c9b01a96feda180e1518468fd5977e031566fdc0
[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 HWND hSelf;
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 of the window region. */
64 HANDLE WindowRegion;
65 /* Pointer to the owning thread's message queue. */
66 PUSER_MESSAGE_QUEUE MessageQueue;
67 struct _WINDOW_OBJECT* FirstChild;
68 struct _WINDOW_OBJECT* LastChild;
69 struct _WINDOW_OBJECT* NextSibling;
70 struct _WINDOW_OBJECT* PrevSibling;
71 /* Entry in the list of thread windows. */
72 LIST_ENTRY ThreadListEntry;
73 /* Handle to the parent window. */
74 struct _WINDOW_OBJECT* Parent;
75 /* Handle to the owner window. */
76 HWND hOwner;
77 /* DC Entries (DCE) */
78 PDCE Dce;
79 /* Property list head.*/
80 LIST_ENTRY PropListHead;
81 ULONG PropListItems;
82 /* Scrollbar info */
83 PWINDOW_SCROLLINFO Scroll;
84 LONG UserData;
85 BOOL Unicode;
86 WNDPROC WndProcA;
87 WNDPROC WndProcW;
88 PETHREAD OwnerThread;
89 HWND hWndLastPopup; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
90 PINTERNALPOS InternalPos;
91 ULONG Status;
92 /* counter for tiled child windows */
93 ULONG TiledCounter;
94 /* WNDOBJ list */
95 LIST_ENTRY WndObjListHead;
96 } WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
97
98 /* Window flags. */
99 #define WINDOWOBJECT_NEED_SIZE (0x00000001)
100 #define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002)
101 #define WINDOWOBJECT_NEED_NCPAINT (0x00000004)
102 #define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008)
103 #define WINDOWOBJECT_RESTOREMAX (0x00000020)
104
105 #define WINDOWSTATUS_DESTROYING (0x1)
106 #define WINDOWSTATUS_DESTROYED (0x2)
107
108 #define HAS_DLGFRAME(Style, ExStyle) \
109 (((ExStyle) & WS_EX_DLGMODALFRAME) || \
110 (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
111
112 #define HAS_THICKFRAME(Style, ExStyle) \
113 (((Style) & WS_THICKFRAME) && \
114 (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
115
116 #define HAS_THINFRAME(Style, ExStyle) \
117 (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
118
119 #define IntIsDesktopWindow(WndObj) \
120 (WndObj->Parent == NULL)
121
122 #define IntIsBroadcastHwnd(hWnd) \
123 (hWnd == HWND_BROADCAST || hWnd == HWND_TOPMOST)
124
125
126 #define IntWndBelongsToThread(WndObj, W32Thread) \
127 (((WndObj->OwnerThread && WndObj->OwnerThread->Tcb.Win32Thread)) && \
128 (WndObj->OwnerThread->Tcb.Win32Thread == W32Thread))
129
130 #define IntGetWndThreadId(WndObj) \
131 WndObj->OwnerThread->Cid.UniqueThread
132
133 #define IntGetWndProcessId(WndObj) \
134 WndObj->OwnerThread->ThreadsProcess->UniqueProcessId
135
136
137 BOOL FASTCALL
138 IntIsWindow(HWND hWnd);
139
140 HWND* FASTCALL
141 IntWinListChildren(PWINDOW_OBJECT Window);
142
143 NTSTATUS FASTCALL
144 InitWindowImpl (VOID);
145
146 NTSTATUS FASTCALL
147 CleanupWindowImpl (VOID);
148
149 VOID FASTCALL
150 IntGetClientRect (PWINDOW_OBJECT WindowObject, PRECT Rect);
151
152 HWND FASTCALL
153 IntGetActiveWindow (VOID);
154
155 BOOL FASTCALL
156 IntIsWindowVisible (PWINDOW_OBJECT Window);
157
158 BOOL FASTCALL
159 IntIsChildWindow (PWINDOW_OBJECT Parent, PWINDOW_OBJECT Child);
160
161 VOID FASTCALL
162 IntUnlinkWindow(PWINDOW_OBJECT Wnd);
163
164 VOID FASTCALL
165 IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndParent, PWINDOW_OBJECT WndPrevSibling);
166
167 PWINDOW_OBJECT FASTCALL
168 IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
169
170 PWINDOW_OBJECT FASTCALL
171 IntGetParent(PWINDOW_OBJECT Wnd);
172
173 PWINDOW_OBJECT FASTCALL
174 IntGetOwner(PWINDOW_OBJECT Wnd);
175
176
177 INT FASTCALL
178 IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn);
179
180 INT FASTCALL
181 IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECT *Rect);
182
183 BOOL FASTCALL
184 IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);
185
186 VOID FASTCALL
187 IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy);
188
189 BOOL FASTCALL
190 IntAnyPopup(VOID);
191
192 BOOL FASTCALL
193 IntIsWindowInDestroy(PWINDOW_OBJECT Window);
194
195 DWORD IntRemoveWndProcHandle(WNDPROC Handle);
196 DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
197 DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
198
199 BOOL FASTCALL
200 IntShowOwnedPopups( PWINDOW_OBJECT owner, BOOL fShow );
201
202 #endif /* _WIN32K_WINDOW_H */
203
204 /* EOF */