2011-08-07 17:52:40 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-08-07 17:52:40 +04:00
|
|
|
* X11 Client
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __XFREERDP_H
|
|
|
|
#define __XFREERDP_H
|
|
|
|
|
2012-08-15 01:41:40 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2012-03-12 15:14:56 +04:00
|
|
|
#include "config.h"
|
2012-08-15 01:41:40 +04:00
|
|
|
#endif
|
|
|
|
|
2011-08-07 17:52:40 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
2011-10-16 22:57:15 +04:00
|
|
|
#include <freerdp/channels/channels.h>
|
2011-08-15 22:33:04 +04:00
|
|
|
#include <freerdp/gdi/gdi.h>
|
2011-09-23 08:06:39 +04:00
|
|
|
#include <freerdp/gdi/dc.h>
|
|
|
|
#include <freerdp/gdi/region.h>
|
2011-08-16 08:22:00 +04:00
|
|
|
#include <freerdp/rail/rail.h>
|
2011-08-26 22:48:51 +04:00
|
|
|
#include <freerdp/cache/cache.h>
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2011-08-09 06:24:12 +04:00
|
|
|
typedef struct xf_info xfInfo;
|
|
|
|
|
|
|
|
#include "xf_window.h"
|
2011-08-31 04:59:42 +04:00
|
|
|
#include "xf_monitor.h"
|
2011-08-09 06:24:12 +04:00
|
|
|
|
2011-08-17 22:13:44 +04:00
|
|
|
struct xf_WorkArea
|
|
|
|
{
|
|
|
|
uint32 x;
|
|
|
|
uint32 y;
|
|
|
|
uint32 width;
|
|
|
|
uint32 height;
|
|
|
|
};
|
|
|
|
typedef struct xf_WorkArea xfWorkArea;
|
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
struct xf_pointer
|
|
|
|
{
|
|
|
|
rdpPointer pointer;
|
|
|
|
Cursor cursor;
|
|
|
|
};
|
|
|
|
typedef struct xf_pointer xfPointer;
|
|
|
|
|
2011-10-13 23:51:07 +04:00
|
|
|
struct xf_bitmap
|
|
|
|
{
|
|
|
|
rdpBitmap bitmap;
|
|
|
|
Pixmap pixmap;
|
|
|
|
};
|
|
|
|
typedef struct xf_bitmap xfBitmap;
|
|
|
|
|
2011-11-09 21:16:09 +04:00
|
|
|
struct xf_glyph
|
|
|
|
{
|
|
|
|
rdpGlyph glyph;
|
|
|
|
Pixmap pixmap;
|
|
|
|
};
|
|
|
|
typedef struct xf_glyph xfGlyph;
|
|
|
|
|
2011-10-16 08:50:10 +04:00
|
|
|
struct xf_context
|
|
|
|
{
|
|
|
|
rdpContext _p;
|
|
|
|
|
|
|
|
xfInfo* xfi;
|
|
|
|
rdpSettings* settings;
|
|
|
|
};
|
|
|
|
typedef struct xf_context xfContext;
|
|
|
|
|
2011-08-07 17:52:40 +04:00
|
|
|
struct xf_info
|
|
|
|
{
|
2011-10-16 08:50:10 +04:00
|
|
|
freerdp* instance;
|
|
|
|
xfContext* context;
|
2011-10-17 04:10:09 +04:00
|
|
|
rdpContext* _context;
|
2011-10-16 08:50:10 +04:00
|
|
|
|
2011-08-07 21:41:54 +04:00
|
|
|
GC gc;
|
|
|
|
int bpp;
|
|
|
|
int xfds;
|
|
|
|
int depth;
|
|
|
|
int width;
|
|
|
|
int height;
|
2011-08-26 22:48:51 +04:00
|
|
|
int srcBpp;
|
2011-09-12 06:32:22 +04:00
|
|
|
GC gc_mono;
|
2011-08-07 21:41:54 +04:00
|
|
|
Screen* screen;
|
2011-08-07 22:09:18 +04:00
|
|
|
XImage* image;
|
2011-08-07 21:41:54 +04:00
|
|
|
Pixmap primary;
|
2011-08-26 22:48:51 +04:00
|
|
|
Pixmap drawing;
|
2011-08-07 21:41:54 +04:00
|
|
|
Visual* visual;
|
|
|
|
Display* display;
|
2011-09-23 08:06:39 +04:00
|
|
|
Drawable drawable;
|
2011-09-12 06:32:22 +04:00
|
|
|
Pixmap bitmap_mono;
|
2011-08-07 21:41:54 +04:00
|
|
|
Colormap colormap;
|
|
|
|
int screen_number;
|
|
|
|
int scanline_pad;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL big_endian;
|
|
|
|
BOOL fullscreen;
|
|
|
|
BOOL grab_keyboard;
|
|
|
|
BOOL unobscured;
|
|
|
|
BOOL decorations;
|
|
|
|
BOOL debug;
|
2011-08-09 06:24:12 +04:00
|
|
|
xfWindow* window;
|
2011-08-17 22:13:44 +04:00
|
|
|
xfWorkArea workArea;
|
|
|
|
int current_desktop;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL remote_app;
|
|
|
|
BOOL disconnect;
|
2011-08-26 22:48:51 +04:00
|
|
|
HCLRCONV clrconv;
|
2011-12-09 22:53:19 +04:00
|
|
|
Window parent_window;
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2011-09-23 08:06:39 +04:00
|
|
|
HGDI_DC hdc;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL sw_gdi;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* primary_buffer;
|
2011-09-23 08:06:39 +04:00
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL frame_begin;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16 frame_x1;
|
|
|
|
UINT16 frame_y1;
|
|
|
|
UINT16 frame_x2;
|
|
|
|
UINT16 frame_y2;
|
2012-05-26 10:41:38 +04:00
|
|
|
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL focused;
|
|
|
|
BOOL mouse_active;
|
|
|
|
BOOL mouse_motion;
|
|
|
|
BOOL suppress_output;
|
|
|
|
BOOL fullscreen_toggle;
|
2011-08-07 21:41:54 +04:00
|
|
|
uint32 keyboard_layout_id;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL pressed_keys[256];
|
2011-08-07 21:41:54 +04:00
|
|
|
XModifierKeymap* modifier_map;
|
2011-08-09 06:24:12 +04:00
|
|
|
XSetWindowAttributes attribs;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL complex_regions;
|
2011-08-31 04:59:42 +04:00
|
|
|
VIRTUAL_SCREEN vscreen;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* bmp_codec_none;
|
|
|
|
BYTE* bmp_codec_nsc;
|
2011-09-12 05:22:03 +04:00
|
|
|
void* rfx_context;
|
2011-10-02 23:16:22 +04:00
|
|
|
void* nsc_context;
|
2011-09-20 12:27:59 +04:00
|
|
|
void* xv_context;
|
2011-09-23 07:37:17 +04:00
|
|
|
void* clipboard_context;
|
2011-12-09 22:53:19 +04:00
|
|
|
|
2011-08-24 08:46:34 +04:00
|
|
|
Atom _NET_WM_ICON;
|
|
|
|
Atom _MOTIF_WM_HINTS;
|
|
|
|
Atom _NET_CURRENT_DESKTOP;
|
|
|
|
Atom _NET_WORKAREA;
|
2011-08-25 01:16:57 +04:00
|
|
|
|
2011-08-24 08:46:34 +04:00
|
|
|
Atom _NET_WM_STATE;
|
|
|
|
Atom _NET_WM_STATE_FULLSCREEN;
|
2011-08-25 01:16:57 +04:00
|
|
|
Atom _NET_WM_STATE_SKIP_TASKBAR;
|
|
|
|
Atom _NET_WM_STATE_SKIP_PAGER;
|
|
|
|
|
|
|
|
Atom _NET_WM_WINDOW_TYPE;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_NORMAL;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_DIALOG;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_UTILITY;
|
2011-12-03 02:51:30 +04:00
|
|
|
Atom _NET_WM_WINDOW_TYPE_POPUP;
|
|
|
|
Atom _NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
|
2011-09-01 02:22:21 +04:00
|
|
|
|
|
|
|
Atom _NET_WM_MOVERESIZE;
|
2011-12-03 02:51:30 +04:00
|
|
|
Atom _NET_MOVERESIZE_WINDOW;
|
2011-09-21 16:36:49 +04:00
|
|
|
|
2012-08-04 02:35:17 +04:00
|
|
|
Atom WM_STATE;
|
2011-09-21 16:36:49 +04:00
|
|
|
Atom WM_PROTOCOLS;
|
|
|
|
Atom WM_DELETE_WINDOW;
|
2011-08-07 17:52:40 +04:00
|
|
|
};
|
|
|
|
|
2012-08-14 23:59:11 +04:00
|
|
|
void xf_create_window(xfInfo* xfi);
|
2011-08-07 21:41:54 +04:00
|
|
|
void xf_toggle_fullscreen(xfInfo* xfi);
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL xf_post_connect(freerdp* instance);
|
2011-08-07 21:41:54 +04:00
|
|
|
|
2011-10-24 22:46:19 +04:00
|
|
|
enum XF_EXIT_CODE
|
|
|
|
{
|
|
|
|
/* section 0-15: protocol-independent codes */
|
|
|
|
XF_EXIT_SUCCESS = 0,
|
|
|
|
XF_EXIT_DISCONNECT = 1,
|
|
|
|
XF_EXIT_LOGOFF = 2,
|
|
|
|
XF_EXIT_IDLE_TIMEOUT = 3,
|
|
|
|
XF_EXIT_LOGON_TIMEOUT = 4,
|
|
|
|
XF_EXIT_CONN_REPLACED = 5,
|
|
|
|
XF_EXIT_OUT_OF_MEMORY = 6,
|
|
|
|
XF_EXIT_CONN_DENIED = 7,
|
|
|
|
XF_EXIT_CONN_DENIED_FIPS = 8,
|
|
|
|
XF_EXIT_USER_PRIVILEGES = 9,
|
|
|
|
XF_EXIT_FRESH_CREDENTIALS_REQUIRED = 10,
|
|
|
|
XF_EXIT_DISCONNECT_BY_USER = 11,
|
|
|
|
|
|
|
|
/* section 16-31: license error set */
|
|
|
|
XF_EXIT_LICENSE_INTERNAL = 16,
|
|
|
|
XF_EXIT_LICENSE_NO_LICENSE_SERVER = 17,
|
|
|
|
XF_EXIT_LICENSE_NO_LICENSE = 18,
|
|
|
|
XF_EXIT_LICENSE_BAD_CLIENT_MSG = 19,
|
|
|
|
XF_EXIT_LICENSE_HWID_DOESNT_MATCH = 20,
|
|
|
|
XF_EXIT_LICENSE_BAD_CLIENT = 21,
|
|
|
|
XF_EXIT_LICENSE_CANT_FINISH_PROTOCOL = 22,
|
|
|
|
XF_EXIT_LICENSE_CLIENT_ENDED_PROTOCOL = 23,
|
|
|
|
XF_EXIT_LICENSE_BAD_CLIENT_ENCRYPTION = 24,
|
|
|
|
XF_EXIT_LICENSE_CANT_UPGRADE = 25,
|
|
|
|
XF_EXIT_LICENSE_NO_REMOTE_CONNECTIONS = 26,
|
|
|
|
|
|
|
|
/* section 32-127: RDP protocol error set */
|
|
|
|
XF_EXIT_RDP = 32,
|
|
|
|
|
|
|
|
/* section 128-254: xfreerdp specific exit codes */
|
|
|
|
XF_EXIT_PARSE_ARGUMENTS = 128,
|
|
|
|
XF_EXIT_MEMORY = 129,
|
|
|
|
XF_EXIT_PROTOCOL = 130,
|
|
|
|
XF_EXIT_CONN_FAILED = 131,
|
|
|
|
|
|
|
|
XF_EXIT_UNKNOWN = 255,
|
|
|
|
};
|
|
|
|
|
2011-09-02 21:29:17 +04:00
|
|
|
#ifdef WITH_DEBUG_X11
|
|
|
|
#define DEBUG_X11(fmt, ...) DEBUG_CLASS(X11, fmt, ## __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG_X11(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
2011-09-04 00:38:01 +04:00
|
|
|
#ifdef WITH_DEBUG_X11_LOCAL_MOVESIZE
|
|
|
|
#define DEBUG_X11_LMS(fmt, ...) DEBUG_CLASS(X11_LMS, fmt, ## __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define DEBUG_X11_LMS(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
2011-08-07 17:52:40 +04:00
|
|
|
#endif /* __XFREERDP_H */
|