update for HEAD-2003091401
[reactos.git] / subsys / win32k / include / window.h
1 #ifndef __WIN32K_WINDOW_H
2 #define __WIN32K_WINDOW_H
3
4 struct _PROPERTY;
5 struct _WINDOW_OBJECT;
6
7 #include <windows.h>
8 #include <ddk/ntddk.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
15 typedef struct _PROPERTY
16 {
17   LIST_ENTRY PropListEntry;
18   HANDLE Data;
19   ATOM Atom;
20 } PROPERTY, *PPROPERTY;
21
22 VOID FASTCALL
23 WinPosSetupInternalPos(VOID);
24
25 typedef struct _WINDOW_OBJECT
26 {
27   /* Pointer to the window class. */
28   PWNDCLASS_OBJECT Class;
29   /* Extended style. */
30   DWORD ExStyle;
31   /* Window name. */
32   UNICODE_STRING WindowName;
33   /* Style. */
34   DWORD Style;
35   /* Initial window position. */
36   INT x;
37   INT y;
38   INT Width;
39   INT Height;
40   /* Context help id */
41   DWORD ContextHelpId;
42   /* Parent window handle. */
43   HWND ParentHandle;
44   /* system menu handle. */
45   HMENU SystemMenu;
46   /* Handle of the module that created the window. */
47   HINSTANCE Instance;
48   /* Unknown. */
49   LPVOID Parameters;
50   /* Entry in the thread's list of windows. */
51   LIST_ENTRY ListEntry;
52   /* Pointer to the extra data associated with the window. */
53   PULONG ExtraData;
54   /* Size of the extra data associated with the window. */
55   ULONG ExtraDataSize;
56   /* Position of the window. */
57   RECT WindowRect;
58   /* Position of the window's client area. */
59   RECT ClientRect;
60   /* Handle for the window. */
61   HANDLE Self;
62   /* Window flags. */
63   ULONG Flags;
64   /* Window menu handle or window id */
65   UINT IDMenu;
66   /* Handle of region of the window to be updated. */
67   HANDLE UpdateRegion;
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   /* Lock for the list of child windows. */
73   FAST_MUTEX ChildrenListLock;
74   struct _WINDOW_OBJECT* NextSibling;
75   struct _WINDOW_OBJECT* PrevSibling;
76   /* Entry in the list of thread windows. */
77   LIST_ENTRY ThreadListEntry;
78   /* Pointer to the parent window. */
79   struct _WINDOW_OBJECT* Parent;
80   /* DC Entries (DCE) */
81   PDCE Dce;
82   /* Property list head.*/
83   LIST_ENTRY PropListHead;
84   /* Scrollbar info */
85   PSCROLLBARINFO pHScroll;
86   PSCROLLBARINFO pVScroll;
87   PSCROLLBARINFO wExtra;
88   LONG UserData;
89   BOOL Unicode;
90   WNDPROC WndProcA;
91   WNDPROC WndProcW;
92   PETHREAD OwnerThread;
93   HWND hWndOwner; /* handle to the owner window (wine doesn't use pointer, for unk. reason)*/
94   HWND hWndLastPopup; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
95 } WINDOW_OBJECT, *PWINDOW_OBJECT;
96
97 /* Window flags. */
98 #define WINDOWOBJECT_NEED_SIZE            (0x00000001)
99 /* Not used anymore: define WINDOWOBJECT_NEED_BEGINPAINT      (0x00000002) */
100 #define WINDOWOBJECT_NEED_ERASEBACKGRD    (0x00000004)
101 #define WINDOWOBJECT_NEED_NCPAINT         (0x00000008)
102 #define WINDOWOBJECT_NEED_INTERNALPAINT   (0x00000010)
103 #define WINDOWOBJECT_RESTOREMAX           (0x00000020)
104
105 inline BOOL IntIsDesktopWindow(PWINDOW_OBJECT WindowObject);
106
107 inline BOOL IntIsBroadcastHwnd( HWND hwnd );
108
109 BOOLEAN FASTCALL
110 IntWndBelongsToThread(PWINDOW_OBJECT Window, PW32THREAD ThreadData);
111
112 NTSTATUS FASTCALL
113 InitWindowImpl (VOID);
114
115 NTSTATUS FASTCALL
116 CleanupWindowImpl (VOID);
117
118 VOID FASTCALL
119 IntGetClientRect (PWINDOW_OBJECT WindowObject, PRECT Rect);
120
121 PWINDOW_OBJECT FASTCALL
122 IntGetWindowObject (HWND hWnd);
123
124 VOID FASTCALL
125 IntReleaseWindowObject (PWINDOW_OBJECT Window);
126
127 HWND STDCALL
128 IntCreateDesktopWindow (PWINSTATION_OBJECT WindowStation,
129                         PWNDCLASS_OBJECT DesktopClass,
130                         ULONG Width, ULONG Height);
131
132 HWND FASTCALL
133 IntGetActiveWindow (VOID);
134
135 BOOL FASTCALL
136 IntIsWindowVisible (HWND Wnd);
137
138 BOOL FASTCALL
139 IntIsChildWindow (HWND Parent, HWND Child);
140
141 HWND FASTCALL
142 IntGetDesktopWindow (VOID);
143
144 HWND FASTCALL
145 IntGetFocusWindow (VOID);
146
147 HWND FASTCALL
148 IntSetFocusWindow (HWND hWnd);
149
150 BOOL FASTCALL
151 IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data);
152
153 PPROPERTY FASTCALL
154 IntGetProp(PWINDOW_OBJECT WindowObject, ATOM Atom);
155
156 DWORD FASTCALL
157 IntGetWindowThreadProcessId(PWINDOW_OBJECT Wnd, PDWORD pid);
158
159 VOID FASTCALL
160 IntUnlinkWindow(PWINDOW_OBJECT Wnd);
161
162 ULONG
163 UserHasDlgFrameStyle(ULONG Style, ULONG ExStyle);
164
165 ULONG
166 UserHasThickFrameStyle(ULONG Style, ULONG ExStyle);
167
168 PWINDOW_OBJECT FASTCALL
169 IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
170
171 PWINDOW_OBJECT FASTCALL
172 IntGetParent(PWINDOW_OBJECT Wnd);
173
174 typedef enum _WINLOCK_TYPE
175 {
176   None,
177   Any,
178   Shared,
179   Exclusive
180 } WINLOCK_TYPE; 
181
182 #define ASSERT_WINLOCK(a) assert(IntVerifyWinLock(a))
183
184 inline VOID IntAcquireWinLockShared();
185 inline VOID IntAcquireWinLockExclusive();
186 inline VOID IntReleaseWinLock();
187 BOOL FASTCALL IntVerifyWinLock(WINLOCK_TYPE Type);
188 WINLOCK_TYPE FASTCALL IntSuspendWinLock();
189 VOID FASTCALL IntRestoreWinLock(WINLOCK_TYPE Type);
190 inline BOOL IntInitializeWinLock();
191 inline VOID IntDeleteWinLock();
192
193 #endif /* __WIN32K_WINDOW_H */
194
195 /* EOF */