c_guiobject.cpp 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. /* This file was generated by Maki Compiler, do not edit manually */
  2. #include <precomp.h>
  3. #include "c_guiobject.h"
  4. #include <api/script/objcontroller.h>
  5. C_GuiObject::C_GuiObject(ScriptObject *object) : C_RootObject(object) {
  6. inited = 0;
  7. obj = NULL;
  8. C_hook(object);
  9. }
  10. C_GuiObject::C_GuiObject() {
  11. inited = 0;
  12. obj = NULL;
  13. }
  14. void C_GuiObject::C_hook(ScriptObject *object) {
  15. ASSERT(!inited);
  16. ScriptObjectController *controller = object->vcpu_getController();
  17. obj = controller->cast(object, guiObjectGuid);
  18. if (obj != object && obj != NULL)
  19. controller = obj->vcpu_getController();
  20. else
  21. obj = NULL;
  22. int iter = WASABI_API_APP->app_getInitCount();
  23. if (!loaded || loaded != iter) {
  24. loaded = iter;
  25. show_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"show", this);
  26. hide_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hide", this);
  27. isvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isVisible", this);
  28. onsetvisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSetVisible", this);
  29. setalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setAlpha", this);
  30. getalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAlpha", this);
  31. onleftbuttonup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftButtonUp", this);
  32. onleftbuttondown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftButtonDown", this);
  33. onrightbuttonup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightButtonUp", this);
  34. onrightbuttondown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightButtonDown", this);
  35. onrightbuttondblclk_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightButtonDblClk", this);
  36. onleftbuttondblclk_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftButtonDblClk", this);
  37. onmousemove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseMove", this);
  38. onenterarea_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEnterArea", this);
  39. onleavearea_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeaveArea", this);
  40. setenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setEnabled", this);
  41. getenabled_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getEnabled", this);
  42. onenable_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEnable", this);
  43. resize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"resize", this);
  44. onresize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onResize", this);
  45. ismouseover_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isMouseOver", this);
  46. getleft_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLeft", this);
  47. gettop_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getTop", this);
  48. getwidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getWidth", this);
  49. getheight_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getHeight", this);
  50. settargetx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetX", this);
  51. settargety_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetY", this);
  52. settargetw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetW", this);
  53. settargeth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetH", this);
  54. settargeta_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetA", this);
  55. settargetspeed_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setTargetSpeed", this);
  56. gototarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"gotoTarget", this);
  57. ontargetreached_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onTargetReached", this);
  58. canceltarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"cancelTarget", this);
  59. reversetarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"reverseTarget", this);
  60. onstartup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onStartup", this);
  61. isgoingtotarget_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isGoingToTarget", this);
  62. setxmlparam_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setXmlParam", this);
  63. getxmlparam_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getXmlParam", this);
  64. init_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"init", this);
  65. bringtofront_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringToFront", this);
  66. bringtoback_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringToBack", this);
  67. bringabove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringAbove", this);
  68. bringbelow_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"bringBelow", this);
  69. getguix_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiX", this);
  70. getguiy_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiY", this);
  71. getguiw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiW", this);
  72. getguih_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiH", this);
  73. getguirelatx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatX", this);
  74. getguirelaty_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatY", this);
  75. getguirelatw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatW", this);
  76. getguirelath_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getGuiRelatH", this);
  77. isactive_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isActive", this);
  78. getparent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getParent", this);
  79. getparentlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getParentLayout", this);
  80. gettopparent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getTopParent", this);
  81. runmodal_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"runModal", this);
  82. endmodal_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"endModal", this);
  83. findobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"findObject", this);
  84. findobjectxy_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"findObjectXY", this);
  85. getname_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getName", this);
  86. clienttoscreenx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenX", this);
  87. clienttoscreeny_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenY", this);
  88. clienttoscreenw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenW", this);
  89. clienttoscreenh_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"clientToScreenH", this);
  90. screentoclientx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientX", this);
  91. screentoclienty_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientY", this);
  92. screentoclientw_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientW", this);
  93. screentoclienth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"screenToClientH", this);
  94. getautowidth_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAutoWidth", this);
  95. getautoheight_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getAutoHeight", this);
  96. setfocus_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setFocus", this);
  97. onchar_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onChar", this);
  98. onaccelerator_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onAccelerator", this);
  99. ismouseoverrect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isMouseOverRect", this);
  100. getinterface_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getInterface", this);
  101. onkeydown_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onKeyDown", this);
  102. onkeyup_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onKeyUp", this);
  103. ongetfocus_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onGetFocus", this);
  104. onkillfocus_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onKillFocus", this);
  105. sendaction_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"sendAction", this);
  106. onaction_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onAction", this);
  107. }
  108. inited = 1;
  109. }
  110. C_GuiObject::~C_GuiObject() {
  111. }
  112. ScriptObject *C_GuiObject::getScriptObject() {
  113. if (obj != NULL) return obj;
  114. return C_GUIOBJECT_PARENT::getScriptObject();
  115. }
  116. void C_GuiObject::show() {
  117. ASSERT(inited);
  118. WASABI_API_MAKI->maki_callFunction(getScriptObject(), show_id, NULL);
  119. }
  120. void C_GuiObject::hide() {
  121. ASSERT(inited);
  122. WASABI_API_MAKI->maki_callFunction(getScriptObject(), hide_id, NULL);
  123. }
  124. int C_GuiObject::isVisible() {
  125. ASSERT(inited);
  126. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isvisible_id, NULL));
  127. }
  128. void C_GuiObject::onSetVisible(int onoff) {
  129. ASSERT(inited);
  130. scriptVar a = MAKE_SCRIPT_INT(onoff);
  131. scriptVar *params[1] = {&a};
  132. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsetvisible_id, params);
  133. }
  134. void C_GuiObject::setAlpha(int alpha) {
  135. ASSERT(inited);
  136. scriptVar a = MAKE_SCRIPT_INT(alpha);
  137. scriptVar *params[1] = {&a};
  138. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setalpha_id, params);
  139. }
  140. int C_GuiObject::getAlpha() {
  141. ASSERT(inited);
  142. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getalpha_id, NULL));
  143. }
  144. void C_GuiObject::onLeftButtonUp(int x, int y) {
  145. ASSERT(inited);
  146. scriptVar a = MAKE_SCRIPT_INT(x);
  147. scriptVar b = MAKE_SCRIPT_INT(y);
  148. scriptVar *params[2] = {&a, &b};
  149. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftbuttonup_id, params);
  150. }
  151. void C_GuiObject::onLeftButtonDown(int x, int y) {
  152. ASSERT(inited);
  153. scriptVar a = MAKE_SCRIPT_INT(x);
  154. scriptVar b = MAKE_SCRIPT_INT(y);
  155. scriptVar *params[2] = {&a, &b};
  156. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftbuttondown_id, params);
  157. }
  158. void C_GuiObject::onRightButtonUp(int x, int y) {
  159. ASSERT(inited);
  160. scriptVar a = MAKE_SCRIPT_INT(x);
  161. scriptVar b = MAKE_SCRIPT_INT(y);
  162. scriptVar *params[2] = {&a, &b};
  163. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightbuttonup_id, params);
  164. }
  165. void C_GuiObject::onRightButtonDown(int x, int y) {
  166. ASSERT(inited);
  167. scriptVar a = MAKE_SCRIPT_INT(x);
  168. scriptVar b = MAKE_SCRIPT_INT(y);
  169. scriptVar *params[2] = {&a, &b};
  170. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightbuttondown_id, params);
  171. }
  172. void C_GuiObject::onRightButtonDblClk(int x, int y) {
  173. ASSERT(inited);
  174. scriptVar a = MAKE_SCRIPT_INT(x);
  175. scriptVar b = MAKE_SCRIPT_INT(y);
  176. scriptVar *params[2] = {&a, &b};
  177. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightbuttondblclk_id, params);
  178. }
  179. void C_GuiObject::onLeftButtonDblClk(int x, int y) {
  180. ASSERT(inited);
  181. scriptVar a = MAKE_SCRIPT_INT(x);
  182. scriptVar b = MAKE_SCRIPT_INT(y);
  183. scriptVar *params[2] = {&a, &b};
  184. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftbuttondblclk_id, params);
  185. }
  186. void C_GuiObject::onMouseMove(int x, int y) {
  187. ASSERT(inited);
  188. scriptVar a = MAKE_SCRIPT_INT(x);
  189. scriptVar b = MAKE_SCRIPT_INT(y);
  190. scriptVar *params[2] = {&a, &b};
  191. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmousemove_id, params);
  192. }
  193. void C_GuiObject::onEnterArea() {
  194. ASSERT(inited);
  195. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onenterarea_id, NULL);
  196. }
  197. void C_GuiObject::onLeaveArea() {
  198. ASSERT(inited);
  199. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleavearea_id, NULL);
  200. }
  201. void C_GuiObject::setEnabled(int onoff) {
  202. ASSERT(inited);
  203. scriptVar a = MAKE_SCRIPT_INT(onoff);
  204. scriptVar *params[1] = {&a};
  205. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setenabled_id, params);
  206. }
  207. int C_GuiObject::getEnabled() {
  208. ASSERT(inited);
  209. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getenabled_id, NULL));
  210. }
  211. void C_GuiObject::onEnable(int onoff) {
  212. ASSERT(inited);
  213. scriptVar a = MAKE_SCRIPT_INT(onoff);
  214. scriptVar *params[1] = {&a};
  215. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onenable_id, params);
  216. }
  217. void C_GuiObject::resize(int x, int y, int w, int h) {
  218. ASSERT(inited);
  219. scriptVar a = MAKE_SCRIPT_INT(x);
  220. scriptVar b = MAKE_SCRIPT_INT(y);
  221. scriptVar c = MAKE_SCRIPT_INT(w);
  222. scriptVar d = MAKE_SCRIPT_INT(h);
  223. scriptVar *params[4] = {&a, &b, &c, &d};
  224. WASABI_API_MAKI->maki_callFunction(getScriptObject(), resize_id, params);
  225. }
  226. void C_GuiObject::onResize(int x, int y, int w, int h) {
  227. ASSERT(inited);
  228. scriptVar a = MAKE_SCRIPT_INT(x);
  229. scriptVar b = MAKE_SCRIPT_INT(y);
  230. scriptVar c = MAKE_SCRIPT_INT(w);
  231. scriptVar d = MAKE_SCRIPT_INT(h);
  232. scriptVar *params[4] = {&a, &b, &c, &d};
  233. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onresize_id, params);
  234. }
  235. int C_GuiObject::isMouseOver(int x, int y) {
  236. ASSERT(inited);
  237. scriptVar a = MAKE_SCRIPT_INT(x);
  238. scriptVar b = MAKE_SCRIPT_INT(y);
  239. scriptVar *params[2] = {&a, &b};
  240. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ismouseover_id, params));
  241. }
  242. int C_GuiObject::getLeft() {
  243. ASSERT(inited);
  244. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getleft_id, NULL));
  245. }
  246. int C_GuiObject::getTop() {
  247. ASSERT(inited);
  248. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettop_id, NULL));
  249. }
  250. int C_GuiObject::getWidth() {
  251. ASSERT(inited);
  252. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getwidth_id, NULL));
  253. }
  254. int C_GuiObject::getHeight() {
  255. ASSERT(inited);
  256. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getheight_id, NULL));
  257. }
  258. void C_GuiObject::setTargetX(int x) {
  259. ASSERT(inited);
  260. scriptVar a = MAKE_SCRIPT_INT(x);
  261. scriptVar *params[1] = {&a};
  262. WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargetx_id, params);
  263. }
  264. void C_GuiObject::setTargetY(int y) {
  265. ASSERT(inited);
  266. scriptVar a = MAKE_SCRIPT_INT(y);
  267. scriptVar *params[1] = {&a};
  268. WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargety_id, params);
  269. }
  270. void C_GuiObject::setTargetW(int w) {
  271. ASSERT(inited);
  272. scriptVar a = MAKE_SCRIPT_INT(w);
  273. scriptVar *params[1] = {&a};
  274. WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargetw_id, params);
  275. }
  276. void C_GuiObject::setTargetH(int r) {
  277. ASSERT(inited);
  278. scriptVar a = MAKE_SCRIPT_INT(r);
  279. scriptVar *params[1] = {&a};
  280. WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargeth_id, params);
  281. }
  282. void C_GuiObject::setTargetA(int alpha) {
  283. ASSERT(inited);
  284. scriptVar a = MAKE_SCRIPT_INT(alpha);
  285. scriptVar *params[1] = {&a};
  286. WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargeta_id, params);
  287. }
  288. void C_GuiObject::setTargetSpeed(float insecond) {
  289. ASSERT(inited);
  290. scriptVar a = MAKE_SCRIPT_FLOAT(insecond);
  291. scriptVar *params[1] = {&a};
  292. WASABI_API_MAKI->maki_callFunction(getScriptObject(), settargetspeed_id, params);
  293. }
  294. void C_GuiObject::gotoTarget() {
  295. ASSERT(inited);
  296. WASABI_API_MAKI->maki_callFunction(getScriptObject(), gototarget_id, NULL);
  297. }
  298. void C_GuiObject::onTargetReached() {
  299. ASSERT(inited);
  300. WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontargetreached_id, NULL);
  301. }
  302. void C_GuiObject::cancelTarget() {
  303. ASSERT(inited);
  304. WASABI_API_MAKI->maki_callFunction(getScriptObject(), canceltarget_id, NULL);
  305. }
  306. void C_GuiObject::reverseTarget(int reverse) {
  307. ASSERT(inited);
  308. scriptVar a = MAKE_SCRIPT_INT(reverse);
  309. scriptVar *params[1] = {&a};
  310. WASABI_API_MAKI->maki_callFunction(getScriptObject(), reversetarget_id, params);
  311. }
  312. void C_GuiObject::onStartup() {
  313. ASSERT(inited);
  314. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onstartup_id, NULL);
  315. }
  316. int C_GuiObject::isGoingToTarget() {
  317. ASSERT(inited);
  318. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isgoingtotarget_id, NULL));
  319. }
  320. void C_GuiObject::setXmlParam(const wchar_t *param, const wchar_t *value)
  321. {
  322. ASSERT(inited);
  323. scriptVar a = MAKE_SCRIPT_STRING(param);
  324. scriptVar b = MAKE_SCRIPT_STRING(value);
  325. scriptVar *params[2] = {&a, &b};
  326. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setxmlparam_id, params);
  327. }
  328. const wchar_t *C_GuiObject::getXmlParam(const wchar_t *param)
  329. {
  330. ASSERT(inited);
  331. scriptVar a = MAKE_SCRIPT_STRING(param);
  332. scriptVar *params[1] = {&a};
  333. return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getxmlparam_id, params));
  334. }
  335. void C_GuiObject::init(ScriptObject *parent) {
  336. ASSERT(inited);
  337. scriptVar a = MAKE_SCRIPT_OBJECT(parent);
  338. scriptVar *params[1] = {&a};
  339. WASABI_API_MAKI->maki_callFunction(getScriptObject(), init_id, params);
  340. }
  341. void C_GuiObject::bringToFront() {
  342. ASSERT(inited);
  343. WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringtofront_id, NULL);
  344. }
  345. void C_GuiObject::bringToBack() {
  346. ASSERT(inited);
  347. WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringtoback_id, NULL);
  348. }
  349. void C_GuiObject::bringAbove(ScriptObject *guiobj) {
  350. ASSERT(inited);
  351. scriptVar a = MAKE_SCRIPT_OBJECT(guiobj);
  352. scriptVar *params[1] = {&a};
  353. WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringabove_id, params);
  354. }
  355. void C_GuiObject::bringBelow(ScriptObject *guiobj) {
  356. ASSERT(inited);
  357. scriptVar a = MAKE_SCRIPT_OBJECT(guiobj);
  358. scriptVar *params[1] = {&a};
  359. WASABI_API_MAKI->maki_callFunction(getScriptObject(), bringbelow_id, params);
  360. }
  361. int C_GuiObject::getGuiX() {
  362. ASSERT(inited);
  363. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguix_id, NULL));
  364. }
  365. int C_GuiObject::getGuiY() {
  366. ASSERT(inited);
  367. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguiy_id, NULL));
  368. }
  369. int C_GuiObject::getGuiW() {
  370. ASSERT(inited);
  371. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguiw_id, NULL));
  372. }
  373. int C_GuiObject::getGuiH() {
  374. ASSERT(inited);
  375. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguih_id, NULL));
  376. }
  377. int C_GuiObject::getGuiRelatX() {
  378. ASSERT(inited);
  379. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelatx_id, NULL));
  380. }
  381. int C_GuiObject::getGuiRelatY() {
  382. ASSERT(inited);
  383. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelaty_id, NULL));
  384. }
  385. int C_GuiObject::getGuiRelatW() {
  386. ASSERT(inited);
  387. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelatw_id, NULL));
  388. }
  389. int C_GuiObject::getGuiRelatH() {
  390. ASSERT(inited);
  391. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getguirelath_id, NULL));
  392. }
  393. int C_GuiObject::isActive() {
  394. ASSERT(inited);
  395. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isactive_id, NULL));
  396. }
  397. ScriptObject *C_GuiObject::getParent() {
  398. ASSERT(inited);
  399. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getparent_id, NULL));
  400. }
  401. ScriptObject *C_GuiObject::getParentLayout() {
  402. ASSERT(inited);
  403. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getparentlayout_id, NULL));
  404. }
  405. ScriptObject *C_GuiObject::getTopParent() {
  406. ASSERT(inited);
  407. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettopparent_id, NULL));
  408. }
  409. int C_GuiObject::runModal() {
  410. ASSERT(inited);
  411. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), runmodal_id, NULL));
  412. }
  413. void C_GuiObject::endModal(int retcode) {
  414. ASSERT(inited);
  415. scriptVar a = MAKE_SCRIPT_INT(retcode);
  416. scriptVar *params[1] = {&a};
  417. WASABI_API_MAKI->maki_callFunction(getScriptObject(), endmodal_id, params);
  418. }
  419. ScriptObject *C_GuiObject::findObject(const wchar_t *id)
  420. {
  421. ASSERT(inited);
  422. scriptVar a = MAKE_SCRIPT_STRING(id);
  423. scriptVar *params[1] = {&a};
  424. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), findobject_id, params));
  425. }
  426. ScriptObject *C_GuiObject::findObjectXY(int x, int y) {
  427. ASSERT(inited);
  428. scriptVar a = MAKE_SCRIPT_INT(x);
  429. scriptVar b = MAKE_SCRIPT_INT(y);
  430. scriptVar *params[2] = {&a, &b};
  431. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), findobjectxy_id, params));
  432. }
  433. const wchar_t *C_GuiObject::getName()
  434. {
  435. ASSERT(inited);
  436. return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getname_id, NULL));
  437. }
  438. int C_GuiObject::clientToScreenX(int x) {
  439. ASSERT(inited);
  440. scriptVar a = MAKE_SCRIPT_INT(x);
  441. scriptVar *params[1] = {&a};
  442. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreenx_id, params));
  443. }
  444. int C_GuiObject::clientToScreenY(int y) {
  445. ASSERT(inited);
  446. scriptVar a = MAKE_SCRIPT_INT(y);
  447. scriptVar *params[1] = {&a};
  448. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreeny_id, params));
  449. }
  450. int C_GuiObject::clientToScreenW(int w) {
  451. ASSERT(inited);
  452. scriptVar a = MAKE_SCRIPT_INT(w);
  453. scriptVar *params[1] = {&a};
  454. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreenw_id, params));
  455. }
  456. int C_GuiObject::clientToScreenH(int h) {
  457. ASSERT(inited);
  458. scriptVar a = MAKE_SCRIPT_INT(h);
  459. scriptVar *params[1] = {&a};
  460. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), clienttoscreenh_id, params));
  461. }
  462. int C_GuiObject::screenToClientX(int x) {
  463. ASSERT(inited);
  464. scriptVar a = MAKE_SCRIPT_INT(x);
  465. scriptVar *params[1] = {&a};
  466. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclientx_id, params));
  467. }
  468. int C_GuiObject::screenToClientY(int y) {
  469. ASSERT(inited);
  470. scriptVar a = MAKE_SCRIPT_INT(y);
  471. scriptVar *params[1] = {&a};
  472. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclienty_id, params));
  473. }
  474. int C_GuiObject::screenToClientW(int w) {
  475. ASSERT(inited);
  476. scriptVar a = MAKE_SCRIPT_INT(w);
  477. scriptVar *params[1] = {&a};
  478. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclientw_id, params));
  479. }
  480. int C_GuiObject::screenToClientH(int h) {
  481. ASSERT(inited);
  482. scriptVar a = MAKE_SCRIPT_INT(h);
  483. scriptVar *params[1] = {&a};
  484. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), screentoclienth_id, params));
  485. }
  486. int C_GuiObject::getAutoWidth() {
  487. ASSERT(inited);
  488. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getautowidth_id, NULL));
  489. }
  490. int C_GuiObject::getAutoHeight() {
  491. ASSERT(inited);
  492. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getautoheight_id, NULL));
  493. }
  494. void C_GuiObject::setFocus() {
  495. ASSERT(inited);
  496. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setfocus_id, NULL);
  497. }
  498. void C_GuiObject::onChar(const wchar_t *c)
  499. {
  500. ASSERT(inited);
  501. scriptVar a = MAKE_SCRIPT_STRING(c);
  502. scriptVar *params[1] = {&a};
  503. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onchar_id, params);
  504. }
  505. void C_GuiObject::onAccelerator(const wchar_t *accel) {
  506. ASSERT(inited);
  507. scriptVar a = MAKE_SCRIPT_STRING(accel);
  508. scriptVar *params[1] = {&a};
  509. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onaccelerator_id, params);
  510. }
  511. int C_GuiObject::isMouseOverRect() {
  512. ASSERT(inited);
  513. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ismouseoverrect_id, NULL));
  514. }
  515. ScriptObject *C_GuiObject::getInterface(const wchar_t *interface_guid)
  516. {
  517. ASSERT(inited);
  518. scriptVar a = MAKE_SCRIPT_STRING(interface_guid);
  519. scriptVar *params[1] = {&a};
  520. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getinterface_id, params));
  521. }
  522. void C_GuiObject::onKeyDown(int vk_code) {
  523. ASSERT(inited);
  524. scriptVar a = MAKE_SCRIPT_INT(vk_code);
  525. scriptVar *params[1] = {&a};
  526. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onkeydown_id, params);
  527. }
  528. void C_GuiObject::onKeyUp(int vk_code) {
  529. ASSERT(inited);
  530. scriptVar a = MAKE_SCRIPT_INT(vk_code);
  531. scriptVar *params[1] = {&a};
  532. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onkeyup_id, params);
  533. }
  534. void C_GuiObject::onGetFocus() {
  535. ASSERT(inited);
  536. WASABI_API_MAKI->maki_callFunction(getScriptObject(), ongetfocus_id, NULL);
  537. }
  538. void C_GuiObject::onKillFocus() {
  539. ASSERT(inited);
  540. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onkillfocus_id, NULL);
  541. }
  542. int C_GuiObject::sendAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2) {
  543. ASSERT(inited);
  544. scriptVar a = MAKE_SCRIPT_STRING(action);
  545. scriptVar b = MAKE_SCRIPT_STRING(param);
  546. scriptVar c = MAKE_SCRIPT_INT(x);
  547. scriptVar d = MAKE_SCRIPT_INT(y);
  548. scriptVar e = MAKE_SCRIPT_INT((int)p1);
  549. scriptVar f = MAKE_SCRIPT_INT((int)p2);
  550. scriptVar *params[6] = {&a, &b, &c, &d, &e, &f};
  551. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), sendaction_id, params));
  552. }
  553. int C_GuiObject::onAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2, ScriptObject *source)
  554. {
  555. ASSERT(inited);
  556. scriptVar a = MAKE_SCRIPT_STRING(action);
  557. scriptVar b = MAKE_SCRIPT_STRING(param);
  558. scriptVar c = MAKE_SCRIPT_INT(x);
  559. scriptVar d = MAKE_SCRIPT_INT(y);
  560. scriptVar e = MAKE_SCRIPT_INT((int)p1);
  561. scriptVar f = MAKE_SCRIPT_INT((int)p2);
  562. scriptVar g = MAKE_SCRIPT_OBJECT(source);
  563. scriptVar *params[7] = {&a, &b, &c, &d, &e, &f, &g};
  564. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onaction_id, params));
  565. }
  566. int C_GuiObject::loaded=0;
  567. int C_GuiObject::show_id=0;
  568. int C_GuiObject::hide_id=0;
  569. int C_GuiObject::isvisible_id=0;
  570. int C_GuiObject::onsetvisible_id=0;
  571. int C_GuiObject::setalpha_id=0;
  572. int C_GuiObject::getalpha_id=0;
  573. int C_GuiObject::onleftbuttonup_id=0;
  574. int C_GuiObject::onleftbuttondown_id=0;
  575. int C_GuiObject::onrightbuttonup_id=0;
  576. int C_GuiObject::onrightbuttondown_id=0;
  577. int C_GuiObject::onrightbuttondblclk_id=0;
  578. int C_GuiObject::onleftbuttondblclk_id=0;
  579. int C_GuiObject::onmousemove_id=0;
  580. int C_GuiObject::onenterarea_id=0;
  581. int C_GuiObject::onleavearea_id=0;
  582. int C_GuiObject::setenabled_id=0;
  583. int C_GuiObject::getenabled_id=0;
  584. int C_GuiObject::onenable_id=0;
  585. int C_GuiObject::resize_id=0;
  586. int C_GuiObject::onresize_id=0;
  587. int C_GuiObject::ismouseover_id=0;
  588. int C_GuiObject::getleft_id=0;
  589. int C_GuiObject::gettop_id=0;
  590. int C_GuiObject::getwidth_id=0;
  591. int C_GuiObject::getheight_id=0;
  592. int C_GuiObject::settargetx_id=0;
  593. int C_GuiObject::settargety_id=0;
  594. int C_GuiObject::settargetw_id=0;
  595. int C_GuiObject::settargeth_id=0;
  596. int C_GuiObject::settargeta_id=0;
  597. int C_GuiObject::settargetspeed_id=0;
  598. int C_GuiObject::gototarget_id=0;
  599. int C_GuiObject::ontargetreached_id=0;
  600. int C_GuiObject::canceltarget_id=0;
  601. int C_GuiObject::reversetarget_id=0;
  602. int C_GuiObject::onstartup_id=0;
  603. int C_GuiObject::isgoingtotarget_id=0;
  604. int C_GuiObject::setxmlparam_id=0;
  605. int C_GuiObject::getxmlparam_id=0;
  606. int C_GuiObject::init_id=0;
  607. int C_GuiObject::bringtofront_id=0;
  608. int C_GuiObject::bringtoback_id=0;
  609. int C_GuiObject::bringabove_id=0;
  610. int C_GuiObject::bringbelow_id=0;
  611. int C_GuiObject::getguix_id=0;
  612. int C_GuiObject::getguiy_id=0;
  613. int C_GuiObject::getguiw_id=0;
  614. int C_GuiObject::getguih_id=0;
  615. int C_GuiObject::getguirelatx_id=0;
  616. int C_GuiObject::getguirelaty_id=0;
  617. int C_GuiObject::getguirelatw_id=0;
  618. int C_GuiObject::getguirelath_id=0;
  619. int C_GuiObject::isactive_id=0;
  620. int C_GuiObject::getparent_id=0;
  621. int C_GuiObject::getparentlayout_id=0;
  622. int C_GuiObject::gettopparent_id=0;
  623. int C_GuiObject::runmodal_id=0;
  624. int C_GuiObject::endmodal_id=0;
  625. int C_GuiObject::findobject_id=0;
  626. int C_GuiObject::findobjectxy_id=0;
  627. int C_GuiObject::getname_id=0;
  628. int C_GuiObject::clienttoscreenx_id=0;
  629. int C_GuiObject::clienttoscreeny_id=0;
  630. int C_GuiObject::clienttoscreenw_id=0;
  631. int C_GuiObject::clienttoscreenh_id=0;
  632. int C_GuiObject::screentoclientx_id=0;
  633. int C_GuiObject::screentoclienty_id=0;
  634. int C_GuiObject::screentoclientw_id=0;
  635. int C_GuiObject::screentoclienth_id=0;
  636. int C_GuiObject::getautowidth_id=0;
  637. int C_GuiObject::getautoheight_id=0;
  638. int C_GuiObject::setfocus_id=0;
  639. int C_GuiObject::onchar_id=0;
  640. int C_GuiObject::onaccelerator_id=0;
  641. int C_GuiObject::ismouseoverrect_id=0;
  642. int C_GuiObject::getinterface_id=0;
  643. int C_GuiObject::onkeydown_id=0;
  644. int C_GuiObject::onkeyup_id=0;
  645. int C_GuiObject::ongetfocus_id=0;
  646. int C_GuiObject::onkillfocus_id=0;
  647. int C_GuiObject::sendaction_id=0;
  648. int C_GuiObject::onaction_id=0;