123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944 |
- #ifndef _BASEWND_H
- #define _BASEWND_H
- #include <api/wnd/api_wnd.h>
- #include <api/timer/api_timer.h>
- #include <bfc/wasabi_std.h>
- #include <bfc/common.h>
- #include <api/wnd/api_window.h>
- #include <api/wnd/drag.h>
- #include <bfc/ptrlist.h>
- #include <bfc/tlist.h>
- #include <bfc/named.h>
- #include <api/timer/timerclient.h>
- #include <api/wnd/findobjectcb.h>
- #include <bfc/stack.h>
- #include <api/wnd/rootwnd.h>
- class BaseWnd;
- #include <tataki/canvas/bltcanvas.h>
- class FilenamePS;
- class Canvas;
- class ifc_canvas;
- class RegionI;
- class DragSet;
- class VirtualWnd;
- class Tooltip;
- class svc_toolTipsRenderer;
- class Accessible;
- #define TRIGGER_ONRESIZE 1000
- #define TRIGGER_INVALIDATE 2000
- #define BASEWND_NOTIFY_USER NUM_NOTIFY_MESSAGES
- #define BASEWND_CURSOR_USERSET -1
- #define BASEWND_CURSOR_POINTER 1
- #define BASEWND_CURSOR_NORTHSOUTH 2
- #define BASEWND_CURSOR_EASTWEST 3
- #define BASEWND_CURSOR_NORTHWEST_SOUTHEAST 4
- #define BASEWND_CURSOR_NORTHEAST_SOUTHWEST 5
- #define BASEWND_CURSOR_4WAY 6
- #define BASEWND_CURSOR_EDIT 7
- #define WM_WA_CONTAINER_TOGGLED WM_USER+0x1338
- #define WM_WA_COMPONENT_TOGGLED WM_USER+0x1339
- #define WM_WA_RELOAD WM_USER+0x133A
- #define WM_WA_GETFBSIZE WM_USER+0x133B
- #define DEFERREDCB_FLUSHPAINT 0x200
- #define SYSRGN 4
- #define REGIONOP_NONE 0
- #define REGIONOP_OR 1
- #define REGIONOP_AND 2
- #define REGIONOP_SUB -1
- #define REGIONOP_SUB2 -2
- #define TABORDER_K 0.0001f
- class ReparentWndEntry {
- public:
- ReparentWndEntry(OSWINDOWHANDLE wnd, OSWINDOWHANDLE parentwnd);
- virtual ~ReparentWndEntry() {}
- void unparent();
- void reparent(OSWINDOWHANDLE newparent);
- private:
- RECT rect;
- OSWINDOWHANDLE wnd;
- };
- class virtualChildTimer {
- public:
- virtualChildTimer(int _id, ifc_window *_child) : id(_id), child(_child) { }
- virtual ~virtualChildTimer() {}
- int id;
- ifc_window *child;
- };
- class RootWndFinder : public FindObjectCallbackI {
- public:
- RootWndFinder() { findobject_guid = INVALID_GUID; }
- virtual ~RootWndFinder() { }
- void reset() { findobject_id = L""; findobject_guid = INVALID_GUID; }
- void setFindId(const wchar_t *id) { findobject_id = id; }
- void setFindGuid(GUID guid) { findobject_guid = guid; }
- virtual int findobjectcb_matchObject(ifc_window *w) {
- if (!findobject_id.isempty()) {
- if (w != NULL) {
- const wchar_t *id = w->getId();
- return WCSCASEEQLSAFE(id, findobject_id);
- }
- } else if (findobject_guid != INVALID_GUID) {
- return (w->getInterface(findobject_guid) != NULL);
- }
- return 0;
- }
- private:
- StringW findobject_id;
- GUID findobject_guid;
- };
- #ifdef _WIN32
- typedef struct {
- HWND owner;
- HWND hthis;
- PtrList<ifc_window> *hlist;
- } enumownedstruct;
- #endif
- class WndWatcher: public DependentViewerI {
- public:
- WndWatcher(BaseWnd *b) : watched(NULL), dep(NULL), watcher(b) { ASSERT(watcher != NULL); }
- WndWatcher() : watched(NULL), dep(NULL), watcher(NULL) { }
- virtual ~WndWatcher() {}
- virtual void setWatcher(BaseWnd *w) {
- if (watcher != NULL)
- watchWindow(NULL);
- watcher = w;
- }
- virtual void watchWindow(ifc_window *w) {
- ASSERT(watcher != NULL);
- if (dep != NULL) {
- viewer_delViewItem(dep);
- dep = NULL;
- watched = NULL;
- }
- if (w != NULL) {
- watched = w;
- dep = w->getDependencyPtr();
- viewer_addViewItem(dep);
- }
- }
-
- virtual int viewer_onItemDeleted(ifc_dependent *item);
- private:
- ifc_window *watched;
- ifc_dependent *dep;
- BaseWnd *watcher;
- };
- #ifdef _WIN32
- BOOL CALLBACK EnumOwnedTopMostWindows(HWND hwnd, LPARAM lParam);
- #endif
- class TabOrderEntry {
- public:
- ifc_window *wnd;
- float order;
-
-
-
- };
- class TabOrderSort {
- public:
- static int compareItem(TabOrderEntry *p1, TabOrderEntry *p2) {
- if (p1->order < p2->order) return -1;
- if (p1->order > p2->order) return 1;
- return 0;
- }
- };
- #define BASEWND_PARENT RootWndI
- class NOVTABLE BaseWnd :
- public RootWndI,
- public DragInterface,
- public NamedW,
- public DependentI,
- public TimerClientI
- {
- friend class VirtualWnd;
- protected:
-
- BaseWnd();
-
- public:
- virtual ~BaseWnd();
-
-
-
- virtual int init(ifc_window *parent, int nochild=FALSE);
- virtual int init(OSMODULEHANDLE hInstance, OSWINDOWHANDLE parent, int nochild=FALSE);
- virtual int isInited();
- virtual int isPostOnInit() { return postoninit; }
- virtual int setVirtual(int i) { return 0; }
-
-
- virtual int onInit();
- virtual int onPostOnInit();
-
- virtual int getCursorType(int x, int y);
- virtual int getFontSize() { return 0; }
- virtual int setFontSize(int size) { return -1; }
-
- virtual void resize(int x, int y, int w, int h, int wantcb=1);
- void resize(RECT *r, int wantcb=1);
- void resizeToRect(RECT *r) { resize(r); }
-
- virtual int onResize();
- virtual int onAfterResize() { return 1; }
- void resizeToClient(BaseWnd *wnd);
- virtual int onPostedMove();
-
- virtual void move(int x, int y);
-
- virtual void notifyDeferredMove(int x, int y);
-
- virtual void bringToFront();
-
- virtual void bringToBack();
-
- virtual int onSiblingInvalidateRgn(api_region *r, ifc_window *who, int who_idx, int my_idx) { return 0; }
-
- virtual void setVisible(int show);
- virtual void setCloaked(int cloak);
- virtual void onSetVisible(int show);
- virtual void onChildInvalidate(api_region *r, ifc_window *w) {}
-
- virtual void setEnabled(int en);
-
- virtual void setFocus();
- virtual void setFocusOnClick(int f);
- virtual int getFocusOnClick() { return focus_on_click; }
- virtual int pointInWnd(POINT *p);
-
- virtual void invalidate();
- virtual void invalidateRect(RECT *r);
- virtual void invalidateRgn(api_region *r);
- virtual void invalidateFrom(ifc_window *who);
- virtual void invalidateRectFrom(RECT *r, ifc_window *who);
- virtual void invalidateRgnFrom(api_region *r, ifc_window *who);
- virtual void validate();
- virtual void validateRect(RECT *r);
- virtual void validateRgn(api_region *reg);
-
- void deferedInvalidateRgn(api_region *h);
- void deferedInvalidateRect(RECT *r);
- void deferedInvalidate();
- void deferedValidateRgn(api_region *h);
- void deferedValidateRect(RECT *r);
- void deferedValidate();
- api_region *getDeferedInvalidRgn();
- int hasVirtualChildren();
- virtual void setVirtualChildFocus(ifc_window *w);
- virtual ifc_window *getNextVirtualFocus(ifc_window *w);
- void setVirtualTabOrder(ifc_window *w, int a);
- int getVirtualTabOrder(ifc_window *w);
- virtual void setTabOrder(int a);
- virtual int getTabOrder();
- virtual void setAutoTabOrder();
- virtual void setVirtualAutoTabOrder(ifc_window *w);
- virtual void focusNext();
- virtual void focusPrevious();
- virtual ifc_window *getCurVirtualChildFocus() { return curVirtualChildFocus; }
- virtual ifc_window *getTab(int what=TAB_GETNEXT);
- private:
-
- virtual void physicalInvalidateRgn(api_region *r);
- void autoFocus(ifc_window *w);
- protected:
- virtual int ensureVirtualCanvasOk();
- virtual void setVirtualCanvas(Canvas *c);
- virtual void setRSize(int x, int y, int w, int h);
- public:
- virtual void repaint();
-
- virtual void getClientRect(RECT *);
- RECT clientRect();
- virtual void getNonClientRect(RECT *);
- RECT nonClientRect();
- virtual void getWindowRect(RECT *);
- RECT windowRect();
- virtual void getPosition(POINT *pt);
- virtual void *getInterface(GUID interface_guid) { return NULL; }
- virtual void *dependent_getInterface(const GUID *classguid);
- virtual void clientToScreen(int *x, int *y);
- virtual void screenToClient(int *x, int *y);
- virtual void clientToScreen(POINT *pt);
- virtual void screenToClient(POINT *pt);
- virtual void clientToScreen(RECT *r);
- virtual void screenToClient(RECT *r);
- void setIcon(OSICONHANDLE icon, int _small);
- virtual void setSkinId(int id);
- virtual int getPreferences(int what);
- virtual void setPreferences(int what, int v);
- virtual void setStartHidden(int wtf);
- virtual void setDefaultCursor(Cursor *c);
- virtual Canvas *getFrameBuffer();
- void setWindowTitle(const wchar_t *title);
- protected:
- virtual DragInterface *getDragInterface();
- virtual ifc_window *rootWndFromPoint(POINT *pt);
- virtual int rootwnd_paintTree(ifc_canvas *canvas, api_region *r);
- void assignRootFocus(ifc_window *w);
- public:
-
- #ifdef _WIN32
- virtual LRESULT wndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
- #elif defined(__APPLE__)
- virtual OSStatus eventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData);
- #endif
- virtual void performBatchProcesses();
- virtual const wchar_t *getRootWndName();
- virtual const wchar_t *getId();
-
- virtual int onContextMenu(int x, int y);
- virtual int onChildContextMenu(int x, int y);
-
- virtual int onPaint(Canvas *canvas);
- void setTransparency(int amount);
- int getTransparency();
-
- virtual void timerCallback(int id);
- virtual int onDeferredCallback(intptr_t p1, intptr_t p2);
- int setTimer(int id, int ms);
- int killTimer(int id);
- void postDeferredCallback(intptr_t p1, intptr_t p2=0, int mindelay=0);
-
- virtual int timerclient_onDeferredCallback(intptr_t p1, intptr_t p2);
- virtual void timerclient_timerCallback(int id);
- virtual TimerClient *timerclient_getMasterClient();
- virtual void timerclient_onMasterClientMultiplex();
- virtual TimerClient *getTimerClient();
- virtual const wchar_t *timerclient_getName();
- private:
- virtual int onPaint(Canvas *canvas, api_region *r);
- public:
-
- virtual int onLeftButtonDown(int x, int y);
- virtual int onRightButtonDown(int x, int y) { return 0; }
- virtual int onMouseMove(int x, int y);
- virtual int onLeftButtonUp(int x, int y);
- virtual int onRightButtonUp(int x, int y) { return 0; }
- virtual int onMouseWheelUp(int click, int lines);
- virtual int onMouseWheelDown(int click, int lines);
- virtual int beginCapture();
- virtual int endCapture();
- virtual int getCapture();
- virtual void onCancelCapture();
- virtual void cancelCapture();
-
- virtual int onLeftButtonDblClk(int x, int y);
- virtual int onRightButtonDblClk(int x, int y);
- virtual int onGetFocus();
- virtual int onKillFocus();
- virtual int gotFocus();
- virtual int isActive();
- virtual int onActivate();
- virtual void activate();
- virtual int onDeactivate();
- virtual int onEnable(int en);
- virtual int isEnabled(int within=0);
- virtual void registerAcceleratorSection(const wchar_t *name, int global=0);
- virtual int onAcceleratorEvent(const wchar_t *name);
- virtual int onChar(unsigned int c);
- virtual int onKeyDown(int keyCode) { return 0; }
- virtual int onKeyUp(int keyCode) { return 0; }
- virtual int onSysKeyDown(int keyCode, int keyData) { return 0; }
- virtual int onSysKeyUp(int keyCode, int keyData) { return 0; }
- virtual int onEraseBkgnd(HDC dc);
- virtual int onUserMessage(int msg, int w, int l, int *r);
-
-
-
-
-
- virtual int childNotify(ifc_window *child, int msg,
- int param1=0, int param2=0);
-
- void setParent(ifc_window *newparent);
- ifc_window *getParent();
- virtual ifc_window *getRootParent();
- virtual ifc_window *getDesktopParent();
-
-
- virtual int reparent(ifc_window *newparent);
-
- virtual void onSetParent(ifc_window *newparent) {}
- virtual api_region *getRegion();
- virtual void setRegionOp(int op);
- virtual void setRectRgn(int i);
- virtual void invalidateWindowRegion();
- api_region *getComposedRegion();
- api_region *getSubtractorRegion();
- int ptInRegion(int x, int y);
- virtual int getRegionOp();
- virtual int isRectRgn();
-
- virtual int notifyParent(int msg, int param1=0, int param2=0);
-
-
- virtual int passNotifyUp(ifc_window *child, int msg,
- int param1=0, int param2=0);
-
-
-
- void setNotifyId(int id);
- virtual int getNotifyId();
-
- virtual void onSetName();
-
- virtual void setOSWndName(const wchar_t *name);
-
- virtual const wchar_t *getOSWndName();
- virtual const wchar_t *getTip();
- virtual void setTip(const wchar_t *tooltip);
- virtual int getStartHidden();
- virtual void abortTip();
- virtual int isVisible(int within=0);
-
- virtual Canvas *createFrameBuffer(int w, int h);
- virtual void prepareFrameBuffer(Canvas *canvas, int w, int h);
- virtual void deleteFrameBuffer(Canvas *canvas);
- virtual void registerRootWndChild(ifc_window *child);
- virtual void unregisterRootWndChild(ifc_window *child);
- virtual ifc_window *findRootWndChild(int x, int y, int only_virtuals=0);
- virtual ifc_window *enumRootWndChildren(int _enum);
- virtual int getNumRootWndChildren();
- virtual int isVirtual();
- virtual ifc_window *enumVirtualChild(int _enum);
- virtual int getNumVirtuals();
- virtual int handleVirtualChildMsg(UINT uMsg,int x, int y, void *p=NULL, void *d=NULL);
- virtual void setVirtualChildCapture(ifc_window *child);
- virtual ifc_window *getVirtualChildCapture();
- virtual int cascadeRepaintFrom(ifc_window *who, int pack=1);
- virtual int cascadeRepaintRgnFrom(api_region *reg, ifc_window *who, int pack=1);
- virtual int cascadeRepaintRectFrom(RECT *r, ifc_window *who, int pack=1);
- virtual int cascadeRepaint(int pack=1);
- virtual int cascadeRepaintRgn(api_region *reg, int pack=1);
- virtual int cascadeRepaintRect(RECT *r, int pack=1);
- virtual void flushPaint();
- virtual void onMinimize();
- virtual void onRestore();
- virtual int isMinimized();
- virtual int isMaximized() { return maximized; }
- virtual void onMaximize() { }
-
- virtual void freeResources();
- virtual void reloadResources();
- virtual int getDesktopAlpha();
- virtual int handleDesktopAlpha() { return isVirtual(); }
- virtual int getPaintingAlpha();
- virtual void setAlpha(int activealpha, int inactivealpha=-1);
- virtual void getAlpha(int *activealpha=NULL, int *inactivealpha=NULL);
- virtual int getFlag(int flag);
- virtual int triggerEvent(int event, intptr_t p1, intptr_t p2);
- void commitFrameBuffer(Canvas *canvas, RECT *r, double ratio);
- virtual int paint(Canvas *canvas, api_region *r);
- protected:
- void do_flushPaint();
- virtual int paintTree(Canvas *canvas, api_region *r);
- virtual int virtualBeforePaint(api_region *r);
- virtual int virtualAfterPaint(api_region *r);
- int virtualOnPaint();
- virtual void setDesktopAlpha(int do_alpha);
- virtual void onSetDesktopAlpha(int a);
- public:
-
- virtual OSWINDOWHANDLE getOsWindowHandle();
- virtual OSMODULEHANDLE getOsModuleHandle();
- public:
-
- bool getNoCopyBits(void);
- void setNoCopyBits(bool ncb);
- BltCanvas *scalecanvas;
- protected:
- virtual int checkDoubleClick(int button, int x, int y);
- public:
- virtual int isDestroying();
-
-
- int addDragItem(const wchar_t *droptype, void *item);
-
- int handleDrag();
- int resetDragSet();
-
- virtual int dragEnter(ifc_window *sourceWnd);
-
-
- virtual int dragOver(int x, int y, ifc_window *sourceWnd) { return 0; }
-
- virtual int dragSetSticky(ifc_window *wnd, int left, int right, int up, int down);
-
- virtual int dragLeave(ifc_window *sourceWnd) { return 0; }
-
-
-
-
- virtual int dragDrop(ifc_window *sourceWnd, int x, int y) { return 0; }
-
- virtual int dragComplete(int success) { return 0; }
-
-
- void setSuggestedDropTitle(const wchar_t *title);
-
- virtual const wchar_t *dragGetSuggestedDropTitle(void);
- virtual int dragCheckData(const wchar_t *type, int *nitems=NULL);
- virtual void *dragGetData(int slot, int itemnum);
- virtual int dragCheckOption(int option) { return 0; }
-
- virtual int checkDragTypes(ifc_window *sourceWnd) { return 0; }
-
- virtual int acceptExternalDrops() { return 0; }
- virtual void onExternalDropBegin() {}
- virtual void onExternalDropDirScan(const wchar_t *dirname) {}
- virtual void onExternalDropEnd() {}
- virtual int bypassModal();
- virtual ifc_window *findWindow(const wchar_t *id);
- virtual ifc_window *findWindowByInterface(GUID interface_guid);
- virtual ifc_window *findWindowByCallback(FindObjectCallback *cb);
- virtual ifc_window *findWindowChain(FindObjectCallback *cb, ifc_window *wcaller=NULL);
- private:
- void addDroppedFile(const wchar_t *filename, PtrList<FilenamePS> *plist);
- void setLayeredWindow(int i);
- Accessible *createNewAccObj();
- public:
- virtual void setNotifyWindow(ifc_window *newnotify);
- virtual ifc_window *getNotifyWindow();
- virtual double getRenderRatio();
- virtual void setRenderRatio(double r);
- virtual void onRatioChanged() {}
- virtual void setRatioLinked(int l);
- virtual int handleRatio();
- int renderRatioActive();
- void multRatio(int *x, int *y=NULL);
- void multRatio(RECT *r);
- void divRatio(int *x, int *y=NULL);
- void divRatio(RECT *r);
- virtual int isClickThrough();
- virtual void setClickThrough(int ct);
- virtual ifc_window *getForwardWnd() { return this; }
- virtual void setNoLeftClicks(int no);
- virtual void setNoRightClicks(int no);
- virtual void setNoDoubleClicks(int no);
- virtual void setNoMouseMoves(int no);
- virtual void setNoContextMenus(int no);
-
-
- virtual int wantDoubleClicks() { return !nodoubleclick; }
- virtual int wantLeftClicks() { return !noleftclick; }
- virtual int wantRightClicks() { return !norightclick; }
- virtual int wantMouseMoves() { return !nomousemove; }
- virtual int wantContextMenus() { return !nocontextmnu; }
- protected:
-
- virtual int wantSiblingInvalidations();
- virtual int wantFocus();
- virtual int wantAutoContextMenu();
- protected:
- void onTipMouseMove();
- void renderBaseTexture(ifc_canvas *c, const RECT &r, int alpha=255);
- void rootwnd_renderBaseTexture(ifc_canvas *c, const RECT *r, int alpha=255) { renderBaseTexture(c, *r, alpha); }
-
- int getTabOrderEntry(ifc_window *w);
- void delTabOrderEntry(int i);
- int getTabOrderEntry(float order);
- void delTabOrderEntry(ifc_window *w);
- virtual OSCURSORHANDLE getCustomCursor(int x, int y);
- public:
- virtual ifc_window *getBaseTextureWindow();
- void setBaseTextureWindow(ifc_window *w);
- virtual int isMouseOver(int x, int y);
- virtual void bringVirtualToFront(ifc_window *w);
- virtual void bringVirtualToBack(ifc_window *w);
- virtual void bringVirtualAbove(ifc_window *w, ifc_window *b);
- virtual void bringVirtualBelow(ifc_window *w, ifc_window *b);
- void changeChildZorder(ifc_window *w, int newpos);
- virtual int handleTransparency();
- virtual int runModal();
- virtual int exec() { return runModal(); }
- virtual void endModal(int ret);
- ifc_dependent *rootwnd_getDependencyPtr();
- ifc_dependent *timerclient_getDependencyPtr();
- virtual void signalMinMaxEnforcerChanged(void);
- virtual void onMinMaxEnforcerChanged(void) {}
- virtual void addMinMaxEnforcer(ifc_window *w);
- virtual void removeMinMaxEnforcer(ifc_window *w);
- virtual ifc_window *enumMinMaxEnforcer(int n);
- virtual int getNumMinMaxEnforcers();
- 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 sendAction(ifc_window *target, const wchar_t *action, const wchar_t *param=NULL, int x=0, int y=0, intptr_t p1=0, intptr_t p2=0, void *data=NULL, size_t datalen=0);
- virtual void setRenderBaseTexture(int r);
- virtual int getRenderBaseTexture();
- virtual GuiObject *getGuiObject();
- void setAutoResizeAfterInit(int tf) { want_autoresize_after_init = tf; }
- virtual void setAllowDeactivation(int allow) { allow_deactivate = allow; }
- virtual int allowDeactivation();
- int getNumTabs();
- ifc_window *enumTab(int i);
- virtual void onSetRootFocus(ifc_window *w);
- virtual int wantActivation() { return 1; }
- virtual Accessible *getAccessibleObject(int createifnotexists=1);
- virtual int accessibility_getState();
- #ifdef EXPERIMENTAL_INDEPENDENT_AOT
- virtual void setAlwaysOnTop(int i);
- virtual int getAlwaysOnTop();
- #endif
- virtual void wndwatcher_onDeleteWindow(ifc_window *w);
- virtual void setOSModuleHandle(OSMODULEHANDLE module) { hinstance = module; }
- #ifndef WA3COMPATIBILITY
- virtual void setDropTarget(void *dt);
- virtual void *getDropTarget();
- #endif
- virtual void pushWindowRect();
- virtual int popWindowRect(RECT *rc=NULL, int applyhow=PWR_DIMENTIONS|PWR_POSITION);
- virtual void maximize(int axis=MAXIMIZE_WIDTH|MAXIMIZE_HEIGHT);
- virtual void restore(int what=RESTORE_X|RESTORE_Y|RESTORE_WIDTH|RESTORE_HEIGHT);
- virtual int getRestoredRect(RECT *r);
- virtual void setRestoredRect(RECT *r);
- virtual int forcedOnResize();
- virtual void forcedOnResizeChain(ifc_window *w);
- protected:
- void setForeignWnd(int i);
-
- protected:
-
-
- OSMODULEHANDLE hinstance;
- OSWINDOWHANDLE hwnd;
- private:
- ifc_window *parentWnd;
- int inputCaptured;
- void onTab();
- void recursive_setVirtualTabOrder(ifc_window *w, float a, float lambda=TABORDER_K);
- void recursive_buildTabList(ifc_window *from, PtrList<ifc_window> *list);
- RECT restore_rect;
- int maximized;
- protected:
- void dropVirtualCanvas();
- int bufferizeLockedUIMsg(int uMsg, int wParam, int lParam);
- void clearBufferizedUI() { bufferedmsgs.removeAll(); }
- void checkLockedUI();
- int checkModal();
- void hintDestroying() { destroying=TRUE; }
- virtual int forceTransparencyFlag();
- int dragging;
- Canvas *virtualCanvas;
- void updateWindowRegion();
- int isWindowRegionValid() { return !wndregioninvalid; }
- virtual int wantRedrawOnResize() { return 1; }
- int ensureWindowRegionValid();
- int disable_tooltip_til_recapture;
- virtual int reinit();
- virtual int reinit(ifc_window *parWnd, int nochild);
- virtual int reinit(OSMODULEHANDLE moduleHandle, OSWINDOWHANDLE parent, int nochild);
- int inonresize;
- virtual void onBeforeReinit() {}
- virtual void onAfterReinit() {}
- StringW tip;
- private:
- void reparentHWNDChildren();
- void redrawHWNDChildren();
- void unparentHWNDChildren();
-
- #ifdef EXPERIMENTAL_INDEPENDENT_AOT
- void saveTopMosts();
- void restoreTopMosts();
- #endif
- void _cascadeRepaintRgn(api_region *rg);
- void packCascadeRepaintRgn(api_region *rg);
- int createTip();
- void destroyTip();
- PtrList<DragSet> dragsets;
- ifc_window *prevtarg;
- StringW suggestedTitle;
- typedef struct {
- int msg;
- int wparam;
- int lparam;
- } bufferedMsgStruct;
-
- TList<bufferedMsgStruct> bufferedmsgs;
- int uiwaslocked;
- void onTip();
-
- int start_hidden;
- svc_toolTipsRenderer *tipsvc;
- int tipid;
- bool tip_done;
- bool tipawaytimer;
- bool tipshowtimer;
- bool tipbeenchecked;
- bool tipdestroytimer;
-
- bool ncb;
- uint32_t lastClick[2];
- POINT lastClickP[2];
-
- ifc_window *btexture;
-
- ifc_window *notifyWindow;
- bool destroying;
-
- PtrList<ifc_window> virtualChildren;
- PtrList<ifc_window> rootwndchildren;
- int virtualCanvasHandled;
- int virtualCanvasH,virtualCanvasW;
- int rwidth, rheight, rx, ry;
- ifc_window *curVirtualChildCaptured;
-
- RegionI *deferedInvalidRgn;
- OSWINDOWHANDLE oldCapture;
-
- int hasfocus;
- ifc_window *curVirtualChildFocus;
- double ratio;
- int skin_id;
- int wndalpha;
- int w2k_alpha;
- int curframerate;
- int notifyid;
- int activealpha;
- int inactivealpha;
- int clickthrough;
- int triedtipsvc;
- int mustquit;
- int returnvalue;
- int postoninit;
- int inited;
- int skipnextfocus;
- RegionI *subtractorrgn, *composedrgn;
- void setWindowRegion(api_region *r);
- void computeComposedRegion();
- void assignWindowRegion(api_region *wr);
- int wndregioninvalid;
- int rectrgn, regionop;
- RegionI *deferedCascadeRepaintRgn;
- int need_flush_cascaderepaint;
- Tooltip *tooltip;
- PtrList<ifc_window> minmaxEnforcers;
- int this_visible;
- int renderbasetexture;
- GuiObject *my_guiobject;
- int want_autoresize_after_init;
- int resizecount;
- double lastratio;
- int suggested_w, suggested_h;
- int maximum_w, maximum_h;
- int minimum_w, minimum_h;
- int allow_deactivate;
- int minimized;
- int deleting;
- int preventcancelcapture;
- StringW tcname;
- int focus_on_click;
- PtrListQuickSorted<TabOrderEntry, TabOrderSort> childtabs;
- ifc_window *rootfocus;
- int ratiolinked;
- int nodoubleclick, noleftclick, norightclick, nomousemove, nocontextmnu;
- Cursor *customdefaultcursor;
- Accessible *accessible;
- StringW osname;
- int focusEventsEnabled;
- PtrList<ifc_window> ontoplist;
- int alwaysontop;
- WndWatcher rootfocuswatcher;
- int cloaked;
- int m_takenOver;
- int this_enabled;
- int has_alpha_flag;
- RECT *commitfb_rect;
- PtrList<ReparentWndEntry> reparentwnds;
- #ifndef WA3COMPATIBILITY
- void *m_target;
- #endif
- int lastnullregion;
- Stack<RECT> windowrectstack;
- TList<OSWINDOWHANDLE> ghosthwnd;
- int ghostbust;
-
- OSWINDOWHANDLE lastActiveWnd;
- };
- #ifdef WIN32
- __inline HINSTANCE HINSTANCEfromHWND(HWND wnd) {
- if (wnd == NULL) return NULL;
- return (HINSTANCE)(LONG_PTR)GetWindowLongPtrW(wnd, GWLP_HINSTANCE);
- }
- #endif
- #endif
|