c_treeitem.cpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /* This file was generated by Maki Compiler, do not edit manually */
  2. #include <precomp.h>
  3. #include "c_treeitem.h"
  4. #include <api/script/objcontroller.h>
  5. C_TreeItem::C_TreeItem(ScriptObject *object) : C_RootObject(object) {
  6. inited = 0;
  7. obj = NULL;
  8. C_hook(object);
  9. }
  10. C_TreeItem::C_TreeItem() {
  11. inited = 0;
  12. obj = NULL;
  13. }
  14. void C_TreeItem::C_hook(ScriptObject *object) {
  15. ASSERT(!inited);
  16. ScriptObjectController *controller = object->vcpu_getController();
  17. obj = controller->cast(object, treeItemGuid);
  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. getnumchildren_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumChildren", this);
  26. setlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setLabel", this);
  27. getlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getLabel", this);
  28. ensurevisible_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"ensureVisible", this);
  29. getnthchild_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNthChild", this);
  30. getchild_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getChild", this);
  31. getchildsibling_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getChildSibling", this);
  32. getsibling_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSibling", this);
  33. getparent_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getParent", this);
  34. editlabel_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"editLabel", this);
  35. hassubitems_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"hasSubItems", this);
  36. setsorted_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setSorted", this);
  37. setchildtab_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setChildTab", this);
  38. issorted_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isSorted", this);
  39. iscollapsed_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isCollapsed", this);
  40. isexpanded_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isExpanded", this);
  41. invalidate_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"invalidate", this);
  42. isselected_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isSelected", this);
  43. ishilited_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isHilited", this);
  44. sethilited_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setHilited", this);
  45. collapse_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"collapse", this);
  46. expand_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"expand", this);
  47. gettree_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getTree", this);
  48. ontreeadd_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onTreeAdd", this);
  49. ontreeremove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onTreeRemove", this);
  50. onselect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSelect", this);
  51. ondeselect_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onDeselect", this);
  52. onleftdoubleclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onLeftDoubleClick", this);
  53. onrightdoubleclick_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onRightDoubleClick", this);
  54. onchar_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onChar", this);
  55. onexpand_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onExpand", this);
  56. oncollapse_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onCollapse", this);
  57. onbeginlabeledit_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onBeginLabelEdit", this);
  58. onendlabeledit_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEndLabelEdit", this);
  59. oncontextmenu_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onContextMenu", this);
  60. }
  61. inited = 1;
  62. }
  63. C_TreeItem::~C_TreeItem() {
  64. }
  65. ScriptObject *C_TreeItem::getScriptObject() {
  66. if (obj != NULL) return obj;
  67. return C_TREEITEM_PARENT::getScriptObject();
  68. }
  69. int C_TreeItem::getNumChildren() {
  70. ASSERT(inited);
  71. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumchildren_id, NULL));
  72. }
  73. void C_TreeItem::setLabel(const wchar_t *label)
  74. {
  75. ASSERT(inited);
  76. scriptVar a = MAKE_SCRIPT_STRING(label);
  77. scriptVar *params[1] = {&a};
  78. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setlabel_id, params);
  79. }
  80. const wchar_t *C_TreeItem::getLabel()
  81. {
  82. ASSERT(inited);
  83. return GET_SCRIPT_STRING(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getlabel_id, NULL));
  84. }
  85. void C_TreeItem::ensureVisible() {
  86. ASSERT(inited);
  87. WASABI_API_MAKI->maki_callFunction(getScriptObject(), ensurevisible_id, NULL);
  88. }
  89. ScriptObject *C_TreeItem::getNthChild(int nth) {
  90. ASSERT(inited);
  91. scriptVar a = MAKE_SCRIPT_INT(nth);
  92. scriptVar *params[1] = {&a};
  93. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnthchild_id, params));
  94. }
  95. ScriptObject *C_TreeItem::getChild() {
  96. ASSERT(inited);
  97. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getchild_id, NULL));
  98. }
  99. ScriptObject *C_TreeItem::getChildSibling(ScriptObject *_item) {
  100. ASSERT(inited);
  101. scriptVar a = MAKE_SCRIPT_OBJECT(_item);
  102. scriptVar *params[1] = {&a};
  103. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getchildsibling_id, params));
  104. }
  105. ScriptObject *C_TreeItem::getSibling() {
  106. ASSERT(inited);
  107. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsibling_id, NULL));
  108. }
  109. ScriptObject *C_TreeItem::getParent() {
  110. ASSERT(inited);
  111. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getparent_id, NULL));
  112. }
  113. void C_TreeItem::editLabel() {
  114. ASSERT(inited);
  115. WASABI_API_MAKI->maki_callFunction(getScriptObject(), editlabel_id, NULL);
  116. }
  117. int C_TreeItem::hasSubItems() {
  118. ASSERT(inited);
  119. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), hassubitems_id, NULL));
  120. }
  121. void C_TreeItem::setSorted(int issorted) {
  122. ASSERT(inited);
  123. scriptVar a = MAKE_SCRIPT_INT(issorted);
  124. scriptVar *params[1] = {&a};
  125. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setsorted_id, params);
  126. }
  127. void C_TreeItem::setChildTab(int haschildtab) {
  128. ASSERT(inited);
  129. scriptVar a = MAKE_SCRIPT_INT(haschildtab);
  130. scriptVar *params[1] = {&a};
  131. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setchildtab_id, params);
  132. }
  133. int C_TreeItem::isSorted() {
  134. ASSERT(inited);
  135. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), issorted_id, NULL));
  136. }
  137. int C_TreeItem::isCollapsed() {
  138. ASSERT(inited);
  139. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), iscollapsed_id, NULL));
  140. }
  141. int C_TreeItem::isExpanded() {
  142. ASSERT(inited);
  143. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isexpanded_id, NULL));
  144. }
  145. void C_TreeItem::invalidate() {
  146. ASSERT(inited);
  147. WASABI_API_MAKI->maki_callFunction(getScriptObject(), invalidate_id, NULL);
  148. }
  149. int C_TreeItem::isSelected() {
  150. ASSERT(inited);
  151. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), isselected_id, NULL));
  152. }
  153. int C_TreeItem::isHilited() {
  154. ASSERT(inited);
  155. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), ishilited_id, NULL));
  156. }
  157. void C_TreeItem::setHilited(int ishilited) {
  158. ASSERT(inited);
  159. scriptVar a = MAKE_SCRIPT_INT(ishilited);
  160. scriptVar *params[1] = {&a};
  161. WASABI_API_MAKI->maki_callFunction(getScriptObject(), sethilited_id, params);
  162. }
  163. int C_TreeItem::collapse() {
  164. ASSERT(inited);
  165. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), collapse_id, NULL));
  166. }
  167. int C_TreeItem::expand() {
  168. ASSERT(inited);
  169. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), expand_id, NULL));
  170. }
  171. ScriptObject *C_TreeItem::getTree() {
  172. ASSERT(inited);
  173. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), gettree_id, NULL));
  174. }
  175. void C_TreeItem::onTreeAdd() {
  176. ASSERT(inited);
  177. WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontreeadd_id, NULL);
  178. }
  179. void C_TreeItem::onTreeRemove() {
  180. ASSERT(inited);
  181. WASABI_API_MAKI->maki_callFunction(getScriptObject(), ontreeremove_id, NULL);
  182. }
  183. void C_TreeItem::onSelect() {
  184. ASSERT(inited);
  185. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onselect_id, NULL);
  186. }
  187. void C_TreeItem::onDeselect() {
  188. ASSERT(inited);
  189. WASABI_API_MAKI->maki_callFunction(getScriptObject(), ondeselect_id, NULL);
  190. }
  191. int C_TreeItem::onLeftDoubleClick() {
  192. ASSERT(inited);
  193. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onleftdoubleclick_id, NULL));
  194. }
  195. int C_TreeItem::onRightDoubleClick() {
  196. ASSERT(inited);
  197. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onrightdoubleclick_id, NULL));
  198. }
  199. int C_TreeItem::onChar(int key) {
  200. ASSERT(inited);
  201. scriptVar a = MAKE_SCRIPT_INT(key);
  202. scriptVar *params[1] = {&a};
  203. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onchar_id, params));
  204. }
  205. void C_TreeItem::onExpand() {
  206. ASSERT(inited);
  207. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onexpand_id, NULL);
  208. }
  209. void C_TreeItem::onCollapse() {
  210. ASSERT(inited);
  211. WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncollapse_id, NULL);
  212. }
  213. int C_TreeItem::onBeginLabelEdit() {
  214. ASSERT(inited);
  215. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onbeginlabeledit_id, NULL));
  216. }
  217. int C_TreeItem::onEndLabelEdit(const wchar_t *newlabel)
  218. {
  219. ASSERT(inited);
  220. scriptVar a = MAKE_SCRIPT_STRING(newlabel);
  221. scriptVar *params[1] = {&a};
  222. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), onendlabeledit_id, params));
  223. }
  224. int C_TreeItem::onContextMenu(int x, int y) {
  225. ASSERT(inited);
  226. scriptVar a = MAKE_SCRIPT_INT(x);
  227. scriptVar b = MAKE_SCRIPT_INT(y);
  228. scriptVar *params[2] = {&a, &b};
  229. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncontextmenu_id, params));
  230. }
  231. int C_TreeItem::loaded=0;
  232. int C_TreeItem::getnumchildren_id=0;
  233. int C_TreeItem::setlabel_id=0;
  234. int C_TreeItem::getlabel_id=0;
  235. int C_TreeItem::ensurevisible_id=0;
  236. int C_TreeItem::getnthchild_id=0;
  237. int C_TreeItem::getchild_id=0;
  238. int C_TreeItem::getchildsibling_id=0;
  239. int C_TreeItem::getsibling_id=0;
  240. int C_TreeItem::getparent_id=0;
  241. int C_TreeItem::editlabel_id=0;
  242. int C_TreeItem::hassubitems_id=0;
  243. int C_TreeItem::setsorted_id=0;
  244. int C_TreeItem::setchildtab_id=0;
  245. int C_TreeItem::issorted_id=0;
  246. int C_TreeItem::iscollapsed_id=0;
  247. int C_TreeItem::isexpanded_id=0;
  248. int C_TreeItem::invalidate_id=0;
  249. int C_TreeItem::isselected_id=0;
  250. int C_TreeItem::ishilited_id=0;
  251. int C_TreeItem::sethilited_id=0;
  252. int C_TreeItem::collapse_id=0;
  253. int C_TreeItem::expand_id=0;
  254. int C_TreeItem::gettree_id=0;
  255. int C_TreeItem::ontreeadd_id=0;
  256. int C_TreeItem::ontreeremove_id=0;
  257. int C_TreeItem::onselect_id=0;
  258. int C_TreeItem::ondeselect_id=0;
  259. int C_TreeItem::onleftdoubleclick_id=0;
  260. int C_TreeItem::onrightdoubleclick_id=0;
  261. int C_TreeItem::onchar_id=0;
  262. int C_TreeItem::onexpand_id=0;
  263. int C_TreeItem::oncollapse_id=0;
  264. int C_TreeItem::onbeginlabeledit_id=0;
  265. int C_TreeItem::onendlabeledit_id=0;
  266. int C_TreeItem::oncontextmenu_id=0;