1
0

guiobject.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. #ifndef __GUIOBJECT_H
  2. #define __GUIOBJECT_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/nsguid.h>
  5. #include <api/service/waservicefactory.h>
  6. class ifc_window;
  7. class ScriptObject; // scriptobj.h
  8. class GuiObject; // this file
  9. class RootObject; // rootobj.h
  10. class svc_xuiObject; // studio/services/svc_xuiobject.h
  11. class GuiStatusCallback;
  12. class AppCmds;
  13. class CfgItem;
  14. class FindObjectCallback;
  15. class Group;
  16. class Layout;
  17. class GuiObject : public Dispatchable
  18. {
  19. public:
  20. ifc_window *guiobject_getRootWnd();
  21. void guiobject_setRootWnd(ifc_window *w);
  22. void guiobject_onInit();
  23. void guiobject_getGuiPosition(int *x, int *y, int *w, int *h, int *rx, int *ry, int *rw, int *rh);
  24. void guiobject_setGuiPosition(int *x, int *y, int *w, int *h, int *rx, int *ry, int *rw, int *rh);
  25. int guiobject_getAnchoragePosition(int *x1, int *x2, int *y1, int *y2, int *anchor); // returns anchor invalidation flag
  26. void guiobject_setAnchoragePosition(int *x1, int *x2, int *y1, int *y2, int *anchor);
  27. void guiobject_validateAnchorage(); // clears up anchor invalidation flag
  28. void guiobject_setParentGroup(Group *l);
  29. ScriptObject *guiobject_getScriptObject();
  30. RootObject *guiobject_getRootObject();
  31. Group *guiobject_getParentGroup();
  32. GuiObject *guiobject_getParent();
  33. Layout *guiobject_getParentLayout();
  34. int guiobject_wantAutoContextMenu();
  35. void guiobject_setId(const wchar_t *id);
  36. const wchar_t *guiobject_getId();
  37. void guiobject_setTargetX(int tx);
  38. void guiobject_setTargetY(int ty);
  39. void guiobject_setTargetW(int tw);
  40. void guiobject_setTargetH(int th);
  41. void guiobject_setTargetA(int th);
  42. void guiobject_setTargetSpeed(float s);
  43. void guiobject_gotoTarget(void);
  44. void guiobject_cancelTarget();
  45. void guiobject_reverseTarget(int reverse);
  46. int guiobject_getAutoWidth();
  47. int guiobject_getAutoHeight();
  48. int guiobject_movingToTarget();
  49. void guiobject_bringToFront();
  50. void guiobject_bringToBack();
  51. void guiobject_bringAbove(GuiObject *o);
  52. void guiobject_bringBelow(GuiObject *o);
  53. void guiobject_setClickThrough(int ct);
  54. int guiobject_isClickThrough();
  55. void guiobject_setAutoSysMetricsX(int a);
  56. void guiobject_setAutoSysMetricsY(int a);
  57. void guiobject_setAutoSysMetricsW(int a);
  58. void guiobject_setAutoSysMetricsH(int a);
  59. int guiobject_getAutoSysMetricsX();
  60. int guiobject_getAutoSysMetricsY();
  61. int guiobject_getAutoSysMetricsW();
  62. int guiobject_getAutoSysMetricsH();
  63. void guiobject_setRegionOp(int op);
  64. int guiobject_getRegionOp();
  65. void guiobject_setRectRgn(int rrgn);
  66. int guiobject_isRectRgn();
  67. void guiobject_setMover(int mover);
  68. int guiobject_getMover();
  69. FOURCC guiobject_getDropTarget();
  70. void guiobject_setDropTarget(const wchar_t *target);
  71. void guiobject_onLeftButtonDown(int x, int y);
  72. void guiobject_onLeftButtonUp(int x, int y);
  73. void guiobject_onRightButtonDown(int x, int y);
  74. void guiobject_onRightButtonUp(int x, int y);
  75. void guiobject_onLeftButtonDblClk(int x, int y);
  76. void guiobject_onRightButtonDblClk(int x, int y);
  77. void guiobject_onMouseMove(int x, int y);
  78. int guiobject_onMouseWheelUp(int click, int lines); // Need to return 1 if handled
  79. int guiobject_onMouseWheelDown(int click, int lines); // Need to return 1 if handled
  80. void guiobject_onEnterArea();
  81. void guiobject_onLeaveArea();
  82. void guiobject_onCancelCapture();
  83. void guiobject_setEnabled(int en);
  84. void guiobject_onEnable(int en);
  85. void guiobject_onResize(int x, int y, int w, int h);
  86. void guiobject_onSetVisible(int v);
  87. void guiobject_onTargetReached();
  88. void guiobject_setAlpha(int a);
  89. int guiobject_getAlpha();
  90. void guiobject_setActiveAlpha(int a);
  91. int guiobject_getActiveAlpha();
  92. void guiobject_setInactiveAlpha(int a);
  93. int guiobject_getInactiveAlpha();
  94. void guiobject_onStartup();
  95. const wchar_t *guiobject_getXmlParam(const wchar_t *param);
  96. int guiobject_setXmlParam(const wchar_t *param, const wchar_t *value);
  97. int guiobject_setXmlParamById(int id, const wchar_t *value);
  98. GuiObject *guiobject_getTopParent();
  99. #ifdef WASABI_COMPILE_WNDMGR
  100. int guiobject_runModal();
  101. void guiobject_endModal(int retcode);
  102. void guiobject_popParentLayout();
  103. void guiobject_registerStatusCB(GuiStatusCallback *cb);
  104. void guiobject_setStatusText(const wchar_t *text, int overlay=FALSE);
  105. void guiobject_addAppCmds(AppCmds *commands);
  106. void guiobject_removeAppCmds(AppCmds *commands);
  107. void guiobject_pushCompleted(int max=100);
  108. void guiobject_incCompleted(int add=1);
  109. void guiobject_setCompleted(int pos);
  110. void guiobject_popCompleted();
  111. #endif
  112. void guiobject_onChar(wchar_t c);
  113. void guiobject_onKeyDown(int vkcode);
  114. void guiobject_onKeyUp(int vkcode);
  115. svc_xuiObject *guiobject_getXuiService();
  116. void guiobject_setXuiService(svc_xuiObject *svc);
  117. waServiceFactory *guiobject_getXuiServiceFactory();
  118. void guiobject_setXuiServiceFactory(waServiceFactory *fac);
  119. GuiObject *guiobject_findObject(const wchar_t *id);
  120. GuiObject *guiobject_findObjectXY(int x, int y);
  121. GuiObject *guiobject_findObjectByInterface(GUID interface_guid);
  122. GuiObject *guiobject_findObjectByCallback(FindObjectCallback *cb);
  123. GuiObject *guiobject_findObjectChain(FindObjectCallback *cb, GuiObject *caller=NULL);
  124. const wchar_t *guiobject_getName();
  125. #ifdef WASABI_COMPILE_CONFIG
  126. void guiobject_setCfgAttrib(CfgItem *i, const wchar_t *attrib);
  127. CfgItem *guiobject_getCfgItem();
  128. const wchar_t *guiobject_getCfgAttrib();
  129. int guiobject_getCfgInt();
  130. void guiobject_setCfgInt(int i);
  131. float guiobject_getCfgFloat();
  132. void guiobject_setCfgFloat(float v);
  133. const wchar_t *guiobject_getCfgString();
  134. void guiobject_setCfgString(const wchar_t *s);
  135. int guiobject_hasCfgAttrib();
  136. #endif
  137. void guiobject_onGetFocus();
  138. void guiobject_onKillFocus();
  139. void guiobject_onAccelerator(const wchar_t *accel);
  140. int guiobject_onAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2, void *data, size_t datalen, ifc_window *source);
  141. int guiobject_wantFocus();
  142. void guiobject_setNoDoubleClick(int no);
  143. void guiobject_setNoLeftClick(int no);
  144. void guiobject_setNoRightClick(int no);
  145. void guiobject_setNoMouseMove(int no);
  146. void guiobject_setNoContextMenu(int no);
  147. void guiobject_setCursor(const wchar_t *c);
  148. void guiobject_setAppBar(int enabled);
  149. int guiobject_getAppBar();
  150. int guiobject_wantTranslation();
  151. int guiobject_dragEnter(ifc_window *sourceWnd);
  152. int guiobject_dragOver(int x, int y, ifc_window *sourceWnd);
  153. int guiobject_dragLeave(ifc_window *sourceWnd);
  154. enum {
  155. GUI_GETGUIPOSITION=10,
  156. GUI_GETANCHORAGEPOSITION=11,
  157. GUI_SETGUIPOSITION=20,
  158. GUI_SETANCHORAGEPOSITION=21,
  159. GUI_VALIDATEANCHORAGE=22,
  160. GUI_SETPARENTGROUP=30,
  161. GUI_GETPARENTGROUP=40,
  162. GUI_GETPARENT=45,
  163. GUI_GETPARENTLAYOUT=50,
  164. GUI_GETTOPPARENT=55,
  165. GUI_GETROOTWND=60,
  166. GUI_WANTAUTOCTXMENU=70,
  167. GUI_SETID=80,
  168. GUI_GETID=90,
  169. GUI_SETTARGETX=100,
  170. GUI_SETTARGETY=110,
  171. GUI_SETTARGETW=120,
  172. GUI_SETTARGETH=130,
  173. GUI_SETTARGETA=140,
  174. GUI_SETTARGETSPEED=150,
  175. GUI_GOTOTARGET=160,
  176. GUI_CANCELTARGET=161,
  177. GUI_REVERSETARGET=162,
  178. GUI_MOVINGTOTARGET=170,
  179. GUI_GETAUTOWIDTH=180,
  180. GUI_GETAUTOHEIGHT=190,
  181. GUI_BRINGTOFRONT=200,
  182. GUI_BRINGTOBACK=210,
  183. GUI_BRINGBELOW=220,
  184. GUI_BRINGABOVE=230,
  185. GUI_SETCLICKTHROUGH=240,
  186. GUI_ISCLICKTHROUGH=250,
  187. GUI_SETAUTOSMX=260,
  188. GUI_SETAUTOSMY=270,
  189. GUI_SETAUTOSMW=280,
  190. GUI_SETAUTOSMH=290,
  191. GUI_GETAUTOSMX=300,
  192. GUI_GETAUTOSMY=310,
  193. GUI_GETAUTOSMW=320,
  194. GUI_GETAUTOSMH=330,
  195. GUI_ONLEFTBUTTONDOWN=340,
  196. GUI_ONLEFTBUTTONUP=350,
  197. GUI_ONRIGHTBUTTONDOWN=360,
  198. GUI_ONRIGHTBUTTONUP=370,
  199. GUI_ONLEFTBUTTONDBLCLK=380,
  200. GUI_ONRIGHTBUTTONDBLCLK=390,
  201. GUI_ONMOUSEWHEELUP=394,
  202. GUI_ONMOUSEWHEELDOWN=396,
  203. GUI_ONMOUSEMOVE=400,
  204. GUI_ONENTERAREA=410,
  205. GUI_ONLEAVEAREA=420,
  206. GUI_ONENABLE=430,
  207. GUI_SETENABLED=431,
  208. GUI_ONRESIZE=440,
  209. GUI_ONSETVISIBLE=450,
  210. GUI_ONTARGETREACHED=460,
  211. GUI_SETALPHA=470,
  212. GUI_GETALPHA=480,
  213. GUI_SETACTIVEALPHA=490,
  214. GUI_GETACTIVEALPHA=500,
  215. GUI_SETINACTIVEALPHA=510,
  216. GUI_GETINACTIVEALPHA=520,
  217. GUI_ONSTARTUP=530,
  218. GUI_SETXMLPARAM=540,
  219. GUI_SETXMLPARAMBYID=541,
  220. GUI_GETXMLPARAM=542,
  221. // GUI_ONUNKNOWNXMLPARAM=545, retired
  222. GUI_SETROOTWND=550,
  223. GUI_GETSCRIPTOBJECT=560,
  224. GUI_GETROOTOBJECT=570,
  225. GUI_RUNMODAL=580,
  226. GUI_ENDMODAL=590,
  227. GUI_SETXUISVC=600,
  228. GUI_GETXUISVC=610,
  229. GUI_POPPARENTLAYOUT=620,
  230. GUI_SETREGIONOP=630,
  231. GUI_GETREGIONOP=640,
  232. GUI_SETRECTRGN=650,
  233. GUI_ISRECTRGN=660,
  234. GUI_REGISTERSTATUSCB=670,
  235. GUI_SETSTATUSTXT=680,
  236. GUI_ADDCTXTCMDS=690,
  237. GUI_REMCTXTCMDS=700,
  238. GUI_FINDOBJECT=800,
  239. GUI_FINDOBJECTBYGUID=801,
  240. GUI_FINDOBJECTBYCB=802,
  241. GUI_FINDOBJECTCHAIN=803,
  242. GUI_FINDOBJECTXY=804,
  243. GUI_GETNAME=805,
  244. GUI_GETMOVER=810,
  245. GUI_SETMOVER=820,
  246. GUI_GETDROPTARGET=830,
  247. GUI_SETDROPTARGET=840,
  248. GUI_ONCANCELCAPTURE=850,
  249. GUI_SETCFGATTRIB=860,
  250. GUI_GETCFGITEM=870,
  251. GUI_GETCFGATTRIB=880,
  252. GUI_SETCFGINT=890,
  253. GUI_GETCFGINT=900,
  254. GUI_GETCFGFLOAT=910,
  255. GUI_SETCFGFLOAT=920,
  256. GUI_SETCFGSTRING=930,
  257. GUI_GETCFGSTRING=940,
  258. GUI_HASATTRIB=950,
  259. GUI_PUSHCOMPLETED=1000,
  260. GUI_INCCOMPLETED=1010,
  261. GUI_SETCOMPLETED=1020,
  262. GUI_POPCOMPLETED=1030,
  263. GUI_ONCHAR=1100,
  264. GUI_ONKEYDOWN=1110,
  265. GUI_ONKEYUP=1120,
  266. GUI_ONGETFOCUS=1200,
  267. GUI_ONKILLFOCUS=1210,
  268. GUI_ONACCELERATOR=1300,
  269. GUI_ONACTION=1400,
  270. GUI_ONINIT=1500,
  271. GUI_WANTFOCUS=1600,
  272. GUI_SETNOMOUSEMOVE=1700,
  273. GUI_SETNOLEFTCLICK=1800,
  274. GUI_SETNORIGHTCLICK=1900,
  275. GUI_SETNODOUBLECLICK=2000,
  276. GUI_SETNOCONTEXTMENU=2100,
  277. GUI_SETCURSOR=2200,
  278. GUI_SETXUIFAC=2300,
  279. GUI_GETXUIFAC=2310,
  280. GUI_SETAPPBAR=2400,
  281. GUI_GETAPPBAR=2410,
  282. GUI_WANTTRANSLATION=2420,
  283. GUI_DRAGENTER = 2430,
  284. GUI_DRAGOVER = 2440,
  285. GUI_DRAGLEAVE = 2450,
  286. };
  287. operator ScriptObject *() { return (this == NULL) ? NULL : guiobject_getScriptObject(); }
  288. operator ifc_window *() { return (this == NULL) ? NULL : guiobject_getRootWnd(); }
  289. };
  290. inline void GuiObject::guiobject_getGuiPosition(int *x, int *y, int *w, int *h, int *rx, int *ry, int *rw, int *rh) {
  291. _voidcall(GUI_GETGUIPOSITION, x, y, w, h, rx, ry, rw, rh);
  292. }
  293. inline void GuiObject::guiobject_setGuiPosition(int *x, int *y, int *w, int *h, int *rx, int *ry, int *rw, int *rh) {
  294. _voidcall(GUI_SETGUIPOSITION, x, y, w, h, rx, ry, rw, rh);
  295. }
  296. inline int GuiObject::guiobject_getAnchoragePosition(int *x1, int *y1, int *x2, int *y2, int *anchor) {
  297. return _call(GUI_GETANCHORAGEPOSITION, 0, x1, y1, x2, y2, anchor);
  298. }
  299. inline void GuiObject::guiobject_setAnchoragePosition(int *x1, int *y1, int *x2, int *y2, int *anchor) {
  300. _voidcall(GUI_SETANCHORAGEPOSITION, x1, y1, x2, y2, anchor);
  301. }
  302. inline void GuiObject::guiobject_validateAnchorage() {
  303. _voidcall(GUI_VALIDATEANCHORAGE);
  304. }
  305. inline void GuiObject::guiobject_setParentGroup(Group *g) {
  306. _voidcall(GUI_SETPARENTGROUP, g);
  307. }
  308. inline Group *GuiObject::guiobject_getParentGroup() {
  309. return _call(GUI_GETPARENTGROUP, (Group *)NULL);
  310. }
  311. inline GuiObject *GuiObject::guiobject_getParent() {
  312. return _call(GUI_GETPARENT, (GuiObject *)NULL);
  313. }
  314. inline Layout *GuiObject::guiobject_getParentLayout() {
  315. return _call(GUI_GETPARENTLAYOUT, (Layout*)NULL);
  316. }
  317. inline GuiObject *GuiObject::guiobject_getTopParent() {
  318. return _call(GUI_GETTOPPARENT, (GuiObject *)NULL);
  319. }
  320. inline ifc_window *GuiObject::guiobject_getRootWnd() {
  321. return _call(GUI_GETROOTWND, (ifc_window *)NULL);
  322. }
  323. inline void GuiObject::guiobject_setRootWnd(ifc_window *r) {
  324. _voidcall(GUI_SETROOTWND, r);
  325. }
  326. inline int GuiObject::guiobject_wantAutoContextMenu() {
  327. return _call(GUI_WANTAUTOCTXMENU, 0);
  328. }
  329. inline void GuiObject::guiobject_setId(const wchar_t *id) {
  330. _voidcall(GUI_SETID, id);
  331. }
  332. inline const wchar_t *GuiObject::guiobject_getId() {
  333. return _call(GUI_GETID, (const wchar_t *)NULL);
  334. }
  335. inline void GuiObject::guiobject_setTargetX(int tx) {
  336. _voidcall(GUI_SETTARGETX, tx);
  337. }
  338. inline void GuiObject::guiobject_setTargetY(int ty) {
  339. _voidcall(GUI_SETTARGETY, ty);
  340. }
  341. inline void GuiObject::guiobject_setTargetW(int tw) {
  342. _voidcall(GUI_SETTARGETW, tw);
  343. }
  344. inline void GuiObject::guiobject_setTargetH(int th) {
  345. _voidcall(GUI_SETTARGETH, th);
  346. }
  347. inline void GuiObject::guiobject_setTargetA(int ta) {
  348. _voidcall(GUI_SETTARGETA, ta);
  349. }
  350. inline void GuiObject::guiobject_setTargetSpeed(float s) {
  351. _voidcall(GUI_SETTARGETSPEED, s);
  352. }
  353. inline void GuiObject::guiobject_gotoTarget(void) {
  354. _voidcall(GUI_GOTOTARGET);
  355. }
  356. inline void GuiObject::guiobject_cancelTarget() {
  357. _voidcall(GUI_CANCELTARGET);
  358. }
  359. inline int GuiObject::guiobject_getAutoWidth() {
  360. return _call(GUI_GETAUTOWIDTH, 0);
  361. }
  362. inline int GuiObject::guiobject_getAutoHeight() {
  363. return _call(GUI_GETAUTOHEIGHT, 0);
  364. }
  365. inline int GuiObject::guiobject_movingToTarget() {
  366. return _call(GUI_MOVINGTOTARGET, 0);
  367. }
  368. inline void GuiObject::guiobject_bringToFront() {
  369. _voidcall(GUI_BRINGTOFRONT);
  370. }
  371. inline void GuiObject::guiobject_bringToBack() {
  372. _voidcall(GUI_BRINGTOBACK);
  373. }
  374. inline void GuiObject::guiobject_bringAbove(GuiObject *o) {
  375. _voidcall(GUI_BRINGABOVE, o);
  376. }
  377. inline void GuiObject::guiobject_bringBelow(GuiObject *o) {
  378. _voidcall(GUI_BRINGBELOW, o);
  379. }
  380. inline void GuiObject::guiobject_setClickThrough(int ct) {
  381. _voidcall(GUI_SETCLICKTHROUGH, ct);
  382. }
  383. inline void GuiObject::guiobject_setRegionOp(int op) {
  384. _voidcall(GUI_SETREGIONOP, op);
  385. }
  386. inline int GuiObject::guiobject_getRegionOp() {
  387. return _call(GUI_GETREGIONOP, 0);
  388. }
  389. inline void GuiObject::guiobject_setRectRgn(int rrgn) {
  390. _voidcall(GUI_SETRECTRGN, rrgn);
  391. }
  392. inline int GuiObject::guiobject_isRectRgn() {
  393. return _call(GUI_ISRECTRGN, 0);
  394. }
  395. inline int GuiObject::guiobject_isClickThrough() {
  396. return _call(GUI_ISCLICKTHROUGH, 0);
  397. }
  398. inline void GuiObject::guiobject_setAutoSysMetricsX(int a) {
  399. _voidcall(GUI_SETAUTOSMX, a);
  400. }
  401. inline void GuiObject::guiobject_setAutoSysMetricsY(int a) {
  402. _voidcall(GUI_SETAUTOSMY, a);
  403. }
  404. inline void GuiObject::guiobject_setAutoSysMetricsW(int a) {
  405. _voidcall(GUI_SETAUTOSMW, a);
  406. }
  407. inline void GuiObject::guiobject_setAutoSysMetricsH(int a) {
  408. _voidcall(GUI_SETAUTOSMH, a);
  409. }
  410. inline int GuiObject::guiobject_getAutoSysMetricsX() {
  411. return _call(GUI_GETAUTOSMX, 0);
  412. }
  413. inline int GuiObject::guiobject_getAutoSysMetricsY() {
  414. return _call(GUI_GETAUTOSMY, 0);
  415. }
  416. inline int GuiObject::guiobject_getAutoSysMetricsW() {
  417. return _call(GUI_GETAUTOSMW, 0);
  418. }
  419. inline int GuiObject::guiobject_getAutoSysMetricsH() {
  420. return _call(GUI_GETAUTOSMH, 0);
  421. }
  422. inline void GuiObject::guiobject_onLeftButtonDown(int x, int y) {
  423. _voidcall(GUI_ONLEFTBUTTONDOWN, x, y);
  424. }
  425. inline void GuiObject::guiobject_onLeftButtonUp(int x, int y) {
  426. _voidcall(GUI_ONLEFTBUTTONUP, x, y);
  427. }
  428. inline void GuiObject::guiobject_onRightButtonDown(int x, int y) {
  429. _voidcall(GUI_ONRIGHTBUTTONDOWN, x, y);
  430. }
  431. inline void GuiObject::guiobject_onRightButtonUp(int x, int y) {
  432. _voidcall(GUI_ONRIGHTBUTTONUP, x, y);
  433. }
  434. inline void GuiObject::guiobject_onLeftButtonDblClk(int x, int y) {
  435. _voidcall(GUI_ONLEFTBUTTONDBLCLK, x, y);
  436. }
  437. inline void GuiObject::guiobject_onRightButtonDblClk(int x, int y) {
  438. _voidcall(GUI_ONRIGHTBUTTONDBLCLK, x, y);
  439. }
  440. inline int GuiObject::guiobject_onMouseWheelUp(int click, int lines)
  441. {
  442. return _call(GUI_ONMOUSEWHEELUP, 0, click, lines);
  443. }
  444. inline int GuiObject::guiobject_onMouseWheelDown(int click, int lines)
  445. {
  446. return _call(GUI_ONMOUSEWHEELDOWN, 0, click, lines);
  447. }
  448. inline void GuiObject::guiobject_onMouseMove(int x, int y) {
  449. _voidcall(GUI_ONMOUSEMOVE, x, y);
  450. }
  451. inline void GuiObject::guiobject_onEnterArea() {
  452. _voidcall(GUI_ONENTERAREA);
  453. }
  454. inline void GuiObject::guiobject_onLeaveArea() {
  455. _voidcall(GUI_ONLEAVEAREA);
  456. }
  457. inline void GuiObject::guiobject_onEnable(int en) {
  458. _voidcall(GUI_ONENABLE, en);
  459. }
  460. inline void GuiObject::guiobject_setEnabled(int en) {
  461. _voidcall(GUI_SETENABLED, en);
  462. }
  463. inline void GuiObject::guiobject_onResize(int x, int y, int w, int h) {
  464. _voidcall(GUI_ONRESIZE, x, y, w, h);
  465. }
  466. inline void GuiObject::guiobject_onSetVisible(int v) {
  467. _voidcall(GUI_ONSETVISIBLE, v);
  468. }
  469. inline void GuiObject::guiobject_onTargetReached() {
  470. _voidcall(GUI_ONTARGETREACHED);
  471. }
  472. inline void GuiObject::guiobject_setAlpha(int a) {
  473. _voidcall(GUI_SETALPHA, a);
  474. }
  475. inline int GuiObject::guiobject_getAlpha() {
  476. return _call(GUI_GETALPHA, 255);
  477. }
  478. inline void GuiObject::guiobject_setActiveAlpha(int a) {
  479. _voidcall(GUI_SETACTIVEALPHA, a);
  480. }
  481. inline int GuiObject::guiobject_getActiveAlpha() {
  482. return _call(GUI_GETACTIVEALPHA, 255);
  483. }
  484. inline void GuiObject::guiobject_setInactiveAlpha(int a) {
  485. _voidcall(GUI_SETINACTIVEALPHA, a);
  486. }
  487. inline int GuiObject::guiobject_getInactiveAlpha() {
  488. return _call(GUI_GETINACTIVEALPHA, 255);
  489. }
  490. inline void GuiObject::guiobject_onStartup() {
  491. _voidcall(GUI_ONSTARTUP);
  492. }
  493. inline int GuiObject::guiobject_setXmlParam(const wchar_t *param, const wchar_t *value) {
  494. return _call(GUI_SETXMLPARAM, 0, param, value);
  495. }
  496. inline int GuiObject::guiobject_setXmlParamById(int id, const wchar_t *value) {
  497. return _call(GUI_SETXMLPARAMBYID, 0, id, value);
  498. }
  499. inline const wchar_t *GuiObject::guiobject_getXmlParam(const wchar_t *param) {
  500. return _call(GUI_GETXMLPARAM, (const wchar_t *)NULL, param);
  501. }
  502. inline ScriptObject *GuiObject::guiobject_getScriptObject() {
  503. return _call(GUI_GETSCRIPTOBJECT, (ScriptObject *)NULL);
  504. }
  505. inline RootObject *GuiObject::guiobject_getRootObject() {
  506. return _call(GUI_GETROOTOBJECT, (RootObject *)NULL);
  507. }
  508. #ifdef WASABI_COMPILE_WNDMGR
  509. inline int GuiObject::guiobject_runModal() {
  510. return _call(GUI_RUNMODAL, 0);
  511. }
  512. inline void GuiObject::guiobject_endModal(int retcode) {
  513. _voidcall(GUI_ENDMODAL, retcode);
  514. }
  515. #endif
  516. inline svc_xuiObject *GuiObject::guiobject_getXuiService() {
  517. return _call(GUI_GETXUISVC, (svc_xuiObject *)NULL);
  518. }
  519. inline void GuiObject::guiobject_setXuiService(svc_xuiObject *svc) {
  520. _voidcall(GUI_SETXUISVC, svc);
  521. }
  522. inline waServiceFactory *GuiObject::guiobject_getXuiServiceFactory() {
  523. return _call(GUI_GETXUIFAC, (waServiceFactory*)NULL);
  524. }
  525. inline void GuiObject::guiobject_setXuiServiceFactory(waServiceFactory *fac) {
  526. _voidcall(GUI_SETXUIFAC, fac);
  527. }
  528. #ifdef WASABI_COMPILE_WNDMGR
  529. inline void GuiObject::guiobject_popParentLayout() {
  530. _voidcall(GUI_POPPARENTLAYOUT);
  531. }
  532. inline void GuiObject::guiobject_setStatusText(const wchar_t *txt, int overlay) {
  533. _voidcall(GUI_SETSTATUSTXT, txt, overlay);
  534. }
  535. inline void GuiObject::guiobject_addAppCmds(AppCmds *commands) {
  536. _voidcall(GUI_ADDCTXTCMDS, commands);
  537. }
  538. inline void GuiObject::guiobject_removeAppCmds(AppCmds *commands) {
  539. _voidcall(GUI_REMCTXTCMDS, commands);
  540. }
  541. inline
  542. void GuiObject::guiobject_pushCompleted(int max) {
  543. _voidcall(GUI_PUSHCOMPLETED, max);
  544. }
  545. inline
  546. void GuiObject::guiobject_incCompleted(int add) {
  547. _voidcall(GUI_INCCOMPLETED, add);
  548. }
  549. inline
  550. void GuiObject::guiobject_setCompleted(int pos) {
  551. _voidcall(GUI_SETCOMPLETED, pos);
  552. }
  553. inline
  554. void GuiObject::guiobject_popCompleted() {
  555. _voidcall(GUI_POPCOMPLETED);
  556. }
  557. inline void GuiObject::guiobject_registerStatusCB(GuiStatusCallback *callback) {
  558. _voidcall(GUI_REGISTERSTATUSCB, callback);
  559. }
  560. #endif
  561. inline GuiObject *GuiObject::guiobject_findObject(const wchar_t *id) {
  562. return _call(GUI_FINDOBJECT, (GuiObject *)NULL, id);
  563. }
  564. inline GuiObject *GuiObject::guiobject_findObjectXY(int x, int y) {
  565. return _call(GUI_FINDOBJECTXY, (GuiObject *)NULL, x, y);
  566. }
  567. inline GuiObject *GuiObject::guiobject_findObjectByInterface(GUID interface_guid) {
  568. return _call(GUI_FINDOBJECTBYGUID, (GuiObject *)NULL, interface_guid);
  569. }
  570. inline GuiObject *GuiObject::guiobject_findObjectByCallback(FindObjectCallback *cb) {
  571. return _call(GUI_FINDOBJECTBYCB, (GuiObject *)NULL, cb);
  572. }
  573. inline GuiObject *GuiObject::guiobject_findObjectChain(FindObjectCallback *cb, GuiObject *caller) {
  574. return _call(GUI_FINDOBJECTCHAIN, (GuiObject *)NULL, cb, caller);
  575. }
  576. inline const wchar_t *GuiObject::guiobject_getName() {
  577. return _call(GUI_GETNAME, (const wchar_t *)NULL);
  578. }
  579. inline int GuiObject::guiobject_getMover() {
  580. return _call(GUI_GETMOVER, 0);
  581. }
  582. inline void GuiObject::guiobject_setMover(int s) {
  583. _voidcall(GUI_SETMOVER, s);
  584. }
  585. inline FOURCC GuiObject::guiobject_getDropTarget() {
  586. return _call(GUI_GETDROPTARGET, (FOURCC)0);
  587. }
  588. inline void GuiObject::guiobject_setDropTarget(const wchar_t *target) {
  589. _voidcall(GUI_SETDROPTARGET, target);
  590. }
  591. inline void GuiObject::guiobject_onCancelCapture() {
  592. _voidcall(GUI_ONCANCELCAPTURE);
  593. }
  594. #ifdef WASABI_COMPILE_CONFIG
  595. inline void GuiObject::guiobject_setCfgAttrib(CfgItem *item, const wchar_t *attr) {
  596. _voidcall(GUI_SETCFGATTRIB, item, attr);
  597. }
  598. inline CfgItem *GuiObject::guiobject_getCfgItem() {
  599. return _call(GUI_GETCFGITEM, (CfgItem *)NULL);
  600. }
  601. inline const wchar_t *GuiObject::guiobject_getCfgAttrib() {
  602. return _call(GUI_GETCFGATTRIB, (const wchar_t *)NULL);
  603. }
  604. inline int GuiObject::guiobject_getCfgInt() {
  605. return _call(GUI_GETCFGINT, 0);
  606. }
  607. inline void GuiObject::guiobject_setCfgInt(int i) {
  608. _voidcall(GUI_SETCFGINT, i);
  609. }
  610. inline float GuiObject::guiobject_getCfgFloat() {
  611. return _call(GUI_GETCFGFLOAT, (float)0);
  612. }
  613. inline void GuiObject::guiobject_setCfgFloat(float v) {
  614. _voidcall(GUI_SETCFGFLOAT, v);
  615. }
  616. inline const wchar_t *GuiObject::guiobject_getCfgString() {
  617. return _call(GUI_GETCFGSTRING, (const wchar_t *)NULL);
  618. }
  619. inline void GuiObject::guiobject_setCfgString(const wchar_t *s) {
  620. _voidcall(GUI_SETCFGSTRING, s);
  621. }
  622. inline int GuiObject::guiobject_hasCfgAttrib() {
  623. return _call(GUI_HASATTRIB, 0);
  624. }
  625. #endif
  626. inline void GuiObject::guiobject_onChar(wchar_t c) {
  627. _voidcall(GUI_ONCHAR, c);
  628. }
  629. inline void GuiObject::guiobject_onKeyDown(int k) {
  630. _voidcall(GUI_ONKEYDOWN, k);
  631. }
  632. inline void GuiObject::guiobject_onKeyUp(int k) {
  633. _voidcall(GUI_ONKEYUP, k);
  634. }
  635. inline void GuiObject::guiobject_onGetFocus() {
  636. _voidcall(GUI_ONGETFOCUS);
  637. }
  638. inline void GuiObject::guiobject_onKillFocus() {
  639. _voidcall(GUI_ONKILLFOCUS);
  640. }
  641. inline void GuiObject::guiobject_onAccelerator(const wchar_t *accel) {
  642. _voidcall(GUI_ONACCELERATOR, accel);
  643. }
  644. inline int GuiObject::guiobject_onAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2, void *data, size_t datalen, ifc_window *source) {
  645. return _call(GUI_ONACTION, 0, action, param, x, y, p1, p2, data, datalen, source);
  646. }
  647. inline void GuiObject::guiobject_onInit() {
  648. _voidcall(GUI_ONINIT);
  649. }
  650. inline int GuiObject::guiobject_wantFocus() {
  651. return _call(GUI_WANTFOCUS, 0);
  652. }
  653. inline void GuiObject::guiobject_setNoDoubleClick(int no) {
  654. _voidcall(GUI_SETNODOUBLECLICK, no);
  655. }
  656. inline void GuiObject::guiobject_setNoLeftClick(int no) {
  657. _voidcall(GUI_SETNOLEFTCLICK, no);
  658. }
  659. inline void GuiObject::guiobject_setNoRightClick(int no) {
  660. _voidcall(GUI_SETNORIGHTCLICK, no);
  661. }
  662. inline void GuiObject::guiobject_setNoMouseMove(int no) {
  663. _voidcall(GUI_SETNOMOUSEMOVE, no);
  664. }
  665. inline void GuiObject::guiobject_setNoContextMenu(int no) {
  666. _voidcall(GUI_SETNOCONTEXTMENU, no);
  667. }
  668. inline void GuiObject::guiobject_setCursor(const wchar_t *c) {
  669. _voidcall(GUI_SETCURSOR, c);
  670. }
  671. inline void GuiObject::guiobject_reverseTarget(int reverse) {
  672. _voidcall(GUI_REVERSETARGET, reverse);
  673. }
  674. inline void GuiObject::guiobject_setAppBar(int enabled) {
  675. _voidcall(GUI_SETAPPBAR, enabled);
  676. }
  677. inline int GuiObject::guiobject_getAppBar() {
  678. return _call(GUI_GETAPPBAR, 0);
  679. }
  680. inline int GuiObject::guiobject_wantTranslation()
  681. {
  682. return _call(GUI_WANTTRANSLATION, (int)1);
  683. }
  684. inline int GuiObject::guiobject_dragEnter(ifc_window *sourceWnd)
  685. {
  686. return _call(GUI_DRAGENTER, (int)1, sourceWnd);
  687. }
  688. inline int GuiObject::guiobject_dragOver(int x, int y, ifc_window *sourceWnd)
  689. {
  690. return _call(GUI_DRAGOVER, (int)1, sourceWnd, x, y);
  691. }
  692. inline int GuiObject::guiobject_dragLeave(ifc_window *sourceWnd)
  693. {
  694. return _call(GUI_DRAGLEAVE, (int)1, sourceWnd);
  695. }
  696. #endif