2 // Automatically generated from "/usr/share/gir-1.0/ClutterX11-1.0.gir"
5 public import gtk2
.atk
;
7 public import gtk2
.clutter
;
8 alias gtk2
.clutter Clutter
;
9 public import gtk2
.cogl
;
11 public import gtk2
.coglpango
;
12 alias gtk2
.coglpango CoglPango
;
13 public import gtk2
.gl
;
15 public import gtk2
.glib2
;
16 alias gtk2
.glib2 GLib2
;
17 public import gtk2
.gobject2
;
18 alias gtk2
.gobject2 GObject2
;
19 public import gtk2
.gio2
;
21 public import gtk2
.json
;
23 public import gtk2
.pango
;
24 alias gtk2
.pango Pango
;
25 public import gtk2
.pangocairo
;
26 alias gtk2
.pangocairo PangoCairo
;
27 public import gtk2
.pangoft2
;
28 alias gtk2
.pangoft2 PangoFT2
;
29 public import gtk2
.cairo
;
30 alias gtk2
.cairo cairo
;
31 public import gtk2
.fontconfig2
;
32 alias gtk2
.fontconfig2 fontconfig2
;
33 public import gtk2
.freetype22
;
34 alias gtk2
.freetype22 freetype22
;
35 public import gtk2
.xlib2
;
36 alias gtk2
.xlib2 xlib2
;
38 // package: "clutter-x11-1.0";
39 // C header: "clutter/x11/clutter-x11.h";
41 // c:symbol-prefixes: ["clutter_x11"]
42 // c:identifier-prefixes: ["ClutterX11"]
47 // Filter function for X11 native events.
48 // RETURNS: the result of the filtering
49 // <xev>: Native X11 event structure
50 // <cev>: Clutter event structure
51 // <data>: user data passed to the filter function
52 extern (C
) alias Clutter
.X11FilterReturn
function (xlib
.XEvent
* xev
, Clutter
.Event
* cev
, void* data
) FilterFunc
;
54 // Return values for the #ClutterX11FilterFunc function.
55 enum FilterReturn
/* Version 0.6 */ {
60 // The #ClutterX11TexturePixmap structure contains only private data
61 struct TexturePixmap
/* : Clutter.Texture */ /* Version 0.8 */ {
65 Clutter
.Texture parent
;
66 private TexturePixmapPrivate
* priv
;
69 // Creates a new #ClutterX11TexturePixmap which can be used to display the
70 // contents of an X11 Pixmap inside a Clutter scene graph
71 // RETURNS: A new #ClutterX11TexturePixmap
72 static TexturePixmap
* new_() {
73 return clutter_x11_texture_pixmap_new();
76 // Creates a new #ClutterX11TexturePixmap for @pixmap
77 // RETURNS: A new #ClutterX11TexturePixmap bound to the given X Pixmap
78 // <pixmap>: the X Pixmap to which this texture should be bound
79 static TexturePixmap
* new_with_pixmap(xlib
.Pixmap pixmap
) {
80 return clutter_x11_texture_pixmap_new_with_pixmap(pixmap
);
83 // Creates a new #ClutterX11TexturePixmap for @window
84 // RETURNS: A new #ClutterX11TexturePixmap bound to the given X window.
85 // <window>: the X window to which this texture should be bound
86 static TexturePixmap
* new_with_window(xlib
.Window window
) {
87 return clutter_x11_texture_pixmap_new_with_window(window
);
90 // Enables or disables the automatic updates ot @texture in case the backing
91 // pixmap or window is damaged
92 // <setting>: %TRUE to enable automatic updates
93 void set_automatic(int setting
) {
94 clutter_x11_texture_pixmap_set_automatic(&this, setting
);
97 // Sets the X Pixmap to which the texture should be bound.
98 // <pixmap>: the X Pixmap to which the texture should be bound
99 void set_pixmap(xlib
.Pixmap pixmap
) {
100 clutter_x11_texture_pixmap_set_pixmap(&this, pixmap
);
103 // Sets up a suitable pixmap for the window, using the composite and damage
104 // extensions if possible, and then calls
105 // clutter_x11_texture_pixmap_set_pixmap().
107 // If you want to display a window in a #ClutterTexture, you probably want
108 // this function, or its older sister, clutter_glx_texture_pixmap_set_window().
110 // This function has no effect unless the XComposite extension is available.
111 // <window>: the X window to which the texture should be bound
112 // <automatic>: %TRUE for automatic window updates, %FALSE for manual.
113 void set_window(xlib
.Window window
, int automatic
) {
114 clutter_x11_texture_pixmap_set_window(&this, window
, automatic
);
117 // Resets the texture's pixmap from its window, perhaps in response to the
118 // pixmap's invalidation as the window changed size.
120 clutter_x11_texture_pixmap_sync_window(&this);
123 // Performs the actual binding of texture to the current content of
124 // the pixmap. Can be called to update the texture if the pixmap
125 // content has changed.
126 // <x>: the X coordinate of the area to update
127 // <y>: the Y coordinate of the area to update
128 // <width>: the width of the area to update
129 // <height>: the height of the area to update
130 void update_area(int x
, int y
, int width
, int height
) {
131 clutter_x11_texture_pixmap_update_area(&this, x
, y
, width
, height
);
134 // ::queue-damage-redraw is emitted to notify that some sub-region
135 // of the texture has been changed (either by an automatic damage
136 // update or by an explicit call to
137 // clutter_x11_texture_pixmap_update_area). This usually means a
138 // redraw needs to be queued for the actor.
140 // The default handler will queue a clipped redraw in response to
141 // the damage, using the assumption that the pixmap is being painted
142 // to a rectangle covering the transformed allocation of the actor.
143 // If you sub-class and change the paint method so this isn't true
144 // then you must also provide your own damage signal handler to
145 // queue a redraw that blocks this default behaviour.
146 // <x>: The top left x position of the damage region
147 // <y>: The top left y position of the damage region
148 // <width>: The width of the damage region
149 // <height>: The height of the damage region
150 extern (C
) alias static void function (TexturePixmap
* this_
, int x
, int y
, int width
, int height
, void* user_data
=null) signal_queue_damage_redraw
;
152 ulong signal_connect(string name
, CB
)(CB cb
, void* data
=null, ConnectFlags cf
=cast(ConnectFlags
)0) {
153 return super_
.signal_connect
!name(cb
, data
, cf
);
156 ulong signal_connect(string name
:"queue-damage-redraw", CB
:signal_queue_damage_redraw
)(CB cb
, void* data
=null, ConnectFlags cf
=cast(ConnectFlags
)0) {
157 return signal_connect_data(&this, cast(char*)"queue-damage-redraw",
158 cast(GObject2
.Callback
)cb
, data
, null, cf
);
161 // The ::update-area signal is emitted to ask the texture to update its
162 // content from its source pixmap.
163 extern (C
) alias static void function (TexturePixmap
* this_
, int object
, int p0
, int p1
, int p2
, void* user_data
=null) signal_update_area
;
164 ulong signal_connect(string name
:"update-area", CB
:signal_update_area
)(CB cb
, void* data
=null, ConnectFlags cf
=cast(ConnectFlags
)0) {
165 return signal_connect_data(&this, cast(char*)"update-area",
166 cast(GObject2
.Callback
)cb
, data
, null, cf
);
170 // The #ClutterX11TexturePixmapClass structure contains only private data
171 struct TexturePixmapClass
/* Version 0.8 */ {
172 private Clutter
.TextureClass parent_class
;
174 // <x>: the X coordinate of the area to update
175 // <y>: the Y coordinate of the area to update
176 // <width>: the width of the area to update
177 // <height>: the height of the area to update
178 extern (C
) void function (TexturePixmap
* texture
, int x
, int y
, int width
, int height
) update_area
;
181 struct TexturePixmapPrivate
{
184 struct XInputDevice
{
187 enum XInputEventTypes
{
189 KEY_RELEASE_EVENT
= 1,
190 BUTTON_PRESS_EVENT
= 2,
191 BUTTON_RELEASE_EVENT
= 3,
192 MOTION_NOTIFY_EVENT
= 4,
196 // Unintrospectable function: add_filter() / clutter_x11_add_filter()
197 // Adds an event filter function.
198 // <func>: a filter function
199 // <data>: user data to be passed to the filter function, or %NULL
200 static void add_filter(FilterFunc func
, void* data
) {
201 clutter_x11_add_filter(func
, data
);
205 // Disables the internal polling of X11 events in the main loop.
207 // Libraries or applications calling this function will be responsible of
208 // polling all X11 events.
210 // You also must call clutter_x11_handle_event() to let Clutter process
211 // events and maintain its internal state.
213 // <warning>This function can only be called before calling
214 // clutter_init().</warning>
216 // <note>Even with event handling disabled, Clutter will still select
217 // all the events required to maintain its internal state on the stage
218 // Window; compositors using Clutter and input regions to pass events
219 // through to application windows should not rely on an empty input
220 // region, and should instead clear it themselves explicitly using the
221 // XFixes extension.</note>
223 // This function should not be normally used by applications.
224 static void disable_event_retrieval() {
225 clutter_x11_disable_event_retrieval();
229 // Enables the use of the XInput extension if present on connected
230 // XServer and support built into Clutter. XInput allows for multiple
231 // pointing devices to be used.
233 // This function must be called before clutter_init().
235 // Since XInput might not be supported by the X server, you might
236 // want to use clutter_x11_has_xinput() to see if support was enabled.
237 static void enable_xinput() {
238 clutter_x11_enable_xinput();
242 // Retrieves the group for the modifiers set in @event
243 // RETURNS: the group id
244 // <event>: a #ClutterEvent of type %CLUTTER_KEY_PRESS or %CLUTTER_KEY_RELEASE
245 static int event_get_key_group(Clutter
.Event
* event
) {
246 return clutter_x11_event_get_key_group(event
);
250 // Unintrospectable function: get_current_event_time() / clutter_x11_get_current_event_time()
251 // Retrieves the timestamp of the last X11 event processed by
252 // Clutter. This might be different from the timestamp returned
253 // by clutter_get_current_event_time(), as Clutter may synthesize
254 // or throttle events.
255 // RETURNS: a timestamp, in milliseconds
256 static xlib
.Time
get_current_event_time() {
257 return clutter_x11_get_current_event_time();
261 // Retrieves the pointer to the default display.
262 // RETURNS: the default display
263 static xlib
.Display
* get_default_display() {
264 return clutter_x11_get_default_display();
268 // Gets the number of the default X Screen object.
269 // RETURNS: the number of the default screen
270 static int get_default_screen() {
271 return clutter_x11_get_default_screen();
275 // Retrieves a pointer to the list of input devices
279 // pointer to the internal list of input devices; the returned list is
280 // owned by Clutter and should not be modified or freed
282 static GLib2
.SList
* get_input_devices() {
283 return clutter_x11_get_input_devices();
287 // Unintrospectable function: get_root_window() / clutter_x11_get_root_window()
288 // Retrieves the root window.
289 // RETURNS: the id of the root window
290 static xlib
.Window
get_root_window() {
291 return clutter_x11_get_root_window();
295 // Gets the stage for a particular X window.
297 // does not exist for the window
298 // RETURNS: A #ClutterStage, or% NULL if a stage
299 // <win>: an X Window ID
300 static Clutter
.Stage
* get_stage_from_window(xlib
.Window win
) {
301 return clutter_x11_get_stage_from_window(win
);
305 // Unintrospectable function: get_stage_visual() / clutter_x11_get_stage_visual()
306 // Returns an XVisualInfo suitable for creating a foreign window for the given
307 // stage. NOTE: It doesn't do as the name may suggest, which is return the
308 // XVisualInfo that was used to create an existing window for the given stage.
310 // XXX: It might be best to deprecate this function and replace with something
311 // along the lines of clutter_backend_x11_get_foreign_visual () or perhaps
312 // clutter_stage_x11_get_foreign_visual ()
314 // foreign stage. Use XFree() to free the returned value instead
315 // RETURNS: An XVisualInfo suitable for creating a
316 // <stage>: a #ClutterStage
317 static xlib
.XVisualInfo
* /*new*/ get_stage_visual(Clutter
.Stage
* stage
) {
318 return clutter_x11_get_stage_visual(stage
);
322 // Unintrospectable function: get_stage_window() / clutter_x11_get_stage_window()
323 // Gets the stages X Window.
324 // RETURNS: An XID for the stage window.
325 // <stage>: a #ClutterStage
326 static xlib
.Window
get_stage_window(Clutter
.Stage
* stage
) {
327 return clutter_x11_get_stage_window(stage
);
331 // Retrieves whether the Clutter X11 backend is using ARGB visuals by default
332 // RETURNS: %TRUE if ARGB visuals are queried by default
333 static int get_use_argb_visual() {
334 return clutter_x11_get_use_argb_visual();
338 // Unintrospectable function: get_visual_info() / clutter_x11_get_visual_info()
339 // Retrieves the <structname>XVisualInfo</structname> used by the Clutter X11
342 // <varname>None</varname>. The returned value should be freed using XFree()
344 // RETURNS: a <structname>XVisualInfo</structname>, or
345 static xlib
.XVisualInfo
* /*new*/ get_visual_info() {
346 return clutter_x11_get_visual_info();
350 // This function processes a single X event; it can be used to hook
351 // into external X11 event processing (for example, a GDK filter
354 // If clutter_x11_disable_event_retrieval() has been called, you must
355 // let this function process events to update Clutter's internal state.
357 // indicates that Clutter has internally handled the event and the
358 // caller should do no further processing. %CLUTTER_X11_FILTER_CONTINUE
359 // indicates that Clutter is either not interested in the event,
360 // or has used the event to update internal state without taking
361 // any exclusive action. %CLUTTER_X11_FILTER_TRANSLATE will not
363 // RETURNS: #ClutterX11FilterReturn. %CLUTTER_X11_FILTER_REMOVE
364 // <xevent>: pointer to XEvent structure
365 static Clutter
.X11FilterReturn
handle_event(xlib
.XEvent
* xevent
) {
366 return clutter_x11_handle_event(xevent
);
370 // Retrieves whether Clutter is running on an X11 server with the
371 // XComposite extension
372 // RETURNS: %TRUE if the XComposite extension is available
373 static int has_composite_extension() {
374 return clutter_x11_has_composite_extension();
378 // Queries the X11 backend to check if event collection has been disabled.
379 // RETURNS: TRUE if event retrival has been disabled. FALSE otherwise.
380 static int has_event_retrieval() {
381 return clutter_x11_has_event_retrieval();
385 // Gets whether Clutter has XInput support.
387 // and XInput support is available at run time.
388 // RETURNS: %TRUE if Clutter was compiled with XInput support
389 static int has_xinput() {
390 return clutter_x11_has_xinput();
394 // Unintrospectable function: remove_filter() / clutter_x11_remove_filter()
395 // Removes the given filter function.
396 // <func>: a filter function
397 // <data>: user data to be passed to the filter function, or %NULL
398 static void remove_filter(FilterFunc func
, void* data
) {
399 clutter_x11_remove_filter(func
, data
);
403 // Sets the display connection Clutter should use; must be called
404 // before clutter_init(), clutter_init_with_args() or other functions
405 // pertaining Clutter's initialization process.
407 // If you are parsing the command line arguments by retrieving Clutter's
408 // #GOptionGroup with clutter_get_option_group() and calling
409 // g_option_context_parse() yourself, you should also call
410 // clutter_x11_set_display() before g_option_context_parse().
411 // <xdpy>: pointer to a X display connection.
412 static void set_display(xlib
.Display
* xdpy
) {
413 clutter_x11_set_display(xdpy
);
417 // Target the #ClutterStage to use an existing external X Window
418 // RETURNS: %TRUE if foreign window is valid
419 // <stage>: a #ClutterStage
420 // <xwindow>: an existing X Window id
421 static int set_stage_foreign(Clutter
.Stage
* stage
, xlib
.Window xwindow
) {
422 return clutter_x11_set_stage_foreign(stage
, xwindow
);
426 // Sets whether the Clutter X11 backend should request ARGB visuals by default
429 // By default, Clutter requests RGB visuals.
431 // <note>If no ARGB visuals are found, the X11 backend will fall back to
432 // requesting a RGB visual instead.</note>
434 // ARGB visuals are required for the #ClutterStage:use-alpha property to work.
436 // <note>This function can only be called once, and before clutter_init() is
438 // <use_argb>: %TRUE if ARGB visuals should be requested by default
439 static void set_use_argb_visual(int use_argb
) {
440 clutter_x11_set_use_argb_visual(use_argb
);
443 // Traps every X error until clutter_x11_untrap_x_errors() is called.
444 static void trap_x_errors() {
445 clutter_x11_trap_x_errors();
449 // Removes the X error trap and returns the current status.
450 // RETURNS: the trapped error code, or 0 for success
451 static int untrap_x_errors() {
452 return clutter_x11_untrap_x_errors();
459 TexturePixmap
* clutter_x11_texture_pixmap_new();
460 TexturePixmap
* clutter_x11_texture_pixmap_new_with_pixmap(xlib
.Pixmap pixmap
);
461 TexturePixmap
* clutter_x11_texture_pixmap_new_with_window(xlib
.Window window
);
462 void clutter_x11_texture_pixmap_set_automatic(TexturePixmap
* this_
, int setting
);
463 void clutter_x11_texture_pixmap_set_pixmap(TexturePixmap
* this_
, xlib
.Pixmap pixmap
);
464 void clutter_x11_texture_pixmap_set_window(TexturePixmap
* this_
, xlib
.Window window
, int automatic
);
465 void clutter_x11_texture_pixmap_sync_window(TexturePixmap
* this_
);
466 void clutter_x11_texture_pixmap_update_area(TexturePixmap
* this_
, int x
, int y
, int width
, int height
);
467 void clutter_x11_add_filter(FilterFunc func
, void* data
);
468 void clutter_x11_disable_event_retrieval();
469 void clutter_x11_enable_xinput();
470 int clutter_x11_event_get_key_group(Clutter
.Event
* event
);
471 xlib
.Time
clutter_x11_get_current_event_time();
472 xlib
.Display
* clutter_x11_get_default_display();
473 int clutter_x11_get_default_screen();
474 GLib2
.SList
* clutter_x11_get_input_devices();
475 xlib
.Window
clutter_x11_get_root_window();
476 Clutter
.Stage
* clutter_x11_get_stage_from_window(xlib
.Window win
);
477 xlib
.XVisualInfo
* /*new*/ clutter_x11_get_stage_visual(Clutter
.Stage
* stage
);
478 xlib
.Window
clutter_x11_get_stage_window(Clutter
.Stage
* stage
);
479 int clutter_x11_get_use_argb_visual();
480 xlib
.XVisualInfo
* /*new*/ clutter_x11_get_visual_info();
481 Clutter
.X11FilterReturn
clutter_x11_handle_event(xlib
.XEvent
* xevent
);
482 int clutter_x11_has_composite_extension();
483 int clutter_x11_has_event_retrieval();
484 int clutter_x11_has_xinput();
485 void clutter_x11_remove_filter(FilterFunc func
, void* data
);
486 void clutter_x11_set_display(xlib
.Display
* xdpy
);
487 int clutter_x11_set_stage_foreign(Clutter
.Stage
* stage
, xlib
.Window xwindow
);
488 void clutter_x11_set_use_argb_visual(int use_argb
);
489 void clutter_x11_trap_x_errors();
490 int clutter_x11_untrap_x_errors();