h_guitree.cpp 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* This file was generated by Maki Compiler, do not edit manually */
  2. #include <precomp.h>
  3. #include <api/script/objcontroller.h>
  4. #include "h_guitree.h"
  5. H_GuiTree::H_GuiTree(ScriptObject *o) : H_GuiObject(o) {
  6. inited = 0;
  7. obj = NULL;
  8. H_hook(o);
  9. }
  10. H_GuiTree::H_GuiTree() {
  11. inited = 0;
  12. obj = NULL;
  13. }
  14. void H_GuiTree::H_hook(ScriptObject *o) {
  15. ASSERT(!inited);
  16. ScriptObjectController *controller = o->vcpu_getController();
  17. obj = controller->cast(o, guiTreeGuid);
  18. if (obj != o && obj != NULL)
  19. o = obj;
  20. else
  21. obj = NULL;
  22. addMonitorObject(o, &guiTreeGuid);
  23. int iter = WASABI_API_APP->app_getInitCount();
  24. if (!loaded || loaded != iter) {
  25. onwantautocontextmenu_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onWantAutoContextMenu", this);
  26. onmousewheelup_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onMouseWheelUp", this);
  27. onmousewheeldown_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onMouseWheelDown", this);
  28. oncontextmenu_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onContextMenu", this);
  29. onchar_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onChar", this);
  30. onitemrecvdrop_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onItemRecvDrop", this);
  31. onlabelchange_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onLabelChange", this);
  32. onitemselected_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onItemSelected", this);
  33. onitemdeselected_id= WASABI_API_MAKI->maki_addDlfRef(o->vcpu_getController(), L"onItemDeselected", this);
  34. loaded = 1;
  35. }
  36. inited=1;
  37. }
  38. H_GuiTree::~H_GuiTree() {
  39. if (!inited) return;
  40. WASABI_API_MAKI->maki_remDlfRef(this);
  41. }
  42. ScriptObject *H_GuiTree::getHookedObject() {
  43. if (obj != NULL) return obj;
  44. return H_GUITREE_PARENT::getHookedObject();
  45. }
  46. int H_GuiTree::eventCallback(ScriptObject *object, int dlfid, scriptVar **params, int nparams) {
  47. if (object != getHookedObject()) return 0;
  48. if (H_GUITREE_PARENT::eventCallback(object, dlfid, params, nparams)) return 1;
  49. if (dlfid == onwantautocontextmenu_id) { hook_onWantAutoContextMenu(); return 1; }
  50. if (dlfid == onmousewheelup_id) { hook_onMouseWheelUp(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
  51. if (dlfid == onmousewheeldown_id) { hook_onMouseWheelDown(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
  52. if (dlfid == oncontextmenu_id) { hook_onContextMenu(GET_SCRIPT_INT(*params[0]), GET_SCRIPT_INT(*params[1])); return 1; }
  53. if (dlfid == onchar_id) { hook_onChar(GET_SCRIPT_INT(*params[0])); return 1; }
  54. if (dlfid == onitemrecvdrop_id) { hook_onItemRecvDrop(GET_SCRIPT_OBJECT(*params[0])); return 1; }
  55. if (dlfid == onlabelchange_id) { hook_onLabelChange(GET_SCRIPT_OBJECT(*params[0])); return 1; }
  56. if (dlfid == onitemselected_id) { hook_onItemSelected(GET_SCRIPT_OBJECT(*params[0])); return 1; }
  57. if (dlfid == onitemdeselected_id) { hook_onItemDeselected(GET_SCRIPT_OBJECT(*params[0])); return 1; }
  58. return 0;
  59. }
  60. int H_GuiTree::onwantautocontextmenu_id=0;
  61. int H_GuiTree::onmousewheelup_id=0;
  62. int H_GuiTree::onmousewheeldown_id=0;
  63. int H_GuiTree::oncontextmenu_id=0;
  64. int H_GuiTree::onchar_id=0;
  65. int H_GuiTree::onitemrecvdrop_id=0;
  66. int H_GuiTree::onlabelchange_id=0;
  67. int H_GuiTree::onitemselected_id=0;
  68. int H_GuiTree::onitemdeselected_id=0;
  69. int H_GuiTree::loaded=0;