Imported Upstream version 1.15.1
[deb_xorg-server.git] / hw / kdrive / ephyr / hostx.h
CommitLineData
a09e091a
JB
1/*
2 * Xephyr - A kdrive X server thats runs in a host X window.
3 * Authored by Matthew Allum <mallum@o-hand.com>
4 *
5 * Copyright © 2004 Nokia
6 *
7 * Permission to use, copy, modify, distribute, and sell this software and its
8 * documentation for any purpose is hereby granted without fee, provided that
9 * the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of Nokia not be used in
12 * advertising or publicity pertaining to distribution of the software without
13 * specific, written prior permission. Nokia makes no
14 * representations about the suitability of this software for any purpose. It
15 * is provided "as is" without express or implied warranty.
16 *
17 * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19 * EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23 * PERFORMANCE OF THIS SOFTWARE.
24 */
25
26#ifndef _XLIBS_STUFF_H_
27#define _XLIBS_STUFF_H_
28
29#include <X11/X.h>
30#include <X11/Xmd.h>
31#include <xcb/xcb.h>
32#include "ephyr.h"
33
34#define EPHYR_WANT_DEBUG 0
35
36#if (EPHYR_WANT_DEBUG)
37#define EPHYR_DBG(x, a...) \
38 fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
39#else
40#define EPHYR_DBG(x, a...) do {} while (0)
41#endif
42
43typedef struct EphyrHostXVars EphyrHostXVars;
44
45typedef struct {
46 int minKeyCode;
47 int maxKeyCode;
48} EphyrKeySyms;
49
50typedef struct {
51 VisualID visualid;
52 int screen;
53 int depth;
54 int class;
55 unsigned long red_mask;
56 unsigned long green_mask;
57 unsigned long blue_mask;
58 int colormap_size;
59 int bits_per_rgb;
60} EphyrHostVisualInfo;
61
62typedef struct {
63 int x, y;
64 int width, height;
65 int visualid;
66} EphyrHostWindowAttributes;
67
68typedef struct {
69 int x, y, width, height;
70} EphyrBox;
71
72typedef struct {
73 short x1, y1, x2, y2;
74} EphyrRect;
75
76int
77hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height);
78
79int
80 hostx_want_host_cursor(void);
81
82void
83 hostx_use_sw_cursor(void);
84
85void
86 hostx_use_fullscreen(void);
87
88int
89 hostx_want_fullscreen(void);
90
91int
92hostx_want_preexisting_window(KdScreenInfo *screen);
93
94void
95 hostx_use_preexisting_window(unsigned long win_id);
96
97void
98 hostx_use_resname(char *name, int fromcmd);
99
100void
101 hostx_set_title(char *name);
102
103void
104 hostx_handle_signal(int signum);
105
106int
107 hostx_init(void);
108
109void
110hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num);
111
112void
113 hostx_set_display_name(char *name);
114
115void
116hostx_set_screen_number(KdScreenInfo *screen, int number);
117
118void
119hostx_set_win_title(KdScreenInfo *screen, const char *extra_text);
120
121int
122 hostx_get_depth(void);
123
124int
125hostx_get_server_depth(KdScreenInfo *screen);
126
127int
128hostx_get_bpp(KdScreenInfo *screen);
129
130void
131hostx_get_visual_masks(KdScreenInfo *screen,
132 CARD32 *rmsk, CARD32 *gmsk, CARD32 *bmsk);
133void
134
135hostx_set_cmap_entry(unsigned char idx,
136 unsigned char r, unsigned char g, unsigned char b);
137
138void *hostx_screen_init(KdScreenInfo *screen,
139 int width, int height, int buffer_height,
140 int *bytes_per_line, int *bits_per_pixel);
141
142void
143hostx_paint_rect(KdScreenInfo *screen,
144 int sx, int sy, int dx, int dy, int width, int height);
145
146void
147 hostx_load_keymap(void);
148
149xcb_connection_t *
150hostx_get_xcbconn(void);
151
152int
153hostx_get_screen(void);
154
155int
156 hostx_get_window(int a_screen_number);
157
158int
159 hostx_get_window_attributes(int a_window, EphyrHostWindowAttributes * a_attr);
160
161int
162 hostx_get_visuals_info(EphyrHostVisualInfo ** a_visuals, int *a_num_entries);
163
164int hostx_create_window(int a_screen_number,
165 EphyrBox * a_geometry,
166 int a_visual_id, int *a_host_win /*out parameter */ );
167
168int hostx_destroy_window(int a_win);
169
170int hostx_set_window_geometry(int a_win, EphyrBox * a_geo);
171
172int hostx_set_window_bounding_rectangles(int a_window,
173 EphyrRect * a_rects, int a_num_rects);
174
175int host_has_extension(xcb_extension_t *extension);
176
177#ifdef XF86DRI
178int hostx_lookup_peer_window(void *a_local_window,
179 int *a_host_peer /*out parameter */ );
180int
181
182hostx_allocate_resource_id_peer(int a_local_resource_id,
183 int *a_remote_resource_id);
184int
185 hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id);
186int hostx_has_dri(void);
187
188int hostx_has_glx(void);
189#endif /* XF86DRI */
190
191#endif /*_XLIBS_STUFF_H_*/