1
0

xuioswndhost.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef __OSWndHost_H
  2. #define __OSWndHost_H
  3. #include <api/wnd/wndclass/guiobjwnd.h>
  4. #include <api/wnd/wndclass/oswndhost.h>
  5. #define XUIOSWNDHOST_PARENT GuiObjectWnd
  6. #define DCB_OSWNDHOST_REQUEST_IDEAL_SIZE 2048
  7. #define OSWNDHOST_REQUEST_IDEAL_SIZE WM_USER + DCB_OSWNDHOST_REQUEST_IDEAL_SIZE
  8. class DCBIdealSize {
  9. public:
  10. DCBIdealSize(int idealwidth, int idealheight) : m_idealwidth(idealwidth), m_idealheight(idealheight) {}
  11. int m_idealwidth;
  12. int m_idealheight;
  13. };
  14. // -----------------------------------------------------------------------
  15. class XuiOSWndHost : public XUIOSWNDHOST_PARENT, public OSWndHostI
  16. {
  17. public:
  18. XuiOSWndHost();
  19. virtual ~XuiOSWndHost();
  20. virtual int onPaint(Canvas *c);
  21. virtual int setXuiParam(int xuihandle, int xmlattributeid, const wchar_t *xmlattributename, const wchar_t *value);
  22. virtual int wantRedrawOnResize() { return 0; }
  23. virtual int onAfterResize();
  24. void setHWND(const char *hwnd);
  25. HWND getHWND() { return wnd; }
  26. void setHWND(HWND hwnd) { wnd = hwnd; }
  27. virtual void oswndhost_host(HWND oswnd);
  28. virtual void oswndhost_unhost();
  29. virtual void oswndhost_setRegionOffsets(RECT *r);
  30. virtual int onUserMessage(int msg, int w, int l, int *r);
  31. virtual int onDeferredCallback(intptr_t p1, intptr_t p2);
  32. virtual void onBeforeReparent(int host);
  33. virtual void onAfterReparent(int host);
  34. virtual int handleRatio() { return 0; }
  35. virtual int handleDesktopAlpha() { return 0; }
  36. void onSetVisible(int show);
  37. protected:
  38. /*static */void CreateXMLParameters(int master_handle);
  39. private:
  40. void doOnResize();
  41. void doHost();
  42. enum {
  43. XUIOSWNDHOST_SETHWND = 0,
  44. XUIOSWNDHOST_SETOFFSETS = 1,
  45. };
  46. static XMLParamPair params[];
  47. int myxuihandle;
  48. RECT regionrect;
  49. int hasregionrect;
  50. HWND wnd;
  51. HWND oldparent;
  52. DWORD savedStyle;
  53. DWORD savedExStyle;
  54. RECT oldrect;
  55. bool hosted;
  56. int visible_start_state;
  57. };
  58. // -----------------------------------------------------------------------
  59. extern const wchar_t OSWndHostXuiObjectStr[];
  60. extern char OSWndHostXuiSvcName[];
  61. class OSWndHostXuiSvc : public XuiObjectSvc<XuiOSWndHost, OSWndHostXuiObjectStr, OSWndHostXuiSvcName> {};
  62. #endif