2 * An OpenGL based 'interactive canvas' library.
3 * Authored By Matthew Allum <mallum@openedhand.com>
4 * Copyright (C) 2006-2007 OpenedHand
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef __CLUTTER_BACKEND_X11_H__
23 #define __CLUTTER_BACKEND_X11_H__
25 #include <glib-object.h>
26 #include <clutter/clutter-event.h>
28 #include <X11/Xatom.h>
30 #include "clutter-x11.h"
32 #include "clutter-backend-private.h"
33 #include "clutter-keymap-x11.h"
35 #include "xsettings/xsettings-client.h"
39 #define CLUTTER_TYPE_BACKEND_X11 (_clutter_backend_x11_get_type ())
40 #define CLUTTER_BACKEND_X11(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BACKEND_X11, ClutterBackendX11))
41 #define CLUTTER_IS_BACKEND_X11(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BACKEND_X11))
42 #define CLUTTER_BACKEND_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND_X11, ClutterBackendX11Class))
43 #define CLUTTER_IS_BACKEND_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND_X11))
44 #define CLUTTER_BACKEND_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND_X11, ClutterBackendX11Class))
46 typedef struct _ClutterBackendX11 ClutterBackendX11;
47 typedef struct _ClutterBackendX11Class ClutterBackendX11Class;
48 typedef struct _ClutterEventX11 ClutterEventX11;
49 typedef struct _ClutterX11EventFilter ClutterX11EventFilter;
51 struct _ClutterX11EventFilter
53 ClutterX11FilterFunc func;
58 struct _ClutterEventX11
60 /* additional fields for Key events */
63 guint key_is_modifier : 1;
64 guint num_lock_set : 1;
65 guint caps_lock_set : 1;
68 struct _ClutterBackendX11
70 ClutterBackend parent_instance;
83 GSource *event_source;
84 GSList *event_filters;
88 Atom atom_NET_WM_PING;
89 Atom atom_NET_WM_STATE;
90 Atom atom_NET_WM_STATE_FULLSCREEN;
91 Atom atom_NET_WM_USER_TIME;
92 Atom atom_WM_PROTOCOLS;
93 Atom atom_WM_DELETE_WINDOW;
95 Atom atom_XEMBED_INFO;
96 Atom atom_NET_WM_NAME;
97 Atom atom_UTF8_STRING;
101 ClutterDeviceManager *device_manager;
105 XSettingsClient *xsettings;
106 Window xsettings_xwin;
108 ClutterKeymapX11 *keymap;
110 gboolean have_xkb_autorepeat;
114 struct _ClutterBackendX11Class
116 ClutterBackendClass parent_class;
119 GType _clutter_backend_x11_get_type (void) G_GNUC_CONST;
121 void _clutter_backend_x11_events_init (ClutterBackend *backend);
123 GSource * _clutter_x11_event_source_new (ClutterBackendX11 *backend_x11);
125 /* Private to glx/eglx backends */
126 XVisualInfo * _clutter_backend_x11_get_visual_info (ClutterBackendX11 *backend_x11);
128 void _clutter_x11_select_events (Window xwin);
130 ClutterEventX11 * _clutter_event_x11_new (void);
131 ClutterEventX11 * _clutter_event_x11_copy (ClutterEventX11 *event_x11);
132 void _clutter_event_x11_free (ClutterEventX11 *event_x11);
134 gboolean _clutter_x11_input_device_translate_screen_coord (ClutterInputDevice *device,
139 gdouble *axis_value);
143 #endif /* __CLUTTER_BACKEND_X11_H__ */