1
0

c_group.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* This file was generated by Maki Compiler, do not edit manually */
  2. #include <precomp.h>
  3. #include "c_group.h"
  4. #include <api/script/objcontroller.h>
  5. C_Group::C_Group(ScriptObject *object) : C_GuiObject(object) {
  6. inited = 0;
  7. obj = NULL;
  8. C_hook(object);
  9. }
  10. C_Group::C_Group() {
  11. inited = 0;
  12. obj = NULL;
  13. }
  14. void C_Group::C_hook(ScriptObject *object) {
  15. ASSERT(!inited);
  16. ScriptObjectController *controller = object->vcpu_getController();
  17. obj = controller->cast(object, groupGuid);
  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. getobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getObject", this);
  26. getnumobjects_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getNumObjects", this);
  27. enumobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"enumObject", this);
  28. oncreateobject_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onCreateObject", this);
  29. getmouseposx_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getMousePosX", this);
  30. getmouseposy_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getMousePosY", this);
  31. islayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isLayout", this);
  32. }
  33. inited = 1;
  34. }
  35. C_Group::~C_Group() {
  36. }
  37. ScriptObject *C_Group::getScriptObject() {
  38. if (obj != NULL) return obj;
  39. return C_GROUP_PARENT::getScriptObject();
  40. }
  41. ScriptObject *C_Group::getObject(const wchar_t *object_id)
  42. {
  43. ASSERT(inited);
  44. scriptVar a = MAKE_SCRIPT_STRING(object_id);
  45. scriptVar *params[1] = {&a};
  46. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getobject_id, params));
  47. }
  48. int C_Group::getNumObjects() {
  49. ASSERT(inited);
  50. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getnumobjects_id, NULL));
  51. }
  52. ScriptObject *C_Group::enumObject(int num) {
  53. ASSERT(inited);
  54. scriptVar a = MAKE_SCRIPT_INT(num);
  55. scriptVar *params[1] = {&a};
  56. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), enumobject_id, params));
  57. }
  58. void C_Group::onCreateObject(ScriptObject *newobj) {
  59. ASSERT(inited);
  60. scriptVar a = MAKE_SCRIPT_OBJECT(newobj);
  61. scriptVar *params[1] = {&a};
  62. WASABI_API_MAKI->maki_callFunction(getScriptObject(), oncreateobject_id, params);
  63. }
  64. int C_Group::getMousePosX() {
  65. ASSERT(inited);
  66. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getmouseposx_id, NULL));
  67. }
  68. int C_Group::getMousePosY() {
  69. ASSERT(inited);
  70. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getmouseposy_id, NULL));
  71. }
  72. int C_Group::isLayout() {
  73. ASSERT(inited);
  74. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), islayout_id, NULL));
  75. }
  76. int C_Group::loaded=0;
  77. int C_Group::getobject_id=0;
  78. int C_Group::getnumobjects_id=0;
  79. int C_Group::enumobject_id=0;
  80. int C_Group::oncreateobject_id=0;
  81. int C_Group::getmouseposx_id=0;
  82. int C_Group::getmouseposy_id=0;
  83. int C_Group::islayout_id=0;