Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / window.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Window Alternate Secondary Drawing Orders Interface API
4  *
5  * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __UPDATE_WINDOW_H
21 #define __UPDATE_WINDOW_H
22
23 #include <freerdp/types.h>
24
25 #ifdef _WIN32
26 #include <windows.h>
27 #endif
28
29 /* Window Order Header Flags */
30 #define WINDOW_ORDER_TYPE_WINDOW                        0x01000000
31 #define WINDOW_ORDER_TYPE_NOTIFY                        0x02000000
32 #define WINDOW_ORDER_TYPE_DESKTOP                       0x04000000
33 #define WINDOW_ORDER_STATE_NEW                          0x10000000
34 #define WINDOW_ORDER_STATE_DELETED                      0x20000000
35 #define WINDOW_ORDER_FIELD_OWNER                        0x00000002
36 #define WINDOW_ORDER_FIELD_STYLE                        0x00000008
37 #define WINDOW_ORDER_FIELD_SHOW                         0x00000010
38 #define WINDOW_ORDER_FIELD_TITLE                        0x00000004
39 #define WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET           0x00004000
40 #define WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE             0x00010000
41 #define WINDOW_ORDER_FIELD_RP_CONTENT                   0x00020000
42 #define WINDOW_ORDER_FIELD_ROOT_PARENT                  0x00040000
43 #define WINDOW_ORDER_FIELD_WND_OFFSET                   0x00000800
44 #define WINDOW_ORDER_FIELD_WND_CLIENT_DELTA             0x00008000
45 #define WINDOW_ORDER_FIELD_WND_SIZE                     0x00000400
46 #define WINDOW_ORDER_FIELD_WND_RECTS                    0x00000100
47 #define WINDOW_ORDER_FIELD_VIS_OFFSET                   0x00001000
48 #define WINDOW_ORDER_FIELD_VISIBILITY                   0x00000200
49 #define WINDOW_ORDER_FIELD_ICON_BIG                     0x00002000
50 #define WINDOW_ORDER_ICON                               0x40000000
51 #define WINDOW_ORDER_CACHED_ICON                        0x80000000
52 #define WINDOW_ORDER_FIELD_NOTIFY_VERSION               0x00000008
53 #define WINDOW_ORDER_FIELD_NOTIFY_TIP                   0x00000001
54 #define WINDOW_ORDER_FIELD_NOTIFY_INFO_TIP              0x00000002
55 #define WINDOW_ORDER_FIELD_NOTIFY_STATE                 0x00000004
56 #define WINDOW_ORDER_FIELD_DESKTOP_NONE                 0x00000001
57 #define WINDOW_ORDER_FIELD_DESKTOP_HOOKED               0x00000002
58 #define WINDOW_ORDER_FIELD_DESKTOP_ARC_COMPLETED        0x00000004
59 #define WINDOW_ORDER_FIELD_DESKTOP_ARC_BEGAN            0x00000008
60 #define WINDOW_ORDER_FIELD_DESKTOP_ZORDER               0x00000010
61 #define WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND           0x00000020
62
63 /* Window Show States */
64 #define WINDOW_HIDE                                     0x00
65 #define WINDOW_SHOW_MINIMIZED                           0x02
66 #define WINDOW_SHOW_MAXIMIZED                           0x03
67 #define WINDOW_SHOW                                     0x05
68
69 /* Window Styles */
70 #ifndef _WIN32
71 #define WS_BORDER                       0x00800000
72 #define WS_CAPTION                      0x00C00000
73 #define WS_CHILD                        0x40000000
74 #define WS_CLIPCHILDREN                 0x02000000
75 #define WS_CLIPSIBLINGS                 0x04000000
76 #define WS_DISABLED                     0x08000000
77 #define WS_DLGFRAME                     0x00400000
78 #define WS_GROUP                        0x00020000
79 #define WS_HSCROLL                      0x00100000
80 #define WS_ICONIC                       0x20000000
81 #define WS_MAXIMIZE                     0x01000000
82 #define WS_MAXIMIZEBOX                  0x00010000
83 #define WS_MINIMIZE                     0x20000000
84 #define WS_MINIMIZEBOX                  0x00020000
85 #define WS_OVERLAPPED                   0x00000000
86 #define WS_OVERLAPPEDWINDOW             (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
87 #define WS_POPUP                        0x80000000
88 #define WS_POPUPWINDOW                  (WS_POPUP | WS_BORDER | WS_SYSMENU)
89 #define WS_SIZEBOX                      0x00040000
90 #define WS_SYSMENU                      0x00080000
91 #define WS_TABSTOP                      0x00010000
92 #define WS_THICKFRAME                   0x00040000
93 #define WS_VISIBLE                      0x10000000
94 #define WS_VSCROLL                      0x00200000
95 #endif
96
97 /* Extended Window Styles */
98 #ifndef _WIN32
99 #define WS_EX_ACCEPTFILES               0x00000010
100 #define WS_EX_APPWINDOW                 0x00040000
101 #define WS_EX_CLIENTEDGE                0x00000200
102 #define WS_EX_COMPOSITED                0x02000000
103 #define WS_EX_CONTEXTHELP               0x00000400
104 #define WS_EX_CONTROLPARENT             0x00010000
105 #define WS_EX_DLGMODALFRAME             0x00000001
106 #define WS_EX_LAYERED                   0x00080000
107 #define WS_EX_LAYOUTRTL                 0x00400000
108 #define WS_EX_LEFT                      0x00000000
109 #define WS_EX_LEFTSCROLLBAR             0x00004000
110 #define WS_EX_LTRREADING                0x00000000
111 #define WS_EX_MDICHILD                  0x00000040
112 #define WS_EX_NOACTIVATE                0x08000000
113 #define WS_EX_NOINHERITLAYOUT           0x00100000
114 #define WS_EX_NOPARENTNOTIFY            0x00000004
115 #define WS_EX_OVERLAPPEDWINDOW          (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
116 #define WS_EX_PALETTEWINDOW             (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
117 #define WS_EX_RIGHT                     0x00001000
118 #define WS_EX_RIGHTSCROLLBAR            0x00000000
119 #define WS_EX_RTLREADING                0x00002000
120 #define WS_EX_STATICEDGE                0x00020000
121 #define WS_EX_TOOLWINDOW                0x00000080
122 #define WS_EX_TOPMOST                   0x00000008
123 #define WS_EX_TRANSPARENT               0x00000020
124 #define WS_EX_WINDOWEDGE                0x00000100
125 #endif
126
127 struct _WINDOW_ORDER_INFO
128 {
129         uint32 windowId;
130         uint32 fieldFlags;
131         uint32 notifyIconId;
132 };
133 typedef struct _WINDOW_ORDER_INFO WINDOW_ORDER_INFO;
134
135 struct _ICON_INFO
136 {
137         uint32 cacheEntry;
138         uint32 cacheId;
139         uint32 bpp;
140         uint32 width;
141         uint32 height;
142         uint32 cbColorTable;
143         uint32 cbBitsMask;
144         uint32 cbBitsColor;
145         uint8* bitsMask;
146         uint8* colorTable;
147         uint8* bitsColor;
148 };
149 typedef struct _ICON_INFO ICON_INFO;
150
151 struct _CACHED_ICON_INFO
152 {
153         uint32 cacheEntry;
154         uint32 cacheId;
155 };
156 typedef struct _CACHED_ICON_INFO CACHED_ICON_INFO;
157
158 struct _NOTIFY_ICON_INFOTIP
159 {
160         uint32 timeout;
161         uint32 flags;
162         UNICODE_STRING text;
163         UNICODE_STRING title;
164 };
165 typedef struct _NOTIFY_ICON_INFOTIP NOTIFY_ICON_INFOTIP;
166
167 struct _WINDOW_STATE_ORDER
168 {
169         uint32 ownerWindowId;
170         uint32 style;
171         uint32 extendedStyle;
172         uint32 showState;
173         UNICODE_STRING titleInfo;
174         uint32 clientOffsetX;
175         uint32 clientOffsetY;
176         uint32 clientAreaWidth;
177         uint32 clientAreaHeight;
178         uint32 RPContent;
179         uint32 rootParentHandle;
180         uint32 windowOffsetX;
181         uint32 windowOffsetY;
182         uint32 windowClientDeltaX;
183         uint32 windowClientDeltaY;
184         uint32 windowWidth;
185         uint32 windowHeight;
186         uint32 numWindowRects;
187         RECTANGLE_16* windowRects;
188         uint32 visibleOffsetX;
189         uint32 visibleOffsetY;
190         uint32 numVisibilityRects;
191         RECTANGLE_16* visibilityRects;
192 };
193 typedef struct _WINDOW_STATE_ORDER WINDOW_STATE_ORDER;
194
195 struct _WINDOW_ICON_ORDER
196 {
197         ICON_INFO* iconInfo;
198 };
199 typedef struct _WINDOW_ICON_ORDER WINDOW_ICON_ORDER;
200
201 struct _WINDOW_CACHED_ICON_ORDER
202 {
203         CACHED_ICON_INFO cachedIcon;
204 };
205 typedef struct _WINDOW_CACHED_ICON_ORDER WINDOW_CACHED_ICON_ORDER;
206
207 struct _NOTIFY_ICON_STATE_ORDER
208 {
209         uint32 version;
210         UNICODE_STRING toolTip;
211         NOTIFY_ICON_INFOTIP infoTip;
212         uint32 state;
213         ICON_INFO icon;
214         CACHED_ICON_INFO cachedIcon;
215 };
216 typedef struct _NOTIFY_ICON_STATE_ORDER NOTIFY_ICON_STATE_ORDER;
217
218 struct _MONITORED_DESKTOP_ORDER
219 {
220         uint32 activeWindowId;
221         uint32 numWindowIds;
222         uint32* windowIds;
223 };
224 typedef struct _MONITORED_DESKTOP_ORDER MONITORED_DESKTOP_ORDER;
225
226 typedef void (*pWindowCreate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
227 typedef void (*pWindowUpdate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_STATE_ORDER* window_state);
228 typedef void (*pWindowIcon)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* window_icon);
229 typedef void (*pWindowCachedIcon)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, WINDOW_CACHED_ICON_ORDER* window_cached_icon);
230 typedef void (*pWindowDelete)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo);
231 typedef void (*pNotifyIconCreate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state);
232 typedef void (*pNotifyIconUpdate)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, NOTIFY_ICON_STATE_ORDER* notify_icon_state);
233 typedef void (*pNotifyIconDelete)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo);
234 typedef void (*pMonitoredDesktop)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo, MONITORED_DESKTOP_ORDER* monitored_desktop);
235 typedef void (*pNonMonitoredDesktop)(rdpContext* context, WINDOW_ORDER_INFO* orderInfo);
236
237 struct rdp_window_update
238 {
239         rdpContext* context; /* 0 */
240         uint32 paddingA[16 - 1]; /* 1 */
241
242         pWindowCreate WindowCreate; /* 16 */
243         pWindowUpdate WindowUpdate; /* 17 */
244         pWindowIcon WindowIcon; /* 18 */
245         pWindowCachedIcon WindowCachedIcon; /* 19 */
246         pWindowDelete WindowDelete; /* 20 */
247         pNotifyIconCreate NotifyIconCreate; /* 21 */
248         pNotifyIconUpdate NotifyIconUpdate; /* 22 */
249         pNotifyIconDelete NotifyIconDelete; /* 23 */
250         pMonitoredDesktop MonitoredDesktop; /* 24 */
251         pNonMonitoredDesktop NonMonitoredDesktop; /* 25 */
252         uint32 paddingB[32 - 26]; /* 26 */
253
254         /* internal */
255
256         WINDOW_ORDER_INFO orderInfo;
257         WINDOW_STATE_ORDER window_state;
258         WINDOW_ICON_ORDER window_icon;
259         WINDOW_CACHED_ICON_ORDER window_cached_icon;
260         NOTIFY_ICON_STATE_ORDER notify_icon_state;
261         MONITORED_DESKTOP_ORDER monitored_desktop;
262 };
263 typedef struct rdp_window_update rdpWindowUpdate;
264
265 #endif /* __UPDATE_WINDOW_H */