Mx support.
[girtod.git] / gtk2 / clutterx11.d
blob16d0714d887c5bb0837e2d69e52d65d25f6bd993
1 // *** DO NOT EDIT ***
2 // Automatically generated from "/usr/share/gir-1.0/ClutterX11-1.0.gir"
4 module ClutterX11;
5 public import gtk2.atk;
6 alias gtk2.atk Atk;
7 public import gtk2.clutter;
8 alias gtk2.clutter Clutter;
9 public import gtk2.cogl;
10 alias gtk2.cogl Cogl;
11 public import gtk2.coglpango;
12 alias gtk2.coglpango CoglPango;
13 public import gtk2.gl;
14 alias gtk2.gl 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;
20 alias gtk2.gio2 Gio2;
21 public import gtk2.json;
22 alias gtk2.json 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"]
44 // module ClutterX11;
47 // VERSION: 0.6
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) FilterFunc;
55 // Return values for the #ClutterX11FilterFunc function.
56 enum FilterReturn /* Version 0.6 */ {
57 CONTINUE = 0,
58 TRANSLATE = 1,
59 REMOVE = 2
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.Scriptable.__interface__;
66 alias parent this;
67 alias parent super_;
68 alias parent texture;
69 Clutter.Texture parent;
70 private TexturePixmapPrivate* priv;
73 // VERSION: 0.8
74 // Creates a new #ClutterX11TexturePixmap which can be used to display the
75 // contents of an X11 Pixmap inside a Clutter scene graph
76 // RETURNS: A new #ClutterX11TexturePixmap
77 static TexturePixmap* new_()() {
78 return clutter_x11_texture_pixmap_new();
81 // VERSION: 0.8
82 // Creates a new #ClutterX11TexturePixmap for @pixmap
83 // RETURNS: A new #ClutterX11TexturePixmap bound to the given X Pixmap
84 // <pixmap>: the X Pixmap to which this texture should be bound
85 static TexturePixmap* new_with_pixmap()(xlib.Pixmap pixmap) {
86 return clutter_x11_texture_pixmap_new_with_pixmap(pixmap);
89 // VERSION: 0.8
90 // Creates a new #ClutterX11TexturePixmap for @window
91 // RETURNS: A new #ClutterX11TexturePixmap bound to the given X window.
92 // <window>: the X window to which this texture should be bound
93 static TexturePixmap* new_with_window()(xlib.Window window) {
94 return clutter_x11_texture_pixmap_new_with_window(window);
97 // VERSION: 0.8
98 // Enables or disables the automatic updates ot @texture in case the backing
99 // pixmap or window is damaged
100 // <setting>: %TRUE to enable automatic updates
101 void set_automatic()(int setting) {
102 clutter_x11_texture_pixmap_set_automatic(&this, setting);
105 // VERSION: 0.8
106 // Sets the X Pixmap to which the texture should be bound.
107 // <pixmap>: the X Pixmap to which the texture should be bound
108 void set_pixmap()(xlib.Pixmap pixmap) {
109 clutter_x11_texture_pixmap_set_pixmap(&this, pixmap);
112 // VERSION: 0.8
113 // Sets up a suitable pixmap for the window, using the composite and damage
114 // extensions if possible, and then calls
115 // clutter_x11_texture_pixmap_set_pixmap().
117 // If you want to display a window in a #ClutterTexture, you probably want
118 // this function, or its older sister, clutter_glx_texture_pixmap_set_window().
120 // This function has no effect unless the XComposite extension is available.
121 // <window>: the X window to which the texture should be bound
122 // <automatic>: %TRUE for automatic window updates, %FALSE for manual.
123 void set_window()(xlib.Window window, int automatic) {
124 clutter_x11_texture_pixmap_set_window(&this, window, automatic);
127 // VERSION: 0.8
128 // Resets the texture's pixmap from its window, perhaps in response to the
129 // pixmap's invalidation as the window changed size.
130 void sync_window()() {
131 clutter_x11_texture_pixmap_sync_window(&this);
134 // VERSION: 0.8
135 // Performs the actual binding of texture to the current content of
136 // the pixmap. Can be called to update the texture if the pixmap
137 // content has changed.
138 // <x>: the X coordinate of the area to update
139 // <y>: the Y coordinate of the area to update
140 // <width>: the width of the area to update
141 // <height>: the height of the area to update
142 void update_area()(int x, int y, int width, int height) {
143 clutter_x11_texture_pixmap_update_area(&this, x, y, width, height);
146 // VERSION: 1.2
147 // ::queue-damage-redraw is emitted to notify that some sub-region
148 // of the texture has been changed (either by an automatic damage
149 // update or by an explicit call to
150 // clutter_x11_texture_pixmap_update_area). This usually means a
151 // redraw needs to be queued for the actor.
153 // The default handler will queue a clipped redraw in response to
154 // the damage, using the assumption that the pixmap is being painted
155 // to a rectangle covering the transformed allocation of the actor.
156 // If you sub-class and change the paint method so this isn't true
157 // then you must also provide your own damage signal handler to
158 // queue a redraw that blocks this default behaviour.
159 // <x>: The top left x position of the damage region
160 // <y>: The top left y position of the damage region
161 // <width>: The width of the damage region
162 // <height>: The height of the damage region
163 extern (C) alias static void function (TexturePixmap* this_, int x, int y, int width, int height, void* user_data=null) signal_queue_damage_redraw;
165 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
166 return super_.signal_connect!name(cb, data, cf);
169 ulong signal_connect(string name:"queue-damage-redraw", CB:signal_queue_damage_redraw)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
170 return signal_connect_data!()(&this, cast(char*)"queue-damage-redraw",
171 cast(GObject2.Callback)cb, data, null, cf);
174 // VERSION: 0.8
175 // The ::update-area signal is emitted to ask the texture to update its
176 // content from its source pixmap.
177 extern (C) alias static void function (TexturePixmap* this_, int object, int p0, int p1, int p2, void* user_data=null) signal_update_area;
178 ulong signal_connect(string name:"update-area", CB:signal_update_area)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
179 return signal_connect_data!()(&this, cast(char*)"update-area",
180 cast(GObject2.Callback)cb, data, null, cf);
184 // The #ClutterX11TexturePixmapClass structure contains only private data
185 struct TexturePixmapClass /* Version 0.8 */ {
186 private Clutter.TextureClass parent_class;
188 // <x>: the X coordinate of the area to update
189 // <y>: the Y coordinate of the area to update
190 // <width>: the width of the area to update
191 // <height>: the height of the area to update
192 extern (C) void function (TexturePixmap* texture, int x, int y, int width, int height) update_area;
195 struct TexturePixmapPrivate {
198 struct XInputDevice {
201 enum XInputEventTypes {
202 KEY_PRESS_EVENT = 0,
203 KEY_RELEASE_EVENT = 1,
204 BUTTON_PRESS_EVENT = 2,
205 BUTTON_RELEASE_EVENT = 3,
206 MOTION_NOTIFY_EVENT = 4,
207 LAST_EVENT = 5
210 // Unintrospectable function: add_filter() / clutter_x11_add_filter()
211 // VERSION: 0.6
212 // Adds an event filter function.
213 // <func>: a filter function
214 // <data>: user data to be passed to the filter function, or %NULL
215 static void add_filter()(FilterFunc func, void* data) {
216 clutter_x11_add_filter(func, data);
220 // VERSION: 0.8
221 // Disables the internal polling of X11 events in the main loop.
223 // Libraries or applications calling this function will be responsible of
224 // polling all X11 events.
226 // You also must call clutter_x11_handle_event() to let Clutter process
227 // events and maintain its internal state.
229 // <warning>This function can only be called before calling
230 // clutter_init().</warning>
232 // <note>Even with event handling disabled, Clutter will still select
233 // all the events required to maintain its internal state on the stage
234 // Window; compositors using Clutter and input regions to pass events
235 // through to application windows should not rely on an empty input
236 // region, and should instead clear it themselves explicitly using the
237 // XFixes extension.</note>
239 // This function should not be normally used by applications.
240 static void disable_event_retrieval()() {
241 clutter_x11_disable_event_retrieval();
245 // VERSION: 0.8
246 // Enables the use of the XInput extension if present on connected
247 // XServer and support built into Clutter. XInput allows for multiple
248 // pointing devices to be used.
250 // This function must be called before clutter_init().
252 // Since XInput might not be supported by the X server, you might
253 // want to use clutter_x11_has_xinput() to see if support was enabled.
254 static void enable_xinput()() {
255 clutter_x11_enable_xinput();
259 // VERSION: 1.4
260 // Retrieves the group for the modifiers set in @event
261 // RETURNS: the group id
262 // <event>: a #ClutterEvent of type %CLUTTER_KEY_PRESS or %CLUTTER_KEY_RELEASE
263 static int event_get_key_group()(Clutter.Event* event) {
264 return clutter_x11_event_get_key_group(event);
268 // Unintrospectable function: get_current_event_time() / clutter_x11_get_current_event_time()
269 // VERSION: 1.0
270 // Retrieves the timestamp of the last X11 event processed by
271 // Clutter. This might be different from the timestamp returned
272 // by clutter_get_current_event_time(), as Clutter may synthesize
273 // or throttle events.
274 // RETURNS: a timestamp, in milliseconds
275 static xlib.Time get_current_event_time()() {
276 return clutter_x11_get_current_event_time();
280 // VERSION: 0.6
281 // Retrieves the pointer to the default display.
282 // RETURNS: the default display
283 static xlib.Display* get_default_display()() {
284 return clutter_x11_get_default_display();
288 // VERSION: 0.6
289 // Gets the number of the default X Screen object.
290 // RETURNS: the number of the default screen
291 static int get_default_screen()() {
292 return clutter_x11_get_default_screen();
296 // VERSION: 0.8
297 // DEPRECATED (v1.2) function: get_input_devices - Use clutter_device_manager_peek_devices() instead
298 // Retrieves a pointer to the list of input devices
302 // pointer to the internal list of input devices; the returned list is
303 // owned by Clutter and should not be modified or freed
304 // RETURNS: a
305 static GLib2.SList* get_input_devices()() {
306 return clutter_x11_get_input_devices();
310 // Unintrospectable function: get_root_window() / clutter_x11_get_root_window()
311 // VERSION: 0.6
312 // Retrieves the root window.
313 // RETURNS: the id of the root window
314 static xlib.Window get_root_window()() {
315 return clutter_x11_get_root_window();
319 // VERSION: 0.8
320 // Gets the stage for a particular X window.
322 // does not exist for the window
323 // RETURNS: A #ClutterStage, or% NULL if a stage
324 // <win>: an X Window ID
325 static Clutter.Stage* get_stage_from_window()(xlib.Window win) {
326 return clutter_x11_get_stage_from_window(win);
330 // Unintrospectable function: get_stage_visual() / clutter_x11_get_stage_visual()
331 // VERSION: 0.4
332 // DEPRECATED (v1.2) function: get_stage_visual - Use clutter_x11_get_visual_info() instead
333 // Returns an XVisualInfo suitable for creating a foreign window for the given
334 // stage. NOTE: It doesn't do as the name may suggest, which is return the
335 // XVisualInfo that was used to create an existing window for the given stage.
337 // XXX: It might be best to deprecate this function and replace with something
338 // along the lines of clutter_backend_x11_get_foreign_visual () or perhaps
339 // clutter_stage_x11_get_foreign_visual ()
341 // foreign stage. Use XFree() to free the returned value instead
342 // RETURNS: An XVisualInfo suitable for creating a
343 // <stage>: a #ClutterStage
344 static xlib.XVisualInfo* /*new*/ get_stage_visual()(Clutter.Stage* stage) {
345 return clutter_x11_get_stage_visual(stage);
349 // Unintrospectable function: get_stage_window() / clutter_x11_get_stage_window()
350 // VERSION: 0.4
351 // Gets the stages X Window.
352 // RETURNS: An XID for the stage window.
353 // <stage>: a #ClutterStage
354 static xlib.Window get_stage_window()(Clutter.Stage* stage) {
355 return clutter_x11_get_stage_window(stage);
359 // VERSION: 1.2
360 // Retrieves whether the Clutter X11 backend is using ARGB visuals by default
361 // RETURNS: %TRUE if ARGB visuals are queried by default
362 static int get_use_argb_visual()() {
363 return clutter_x11_get_use_argb_visual();
367 // Unintrospectable function: get_visual_info() / clutter_x11_get_visual_info()
368 // VERSION: 1.2
369 // Retrieves the <structname>XVisualInfo</structname> used by the Clutter X11
370 // backend.
372 // <varname>None</varname>. The returned value should be freed using XFree()
373 // when done
374 // RETURNS: a <structname>XVisualInfo</structname>, or
375 static xlib.XVisualInfo* /*new*/ get_visual_info()() {
376 return clutter_x11_get_visual_info();
380 // VERSION: 0.8
381 // This function processes a single X event; it can be used to hook
382 // into external X11 event processing (for example, a GDK filter
383 // function).
385 // If clutter_x11_disable_event_retrieval() has been called, you must
386 // let this function process events to update Clutter's internal state.
388 // indicates that Clutter has internally handled the event and the
389 // caller should do no further processing. %CLUTTER_X11_FILTER_CONTINUE
390 // indicates that Clutter is either not interested in the event,
391 // or has used the event to update internal state without taking
392 // any exclusive action. %CLUTTER_X11_FILTER_TRANSLATE will not
393 // occur.
394 // RETURNS: #ClutterX11FilterReturn. %CLUTTER_X11_FILTER_REMOVE
395 // <xevent>: pointer to XEvent structure
396 static Clutter.X11FilterReturn handle_event()(xlib.XEvent* xevent) {
397 return clutter_x11_handle_event(xevent);
401 // Retrieves whether Clutter is running on an X11 server with the
402 // XComposite extension
403 // RETURNS: %TRUE if the XComposite extension is available
404 static int has_composite_extension()() {
405 return clutter_x11_has_composite_extension();
409 // VERSION: 0.8
410 // Queries the X11 backend to check if event collection has been disabled.
411 // RETURNS: TRUE if event retrival has been disabled. FALSE otherwise.
412 static int has_event_retrieval()() {
413 return clutter_x11_has_event_retrieval();
417 // VERSION: 0.8
418 // Gets whether Clutter has XInput support.
420 // and XInput support is available at run time.
421 // RETURNS: %TRUE if Clutter was compiled with XInput support
422 static int has_xinput()() {
423 return clutter_x11_has_xinput();
427 // Unintrospectable function: remove_filter() / clutter_x11_remove_filter()
428 // VERSION: 0.6
429 // Removes the given filter function.
430 // <func>: a filter function
431 // <data>: user data to be passed to the filter function, or %NULL
432 static void remove_filter()(FilterFunc func, void* data) {
433 clutter_x11_remove_filter(func, data);
437 // VERSION: 0.8
438 // Sets the display connection Clutter should use; must be called
439 // before clutter_init(), clutter_init_with_args() or other functions
440 // pertaining Clutter's initialization process.
442 // If you are parsing the command line arguments by retrieving Clutter's
443 // #GOptionGroup with clutter_get_option_group() and calling
444 // g_option_context_parse() yourself, you should also call
445 // clutter_x11_set_display() before g_option_context_parse().
446 // <xdpy>: pointer to a X display connection.
447 static void set_display()(xlib.Display* xdpy) {
448 clutter_x11_set_display(xdpy);
452 // VERSION: 0.4
453 // Target the #ClutterStage to use an existing external X Window
454 // RETURNS: %TRUE if foreign window is valid
455 // <stage>: a #ClutterStage
456 // <xwindow>: an existing X Window id
457 static int set_stage_foreign()(Clutter.Stage* stage, xlib.Window xwindow) {
458 return clutter_x11_set_stage_foreign(stage, xwindow);
462 // VERSION: 1.2
463 // Sets whether the Clutter X11 backend should request ARGB visuals by default
464 // or not.
466 // By default, Clutter requests RGB visuals.
468 // <note>If no ARGB visuals are found, the X11 backend will fall back to
469 // requesting a RGB visual instead.</note>
471 // ARGB visuals are required for the #ClutterStage:use-alpha property to work.
473 // <note>This function can only be called once, and before clutter_init() is
474 // called.</note>
475 // <use_argb>: %TRUE if ARGB visuals should be requested by default
476 static void set_use_argb_visual()(int use_argb) {
477 clutter_x11_set_use_argb_visual(use_argb);
481 // VERSION: 0.6
482 // Traps every X error until clutter_x11_untrap_x_errors() is called.
483 static void trap_x_errors()() {
484 clutter_x11_trap_x_errors();
488 // VERSION: 0.4
489 // Removes the X error trap and returns the current status.
490 // RETURNS: the trapped error code, or 0 for success
491 static int untrap_x_errors()() {
492 return clutter_x11_untrap_x_errors();
496 // C prototypes:
498 extern (C) {
499 TexturePixmap* clutter_x11_texture_pixmap_new();
500 TexturePixmap* clutter_x11_texture_pixmap_new_with_pixmap(xlib.Pixmap pixmap);
501 TexturePixmap* clutter_x11_texture_pixmap_new_with_window(xlib.Window window);
502 void clutter_x11_texture_pixmap_set_automatic(TexturePixmap* this_, int setting);
503 void clutter_x11_texture_pixmap_set_pixmap(TexturePixmap* this_, xlib.Pixmap pixmap);
504 void clutter_x11_texture_pixmap_set_window(TexturePixmap* this_, xlib.Window window, int automatic);
505 void clutter_x11_texture_pixmap_sync_window(TexturePixmap* this_);
506 void clutter_x11_texture_pixmap_update_area(TexturePixmap* this_, int x, int y, int width, int height);
507 void clutter_x11_add_filter(FilterFunc func, void* data);
508 void clutter_x11_disable_event_retrieval();
509 void clutter_x11_enable_xinput();
510 int clutter_x11_event_get_key_group(Clutter.Event* event);
511 xlib.Time clutter_x11_get_current_event_time();
512 xlib.Display* clutter_x11_get_default_display();
513 int clutter_x11_get_default_screen();
514 GLib2.SList* clutter_x11_get_input_devices();
515 xlib.Window clutter_x11_get_root_window();
516 Clutter.Stage* clutter_x11_get_stage_from_window(xlib.Window win);
517 xlib.XVisualInfo* /*new*/ clutter_x11_get_stage_visual(Clutter.Stage* stage);
518 xlib.Window clutter_x11_get_stage_window(Clutter.Stage* stage);
519 int clutter_x11_get_use_argb_visual();
520 xlib.XVisualInfo* /*new*/ clutter_x11_get_visual_info();
521 Clutter.X11FilterReturn clutter_x11_handle_event(xlib.XEvent* xevent);
522 int clutter_x11_has_composite_extension();
523 int clutter_x11_has_event_retrieval();
524 int clutter_x11_has_xinput();
525 void clutter_x11_remove_filter(FilterFunc func, void* data);
526 void clutter_x11_set_display(xlib.Display* xdpy);
527 int clutter_x11_set_stage_foreign(Clutter.Stage* stage, xlib.Window xwindow);
528 void clutter_x11_set_use_argb_visual(int use_argb);
529 void clutter_x11_trap_x_errors();
530 int clutter_x11_untrap_x_errors();