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_
32 #define EPHYR_WANT_DEBUG 0
34 #if (EPHYR_WANT_DEBUG)
35 #define EPHYR_DBG(x, a...) \
36 fprintf(stderr, __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a)
38 #define EPHYR_DBG(x, a...) do {} while (0)
41 typedef struct EphyrHostXVars EphyrHostXVars;
42 typedef struct EphyrHostXEvent EphyrHostXEvent;
43 typedef void *EphyrScreenInfo;
44 typedef enum EphyrHostXEventType {
45 EPHYR_EV_MOUSE_MOTION,
47 EPHYR_EV_MOUSE_RELEASE,
52 } EphyrHostXEventType;
54 /* I can't believe it's not a KeySymsRec. */
62 struct EphyrHostXEvent {
63 EphyrHostXEventType type;
110 unsigned long red_mask;
111 unsigned long green_mask;
112 unsigned long blue_mask;
115 } EphyrHostVisualInfo;
121 } EphyrHostWindowAttributes;
124 int x, y, width, height;
128 short x1, y1, x2, y2;
132 hostx_want_screen_size(EphyrScreenInfo screen, int *width, int *height);
135 hostx_want_host_cursor(void);
138 hostx_use_host_cursor(void);
141 hostx_use_fullscreen(void);
144 hostx_want_fullscreen(void);
147 hostx_want_preexisting_window(EphyrScreenInfo screen);
150 hostx_use_preexisting_window(unsigned long win_id);
153 hostx_use_resname(char *name, int fromcmd);
156 hostx_set_title(char *name);
159 hostx_handle_signal(int signum);
165 hostx_add_screen(EphyrScreenInfo screen, unsigned long win_id, int screen_num);
168 hostx_set_display_name(char *name);
171 hostx_set_screen_number(EphyrScreenInfo screen, int number);
174 hostx_set_win_title(EphyrScreenInfo screen, char *extra_text);
177 hostx_get_depth(void);
180 hostx_get_server_depth(EphyrScreenInfo screen);
183 hostx_set_server_depth(EphyrScreenInfo screen, int depth);
186 hostx_get_bpp(void *info);
189 hostx_get_visual_masks(void *info, CARD32 *rmsk, CARD32 *gmsk, CARD32 *bmsk);
192 hostx_set_cmap_entry(unsigned char idx,
193 unsigned char r, unsigned char g, unsigned char b);
195 void *hostx_screen_init(EphyrScreenInfo screen,
196 int width, int height, int buffer_height);
200 hostx_paint_rect(EphyrScreenInfo screen,
201 int sx, int sy, int dx, int dy, int width, int height);
204 hostx_load_keymap(void);
207 hostx_get_event(EphyrHostXEvent * ev);
209 void *hostx_get_display(void);
212 hostx_get_window(int a_screen_number);
215 hostx_get_window_attributes(int a_window, EphyrHostWindowAttributes * a_attr);
219 hostx_get_extension_info(const char *a_ext_name,
221 int *a_first_even, int *a_first_error);
223 hostx_get_visuals_info(EphyrHostVisualInfo ** a_visuals, int *a_num_entries);
225 int hostx_create_window(int a_screen_number,
226 EphyrBox * a_geometry,
227 int a_visual_id, int *a_host_win /*out parameter */ );
229 int hostx_destroy_window(int a_win);
231 int hostx_set_window_geometry(int a_win, EphyrBox * a_geo);
233 int hostx_set_window_bounding_rectangles(int a_window,
234 EphyrRect * a_rects, int a_num_rects);
236 int hostx_set_window_clipping_rectangles(int a_window,
237 EphyrRect * a_rects, int a_num_rects);
238 int hostx_has_xshape(void);
241 int hostx_lookup_peer_window(void *a_local_window,
242 int *a_host_peer /*out parameter */ );
245 hostx_allocate_resource_id_peer(int a_local_resource_id,
246 int *a_remote_resource_id);
248 hostx_get_resource_id_peer(int a_local_resource_id, int *a_remote_resource_id);
249 int hostx_has_dri(void);
251 int hostx_has_glx(void);
254 #endif /*_XLIBS_STUFF_H_*/