rootwndholder.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef __ROOTWNDHOLD_H
  2. #define __ROOTWNDHOLD_H
  3. #include <api/wnd/virtualwnd.h>
  4. /**
  5. A simple wnd that holds another window. Initializes it if needed, but DOES not delete it (and for a good reason, this is a ifc_window),
  6. so your inheritor has to call whoever is needed to destroy the wnd
  7. */
  8. #define ROOTWNDHOLDER_PARENT VirtualWnd
  9. class RootWndHolder : public ROOTWNDHOLDER_PARENT
  10. {
  11. public:
  12. RootWndHolder();
  13. virtual ~RootWndHolder();
  14. // override this
  15. virtual ifc_window *rootwndholder_getRootWnd();
  16. virtual void rootwndholder_getRect(RECT *r);
  17. virtual void rootwndholder_setRootWnd(ifc_window *w);
  18. // BaseWnd
  19. virtual int onInit();
  20. virtual int onResize();
  21. // virtual void onSetVisible(int v);
  22. virtual int wantRenderBaseTexture() { return 0; }
  23. virtual int onPaint(Canvas *c);
  24. virtual int onActivate();
  25. virtual int onDeactivate();
  26. virtual int getPreferences(int what);
  27. virtual int onAction(const wchar_t *action, const wchar_t *param=NULL, int x=-1, int y=-1, intptr_t p1=0, intptr_t p2=0, void *data=NULL, size_t datalen=0, ifc_window *source=NULL);
  28. virtual int childNotify(ifc_window *child, int msg, intptr_t param1=0, intptr_t param2=0);
  29. private:
  30. void checkInit(ifc_window *w);
  31. ifc_window *privptr;
  32. };
  33. #endif