4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
8 * Copyright (C) 2006 OpenedHand
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
28 * @short_description: X11 specific API
30 * The X11 backend for Clutter provides some specific API, allowing
31 * integration with the Xlibs API for embedding and manipulating the
32 * stage window, or for trapping X errors.
34 * The ClutterX11 API is available since Clutter 0.6
37 #ifndef __CLUTTER_X11_H__
38 #define __CLUTTER_X11_H__
42 #include <X11/Xatom.h>
43 #include <X11/Xutil.h>
44 #include <clutter/clutter.h>
45 #include <clutter/x11/clutter-x11-texture-pixmap.h>
50 * ClutterX11FilterReturn:
51 * @CLUTTER_X11_FILTER_CONTINUE: The event was not handled, continues the
53 * @CLUTTER_X11_FILTER_TRANSLATE: Native event translated into a Clutter
54 * event, stops the processing
55 * @CLUTTER_X11_FILTER_REMOVE: Remove the event, stops the processing
57 * Return values for the #ClutterX11FilterFunc function.
62 CLUTTER_X11_FILTER_CONTINUE,
63 CLUTTER_X11_FILTER_TRANSLATE,
64 CLUTTER_X11_FILTER_REMOVE
65 } ClutterX11FilterReturn;
68 * This is an internal only enumeration; it should really be private
71 CLUTTER_X11_XINPUT_KEY_PRESS_EVENT = 0,
72 CLUTTER_X11_XINPUT_KEY_RELEASE_EVENT,
73 CLUTTER_X11_XINPUT_BUTTON_PRESS_EVENT,
74 CLUTTER_X11_XINPUT_BUTTON_RELEASE_EVENT,
75 CLUTTER_X11_XINPUT_MOTION_NOTIFY_EVENT,
76 CLUTTER_X11_XINPUT_LAST_EVENT
77 } ClutterX11XInputEventTypes;
80 * This is not used any more
82 typedef struct _ClutterX11XInputDevice ClutterX11XInputDevice;
85 * ClutterX11FilterFunc:
86 * @xev: Native X11 event structure
87 * @cev: Clutter event structure
88 * @data: user data passed to the filter function
90 * Filter function for X11 native events.
92 * Return value: the result of the filtering
96 typedef ClutterX11FilterReturn (*ClutterX11FilterFunc) (XEvent *xev,
100 void clutter_x11_trap_x_errors (void);
101 gint clutter_x11_untrap_x_errors (void);
103 Display *clutter_x11_get_default_display (void);
104 int clutter_x11_get_default_screen (void);
105 Window clutter_x11_get_root_window (void);
106 XVisualInfo *clutter_x11_get_visual_info (void);
107 void clutter_x11_set_display (Display * xdpy);
109 CLUTTER_DEPRECATED_FOR(clutter_x11_get_visual_info)
110 XVisualInfo *clutter_x11_get_stage_visual (ClutterStage *stage);
112 Window clutter_x11_get_stage_window (ClutterStage *stage);
113 gboolean clutter_x11_set_stage_foreign (ClutterStage *stage,
116 void clutter_x11_add_filter (ClutterX11FilterFunc func,
118 void clutter_x11_remove_filter (ClutterX11FilterFunc func,
121 ClutterX11FilterReturn clutter_x11_handle_event (XEvent *xevent);
123 void clutter_x11_disable_event_retrieval (void);
124 gboolean clutter_x11_has_event_retrieval (void);
126 ClutterStage *clutter_x11_get_stage_from_window (Window win);
128 CLUTTER_DEPRECATED_FOR(clutter_device_manager_peek_devices)
129 const GSList* clutter_x11_get_input_devices (void);
131 void clutter_x11_enable_xinput (void);
132 gboolean clutter_x11_has_xinput (void);
134 gboolean clutter_x11_has_composite_extension (void);
136 void clutter_x11_set_use_argb_visual (gboolean use_argb);
137 gboolean clutter_x11_get_use_argb_visual (void);
139 Time clutter_x11_get_current_event_time (void);
141 gint clutter_x11_event_get_key_group (const ClutterEvent *event);
145 #endif /* __CLUTTER_X11_H__ */