| 1 |
/* |
| 2 |
* Clutter. |
| 3 |
* |
| 4 |
* An OpenGL based 'interactive canvas' library. |
| 5 |
* |
| 6 |
* Authored By Matthew Allum <[email protected]> |
| 7 |
* |
| 8 |
* Copyright (C) 2006 OpenedHand |
| 9 |
* |
| 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. |
| 14 |
* |
| 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. |
| 19 |
* |
| 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/>. |
| 22 |
* |
| 23 |
* |
| 24 |
*/ |
| 25 |
|
| 26 |
/** |
| 27 |
* SECTION:clutter-x11 |
| 28 |
* @short_description: X11 specific API |
| 29 |
* |
| 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. |
| 33 |
* |
| 34 |
* The ClutterX11 API is available since Clutter 0.6 |
| 35 |
*/ |
| 36 |
|
| 37 |
#ifndef __CLUTTER_X11_H__ |
| 38 |
#define __CLUTTER_X11_H__ |
| 39 |
|
| 40 |
#include <glib.h> |
| 41 |
#include <X11/Xlib.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> |
| 46 |
|
| 47 |
G_BEGIN_DECLS |
| 48 |
|
| 49 |
/** |
| 50 |
* ClutterX11FilterReturn: |
| 51 |
* @CLUTTER_X11_FILTER_CONTINUE: The event was not handled, continues the |
| 52 |
* processing |
| 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 |
| 56 |
* |
| 57 |
* Return values for the #ClutterX11FilterFunc function. |
| 58 |
* |
| 59 |
* Since: 0.6 |
| 60 |
*/ |
| 61 |
typedef enum { |
| 62 |
CLUTTER_X11_FILTER_CONTINUE, |
| 63 |
CLUTTER_X11_FILTER_TRANSLATE, |
| 64 |
CLUTTER_X11_FILTER_REMOVE |
| 65 |
} ClutterX11FilterReturn; |
| 66 |
|
| 67 |
CLUTTER_AVAILABLE_IN_ALL |
| 68 |
GType clutter_x11_filter_return_get_type (void) G_GNUC_CONST; |
| 69 |
|
| 70 |
/* |
| 71 |
* This is not used any more |
| 72 |
*/ |
| 73 |
typedef struct _ClutterX11XInputDevice ClutterX11XInputDevice; |
| 74 |
|
| 75 |
/** |
| 76 |
* ClutterX11FilterFunc: |
| 77 |
* @xev: Native X11 event structure |
| 78 |
* @cev: Clutter event structure |
| 79 |
* @data: (closure): user data passed to the filter function |
| 80 |
* |
| 81 |
* Filter function for X11 native events. |
| 82 |
* |
| 83 |
* Return value: the result of the filtering |
| 84 |
* |
| 85 |
* Since: 0.6 |
| 86 |
*/ |
| 87 |
typedef ClutterX11FilterReturn (*ClutterX11FilterFunc) (XEvent *xev, |
| 88 |
ClutterEvent *cev, |
| 89 |
gpointer data); |
| 90 |
|
| 91 |
CLUTTER_AVAILABLE_IN_ALL |
| 92 |
void clutter_x11_trap_x_errors (void); |
| 93 |
CLUTTER_AVAILABLE_IN_ALL |
| 94 |
gint clutter_x11_untrap_x_errors (void); |
| 95 |
|
| 96 |
CLUTTER_AVAILABLE_IN_ALL |
| 97 |
Display *clutter_x11_get_default_display (void); |
| 98 |
CLUTTER_AVAILABLE_IN_ALL |
| 99 |
int clutter_x11_get_default_screen (void); |
| 100 |
CLUTTER_AVAILABLE_IN_ALL |
| 101 |
Window clutter_x11_get_root_window (void); |
| 102 |
CLUTTER_AVAILABLE_IN_ALL |
| 103 |
XVisualInfo *clutter_x11_get_visual_info (void); |
| 104 |
CLUTTER_AVAILABLE_IN_ALL |
| 105 |
void clutter_x11_set_display (Display * xdpy); |
| 106 |
|
| 107 |
CLUTTER_DEPRECATED_FOR(clutter_x11_get_visual_info) |
| 108 |
XVisualInfo *clutter_x11_get_stage_visual (ClutterStage *stage); |
| 109 |
|
| 110 |
CLUTTER_AVAILABLE_IN_ALL |
| 111 |
Window clutter_x11_get_stage_window (ClutterStage *stage); |
| 112 |
CLUTTER_AVAILABLE_IN_ALL |
| 113 |
gboolean clutter_x11_set_stage_foreign (ClutterStage *stage, |
| 114 |
Window xwindow); |
| 115 |
|
| 116 |
CLUTTER_AVAILABLE_IN_ALL |
| 117 |
void clutter_x11_add_filter (ClutterX11FilterFunc func, |
| 118 |
gpointer data); |
| 119 |
CLUTTER_AVAILABLE_IN_ALL |
| 120 |
void clutter_x11_remove_filter (ClutterX11FilterFunc func, |
| 121 |
gpointer data); |
| 122 |
|
| 123 |
CLUTTER_AVAILABLE_IN_ALL |
| 124 |
ClutterX11FilterReturn clutter_x11_handle_event (XEvent *xevent); |
| 125 |
|
| 126 |
CLUTTER_AVAILABLE_IN_ALL |
| 127 |
void clutter_x11_disable_event_retrieval (void); |
| 128 |
CLUTTER_AVAILABLE_IN_ALL |
| 129 |
gboolean clutter_x11_has_event_retrieval (void); |
| 130 |
|
| 131 |
CLUTTER_AVAILABLE_IN_ALL |
| 132 |
ClutterStage *clutter_x11_get_stage_from_window (Window win); |
| 133 |
|
| 134 |
CLUTTER_DEPRECATED_FOR(clutter_device_manager_peek_devices) |
| 135 |
const GSList* clutter_x11_get_input_devices (void); |
| 136 |
|
| 137 |
CLUTTER_DEPRECATED_IN_1_14 |
| 138 |
void clutter_x11_enable_xinput (void); |
| 139 |
CLUTTER_AVAILABLE_IN_ALL |
| 140 |
gboolean clutter_x11_has_xinput (void); |
| 141 |
|
| 142 |
CLUTTER_AVAILABLE_IN_ALL |
| 143 |
gboolean clutter_x11_has_composite_extension (void); |
| 144 |
|
| 145 |
CLUTTER_AVAILABLE_IN_ALL |
| 146 |
void clutter_x11_set_use_argb_visual (gboolean use_argb); |
| 147 |
CLUTTER_AVAILABLE_IN_ALL |
| 148 |
gboolean clutter_x11_get_use_argb_visual (void); |
| 149 |
|
| 150 |
CLUTTER_AVAILABLE_IN_1_22 |
| 151 |
void clutter_x11_set_use_stereo_stage (gboolean use_stereo); |
| 152 |
CLUTTER_AVAILABLE_IN_1_22 |
| 153 |
gboolean clutter_x11_get_use_stereo_stage (void); |
| 154 |
|
| 155 |
CLUTTER_AVAILABLE_IN_ALL |
| 156 |
Time clutter_x11_get_current_event_time (void); |
| 157 |
|
| 158 |
CLUTTER_AVAILABLE_IN_ALL |
| 159 |
gint clutter_x11_event_get_key_group (const ClutterEvent *event); |
| 160 |
|
| 161 |
CLUTTER_AVAILABLE_IN_ALL |
| 162 |
guint clutter_x11_event_sequence_get_touch_detail (const ClutterEventSequence *sequence); |
| 163 |
|
| 164 |
G_END_DECLS |
| 165 |
|
| 166 |
#endif /* __CLUTTER_X11_H__ */ |