Popup windows will be hidden when minimizing the main frame.
[wine] / include / win.h
1 /*
2  * Window definitions
3  *
4  * Copyright 1993 Alexandre Julliard
5  */
6
7 #ifndef __WINE_WIN_H
8 #define __WINE_WIN_H
9
10 #include "windef.h"
11 #include "wingdi.h"
12 #include "winuser.h"
13 #include "queue.h"
14 #include "class.h"
15
16 #define WND_MAGIC     0x444e4957  /* 'WIND' */
17
18   /* Built-in class names (see _Undocumented_Windows_ p.418) */
19 #define POPUPMENU_CLASS_NAME "#32768"  /* PopupMenu */
20 #define DESKTOP_CLASS_NAME   "#32769"  /* Desktop */
21 #define DIALOG_CLASS_NAME    "#32770"  /* Dialog */
22 #define WINSWITCH_CLASS_NAME "#32771"  /* WinSwitch */
23 #define ICONTITLE_CLASS_NAME "#32772"  /* IconTitle */
24
25 #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768)  /* PopupMenu */
26 #define DESKTOP_CLASS_ATOM   ((ATOM)32769)       /* Desktop */
27 #define DIALOG_CLASS_ATOM    MAKEINTATOM(32770)  /* Dialog */
28 #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771)  /* WinSwitch */
29 #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772)  /* IconTitle */
30
31 /* Built-in 32-bit classes */
32 typedef enum
33 {
34     BIC32_BUTTON,
35     BIC32_EDIT,
36     BIC32_LISTBOX,
37     BIC32_COMBO,
38     BIC32_COMBOLB,
39     BIC32_POPUPMENU,
40     BIC32_STATIC,
41     BIC32_SCROLL,
42     BIC32_MDICLIENT,
43     BIC32_DESKTOP,
44     BIC32_DIALOG,
45     BIC32_ICONTITLE,
46     BIC32_NB_CLASSES
47 } BUILTIN_CLASS32;
48
49   /* PAINT_RedrawWindow() control flags */
50 #define RDW_EX_USEHRGN          0x0001
51 #define RDW_EX_DELETEHRGN       0x0002
52 #define RDW_EX_XYWINDOW         0x0004
53 #define RDW_EX_TOPFRAME         0x0010
54 #define RDW_EX_DELAY_NCPAINT    0x0020
55
56 struct tagCLASS;
57 struct tagDCE;
58 struct tagDC;
59 struct tagWND_DRIVER;
60
61 typedef struct tagWND
62 {
63     struct tagWND *next;          /* Next sibling */
64     struct tagWND *child;         /* First child */
65     struct tagWND *parent;        /* Window parent (from CreateWindow) */
66     struct tagWND *owner;         /* Window owner */
67     struct tagCLASS *class;       /* Window class */
68     HWINDOWPROC    winproc;       /* Window procedure */
69     DWORD          dwMagic;       /* Magic number (must be WND_MAGIC) */
70     HWND         hwndSelf;      /* Handle of this window */
71     HINSTANCE    hInstance;     /* Window hInstance (from CreateWindow) */
72     RECT         rectClient;    /* Client area rel. to parent client area */
73     RECT         rectWindow;    /* Whole window rel. to parent client area */
74     LPSTR          text;          /* Window text */
75     void          *pVScroll;      /* Vertical scroll-bar info */
76     void          *pHScroll;      /* Horizontal scroll-bar info */
77     void          *pProp;         /* Pointer to properties list */
78     struct tagDCE *dce;           /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
79     HGLOBAL16      hmemTaskQ;     /* Task queue global memory handle */
80     HRGN16         hrgnUpdate;    /* Update region */
81     HWND         hwndLastActive;/* Last active popup hwnd */
82     DWORD          dwStyle;       /* Window style (from CreateWindow) */
83     DWORD          dwExStyle;     /* Extended style (from CreateWindowEx) */
84     UINT         wIDmenu;       /* ID or hmenu (from CreateWindow) */
85     DWORD          helpContext;   /* Help context ID */
86     WORD           flags;         /* Misc. flags (see below) */
87     HMENU16        hSysMenu;      /* window's copy of System Menu */
88     int            irefCount;     /* window's reference count*/
89     DWORD          userdata;      /* User private data */
90     struct tagWND_DRIVER *pDriver;  /* Window driver */
91     void          *pDriverData;   /* Window driver data */
92     DWORD          wExtra[1];     /* Window extra bytes */
93 } WND;
94
95 /* Host attributes */
96
97 #define HAK_BITGRAVITY     1
98 #define HAK_ACCEPTFOCUS    2
99 #define HAK_ICONICSTATE    3
100
101 /* Bit Gravity */
102
103 #define BGForget           0
104 #define BGNorthWest        1
105 #define BGNorth            2
106 #define BGNorthEast        3
107 #define BGWest             4
108 #define BGCenter           5
109 #define BGEast             6
110 #define BGSouthWest        7
111 #define BGSouth            8
112 #define BGSouthEast        9
113 #define BGStatic           10
114
115 typedef struct tagWND_DRIVER
116 {
117     void   (*pInitialize)(WND *);
118     void   (*pFinalize)(WND *);
119     BOOL (*pCreateDesktopWindow)(WND *, struct tagCLASS *, BOOL);
120     BOOL (*pCreateWindow)(WND *, struct tagCLASS *, CREATESTRUCTA *, BOOL);
121     BOOL (*pDestroyWindow)(WND *);
122     WND*   (*pSetParent)(WND *, WND *);
123     void   (*pForceWindowRaise)(WND *);
124     void   (*pSetWindowPos)(WND *, const WINDOWPOS *, BOOL);
125     void   (*pSetText)(WND *, LPCSTR);
126     void   (*pSetFocus)(WND *);
127     void   (*pPreSizeMove)(WND *);
128     void   (*pPostSizeMove)(WND *);
129     void   (*pSurfaceCopy)(WND *, struct tagDC *, INT, INT, const RECT *, BOOL);
130     void   (*pSetDrawable)(WND *, struct tagDC *, WORD, BOOL);
131     BOOL   (*pSetHostAttr)(WND *, INT haKey, INT value);
132     BOOL (*pIsSelfClipping)(WND *);
133 } WND_DRIVER;
134
135 extern WND_DRIVER *WND_Driver;
136
137 typedef struct
138 {
139     RECT16         rectNormal;
140     POINT16        ptIconPos;
141     POINT16        ptMaxPos;
142     HWND16         hwndIconTitle;
143 } INTERNALPOS, *LPINTERNALPOS;
144
145   /* WND flags values */
146 #define WIN_NEEDS_BEGINPAINT   0x0001 /* WM_PAINT sent to window */
147 #define WIN_NEEDS_ERASEBKGND   0x0002 /* WM_ERASEBKGND must be sent to window*/
148 #define WIN_NEEDS_NCPAINT      0x0004 /* WM_NCPAINT must be sent to window */
149 #define WIN_RESTORE_MAX        0x0008 /* Maximize when restoring */
150 #define WIN_INTERNAL_PAINT     0x0010 /* Internal WM_PAINT message pending */
151 #define WIN_NATIVE             0x0020 /* Directly mapped to the window provided by the driver */
152 #define WIN_NEED_SIZE          0x0040 /* Internal WM_SIZE is needed */
153 #define WIN_NCACTIVATED        0x0080 /* last WM_NCACTIVATE was positive */
154 #define WIN_MANAGED            0x0100 /* Window managed by the window system */
155 #define WIN_ISDIALOG           0x0200 /* Window is a dialog */
156 #define WIN_ISWIN32            0x0400 /* Understands Win32 messages */
157 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
158
159   /* BuildWinArray() flags */
160 #define BWA_SKIPDISABLED        0x0001
161 #define BWA_SKIPHIDDEN          0x0002
162 #define BWA_SKIPOWNED           0x0004
163 #define BWA_SKIPICONIC          0x0008
164
165   /* WIN_UpdateNCRgn() flags */
166 #define UNC_CHECK               0x0001
167 #define UNC_ENTIRE              0x0002
168 #define UNC_REGION              0x0004
169 #define UNC_UPDATE              0x0008
170 #define UNC_DELAY_NCPAINT       0x0010
171 #define UNC_IN_BEGINPAINT       0x0020
172
173   /* Window functions */
174 extern void   WIN_Init( void );
175 extern void   WIN_LockWnds( void );
176 extern void   WIN_UnlockWnds( void );
177 extern int    WIN_SuspendWndsLock( void );
178 extern void   WIN_RestoreWndsLock(int ipreviousLock);
179 extern WND*   WIN_FindWndPtr( HWND hwnd );
180 extern WND*   WIN_LockWndPtr(WND *wndPtr);
181 extern void   WIN_ReleaseWndPtr(WND *wndPtr);
182 extern void   WIN_UpdateWndPtr(WND **oldPtr,WND *newPtr);
183 extern WND*   WIN_GetDesktop(void);
184 extern void   WIN_ReleaseDesktop(void);
185 extern void   WIN_DumpWindow( HWND hwnd );
186 extern void   WIN_WalkWindows( HWND hwnd, int indent );
187 extern BOOL WIN_UnlinkWindow( HWND hwnd );
188 extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
189 extern HWND WIN_FindWinToRepaint( HWND hwnd, HQUEUE16 hQueue );
190 extern BOOL WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew);
191 extern BOOL WIN_CreateDesktopWindow(void);
192 extern HWND WIN_GetTopParent( HWND hwnd );
193 extern WND*   WIN_GetTopParentPtr( WND* pWnd );
194 extern BOOL WIN_IsWindowDrawable(WND*, BOOL );
195 extern WND**  WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
196 extern void   WIN_ReleaseWinArray(WND **wndArray);
197
198 extern HWND CARET_GetHwnd(void);
199 extern void CARET_GetRect(LPRECT lprc);  /* windows/caret.c */
200
201 extern BOOL16 DRAG_QueryUpdate( HWND, SEGPTR, BOOL );
202 extern void DEFWND_SetText( WND *wndPtr, LPCSTR text );
203 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT16 ctlType );     /* windows/defwnd.c */
204
205 extern void PROPERTY_RemoveWindowProps( WND *pWnd );                  /* windows/property.c */
206
207 extern BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
208                                   HRGN hrgnUpdate, UINT flags,
209                                   UINT control );                     /* windows/painting.c */
210 extern HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT flags);     /* windows/painting.c */
211
212 /* controls/widgets.c */
213 extern BOOL WIDGETS_Init( void );
214 extern BOOL WIDGETS_IsControl( WND* pWnd, BUILTIN_CLASS32 cls );  
215
216 /* controls/icontitle.c */
217 extern LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
218
219 extern HWND ICONTITLE_Create( WND* );
220 extern BOOL ICONTITLE_Init( void );
221
222 /* windows/focus.c */
223 extern void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND , HWND );
224
225 /* windows/edit.c */
226 extern LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
227
228 /* windows/listbox.c */
229 extern LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
230 extern LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
231
232 /* generic method that returns TRUE if the window properties ask for a 
233    window manager type of border */
234 extern BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle );
235
236 #endif  /* __WINE_WIN_H */