api_wndmgr.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. #ifndef __WNDMGR_API_H
  2. #define __WNDMGR_API_H
  3. #include <bfc/dispatch.h>
  4. #include <bfc/nsguid.h>
  5. class ifc_window;
  6. class WindowHolder;
  7. class Container;
  8. class ScriptObject;
  9. #ifndef MODALWND_DEF
  10. #define MODALWND_DEF
  11. ifc_window *const MODALWND_NOWND = reinterpret_cast<ifc_window*>(-1);
  12. #endif
  13. class wndmgr_api : public Dispatchable {
  14. public:
  15. void wndTrackAdd(ifc_window *wnd);
  16. void wndTrackRemove(ifc_window *wnd);
  17. bool wndTrackDock(ifc_window *wnd, RECT *r, int mask);
  18. bool wndTrackDock(ifc_window *wnd, RECT *r, RECT *orig_r, int mask);
  19. void wndTrackStartCooperative(ifc_window *wnd);
  20. void wndTrackEndCooperative();
  21. int wndTrackWasCooperative();
  22. void wndTrackInvalidateAll();
  23. int skinwnd_toggleByGuid(GUID g, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0);
  24. int skinwnd_toggleByGroupId(const wchar_t *groupid, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0);
  25. ifc_window *skinwnd_createByGuid(GUID g, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0, int starthidden = 0, int *isnew = NULL);
  26. ifc_window *skinwnd_createByGroupId(const wchar_t *groupid, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0, int starthidden = 0, int *isnew = NULL);
  27. void skinwnd_destroy(ifc_window *w, RECT *destanimrect = NULL);
  28. int skinwnd_getNumByGuid(GUID g);
  29. ifc_window *skinwnd_enumByGuid(GUID g, int n);
  30. int skinwnd_getNumByGroupId(const wchar_t *groupid);
  31. ifc_window *skinwnd_enumByGroupId(const wchar_t *groupid, int n);
  32. void skinwnd_attachToSkin(ifc_window *w, int side, int size);
  33. //ScriptObject *skin_getContainer(const wchar_t *container_name);
  34. //ScriptObject *skin_getLayout(ScriptObject *container, const wchar_t *layout_name);
  35. void wndholder_register(WindowHolder *wh);
  36. void wndholder_unregister(WindowHolder *wh);
  37. int messageBox(const wchar_t *txt, const wchar_t *title, int flags, const wchar_t *not_anymore_identifier, ifc_window *parenwnt);
  38. ifc_window *getModalWnd();
  39. void pushModalWnd(ifc_window *w = MODALWND_NOWND);
  40. void popModalWnd(ifc_window *w = MODALWND_NOWND);
  41. void drawAnimatedRects(const RECT *r1, const RECT *r2);
  42. int autopopup_registerGuid(GUID g, const wchar_t *desc, const wchar_t *prefered_container = NULL, int container_flag = 0);
  43. int autopopup_registerGroupId(const wchar_t *groupid, const wchar_t *desc, const wchar_t *prefered_container = NULL, int container_flag = 0);
  44. void autopopup_unregister(int id);
  45. int autopopup_getNumGuids();
  46. GUID autopopup_enumGuid(int n);
  47. int autopopup_getNumGroups();
  48. const wchar_t *autopopup_enumGroup(int n);
  49. const wchar_t *autopopup_enumGuidDescription(int n);
  50. const wchar_t *autopopup_enumGroupDescription(int n);
  51. const wchar_t *varmgr_translate(const wchar_t *str);
  52. //Container *newDynamicContainer(const wchar_t *containername, int transcient = 1);
  53. enum {
  54. WNDMGR_API_WNDTRACKADD = 0,
  55. WNDMGR_API_WNDTRACKREMOVE = 10,
  56. WNDMGR_API_WNDTRACKDOCK = 20,
  57. WNDMGR_API_WNDTRACKDOCK2 = 30,
  58. WNDMGR_API_WNDTRACKSTARTCOOPERATIVE = 40,
  59. WNDMGR_API_WNDTRACKENDCOOPERATIVE = 50,
  60. WNDMGR_API_WNDTRACKWASCOOPERATIVE = 60,
  61. WNDMGR_API_WNDTRACKINVALIDATEALL = 70,
  62. WNDMGR_API_SKINWND_TOGGLEBYGUID = 80,
  63. WNDMGR_API_SKINWND_TOGGLEBYGROUPID = 90,
  64. WNDMGR_API_SKINWND_CREATEBYGUID = 100,
  65. WNDMGR_API_SKINWND_CREATEBYGROUPID = 110,
  66. WNDMGR_API_SKINWND_DESTROY = 120,
  67. WNDMGR_API_SKINWND_GETNUMBYGUID = 130,
  68. WNDMGR_API_SKINWND_ENUMBYGUID = 140,
  69. WNDMGR_API_SKINWND_GETNUMBYGROUPID = 150,
  70. WNDMGR_API_SKINWND_ENUMBYGROUPID = 160,
  71. WNDMGR_API_SKINWND_ATTACHTOSKIN = 170,
  72. //WNDMGR_API_SKIN_GETCONTAINER = 180,
  73. WNDMGR_API_SKIN_GETLAYOUT = 190,
  74. WNDMGR_API_WNDHOLDER_REGISTER = 200,
  75. WNDMGR_API_WNDHOLDER_UNREGISTER = 210,
  76. WNDMGR_API_MESSAGEBOX = 220,
  77. WNDMGR_API_GETMODALWND = 230,
  78. WNDMGR_API_PUSHMODALWND = 240,
  79. WNDMGR_API_POPMODALWND = 250,
  80. WNDMGR_API_DRAWANIMATEDRECTS = 260,
  81. WNDMGR_API_AUTOPOPUP_REGISTERGUID = 270,
  82. WNDMGR_API_AUTOPOPUP_REGISTERGROUPID = 280,
  83. WNDMGR_API_AUTOPOPUP_UNREGISTER = 290,
  84. WNDMGR_API_VARMGR_TRANSLATE = 300,
  85. WNDMGR_API_NEWDYNAMICCONTAINER = 310,
  86. WNDMGR_API_AUTOPOPUP_GETNUMGUIDS = 320,
  87. WNDMGR_API_AUTOPOPUP_ENUMGUID = 330,
  88. WNDMGR_API_AUTOPOPUP_GETNUMGROUPS = 340,
  89. WNDMGR_API_AUTOPOPUP_ENUMGROUPS = 350,
  90. WNDMGR_API_AUTOPOPUP_ENUMGUIDDESC = 360,
  91. WNDMGR_API_AUTOPOPUP_ENUMGROUPDESC = 370,
  92. };
  93. };
  94. inline void wndmgr_api::wndTrackAdd(ifc_window *wnd) {
  95. _voidcall(WNDMGR_API_WNDTRACKADD, wnd);
  96. }
  97. inline void wndmgr_api::wndTrackRemove(ifc_window *wnd) {
  98. _voidcall(WNDMGR_API_WNDTRACKREMOVE, wnd);
  99. }
  100. inline bool wndmgr_api::wndTrackDock(ifc_window *wnd, RECT *r, int mask) {
  101. return _call(WNDMGR_API_WNDTRACKDOCK, (bool)FALSE, wnd, r, mask);
  102. }
  103. inline bool wndmgr_api::wndTrackDock(ifc_window *wnd, RECT *r, RECT *orig_r, int mask) {
  104. return _call(WNDMGR_API_WNDTRACKDOCK2, (bool)FALSE, wnd, r, orig_r, mask);
  105. }
  106. inline void wndmgr_api::wndTrackStartCooperative(ifc_window *wnd) {
  107. _voidcall(WNDMGR_API_WNDTRACKSTARTCOOPERATIVE, wnd);
  108. }
  109. inline void wndmgr_api::wndTrackEndCooperative() {
  110. _voidcall(WNDMGR_API_WNDTRACKENDCOOPERATIVE);
  111. }
  112. inline int wndmgr_api::wndTrackWasCooperative() {
  113. return _call(WNDMGR_API_WNDTRACKWASCOOPERATIVE, (int)0);
  114. }
  115. inline void wndmgr_api::wndTrackInvalidateAll() {
  116. _voidcall(WNDMGR_API_WNDTRACKINVALIDATEALL);
  117. }
  118. inline int wndmgr_api::skinwnd_toggleByGuid(GUID g, const wchar_t *prefered_container, int container_flag, RECT *sourceanimrect, int transcient) {
  119. return _call(WNDMGR_API_SKINWND_TOGGLEBYGUID, (int)0, g, prefered_container, container_flag, sourceanimrect, transcient);
  120. }
  121. inline int wndmgr_api::skinwnd_toggleByGroupId(const wchar_t *groupid, const wchar_t *prefered_container, int container_flag, RECT *sourceanimrect, int transcient) {
  122. return _call(WNDMGR_API_SKINWND_TOGGLEBYGROUPID, (int)0, groupid, prefered_container, container_flag, sourceanimrect, transcient);
  123. }
  124. inline ifc_window *wndmgr_api::skinwnd_createByGuid(GUID g, const wchar_t *prefered_container, int container_flag, RECT *sourceanimrect, int transcient, int starthidden, int *isnew) {
  125. return _call(WNDMGR_API_SKINWND_CREATEBYGUID, (ifc_window *)NULL, g, prefered_container, container_flag, sourceanimrect, transcient, starthidden, isnew);
  126. }
  127. inline ifc_window *wndmgr_api::skinwnd_createByGroupId(const wchar_t *groupid, const wchar_t *prefered_container, int container_flag, RECT *sourceanimrect, int transcient, int starthidden, int *isnew) {
  128. return _call(WNDMGR_API_SKINWND_CREATEBYGROUPID, (ifc_window *)NULL, groupid, prefered_container, container_flag, sourceanimrect, transcient, starthidden, isnew);
  129. }
  130. inline void wndmgr_api::skinwnd_destroy(ifc_window *w, RECT *destanimrect) {
  131. _voidcall(WNDMGR_API_SKINWND_DESTROY, w, destanimrect);
  132. }
  133. inline int wndmgr_api::skinwnd_getNumByGuid(GUID g) {
  134. return _call(WNDMGR_API_SKINWND_GETNUMBYGUID, (int)0, g);
  135. }
  136. inline ifc_window *wndmgr_api::skinwnd_enumByGuid(GUID g, int n) {
  137. return _call(WNDMGR_API_SKINWND_ENUMBYGUID, (ifc_window *)NULL, g, n);
  138. }
  139. inline int wndmgr_api::skinwnd_getNumByGroupId(const wchar_t *groupid) {
  140. return _call(WNDMGR_API_SKINWND_GETNUMBYGROUPID, (int)0, groupid);
  141. }
  142. inline ifc_window *wndmgr_api::skinwnd_enumByGroupId(const wchar_t *groupid, int n) {
  143. return _call(WNDMGR_API_SKINWND_ENUMBYGROUPID, (ifc_window *)NULL, groupid, n);
  144. }
  145. inline void wndmgr_api::skinwnd_attachToSkin(ifc_window *w, int side, int size) {
  146. _voidcall(WNDMGR_API_SKINWND_ATTACHTOSKIN, w, side, size);
  147. }
  148. /*
  149. inline ScriptObject *wndmgr_api::skin_getContainer(const wchar_t *container_name) {
  150. return _call(WNDMGR_API_SKIN_GETCONTAINER, (ScriptObject *)NULL, container_name);
  151. }
  152. */
  153. /*
  154. inline ScriptObject *wndmgr_api::skin_getLayout(ScriptObject *container, const wchar_t *layout_name) {
  155. return _call(WNDMGR_API_SKIN_GETLAYOUT, (ScriptObject *)NULL, container, layout_name);
  156. }
  157. */
  158. inline void wndmgr_api::wndholder_register(WindowHolder *wh) {
  159. _voidcall(WNDMGR_API_WNDHOLDER_REGISTER, wh);
  160. }
  161. inline void wndmgr_api::wndholder_unregister(WindowHolder *wh) {
  162. _voidcall(WNDMGR_API_WNDHOLDER_UNREGISTER, wh);
  163. }
  164. inline int wndmgr_api::messageBox(const wchar_t *txt, const wchar_t *title, int flags, const wchar_t *not_anymore_identifier, ifc_window *parenwnt) {
  165. return _call(WNDMGR_API_MESSAGEBOX, (int)0, txt, title, flags, not_anymore_identifier, parenwnt);
  166. }
  167. inline ifc_window *wndmgr_api::getModalWnd() {
  168. return _call(WNDMGR_API_GETMODALWND, (ifc_window *)NULL);
  169. }
  170. inline void wndmgr_api::pushModalWnd(ifc_window *w) {
  171. _voidcall(WNDMGR_API_PUSHMODALWND, w);
  172. }
  173. inline void wndmgr_api::popModalWnd(ifc_window *w) {
  174. _voidcall(WNDMGR_API_POPMODALWND, w);
  175. }
  176. inline void wndmgr_api::drawAnimatedRects(const RECT *r1, const RECT *r2) {
  177. _voidcall(WNDMGR_API_DRAWANIMATEDRECTS, r1, r2);
  178. }
  179. inline int wndmgr_api::autopopup_registerGuid(GUID g, const wchar_t *desc, const wchar_t *prefered_container, int container_flag) {
  180. return _call(WNDMGR_API_AUTOPOPUP_REGISTERGUID, (int)0, g, desc, prefered_container, container_flag);
  181. }
  182. inline int wndmgr_api::autopopup_registerGroupId(const wchar_t *groupid, const wchar_t *desc, const wchar_t *prefered_container, int container_flag) {
  183. return _call(WNDMGR_API_AUTOPOPUP_REGISTERGROUPID, (int)0, groupid, desc, prefered_container, container_flag);
  184. }
  185. inline void wndmgr_api::autopopup_unregister(int id) {
  186. _voidcall(WNDMGR_API_AUTOPOPUP_UNREGISTER, id);
  187. }
  188. inline const wchar_t *wndmgr_api::varmgr_translate(const wchar_t *str) {
  189. return _call(WNDMGR_API_VARMGR_TRANSLATE, (const wchar_t *)0, str);
  190. }
  191. /*
  192. inline Container *wndmgr_api::newDynamicContainer(const wchar_t *containername, int transcient) {
  193. return _call(WNDMGR_API_NEWDYNAMICCONTAINER, (Container *)NULL, containername, transcient);
  194. }
  195. */
  196. inline int wndmgr_api::autopopup_getNumGuids() {
  197. return _call(WNDMGR_API_AUTOPOPUP_GETNUMGUIDS, 0);
  198. }
  199. inline GUID wndmgr_api::autopopup_enumGuid(int n) {
  200. return _call(WNDMGR_API_AUTOPOPUP_ENUMGUID, INVALID_GUID, n);
  201. }
  202. inline int wndmgr_api::autopopup_getNumGroups() {
  203. return _call(WNDMGR_API_AUTOPOPUP_GETNUMGROUPS, 0);
  204. }
  205. inline const wchar_t *wndmgr_api::autopopup_enumGroup(int n) {
  206. return _call(WNDMGR_API_AUTOPOPUP_ENUMGROUPS, (const wchar_t*)NULL, n);
  207. }
  208. inline const wchar_t *wndmgr_api::autopopup_enumGuidDescription(int n) {
  209. return _call(WNDMGR_API_AUTOPOPUP_ENUMGUIDDESC, (const wchar_t *)NULL, n);
  210. }
  211. inline const wchar_t *wndmgr_api::autopopup_enumGroupDescription(int n) {
  212. return _call(WNDMGR_API_AUTOPOPUP_ENUMGROUPDESC, (const wchar_t *)NULL, n);
  213. }
  214. class wndmgr_apiI : public wndmgr_api {
  215. public:
  216. virtual void wndTrackAdd(ifc_window *wnd)=0;
  217. virtual void wndTrackRemove(ifc_window *wnd)=0;
  218. virtual bool wndTrackDock(ifc_window *wnd, RECT *r, int mask)=0;
  219. virtual bool wndTrackDock2(ifc_window *wnd, RECT *r, RECT *orig_r, int mask)=0;
  220. virtual void wndTrackStartCooperative(ifc_window *wnd)=0;
  221. virtual void wndTrackEndCooperative()=0;
  222. virtual int wndTrackWasCooperative()=0;
  223. virtual void wndTrackInvalidateAll()=0;
  224. virtual int skinwnd_toggleByGuid(GUID g, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0)=0;
  225. virtual int skinwnd_toggleByGroupId(const wchar_t *groupid, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0)=0;
  226. virtual ifc_window *skinwnd_createByGuid(GUID g, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0, int starthidden = 0, int *isnew=NULL)=0;
  227. virtual ifc_window *skinwnd_createByGroupId(const wchar_t *groupid, const wchar_t *prefered_container = NULL, int container_flag = 0, RECT *sourceanimrect = NULL, int transcient = 0, int starthidden = 0, int *isnew=NULL)=0;
  228. virtual void skinwnd_destroy(ifc_window *w, RECT *destanimrect = NULL)=0;
  229. virtual int skinwnd_getNumByGuid(GUID g)=0;
  230. virtual ifc_window *skinwnd_enumByGuid(GUID g, int n)=0;
  231. virtual int skinwnd_getNumByGroupId(const wchar_t *groupid)=0;
  232. virtual ifc_window *skinwnd_enumByGroupId(const wchar_t *groupid, int n)=0;
  233. virtual void skinwnd_attachToSkin(ifc_window *w, int side, int size)=0;
  234. virtual ScriptObject *skin_getContainer(const wchar_t *container_name)=0;
  235. virtual ScriptObject *skin_getLayout(ScriptObject *container, const wchar_t *layout_name)=0;
  236. virtual void wndholder_register(WindowHolder *wh)=0;
  237. virtual void wndholder_unregister(WindowHolder *wh)=0;
  238. virtual int messageBox(const wchar_t *txt, const wchar_t *title, int flags, const wchar_t *not_anymore_identifier, ifc_window *parenwnt)=0;
  239. virtual ifc_window *getModalWnd()=0;
  240. virtual void pushModalWnd(ifc_window *w = MODALWND_NOWND)=0;
  241. virtual void popModalWnd(ifc_window *w = MODALWND_NOWND)=0;
  242. virtual void drawAnimatedRects(const RECT *r1, const RECT *r2)=0;
  243. virtual int autopopup_registerGuid(GUID g, const wchar_t *desc, const wchar_t *prefered_container = NULL, int container_flag = 0)=0;
  244. virtual int autopopup_registerGroupId(const wchar_t *groupid, const wchar_t *desc, const wchar_t *prefered_container = NULL, int container_flag = 0)=0;
  245. virtual void autopopup_unregister(int id)=0;
  246. virtual int autopopup_getNumGuids()=0;
  247. virtual GUID autopopup_enumGuid(int n)=0;
  248. virtual int autopopup_getNumGroups()=0;
  249. virtual const wchar_t *autopopup_enumGroup(int n)=0;
  250. virtual const wchar_t *varmgr_translate(const wchar_t *str)=0;
  251. virtual Container *newDynamicContainer(const wchar_t *containername, int transcient = 1)=0;
  252. virtual const wchar_t *autopopup_enumGuidDescription(int n)=0;
  253. virtual const wchar_t *autopopup_enumGroupDescription(int n)=0;
  254. protected:
  255. RECVS_DISPATCH;
  256. };
  257. // {038A3567-1530-4062-BA87-CCB4F01DA3E9}
  258. static const GUID wndMgrApiServiceGuid =
  259. { 0x38a3567, 0x1530, 0x4062, { 0xba, 0x87, 0xcc, 0xb4, 0xf0, 0x1d, 0xa3, 0xe9 } };
  260. extern wndmgr_api *wndManagerApi;
  261. #endif //wndmgr_api_h