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
.freetype2
;
34 alias gtk2
.freetype2 freetype2
;
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"]
48 // Filter function for X11 native events.
49 // RETURNS: the result of the filtering
50 // <xev>: Native X11 event structure
51 // <cev>: Clutter event structure
52 // <data>: user data passed to the filter function
53 extern (C
) alias Clutter
.X11FilterReturn
function (xlib
.XEvent
* xev
, Clutter
.Event
* cev
, void* data
) nothrow FilterFunc
;
55 // Return values for the #ClutterX11FilterFunc function.
56 enum FilterReturn
/* Version 0.6 */ {
61 // The #ClutterX11TexturePixmap structure contains only private data
62 struct TexturePixmap
/* : Clutter.Texture */ /* Version 0.8 */ {
63 mixin Atk
.ImplementorIface
.__interface__
;
64 mixin Clutter
.Animatable
.__interface__
;
65 mixin Clutter
.Container
.__interface__
;
66 mixin Clutter
.Scriptable
.__interface__
;
70 Clutter
.Texture parent
;
71 private TexturePixmapPrivate
* priv
;
75 // Creates a new #ClutterX11TexturePixmap which can be used to display the
76 // contents of an X11 Pixmap inside a Clutter scene graph
77 // RETURNS: A new #ClutterX11TexturePixmap
78 static TexturePixmap
* new_()() nothrow {
79 return clutter_x11_texture_pixmap_new();
81 static auto opCall()() {
82 return clutter_x11_texture_pixmap_new();
86 // Creates a new #ClutterX11TexturePixmap for @pixmap
87 // RETURNS: A new #ClutterX11TexturePixmap bound to the given X Pixmap
88 // <pixmap>: the X Pixmap to which this texture should be bound
89 static TexturePixmap
* new_with_pixmap()(xlib
.Pixmap pixmap
) nothrow {
90 return clutter_x11_texture_pixmap_new_with_pixmap(pixmap
);
92 static auto opCall()(xlib
.Pixmap pixmap
) {
93 return clutter_x11_texture_pixmap_new_with_pixmap(pixmap
);
97 // Creates a new #ClutterX11TexturePixmap for @window
98 // RETURNS: A new #ClutterX11TexturePixmap bound to the given X window.
99 // <window>: the X window to which this texture should be bound
100 static TexturePixmap
* new_with_window()(xlib
.Window window
) nothrow {
101 return clutter_x11_texture_pixmap_new_with_window(window
);
103 static auto opCall()(xlib
.Window window
) {
104 return clutter_x11_texture_pixmap_new_with_window(window
);
108 // Enables or disables the automatic updates ot @texture in case the backing
109 // pixmap or window is damaged
110 // <setting>: %TRUE to enable automatic updates
111 void set_automatic()(int setting
) nothrow {
112 clutter_x11_texture_pixmap_set_automatic(&this, setting
);
116 // Sets the X Pixmap to which the texture should be bound.
117 // <pixmap>: the X Pixmap to which the texture should be bound
118 void set_pixmap()(xlib
.Pixmap pixmap
) nothrow {
119 clutter_x11_texture_pixmap_set_pixmap(&this, pixmap
);
123 // Sets up a suitable pixmap for the window, using the composite and damage
124 // extensions if possible, and then calls
125 // clutter_x11_texture_pixmap_set_pixmap().
127 // If you want to display a window in a #ClutterTexture, you probably want
128 // this function, or its older sister, clutter_glx_texture_pixmap_set_window().
130 // This function has no effect unless the XComposite extension is available.
131 // <window>: the X window to which the texture should be bound
132 // <automatic>: %TRUE for automatic window updates, %FALSE for manual.
133 void set_window()(xlib
.Window window
, int automatic
) nothrow {
134 clutter_x11_texture_pixmap_set_window(&this, window
, automatic
);
138 // Resets the texture's pixmap from its window, perhaps in response to the
139 // pixmap's invalidation as the window changed size.
140 void sync_window()() nothrow {
141 clutter_x11_texture_pixmap_sync_window(&this);
145 // Performs the actual binding of texture to the current content of
146 // the pixmap. Can be called to update the texture if the pixmap
147 // content has changed.
148 // <x>: the X coordinate of the area to update
149 // <y>: the Y coordinate of the area to update
150 // <width>: the width of the area to update
151 // <height>: the height of the area to update
152 void update_area()(int x
, int y
, int width
, int height
) nothrow {
153 clutter_x11_texture_pixmap_update_area(&this, x
, y
, width
, height
);
157 // ::queue-damage-redraw is emitted to notify that some sub-region
158 // of the texture has been changed (either by an automatic damage
159 // update or by an explicit call to
160 // clutter_x11_texture_pixmap_update_area). This usually means a
161 // redraw needs to be queued for the actor.
163 // The default handler will queue a clipped redraw in response to
164 // the damage, using the assumption that the pixmap is being painted
165 // to a rectangle covering the transformed allocation of the actor.
166 // If you sub-class and change the paint method so this isn't true
167 // then you must also provide your own damage signal handler to
168 // queue a redraw that blocks this default behaviour.
169 // <x>: The top left x position of the damage region
170 // <y>: The top left y position of the damage region
171 // <width>: The width of the damage region
172 // <height>: The height of the damage region
173 extern (C
) alias static void function (TexturePixmap
* this_
, int x
, int y
, int width
, int height
, void* user_data
=null) nothrow signal_queue_damage_redraw
;
175 ulong signal_connect(string name
, CB
)(CB cb
, void* data
=null, ConnectFlags cf
=cast(ConnectFlags
)0) {
176 return super_
.signal_connect
!name(cb
, data
, cf
);
179 ulong signal_connect(string name
:"queue-damage-redraw", CB
/*:signal_queue_damage_redraw*/)
180 (CB cb
, void* data
=null, ConnectFlags cf
=cast(ConnectFlags
)0)
181 if (is(typeof(cb
)==signal_queue_damage_redraw
)||_ttmm
!(CB
, signal_queue_damage_redraw
)()) {
182 return signal_connect_data
!()(&this, cast(char*)"queue-damage-redraw",
183 cast(GObject2
.Callback
)cb
, data
, null, cf
);
187 // The ::update-area signal is emitted to ask the texture to update its
188 // content from its source pixmap.
189 extern (C
) alias static void function (TexturePixmap
* this_
, int object
, int p0
, int p1
, int p2
, void* user_data
=null) nothrow signal_update_area
;
190 ulong signal_connect(string name
:"update-area", CB
/*:signal_update_area*/)
191 (CB cb
, void* data
=null, ConnectFlags cf
=cast(ConnectFlags
)0)
192 if (is(typeof(cb
)==signal_update_area
)||_ttmm
!(CB
, signal_update_area
)()) {
193 return signal_connect_data
!()(&this, cast(char*)"update-area",
194 cast(GObject2
.Callback
)cb
, data
, null, cf
);
198 // The #ClutterX11TexturePixmapClass structure contains only private data
199 struct TexturePixmapClass
/* Version 0.8 */ {
200 private Clutter
.TextureClass parent_class
;
202 // <x>: the X coordinate of the area to update
203 // <y>: the Y coordinate of the area to update
204 // <width>: the width of the area to update
205 // <height>: the height of the area to update
206 extern (C
) void function (TexturePixmap
* texture
, int x
, int y
, int width
, int height
) nothrow update_area
;
209 struct TexturePixmapPrivate
{
212 struct XInputDevice
{
215 enum XInputEventTypes
{
217 KEY_RELEASE_EVENT
= 1,
218 BUTTON_PRESS_EVENT
= 2,
219 BUTTON_RELEASE_EVENT
= 3,
220 MOTION_NOTIFY_EVENT
= 4,
224 // Unintrospectable function: add_filter() / clutter_x11_add_filter()
226 // Adds an event filter function.
227 // <func>: a filter function
228 // <data>: user data to be passed to the filter function, or %NULL
229 static void add_filter(AT0
)(FilterFunc func
, AT0
/*void*/ data
) nothrow {
230 clutter_x11_add_filter(func
, UpCast
!(void*)(data
));
235 // Disables the internal polling of X11 events in the main loop.
237 // Libraries or applications calling this function will be responsible of
238 // polling all X11 events.
240 // You also must call clutter_x11_handle_event() to let Clutter process
241 // events and maintain its internal state.
243 // <warning>This function can only be called before calling
244 // clutter_init().</warning>
246 // <note>Even with event handling disabled, Clutter will still select
247 // all the events required to maintain its internal state on the stage
248 // Window; compositors using Clutter and input regions to pass events
249 // through to application windows should not rely on an empty input
250 // region, and should instead clear it themselves explicitly using the
251 // XFixes extension.</note>
253 // This function should not be normally used by applications.
254 static void disable_event_retrieval()() nothrow {
255 clutter_x11_disable_event_retrieval();
260 // Enables the use of the XInput extension if present on connected
261 // XServer and support built into Clutter. XInput allows for multiple
262 // pointing devices to be used.
264 // This function must be called before clutter_init().
266 // Since XInput might not be supported by the X server, you might
267 // want to use clutter_x11_has_xinput() to see if support was enabled.
268 static void enable_xinput()() nothrow {
269 clutter_x11_enable_xinput();
274 // Retrieves the group for the modifiers set in @event
275 // RETURNS: the group id
276 // <event>: a #ClutterEvent of type %CLUTTER_KEY_PRESS or %CLUTTER_KEY_RELEASE
277 static int event_get_key_group(AT0
)(AT0
/*Clutter.Event*/ event
) nothrow {
278 return clutter_x11_event_get_key_group(UpCast
!(Clutter
.Event
*)(event
));
282 // Unintrospectable function: get_current_event_time() / clutter_x11_get_current_event_time()
284 // Retrieves the timestamp of the last X11 event processed by
285 // Clutter. This might be different from the timestamp returned
286 // by clutter_get_current_event_time(), as Clutter may synthesize
287 // or throttle events.
288 // RETURNS: a timestamp, in milliseconds
289 static xlib
.Time
get_current_event_time()() nothrow {
290 return clutter_x11_get_current_event_time();
295 // Retrieves the pointer to the default display.
296 // RETURNS: the default display
297 static xlib
.Display
* get_default_display()() nothrow {
298 return clutter_x11_get_default_display();
303 // Gets the number of the default X Screen object.
304 // RETURNS: the number of the default screen
305 static int get_default_screen()() nothrow {
306 return clutter_x11_get_default_screen();
311 // DEPRECATED (v1.2) function: get_input_devices - Use clutter_device_manager_peek_devices() instead
312 // Retrieves a pointer to the list of input devices
316 // pointer to the internal list of input devices; the returned list is
317 // owned by Clutter and should not be modified or freed
319 static GLib2
.SList
* get_input_devices()() nothrow {
320 return clutter_x11_get_input_devices();
324 // Unintrospectable function: get_root_window() / clutter_x11_get_root_window()
326 // Retrieves the root window.
327 // RETURNS: the id of the root window
328 static xlib
.Window
get_root_window()() nothrow {
329 return clutter_x11_get_root_window();
334 // Gets the stage for a particular X window.
336 // does not exist for the window
337 // RETURNS: A #ClutterStage, or% NULL if a stage
338 // <win>: an X Window ID
339 static Clutter
.Stage
* get_stage_from_window()(xlib
.Window win
) nothrow {
340 return clutter_x11_get_stage_from_window(win
);
344 // Unintrospectable function: get_stage_visual() / clutter_x11_get_stage_visual()
346 // DEPRECATED (v1.2) function: get_stage_visual - Use clutter_x11_get_visual_info() instead
347 // Returns an XVisualInfo suitable for creating a foreign window for the given
348 // stage. NOTE: It doesn't do as the name may suggest, which is return the
349 // XVisualInfo that was used to create an existing window for the given stage.
351 // XXX: It might be best to deprecate this function and replace with something
352 // along the lines of clutter_backend_x11_get_foreign_visual () or perhaps
353 // clutter_stage_x11_get_foreign_visual ()
355 // foreign stage. Use XFree() to free the returned value instead
356 // RETURNS: An XVisualInfo suitable for creating a
357 // <stage>: a #ClutterStage
358 static xlib
.XVisualInfo
* /*new*/ get_stage_visual(AT0
)(AT0
/*Clutter.Stage*/ stage
) nothrow {
359 return clutter_x11_get_stage_visual(UpCast
!(Clutter
.Stage
*)(stage
));
363 // Unintrospectable function: get_stage_window() / clutter_x11_get_stage_window()
365 // Gets the stages X Window.
366 // RETURNS: An XID for the stage window.
367 // <stage>: a #ClutterStage
368 static xlib
.Window
get_stage_window(AT0
)(AT0
/*Clutter.Stage*/ stage
) nothrow {
369 return clutter_x11_get_stage_window(UpCast
!(Clutter
.Stage
*)(stage
));
374 // Retrieves whether the Clutter X11 backend is using ARGB visuals by default
375 // RETURNS: %TRUE if ARGB visuals are queried by default
376 static int get_use_argb_visual()() nothrow {
377 return clutter_x11_get_use_argb_visual();
381 // Unintrospectable function: get_visual_info() / clutter_x11_get_visual_info()
383 // Retrieves the <structname>XVisualInfo</structname> used by the Clutter X11
386 // <varname>None</varname>. The returned value should be freed using XFree()
388 // RETURNS: a <structname>XVisualInfo</structname>, or
389 static xlib
.XVisualInfo
* /*new*/ get_visual_info()() nothrow {
390 return clutter_x11_get_visual_info();
395 // This function processes a single X event; it can be used to hook
396 // into external X11 event processing (for example, a GDK filter
399 // If clutter_x11_disable_event_retrieval() has been called, you must
400 // let this function process events to update Clutter's internal state.
402 // indicates that Clutter has internally handled the event and the
403 // caller should do no further processing. %CLUTTER_X11_FILTER_CONTINUE
404 // indicates that Clutter is either not interested in the event,
405 // or has used the event to update internal state without taking
406 // any exclusive action. %CLUTTER_X11_FILTER_TRANSLATE will not
408 // RETURNS: #ClutterX11FilterReturn. %CLUTTER_X11_FILTER_REMOVE
409 // <xevent>: pointer to XEvent structure
410 static Clutter
.X11FilterReturn
handle_event(AT0
)(AT0
/*xlib.XEvent*/ xevent
) nothrow {
411 return clutter_x11_handle_event(UpCast
!(xlib
.XEvent
*)(xevent
));
415 // Retrieves whether Clutter is running on an X11 server with the
416 // XComposite extension
417 // RETURNS: %TRUE if the XComposite extension is available
418 static int has_composite_extension()() nothrow {
419 return clutter_x11_has_composite_extension();
424 // Queries the X11 backend to check if event collection has been disabled.
425 // RETURNS: TRUE if event retrival has been disabled. FALSE otherwise.
426 static int has_event_retrieval()() nothrow {
427 return clutter_x11_has_event_retrieval();
432 // Gets whether Clutter has XInput support.
434 // and XInput support is available at run time.
435 // RETURNS: %TRUE if Clutter was compiled with XInput support
436 static int has_xinput()() nothrow {
437 return clutter_x11_has_xinput();
441 // Unintrospectable function: remove_filter() / clutter_x11_remove_filter()
443 // Removes the given filter function.
444 // <func>: a filter function
445 // <data>: user data to be passed to the filter function, or %NULL
446 static void remove_filter(AT0
)(FilterFunc func
, AT0
/*void*/ data
) nothrow {
447 clutter_x11_remove_filter(func
, UpCast
!(void*)(data
));
452 // Sets the display connection Clutter should use; must be called
453 // before clutter_init(), clutter_init_with_args() or other functions
454 // pertaining Clutter's initialization process.
456 // If you are parsing the command line arguments by retrieving Clutter's
457 // #GOptionGroup with clutter_get_option_group() and calling
458 // g_option_context_parse() yourself, you should also call
459 // clutter_x11_set_display() before g_option_context_parse().
460 // <xdpy>: pointer to a X display connection.
461 static void set_display(AT0
)(AT0
/*xlib.Display*/ xdpy
) nothrow {
462 clutter_x11_set_display(UpCast
!(xlib
.Display
*)(xdpy
));
467 // Target the #ClutterStage to use an existing external X Window
468 // RETURNS: %TRUE if foreign window is valid
469 // <stage>: a #ClutterStage
470 // <xwindow>: an existing X Window id
471 static int set_stage_foreign(AT0
)(AT0
/*Clutter.Stage*/ stage
, xlib
.Window xwindow
) nothrow {
472 return clutter_x11_set_stage_foreign(UpCast
!(Clutter
.Stage
*)(stage
), xwindow
);
477 // Sets whether the Clutter X11 backend should request ARGB visuals by default
480 // By default, Clutter requests RGB visuals.
482 // <note>If no ARGB visuals are found, the X11 backend will fall back to
483 // requesting a RGB visual instead.</note>
485 // ARGB visuals are required for the #ClutterStage:use-alpha property to work.
487 // <note>This function can only be called once, and before clutter_init() is
489 // <use_argb>: %TRUE if ARGB visuals should be requested by default
490 static void set_use_argb_visual()(int use_argb
) nothrow {
491 clutter_x11_set_use_argb_visual(use_argb
);
496 // Traps every X error until clutter_x11_untrap_x_errors() is called.
497 static void trap_x_errors()() nothrow {
498 clutter_x11_trap_x_errors();
503 // Removes the X error trap and returns the current status.
504 // RETURNS: the trapped error code, or 0 for success
505 static int untrap_x_errors()() nothrow {
506 return clutter_x11_untrap_x_errors();
513 TexturePixmap
* clutter_x11_texture_pixmap_new() nothrow;
514 TexturePixmap
* clutter_x11_texture_pixmap_new_with_pixmap(xlib
.Pixmap pixmap
) nothrow;
515 TexturePixmap
* clutter_x11_texture_pixmap_new_with_window(xlib
.Window window
) nothrow;
516 void clutter_x11_texture_pixmap_set_automatic(TexturePixmap
* this_
, int setting
) nothrow;
517 void clutter_x11_texture_pixmap_set_pixmap(TexturePixmap
* this_
, xlib
.Pixmap pixmap
) nothrow;
518 void clutter_x11_texture_pixmap_set_window(TexturePixmap
* this_
, xlib
.Window window
, int automatic
) nothrow;
519 void clutter_x11_texture_pixmap_sync_window(TexturePixmap
* this_
) nothrow;
520 void clutter_x11_texture_pixmap_update_area(TexturePixmap
* this_
, int x
, int y
, int width
, int height
) nothrow;
521 void clutter_x11_add_filter(FilterFunc func
, void* data
) nothrow;
522 void clutter_x11_disable_event_retrieval() nothrow;
523 void clutter_x11_enable_xinput() nothrow;
524 int clutter_x11_event_get_key_group(Clutter
.Event
* event
) nothrow;
525 xlib
.Time
clutter_x11_get_current_event_time() nothrow;
526 xlib
.Display
* clutter_x11_get_default_display() nothrow;
527 int clutter_x11_get_default_screen() nothrow;
528 GLib2
.SList
* clutter_x11_get_input_devices() nothrow;
529 xlib
.Window
clutter_x11_get_root_window() nothrow;
530 Clutter
.Stage
* clutter_x11_get_stage_from_window(xlib
.Window win
) nothrow;
531 xlib
.XVisualInfo
* /*new*/ clutter_x11_get_stage_visual(Clutter
.Stage
* stage
) nothrow;
532 xlib
.Window
clutter_x11_get_stage_window(Clutter
.Stage
* stage
) nothrow;
533 int clutter_x11_get_use_argb_visual() nothrow;
534 xlib
.XVisualInfo
* /*new*/ clutter_x11_get_visual_info() nothrow;
535 Clutter
.X11FilterReturn
clutter_x11_handle_event(xlib
.XEvent
* xevent
) nothrow;
536 int clutter_x11_has_composite_extension() nothrow;
537 int clutter_x11_has_event_retrieval() nothrow;
538 int clutter_x11_has_xinput() nothrow;
539 void clutter_x11_remove_filter(FilterFunc func
, void* data
) nothrow;
540 void clutter_x11_set_display(xlib
.Display
* xdpy
) nothrow;
541 int clutter_x11_set_stage_foreign(Clutter
.Stage
* stage
, xlib
.Window xwindow
) nothrow;
542 void clutter_x11_set_use_argb_visual(int use_argb
) nothrow;
543 void clutter_x11_trap_x_errors() nothrow;
544 int clutter_x11_untrap_x_errors() nothrow;