dc0c1c9b4b445a18be38500933eb98f59a8fcc28
[reactos.git] / reactos / subsys / win32k / include / window.h
1 #ifndef _WIN32K_WINDOW_H
2 #define _WIN32K_WINDOW_H
3
4 struct _PROPERTY;
5 struct _WINDOW_OBJECT;
6 typedef struct _WINDOW_OBJECT *PWINDOW_OBJECT;
7
8 #include <include/object.h>
9 #include <include/class.h>
10 #include <include/msgqueue.h>
11 #include <include/winsta.h>
12 #include <include/dce.h>
13 #include <include/prop.h>
14 #include <include/scroll.h>
15
16
17 VOID FASTCALL
18 WinPosSetupInternalPos(VOID);
19
20 typedef struct _INTERNALPOS
21 {
22 RECT NormalRect;
23 POINT IconPos;
24 POINT MaxPos;
25 } INTERNALPOS, *PINTERNALPOS;
26
27 typedef struct _WINDOW_OBJECT
28 {
29 /* Pointer to the window class. */
30 PWNDCLASS_OBJECT Class;
31 /* entry in the window list of the class object */
32 LIST_ENTRY ClassListEntry;
33 /* Extended style. */
34 DWORD ExStyle;
35 /* Window name. */
36 UNICODE_STRING WindowName;
37 /* Style. */
38 DWORD Style;
39 /* Context help id */
40 DWORD ContextHelpId;
41 /* system menu handle. */
42 HMENU SystemMenu;
43 /* Handle of the module that created the window. */
44 HINSTANCE Instance;
45 /* Entry in the thread's list of windows. */
46 LIST_ENTRY ListEntry;
47 /* Pointer to the extra data associated with the window. */
48 PCHAR ExtraData;
49 /* Size of the extra data associated with the window. */
50 ULONG ExtraDataSize;
51 /* Position of the window. */
52 RECT WindowRect;
53 /* Position of the window's client area. */
54 RECT ClientRect;
55 /* Handle for the window. */
56 HANDLE Self;
57 /* Window flags. */
58 ULONG Flags;
59 /* Window menu handle or window id */
60 UINT IDMenu;
61 /* Handle of region of the window to be updated. */
62 HANDLE UpdateRegion;
63 HANDLE NCUpdateRegion;
64 /* Handle of the window region. */
65 HANDLE WindowRegion;
66 /* Lock to be held when manipulating (NC)UpdateRegion */
67 FAST_MUTEX UpdateLock;
68 /* Pointer to the owning thread's message queue. */
69 PUSER_MESSAGE_QUEUE MessageQueue;
70 struct _WINDOW_OBJECT* FirstChild;
71 struct _WINDOW_OBJECT* LastChild;
72 struct _WINDOW_OBJECT* NextSibling;
73 struct _WINDOW_OBJECT* PrevSibling;
74 /* Entry in the list of thread windows. */
75 LIST_ENTRY ThreadListEntry;
76 /* Handle to the parent window. */
77 HANDLE Parent;
78 /* Handle to the owner window. */
79 HANDLE Owner;
80 /* DC Entries (DCE) */
81 PDCE Dce;
82 /* Property list head.*/
83 LIST_ENTRY PropListHead;
84 ULONG PropListItems;
85 /* Scrollbar info */
86 PWINDOW_SCROLLINFO Scroll;
87 LONG UserData;
88 BOOL Unicode;
89 WNDPROC WndProcA;
90 WNDPROC WndProcW;
91 PETHREAD OwnerThread;
92 HWND hWndLastPopup; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
93 PINTERNALPOS InternalPos;
94 ULONG Status;
95 /* counter for tiled child windows */
96 ULONG TiledCounter;
97 /* WNDOBJ list */
98 LIST_ENTRY WndObjListHead;
99 FAST_MUTEX WndObjListLock;
100 } WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
101
102 /* Window flags. */
103 #define WINDOWOBJECT_NEED_SIZE (0x00000001)
104 #define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002)
105 #define WINDOWOBJECT_NEED_NCPAINT (0x00000004)
106 #define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008)
107 #define WINDOWOBJECT_RESTOREMAX (0x00000020)
108
109 #define WINDOWSTATUS_DESTROYING (0x1)
110 #define WINDOWSTATUS_DESTROYED (0x2)
111
112 #define HAS_DLGFRAME(Style, ExStyle) \
113 (((ExStyle) & WS_EX_DLGMODALFRAME) || \
114 (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
115
116 #define HAS_THICKFRAME(Style, ExStyle) \
117 (((Style) & WS_THICKFRAME) && \
118 (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
119
120 #define HAS_THINFRAME(Style, ExStyle) \
121 (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
122
123 #define IntIsDesktopWindow(WndObj) \
124 (WndObj->Parent == NULL)
125
126 #define IntIsBroadcastHwnd(hWnd) \
127 (hWnd == HWND_BROADCAST || hWnd == HWND_TOPMOST)
128
129 #define IntGetWindowObject(hWnd) \
130 IntGetProcessWindowObject(PsGetWin32Thread(), hWnd)
131
132 #define IntReferenceWindowObject(WndObj) \
133 ObmReferenceObjectByPointer(WndObj, otWindow)
134
135 #define IntReleaseWindowObject(WndObj) \
136 ObmDereferenceObject(WndObj)
137
138 #define IntWndBelongsToThread(WndObj, W32Thread) \
139 (((WndObj->OwnerThread && WndObj->OwnerThread->Tcb.Win32Thread)) && \
140 (WndObj->OwnerThread->Tcb.Win32Thread == W32Thread))
141
142 #define IntGetWndThreadId(WndObj) \
143 WndObj->OwnerThread->Cid.UniqueThread
144
145 #define IntGetWndProcessId(WndObj) \
146 WndObj->OwnerThread->ThreadsProcess->UniqueProcessId
147
148
149 PWINDOW_OBJECT FASTCALL
150 IntGetProcessWindowObject(PW32THREAD Thread, HWND hWnd);
151
152 BOOL FASTCALL
153 IntIsWindow(HWND hWnd);
154
155 HWND* FASTCALL
156 IntWinListChildren(PWINDOW_OBJECT Window);
157
158 NTSTATUS FASTCALL
159 InitWindowImpl (VOID);
160
161 NTSTATUS FASTCALL
162 CleanupWindowImpl (VOID);
163
164 VOID FASTCALL
165 IntGetClientRect (PWINDOW_OBJECT WindowObject, PRECT Rect);
166
167 HWND FASTCALL
168 IntGetActiveWindow (VOID);
169
170 BOOL FASTCALL
171 IntIsWindowVisible (HWND hWnd);
172
173 BOOL FASTCALL
174 IntIsChildWindow (HWND Parent, HWND Child);
175
176 VOID FASTCALL
177 IntUnlinkWindow(PWINDOW_OBJECT Wnd);
178
179 VOID FASTCALL
180 IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndParent, PWINDOW_OBJECT WndPrevSibling);
181
182 PWINDOW_OBJECT FASTCALL
183 IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
184
185 PWINDOW_OBJECT FASTCALL
186 IntGetParent(PWINDOW_OBJECT Wnd);
187
188 PWINDOW_OBJECT FASTCALL
189 IntGetOwner(PWINDOW_OBJECT Wnd);
190
191 PWINDOW_OBJECT FASTCALL
192 IntGetParentObject(PWINDOW_OBJECT Wnd);
193
194 INT FASTCALL
195 IntGetWindowRgn(HWND hWnd, HRGN hRgn);
196
197 INT FASTCALL
198 IntGetWindowRgnBox(HWND hWnd, RECT *Rect);
199
200 BOOL FASTCALL
201 IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);
202
203 VOID FASTCALL
204 IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy);
205
206 BOOL FASTCALL
207 IntAnyPopup(VOID);
208
209 BOOL FASTCALL
210 IntIsWindowInDestroy(PWINDOW_OBJECT Window);
211
212 DWORD IntRemoveWndProcHandle(WNDPROC Handle);
213 DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
214 DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
215
216 BOOL FASTCALL
217 IntShowOwnedPopups( HWND owner, BOOL fShow );
218
219 #endif /* _WIN32K_WINDOW_H */
220
221 /* EOF */