MrP0wers

PythonWindowManagerModule.cpp

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