xuiwndholder.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef __XUIWNDHOLDER_H
  2. #define __XUIWNDHOLDER_H
  3. #include <api/wnd/wndclass/wndholder.h>
  4. #include <api/script/scriptguid.h>
  5. #include <api/script/objcontroller.h>
  6. #define XUIWNDHOLDER_PARENT WindowHolderWnd
  7. // -----------------------------------------------------------------------
  8. class XuiWindowHolder : public XUIWNDHOLDER_PARENT
  9. {
  10. public:
  11. XuiWindowHolder();
  12. virtual ~XuiWindowHolder();
  13. virtual int setXuiParam(int xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value);
  14. void setRegionFromMap(ScriptObject *map, int byte, int inverse);
  15. void setRegion(ScriptObject *region);
  16. static GUID *parseGUID(const wchar_t *id);
  17. protected:
  18. /*static */void CreateXMLParameters(int master_handle);
  19. private:
  20. enum {
  21. XUIWNDHOLDER_ADDHOLD = 10,
  22. XUIWNDHOLDER_SETNOSHOWCMDBAR = 20,
  23. XUIWNDHOLDER_SETNOANIMRECTS = 30,
  24. XUIWNDHOLDER_SETAUTOOPEN = 40,
  25. XUIWNDHOLDER_SETAUTOCLOSE = 50,
  26. XUIWNDHOLDER_SETAUTOFOCUS = 60,
  27. XUIWNDHOLDER_SETAUTOAVAILABLE = 70,
  28. };
  29. static XMLParamPair params[];
  30. int myxuihandle;
  31. };
  32. // -----------------------------------------------------------------------------------------------------
  33. class WindowHolderScriptController: public ScriptObjectControllerI {
  34. public:
  35. virtual const wchar_t *getClassName() { return L"WindowHolder"; }
  36. virtual const wchar_t *getAncestorClassName() { return L"GuiObject"; }
  37. virtual ScriptObjectController *getAncestorController() { return WASABI_API_MAKI->maki_getController(guiObjectGuid); }
  38. virtual int getNumFunctions();
  39. virtual const function_descriptor_struct *getExportedFunctions();
  40. virtual GUID getClassGuid() { return windowHolderGuid; }
  41. virtual ScriptObject *instantiate();
  42. virtual void destroy(ScriptObject *o);
  43. virtual void *encapsulate(ScriptObject *o);
  44. virtual void deencapsulate(void *o);
  45. public:
  46. static scriptVar script_getGUID(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  47. static scriptVar script_setRegionFromMap(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar map, scriptVar byte, scriptVar inv);
  48. static scriptVar script_setRegion(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar reg);
  49. static scriptVar script_getContent(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  50. static scriptVar script_getComponentName(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  51. private:
  52. static function_descriptor_struct exportedFunction[];
  53. };
  54. extern WindowHolderScriptController *windowHolderController;
  55. // -----------------------------------------------------------------------
  56. extern const wchar_t WindowHolderXuiObjectStr[];
  57. extern const wchar_t WindowHolderXuiObjectStrCompat[];
  58. extern char WindowHolderXuiSvcName[];
  59. extern char WindowHolderXuiSvcNameCompat[];
  60. class WindowHolderXuiSvc : public XuiObjectSvc<XuiWindowHolder, WindowHolderXuiObjectStr, WindowHolderXuiSvcName> {};
  61. class WindowHolderXuiSvc2 : public XuiObjectSvc<XuiWindowHolder, WindowHolderXuiObjectStrCompat, WindowHolderXuiSvcNameCompat> {};
  62. #endif