22 #ifndef FREERDP_CLIENT_X11_FREERDP_H
23 #define FREERDP_CLIENT_X11_FREERDP_H
25 #include <freerdp/config.h>
30 #include <X11/Xcursor/Xcursor.h>
34 #include <X11/extensions/XInput2.h>
37 #include <freerdp/api.h>
39 #include "xf_window.h"
40 #include "xf_monitor.h"
41 #include "xf_channels.h"
43 #if defined(CHANNEL_TSMF_CLIENT)
44 #include <freerdp/client/tsmf.h>
47 #include <freerdp/gdi/gdi.h>
48 #include <freerdp/codec/rfx.h>
49 #include <freerdp/codec/nsc.h>
50 #include <freerdp/codec/clear.h>
51 #include <freerdp/codec/color.h>
52 #include <freerdp/codec/bitmap.h>
53 #include <freerdp/codec/h264.h>
54 #include <freerdp/codec/progressive.h>
55 #include <freerdp/codec/region.h>
57 #if !defined(XcursorUInt)
58 typedef unsigned int XcursorUInt;
61 #if !defined(XcursorPixel)
62 typedef XcursorUInt XcursorPixel;
86 XcursorPixel* cursorPixels;
90 UINT32* cursorHeights;
111 typedef struct xf_clipboard xfClipboard;
112 typedef struct s_xfDispContext xfDispContext;
113 typedef struct s_xfVideoContext xfVideoContext;
114 typedef struct xf_rail_icon_cache xfRailIconCache;
117 #define NUM_BUTTONS_MAPPED 11
126 #define MAX_CONTACTS 20
128 typedef struct touch_contact
143 rdpClientContext common;
170 xfAppWindow* appWindow;
173 xfFullscreenMonitors fullscreenMonitors;
201 BOOL fullscreen_toggle;
202 UINT32 KeyboardLayout;
203 BOOL KeyboardState[256];
204 XModifierKeymap* modifierMap;
205 wArrayList* keyCombinations;
207 BOOL actionScriptExists;
210 XSetWindowAttributes attribs;
211 BOOL complex_regions;
212 VIRTUAL_SCREEN vscreen;
213 #if defined(CHANNEL_TSMF_CLIENT)
217 Atom* supportedAtoms;
218 unsigned long supportedAtomCount;
222 Atom _XWAYLAND_MAY_GRAB_KEYBOARD;
225 Atom _MOTIF_WM_HINTS;
226 Atom _NET_NUMBER_OF_DESKTOPS;
227 Atom _NET_CURRENT_DESKTOP;
231 Atom _NET_SUPPORTING_WM_CHECK;
234 Atom _NET_WM_STATE_MODAL;
235 Atom _NET_WM_STATE_STICKY;
236 Atom _NET_WM_STATE_MAXIMIZED_VERT;
237 Atom _NET_WM_STATE_MAXIMIZED_HORZ;
238 Atom _NET_WM_STATE_SHADED;
239 Atom _NET_WM_STATE_SKIP_TASKBAR;
240 Atom _NET_WM_STATE_SKIP_PAGER;
241 Atom _NET_WM_STATE_HIDDEN;
242 Atom _NET_WM_STATE_FULLSCREEN;
243 Atom _NET_WM_STATE_ABOVE;
244 Atom _NET_WM_STATE_BELOW;
245 Atom _NET_WM_STATE_DEMANDS_ATTENTION;
247 Atom _NET_WM_FULLSCREEN_MONITORS;
252 Atom _NET_WM_WINDOW_TYPE;
253 Atom _NET_WM_WINDOW_TYPE_NORMAL;
254 Atom _NET_WM_WINDOW_TYPE_DIALOG;
255 Atom _NET_WM_WINDOW_TYPE_UTILITY;
256 Atom _NET_WM_WINDOW_TYPE_POPUP;
257 Atom _NET_WM_WINDOW_TYPE_POPUP_MENU;
258 Atom _NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
260 Atom _NET_WM_MOVERESIZE;
261 Atom _NET_MOVERESIZE_WINDOW;
265 Atom WM_DELETE_WINDOW;
268 Atom NET_WM_ALLOWED_ACTIONS;
270 Atom NET_WM_ACTION_CLOSE;
271 Atom NET_WM_ACTION_MINIMIZE;
272 Atom NET_WM_ACTION_MOVE;
273 Atom NET_WM_ACTION_RESIZE;
274 Atom NET_WM_ACTION_MAXIMIZE_HORZ;
275 Atom NET_WM_ACTION_MAXIMIZE_VERT;
276 Atom NET_WM_ACTION_FULLSCREEN;
277 Atom NET_WM_ACTION_CHANGE_DESKTOP;
280 #if defined(CHANNEL_TSMF_CLIENT)
281 TsmfClientContext* tsmf;
284 xfClipboard* clipboard;
285 CliprdrClientContext* cliprdr;
286 xfVideoContext* xfVideo;
287 xfDispContext* xfDisp;
289 RailClientContext* rail;
290 wHashTable* railWindows;
291 xfRailIconCache* railIconCache;
294 BOOL xrenderAvailable;
298 BYTE savedMaximizedState;
300 BOOL wasRightCtrlAlreadyPressed;
301 BOOL ungrabKeyboardWithRightCtrl;
304 touchContact contacts[MAX_CONTACTS];
307 XIDeviceEvent lastEvent;
320 BOOL xf_create_window(xfContext* xfc);
321 BOOL xf_create_image(xfContext* xfc);
322 void xf_toggle_fullscreen(xfContext* xfc);
323 void xf_minimize(xfContext* xfc);
329 XF_EXIT_DISCONNECT = 1,
331 XF_EXIT_IDLE_TIMEOUT = 3,
332 XF_EXIT_LOGON_TIMEOUT = 4,
333 XF_EXIT_CONN_REPLACED = 5,
334 XF_EXIT_OUT_OF_MEMORY = 6,
335 XF_EXIT_CONN_DENIED = 7,
336 XF_EXIT_CONN_DENIED_FIPS = 8,
337 XF_EXIT_USER_PRIVILEGES = 9,
338 XF_EXIT_FRESH_CREDENTIALS_REQUIRED = 10,
339 XF_EXIT_DISCONNECT_BY_USER = 11,
342 XF_EXIT_LICENSE_INTERNAL = 16,
343 XF_EXIT_LICENSE_NO_LICENSE_SERVER = 17,
344 XF_EXIT_LICENSE_NO_LICENSE = 18,
345 XF_EXIT_LICENSE_BAD_CLIENT_MSG = 19,
346 XF_EXIT_LICENSE_HWID_DOESNT_MATCH = 20,
347 XF_EXIT_LICENSE_BAD_CLIENT = 21,
348 XF_EXIT_LICENSE_CANT_FINISH_PROTOCOL = 22,
349 XF_EXIT_LICENSE_CLIENT_ENDED_PROTOCOL = 23,
350 XF_EXIT_LICENSE_BAD_CLIENT_ENCRYPTION = 24,
351 XF_EXIT_LICENSE_CANT_UPGRADE = 25,
352 XF_EXIT_LICENSE_NO_REMOTE_CONNECTIONS = 26,
358 XF_EXIT_PARSE_ARGUMENTS = 128,
359 XF_EXIT_MEMORY = 129,
360 XF_EXIT_PROTOCOL = 130,
361 XF_EXIT_CONN_FAILED = 131,
362 XF_EXIT_AUTH_FAILURE = 132,
363 XF_EXIT_NEGO_FAILURE = 133,
364 XF_EXIT_LOGON_FAILURE = 134,
365 XF_EXIT_ACCOUNT_LOCKED_OUT = 135,
366 XF_EXIT_PRE_CONNECT_FAILED = 136,
367 XF_EXIT_CONNECT_UNDEFINED = 137,
368 XF_EXIT_POST_CONNECT_FAILED = 138,
369 XF_EXIT_DNS_ERROR = 139,
370 XF_EXIT_DNS_NAME_NOT_FOUND = 140,
371 XF_EXIT_CONNECT_FAILED = 141,
372 XF_EXIT_MCS_CONNECT_INITIAL_ERROR = 142,
373 XF_EXIT_TLS_CONNECT_FAILED = 143,
374 XF_EXIT_INSUFFICIENT_PRIVILEGES = 144,
375 XF_EXIT_CONNECT_CANCELLED = 145,
377 XF_EXIT_CONNECT_TRANSPORT_FAILED = 147,
378 XF_EXIT_CONNECT_PASSWORD_EXPIRED = 148,
379 XF_EXIT_CONNECT_PASSWORD_MUST_CHANGE = 149,
380 XF_EXIT_CONNECT_KDC_UNREACHABLE = 150,
381 XF_EXIT_CONNECT_ACCOUNT_DISABLED = 151,
382 XF_EXIT_CONNECT_PASSWORD_CERTAINLY_EXPIRED = 152,
383 XF_EXIT_CONNECT_CLIENT_REVOKED = 153,
384 XF_EXIT_CONNECT_WRONG_PASSWORD = 154,
385 XF_EXIT_CONNECT_ACCESS_DENIED = 155,
386 XF_EXIT_CONNECT_ACCOUNT_RESTRICTION = 156,
387 XF_EXIT_CONNECT_ACCOUNT_EXPIRED = 157,
388 XF_EXIT_CONNECT_LOGON_TYPE_NOT_GRANTED = 158,
389 XF_EXIT_CONNECT_NO_OR_MISSING_CREDENTIALS = 159,
391 XF_EXIT_UNKNOWN = 255,
394 #define xf_lock_x11(xfc) xf_lock_x11_(xfc, __func__)
395 #define xf_unlock_x11(xfc) xf_unlock_x11_(xfc, __func__)
397 void xf_lock_x11_(xfContext* xfc,
const char* fkt);
398 void xf_unlock_x11_(xfContext* xfc,
const char* fkt);
400 BOOL xf_picture_transform_required(xfContext* xfc);
402 #define xf_draw_screen(_xfc, _x, _y, _w, _h) \
403 xf_draw_screen_((_xfc), (_x), (_y), (_w), (_h), __func__, __FILE__, __LINE__)
404 void xf_draw_screen_(xfContext* xfc,
int x,
int y,
int w,
int h,
const char* fkt,
const char* file,
407 BOOL xf_keyboard_update_modifier_map(xfContext* xfc);
409 int xf_exit_code_from_disconnect_reason(DWORD reason);