4 * Copyright 1993 Alexandre Julliard
14 #include "wine/windef16.h"
16 #define WND_MAGIC 0x444e4957 /* 'WIND' */
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 */
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 */
31 /* PAINT_RedrawWindow() control flags */
32 #define RDW_EX_USEHRGN 0x0001
33 #define RDW_EX_DELETEHRGN 0x0002
34 #define RDW_EX_XYWINDOW 0x0004
35 #define RDW_EX_TOPFRAME 0x0010
36 #define RDW_EX_DELAY_NCPAINT 0x0020
40 struct tagMESSAGEQUEUE;
45 struct tagWND *next; /* Next sibling */
46 struct tagWND *child; /* First child */
47 struct tagWND *parent; /* Window parent (from CreateWindow) */
48 struct tagWND *owner; /* Window owner */
49 struct tagCLASS *class; /* Window class */
50 HWINDOWPROC winproc; /* Window procedure */
51 DWORD dwMagic; /* Magic number (must be WND_MAGIC) */
52 HWND hwndSelf; /* Handle of this window */
53 HINSTANCE hInstance; /* Window hInstance (from CreateWindow) */
54 RECT rectClient; /* Client area rel. to parent client area */
55 RECT rectWindow; /* Whole window rel. to parent client area */
56 LPWSTR text; /* Window text */
57 void *pVScroll; /* Vertical scroll-bar info */
58 void *pHScroll; /* Horizontal scroll-bar info */
59 void *pProp; /* Pointer to properties list */
60 struct tagDCE *dce; /* Window DCE (if CS_OWNDC or CS_CLASSDC) */
61 HGLOBAL16 hmemTaskQ; /* Task queue global memory handle */
62 HRGN16 hrgnUpdate; /* Update region */
63 HRGN hrgnWnd; /* window's region */
64 HWND hwndLastActive;/* Last active popup hwnd */
65 DWORD dwStyle; /* Window style (from CreateWindow) */
66 DWORD dwExStyle; /* Extended style (from CreateWindowEx) */
67 DWORD clsStyle; /* Class style at window creation */
68 UINT wIDmenu; /* ID or hmenu (from CreateWindow) */
69 DWORD helpContext; /* Help context ID */
70 WORD flags; /* Misc. flags (see below) */
71 HMENU16 hSysMenu; /* window's copy of System Menu */
72 int cbWndExtra; /* class cbWndExtra at window creation */
73 int irefCount; /* window's reference count*/
74 DWORD userdata; /* User private data */
75 struct tagWND_DRIVER *pDriver; /* Window driver */
76 void *pDriverData; /* Window driver data */
77 DWORD wExtra[1]; /* Window extra bytes */
82 #define HAK_BITGRAVITY 1
83 #define HAK_ACCEPTFOCUS 2
84 #define HAK_ICONICSTATE 3
101 typedef struct tagWND_DRIVER
103 void (*pInitialize)(WND *);
104 void (*pFinalize)(WND *);
105 BOOL (*pCreateDesktopWindow)(WND *, BOOL);
106 BOOL (*pCreateWindow)(WND *, CREATESTRUCTA *, BOOL);
107 BOOL (*pDestroyWindow)(WND *);
108 WND* (*pSetParent)(WND *, WND *);
109 void (*pForceWindowRaise)(WND *);
110 void (*pSetWindowPos)(WND *, const WINDOWPOS *, BOOL);
111 void (*pSetText)(WND *, LPCWSTR);
112 void (*pSetFocus)(WND *);
113 void (*pPreSizeMove)(WND *);
114 void (*pPostSizeMove)(WND *);
115 void (*pSurfaceCopy)(WND *, HDC, INT, INT, const RECT *, BOOL);
116 void (*pSetDrawable)(WND *, HDC, WORD, BOOL);
117 BOOL (*pSetHostAttr)(WND *, INT haKey, INT value);
118 BOOL (*pIsSelfClipping)(WND *);
119 void (*pSetWindowRgn)(WND *, const HRGN);
122 extern WND_DRIVER *WND_Driver;
129 HWND16 hwndIconTitle;
130 } INTERNALPOS, *LPINTERNALPOS;
132 /* WND flags values */
133 #define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
134 #define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
135 #define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
136 #define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
137 #define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
138 #define WIN_NATIVE 0x0020 /* Directly mapped to the window provided by the driver */
139 #define WIN_NEED_SIZE 0x0040 /* Internal WM_SIZE is needed */
140 #define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
141 #define WIN_ISDIALOG 0x0200 /* Window is a dialog */
142 #define WIN_ISWIN32 0x0400 /* Understands Win32 messages */
143 #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0800 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
144 #define WIN_NEEDS_INTERNALSOP 0x1000 /* Window was hidden by WIN_InternalShowOwnedPopups */
146 /* BuildWinArray() flags */
147 #define BWA_SKIPDISABLED 0x0001
148 #define BWA_SKIPHIDDEN 0x0002
149 #define BWA_SKIPOWNED 0x0004
150 #define BWA_SKIPICONIC 0x0008
152 /* WIN_UpdateNCRgn() flags */
153 #define UNC_CHECK 0x0001
154 #define UNC_ENTIRE 0x0002
155 #define UNC_REGION 0x0004
156 #define UNC_UPDATE 0x0008
157 #define UNC_DELAY_NCPAINT 0x0010
158 #define UNC_IN_BEGINPAINT 0x0020
160 /* Window functions */
161 extern void WIN_LockWnds( void );
162 extern void WIN_UnlockWnds( void );
163 extern int WIN_SuspendWndsLock( void );
164 extern void WIN_RestoreWndsLock(int ipreviousLock);
165 extern WND* WIN_FindWndPtr( HWND hwnd );
166 extern WND* WIN_LockWndPtr(WND *wndPtr);
167 extern void WIN_ReleaseWndPtr(WND *wndPtr);
168 extern void WIN_UpdateWndPtr(WND **oldPtr,WND *newPtr);
169 extern WND* WIN_GetDesktop(void);
170 extern void WIN_ReleaseDesktop(void);
171 extern void WIN_DumpWindow( HWND hwnd );
172 extern void WIN_WalkWindows( HWND hwnd, int indent );
173 extern BOOL WIN_UnlinkWindow( HWND hwnd );
174 extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
175 extern HWND WIN_FindWinToRepaint( HWND hwnd, HQUEUE16 hQueue );
176 extern BOOL WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew);
177 extern BOOL WIN_CreateDesktopWindow(void);
178 extern HWND WIN_GetTopParent( HWND hwnd );
179 extern WND* WIN_GetTopParentPtr( WND* pWnd );
180 extern BOOL WIN_IsWindowDrawable(WND*, BOOL );
181 extern WND** WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
182 extern void WIN_ReleaseWinArray(WND **wndArray);
183 extern BOOL WIN_InternalShowOwnedPopups( HWND owner, BOOL fShow, BOOL unmanagedOnly );
185 extern HICON16 NC_IconForWindow( WND *wndPtr );
187 extern HWND CARET_GetHwnd(void);
188 extern void CARET_GetRect(LPRECT lprc); /* windows/caret.c */
190 extern BOOL16 DRAG_QueryUpdate( HWND, SEGPTR, BOOL );
191 extern void DEFWND_SetTextA( WND *wndPtr, LPCSTR text );
192 extern void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text );
193 extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT16 ctlType ); /* windows/defwnd.c */
195 extern void PROPERTY_RemoveWindowProps( WND *pWnd ); /* windows/property.c */
197 extern BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
198 HRGN hrgnUpdate, UINT flags,
199 UINT control ); /* windows/painting.c */
200 extern HRGN WIN_UpdateNCRgn(WND* wnd, HRGN hRgn, UINT flags); /* windows/painting.c */
202 /* Classes functions */
203 struct tagCLASS; /* opaque structure */
204 extern ATOM CLASS_RegisterBuiltinClass( LPCSTR name, DWORD style, INT winExtra, LPCSTR cursor,
205 HBRUSH brush, WNDPROC wndProcA, WNDPROC wndProcW );
206 extern struct tagCLASS *CLASS_AddWindow( ATOM atom, HINSTANCE inst, WINDOWPROCTYPE type,
207 INT *winExtra, WNDPROC *winproc,
208 DWORD *style, struct tagDCE **dce );
209 extern void CLASS_RemoveWindow( struct tagCLASS *cls );
210 extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
212 /* controls/widgets.c */
213 extern BOOL WIDGETS_Init( void );
215 /* controls/icontitle.c */
216 extern LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
218 extern HWND ICONTITLE_Create( WND* );
219 extern BOOL ICONTITLE_Init( void );
221 /* windows/focus.c */
222 extern void FOCUS_SwitchFocus( struct tagMESSAGEQUEUE *pMsgQ, HWND , HWND );
225 extern LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
227 /* windows/listbox.c */
228 extern LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
229 extern LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
231 /* generic method that returns TRUE if the window properties ask for a
232 window manager type of border */
233 extern BOOL WIN_WindowNeedsWMBorder( DWORD style, DWORD exStyle );
235 #endif /* __WINE_WIN_H */