1
0

sstatus.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //PORTABLE
  2. #ifndef _SSTATUS_H
  3. #define _SSTATUS_H
  4. #include <api/wnd/basewnd.h>
  5. #include <tataki/bitmap/autobitmap.h>
  6. #include <api/wnd/virtualwnd.h>
  7. #include <api/syscb/callbacks/corecbi.h>
  8. #include <api/wnd/wndclass/guiobjwnd.h>
  9. // {0F08C940-AF39-4b23-80F3-B8C48F7EBB59}
  10. static const GUID statusGuid =
  11. { 0xf08c940, 0xaf39, 0x4b23, { 0x80, 0xf3, 0xb8, 0xc4, 0x8f, 0x7e, 0xbb, 0x59 } };
  12. #define SSTATUS_PARENT GuiObjectWnd
  13. class StatusScriptController : public GuiObjectScriptController {
  14. public:
  15. virtual const wchar_t *getClassName();
  16. virtual const wchar_t *getAncestorClassName();
  17. virtual ScriptObjectController *getAncestorController() { return guiController; }
  18. virtual int getNumFunctions();
  19. virtual const function_descriptor_struct *getExportedFunctions();
  20. virtual GUID getClassGuid();
  21. virtual ScriptObject *instantiate();
  22. virtual void destroy(ScriptObject *o);
  23. virtual void *encapsulate(ScriptObject *o);
  24. virtual void deencapsulate(void *o);
  25. private:
  26. static function_descriptor_struct exportedFunction[];
  27. };
  28. extern StatusScriptController *statusController;
  29. #ifndef _NOSTUDIO
  30. class SStatus : public SSTATUS_PARENT, public CoreCallbackI {
  31. public:
  32. SStatus();
  33. virtual ~SStatus();
  34. virtual int onInit();
  35. virtual int onPaint(Canvas *canvas);
  36. void setPlayBitmap(const wchar_t *name);
  37. void setPauseBitmap(const wchar_t *name);
  38. void setStopBitmap(const wchar_t *name);
  39. virtual int getWidth();
  40. virtual int getHeight();
  41. virtual int setXuiParam(int xuihandle, int attrid, const wchar_t *name, const wchar_t *strval);
  42. virtual int getPreferences(int what);
  43. // core callbacks
  44. virtual int corecb_onStarted();
  45. virtual int corecb_onStopped();
  46. virtual int corecb_onPaused();
  47. virtual int corecb_onUnpaused();
  48. enum {
  49. SSTATUS_SETPLAYBITMAP=0,
  50. SSTATUS_SETSTOPBITMAP,
  51. SSTATUS_SETPAUSEBITMAP,
  52. };
  53. protected:
  54. /*static */void CreateXMLParameters(int master_handle);
  55. /*protected:
  56. virtual void timerCallback(int id);*/
  57. private:
  58. AutoSkinBitmap playBitmap,pauseBitmap,stopBitmap;
  59. int currentStatus;
  60. int xuihandle;
  61. static XMLParamPair params[];
  62. #else
  63. class SStatus : public SSTATUS_SCRIPTPARENT {
  64. #endif
  65. public:
  66. static scriptVar script_vcpu_fake(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  67. };
  68. extern const wchar_t statusXuiStr[];
  69. extern char statusXuiSvcName[];
  70. class StatusXuiSvc : public XuiObjectSvc<SStatus, statusXuiStr, statusXuiSvcName> {};
  71. #endif