![]() |
![]() |
![]() |
Clutter 0.7.6 Reference Manual | ![]() |
---|---|---|---|---|
void clutter_x11_set_display (Display *xdpy); void clutter_x11_disable_event_retrieval (void); ClutterStage* clutter_x11_get_stage_from_window (Window win); ClutterX11FilterReturn clutter_x11_handle_event (XEvent *xevent); Display* clutter_x11_get_default_display (void); int clutter_x11_get_default_screen (void); Window clutter_x11_get_root_window (void); XVisualInfo* clutter_x11_get_stage_visual (ClutterStage *stage); Window clutter_x11_get_stage_window (ClutterStage *stage); gboolean clutter_x11_set_stage_foreign (ClutterStage *stage, Window xwindow); void clutter_x11_trap_x_errors (void); gint clutter_x11_untrap_x_errors (void); ClutterX11FilterReturn (*ClutterX11FilterFunc) (XEvent *xev, ClutterEvent *cev, gpointer data); enum ClutterX11FilterReturn; void clutter_x11_add_filter (ClutterX11FilterFunc func, gpointer data); void clutter_x11_remove_filter (ClutterX11FilterFunc func, gpointer data); enum ClutterX11InputDeviceType; ClutterX11XInputDevice; enum ClutterX11XInputEventTypes; ClutterX11InputDeviceType clutter_x11_get_input_device_type (ClutterX11XInputDevice *device); GSList* clutter_x11_get_input_devices (void); gboolean clutter_x11_has_xinput (void);
The X11 backend for Clutter provides some specific API, allowing integration with the Xlibs API for embedding and manipulating the stage window, or for trapping X errors.
The ClutterX11 API is available since Clutter 0.6
void clutter_x11_set_display (Display *xdpy);
Sets the display connection clutter should use; must be called
before clutter_init()
.
|
pointer to a X display connection. |
Since 0.8
void clutter_x11_disable_event_retrieval (void);
Disables retrieval of X events in the main loop. Use to create event-less canvas or in conjunction with clutter_x11_handle_event.
This function can only be called before calling clutter_init()
.
Since 0.8
ClutterStage* clutter_x11_get_stage_from_window (Window win);
Gets the stage for a particular X window.
|
an X Window ID |
Returns : |
The stage or NULL if a stage does not exist for the window. |
Since 0.8
ClutterX11FilterReturn clutter_x11_handle_event (XEvent *xevent);
This function processes a single X event; it can be used to hook into external X event retrieval (for example that done by GDK).
|
pointer to XEvent structure |
Returns : |
ClutterX11FilterReturn indicating what the caller should do with the original event. |
Since 0.8
Display* clutter_x11_get_default_display (void);
Retrieves the pointer to the default display.
Returns : |
the default display |
Since 0.6
int clutter_x11_get_default_screen (void);
Gets the number of the default X Screen object.
Returns : |
the number of the default screen |
Since 0.6
Window clutter_x11_get_root_window (void);
Retrieves the root window.
Returns : |
the id of the root window |
Since 0.6
XVisualInfo* clutter_x11_get_stage_visual (ClutterStage *stage);
Returns the stage XVisualInfo
|
a ClutterStage |
Returns : |
The XVisualInfo for the stage. |
Since 0.4
Window clutter_x11_get_stage_window (ClutterStage *stage);
Gets the stages X Window.
|
a ClutterStage |
Returns : |
An XID for the stage window. |
Since 0.4
gboolean clutter_x11_set_stage_foreign (ClutterStage *stage, Window xwindow);
Target the ClutterStage to use an existing external X Window
|
a ClutterStage |
|
an existing X Window id |
Returns : |
TRUE if foreign window is valid
|
Since 0.4
void clutter_x11_trap_x_errors (void);
Traps every X error until clutter_x11_untrap_x_errors()
is called.
Since 0.6
gint clutter_x11_untrap_x_errors (void);
Removes the X error trap and returns the current status.
Returns : |
the trapped error code, or 0 for success |
Since 0.4
ClutterX11FilterReturn (*ClutterX11FilterFunc) (XEvent *xev, ClutterEvent *cev, gpointer data);
Filter function for X11 native events.
|
Native X11 event structure |
|
Clutter event structure |
|
user data passed to the filter function |
Returns : |
the result of the filtering |
Since 0.6
typedef enum { CLUTTER_X11_FILTER_CONTINUE, CLUTTER_X11_FILTER_TRANSLATE, CLUTTER_X11_FILTER_REMOVE } ClutterX11FilterReturn;
Return values for the ClutterX11FilterFunc function.
The event was not handled, continues the processing | |
Native event translated into a Clutter event, stops the processing | |
Remove the event, stops the processing |
Since 0.6
void clutter_x11_add_filter (ClutterX11FilterFunc func, gpointer data);
Adds an event filter function.
|
a filter function |
|
user data to be passed to the filter function, or NULL
|
Since 0.6
void clutter_x11_remove_filter (ClutterX11FilterFunc func, gpointer data);
Removes the given filter function.
|
a filter function |
|
user data to be passed to the filter function, or NULL
|
Since 0.6
typedef enum { CLUTTER_X11_XINPUT_POINTER_DEVICE, CLUTTER_X11_XINPUT_KEYBOARD_DEVICE, CLUTTER_X11_XINPUT_EXTENSION_DEVICE } ClutterX11InputDeviceType;
typedef enum { CLUTTER_X11_XINPUT_KEY_PRESS_EVENT = 0, CLUTTER_X11_XINPUT_KEY_RELEASE_EVENT, CLUTTER_X11_XINPUT_BUTTON_PRESS_EVENT, CLUTTER_X11_XINPUT_BUTTON_RELEASE_EVENT, CLUTTER_X11_XINPUT_MOTION_NOTIFY_EVENT, CLUTTER_X11_XINPUT_LAST_EVENT } ClutterX11XInputEventTypes;
ClutterX11InputDeviceType clutter_x11_get_input_device_type (ClutterX11XInputDevice *device);
|
|
Returns : |