982dbe0f7ca864e445e9a47d871ae91b084778ee
[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 <windows.h>
9 #include <ddk/ntddk.h>
10 #include <include/class.h>
11 #include <include/msgqueue.h>
12 #include <include/winsta.h>
13 #include <include/dce.h>
14 #include <include/prop.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 HANDLE Self;
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 NCUpdateRegion;
62 /* Pointer to the owning thread's message queue. */
63 PUSER_MESSAGE_QUEUE MessageQueue;
64 struct _WINDOW_OBJECT* FirstChild;
65 struct _WINDOW_OBJECT* LastChild;
66 /* Lock for the list of child windows. */
67 FAST_MUTEX ChildrenListLock;
68 struct _WINDOW_OBJECT* NextSibling;
69 struct _WINDOW_OBJECT* PrevSibling;
70 /* Entry in the list of thread windows. */
71 LIST_ENTRY ThreadListEntry;
72 /* Pointer to the parent window. */
73 struct _WINDOW_OBJECT* Parent;
74 /* Pointer to the owner window. */
75 struct _WINDOW_OBJECT* Owner;
76 /* DC Entries (DCE) */
77 PDCE Dce;
78 /* Property list head.*/
79 LIST_ENTRY PropListHead;
80 FAST_MUTEX PropListLock;
81 ULONG PropListItems;
82 /* Scrollbar info */
83 PSCROLLBARINFO pHScroll;
84 PSCROLLBARINFO pVScroll;
85 PSCROLLBARINFO wExtra;
86 LONG UserData;
87 BOOL Unicode;
88 WNDPROC WndProcA;
89 WNDPROC WndProcW;
90 PETHREAD OwnerThread;
91 HWND hWndLastPopup; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
92 PINTERNALPOS InternalPos;
93 } WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
94
95 /* Window flags. */
96 #define WINDOWOBJECT_NEED_SIZE (0x00000001)
97 #define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002)
98 #define WINDOWOBJECT_NEED_NCPAINT (0x00000004)
99 #define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008)
100 #define WINDOWOBJECT_RESTOREMAX (0x00000020)
101
102 inline BOOL IntIsDesktopWindow(PWINDOW_OBJECT WindowObject);
103
104 inline BOOL IntIsBroadcastHwnd(HWND hwnd);
105
106 BOOL FASTCALL
107 IntIsWindow(HWND hWnd);
108
109 HWND* FASTCALL
110 IntWinListChildren(PWINDOW_OBJECT Window);
111
112 BOOLEAN FASTCALL
113 IntWndBelongsToThread(PWINDOW_OBJECT Window, PW32THREAD ThreadData);
114
115 NTSTATUS FASTCALL
116 InitWindowImpl (VOID);
117
118 NTSTATUS FASTCALL
119 CleanupWindowImpl (VOID);
120
121 VOID FASTCALL
122 IntGetClientRect (PWINDOW_OBJECT WindowObject, PRECT Rect);
123
124 PWINDOW_OBJECT FASTCALL
125 IntGetWindowObject (HWND hWnd);
126
127 VOID FASTCALL
128 IntReleaseWindowObject (PWINDOW_OBJECT Window);
129
130 HWND FASTCALL
131 IntGetActiveWindow (VOID);
132
133 BOOL FASTCALL
134 IntIsWindowVisible (HWND Wnd);
135
136 BOOL FASTCALL
137 IntIsChildWindow (HWND Parent, HWND Child);
138
139 BOOL FASTCALL
140 IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data);
141
142 PPROPERTY FASTCALL
143 IntGetProp(PWINDOW_OBJECT WindowObject, ATOM Atom);
144
145 DWORD FASTCALL
146 IntGetWindowThreadProcessId(PWINDOW_OBJECT Wnd, PDWORD pid);
147
148 VOID FASTCALL
149 IntUnlinkWindow(PWINDOW_OBJECT Wnd);
150
151 VOID FASTCALL
152 IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndParent, PWINDOW_OBJECT WndPrevSibling);
153
154 PWINDOW_OBJECT FASTCALL
155 IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
156
157 PWINDOW_OBJECT FASTCALL
158 IntGetParent(PWINDOW_OBJECT Wnd);
159
160 typedef enum _WINLOCK_TYPE
161 {
162 None,
163 Any,
164 Shared,
165 Exclusive
166 } WINLOCK_TYPE;
167
168 #define ASSERT_WINLOCK(a) assert(IntVerifyWinLock(a))
169
170 inline VOID IntAcquireWinLockShared();
171 inline VOID IntAcquireWinLockExclusive();
172 inline VOID IntReleaseWinLock();
173 BOOL FASTCALL IntVerifyWinLock(WINLOCK_TYPE Type);
174 WINLOCK_TYPE FASTCALL IntSuspendWinLock();
175 VOID FASTCALL IntRestoreWinLock(WINLOCK_TYPE Type);
176 inline BOOL IntInitializeWinLock();
177 inline VOID IntDeleteWinLock();
178 DWORD IntRemoveWndProcHandle(WNDPROC Handle);
179 DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
180 DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
181
182 #endif /* _WIN32K_WINDOW_H */
183
184 /* EOF */