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"
31 #include "clutter-backend-private.h"
32 #include "clutter-keymap-x11.h"
33 #include "xsettings/xsettings-client.h"
37 #define CLUTTER_TYPE_BACKEND_X11 (clutter_backend_x11_get_type ())
38 #define CLUTTER_BACKEND_X11(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BACKEND_X11, ClutterBackendX11))
39 #define CLUTTER_IS_BACKEND_X11(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BACKEND_X11))
40 #define CLUTTER_BACKEND_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND_X11, ClutterBackendX11Class))
41 #define CLUTTER_IS_BACKEND_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND_X11))
42 #define CLUTTER_BACKEND_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND_X11, ClutterBackendX11Class))
44 typedef struct _ClutterBackendX11 ClutterBackendX11;
45 typedef struct _ClutterBackendX11Class ClutterBackendX11Class;
47 typedef struct _ClutterX11EventFilter
49 ClutterX11FilterFunc func;
52 } ClutterX11EventFilter;
54 struct _ClutterBackendX11
56 ClutterBackend parent_instance;
65 GSource *event_source;
66 GSList *event_filters;
70 Atom atom_NET_WM_PING;
71 Atom atom_NET_WM_STATE;
72 Atom atom_NET_WM_STATE_FULLSCREEN;
73 Atom atom_NET_WM_USER_TIME;
74 Atom atom_WM_PROTOCOLS;
75 Atom atom_WM_DELETE_WINDOW;
77 Atom atom_XEMBED_INFO;
78 Atom atom_NET_WM_NAME;
79 Atom atom_UTF8_STRING;
82 int event_types[CLUTTER_X11_XINPUT_LAST_EVENT];
87 ClutterDeviceManager *device_manager;
89 XSettingsClient *xsettings;
90 Window xsettings_xwin;
92 ClutterKeymapX11 *keymap;
95 gboolean have_xkb_autorepeat;
98 struct _ClutterBackendX11Class
100 ClutterBackendClass parent_class;
103 * To support foreign stage windows the we need a way to ask for an
104 * XVisualInfo that may be used by toolkits to create an XWindow, and this
105 * may need to be handled differently for different backends.
107 XVisualInfo *(* get_visual_info) (ClutterBackendX11 *backend);
110 * Different X11 backends may care about some special events so they all have
111 * a chance to intercept them.
113 gboolean (*handle_event) (ClutterBackendX11 *backend,
117 /* platform-specific event data */
118 typedef struct _ClutterEventX11 ClutterEventX11;
120 void _clutter_backend_x11_events_init (ClutterBackend *backend);
121 void _clutter_backend_x11_events_uninit (ClutterBackend *backend);
123 GType clutter_backend_x11_get_type (void) G_GNUC_CONST;
125 /* Private to glx/eglx backends */
127 clutter_backend_x11_pre_parse (ClutterBackend *backend,
131 clutter_backend_x11_post_parse (ClutterBackend *backend,
135 clutter_backend_x11_init_stage (ClutterBackend *backend,
139 clutter_backend_x11_get_stage (ClutterBackend *backend);
142 clutter_backend_x11_add_options (ClutterBackend *backend,
143 GOptionGroup *group);
146 clutter_backend_x11_get_features (ClutterBackend *backend);
149 clutter_backend_x11_get_visual_info (ClutterBackendX11 *backend_x11);
152 _clutter_x11_get_device_for_xid (XID id);
155 _clutter_x11_select_events (Window xwin);
158 _clutter_event_x11_new (void);
161 _clutter_event_x11_copy (ClutterEventX11 *event_x11);
164 _clutter_event_x11_free (ClutterEventX11 *event_x11);
168 #endif /* __CLUTTER_BACKEND_X11_H__ */