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