xfreerdp: add support for no-codec bitmaps in X11-GDI
[platform/upstream/freerdp.git] / client / X11 / xfreerdp.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * X11 Client
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 __XFREERDP_H
21 #define __XFREERDP_H
22
23 #include <X11/Xlib.h>
24 #include <X11/Xutil.h>
25 #include <freerdp/freerdp.h>
26 #include <freerdp/chanman/chanman.h>
27 #include <freerdp/gdi/gdi.h>
28 #include <freerdp/rail/rail.h>
29 #include <freerdp/cache/cache.h>
30
31 typedef struct xf_info xfInfo;
32
33 #include "xf_window.h"
34 #include "xf_monitor.h"
35
36 #define SET_XFI(_instance, _xfi) (_instance)->param1 = _xfi
37 #define GET_XFI(_instance) ((xfInfo*) ((_instance)->param1))
38
39 #define SET_CHANMAN(_instance, _chanman) (_instance)->param2 = _chanman
40 #define GET_CHANMAN(_instance) ((rdpChanMan*) ((_instance)->param2))
41
42 struct xf_WorkArea
43 {
44         uint32 x;
45         uint32 y;
46         uint32 width;
47         uint32 height;
48 };
49 typedef struct xf_WorkArea xfWorkArea;
50
51 struct xf_info
52 {
53         GC gc;
54         int bpp;
55         int xfds;
56         int depth;
57         int width;
58         int height;
59         int srcBpp;
60         GC gc_mono;
61         Screen* screen;
62         XImage* image;
63         Pixmap primary;
64         Pixmap drawing;
65         Visual* visual;
66         Display* display;
67         Pixmap bitmap_mono;
68         Colormap colormap;
69         int screen_number;
70         int scanline_pad;
71         boolean big_endian;
72         boolean fullscreen;
73         boolean unobscured;
74         boolean decoration;
75         freerdp* instance;
76         xfWindow* window;
77         xfWorkArea workArea;
78         int current_desktop;
79         boolean remote_app;
80         HCLRCONV clrconv;
81         rdpRail* rail;
82         rdpCache* cache;
83
84         boolean focused;
85         boolean mouse_active;
86         boolean mouse_motion;
87         boolean fullscreen_toggle;
88         uint32 keyboard_layout_id;
89         boolean pressed_keys[256];
90         XModifierKeymap* modifier_map;
91         XSetWindowAttributes attribs;
92         boolean complex_regions;
93         VIRTUAL_SCREEN vscreen;
94         uint8* bmp_codec_none;
95         void* rfx_context;
96
97         Atom _NET_WM_ICON;
98         Atom _MOTIF_WM_HINTS;
99         Atom _NET_CURRENT_DESKTOP;
100         Atom _NET_WORKAREA;
101
102         Atom _NET_WM_STATE;
103         Atom _NET_WM_STATE_FULLSCREEN;
104         Atom _NET_WM_STATE_SKIP_TASKBAR;
105         Atom _NET_WM_STATE_SKIP_PAGER;
106
107         Atom _NET_WM_WINDOW_TYPE;
108         Atom _NET_WM_WINDOW_TYPE_NORMAL;
109         Atom _NET_WM_WINDOW_TYPE_DIALOG;
110         Atom _NET_WM_WINDOW_TYPE_UTILITY;
111
112         Atom _NET_WM_MOVERESIZE;
113 };
114
115 void xf_toggle_fullscreen(xfInfo* xfi);
116 boolean xf_post_connect(freerdp* instance);
117
118 #ifdef WITH_DEBUG_X11
119 #define DEBUG_X11(fmt, ...) DEBUG_CLASS(X11, fmt, ## __VA_ARGS__)
120 #else
121 #define DEBUG_X11(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
122 #endif
123
124 #ifdef WITH_DEBUG_X11_LOCAL_MOVESIZE
125 #define DEBUG_X11_LMS(fmt, ...) DEBUG_CLASS(X11_LMS, fmt, ## __VA_ARGS__)
126 #else
127 #define DEBUG_X11_LMS(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
128 #endif
129
130
131 #endif /* __XFREERDP_H */