merge 37282 from amd64-branch:
[reactos.git] / reactos / subsystems / win32 / 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 BOOL FASTCALL UserUpdateUiState(PWINDOW Wnd, WPARAM wParam);
17
18 typedef struct _WINDOW_OBJECT
19 {
20 /* NOTE: Do *NOT* Move this pointer anywhere in this structure! This
21 is a pointer to the WINDOW structure that eventually replaces
22 the WINDOW_OBJECT structure! USER32 expects this pointer to
23 be here until WINDOW_OBJECT has completely been superseded! */
24 PWINDOW Wnd;
25
26 /* Pointer to the thread information */
27 PW32THREADINFO ti;
28 /* Pointer to the desktop */
29 PDESKTOPINFO Desktop;
30 /* system menu handle. */
31 HMENU SystemMenu;
32 /* Entry in the thread's list of windows. */
33 LIST_ENTRY ListEntry;
34 /* Handle for the window. */
35 HWND hSelf;
36 /* Window flags. */
37 ULONG Flags;
38 /* Handle of region of the window to be updated. */
39 HANDLE UpdateRegion;
40 /* Handle of the window region. */
41 HANDLE WindowRegion;
42 /* Pointer to the owning thread's message queue. */
43 PUSER_MESSAGE_QUEUE MessageQueue;
44 struct _WINDOW_OBJECT* FirstChild;
45 struct _WINDOW_OBJECT* LastChild;
46 struct _WINDOW_OBJECT* NextSibling;
47 struct _WINDOW_OBJECT* PrevSibling;
48 /* Entry in the list of thread windows. */
49 LIST_ENTRY ThreadListEntry;
50 /* Handle to the parent window. */
51 struct _WINDOW_OBJECT* Parent;
52 /* Handle to the owner window. */
53 HWND hOwner;
54 /* DC Entries (DCE) */
55 PDCE Dce;
56 /* Scrollbar info */
57 PWINDOW_SCROLLINFO Scroll;
58 PETHREAD OwnerThread;
59 HWND hWndLastPopup; /* handle to last active popup window (wine doesn't use pointer, for unk. reason)*/
60 ULONG Status;
61 /* counter for tiled child windows */
62 ULONG TiledCounter;
63 /* WNDOBJ list */
64 LIST_ENTRY WndObjListHead;
65 } WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
66
67 /* Window flags. */
68 #define WINDOWOBJECT_NEED_SIZE (0x00000001)
69 #define WINDOWOBJECT_NEED_ERASEBKGND (0x00000002)
70 #define WINDOWOBJECT_NEED_NCPAINT (0x00000004)
71 #define WINDOWOBJECT_NEED_INTERNALPAINT (0x00000008)
72 #define WINDOWOBJECT_RESTOREMAX (0x00000020)
73
74 #define WINDOWSTATUS_DESTROYING (0x1)
75 #define WINDOWSTATUS_DESTROYED (0x2)
76
77 #define HAS_DLGFRAME(Style, ExStyle) \
78 (((ExStyle) & WS_EX_DLGMODALFRAME) || \
79 (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
80
81 #define HAS_THICKFRAME(Style, ExStyle) \
82 (((Style) & WS_THICKFRAME) && \
83 (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME)))
84
85 #define HAS_THINFRAME(Style, ExStyle) \
86 (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
87
88 #define IntIsDesktopWindow(WndObj) \
89 (WndObj->Parent == NULL)
90
91 #define IntIsBroadcastHwnd(hWnd) \
92 (hWnd == HWND_BROADCAST || hWnd == HWND_TOPMOST)
93
94
95 #define IntWndBelongsToThread(WndObj, W32Thread) \
96 (((WndObj->OwnerThread && WndObj->OwnerThread->Tcb.Win32Thread)) && \
97 (WndObj->OwnerThread->Tcb.Win32Thread == W32Thread))
98
99 #define IntGetWndThreadId(WndObj) \
100 WndObj->OwnerThread->Cid.UniqueThread
101
102 #define IntGetWndProcessId(WndObj) \
103 WndObj->OwnerThread->ThreadsProcess->UniqueProcessId
104
105
106 BOOL FASTCALL
107 IntIsWindow(HWND hWnd);
108
109 HWND* FASTCALL
110 IntWinListChildren(PWINDOW_OBJECT Window);
111
112 NTSTATUS FASTCALL
113 InitWindowImpl (VOID);
114
115 NTSTATUS FASTCALL
116 CleanupWindowImpl (VOID);
117
118 VOID FASTCALL
119 IntGetClientRect (PWINDOW_OBJECT WindowObject, RECTL *Rect);
120
121 HWND FASTCALL
122 IntGetActiveWindow (VOID);
123
124 BOOL FASTCALL
125 IntIsWindowVisible (PWINDOW_OBJECT Window);
126
127 BOOL FASTCALL
128 IntIsChildWindow (PWINDOW_OBJECT Parent, PWINDOW_OBJECT Child);
129
130 VOID FASTCALL
131 IntUnlinkWindow(PWINDOW_OBJECT Wnd);
132
133 VOID FASTCALL
134 IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndParent, PWINDOW_OBJECT WndPrevSibling);
135
136 PWINDOW_OBJECT FASTCALL
137 IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
138
139 PWINDOW_OBJECT FASTCALL
140 IntGetParent(PWINDOW_OBJECT Wnd);
141
142 PWINDOW_OBJECT FASTCALL
143 IntGetOwner(PWINDOW_OBJECT Wnd);
144
145
146 INT FASTCALL
147 IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn);
148
149 INT FASTCALL
150 IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect);
151
152 BOOL FASTCALL
153 IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);
154
155 VOID FASTCALL
156 IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy);
157
158 BOOL FASTCALL
159 IntAnyPopup(VOID);
160
161 BOOL FASTCALL
162 IntIsWindowInDestroy(PWINDOW_OBJECT Window);
163
164 BOOL FASTCALL
165 IntShowOwnedPopups( PWINDOW_OBJECT owner, BOOL fShow );
166
167 LRESULT FASTCALL
168 IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
169
170 VOID FASTCALL IntNotifyWinEvent(DWORD, PWINDOW_OBJECT, LONG, LONG);
171
172 #endif /* _WIN32K_WINDOW_H */
173
174 /* EOF */