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