embeddedxui.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef __EMBEDDEDXUIOBJECT_H
  2. #define __EMBEDDEDXUIOBJECT_H
  3. #include <wasabicfg.h>
  4. #include <api/script/api_maki.h>
  5. #include <api/wnd/wndclass/guiobjwnd.h>
  6. #include <api/script/scriptguid.h>
  7. #include <api/script/scriptobj.h>
  8. #include <api/script/objcontroller.h>
  9. #define EMBEDDEDXUIOBJECT_PARENT GuiObjectWnd
  10. class EmbeddedXuiObjectParam {
  11. public:
  12. EmbeddedXuiObjectParam(const wchar_t *p, const wchar_t *v) : param(p), value(v) {}
  13. virtual ~EmbeddedXuiObjectParam() {}
  14. StringW param;
  15. StringW value;
  16. };
  17. class EmbeddedXuiObject : public EMBEDDEDXUIOBJECT_PARENT {
  18. public:
  19. EmbeddedXuiObject();
  20. virtual ~EmbeddedXuiObject();
  21. virtual void onNewContent();
  22. virtual int onInit();
  23. virtual void embeddedxui_onNewEmbeddedContent();
  24. virtual const wchar_t *embeddedxui_getContentId() { return NULL; }
  25. virtual const wchar_t *embeddedxui_getEmbeddedObjectId() { return NULL; }
  26. virtual int onUnknownXuiParam(const wchar_t *xmlattributename, const wchar_t *value);
  27. #ifdef WASABI_COMPILE_CONFIG
  28. virtual int onReloadConfig();
  29. #endif
  30. virtual GuiObject *embeddedxui_getEmbeddedObject() { return embedded; }
  31. private:
  32. #ifdef WASABI_COMPILE_CONFIG
  33. void syncCfgAttrib();
  34. #endif
  35. int myxuihandle;
  36. PtrList<EmbeddedXuiObjectParam> paramlist;
  37. GuiObject *embedded;
  38. };
  39. // -----------------------------------------------------------------------
  40. class EmbeddedXuiScriptController: public ScriptObjectControllerI
  41. {
  42. public:
  43. virtual const wchar_t *getClassName() { return L"ObjectEmbedder"; }
  44. virtual const wchar_t *getAncestorClassName() { return L"GuiObject"; }
  45. virtual ScriptObjectController *getAncestorController();
  46. virtual int getNumFunctions();
  47. virtual const function_descriptor_struct *getExportedFunctions();
  48. virtual GUID getClassGuid() { return embeddedXuiGuid; }
  49. virtual ScriptObject *instantiate();
  50. virtual void destroy(ScriptObject *o);
  51. virtual void *encapsulate(ScriptObject *o);
  52. virtual void deencapsulate(void *o);
  53. virtual ScriptObject *cast(ScriptObject *o, GUID g);
  54. private:
  55. static function_descriptor_struct exportedFunction[];
  56. static scriptVar EmbeddedXui_getEmbeddedObject(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  57. };
  58. extern COMEXP EmbeddedXuiScriptController *embeddedXuiController;
  59. #endif