c_layout.cpp 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /* This file was generated by Maki Compiler, do not edit manually */
  2. #include <precomp.h>
  3. #include "c_layout.h"
  4. #include <api/script/objcontroller.h>
  5. C_Layout::C_Layout(ScriptObject *object) : C_Group(object) {
  6. inited = 0;
  7. obj = NULL;
  8. C_hook(object);
  9. }
  10. C_Layout::C_Layout() {
  11. inited = 0;
  12. obj = NULL;
  13. }
  14. void C_Layout::C_hook(ScriptObject *object) {
  15. ASSERT(!inited);
  16. ScriptObjectController *controller = object->vcpu_getController();
  17. obj = controller->cast(object, layoutGuid);
  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. ondock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onDock", this);
  26. onundock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onUndock", this);
  27. onscale_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onScale", this);
  28. getscale_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getScale", this);
  29. setscale_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setScale", this);
  30. setdesktopalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setDesktopAlpha", this);
  31. getdesktopalpha_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getDesktopAlpha", this);
  32. getcontainer_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getContainer", this);
  33. center_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"center", this);
  34. onmove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMove", this);
  35. onendmove_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onEndMove", this);
  36. onuserresize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onUserResize", this);
  37. snapadjust_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"snapAdjust", this);
  38. getsnapadjusttop_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustTop", this);
  39. getsnapadjustright_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustRight", this);
  40. getsnapadjustleft_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustLeft", this);
  41. getsnapadjustbottom_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"getSnapAdjustBottom", this);
  42. setredrawonresize_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"setRedrawOnResize", this);
  43. beforeredock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"beforeRedock", this);
  44. redock_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"redock", this);
  45. istransparencysafe_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isTransparencySafe", this);
  46. islayoutanimationsafe_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"isLayoutAnimationSafe", this);
  47. onmouseenterlayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseEnterLayout", this);
  48. onmouseleavelayout_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onMouseLeaveLayout", this);
  49. onsnapadjustchanged_id = WASABI_API_MAKI->maki_addDlfRef(controller, L"onSnapAdjustChanged", this);
  50. }
  51. inited = 1;
  52. }
  53. C_Layout::~C_Layout() {
  54. }
  55. ScriptObject *C_Layout::getScriptObject() {
  56. if (obj != NULL) return obj;
  57. return C_LAYOUT_PARENT::getScriptObject();
  58. }
  59. void C_Layout::onDock() {
  60. ASSERT(inited);
  61. WASABI_API_MAKI->maki_callFunction(getScriptObject(), ondock_id, NULL);
  62. }
  63. void C_Layout::onUndock() {
  64. ASSERT(inited);
  65. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onundock_id, NULL);
  66. }
  67. void C_Layout::onScale(double newscalevalue) {
  68. ASSERT(inited);
  69. scriptVar a = MAKE_SCRIPT_DOUBLE(newscalevalue);
  70. scriptVar *params[1] = {&a};
  71. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onscale_id, params);
  72. }
  73. double C_Layout::getScale() {
  74. ASSERT(inited);
  75. return GET_SCRIPT_DOUBLE(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getscale_id, NULL));
  76. }
  77. void C_Layout::setScale(double scalevalue) {
  78. ASSERT(inited);
  79. scriptVar a = MAKE_SCRIPT_DOUBLE(scalevalue);
  80. scriptVar *params[1] = {&a};
  81. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setscale_id, params);
  82. }
  83. void C_Layout::setDesktopAlpha(int onoff) {
  84. ASSERT(inited);
  85. scriptVar a = MAKE_SCRIPT_INT(onoff);
  86. scriptVar *params[1] = {&a};
  87. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setdesktopalpha_id, params);
  88. }
  89. int C_Layout::getDesktopAlpha() {
  90. ASSERT(inited);
  91. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getdesktopalpha_id, NULL));
  92. }
  93. ScriptObject *C_Layout::getContainer() {
  94. ASSERT(inited);
  95. return GET_SCRIPT_OBJECT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getcontainer_id, NULL));
  96. }
  97. void C_Layout::center() {
  98. ASSERT(inited);
  99. WASABI_API_MAKI->maki_callFunction(getScriptObject(), center_id, NULL);
  100. }
  101. void C_Layout::onMove() {
  102. ASSERT(inited);
  103. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmove_id, NULL);
  104. }
  105. void C_Layout::onEndMove() {
  106. ASSERT(inited);
  107. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onendmove_id, NULL);
  108. }
  109. void C_Layout::onUserResize(int x, int y, int w, int h) {
  110. ASSERT(inited);
  111. scriptVar a = MAKE_SCRIPT_INT(x);
  112. scriptVar b = MAKE_SCRIPT_INT(y);
  113. scriptVar c = MAKE_SCRIPT_INT(w);
  114. scriptVar d = MAKE_SCRIPT_INT(h);
  115. scriptVar *params[4] = {&a, &b, &c, &d};
  116. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onuserresize_id, params);
  117. }
  118. void C_Layout::snapAdjust(int left, int top, int right, int bottom) {
  119. ASSERT(inited);
  120. scriptVar a = MAKE_SCRIPT_INT(left);
  121. scriptVar b = MAKE_SCRIPT_INT(top);
  122. scriptVar c = MAKE_SCRIPT_INT(right);
  123. scriptVar d = MAKE_SCRIPT_INT(bottom);
  124. scriptVar *params[4] = {&a, &b, &c, &d};
  125. WASABI_API_MAKI->maki_callFunction(getScriptObject(), snapadjust_id, params);
  126. }
  127. int C_Layout::getSnapAdjustTop() {
  128. ASSERT(inited);
  129. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjusttop_id, NULL));
  130. }
  131. int C_Layout::getSnapAdjustRight() {
  132. ASSERT(inited);
  133. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjustright_id, NULL));
  134. }
  135. int C_Layout::getSnapAdjustLeft() {
  136. ASSERT(inited);
  137. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjustleft_id, NULL));
  138. }
  139. int C_Layout::getSnapAdjustBottom() {
  140. ASSERT(inited);
  141. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), getsnapadjustbottom_id, NULL));
  142. }
  143. void C_Layout::setRedrawOnResize(int wantredrawonresize) {
  144. ASSERT(inited);
  145. scriptVar a = MAKE_SCRIPT_INT(wantredrawonresize);
  146. scriptVar *params[1] = {&a};
  147. WASABI_API_MAKI->maki_callFunction(getScriptObject(), setredrawonresize_id, params);
  148. }
  149. void C_Layout::beforeRedock() {
  150. ASSERT(inited);
  151. WASABI_API_MAKI->maki_callFunction(getScriptObject(), beforeredock_id, NULL);
  152. }
  153. void C_Layout::redock() {
  154. ASSERT(inited);
  155. WASABI_API_MAKI->maki_callFunction(getScriptObject(), redock_id, NULL);
  156. }
  157. int C_Layout::isTransparencySafe() {
  158. ASSERT(inited);
  159. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), istransparencysafe_id, NULL));
  160. }
  161. int C_Layout::isLayoutAnimationSafe() {
  162. ASSERT(inited);
  163. return GET_SCRIPT_INT(WASABI_API_MAKI->maki_callFunction(getScriptObject(), islayoutanimationsafe_id, NULL));
  164. }
  165. void C_Layout::onMouseEnterLayout() {
  166. ASSERT(inited);
  167. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmouseenterlayout_id, NULL);
  168. }
  169. void C_Layout::onMouseLeaveLayout() {
  170. ASSERT(inited);
  171. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onmouseleavelayout_id, NULL);
  172. }
  173. void C_Layout::onSnapAdjustChanged() {
  174. ASSERT(inited);
  175. WASABI_API_MAKI->maki_callFunction(getScriptObject(), onsnapadjustchanged_id, NULL);
  176. }
  177. int C_Layout::loaded=0;
  178. int C_Layout::ondock_id=0;
  179. int C_Layout::onundock_id=0;
  180. int C_Layout::onscale_id=0;
  181. int C_Layout::getscale_id=0;
  182. int C_Layout::setscale_id=0;
  183. int C_Layout::setdesktopalpha_id=0;
  184. int C_Layout::getdesktopalpha_id=0;
  185. int C_Layout::getcontainer_id=0;
  186. int C_Layout::center_id=0;
  187. int C_Layout::onmove_id=0;
  188. int C_Layout::onendmove_id=0;
  189. int C_Layout::onuserresize_id=0;
  190. int C_Layout::snapadjust_id=0;
  191. int C_Layout::getsnapadjusttop_id=0;
  192. int C_Layout::getsnapadjustright_id=0;
  193. int C_Layout::getsnapadjustleft_id=0;
  194. int C_Layout::getsnapadjustbottom_id=0;
  195. int C_Layout::setredrawonresize_id=0;
  196. int C_Layout::beforeredock_id=0;
  197. int C_Layout::redock_id=0;
  198. int C_Layout::istransparencysafe_id=0;
  199. int C_Layout::islayoutanimationsafe_id=0;
  200. int C_Layout::onmouseenterlayout_id=0;
  201. int C_Layout::onmouseleavelayout_id=0;
  202. int C_Layout::onsnapadjustchanged_id=0;