1
0

compoobj.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef _COMPONENTOBJ_H
  2. #define _COMPONENTOBJ_H
  3. #include <api/script/script.h>
  4. #include <api/script/scriptobj.h>
  5. #include <api/wnd/wndclass/guiobjwnd.h>
  6. #include <api/script/objects/guiobj.h>
  7. class SMap;
  8. class SRegion;
  9. class Container;
  10. class Layout;
  11. class CompWnd;
  12. // {403ABCC0-6F22-4bd6-8BA4-10C829932547}
  13. static const GUID componentObjectGuid =
  14. { 0x403abcc0, 0x6f22, 0x4bd6, { 0x8b, 0xa4, 0x10, 0xc8, 0x29, 0x93, 0x25, 0x47 } };
  15. #define COMPONENTOBJECT_PARENT GuiObjectWnd
  16. class CompoObjScriptController : public GuiObjectScriptController {
  17. public:
  18. virtual const wchar_t *getClassName();
  19. virtual const wchar_t *getAncestorClassName();
  20. virtual ScriptObjectController *getAncestorController() { return guiController; }
  21. virtual int getNumFunctions();
  22. virtual const function_descriptor_struct *getExportedFunctions();
  23. virtual GUID getClassGuid();
  24. virtual ScriptObject *instantiate();
  25. virtual void destroy(ScriptObject *o);
  26. virtual void *encapsulate(ScriptObject *o);
  27. virtual void deencapsulate(void *);
  28. private:
  29. static function_descriptor_struct exportedFunction[];
  30. };
  31. extern CompoObjScriptController *compoController;
  32. #ifndef _NOSTUDIO
  33. #include <api/wnd/virtualwnd.h>
  34. class ComponentObject : public COMPONENTOBJECT_PARENT {
  35. public:
  36. ComponentObject();
  37. virtual ~ComponentObject();
  38. virtual int setXmlParam(const wchar_t *name, const wchar_t *value);
  39. virtual int onResize();
  40. virtual void onSetVisible(int s);
  41. virtual int handleRatio();
  42. void deniedComponentCompWnd(CompWnd *c, GUID g);
  43. void grantedComponentCompWnd(CompWnd *c, GUID g);
  44. int wantGUID(GUID *g);
  45. void onReleaseComponent();
  46. void onGetComponent(GUID g);
  47. void onBeforeGetWac(GUID g, CompWnd *c);
  48. void onBeforeGiveUpWac(GUID g, CompWnd *c);
  49. void setGUID(GUID g);
  50. void setCompGUID(GUID g);
  51. GUID getGUID(void);
  52. int getAutoClose();
  53. void setAcceptWac(int a);
  54. int getAnimatedRects() { return !noanimrects; }
  55. virtual int getPreferences(int what);
  56. virtual void script_resetRegion();
  57. virtual void script_setRegionFromMap(SMap *map, int byte, int inv);
  58. virtual void script_setRegion(SRegion *r);
  59. virtual int handleDesktopAlpha();
  60. virtual int handleTransparency();
  61. // VCPU
  62. static scriptVar script_vcpu_getGUID(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  63. static scriptVar script_vcpu_getWac(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  64. static scriptVar script_vcpu_onShow(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  65. static scriptVar script_vcpu_onHide(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  66. static scriptVar script_vcpu_onGetWac(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar wac);
  67. static scriptVar script_vcpu_onGiveUpWac(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar wac);
  68. static scriptVar script_vcpu_setRegionFromMap(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar map, scriptVar byte, scriptVar inv);
  69. static scriptVar script_vcpu_setRegion(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar r);
  70. static scriptVar script_vcpu_setAcceptWac(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar on);
  71. // End VCPU
  72. private:
  73. GUID myGUID;
  74. GUID myCompGuid;
  75. int deleting;
  76. CompWnd *compwnd;
  77. int noshowcmdbar;
  78. int noshowbtnbar;
  79. api_region *my_region_clone;
  80. int autoopen, autoclose;
  81. int accept;
  82. int denyDesktopAlpha;
  83. int denyTransparency;
  84. int noanimrects;
  85. #else
  86. class ComponentObject : public COMPONENTOBJECT_SCRIPTPARENT {
  87. #endif
  88. };
  89. #endif