Advertisement
Guest User

Untitled

a guest
Nov 28th, 2023
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 77.25 KB | Gaming | 0 0
  1. #include "StdAfx.h"
  2. #include "PythonWindow.h"
  3. #include "PythonSlotWindow.h"
  4. #include "PythonGridSlotWindow.h"
  5. #include "../UserInterface/Locale_inc.h"
  6.  
  7. bool PyTuple_GetWindow(PyObject* poArgs, int pos, UI::CWindow ** ppRetWindow)
  8. {
  9.     int iHandle;
  10.     if (!PyTuple_GetInteger(poArgs, pos, &iHandle))
  11.         return false;
  12.     if (!iHandle)
  13.         return false;
  14.  
  15.     *ppRetWindow = (UI::CWindow*)iHandle;
  16.     return true;
  17. }
  18.  
  19. PyObject * wndMgrGetAspect(PyObject * poSelf, PyObject * poArgs)
  20. {
  21.     return Py_BuildValue("f", UI::CWindowManager::Instance().GetAspect());
  22. }
  23.  
  24. PyObject * wndMgrOnceIgnoreMouseLeftButtonUpEvent(PyObject * poSelf, PyObject * poArgs)
  25. {
  26.     UI::CWindowManager::Instance().OnceIgnoreMouseLeftButtonUpEvent();
  27.     return Py_BuildNone();
  28. }
  29.  
  30. PyObject * wndMgrSetMouseHandler(PyObject * poSelf, PyObject * poArgs)
  31. {
  32.     PyObject * poHandler;
  33.     if (!PyTuple_GetObject(poArgs, 0, &poHandler))
  34.         return Py_BuildException();
  35.  
  36.     UI::CWindowManager::Instance().SetMouseHandler(poHandler);
  37.     return Py_BuildNone();
  38. }
  39.  
  40. /////////////////////////////////////////////////////////////////////////////////////////////////
  41. ///// Register /////
  42. // Window
  43. PyObject * wndMgrRegister(PyObject * poSelf, PyObject * poArgs)
  44. {
  45.     PyObject * po;
  46.     if (!PyTuple_GetObject(poArgs, 0, &po))
  47.         return Py_BuildException();
  48.     char * szLayer;
  49.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  50.         return Py_BuildException();
  51.  
  52.     UI::CWindowManager& kWndMgr=UI::CWindowManager::Instance();
  53.     UI::CWindow * pWindow = kWndMgr.RegisterWindow(po, szLayer);
  54.     if (!pWindow)
  55.         return Py_BuildException();
  56.    
  57.     return Py_BuildValue("i", pWindow);
  58. }
  59.  
  60. // SlotWindow
  61. PyObject * wndMgrRegisterSlotWindow(PyObject * poSelf, PyObject * poArgs)
  62. {
  63.     PyObject * po;
  64.     if (!PyTuple_GetObject(poArgs, 0, &po))
  65.         return Py_BuildException();
  66.     char * szLayer;
  67.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  68.         return Py_BuildException();
  69.  
  70.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterSlotWindow(po, szLayer);
  71.     return Py_BuildValue("i", pWindow);
  72. }
  73.  
  74. // GridSlotWindow
  75. PyObject * wndMgrRegisterGridSlotWindow(PyObject * poSelf, PyObject * poArgs)
  76. {
  77.     PyObject * po;
  78.     if (!PyTuple_GetObject(poArgs, 0, &po))
  79.         return Py_BuildException();
  80.     char * szLayer;
  81.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  82.         return Py_BuildException();
  83.  
  84.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterGridSlotWindow(po, szLayer);
  85.     return Py_BuildValue("i", pWindow);
  86. }
  87.  
  88. // TextLine
  89. PyObject * wndMgrRegisterTextLine(PyObject * poSelf, PyObject * poArgs)
  90. {
  91.     PyObject * po;
  92.     if (!PyTuple_GetObject(poArgs, 0, &po))
  93.         return Py_BuildException();
  94.     char * szLayer;
  95.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  96.         return Py_BuildException();
  97.  
  98.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterTextLine(po, szLayer);
  99.     return Py_BuildValue("i", pWindow);
  100. }
  101.  
  102. // MarkBox
  103. PyObject * wndMgrRegisterMarkBox(PyObject * poSelf, PyObject * poArgs)
  104. {
  105.     PyObject * po;
  106.     if (!PyTuple_GetObject(poArgs, 0, &po))
  107.         return Py_BuildException();
  108.     char * szLayer;
  109.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  110.         return Py_BuildException();
  111.  
  112.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterMarkBox(po, szLayer);
  113.     return Py_BuildValue("i", pWindow);
  114. }
  115.  
  116. // ImageBox
  117. PyObject * wndMgrRegisterImageBox(PyObject * poSelf, PyObject * poArgs)
  118. {
  119.     PyObject * po;
  120.     if (!PyTuple_GetObject(poArgs, 0, &po))
  121.         return Py_BuildException();
  122.     char * szLayer;
  123.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  124.         return Py_BuildException();
  125.  
  126.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterImageBox(po, szLayer);
  127.     return Py_BuildValue("i", pWindow);
  128. }
  129.  
  130. // ExpandedImageBox
  131. PyObject * wndMgrRegisterExpandedImageBox(PyObject * poSelf, PyObject * poArgs)
  132. {
  133.     PyObject * po;
  134.     if (!PyTuple_GetObject(poArgs, 0, &po))
  135.         return Py_BuildException();
  136.     char * szLayer;
  137.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  138.         return Py_BuildException();
  139.  
  140.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterExpandedImageBox(po, szLayer);
  141.     return Py_BuildValue("i", pWindow);
  142. }
  143.  
  144. // AniImageBox
  145. PyObject * wndMgrRegisterAniImageBox(PyObject * poSelf, PyObject * poArgs)
  146. {
  147.     PyObject * po;
  148.     if (!PyTuple_GetObject(poArgs, 0, &po))
  149.         return Py_BuildException();
  150.     char * szLayer;
  151.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  152.         return Py_BuildException();
  153.  
  154.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterAniImageBox(po, szLayer);
  155.     return Py_BuildValue("i", pWindow);
  156. }
  157.  
  158. // RegisterButton
  159. PyObject * wndMgrRegisterButton(PyObject * poSelf, PyObject * poArgs)
  160. {
  161.     PyObject * po;
  162.     if (!PyTuple_GetObject(poArgs, 0, &po))
  163.         return Py_BuildException();
  164.     char * szLayer;
  165.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  166.         return Py_BuildException();
  167.  
  168.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterButton(po, szLayer);
  169.     return Py_BuildValue("i", pWindow);
  170. }
  171.  
  172. // RadioButton
  173. PyObject * wndMgrRegisterRadioButton(PyObject * poSelf, PyObject * poArgs)
  174. {
  175.     PyObject * po;
  176.     if (!PyTuple_GetObject(poArgs, 0, &po))
  177.         return Py_BuildException();
  178.     char * szLayer;
  179.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  180.         return Py_BuildException();
  181.  
  182.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterRadioButton(po, szLayer);
  183.     return Py_BuildValue("i", pWindow);
  184. }
  185.  
  186. // ToggleButton
  187. PyObject * wndMgrRegisterToggleButton(PyObject * poSelf, PyObject * poArgs)
  188. {
  189.     PyObject * po;
  190.     if (!PyTuple_GetObject(poArgs, 0, &po))
  191.         return Py_BuildException();
  192.     char * szLayer;
  193.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  194.         return Py_BuildException();
  195.  
  196.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterToggleButton(po, szLayer);
  197.     return Py_BuildValue("i", pWindow);
  198. }
  199.  
  200. // DragButton
  201. PyObject * wndMgrRegisterDragButton(PyObject * poSelf, PyObject * poArgs)
  202. {
  203.     PyObject * po;
  204.     if (!PyTuple_GetObject(poArgs, 0, &po))
  205.         return Py_BuildException();
  206.     char * szLayer;
  207.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  208.         return Py_BuildException();
  209.  
  210.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterDragButton(po, szLayer);
  211.     return Py_BuildValue("i", pWindow);
  212. }
  213.  
  214. // Box
  215. PyObject * wndMgrRegisterBox(PyObject * poSelf, PyObject * poArgs)
  216. {
  217.     PyObject * po;
  218.     if (!PyTuple_GetObject(poArgs, 0, &po))
  219.         return Py_BuildException();
  220.     char * szLayer;
  221.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  222.         return Py_BuildException();
  223.  
  224.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterBox(po, szLayer);
  225.     return Py_BuildValue("i", pWindow);
  226. }
  227.  
  228. // Bar
  229. PyObject * wndMgrRegisterBar(PyObject * poSelf, PyObject * poArgs)
  230. {
  231.     PyObject * po;
  232.     if (!PyTuple_GetObject(poArgs, 0, &po))
  233.         return Py_BuildException();
  234.     char * szLayer;
  235.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  236.         return Py_BuildException();
  237.  
  238.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterBar(po, szLayer);
  239.     return Py_BuildValue("i", pWindow);
  240. }
  241.  
  242. // Line
  243. PyObject * wndMgrRegisterLine(PyObject * poSelf, PyObject * poArgs)
  244. {
  245.     PyObject * po;
  246.     if (!PyTuple_GetObject(poArgs, 0, &po))
  247.         return Py_BuildException();
  248.     char * szLayer;
  249.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  250.         return Py_BuildException();
  251.  
  252.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterLine(po, szLayer);
  253.     return Py_BuildValue("i", pWindow);
  254. }
  255.  
  256. // Slot
  257. PyObject * wndMgrRegisterBar3D(PyObject * poSelf, PyObject * poArgs)
  258. {
  259.     PyObject * po;
  260.     if (!PyTuple_GetObject(poArgs, 0, &po))
  261.         return Py_BuildException();
  262.     char * szLayer;
  263.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  264.         return Py_BuildException();
  265.  
  266.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterBar3D(po, szLayer);
  267.     return Py_BuildValue("i", pWindow);
  268. }
  269.  
  270. // NumberLine
  271. PyObject * wndMgrRegisterNumberLine(PyObject * poSelf, PyObject * poArgs)
  272. {
  273.     PyObject * po;
  274.     if (!PyTuple_GetObject(poArgs, 0, &po))
  275.         return Py_BuildException();
  276.     char * szLayer;
  277.     if (!PyTuple_GetString(poArgs, 1, &szLayer))
  278.         return Py_BuildException();
  279.  
  280.     UI::CWindow * pWindow = UI::CWindowManager::Instance().RegisterNumberLine(po, szLayer);
  281.     return Py_BuildValue("i", pWindow);
  282. }
  283. ///// Register /////
  284. /////////////////////////////////////////////////////////////////////////////////////////////////
  285.  
  286. PyObject * wndMgrDestroy(PyObject * poSelf, PyObject * poArgs)
  287. {
  288.     UI::CWindow * pWin;
  289.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  290.         return Py_BuildException();
  291.  
  292.     UI::CWindowManager::Instance().DestroyWindow(pWin);
  293.     return Py_BuildNone();
  294. }
  295.  
  296. PyObject * wndMgrIsFocus(PyObject * poSelf, PyObject * poArgs)
  297. {
  298.     UI::CWindow * pWindow;
  299.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  300.         return Py_BuildException();
  301.  
  302.     return Py_BuildValue("i", pWindow == UI::CWindowManager::Instance().GetActivateWindow());
  303. }
  304.  
  305. PyObject * wndMgrSetFocus(PyObject * poSelf, PyObject * poArgs)
  306. {
  307.     UI::CWindow * pWin;
  308.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  309.         return Py_BuildException();
  310.  
  311.     UI::CWindowManager::Instance().ActivateWindow(pWin);
  312.     return Py_BuildNone();
  313. }
  314.  
  315. PyObject * wndMgrKillFocus(PyObject * poSelf, PyObject * poArgs)
  316. {
  317.     UI::CWindow * pWin;
  318.     if (PyTuple_GetWindow(poArgs, 0, &pWin))
  319.     {
  320.         if (pWin == UI::CWindowManager::Instance().GetActivateWindow())
  321.         {
  322.             UI::CWindowManager::Instance().DeactivateWindow();
  323.         }
  324.     }
  325.     else
  326.     {
  327.         UI::CWindowManager::Instance().DeactivateWindow();
  328.     }
  329.  
  330.     return Py_BuildNone();
  331. }
  332.  
  333. PyObject * wndMgrLock(PyObject * poSelf, PyObject * poArgs)
  334. {
  335.     UI::CWindow * pWin;
  336.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  337.         return Py_BuildException();
  338.  
  339.     UI::CWindowManager::Instance().LockWindow(pWin);
  340.     return Py_BuildNone();
  341. }
  342.  
  343. PyObject * wndMgrUnlock(PyObject * poSelf, PyObject * poArgs)
  344. {
  345.     UI::CWindowManager::Instance().UnlockWindow();
  346.     return Py_BuildNone();
  347. }
  348.  
  349. PyObject * wndMgrSetName(PyObject * poSelf, PyObject * poArgs)
  350. {
  351.     UI::CWindow * pWin;
  352.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  353.         return Py_BuildException();
  354.     char * szName;
  355.     if (!PyTuple_GetString(poArgs, 1, &szName))
  356.         return Py_BuildException();
  357.  
  358.     pWin->SetName(szName);
  359.     return Py_BuildNone();
  360. }
  361.  
  362. PyObject * wndMgrSetTop(PyObject * poSelf, PyObject * poArgs)
  363. {
  364.     UI::CWindow * pWin;
  365.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  366.         return Py_BuildException();
  367.  
  368.     UI::CWindowManager::Instance().SetTop(pWin);
  369.     return Py_BuildNone();
  370. }
  371.  
  372. PyObject * wndMgrShow(PyObject * poSelf, PyObject * poArgs)
  373. {
  374.     UI::CWindow * pWin;
  375.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  376.         return Py_BuildException();
  377.  
  378.     pWin->Show();
  379.     return Py_BuildNone();
  380. }
  381.  
  382. PyObject * wndMgrHide(PyObject * poSelf, PyObject * poArgs)
  383. {
  384.     UI::CWindow * pWin;
  385.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  386.         return Py_BuildException();
  387.  
  388.     pWin->Hide();
  389.     return Py_BuildNone();
  390. }
  391.  
  392. PyObject * wndMgrIsShow(PyObject * poSelf, PyObject * poArgs)
  393. {
  394.     UI::CWindow * pWin;
  395.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  396.         return Py_BuildException();
  397.  
  398.     return Py_BuildValue("i", pWin->IsShow());
  399. }
  400.  
  401. PyObject * wndMgrIsRTL(PyObject * poSelf, PyObject * poArgs)
  402. {
  403.     UI::CWindow * pWin;
  404.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  405.         return Py_BuildException();
  406.  
  407.     return Py_BuildValue("i", pWin->IsFlag(UI::CWindow::FLAG_RTL));
  408. }
  409.  
  410. PyObject * wndMgrSetScreenSize(PyObject * poSelf, PyObject * poArgs)
  411. {
  412.     int width;
  413.     if (!PyTuple_GetInteger(poArgs, 0, &width))
  414.         return Py_BuildException();
  415.     int height;
  416.     if (!PyTuple_GetInteger(poArgs, 1, &height))
  417.         return Py_BuildException();
  418.  
  419.     UI::CWindowManager::Instance().SetScreenSize(width, height);
  420.     return Py_BuildNone();
  421. }
  422.  
  423. PyObject * wndMgrSetParent(PyObject * poSelf, PyObject * poArgs)
  424. {
  425.     UI::CWindow * pWin;
  426.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  427.         return Py_BuildException();
  428.     UI::CWindow * pParentWin;
  429.     if (!PyTuple_GetWindow(poArgs, 1, &pParentWin))
  430.         return Py_BuildException();
  431.  
  432.     UI::CWindowManager::Instance().SetParent(pWin, pParentWin);
  433.     return Py_BuildNone();
  434. }
  435.  
  436. PyObject * wndMgrSetPickAlways(PyObject * poSelf, PyObject * poArgs)
  437. {
  438.     UI::CWindow * pWin;
  439.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  440.         return Py_BuildException();
  441.  
  442.     UI::CWindowManager::Instance().SetPickAlways(pWin);
  443.     return Py_BuildNone();
  444. }
  445.  
  446. PyObject * wndMgrSetWndSize(PyObject * poSelf, PyObject * poArgs)
  447. {
  448.     UI::CWindow * pWin;
  449.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  450.         return Py_BuildException();
  451.     int width;
  452.     if (!PyTuple_GetInteger(poArgs, 1, &width))
  453.         return Py_BuildException();
  454.     int height;
  455.     if (!PyTuple_GetInteger(poArgs, 2, &height))
  456.         return Py_BuildException();
  457.  
  458.     pWin->SetSize(width, height);
  459.     return Py_BuildNone();
  460. }
  461.  
  462. PyObject * wndMgrSetWndPosition(PyObject * poSelf, PyObject * poArgs)
  463. {
  464.     UI::CWindow * pWin;
  465.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  466.         return Py_BuildException();
  467.     int x;
  468.     if (!PyTuple_GetInteger(poArgs, 1, &x))
  469.         return Py_BuildException();
  470.     int y;
  471.     if (!PyTuple_GetInteger(poArgs, 2, &y))
  472.         return Py_BuildException();
  473.  
  474.     pWin->SetPosition(x, y);
  475.     return Py_BuildNone();
  476. }
  477.  
  478. PyObject * wndMgrGetName(PyObject * poSelf, PyObject * poArgs)
  479. {
  480.     UI::CWindow * pWin;
  481.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  482.         return Py_BuildException();
  483.  
  484.     return Py_BuildValue("s", pWin->GetName());
  485. }
  486.  
  487. PyObject * wndMgrGetWndWidth(PyObject * poSelf, PyObject * poArgs)
  488. {
  489.     UI::CWindow * pWin;
  490.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  491.         return Py_BuildException();
  492.  
  493.     return Py_BuildValue("i", pWin->GetWidth());
  494. }
  495.  
  496. PyObject * wndMgrGetWndHeight(PyObject * poSelf, PyObject * poArgs)
  497. {
  498.     UI::CWindow * pWin;
  499.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  500.         return Py_BuildException();
  501.  
  502.     return Py_BuildValue("i", pWin->GetHeight());
  503. }
  504.  
  505. PyObject * wndMgrGetWndLocalPosition(PyObject * poSelf, PyObject * poArgs)
  506. {
  507.     UI::CWindow * pWin;
  508.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  509.         return Py_BuildException();
  510.  
  511.     long lx, ly;
  512.     pWin->GetPosition(&lx, &ly);
  513.  
  514.     return Py_BuildValue("ii", lx, ly);
  515. }
  516.  
  517. PyObject * wndMgrGetWndGlobalPosition(PyObject * poSelf, PyObject * poArgs)
  518. {
  519.     UI::CWindow * pWindow;
  520.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  521.         return Py_BuildException();
  522.  
  523.     RECT & rRect = pWindow->GetRect();
  524.     return Py_BuildValue("ii", rRect.left, rRect.top);
  525. }
  526.  
  527. PyObject * wndMgrGetWindowRect(PyObject * poSelf, PyObject * poArgs)
  528. {
  529.     UI::CWindow * pWin;
  530.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  531.         return Py_BuildException();
  532.  
  533.     RECT & rRect = pWin->GetRect();
  534.     return Py_BuildValue("iiii", rRect.left, rRect.top, rRect.right - rRect.left, rRect.bottom - rRect.top);
  535. }
  536.  
  537. PyObject * wndMgrSetWindowHorizontalAlign(PyObject * poSelf, PyObject * poArgs)
  538. {
  539.     UI::CWindow * pWin;
  540.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  541.         return Py_BuildException();
  542.     int iAlign;
  543.     if (!PyTuple_GetInteger(poArgs, 1, &iAlign))
  544.         return Py_BuildException();
  545.  
  546.     pWin->SetHorizontalAlign(iAlign);
  547.  
  548.     return Py_BuildNone();
  549. }
  550.  
  551. PyObject * wndMgrSetWindowVerticalAlign(PyObject * poSelf, PyObject * poArgs)
  552. {
  553.     UI::CWindow * pWin;
  554.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  555.         return Py_BuildException();
  556.     int iAlign;
  557.     if (!PyTuple_GetInteger(poArgs, 1, &iAlign))
  558.         return Py_BuildException();
  559.  
  560.     pWin->SetVerticalAlign(iAlign);
  561.  
  562.     return Py_BuildNone();
  563. }
  564.  
  565. PyObject * wndMgrIsIn(PyObject * poSelf, PyObject * poArgs)
  566. {
  567.     UI::CWindow * pWin;
  568.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  569.         return Py_BuildException();
  570.  
  571.     return Py_BuildValue("i", pWin == UI::CWindowManager::Instance().GetPointWindow());
  572. }
  573.  
  574. PyObject * wndMgrGetMouseLocalPosition(PyObject * poSelf, PyObject * poArgs)
  575. {
  576.     UI::CWindow * pWin;
  577.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  578.         return Py_BuildException();
  579.  
  580.     long lx, ly;
  581.     pWin->GetMouseLocalPosition(lx, ly);
  582.     return Py_BuildValue("ii", lx, ly);
  583. }
  584.  
  585. PyObject * wndMgrGetHyperlink(PyObject * poSelf, PyObject * poArgs)
  586. {
  587.     char retBuf[1024];
  588.     int retLen = CGraphicTextInstance::Hyperlink_GetText(retBuf, sizeof(retBuf)-1);
  589.     retBuf[retLen] = '\0';
  590.  
  591.     return Py_BuildValue("s#", retBuf, retLen);
  592. }
  593.  
  594. PyObject * wndMgrGetScreenWidth(PyObject * poSelf, PyObject * poArgs)
  595. {
  596.     return Py_BuildValue("i", UI::CWindowManager::Instance().GetScreenWidth());
  597. }
  598.  
  599. PyObject * wndMgrGetScreenHeight(PyObject * poSelf, PyObject * poArgs)
  600. {
  601.     return Py_BuildValue("i", UI::CWindowManager::Instance().GetScreenHeight());
  602. }
  603.  
  604. PyObject * wndMgrGetMousePosition(PyObject * poSelf, PyObject * poArgs)
  605. {
  606.     long lx, ly;
  607.     UI::CWindowManager::Instance().GetMousePosition(lx, ly);
  608.     return Py_BuildValue("ii", lx, ly);
  609. }
  610.  
  611. PyObject * wndMgrIsDragging(PyObject * poSelf, PyObject * poArgs)
  612. {
  613.     return Py_BuildValue("i", UI::CWindowManager::Instance().IsDragging());
  614. }
  615.  
  616. PyObject * wndMgrIsPickedWindow(PyObject * poSelf, PyObject * poArgs)
  617. {
  618.     UI::CWindow * pWin;
  619.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  620.         return Py_BuildException();
  621.  
  622.     UI::CWindow * pPickedWin = UI::CWindowManager::Instance().GetPointWindow();
  623.     return Py_BuildValue("i", pWin == pPickedWin ? 1 : 0);
  624. }
  625.  
  626. PyObject * wndMgrGetChildCount(PyObject * poSelf, PyObject * poArgs)
  627. {
  628.     UI::CWindow * pWin;
  629.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  630.         return Py_BuildException();
  631.  
  632.     return Py_BuildValue("i", pWin->GetChildCount());
  633. }
  634.  
  635. PyObject * wndMgrAddFlag(PyObject * poSelf, PyObject * poArgs)
  636. {
  637.     UI::CWindow * pWin;
  638.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  639.         return Py_BuildException();
  640.  
  641.     char * pszFlag;
  642.     if (!PyTuple_GetString(poArgs, 1, &pszFlag))
  643.         return Py_BuildException();
  644.  
  645.     if (pszFlag && *pszFlag)
  646.     {
  647.         if (!stricmp(pszFlag, "movable"))
  648.             pWin->AddFlag(UI::CWindow::FLAG_MOVABLE);
  649.         else if (!stricmp(pszFlag, "limit"))
  650.             pWin->AddFlag(UI::CWindow::FLAG_LIMIT);
  651.         else if (!stricmp(pszFlag, "dragable"))
  652.             pWin->AddFlag(UI::CWindow::FLAG_DRAGABLE);
  653.         else if (!stricmp(pszFlag, "attach"))
  654.             pWin->AddFlag(UI::CWindow::FLAG_ATTACH);
  655.         else if (!stricmp(pszFlag, "restrict_x"))
  656.             pWin->AddFlag(UI::CWindow::FLAG_RESTRICT_X);
  657.         else if (!stricmp(pszFlag, "restrict_y"))
  658.             pWin->AddFlag(UI::CWindow::FLAG_RESTRICT_Y);
  659.         else if (!stricmp(pszFlag, "float"))
  660.             pWin->AddFlag(UI::CWindow::FLAG_FLOAT);
  661.         else if (!stricmp(pszFlag, "not_pick"))
  662.             pWin->AddFlag(UI::CWindow::FLAG_NOT_PICK);
  663.         else if (!stricmp(pszFlag, "ignore_size"))
  664.             pWin->AddFlag(UI::CWindow::FLAG_IGNORE_SIZE);
  665.         else if (!stricmp(pszFlag, "rtl"))
  666.             pWin->AddFlag(UI::CWindow::FLAG_RTL);
  667.         else if (!stricmp(pszFlag, "ltr"))
  668.             pWin->RemoveFlag(UI::CWindow::FLAG_RTL);
  669.         else
  670.             TraceError("Unknown window flag %s", pszFlag);
  671.     }
  672.  
  673.     return Py_BuildNone();
  674. }
  675.  
  676. PyObject * wndMgrSetLimitBias(PyObject * poSelf, PyObject * poArgs)
  677. {
  678.     UI::CWindow * pWin;
  679.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  680.         return Py_BuildException();
  681.  
  682.     int l;
  683.     if (!PyTuple_GetInteger(poArgs, 1, &l))
  684.         return Py_BuildException();
  685.     int r;
  686.     if (!PyTuple_GetInteger(poArgs, 2, &r))
  687.         return Py_BuildException();
  688.     int t;
  689.     if (!PyTuple_GetInteger(poArgs, 3, &t))
  690.         return Py_BuildException();
  691.     int b;
  692.     if (!PyTuple_GetInteger(poArgs, 4, &b))
  693.         return Py_BuildException();
  694.  
  695.     pWin->SetLimitBias(l, r, t, b);
  696.     return Py_BuildNone();
  697. }
  698.  
  699. PyObject * wndMgrUpdateRect(PyObject * poSelf, PyObject * poArgs)
  700. {
  701.     UI::CWindow * pWin;
  702.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  703.         return Py_BuildException();
  704.  
  705.     pWin->UpdateRect();
  706.     return Py_BuildNone();
  707. }
  708.  
  709. PyObject * wndMgrAppendSlot(PyObject * poSelf, PyObject * poArgs)
  710. {
  711.     UI::CWindow * pWin;
  712.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  713.         return Py_BuildException();
  714.  
  715.     int iIndex;
  716.     if (!PyTuple_GetInteger(poArgs, 1, &iIndex))
  717.         return Py_BuildException();
  718.  
  719.     int ixPosition;
  720.     if (!PyTuple_GetInteger(poArgs, 2, &ixPosition))
  721.         return Py_BuildException();
  722.  
  723.     int iyPosition;
  724.     if (!PyTuple_GetInteger(poArgs, 3, &iyPosition))
  725.         return Py_BuildException();
  726.  
  727.     int ixCellSize;
  728.     if (!PyTuple_GetInteger(poArgs, 4, &ixCellSize))
  729.         return Py_BuildException();
  730.  
  731.     int iyCellSize;
  732.     if (!PyTuple_GetInteger(poArgs, 5, &iyCellSize))
  733.         return Py_BuildException();
  734.  
  735.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  736.         return Py_BuildException();
  737.  
  738.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  739.     pSlotWin->AppendSlot(iIndex, ixPosition, iyPosition, ixCellSize, iyCellSize);
  740.  
  741.     return Py_BuildNone();
  742. }
  743.  
  744. PyObject * wndMgrArrangeSlot(PyObject * poSelf, PyObject * poArgs)
  745. {
  746.     UI::CWindow * pWin;
  747.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  748.         return Py_BuildException();
  749.  
  750.     int iStartIndex;
  751.     if (!PyTuple_GetInteger(poArgs, 1, &iStartIndex))
  752.         return Py_BuildException();
  753.  
  754.     int ixCellCount;
  755.     if (!PyTuple_GetInteger(poArgs, 2, &ixCellCount))
  756.         return Py_BuildException();
  757.  
  758.     int iyCellCount;
  759.     if (!PyTuple_GetInteger(poArgs, 3, &iyCellCount))
  760.         return Py_BuildException();
  761.  
  762.     int ixCellSize;
  763.     if (!PyTuple_GetInteger(poArgs, 4, &ixCellSize))
  764.         return Py_BuildException();
  765.  
  766.     int iyCellSize;
  767.     if (!PyTuple_GetInteger(poArgs, 5, &iyCellSize))
  768.         return Py_BuildException();
  769.  
  770.     int ixBlank;
  771.     if (!PyTuple_GetInteger(poArgs, 6, &ixBlank))
  772.         return Py_BuildException();
  773.  
  774.     int iyBlank;
  775.     if (!PyTuple_GetInteger(poArgs, 7, &iyBlank))
  776.         return Py_BuildException();
  777.  
  778.     if (!pWin->IsType(UI::CGridSlotWindow::Type()))
  779.     {
  780.         TraceError("wndMgr.ArrangeSlot : not a grid window");
  781.         return Py_BuildException();
  782.     }
  783.  
  784.     UI::CGridSlotWindow * pGridSlotWin = (UI::CGridSlotWindow *)pWin;
  785.     pGridSlotWin->ArrangeGridSlot(iStartIndex, ixCellCount, iyCellCount, ixCellSize, iyCellSize, ixBlank, iyBlank);
  786.  
  787.     return Py_BuildNone();
  788. }
  789.  
  790. PyObject * wndMgrSetSlotBaseImage(PyObject * poSelf, PyObject * poArgs)
  791. {
  792.     UI::CWindow * pWin;
  793.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  794.         return Py_BuildException();
  795.  
  796.     char * szFileName;
  797.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  798.         return Py_BuildException();
  799.  
  800.     float fr;
  801.     if (!PyTuple_GetFloat(poArgs, 2, &fr))
  802.         return Py_BuildException();
  803.     float fg;
  804.     if (!PyTuple_GetFloat(poArgs, 3, &fg))
  805.         return Py_BuildException();
  806.     float fb;
  807.     if (!PyTuple_GetFloat(poArgs, 4, &fb))
  808.         return Py_BuildException();
  809.     float fa;
  810.     if (!PyTuple_GetFloat(poArgs, 5, &fa))
  811.         return Py_BuildException();
  812.  
  813.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  814.     {
  815.         TraceError("wndMgr.ArrangeSlot : not a slot window");
  816.         return Py_BuildException();
  817.     }
  818.  
  819.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  820.     pSlotWin->SetSlotBaseImage(szFileName, fr, fg, fb, fa);
  821.  
  822.     return Py_BuildNone();
  823. }
  824.  
  825. PyObject * wndMgrSetCoverButton(PyObject * poSelf, PyObject * poArgs)
  826. {
  827.     UI::CWindow * pWindow;
  828.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  829.         return Py_BuildException();
  830.  
  831.     int iSlotIndex;
  832.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  833.         return Py_BuildException();
  834.  
  835.     char * szUpImageName;
  836.     if (!PyTuple_GetString(poArgs, 2, &szUpImageName))
  837.         return Py_BuildException();
  838.     char * szOverImageName;
  839.     if (!PyTuple_GetString(poArgs, 3, &szOverImageName))
  840.         return Py_BuildException();
  841.     char * szDownImageName;
  842.     if (!PyTuple_GetString(poArgs, 4, &szDownImageName))
  843.         return Py_BuildException();
  844.     char * szDisableImageName;
  845.     if (!PyTuple_GetString(poArgs, 5, &szDisableImageName))
  846.         return Py_BuildException();
  847.  
  848.     int iLeftButtonEnable;
  849.     if (!PyTuple_GetInteger(poArgs, 6, &iLeftButtonEnable))
  850.         return Py_BuildException();
  851.     int iRightButtonEnable;
  852.     if (!PyTuple_GetInteger(poArgs, 7, &iRightButtonEnable))
  853.         return Py_BuildException();
  854.  
  855.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  856.     pSlotWin->SetCoverButton(iSlotIndex, szUpImageName, szOverImageName, szDownImageName, szDisableImageName, iLeftButtonEnable, iRightButtonEnable);
  857.  
  858.     return Py_BuildNone();
  859. }
  860.  
  861. PyObject * wndMgrEnableCoverButton(PyObject * poSelf, PyObject * poArgs)
  862. {
  863.     UI::CWindow * pWindow;
  864.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  865.         return Py_BuildException();
  866.  
  867.     int iSlotIndex;
  868.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  869.         return Py_BuildException();
  870.  
  871.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  872.     pSlotWin->EnableCoverButton(iSlotIndex);
  873.  
  874.     return Py_BuildNone();
  875. }
  876.  
  877. PyObject * wndMgrDisableCoverButton(PyObject * poSelf, PyObject * poArgs)
  878. {
  879.     UI::CWindow * pWindow;
  880.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  881.         return Py_BuildException();
  882.  
  883.     int iSlotIndex;
  884.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  885.         return Py_BuildException();
  886.  
  887.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  888.     pSlotWin->DisableCoverButton(iSlotIndex);
  889.  
  890.     return Py_BuildNone();
  891. }
  892.  
  893. PyObject * wndMgrIsDisableCoverButton(PyObject * poSelf, PyObject * poArgs)
  894. {
  895.     UI::CWindow * pWindow;
  896.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  897.         return Py_BuildException();
  898.  
  899.     int iSlotIndex;
  900.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  901.         return Py_BuildException();
  902.  
  903.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  904.     return Py_BuildValue("i", pSlotWin->IsDisableCoverButton(iSlotIndex));
  905. }
  906.  
  907. PyObject * wndMgrSetAlwaysRenderCoverButton(PyObject * poSelf, PyObject * poArgs)
  908. {
  909.     UI::CWindow * pWindow;
  910.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  911.         return Py_BuildException();
  912.  
  913.     int iSlotIndex;
  914.     bool bAlwaysRender = false;
  915.  
  916.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  917.         return Py_BuildException();
  918.  
  919.     if (!PyTuple_GetBoolean(poArgs, 2, &bAlwaysRender))
  920.         return Py_BuildException();
  921.  
  922.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  923.     pSlotWin->SetAlwaysRenderCoverButton(iSlotIndex, bAlwaysRender);
  924.  
  925.     return Py_BuildNone();
  926. }
  927.  
  928. PyObject * wndMgrAppendSlotButton(PyObject * poSelf, PyObject * poArgs)
  929. {
  930.     UI::CWindow * pWindow;
  931.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  932.         return Py_BuildException();
  933.  
  934.     char * szUpImageName;
  935.     if (!PyTuple_GetString(poArgs, 1, &szUpImageName))
  936.         return Py_BuildException();
  937.     char * szOverImageName;
  938.     if (!PyTuple_GetString(poArgs, 2, &szOverImageName))
  939.         return Py_BuildException();
  940.     char * szDownImageName;
  941.     if (!PyTuple_GetString(poArgs, 3, &szDownImageName))
  942.         return Py_BuildException();
  943.  
  944.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  945.     pSlotWin->AppendSlotButton(szUpImageName, szOverImageName, szDownImageName);
  946.  
  947.     return Py_BuildNone();
  948. }
  949.  
  950. PyObject * wndMgrAppendRequirementSignImage(PyObject * poSelf, PyObject * poArgs)
  951. {
  952.     UI::CWindow * pWindow;
  953.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  954.         return Py_BuildException();
  955.  
  956.     char * szImageName;
  957.     if (!PyTuple_GetString(poArgs, 1, &szImageName))
  958.         return Py_BuildException();
  959.  
  960.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  961.     pSlotWin->AppendRequirementSignImage(szImageName);
  962.  
  963.     return Py_BuildNone();
  964. }
  965.  
  966. PyObject * wndMgrShowSlotButton(PyObject * poSelf, PyObject * poArgs)
  967. {
  968.     UI::CWindow * pWindow;
  969.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  970.         return Py_BuildException();
  971.  
  972.     int iSlotNumber;
  973.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotNumber))
  974.         return Py_BuildException();
  975.  
  976.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  977.     pSlotWin->ShowSlotButton(iSlotNumber);
  978.  
  979.     return Py_BuildNone();
  980. }
  981.  
  982. PyObject * wndMgrHideAllSlotButton(PyObject * poSelf, PyObject * poArgs)
  983. {
  984.     UI::CWindow * pWindow;
  985.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  986.         return Py_BuildException();
  987.  
  988.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  989.     pSlotWin->HideAllSlotButton();
  990.  
  991.     return Py_BuildNone();
  992. }
  993.  
  994. PyObject * wndMgrShowRequirementSign(PyObject * poSelf, PyObject * poArgs)
  995. {
  996.     UI::CWindow * pWindow;
  997.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  998.         return Py_BuildException();
  999.  
  1000.     int iSlotNumber;
  1001.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotNumber))
  1002.         return Py_BuildException();
  1003.  
  1004.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  1005.     pSlotWin->ShowRequirementSign(iSlotNumber);
  1006.  
  1007.     return Py_BuildNone();
  1008. }
  1009.  
  1010. PyObject * wndMgrHideRequirementSign(PyObject * poSelf, PyObject * poArgs)
  1011. {
  1012.     UI::CWindow * pWindow;
  1013.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1014.         return Py_BuildException();
  1015.  
  1016.     int iSlotNumber;
  1017.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotNumber))
  1018.         return Py_BuildException();
  1019.  
  1020.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWindow;
  1021.     pSlotWin->HideRequirementSign(iSlotNumber);
  1022.  
  1023.     return Py_BuildNone();
  1024. }
  1025.  
  1026. PyObject * wndMgrRefreshSlot(PyObject * poSelf, PyObject * poArgs)
  1027. {
  1028.     UI::CWindow * pWin;
  1029.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1030.         return Py_BuildException();
  1031.  
  1032.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1033.         return Py_BuildException();
  1034.  
  1035.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1036.     pSlotWin->RefreshSlot();
  1037.  
  1038.     return Py_BuildNone();
  1039. }
  1040.  
  1041. PyObject * wndMgrSetUseMode(PyObject * poSelf, PyObject * poArgs)
  1042. {
  1043.     UI::CWindow * pWin;
  1044.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1045.         return Py_BuildException();
  1046.     int iFlag;
  1047.     if (!PyTuple_GetInteger(poArgs, 1, &iFlag))
  1048.         return Py_BuildException();
  1049.  
  1050.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1051.         return Py_BuildException();
  1052.  
  1053.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1054.     pSlotWin->SetUseMode(iFlag);
  1055.  
  1056.     return Py_BuildNone();
  1057. }
  1058.  
  1059. PyObject * wndMgrSetUsableItem(PyObject * poSelf, PyObject * poArgs)
  1060. {
  1061.     UI::CWindow * pWin;
  1062.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1063.         return Py_BuildException();
  1064.     int iFlag;
  1065.     if (!PyTuple_GetInteger(poArgs, 1, &iFlag))
  1066.         return Py_BuildException();
  1067.  
  1068.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1069.         return Py_BuildException();
  1070.  
  1071.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1072.     pSlotWin->SetUsableItem(iFlag);
  1073.  
  1074.     return Py_BuildNone();
  1075. }
  1076.  
  1077. PyObject * wndMgrClearSlot(PyObject * poSelf, PyObject * poArgs)
  1078. {
  1079.     UI::CWindow * pWin;
  1080.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1081.         return Py_BuildException();
  1082.  
  1083.     int iSlotIndex;
  1084.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1085.         return Py_BuildException();
  1086.  
  1087.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1088.         return Py_BuildException();
  1089.  
  1090.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1091.     pSlotWin->ClearSlot(iSlotIndex);
  1092.  
  1093.     return Py_BuildNone();
  1094. }
  1095.  
  1096. PyObject * wndMgrClearAllSlot(PyObject * poSelf, PyObject * poArgs)
  1097. {
  1098.     UI::CWindow * pWin;
  1099.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1100.         return Py_BuildException();
  1101.  
  1102.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1103.         return Py_BuildException();
  1104.  
  1105.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1106.     pSlotWin->ClearAllSlot();
  1107.  
  1108.     return Py_BuildNone();
  1109. }
  1110.  
  1111. PyObject * wndMgrHasSlot(PyObject * poSelf, PyObject * poArgs)
  1112. {
  1113.     UI::CWindow * pWin;
  1114.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1115.         return Py_BuildException();
  1116.  
  1117.     int iSlotIndex;
  1118.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1119.         return Py_BuildException();
  1120.  
  1121.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1122.         return Py_BuildException();
  1123.  
  1124.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1125.  
  1126.     return Py_BuildValue("i", pSlotWin->HasSlot(iSlotIndex));
  1127. }
  1128.  
  1129. PyObject * wndMgrSetSlot(PyObject * poSelf, PyObject * poArgs)
  1130. {
  1131.     UI::CWindow * pWin;
  1132.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1133.         return Py_BuildException();
  1134.  
  1135.     int iSlotIndex;
  1136.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1137.         return Py_BuildException();
  1138.  
  1139.     int iItemIndex;
  1140.     if (!PyTuple_GetInteger(poArgs, 2, &iItemIndex))
  1141.         return Py_BuildException();
  1142.  
  1143.     int iWidth;
  1144.     if (!PyTuple_GetInteger(poArgs, 3, &iWidth))
  1145.         return Py_BuildException();
  1146.  
  1147.     int iHeight;
  1148.     if (!PyTuple_GetInteger(poArgs, 4, &iHeight))
  1149.         return Py_BuildException();
  1150.  
  1151.     int iImageHandle;
  1152.     if (!PyTuple_GetInteger(poArgs, 5, &iImageHandle))
  1153.         return Py_BuildException();
  1154.  
  1155.     D3DXCOLOR diffuseColor;
  1156.     PyObject* pTuple;
  1157.     if (!PyTuple_GetObject(poArgs, 6, &pTuple))
  1158.     {
  1159.         diffuseColor = D3DXCOLOR(1.0, 1.0, 1.0, 1.0);
  1160.         //return Py_BuildException();
  1161.     }
  1162.     else
  1163.     // get diffuse color from pTuple
  1164.     {
  1165.         if (PyTuple_Size(pTuple) != 4)
  1166.             return Py_BuildException();
  1167.         if (!PyTuple_GetFloat(pTuple, 0, &diffuseColor.r))
  1168.             return Py_BuildException();
  1169.         if (!PyTuple_GetFloat(pTuple, 1, &diffuseColor.g))
  1170.             return Py_BuildException();
  1171.         if (!PyTuple_GetFloat(pTuple, 2, &diffuseColor.b))
  1172.             return Py_BuildException();
  1173.         if (!PyTuple_GetFloat(pTuple, 3, &diffuseColor.a))
  1174.             return Py_BuildException();
  1175.     }
  1176.  
  1177.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1178.         return Py_BuildException();
  1179.  
  1180.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1181.     pSlotWin->SetSlot(iSlotIndex, iItemIndex, iWidth, iHeight, (CGraphicImage *)iImageHandle, diffuseColor);
  1182.  
  1183.     return Py_BuildNone();
  1184. }
  1185.  
  1186. PyObject * wndMgrSetSlotCount(PyObject * poSelf, PyObject * poArgs)
  1187. {
  1188.     UI::CWindow * pWin;
  1189.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1190.         return Py_BuildException();
  1191.  
  1192.     int iSlotIndex;
  1193.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1194.         return Py_BuildException();
  1195.  
  1196.     int iCount;
  1197.     if (!PyTuple_GetInteger(poArgs, 2, &iCount))
  1198.         return Py_BuildException();
  1199.  
  1200.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1201.         return Py_BuildException();
  1202.  
  1203.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1204.     pSlotWin->SetSlotCount(iSlotIndex, iCount);
  1205.  
  1206.     return Py_BuildNone();
  1207. }
  1208.  
  1209. PyObject * wndMgrSetSlotCountNew(PyObject * poSelf, PyObject * poArgs)
  1210. {
  1211.     UI::CWindow * pWin;
  1212.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1213.         return Py_BuildException();
  1214.  
  1215.     int iSlotIndex;
  1216.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1217.         return Py_BuildException();
  1218.  
  1219.     int iGrade;
  1220.     if (!PyTuple_GetInteger(poArgs, 2, &iGrade))
  1221.         return Py_BuildException();
  1222.  
  1223.     int iCount;
  1224.     if (!PyTuple_GetInteger(poArgs, 3, &iCount))
  1225.         return Py_BuildException();
  1226.  
  1227.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1228.         return Py_BuildException();
  1229.  
  1230.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1231.     pSlotWin->SetSlotCountNew(iSlotIndex, iGrade, iCount);
  1232.  
  1233.     return Py_BuildNone();
  1234. }
  1235.  
  1236. PyObject * wndMgrSetSlotCoolTime(PyObject * poSelf, PyObject * poArgs)
  1237. {
  1238.     UI::CWindow * pWin;
  1239.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1240.         return Py_BuildException();
  1241.  
  1242.     int iSlotIndex;
  1243.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1244.         return Py_BuildException();
  1245.  
  1246.     float fCoolTime;
  1247.     if (!PyTuple_GetFloat(poArgs, 2, &fCoolTime))
  1248.         return Py_BuildException();
  1249.  
  1250.     float fElapsedTime = 0.0f;
  1251.     PyTuple_GetFloat(poArgs, 3, &fElapsedTime);
  1252.  
  1253.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1254.         return Py_BuildException();
  1255.  
  1256.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1257.     pSlotWin->SetSlotCoolTime(iSlotIndex, fCoolTime, fElapsedTime);
  1258.  
  1259.     return Py_BuildNone();
  1260. }
  1261.  
  1262. PyObject* wndMgrStoreSlotCoolTime(PyObject* poSelf, PyObject* poArgs)
  1263. {
  1264.     UI::CWindow* pWin;
  1265.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1266.         return Py_BuildException();
  1267.  
  1268.     int iKey;
  1269.     if (!PyTuple_GetInteger(poArgs, 1, &iKey))
  1270.         return Py_BuildException();
  1271.  
  1272.     int iSlotIndex;
  1273.     if (!PyTuple_GetInteger(poArgs, 2, &iSlotIndex))
  1274.         return Py_BuildException();
  1275.  
  1276.     float fCoolTime;
  1277.     if (!PyTuple_GetFloat(poArgs, 3, &fCoolTime))
  1278.         return Py_BuildException();
  1279.  
  1280.     float fElapsedTime = 0.0f;
  1281.     PyTuple_GetFloat(poArgs, 4, &fElapsedTime);
  1282.  
  1283.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1284.         return Py_BuildException();
  1285.  
  1286.     UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWin;
  1287.     pSlotWin->StoreSlotCoolTime(iKey, iSlotIndex, fCoolTime, fElapsedTime);
  1288.  
  1289.     return Py_BuildNone();
  1290. }
  1291.  
  1292. PyObject* wndMgrRestoreSlotCoolTime(PyObject* poSelf, PyObject* poArgs)
  1293. {
  1294.     UI::CWindow* pWin;
  1295.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1296.         return Py_BuildException();
  1297.  
  1298.     int iKey;
  1299.     if (!PyTuple_GetInteger(poArgs, 1, &iKey))
  1300.         return Py_BuildException();
  1301.  
  1302.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1303.         return Py_BuildException();
  1304.  
  1305.     UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWin;
  1306.     pSlotWin->RestoreSlotCoolTime(iKey);
  1307.  
  1308.     return Py_BuildNone();
  1309. }
  1310.  
  1311. PyObject * wndMgrSetToggleSlot(PyObject * poSelf, PyObject * poArgs)
  1312. {
  1313.     assert(!"wndMgrSetToggleSlot - »ηΏλΗΟΑφ ΎΚ΄Β ΗΤΌφ");
  1314.     return Py_BuildNone();
  1315. }
  1316.  
  1317. PyObject * wndMgrActivateSlot(PyObject * poSelf, PyObject * poArgs)
  1318. {
  1319.     UI::CWindow * pWin;
  1320.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1321.         return Py_BuildException();
  1322.  
  1323.     int iSlotIndex;
  1324.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1325.         return Py_BuildException();
  1326.  
  1327.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1328.         return Py_BuildException();
  1329.  
  1330.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1331.     pSlotWin->ActivateSlot(iSlotIndex);
  1332.     return Py_BuildNone();
  1333. }
  1334.  
  1335. PyObject * wndMgrDeactivateSlot(PyObject * poSelf, PyObject * poArgs)
  1336. {
  1337.     UI::CWindow * pWin;
  1338.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1339.         return Py_BuildException();
  1340.  
  1341.     int iSlotIndex;
  1342.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1343.         return Py_BuildException();
  1344.  
  1345.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1346.         return Py_BuildException();
  1347.  
  1348.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1349.     pSlotWin->DeactivateSlot(iSlotIndex);
  1350.     return Py_BuildNone();
  1351. }
  1352.  
  1353. PyObject * wndMgrEnableSlot(PyObject * poSelf, PyObject * poArgs)
  1354. {
  1355.     UI::CWindow * pWin;
  1356.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1357.         return Py_BuildException();
  1358.  
  1359.     int iSlotIndex;
  1360.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1361.         return Py_BuildException();
  1362.  
  1363.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1364.         return Py_BuildException();
  1365.  
  1366.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1367.     pSlotWin->EnableSlot(iSlotIndex);
  1368.     return Py_BuildNone();
  1369. }
  1370.  
  1371. PyObject * wndMgrDisableSlot(PyObject * poSelf, PyObject * poArgs)
  1372. {
  1373.     UI::CWindow * pWin;
  1374.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1375.         return Py_BuildException();
  1376.  
  1377.     int iSlotIndex;
  1378.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1379.         return Py_BuildException();
  1380.  
  1381.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1382.         return Py_BuildException();
  1383.  
  1384.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1385.     pSlotWin->DisableSlot(iSlotIndex);
  1386.     return Py_BuildNone();
  1387. }
  1388.  
  1389. PyObject * wndMgrShowSlotBaseImage(PyObject * poSelf, PyObject * poArgs)
  1390. {
  1391.     UI::CWindow * pWin;
  1392.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1393.         return Py_BuildException();
  1394.  
  1395.     int iSlotIndex;
  1396.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1397.         return Py_BuildException();
  1398.  
  1399.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1400.         return Py_BuildException();
  1401.  
  1402.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1403.     pSlotWin->ShowSlotBaseImage(iSlotIndex);
  1404.     return Py_BuildNone();
  1405. }
  1406.  
  1407. PyObject * wndMgrHideSlotBaseImage(PyObject * poSelf, PyObject * poArgs)
  1408. {
  1409.     UI::CWindow * pWin;
  1410.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1411.         return Py_BuildException();
  1412.  
  1413.     int iSlotIndex;
  1414.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1415.         return Py_BuildException();
  1416.  
  1417.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1418.         return Py_BuildException();
  1419.  
  1420.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1421.     pSlotWin->HideSlotBaseImage(iSlotIndex);
  1422.     return Py_BuildNone();
  1423. }
  1424.  
  1425. PyObject * wndMgrSetSlotType(PyObject * poSelf, PyObject * poArgs)
  1426. {
  1427.     UI::CWindow * pWin;
  1428.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1429.         return Py_BuildException();
  1430.  
  1431.     int iType;
  1432.     if (!PyTuple_GetInteger(poArgs, 1, &iType))
  1433.         return Py_BuildException();
  1434.  
  1435.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1436.         return Py_BuildException();
  1437.  
  1438.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1439.     pSlotWin->SetSlotType(iType);
  1440.  
  1441.     return Py_BuildNone();
  1442. }
  1443.  
  1444. PyObject * wndMgrSetSlotStyle(PyObject * poSelf, PyObject * poArgs)
  1445. {
  1446.     UI::CWindow * pWin;
  1447.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1448.         return Py_BuildException();
  1449.  
  1450.     int iStyle;
  1451.     if (!PyTuple_GetInteger(poArgs, 1, &iStyle))
  1452.         return Py_BuildException();
  1453.  
  1454.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1455.         return Py_BuildException();
  1456.  
  1457.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1458.     pSlotWin->SetSlotStyle(iStyle);
  1459.  
  1460.     return Py_BuildNone();
  1461. }
  1462.  
  1463. PyObject * wndMgrSelectSlot(PyObject * poSelf, PyObject * poArgs)
  1464. {
  1465.     UI::CWindow * pWin;
  1466.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1467.         return Py_BuildException();
  1468.  
  1469.     int iIndex;
  1470.     if (!PyTuple_GetInteger(poArgs, 1, &iIndex))
  1471.         return Py_BuildException();
  1472.  
  1473.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1474.         return Py_BuildException();
  1475.  
  1476.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1477.     pSlotWin->SelectSlot(iIndex);
  1478.  
  1479.     return Py_BuildNone();
  1480. }
  1481.  
  1482. PyObject * wndMgrClearSelected(PyObject * poSelf, PyObject * poArgs)
  1483. {
  1484.     UI::CWindow * pWin;
  1485.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1486.         return Py_BuildException();
  1487.  
  1488.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1489.         return Py_BuildException();
  1490.  
  1491.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1492.     pSlotWin->ClearSelected();
  1493.  
  1494.     return Py_BuildNone();
  1495. }
  1496.  
  1497. PyObject * wndMgrGetSelectedSlotCount(PyObject * poSelf, PyObject * poArgs)
  1498. {
  1499.     UI::CWindow * pWin;
  1500.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1501.         return Py_BuildException();
  1502.  
  1503.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1504.         return Py_BuildException();
  1505.  
  1506.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1507.     return Py_BuildValue("i", pSlotWin->GetSelectedSlotCount());
  1508. }
  1509.  
  1510. PyObject * wndMgrGetSelectedSlotNumber(PyObject * poSelf, PyObject * poArgs)
  1511. {
  1512.     UI::CWindow * pWin;
  1513.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1514.         return Py_BuildException();
  1515.     int iSlotNumber;
  1516.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotNumber))
  1517.         return Py_BuildException();
  1518.  
  1519.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1520.         return Py_BuildException();
  1521.  
  1522.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1523.     return Py_BuildValue("i", pSlotWin->GetSelectedSlotNumber(iSlotNumber));
  1524. }
  1525.  
  1526. PyObject * wndMgrIsSelectedSlot(PyObject * poSelf, PyObject * poArgs)
  1527. {
  1528.     UI::CWindow * pWin;
  1529.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1530.         return Py_BuildException();
  1531.     int iSlotNumber;
  1532.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotNumber))
  1533.         return Py_BuildException();
  1534.  
  1535.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1536.         return Py_BuildException();
  1537.  
  1538.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1539.     return Py_BuildValue("i", pSlotWin->isSelectedSlot(iSlotNumber));
  1540. }
  1541.  
  1542. PyObject * wndMgrGetSlotCount(PyObject * poSelf, PyObject * poArgs)
  1543. {
  1544.     UI::CWindow * pWin;
  1545.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1546.         return Py_BuildException();
  1547.  
  1548.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1549.         return Py_BuildException();
  1550.  
  1551.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1552.     return Py_BuildValue("i", pSlotWin->GetSlotCount());
  1553. }
  1554.  
  1555. PyObject * wndMgrLockSlot(PyObject * poSelf, PyObject * poArgs)
  1556. {
  1557.     UI::CWindow * pWin;
  1558.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1559.         return Py_BuildException();
  1560.     int iSlotIndex;
  1561.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1562.         return Py_BuildException();
  1563.  
  1564.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1565.         return Py_BuildException();
  1566.  
  1567.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1568.     pSlotWin->LockSlot(iSlotIndex);
  1569.     return Py_BuildNone();
  1570. }
  1571.  
  1572. PyObject * wndMgrUnlockSlot(PyObject * poSelf, PyObject * poArgs)
  1573. {
  1574.     UI::CWindow * pWin;
  1575.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  1576.         return Py_BuildException();
  1577.     int iSlotIndex;
  1578.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  1579.         return Py_BuildException();
  1580.  
  1581.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  1582.         return Py_BuildException();
  1583.  
  1584.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  1585.     pSlotWin->UnlockSlot(iSlotIndex);
  1586.     return Py_BuildNone();
  1587. }
  1588.  
  1589. PyObject * wndBarSetColor(PyObject * poSelf, PyObject * poArgs)
  1590. {
  1591.     UI::CWindow * pWindow;
  1592.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1593.         return Py_BuildException();
  1594.     int iColor;
  1595.     if (!PyTuple_GetInteger(poArgs, 1, &iColor))
  1596.         return Py_BuildException();
  1597.  
  1598.     if (pWindow->IsType(UI::CBar3D::Type()))
  1599.     {
  1600.         int iLeftColor = iColor;
  1601.  
  1602.         int iRightColor;
  1603.         if (!PyTuple_GetInteger(poArgs, 2, &iRightColor))
  1604.             return Py_BuildException();
  1605.         int iCenterColor;
  1606.         if (!PyTuple_GetInteger(poArgs, 3, &iCenterColor))
  1607.             return Py_BuildException();
  1608.  
  1609.         ((UI::CBar3D *)pWindow)->SetColor(iLeftColor, iRightColor, iCenterColor);
  1610.     }
  1611.     else
  1612.     {
  1613.         ((UI::CWindow *)pWindow)->SetColor(iColor);
  1614.     }
  1615.     return Py_BuildNone();
  1616. }
  1617.  
  1618. PyObject * wndMgrAttachIcon(PyObject * poSelf, PyObject * poArgs)
  1619. {
  1620.     int iType;
  1621.     if (!PyTuple_GetInteger(poArgs, 0, &iType))
  1622.         return Py_BuildException();
  1623.     int iIndex;
  1624.     if (!PyTuple_GetInteger(poArgs, 1, &iIndex))
  1625.         return Py_BuildException();
  1626.     int iSlotNumber;
  1627.     if (!PyTuple_GetInteger(poArgs, 2, &iSlotNumber))
  1628.         return Py_BuildException();
  1629.     int iWidth;
  1630.     if (!PyTuple_GetInteger(poArgs, 3, &iWidth))
  1631.         return Py_BuildException();
  1632.     int iHeight;
  1633.     if (!PyTuple_GetInteger(poArgs, 4, &iHeight))
  1634.         return Py_BuildException();
  1635.  
  1636.     UI::CWindowManager::Instance().AttachIcon(iType, iIndex, iSlotNumber, iWidth, iHeight);
  1637.     return Py_BuildNone();
  1638. }
  1639.  
  1640. PyObject * wndMgrDeattachIcon(PyObject * poSelf, PyObject * poArgs)
  1641. {
  1642.     UI::CWindowManager::Instance().DeattachIcon();
  1643.     return Py_BuildNone();
  1644. }
  1645.  
  1646. PyObject * wndMgrSetAttachingFlag(PyObject * poSelf, PyObject * poArgs)
  1647. {
  1648.     BOOL bFlag;
  1649.     if (!PyTuple_GetInteger(poArgs, 0, &bFlag))
  1650.         return Py_BuildException();
  1651.  
  1652.     UI::CWindowManager::Instance().SetAttachingFlag(bFlag);
  1653.     return Py_BuildNone();
  1654. }
  1655.  
  1656. // Text
  1657. PyObject * wndTextSetMax(PyObject * poSelf, PyObject * poArgs)
  1658. {
  1659.     UI::CWindow * pWindow;
  1660.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1661.         return Py_BuildException();
  1662.     int iMax;
  1663.     if (!PyTuple_GetInteger(poArgs, 1, &iMax))
  1664.         return Py_BuildException();
  1665.  
  1666.     ((UI::CTextLine*)pWindow)->SetMax(iMax);
  1667.     return Py_BuildNone();
  1668. }
  1669. PyObject * wndTextSetHorizontalAlign(PyObject * poSelf, PyObject * poArgs)
  1670. {
  1671.     UI::CWindow * pWindow;
  1672.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1673.         return Py_BuildException();
  1674.     int iType;
  1675.     if (!PyTuple_GetInteger(poArgs, 1, &iType))
  1676.         return Py_BuildException();
  1677.  
  1678.     ((UI::CTextLine*)pWindow)->SetHorizontalAlign(iType);
  1679.     return Py_BuildNone();
  1680. }
  1681. PyObject * wndTextSetVerticalAlign(PyObject * poSelf, PyObject * poArgs)
  1682. {
  1683.     UI::CWindow * pWindow;
  1684.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1685.         return Py_BuildException();
  1686.     int iType;
  1687.     if (!PyTuple_GetInteger(poArgs, 1, &iType))
  1688.         return Py_BuildException();
  1689.  
  1690.     ((UI::CTextLine*)pWindow)->SetVerticalAlign(iType);
  1691.     return Py_BuildNone();
  1692. }
  1693. PyObject * wndTextSetSecret(PyObject * poSelf, PyObject * poArgs)
  1694. {
  1695.     UI::CWindow * pWindow;
  1696.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1697.         return Py_BuildException();
  1698.     int iFlag;
  1699.     if (!PyTuple_GetInteger(poArgs, 1, &iFlag))
  1700.         return Py_BuildException();
  1701.  
  1702.     ((UI::CTextLine*)pWindow)->SetSecret(iFlag);
  1703.     return Py_BuildNone();
  1704. }
  1705. PyObject * wndTextSetOutline(PyObject * poSelf, PyObject * poArgs)
  1706. {
  1707.     UI::CWindow * pWindow;
  1708.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1709.         return Py_BuildException();
  1710.     int iFlag;
  1711.     if (!PyTuple_GetInteger(poArgs, 1, &iFlag))
  1712.         return Py_BuildException();
  1713.  
  1714.     ((UI::CTextLine*)pWindow)->SetOutline(iFlag);
  1715.     return Py_BuildNone();
  1716. }
  1717. PyObject * wndTextSetFeather(PyObject * poSelf, PyObject * poArgs)
  1718. {
  1719.     UI::CWindow * pWindow;
  1720.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1721.         return Py_BuildException();
  1722.     int iFlag;
  1723.     if (!PyTuple_GetInteger(poArgs, 1, &iFlag))
  1724.         return Py_BuildException();
  1725.  
  1726.     ((UI::CTextLine*)pWindow)->SetFeather(iFlag);
  1727.     return Py_BuildNone();
  1728. }
  1729. PyObject * wndTextSetMultiLine(PyObject * poSelf, PyObject * poArgs)
  1730. {
  1731.     UI::CWindow * pWindow;
  1732.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1733.         return Py_BuildException();
  1734.     int iFlag;
  1735.     if (!PyTuple_GetInteger(poArgs, 1, &iFlag))
  1736.         return Py_BuildException();
  1737.  
  1738.     ((UI::CTextLine*)pWindow)->SetMultiLine(iFlag);
  1739.     return Py_BuildNone();
  1740. }
  1741. PyObject * wndTextSetFontName(PyObject * poSelf, PyObject * poArgs)
  1742. {
  1743.     UI::CWindow * pWindow;
  1744.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1745.         return Py_BuildException();
  1746.     char * szFontName;
  1747.     if (!PyTuple_GetString(poArgs, 1, &szFontName))
  1748.         return Py_BuildException();
  1749.  
  1750.     ((UI::CTextLine*)pWindow)->SetFontName(szFontName);
  1751.     return Py_BuildNone();
  1752. }
  1753. PyObject * wndTextSetFontColor(PyObject * poSelf, PyObject * poArgs)
  1754. {
  1755.     UI::CWindow * pWindow;
  1756.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1757.         return Py_BuildException();
  1758.  
  1759.     if (2 == PyTuple_Size(poArgs))
  1760.     {
  1761.         int iColor;
  1762.         if (!PyTuple_GetInteger(poArgs, 1, &iColor))
  1763.             return Py_BuildException();
  1764.         ((UI::CTextLine*)pWindow)->SetFontColor(iColor);
  1765.     }
  1766.     else if (4 == PyTuple_Size(poArgs))
  1767.     {
  1768.         float fr;
  1769.         if (!PyTuple_GetFloat(poArgs, 1, &fr))
  1770.             return Py_BuildException();
  1771.         float fg;
  1772.         if (!PyTuple_GetFloat(poArgs, 2, &fg))
  1773.             return Py_BuildException();
  1774.         float fb;
  1775.         if (!PyTuple_GetFloat(poArgs, 3, &fb))
  1776.             return Py_BuildException();
  1777.         float fa = 1.0f;
  1778.  
  1779.         BYTE argb[4] =
  1780.         {
  1781.             (BYTE) (255.0f * fb),
  1782.             (BYTE) (255.0f * fg),
  1783.             (BYTE) (255.0f * fr),
  1784.             (BYTE) (255.0f * fa)
  1785.         };
  1786.         ((UI::CTextLine*)pWindow)->SetFontColor(*((DWORD *) argb));
  1787.     }
  1788.     else
  1789.     {
  1790.         return Py_BuildException();
  1791.     }
  1792.  
  1793.     return Py_BuildNone();
  1794. }
  1795. PyObject * wndTextSetLimitWidth(PyObject * poSelf, PyObject * poArgs)
  1796. {
  1797.     UI::CWindow * pWindow;
  1798.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1799.         return Py_BuildException();
  1800.     float fWidth;
  1801.     if (!PyTuple_GetFloat(poArgs, 1, &fWidth))
  1802.         return Py_BuildException();
  1803.  
  1804.     ((UI::CTextLine*)pWindow)->SetLimitWidth(fWidth);
  1805.     return Py_BuildNone();
  1806. }
  1807. PyObject * wndTextSetText(PyObject * poSelf, PyObject * poArgs)
  1808. {
  1809.     UI::CWindow * pWindow;
  1810.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1811.         return Py_BuildException();
  1812.     char * szText;
  1813.     if (!PyTuple_GetString(poArgs, 1, &szText))
  1814.         return Py_BuildException();
  1815.  
  1816.     ((UI::CTextLine*)pWindow)->SetText(szText);
  1817.     return Py_BuildNone();
  1818. }
  1819. PyObject * wndTextGetText(PyObject * poSelf, PyObject * poArgs)
  1820. {
  1821.     UI::CWindow * pWindow;
  1822.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1823.         return Py_BuildException();
  1824.  
  1825.     return Py_BuildValue("s", ((UI::CTextLine*)pWindow)->GetText());
  1826. }
  1827.  
  1828. PyObject * wndTextGetTextSize(PyObject * poSelf, PyObject * poArgs)
  1829. {
  1830.     UI::CWindow * pWindow;
  1831.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1832.         return Py_BuildException();
  1833.  
  1834.     int nWidth;
  1835.     int nHeight;
  1836.  
  1837.     UI::CTextLine* pkTextLine=(UI::CTextLine*)pWindow;
  1838.     pkTextLine->GetTextSize(&nWidth, &nHeight);
  1839.  
  1840.     return Py_BuildValue("(ii)", nWidth, nHeight);
  1841. }
  1842.  
  1843.  
  1844. PyObject * wndTextShowCursor(PyObject * poSelf, PyObject * poArgs)
  1845. {
  1846.     UI::CWindow * pWindow;
  1847.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1848.         return Py_BuildException();
  1849.  
  1850.     ((UI::CTextLine*)pWindow)->ShowCursor();
  1851.     return Py_BuildNone();
  1852. }
  1853. PyObject * wndTextHideCursor(PyObject * poSelf, PyObject * poArgs)
  1854. {
  1855.     UI::CWindow * pWindow;
  1856.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1857.         return Py_BuildException();
  1858.  
  1859.     ((UI::CTextLine*)pWindow)->HideCursor();
  1860.     return Py_BuildNone();
  1861. }
  1862. PyObject * wndTextGetCursorPosition(PyObject * poSelf, PyObject * poArgs)
  1863. {
  1864.     UI::CWindow * pWindow;
  1865.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1866.         return Py_BuildException();
  1867.  
  1868.     return Py_BuildValue("i", ((UI::CTextLine*)pWindow)->GetCursorPosition());
  1869. }
  1870.  
  1871. PyObject * wndNumberSetNumber(PyObject * poSelf, PyObject * poArgs)
  1872. {
  1873.     UI::CWindow * pWindow;
  1874.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1875.         return Py_BuildException();
  1876.     char * szNumber;
  1877.     if (!PyTuple_GetString(poArgs, 1, &szNumber))
  1878.         return Py_BuildException();
  1879.  
  1880.     ((UI::CNumberLine*)pWindow)->SetNumber(szNumber);
  1881.  
  1882.     return Py_BuildNone();
  1883. }
  1884.  
  1885. PyObject * wndNumberSetNumberHorizontalAlignCenter(PyObject * poSelf, PyObject * poArgs)
  1886. {
  1887.     UI::CWindow * pWindow;
  1888.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1889.         return Py_BuildException();
  1890.  
  1891.     ((UI::CNumberLine*)pWindow)->SetHorizontalAlign(UI::CWindow::HORIZONTAL_ALIGN_CENTER);
  1892.  
  1893.     return Py_BuildNone();
  1894. }
  1895.  
  1896. PyObject * wndNumberSetNumberHorizontalAlignRight(PyObject * poSelf, PyObject * poArgs)
  1897. {
  1898.     UI::CWindow * pWindow;
  1899.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1900.         return Py_BuildException();
  1901.  
  1902.     ((UI::CNumberLine*)pWindow)->SetHorizontalAlign(UI::CWindow::HORIZONTAL_ALIGN_RIGHT);
  1903.  
  1904.     return Py_BuildNone();
  1905. }
  1906.  
  1907. PyObject * wndNumberSetPath(PyObject * poSelf, PyObject * poArgs)
  1908. {
  1909.     UI::CWindow * pWindow;
  1910.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1911.         return Py_BuildException();
  1912.     char * szPath;
  1913.     if (!PyTuple_GetString(poArgs, 1, &szPath))
  1914.         return Py_BuildException();
  1915.  
  1916.     ((UI::CNumberLine*)pWindow)->SetPath(szPath);
  1917.  
  1918.     return Py_BuildNone();
  1919. }
  1920.  
  1921. PyObject * wndMarkBox_SetImageFilename(PyObject * poSelf, PyObject * poArgs)
  1922. {
  1923.     UI::CWindow * pWindow;
  1924.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1925.         return Py_BuildException();
  1926.     char * szFileName;
  1927.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  1928.         return Py_BuildException();
  1929.  
  1930.     ((UI::CMarkBox*)pWindow)->LoadImage(szFileName);
  1931.     return Py_BuildNone();
  1932. }
  1933.  
  1934. PyObject * wndMarkBox_SetImage(PyObject * poSelf, PyObject * poArgs)
  1935. {
  1936.     // ΎΖΉ«°Νµµ ΗΟΑφ ΎΚΐ½
  1937.     return Py_BuildNone();
  1938. }
  1939.  
  1940. PyObject * wndMarkBox_Load(PyObject * poSelf, PyObject * poArgs)
  1941. {
  1942.     // ΎΖΉ«°Νµµ ΗΟΑφ ΎΚΐ½
  1943.     return Py_BuildNone();
  1944. }
  1945.  
  1946. PyObject * wndMarkBox_SetIndex(PyObject * poSelf, PyObject * poArgs)
  1947. {
  1948.     UI::CWindow * pWindow;
  1949.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1950.         return Py_BuildException();
  1951.  
  1952.     int nIndex;
  1953.     if (!PyTuple_GetInteger(poArgs, 1, &nIndex))
  1954.         return Py_BuildException();
  1955.  
  1956.     ((UI::CMarkBox*)pWindow)->SetIndex(nIndex);
  1957.     return Py_BuildNone();
  1958. }
  1959.  
  1960. PyObject * wndMarkBox_SetScale(PyObject * poSelf, PyObject * poArgs)
  1961. {
  1962.     UI::CWindow * pWindow;
  1963.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1964.         return Py_BuildException();
  1965.  
  1966.     float fScale;
  1967.     if (!PyTuple_GetFloat(poArgs, 1, &fScale))
  1968.         return Py_BuildException();
  1969.  
  1970.     ((UI::CMarkBox*)pWindow)->SetScale(fScale);
  1971.     return Py_BuildNone();
  1972. }
  1973.  
  1974.  
  1975. PyObject * wndMarkBox_SetDiffuseColor(PyObject * poSelf, PyObject * poArgs)
  1976. {
  1977.     UI::CWindow * pWindow;
  1978.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  1979.         return Py_BuildException();
  1980.     float fr;
  1981.     if (!PyTuple_GetFloat(poArgs, 1, &fr))
  1982.         return Py_BuildException();
  1983.     float fg;
  1984.     if (!PyTuple_GetFloat(poArgs, 2, &fg))
  1985.         return Py_BuildException();
  1986.     float fb;
  1987.     if (!PyTuple_GetFloat(poArgs, 3, &fb))
  1988.         return Py_BuildException();
  1989.     float fa;
  1990.     if (!PyTuple_GetFloat(poArgs, 4, &fa))
  1991.         return Py_BuildException();
  1992.  
  1993.     ((UI::CMarkBox*)pWindow)->SetDiffuseColor(fr, fg, fb, fa);
  1994.  
  1995.     return Py_BuildNone();
  1996. }
  1997.  
  1998.  
  1999. PyObject * wndImageLoadImage(PyObject * poSelf, PyObject * poArgs)
  2000. {
  2001.     UI::CWindow * pWindow;
  2002.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2003.         return Py_BuildException();
  2004.     char * szFileName;
  2005.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  2006.         return Py_BuildException();
  2007.  
  2008.     if (!((UI::CImageBox*)pWindow)->LoadImage(szFileName))
  2009.         return Py_BuildException("Failed to load image (filename: %s)", szFileName);
  2010.  
  2011.     return Py_BuildNone();
  2012. }
  2013.  
  2014. PyObject * wndImageSetDiffuseColor(PyObject * poSelf, PyObject * poArgs)
  2015. {
  2016.     UI::CWindow * pWindow;
  2017.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2018.         return Py_BuildException();
  2019.     float fr;
  2020.     if (!PyTuple_GetFloat(poArgs, 1, &fr))
  2021.         return Py_BuildException();
  2022.     float fg;
  2023.     if (!PyTuple_GetFloat(poArgs, 2, &fg))
  2024.         return Py_BuildException();
  2025.     float fb;
  2026.     if (!PyTuple_GetFloat(poArgs, 3, &fb))
  2027.         return Py_BuildException();
  2028.     float fa;
  2029.     if (!PyTuple_GetFloat(poArgs, 4, &fa))
  2030.         return Py_BuildException();
  2031.  
  2032.     ((UI::CImageBox*)pWindow)->SetDiffuseColor(fr, fg, fb, fa);
  2033.  
  2034.     return Py_BuildNone();
  2035. }
  2036.  
  2037. PyObject * wndImageGetWidth(PyObject * poSelf, PyObject * poArgs)
  2038. {
  2039.     UI::CWindow * pWindow;
  2040.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2041.         return Py_BuildException();
  2042.  
  2043.     return Py_BuildValue("i", ((UI::CImageBox*)pWindow)->GetWidth());
  2044. }
  2045.  
  2046. PyObject * wndImageGetHeight(PyObject * poSelf, PyObject * poArgs)
  2047. {
  2048.     UI::CWindow * pWindow;
  2049.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2050.         return Py_BuildException();
  2051.  
  2052.     return Py_BuildValue("i", ((UI::CImageBox*)pWindow)->GetHeight());
  2053. }
  2054.  
  2055. PyObject * wndImageSetScale(PyObject * poSelf, PyObject * poArgs)
  2056. {
  2057.     UI::CWindow * pWindow;
  2058.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2059.         return Py_BuildException();
  2060.     float fx;
  2061.     if (!PyTuple_GetFloat(poArgs, 1, &fx))
  2062.         return Py_BuildException();
  2063.     float fy;
  2064.     if (!PyTuple_GetFloat(poArgs, 2, &fy))
  2065.         return Py_BuildException();
  2066.  
  2067.     ((UI::CExpandedImageBox*)pWindow)->SetScale(fx, fy);
  2068.  
  2069.     return Py_BuildNone();
  2070. }
  2071. PyObject * wndImageSetOrigin(PyObject * poSelf, PyObject * poArgs)
  2072. {
  2073.     UI::CWindow * pWindow;
  2074.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2075.         return Py_BuildException();
  2076.     float fx;
  2077.     if (!PyTuple_GetFloat(poArgs, 1, &fx))
  2078.         return Py_BuildException();
  2079.     float fy;
  2080.     if (!PyTuple_GetFloat(poArgs, 2, &fy))
  2081.         return Py_BuildException();
  2082.  
  2083.     ((UI::CExpandedImageBox*)pWindow)->SetOrigin(fx, fy);
  2084.  
  2085.     return Py_BuildNone();
  2086. }
  2087. PyObject * wndImageSetRotation(PyObject * poSelf, PyObject * poArgs)
  2088. {
  2089.     UI::CWindow * pWindow;
  2090.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2091.         return Py_BuildException();
  2092.     float fRotation;
  2093.     if (!PyTuple_GetFloat(poArgs, 1, &fRotation))
  2094.         return Py_BuildException();
  2095.  
  2096.     ((UI::CExpandedImageBox*)pWindow)->SetRotation(fRotation);
  2097.  
  2098.     return Py_BuildNone();
  2099. }
  2100. PyObject * wndImageSetRenderingRect(PyObject * poSelf, PyObject * poArgs)
  2101. {
  2102.     UI::CWindow * pWindow;
  2103.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2104.         return Py_BuildException();
  2105.     float fLeft;
  2106.     if (!PyTuple_GetFloat(poArgs, 1, &fLeft))
  2107.         return Py_BuildException();
  2108.     float fTop;
  2109.     if (!PyTuple_GetFloat(poArgs, 2, &fTop))
  2110.         return Py_BuildException();
  2111.     float fRight;
  2112.     if (!PyTuple_GetFloat(poArgs, 3, &fRight))
  2113.         return Py_BuildException();
  2114.     float fBottom;
  2115.     if (!PyTuple_GetFloat(poArgs, 4, &fBottom))
  2116.         return Py_BuildException();
  2117.  
  2118.     if (pWindow->IsType(UI::CExpandedImageBox::Type()))
  2119.         ((UI::CExpandedImageBox*)pWindow)->SetRenderingRect(fLeft, fTop, fRight, fBottom);
  2120.     else if (pWindow->IsType(UI::CAniImageBox::Type()))
  2121.         ((UI::CAniImageBox*)pWindow)->SetRenderingRect(fLeft, fTop, fRight, fBottom);
  2122.  
  2123.     return Py_BuildNone();
  2124. }
  2125. PyObject * wndImageSetRenderingMode(PyObject * poSelf, PyObject * poArgs)
  2126. {
  2127.     UI::CWindow * pWindow;
  2128.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2129.         return Py_BuildException();
  2130.     int iMode;
  2131.     if (!PyTuple_GetInteger(poArgs, 1, &iMode))
  2132.         return Py_BuildException();
  2133.  
  2134.     if (pWindow->IsType(UI::CExpandedImageBox::Type()))
  2135.         ((UI::CExpandedImageBox*)pWindow)->SetRenderingMode(iMode);
  2136.  
  2137.     return Py_BuildNone();
  2138. }
  2139. PyObject * wndImageSetDelay(PyObject * poSelf, PyObject * poArgs)
  2140. {
  2141.     UI::CWindow * pWindow;
  2142.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2143.         return Py_BuildException();
  2144.     float fDelay;
  2145.     if (!PyTuple_GetFloat(poArgs, 1, &fDelay))
  2146.         return Py_BuildException();
  2147.  
  2148.     ((UI::CAniImageBox*)pWindow)->SetDelay(fDelay);
  2149.  
  2150.     return Py_BuildNone();
  2151. }
  2152. PyObject * wndImageAppendImage(PyObject * poSelf, PyObject * poArgs)
  2153. {
  2154.     UI::CWindow * pWindow;
  2155.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2156.         return Py_BuildException();
  2157.     char * szFileName;
  2158.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  2159.         return Py_BuildException();
  2160.  
  2161.     ((UI::CAniImageBox*)pWindow)->AppendImage(szFileName);
  2162.  
  2163.     return Py_BuildNone();
  2164. }
  2165.  
  2166. PyObject * wndButtonSetUpVisual(PyObject * poSelf, PyObject * poArgs)
  2167. {
  2168.     UI::CWindow * pWindow;
  2169.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2170.         return Py_BuildException();
  2171.     char * szFileName;
  2172.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  2173.         return Py_BuildException();
  2174.  
  2175.     ((UI::CButton*)pWindow)->SetUpVisual(szFileName);
  2176.  
  2177.     return Py_BuildNone();
  2178. }
  2179. PyObject * wndButtonSetOverVisual(PyObject * poSelf, PyObject * poArgs)
  2180. {
  2181.     UI::CWindow * pWindow;
  2182.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2183.         return Py_BuildException();
  2184.     char * szFileName;
  2185.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  2186.         return Py_BuildException();
  2187.  
  2188.     ((UI::CButton*)pWindow)->SetOverVisual(szFileName);
  2189.  
  2190.     return Py_BuildNone();
  2191. }
  2192. PyObject * wndButtonSetDownVisual(PyObject * poSelf, PyObject * poArgs)
  2193. {
  2194.     UI::CWindow * pWindow;
  2195.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2196.         return Py_BuildException();
  2197.     char * szFileName;
  2198.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  2199.         return Py_BuildException();
  2200.  
  2201.     ((UI::CButton*)pWindow)->SetDownVisual(szFileName);
  2202.  
  2203.     return Py_BuildNone();
  2204. }
  2205. PyObject * wndButtonSetDisableVisual(PyObject * poSelf, PyObject * poArgs)
  2206. {
  2207.     UI::CWindow * pWindow;
  2208.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2209.         return Py_BuildException();
  2210.     char * szFileName;
  2211.     if (!PyTuple_GetString(poArgs, 1, &szFileName))
  2212.         return Py_BuildException();
  2213.  
  2214.     ((UI::CButton*)pWindow)->SetDisableVisual(szFileName);
  2215.  
  2216.     return Py_BuildNone();
  2217. }
  2218. PyObject * wndButtonGetUpVisualFileName(PyObject * poSelf, PyObject * poArgs)
  2219. {
  2220.     UI::CWindow * pWindow;
  2221.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2222.         return Py_BuildException();
  2223.  
  2224.     return Py_BuildValue("s", ((UI::CButton*)pWindow)->GetUpVisualFileName());
  2225. }
  2226. PyObject * wndButtonGetOverVisualFileName(PyObject * poSelf, PyObject * poArgs)
  2227. {
  2228.     UI::CWindow * pWindow;
  2229.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2230.         return Py_BuildException();
  2231.  
  2232.     return Py_BuildValue("s", ((UI::CButton*)pWindow)->GetOverVisualFileName());
  2233. }
  2234. PyObject * wndButtonGetDownVisualFileName(PyObject * poSelf, PyObject * poArgs)
  2235. {
  2236.     UI::CWindow * pWindow;
  2237.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2238.         return Py_BuildException();
  2239.  
  2240.     return Py_BuildValue("s", ((UI::CButton*)pWindow)->GetDownVisualFileName());
  2241. }
  2242. PyObject * wndButtonFlash(PyObject * poSelf, PyObject * poArgs)
  2243. {
  2244.     UI::CWindow * pWindow;
  2245.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2246.         return Py_BuildException();
  2247.  
  2248.     ((UI::CButton*)pWindow)->Flash();
  2249.  
  2250.     return Py_BuildNone();
  2251. }
  2252. PyObject * wndButtonEnable(PyObject * poSelf, PyObject * poArgs)
  2253. {
  2254.     UI::CWindow * pWindow;
  2255.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2256.         return Py_BuildException();
  2257.  
  2258.     ((UI::CButton*)pWindow)->Enable();
  2259.  
  2260.     return Py_BuildNone();
  2261. }
  2262. PyObject * wndButtonDisable(PyObject * poSelf, PyObject * poArgs)
  2263. {
  2264.     UI::CWindow * pWindow;
  2265.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2266.         return Py_BuildException();
  2267.  
  2268.     ((UI::CButton*)pWindow)->Disable();
  2269.  
  2270.     return Py_BuildNone();
  2271. }
  2272.  
  2273. #if defined(BL_PRIVATESHOP_SEARCH_SYSTEM)
  2274. PyObject* wndIsDisable(PyObject* poSelf, PyObject* poArgs)
  2275. {
  2276.     UI::CWindow* pWindow;
  2277.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2278.         return Py_BuildException();
  2279.  
  2280.     const BOOL IsDisable = dynamic_cast<UI::CButton*>(pWindow)->IsDisable();
  2281.     return Py_BuildValue("i", IsDisable);
  2282. }
  2283. #endif
  2284.  
  2285. PyObject * wndButtonDown(PyObject * poSelf, PyObject * poArgs)
  2286. {
  2287.     UI::CWindow * pWindow;
  2288.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2289.         return Py_BuildException();
  2290.  
  2291.     ((UI::CButton*)pWindow)->Down();
  2292.  
  2293.     return Py_BuildNone();
  2294. }
  2295. PyObject * wndButtonSetUp(PyObject * poSelf, PyObject * poArgs)
  2296. {
  2297.     UI::CWindow * pWindow;
  2298.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2299.         return Py_BuildException();
  2300.  
  2301.     ((UI::CButton*)pWindow)->SetUp();
  2302.  
  2303.     return Py_BuildNone();
  2304. }
  2305. PyObject * wndButtonSetRestrictMovementArea(PyObject * poSelf, PyObject * poArgs)
  2306. {
  2307.     UI::CWindow * pWindow;
  2308.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2309.         return Py_BuildException();
  2310.     int ix;
  2311.     if (!PyTuple_GetInteger(poArgs, 1, &ix))
  2312.         return Py_BuildException();
  2313.     int iy;
  2314.     if (!PyTuple_GetInteger(poArgs, 2, &iy))
  2315.         return Py_BuildException();
  2316.     int iwidth;
  2317.     if (!PyTuple_GetInteger(poArgs, 3, &iwidth))
  2318.         return Py_BuildException();
  2319.     int iheight;
  2320.     if (!PyTuple_GetInteger(poArgs, 4, &iheight))
  2321.         return Py_BuildException();
  2322.  
  2323.     ((UI::CDragButton*)pWindow)->SetRestrictMovementArea(ix, iy, iwidth, iheight);
  2324.  
  2325.     return Py_BuildNone();
  2326. }
  2327.  
  2328. PyObject * wndButtonIsDown(PyObject * poSelf, PyObject * poArgs)
  2329. {
  2330.     UI::CWindow * pWindow;
  2331.     if (!PyTuple_GetWindow(poArgs, 0, &pWindow))
  2332.         return Py_BuildException();
  2333.  
  2334.     return Py_BuildValue("i", ((UI::CButton*)pWindow)->IsPressed());
  2335. }
  2336.  
  2337. extern BOOL g_bOutlineBoxEnable;
  2338. extern BOOL g_bShowOverInWindowName;
  2339.  
  2340. PyObject * wndMgrSetOutlineFlag(PyObject * poSelf, PyObject * poArgs)
  2341. {
  2342.     int iFlag;
  2343.     if (!PyTuple_GetInteger(poArgs, 0, &iFlag))
  2344.         return Py_BuildException();
  2345.  
  2346.     g_bOutlineBoxEnable = iFlag;
  2347.  
  2348.     return Py_BuildNone();
  2349. }
  2350.  
  2351. PyObject * wndMgrShowOverInWindowName(PyObject * poSelf, PyObject * poArgs)
  2352. {
  2353.     int iFlag;
  2354.     if (!PyTuple_GetInteger(poArgs, 0, &iFlag))
  2355.         return Py_BuildException();
  2356.  
  2357.     g_bShowOverInWindowName = iFlag;
  2358.  
  2359.     return Py_BuildNone();
  2360. }
  2361.  
  2362. #ifdef ENABLE_SASH_SYSTEM
  2363. PyObject * wndMgrActivateEffect(PyObject * poSelf, PyObject * poArgs)
  2364. {
  2365.     UI::CWindow * pWin;
  2366.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  2367.         return Py_BuildException();
  2368.    
  2369.     int iSlotIndex;
  2370.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  2371.         return Py_BuildException();
  2372.    
  2373.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  2374.         return Py_BuildException();
  2375.    
  2376.     float r, g, b, a;
  2377.     if (!PyTuple_GetFloat(poArgs, 2, &r))
  2378.         return Py_BuildException();
  2379.    
  2380.     if (!PyTuple_GetFloat(poArgs, 3, &g))
  2381.         return Py_BuildException();
  2382.    
  2383.     if (!PyTuple_GetFloat(poArgs, 4, &b))
  2384.         return Py_BuildException();
  2385.    
  2386.     if (!PyTuple_GetFloat(poArgs, 5, &a))
  2387.         return Py_BuildException();
  2388.    
  2389.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  2390.     pSlotWin->ActivateEffect(iSlotIndex, r, g, b, a);
  2391.     return Py_BuildNone();
  2392. }
  2393.  
  2394. PyObject * wndMgrDeactivateEffect(PyObject * poSelf, PyObject * poArgs)
  2395. {
  2396.     UI::CWindow * pWin;
  2397.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  2398.         return Py_BuildException();
  2399.    
  2400.     int iSlotIndex;
  2401.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  2402.         return Py_BuildException();
  2403.    
  2404.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  2405.         return Py_BuildException();
  2406.    
  2407.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  2408.     pSlotWin->DeactivateEffect(iSlotIndex);
  2409.     return Py_BuildNone();
  2410. }
  2411. #endif
  2412.  
  2413. PyObject * wndMgrSetSlotID(PyObject * poSelf, PyObject * poArgs)
  2414. {
  2415.     UI::CWindow * pWin;
  2416.     if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  2417.         return Py_BuildException();
  2418.  
  2419.     int iSlotIndex;
  2420.     if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  2421.         return Py_BuildException();
  2422.  
  2423.     int id;
  2424.     if (!PyTuple_GetInteger(poArgs, 2, &id))
  2425.         return Py_BuildException();
  2426.  
  2427.     if (!pWin->IsType(UI::CSlotWindow::Type()))
  2428.         return Py_BuildException();
  2429.  
  2430.     UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  2431.     pSlotWin->SetSlotID(iSlotIndex, id);
  2432.  
  2433.     return Py_BuildNone();
  2434. }
  2435.  
  2436.  
  2437. void initwndMgr()
  2438. {
  2439.     static PyMethodDef s_methods[] =
  2440.     {
  2441.         // WindowManager
  2442.         { "SetMouseHandler",            wndMgrSetMouseHandler,              METH_VARARGS },
  2443.         { "SetScreenSize",              wndMgrSetScreenSize,                METH_VARARGS },
  2444.         { "GetScreenWidth",             wndMgrGetScreenWidth,               METH_VARARGS },
  2445.         { "GetScreenHeight",            wndMgrGetScreenHeight,              METH_VARARGS },
  2446.         { "AttachIcon",                 wndMgrAttachIcon,                   METH_VARARGS },
  2447.         { "DeattachIcon",               wndMgrDeattachIcon,                 METH_VARARGS },
  2448.         { "SetAttachingFlag",           wndMgrSetAttachingFlag,             METH_VARARGS },
  2449.         { "GetAspect",                  wndMgrGetAspect,                    METH_VARARGS },
  2450.         { "GetHyperlink",               wndMgrGetHyperlink,                 METH_VARARGS },
  2451.         { "OnceIgnoreMouseLeftButtonUpEvent",   wndMgrOnceIgnoreMouseLeftButtonUpEvent,     METH_VARARGS },
  2452.  
  2453.         // Window
  2454.         { "Register",                   wndMgrRegister,                     METH_VARARGS },
  2455.         { "RegisterSlotWindow",         wndMgrRegisterSlotWindow,           METH_VARARGS },
  2456.         { "RegisterGridSlotWindow",     wndMgrRegisterGridSlotWindow,       METH_VARARGS },
  2457.         { "RegisterTextLine",           wndMgrRegisterTextLine,             METH_VARARGS },
  2458.         { "RegisterMarkBox",            wndMgrRegisterMarkBox,              METH_VARARGS },
  2459.         { "RegisterImageBox",           wndMgrRegisterImageBox,             METH_VARARGS },
  2460.         { "RegisterExpandedImageBox",   wndMgrRegisterExpandedImageBox,     METH_VARARGS },
  2461.         { "RegisterAniImageBox",        wndMgrRegisterAniImageBox,          METH_VARARGS },
  2462.         { "RegisterButton",             wndMgrRegisterButton,               METH_VARARGS },
  2463.         { "RegisterRadioButton",        wndMgrRegisterRadioButton,          METH_VARARGS },
  2464.         { "RegisterToggleButton",       wndMgrRegisterToggleButton,         METH_VARARGS },
  2465.         { "RegisterDragButton",         wndMgrRegisterDragButton,           METH_VARARGS },
  2466.         { "RegisterBox",                wndMgrRegisterBox,                  METH_VARARGS },
  2467.         { "RegisterBar",                wndMgrRegisterBar,                  METH_VARARGS },
  2468.         { "RegisterLine",               wndMgrRegisterLine,                 METH_VARARGS },
  2469.         { "RegisterBar3D",              wndMgrRegisterBar3D,                METH_VARARGS },
  2470.         { "RegisterNumberLine",         wndMgrRegisterNumberLine,           METH_VARARGS },
  2471.         { "Destroy",                    wndMgrDestroy,                      METH_VARARGS },
  2472.         { "AddFlag",                    wndMgrAddFlag,                      METH_VARARGS },
  2473.         { "IsRTL",                      wndMgrIsRTL,                        METH_VARARGS },
  2474.  
  2475.         // Base Window
  2476.         { "SetName",                    wndMgrSetName,                      METH_VARARGS },
  2477.         { "GetName",                    wndMgrGetName,                      METH_VARARGS },
  2478.  
  2479.         { "SetTop",                     wndMgrSetTop,                       METH_VARARGS },
  2480.         { "Show",                       wndMgrShow,                         METH_VARARGS },
  2481.         { "Hide",                       wndMgrHide,                         METH_VARARGS },
  2482.         { "IsShow",                     wndMgrIsShow,                       METH_VARARGS },
  2483.         { "SetParent",                  wndMgrSetParent,                    METH_VARARGS },
  2484.         { "SetPickAlways",              wndMgrSetPickAlways,                METH_VARARGS },
  2485.  
  2486.         { "IsFocus",                    wndMgrIsFocus,                      METH_VARARGS },
  2487.         { "SetFocus",                   wndMgrSetFocus,                     METH_VARARGS },
  2488.         { "KillFocus",                  wndMgrKillFocus,                    METH_VARARGS },
  2489.         { "Lock",                       wndMgrLock,                         METH_VARARGS },
  2490.         { "Unlock",                     wndMgrUnlock,                       METH_VARARGS },
  2491.  
  2492.         { "SetWindowSize",              wndMgrSetWndSize,                   METH_VARARGS },
  2493.         { "SetWindowPosition",          wndMgrSetWndPosition,               METH_VARARGS },
  2494.         { "GetWindowWidth",             wndMgrGetWndWidth,                  METH_VARARGS },
  2495.         { "GetWindowHeight",            wndMgrGetWndHeight,                 METH_VARARGS },
  2496.         { "GetWindowLocalPosition",     wndMgrGetWndLocalPosition,          METH_VARARGS },
  2497.         { "GetWindowGlobalPosition",    wndMgrGetWndGlobalPosition,         METH_VARARGS },
  2498.         { "GetWindowRect",              wndMgrGetWindowRect,                METH_VARARGS },
  2499.         { "SetWindowHorizontalAlign",   wndMgrSetWindowHorizontalAlign,     METH_VARARGS },
  2500.         { "SetWindowVerticalAlign",     wndMgrSetWindowVerticalAlign,       METH_VARARGS },
  2501.  
  2502.         { "GetChildCount",              wndMgrGetChildCount,                METH_VARARGS },
  2503.  
  2504.         { "IsPickedWindow",             wndMgrIsPickedWindow,               METH_VARARGS },
  2505.         { "IsIn",                       wndMgrIsIn,                         METH_VARARGS },
  2506.         { "GetMouseLocalPosition",      wndMgrGetMouseLocalPosition,        METH_VARARGS },
  2507.         { "GetMousePosition",           wndMgrGetMousePosition,             METH_VARARGS },
  2508.         { "IsDragging",                 wndMgrIsDragging,                   METH_VARARGS },
  2509.  
  2510.         { "SetLimitBias",               wndMgrSetLimitBias,                 METH_VARARGS },
  2511.  
  2512.         { "UpdateRect",                 wndMgrUpdateRect,                   METH_VARARGS },
  2513.  
  2514.         // Slot Window
  2515.         { "AppendSlot",                 wndMgrAppendSlot,                   METH_VARARGS },
  2516.         { "ArrangeSlot",                wndMgrArrangeSlot,                  METH_VARARGS },
  2517.         { "ClearSlot",                  wndMgrClearSlot,                    METH_VARARGS },
  2518.         { "ClearAllSlot",               wndMgrClearAllSlot,                 METH_VARARGS },
  2519.         { "HasSlot",                    wndMgrHasSlot,                      METH_VARARGS },
  2520.         { "SetSlot",                    wndMgrSetSlot,                      METH_VARARGS },
  2521.         { "SetSlotCount",               wndMgrSetSlotCount,                 METH_VARARGS },
  2522.         { "SetSlotCountNew",            wndMgrSetSlotCountNew,              METH_VARARGS },
  2523.         { "SetSlotCoolTime",            wndMgrSetSlotCoolTime,              METH_VARARGS },
  2524.  
  2525.         { "StoreSlotCoolTime",          wndMgrStoreSlotCoolTime,            METH_VARARGS },
  2526.         { "RestoreSlotCoolTime",        wndMgrRestoreSlotCoolTime,          METH_VARARGS },
  2527.  
  2528.         { "SetToggleSlot",              wndMgrSetToggleSlot,                METH_VARARGS },
  2529.         { "ActivateSlot",               wndMgrActivateSlot,                 METH_VARARGS },
  2530.         { "DeactivateSlot",             wndMgrDeactivateSlot,               METH_VARARGS },
  2531.         { "EnableSlot",                 wndMgrEnableSlot,                   METH_VARARGS },
  2532.         { "DisableSlot",                wndMgrDisableSlot,                  METH_VARARGS },
  2533.         { "ShowSlotBaseImage",          wndMgrShowSlotBaseImage,            METH_VARARGS },
  2534.         { "HideSlotBaseImage",          wndMgrHideSlotBaseImage,            METH_VARARGS },
  2535.         { "SetSlotType",                wndMgrSetSlotType,                  METH_VARARGS },
  2536.         { "SetSlotStyle",               wndMgrSetSlotStyle,                 METH_VARARGS },
  2537.         { "SetSlotBaseImage",           wndMgrSetSlotBaseImage,             METH_VARARGS },
  2538.  
  2539.         { "SetCoverButton",             wndMgrSetCoverButton,               METH_VARARGS },
  2540.         { "EnableCoverButton",          wndMgrEnableCoverButton,            METH_VARARGS },
  2541.         { "DisableCoverButton",         wndMgrDisableCoverButton,           METH_VARARGS },
  2542.         { "IsDisableCoverButton",       wndMgrIsDisableCoverButton,         METH_VARARGS },
  2543.         { "SetAlwaysRenderCoverButton", wndMgrSetAlwaysRenderCoverButton,   METH_VARARGS },
  2544.        
  2545.         { "AppendSlotButton",           wndMgrAppendSlotButton,             METH_VARARGS },
  2546.         { "AppendRequirementSignImage", wndMgrAppendRequirementSignImage,   METH_VARARGS },
  2547.         { "ShowSlotButton",             wndMgrShowSlotButton,               METH_VARARGS },
  2548.         { "HideAllSlotButton",          wndMgrHideAllSlotButton,            METH_VARARGS },
  2549.         { "ShowRequirementSign",        wndMgrShowRequirementSign,          METH_VARARGS },
  2550.         { "HideRequirementSign",        wndMgrHideRequirementSign,          METH_VARARGS },
  2551.         { "RefreshSlot",                wndMgrRefreshSlot,                  METH_VARARGS },
  2552.         { "SetUseMode",                 wndMgrSetUseMode,                   METH_VARARGS },
  2553.         { "SetUsableItem",              wndMgrSetUsableItem,                METH_VARARGS },
  2554.  
  2555.         { "SelectSlot",                 wndMgrSelectSlot,                   METH_VARARGS },
  2556.         { "ClearSelected",              wndMgrClearSelected,                METH_VARARGS },
  2557.         { "GetSelectedSlotCount",       wndMgrGetSelectedSlotCount,         METH_VARARGS },
  2558.         { "GetSelectedSlotNumber",      wndMgrGetSelectedSlotNumber,        METH_VARARGS },
  2559.         { "IsSelectedSlot",             wndMgrIsSelectedSlot,               METH_VARARGS },
  2560.         { "GetSlotCount",               wndMgrGetSlotCount,                 METH_VARARGS },
  2561.         { "LockSlot",                   wndMgrLockSlot,                     METH_VARARGS },
  2562.         { "UnlockSlot",                 wndMgrUnlockSlot,                   METH_VARARGS },
  2563.  
  2564.         // Bar
  2565.         { "SetColor",                   wndBarSetColor,                     METH_VARARGS },
  2566.  
  2567.         // TextLine
  2568.         { "SetMax",                     wndTextSetMax,                      METH_VARARGS },
  2569.         { "SetHorizontalAlign",         wndTextSetHorizontalAlign,          METH_VARARGS },
  2570.         { "SetVerticalAlign",           wndTextSetVerticalAlign,            METH_VARARGS },
  2571.         { "SetSecret",                  wndTextSetSecret,                   METH_VARARGS },
  2572.         { "SetOutline",                 wndTextSetOutline,                  METH_VARARGS },
  2573.         { "SetFeather",                 wndTextSetFeather,                  METH_VARARGS },
  2574.         { "SetMultiLine",               wndTextSetMultiLine,                METH_VARARGS },
  2575.         { "SetText",                    wndTextSetText,                     METH_VARARGS },
  2576.         { "SetFontName",                wndTextSetFontName,                 METH_VARARGS },
  2577.         { "SetFontColor",               wndTextSetFontColor,                METH_VARARGS },
  2578.         { "SetLimitWidth",              wndTextSetLimitWidth,               METH_VARARGS },
  2579.         { "GetText",                    wndTextGetText,                     METH_VARARGS },
  2580.         { "GetTextSize",                wndTextGetTextSize,                 METH_VARARGS },
  2581.         { "ShowCursor",                 wndTextShowCursor,                  METH_VARARGS },
  2582.         { "HideCursor",                 wndTextHideCursor,                  METH_VARARGS },
  2583.         { "GetCursorPosition",          wndTextGetCursorPosition,           METH_VARARGS },
  2584.         // NumberLine
  2585.         { "SetNumber",                      wndNumberSetNumber,                         METH_VARARGS },
  2586.         { "SetNumberHorizontalAlignCenter", wndNumberSetNumberHorizontalAlignCenter,    METH_VARARGS },
  2587.         { "SetNumberHorizontalAlignRight",  wndNumberSetNumberHorizontalAlignRight,     METH_VARARGS },
  2588.         { "SetPath",                        wndNumberSetPath,                           METH_VARARGS },
  2589.  
  2590.         // ImageBox
  2591.         { "MarkBox_SetImage",           wndMarkBox_SetImage,                METH_VARARGS },
  2592.         { "MarkBox_SetImageFilename",   wndMarkBox_SetImageFilename,        METH_VARARGS },
  2593.         { "MarkBox_Load",               wndMarkBox_Load,                    METH_VARARGS },
  2594.         { "MarkBox_SetIndex",           wndMarkBox_SetIndex,                METH_VARARGS },
  2595.         { "MarkBox_SetScale",           wndMarkBox_SetScale,                METH_VARARGS },
  2596.         { "MarkBox_SetDiffuseColor",    wndMarkBox_SetDiffuseColor,         METH_VARARGS },
  2597.  
  2598.         // ImageBox
  2599.         { "LoadImage",                  wndImageLoadImage,                  METH_VARARGS },
  2600.         { "SetDiffuseColor",            wndImageSetDiffuseColor,            METH_VARARGS },
  2601.         { "GetWidth",                   wndImageGetWidth,                   METH_VARARGS },
  2602.         { "GetHeight",                  wndImageGetHeight,                  METH_VARARGS },
  2603.         // ExpandedImageBox
  2604.         { "SetScale",                   wndImageSetScale,                   METH_VARARGS },
  2605.         { "SetOrigin",                  wndImageSetOrigin,                  METH_VARARGS },
  2606.         { "SetRotation",                wndImageSetRotation,                METH_VARARGS },
  2607.         { "SetRenderingRect",           wndImageSetRenderingRect,           METH_VARARGS },
  2608.         { "SetRenderingMode",           wndImageSetRenderingMode,           METH_VARARGS },
  2609.         // AniImageBox
  2610.         { "SetDelay",                   wndImageSetDelay,                   METH_VARARGS },
  2611.         { "AppendImage",                wndImageAppendImage,                METH_VARARGS },
  2612.  
  2613.         // Button
  2614.         { "SetUpVisual",                wndButtonSetUpVisual,               METH_VARARGS },
  2615.         { "SetOverVisual",              wndButtonSetOverVisual,             METH_VARARGS },
  2616.         { "SetDownVisual",              wndButtonSetDownVisual,             METH_VARARGS },
  2617.         { "SetDisableVisual",           wndButtonSetDisableVisual,          METH_VARARGS },
  2618.         { "GetUpVisualFileName",        wndButtonGetUpVisualFileName,       METH_VARARGS },
  2619.         { "GetOverVisualFileName",      wndButtonGetOverVisualFileName,     METH_VARARGS },
  2620.         { "GetDownVisualFileName",      wndButtonGetDownVisualFileName,     METH_VARARGS },
  2621.         { "Flash",                      wndButtonFlash,                     METH_VARARGS },
  2622.         { "Enable",                     wndButtonEnable,                    METH_VARARGS },
  2623.         { "Disable",                    wndButtonDisable,                   METH_VARARGS },
  2624. #if defined(BL_PRIVATESHOP_SEARCH_SYSTEM)
  2625.         { "IsDisable",                  wndIsDisable,                       METH_VARARGS },
  2626. #endif
  2627.         { "Down",                       wndButtonDown,                      METH_VARARGS },
  2628.         { "SetUp",                      wndButtonSetUp,                     METH_VARARGS },
  2629.         { "IsDown",                     wndButtonIsDown,                    METH_VARARGS },
  2630.  
  2631.         // DragButton
  2632.         { "SetRestrictMovementArea",    wndButtonSetRestrictMovementArea,   METH_VARARGS },
  2633.  
  2634.         // For Debug
  2635.         { "SetOutlineFlag",             wndMgrSetOutlineFlag,               METH_VARARGS },
  2636.         { "ShowOverInWindowName",       wndMgrShowOverInWindowName,         METH_VARARGS },
  2637. #ifdef ENABLE_SASH_SYSTEM
  2638.         {"ActivateEffect", wndMgrActivateEffect, METH_VARARGS},
  2639.         {"DeactivateEffect", wndMgrDeactivateEffect, METH_VARARGS},
  2640.         #endif
  2641.         { "SetSlotID",                  wndMgrSetSlotID,                    METH_VARARGS },
  2642.  
  2643.  
  2644.         { NULL,                         NULL,                               NULL },
  2645.     };
  2646.  
  2647.     PyObject * poModule = Py_InitModule("wndMgr", s_methods);
  2648.  
  2649. // ΗΟ³ΐΗ µρΌΕ³ΚΈ®Ώ΅ ³ΚΉ« ΈΉΐΊ FunctionΐΜ ΖχΗΤ µΗ΄Β °Ν °°ΎΖ ΐΜ·±½ΔΐΈ·Ξ µρΌΕ³ΚΈ®Έ¦ ³΄©΄Β °Νΐ» °ν·Α Αί - [levites]
  2650. //  PyObject * poMgrModule = Py_InitModule("wndMgr", s_methods);
  2651. //  PyObject * poTextModule = Py_InitModule("wndText", s_methods);
  2652. //  PyObject * poSlotModule = Py_InitModule("wndSlot", s_methods);
  2653.  
  2654.     PyModule_AddIntConstant(poModule, "SLOT_STYLE_NONE",                UI::SLOT_STYLE_NONE);
  2655.     PyModule_AddIntConstant(poModule, "SLOT_STYLE_PICK_UP",             UI::SLOT_STYLE_PICK_UP);
  2656.     PyModule_AddIntConstant(poModule, "SLOT_STYLE_SELECT",              UI::SLOT_STYLE_SELECT);
  2657.  
  2658.     PyModule_AddIntConstant(poModule, "TEXT_HORIZONTAL_ALIGN_LEFT",     CGraphicTextInstance::HORIZONTAL_ALIGN_LEFT);
  2659.     PyModule_AddIntConstant(poModule, "TEXT_HORIZONTAL_ALIGN_RIGHT",    CGraphicTextInstance::HORIZONTAL_ALIGN_RIGHT);
  2660.     PyModule_AddIntConstant(poModule, "TEXT_HORIZONTAL_ALIGN_CENTER",   CGraphicTextInstance::HORIZONTAL_ALIGN_CENTER);
  2661.     PyModule_AddIntConstant(poModule, "TEXT_VERTICAL_ALIGN_TOP",        CGraphicTextInstance::VERTICAL_ALIGN_TOP);
  2662.     PyModule_AddIntConstant(poModule, "TEXT_VERTICAL_ALIGN_BOTTOM",     CGraphicTextInstance::VERTICAL_ALIGN_BOTTOM);
  2663.     PyModule_AddIntConstant(poModule, "TEXT_VERTICAL_ALIGN_CENTER",     CGraphicTextInstance::VERTICAL_ALIGN_CENTER);
  2664.  
  2665.     PyModule_AddIntConstant(poModule, "HORIZONTAL_ALIGN_LEFT",          UI::CWindow::HORIZONTAL_ALIGN_LEFT);
  2666.     PyModule_AddIntConstant(poModule, "HORIZONTAL_ALIGN_CENTER",        UI::CWindow::HORIZONTAL_ALIGN_CENTER);
  2667.     PyModule_AddIntConstant(poModule, "HORIZONTAL_ALIGN_RIGHT",         UI::CWindow::HORIZONTAL_ALIGN_RIGHT);
  2668.     PyModule_AddIntConstant(poModule, "VERTICAL_ALIGN_TOP",             UI::CWindow::VERTICAL_ALIGN_TOP);
  2669.     PyModule_AddIntConstant(poModule, "VERTICAL_ALIGN_CENTER",          UI::CWindow::VERTICAL_ALIGN_CENTER);
  2670.     PyModule_AddIntConstant(poModule, "VERTICAL_ALIGN_BOTTOM",          UI::CWindow::VERTICAL_ALIGN_BOTTOM);
  2671.  
  2672.     PyModule_AddIntConstant(poModule, "RENDERING_MODE_MODULATE",        CGraphicExpandedImageInstance::RENDERING_MODE_MODULATE);
  2673. }
  2674.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement