title.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //PORTABLE
  2. #ifndef _TITLE_H
  3. #define _TITLE_H
  4. #include <api/wnd/wndclass/guiobjwnd.h>
  5. #include <api/script/objects/guiobj.h>
  6. // {7DFD3244-3751-4e7c-BF40-82AE5F3ADC33}
  7. static const GUID titleGuid =
  8. { 0x7dfd3244, 0x3751, 0x4e7c, { 0xbf, 0x40, 0x82, 0xae, 0x5f, 0x3a, 0xdc, 0x33 } };
  9. #define TITLE_PARENT GuiObjectWnd
  10. class TitleScriptController : public GuiObjectScriptController {
  11. public:
  12. virtual const wchar_t *getClassName();
  13. virtual const wchar_t *getAncestorClassName();
  14. virtual ScriptObjectController *getAncestorController() { return guiController; }
  15. virtual int getNumFunctions();
  16. virtual const function_descriptor_struct *getExportedFunctions();
  17. virtual GUID getClassGuid();
  18. virtual ScriptObject *instantiate();
  19. virtual void destroy(ScriptObject *o);
  20. virtual void *encapsulate(ScriptObject *o);
  21. virtual void deencapsulate(void *o);
  22. private:
  23. static function_descriptor_struct exportedFunction[];
  24. };
  25. extern TitleScriptController *titleController;
  26. class Title : public TITLE_PARENT {
  27. public:
  28. Title();
  29. virtual ~Title();
  30. virtual int onPaint(Canvas *canvas);
  31. virtual void setTitle(const wchar_t *title);
  32. virtual const wchar_t *getTitle();
  33. virtual int onLeftButtonDblClk(int x, int y);
  34. virtual int getPreferences(int what);
  35. virtual int setXuiParam(int _xuihandle, int attrid, const wchar_t *name, const wchar_t *strval);
  36. virtual const wchar_t *vcpu_getClassName();
  37. virtual ScriptObjectController *vcpu_getController() { return titleController; }
  38. virtual int onDeferredCallback(intptr_t param1, intptr_t param2);
  39. void setBorder(int b);
  40. void setStreaks(int s);
  41. enum {
  42. TITLE_SETTITLE=0,
  43. TITLE_SETSTREAKS,
  44. TITLE_SETBORDER,
  45. TITLE_SETMAXIMIZE,
  46. TITLE_SETDBLCLKACTION,
  47. };
  48. protected:
  49. /*static */void CreateXMLParameters(int master_handle);
  50. private:
  51. static XMLParamPair params[];
  52. StringW title;
  53. int dostreaks, doborder;
  54. int m_maximize;
  55. StringW dblClickAction;
  56. int xuihandle;
  57. public:
  58. static scriptVar script_vcpu_fake(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  59. };
  60. extern const wchar_t titleBarXuiObjectStr[];
  61. extern char titleBarXuiSvcName[];
  62. class TitleBarXuiSvc : public XuiObjectSvc<Title, titleBarXuiObjectStr, titleBarXuiSvcName> {};
  63. #endif