From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/Wasabi/api/wnd/wndclass/rootwndholder.h | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Src/Wasabi/api/wnd/wndclass/rootwndholder.h (limited to 'Src/Wasabi/api/wnd/wndclass/rootwndholder.h') diff --git a/Src/Wasabi/api/wnd/wndclass/rootwndholder.h b/Src/Wasabi/api/wnd/wndclass/rootwndholder.h new file mode 100644 index 00000000..6c718ce5 --- /dev/null +++ b/Src/Wasabi/api/wnd/wndclass/rootwndholder.h @@ -0,0 +1,41 @@ +#ifndef __ROOTWNDHOLD_H +#define __ROOTWNDHOLD_H + +#include + +/** + 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), + so your inheritor has to call whoever is needed to destroy the wnd +*/ + +#define ROOTWNDHOLDER_PARENT VirtualWnd + +class RootWndHolder : public ROOTWNDHOLDER_PARENT +{ + public: + RootWndHolder(); + virtual ~RootWndHolder(); + + // override this + virtual ifc_window *rootwndholder_getRootWnd(); + virtual void rootwndholder_getRect(RECT *r); + virtual void rootwndholder_setRootWnd(ifc_window *w); + + // BaseWnd + virtual int onInit(); + virtual int onResize(); +// virtual void onSetVisible(int v); + virtual int wantRenderBaseTexture() { return 0; } + virtual int onPaint(Canvas *c); + virtual int onActivate(); + virtual int onDeactivate(); + virtual int getPreferences(int what); + 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); + virtual int childNotify(ifc_window *child, int msg, intptr_t param1=0, intptr_t param2=0); + + private: + void checkInit(ifc_window *w); + ifc_window *privptr; +}; + +#endif \ No newline at end of file -- cgit