2 * Xephyr - A kdrive X server thats runs in a host X window.
3 * Authored by Matthew Allum <mallum@o-hand.com>
5 * Copyright © 2004 Nokia
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.
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.
26 #ifndef _XLIBS_STUFF_H_
27 #define _XLIBS_STUFF_H_
34 #define EPHYR_WANT_DEBUG 0
36 #if (EPHYR_WANT_DEBUG)
37 #define EPHYR_DBG(x, a...) \
38 fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
40 #define EPHYR_DBG(x, a...) do {} while (0)
43 typedef struct EphyrHostXVars EphyrHostXVars;
55 unsigned long red_mask;
56 unsigned long green_mask;
57 unsigned long blue_mask;
60 } EphyrHostVisualInfo;
66 } EphyrHostWindowAttributes;
69 int x, y, width, height;
77 hostx_want_screen_size(KdScreenInfo *screen, int *width, int *height);
80 hostx_want_host_cursor(void);
83 hostx_use_sw_cursor(void);
86 hostx_use_fullscreen(void);
89 hostx_want_fullscreen(void);
92 hostx_want_preexisting_window(KdScreenInfo *screen);
95 hostx_use_preexisting_window(unsigned long win_id);
98 hostx_use_resname(char *name, int fromcmd);
101 hostx_set_title(char *name);
104 hostx_handle_signal(int signum);
110 hostx_add_screen(KdScreenInfo *screen, unsigned long win_id, int screen_num);
113 hostx_set_display_name(char *name);
116 hostx_set_screen_number(KdScreenInfo *screen, int number);
119 hostx_set_win_title(KdScreenInfo *screen, const char *extra_text);
122 hostx_get_depth(void);
125 hostx_get_server_depth(KdScreenInfo *screen);
128 hostx_get_bpp(KdScreenInfo *screen);
131 hostx_get_visual_masks(KdScreenInfo *screen,
132 CARD32 *rmsk, CARD32 *gmsk, CARD32 *bmsk);
135 hostx_set_cmap_entry(unsigned char idx,
136 unsigned char r, unsigned char g, unsigned char b);
138 void *hostx_screen_init(KdScreenInfo *screen,
139 int width, int height, int buffer_height,
140 int *bytes_per_line, int *bits_per_pixel);
143 hostx_paint_rect(KdScreenInfo *screen,
144 int sx, int sy, int dx, int dy, int width, int height);
147 hostx_load_keymap(void);
150 hostx_get_xcbconn(void);
153 hostx_get_screen(void);
156 hostx_get_window(int a_screen_number);
159 hostx_get_window_attributes(int a_window, EphyrHostWindowAttributes * a_attr);
162 hostx_get_visuals_info(EphyrHostVisualInfo ** a_visuals, int *a_num_entries);
164 int hostx_create_window(int a_screen_number,
165 EphyrBox * a_geometry,
166 int a_visual_id, int *a_host_win /*out parameter */ );
168 int hostx_destroy_window(int a_win);
170 int hostx_set_window_geometry(int a_win, EphyrBox * a_geo);
172 int hostx_set_window_bounding_rectangles(int a_window,
173 EphyrRect * a_rects, int a_num_rects);
175 int host_has_extension(xcb_extension_t *extension);
178 int hostx_lookup_peer_window(void *a_local_window,
179 int *a_host_peer /*out parameter */ );
182 hostx_allocate_resource_id_peer(int a_local_resource_id,
183 int *a_remote_resource_id);
185 hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id);
186 int hostx_has_dri(void);
188 int hostx_has_glx(void);
191 #endif /*_XLIBS_STUFF_H_*/