1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gdk.Display;
26 
27 private import gdk.AppLaunchContext;
28 private import gdk.Device;
29 private import gdk.DeviceManager;
30 private import gdk.Event;
31 private import gdk.Screen;
32 private import gdk.Window;
33 private import glib.ListG;
34 private import glib.Str;
35 private import gobject.ObjectG;
36 private import gobject.Signals;
37 private import gtkc.gdk;
38 public  import gtkc.gdktypes;
39 
40 
41 /**
42  * #GdkDisplay objects purpose are two fold:
43  * 
44  * - To manage and provide information about input devices (pointers and keyboards)
45  * 
46  * - To manage and provide information about the available #GdkScreens
47  * 
48  * GdkDisplay objects are the GDK representation of an X Display,
49  * which can be described as a workstation consisting of
50  * a keyboard, a pointing device (such as a mouse) and one or more
51  * screens.
52  * It is used to open and keep track of various GdkScreen objects
53  * currently instantiated by the application. It is also used to
54  * access the keyboard(s) and mouse pointer(s) of the display.
55  * 
56  * Most of the input device handling has been factored out into
57  * the separate #GdkDeviceManager object. Every display has a
58  * device manager, which you can obtain using
59  * gdk_display_get_device_manager().
60  */
61 public class Display : ObjectG
62 {
63 	/** the main Gtk struct */
64 	protected GdkDisplay* gdkDisplay;
65 
66 	/** Get the main Gtk struct */
67 	public GdkDisplay* getDisplayStruct()
68 	{
69 		return gdkDisplay;
70 	}
71 
72 	/** the main Gtk struct as a void* */
73 	protected override void* getStruct()
74 	{
75 		return cast(void*)gdkDisplay;
76 	}
77 
78 	protected override void setStruct(GObject* obj)
79 	{
80 		gdkDisplay = cast(GdkDisplay*)obj;
81 		super.setStruct(obj);
82 	}
83 
84 	/**
85 	 * Sets our main struct and passes it to the parent class.
86 	 */
87 	public this (GdkDisplay* gdkDisplay, bool ownedRef = false)
88 	{
89 		this.gdkDisplay = gdkDisplay;
90 		super(cast(GObject*)gdkDisplay, ownedRef);
91 	}
92 
93 
94 	/** */
95 	public static GType getType()
96 	{
97 		return gdk_display_get_type();
98 	}
99 
100 	/**
101 	 * Gets the default #GdkDisplay. This is a convenience
102 	 * function for:
103 	 * `gdk_display_manager_get_default_display (gdk_display_manager_get ())`.
104 	 *
105 	 * Return: a #GdkDisplay, or %NULL if
106 	 *     there is no default display.
107 	 *
108 	 * Since: 2.2
109 	 */
110 	public static Display getDefault()
111 	{
112 		auto p = gdk_display_get_default();
113 		
114 		if(p is null)
115 		{
116 			return null;
117 		}
118 		
119 		return ObjectG.getDObject!(Display)(cast(GdkDisplay*) p);
120 	}
121 
122 	/**
123 	 * Opens a display.
124 	 *
125 	 * Params:
126 	 *     displayName = the name of the display to open
127 	 *
128 	 * Return: a #GdkDisplay, or %NULL if the
129 	 *     display could not be opened
130 	 *
131 	 * Since: 2.2
132 	 */
133 	public static Display open(string displayName)
134 	{
135 		auto p = gdk_display_open(Str.toStringz(displayName));
136 		
137 		if(p is null)
138 		{
139 			return null;
140 		}
141 		
142 		return ObjectG.getDObject!(Display)(cast(GdkDisplay*) p);
143 	}
144 
145 	/**
146 	 * Opens the default display specified by command line arguments or
147 	 * environment variables, sets it as the default display, and returns
148 	 * it. gdk_parse_args() must have been called first. If the default
149 	 * display has previously been set, simply returns that. An internal
150 	 * function that should not be used by applications.
151 	 *
152 	 * Deprecated: This symbol was never meant to be used outside
153 	 * of GTK+
154 	 *
155 	 * Return: the default display, if it
156 	 *     could be opened, otherwise %NULL.
157 	 */
158 	public static Display openDefaultLibgtkOnly()
159 	{
160 		auto p = gdk_display_open_default_libgtk_only();
161 		
162 		if(p is null)
163 		{
164 			return null;
165 		}
166 		
167 		return ObjectG.getDObject!(Display)(cast(GdkDisplay*) p);
168 	}
169 
170 	/**
171 	 * Emits a short beep on @display
172 	 *
173 	 * Since: 2.2
174 	 */
175 	public void beep()
176 	{
177 		gdk_display_beep(gdkDisplay);
178 	}
179 
180 	/**
181 	 * Closes the connection to the windowing system for the given display,
182 	 * and cleans up associated resources.
183 	 *
184 	 * Since: 2.2
185 	 */
186 	public void close()
187 	{
188 		gdk_display_close(gdkDisplay);
189 	}
190 
191 	/**
192 	 * Returns %TRUE if there is an ongoing grab on @device for @display.
193 	 *
194 	 * Params:
195 	 *     device = a #GdkDevice
196 	 *
197 	 * Return: %TRUE if there is a grab in effect for @device.
198 	 */
199 	public bool deviceIsGrabbed(Device device)
200 	{
201 		return gdk_display_device_is_grabbed(gdkDisplay, (device is null) ? null : device.getDeviceStruct()) != 0;
202 	}
203 
204 	/**
205 	 * Flushes any requests queued for the windowing system; this happens automatically
206 	 * when the main loop blocks waiting for new events, but if your application
207 	 * is drawing without returning control to the main loop, you may need
208 	 * to call this function explicitly. A common case where this function
209 	 * needs to be called is when an application is executing drawing commands
210 	 * from a thread other than the thread where the main loop is running.
211 	 *
212 	 * This is most useful for X11. On windowing systems where requests are
213 	 * handled synchronously, this function will do nothing.
214 	 *
215 	 * Since: 2.4
216 	 */
217 	public void flush()
218 	{
219 		gdk_display_flush(gdkDisplay);
220 	}
221 
222 	/**
223 	 * Returns a #GdkAppLaunchContext suitable for launching
224 	 * applications on the given display.
225 	 *
226 	 * Return: a new #GdkAppLaunchContext for @display.
227 	 *     Free with g_object_unref() when done
228 	 *
229 	 * Since: 3.0
230 	 */
231 	public AppLaunchContext getAppLaunchContext()
232 	{
233 		auto p = gdk_display_get_app_launch_context(gdkDisplay);
234 		
235 		if(p is null)
236 		{
237 			return null;
238 		}
239 		
240 		return ObjectG.getDObject!(AppLaunchContext)(cast(GdkAppLaunchContext*) p, true);
241 	}
242 
243 	/**
244 	 * Returns the default size to use for cursors on @display.
245 	 *
246 	 * Return: the default cursor size.
247 	 *
248 	 * Since: 2.4
249 	 */
250 	public uint getDefaultCursorSize()
251 	{
252 		return gdk_display_get_default_cursor_size(gdkDisplay);
253 	}
254 
255 	/**
256 	 * Returns the default group leader window for all toplevel windows
257 	 * on @display. This window is implicitly created by GDK.
258 	 * See gdk_window_set_group().
259 	 *
260 	 * Return: The default group leader window
261 	 *     for @display
262 	 *
263 	 * Since: 2.4
264 	 */
265 	public Window getDefaultGroup()
266 	{
267 		auto p = gdk_display_get_default_group(gdkDisplay);
268 		
269 		if(p is null)
270 		{
271 			return null;
272 		}
273 		
274 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
275 	}
276 
277 	/**
278 	 * Get the default #GdkScreen for @display.
279 	 *
280 	 * Return: the default #GdkScreen object for @display
281 	 *
282 	 * Since: 2.2
283 	 */
284 	public Screen getDefaultScreen()
285 	{
286 		auto p = gdk_display_get_default_screen(gdkDisplay);
287 		
288 		if(p is null)
289 		{
290 			return null;
291 		}
292 		
293 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
294 	}
295 
296 	/**
297 	 * Returns the #GdkDeviceManager associated to @display.
298 	 *
299 	 * Return: A #GdkDeviceManager, or
300 	 *     %NULL. This memory is owned by GDK and must not be freed
301 	 *     or unreferenced.
302 	 *
303 	 * Since: 3.0
304 	 */
305 	public DeviceManager getDeviceManager()
306 	{
307 		auto p = gdk_display_get_device_manager(gdkDisplay);
308 		
309 		if(p is null)
310 		{
311 			return null;
312 		}
313 		
314 		return ObjectG.getDObject!(DeviceManager)(cast(GdkDeviceManager*) p);
315 	}
316 
317 	/**
318 	 * Gets the next #GdkEvent to be processed for @display, fetching events from the
319 	 * windowing system if necessary.
320 	 *
321 	 * Return: the next #GdkEvent to be processed, or %NULL
322 	 *     if no events are pending. The returned #GdkEvent should be freed
323 	 *     with gdk_event_free().
324 	 *
325 	 * Since: 2.2
326 	 */
327 	public Event getEvent()
328 	{
329 		auto p = gdk_display_get_event(gdkDisplay);
330 		
331 		if(p is null)
332 		{
333 			return null;
334 		}
335 		
336 		return ObjectG.getDObject!(Event)(cast(GdkEvent*) p);
337 	}
338 
339 	/**
340 	 * Gets the maximal size to use for cursors on @display.
341 	 *
342 	 * Params:
343 	 *     width = the return location for the maximal cursor width
344 	 *     height = the return location for the maximal cursor height
345 	 *
346 	 * Since: 2.4
347 	 */
348 	public void getMaximalCursorSize(out uint width, out uint height)
349 	{
350 		gdk_display_get_maximal_cursor_size(gdkDisplay, &width, &height);
351 	}
352 
353 	/**
354 	 * Gets the number of screen managed by the @display.
355 	 *
356 	 * Deprecated: The number of screens is always 1.
357 	 *
358 	 * Return: number of screens.
359 	 *
360 	 * Since: 2.2
361 	 */
362 	public int getNScreens()
363 	{
364 		return gdk_display_get_n_screens(gdkDisplay);
365 	}
366 
367 	/**
368 	 * Gets the name of the display.
369 	 *
370 	 * Return: a string representing the display name. This string is owned
371 	 *     by GDK and should not be modified or freed.
372 	 *
373 	 * Since: 2.2
374 	 */
375 	public string getName()
376 	{
377 		return Str.toString(gdk_display_get_name(gdkDisplay));
378 	}
379 
380 	/**
381 	 * Gets the current location of the pointer and the current modifier
382 	 * mask for a given display.
383 	 *
384 	 * Deprecated: Use gdk_device_get_position() instead.
385 	 *
386 	 * Params:
387 	 *     screen = location to store the screen that the
388 	 *         cursor is on, or %NULL.
389 	 *     x = location to store root window X coordinate of pointer, or %NULL.
390 	 *     y = location to store root window Y coordinate of pointer, or %NULL.
391 	 *     mask = location to store current modifier mask, or %NULL
392 	 *
393 	 * Since: 2.2
394 	 */
395 	public void getPointer(out Screen screen, out int x, out int y, out GdkModifierType mask)
396 	{
397 		GdkScreen* outscreen = null;
398 		
399 		gdk_display_get_pointer(gdkDisplay, &outscreen, &x, &y, &mask);
400 		
401 		screen = ObjectG.getDObject!(Screen)(outscreen);
402 	}
403 
404 	/**
405 	 * Returns a screen object for one of the screens of the display.
406 	 *
407 	 * Params:
408 	 *     screenNum = the screen number
409 	 *
410 	 * Return: the #GdkScreen object
411 	 *
412 	 * Since: 2.2
413 	 */
414 	public Screen getScreen(int screenNum)
415 	{
416 		auto p = gdk_display_get_screen(gdkDisplay, screenNum);
417 		
418 		if(p is null)
419 		{
420 			return null;
421 		}
422 		
423 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
424 	}
425 
426 	/**
427 	 * Obtains the window underneath the mouse pointer, returning the location
428 	 * of the pointer in that window in @win_x, @win_y for @screen. Returns %NULL
429 	 * if the window under the mouse pointer is not known to GDK (for example,
430 	 * belongs to another application).
431 	 *
432 	 * Deprecated: Use gdk_device_get_window_at_position() instead.
433 	 *
434 	 * Params:
435 	 *     winX = return location for x coordinate of the pointer location relative
436 	 *         to the window origin, or %NULL
437 	 *     winY = return location for y coordinate of the pointer location relative
438 	 *         &    to the window origin, or %NULL
439 	 *
440 	 * Return: the window under the mouse
441 	 *     pointer, or %NULL
442 	 *
443 	 * Since: 2.2
444 	 */
445 	public Window getWindowAtPointer(out int winX, out int winY)
446 	{
447 		auto p = gdk_display_get_window_at_pointer(gdkDisplay, &winX, &winY);
448 		
449 		if(p is null)
450 		{
451 			return null;
452 		}
453 		
454 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
455 	}
456 
457 	/**
458 	 * Returns whether the display has events that are waiting
459 	 * to be processed.
460 	 *
461 	 * Return: %TRUE if there are events ready to be processed.
462 	 *
463 	 * Since: 3.0
464 	 */
465 	public bool hasPending()
466 	{
467 		return gdk_display_has_pending(gdkDisplay) != 0;
468 	}
469 
470 	/**
471 	 * Finds out if the display has been closed.
472 	 *
473 	 * Return: %TRUE if the display is closed.
474 	 *
475 	 * Since: 2.22
476 	 */
477 	public bool isClosed()
478 	{
479 		return gdk_display_is_closed(gdkDisplay) != 0;
480 	}
481 
482 	/**
483 	 * Release any keyboard grab
484 	 *
485 	 * Deprecated: Use gdk_device_ungrab(), together with gdk_device_grab()
486 	 * instead.
487 	 *
488 	 * Params:
489 	 *     time = a timestap (e.g #GDK_CURRENT_TIME).
490 	 *
491 	 * Since: 2.2
492 	 */
493 	public void keyboardUngrab(uint time)
494 	{
495 		gdk_display_keyboard_ungrab(gdkDisplay, time);
496 	}
497 
498 	/**
499 	 * Returns the list of available input devices attached to @display.
500 	 * The list is statically allocated and should not be freed.
501 	 *
502 	 * Deprecated: Use gdk_device_manager_list_devices() instead.
503 	 *
504 	 * Return: a list of #GdkDevice
505 	 *
506 	 * Since: 2.2
507 	 */
508 	public ListG listDevices()
509 	{
510 		auto p = gdk_display_list_devices(gdkDisplay);
511 		
512 		if(p is null)
513 		{
514 			return null;
515 		}
516 		
517 		return new ListG(cast(GList*) p);
518 	}
519 
520 	/**
521 	 * Indicates to the GUI environment that the application has
522 	 * finished loading, using a given identifier.
523 	 *
524 	 * GTK+ will call this function automatically for #GtkWindow
525 	 * with custom startup-notification identifier unless
526 	 * gtk_window_set_auto_startup_notification() is called to
527 	 * disable that feature.
528 	 *
529 	 * Params:
530 	 *     startupId = a startup-notification identifier, for which
531 	 *         notification process should be completed
532 	 *
533 	 * Since: 3.0
534 	 */
535 	public void notifyStartupComplete(string startupId)
536 	{
537 		gdk_display_notify_startup_complete(gdkDisplay, Str.toStringz(startupId));
538 	}
539 
540 	/**
541 	 * Gets a copy of the first #GdkEvent in the @display’s event queue, without
542 	 * removing the event from the queue.  (Note that this function will
543 	 * not get more events from the windowing system.  It only checks the events
544 	 * that have already been moved to the GDK event queue.)
545 	 *
546 	 * Return: a copy of the first #GdkEvent on the event
547 	 *     queue, or %NULL if no events are in the queue. The returned
548 	 *     #GdkEvent should be freed with gdk_event_free().
549 	 *
550 	 * Since: 2.2
551 	 */
552 	public Event peekEvent()
553 	{
554 		auto p = gdk_display_peek_event(gdkDisplay);
555 		
556 		if(p is null)
557 		{
558 			return null;
559 		}
560 		
561 		return ObjectG.getDObject!(Event)(cast(GdkEvent*) p);
562 	}
563 
564 	/**
565 	 * Test if the pointer is grabbed.
566 	 *
567 	 * Deprecated: Use gdk_display_device_is_grabbed() instead.
568 	 *
569 	 * Return: %TRUE if an active X pointer grab is in effect
570 	 *
571 	 * Since: 2.2
572 	 */
573 	public bool pointerIsGrabbed()
574 	{
575 		return gdk_display_pointer_is_grabbed(gdkDisplay) != 0;
576 	}
577 
578 	/**
579 	 * Release any pointer grab.
580 	 *
581 	 * Deprecated: Use gdk_device_ungrab(), together with gdk_device_grab()
582 	 * instead.
583 	 *
584 	 * Params:
585 	 *     time = a timestap (e.g. %GDK_CURRENT_TIME).
586 	 *
587 	 * Since: 2.2
588 	 */
589 	public void pointerUngrab(uint time)
590 	{
591 		gdk_display_pointer_ungrab(gdkDisplay, time);
592 	}
593 
594 	/**
595 	 * Appends a copy of the given event onto the front of the event
596 	 * queue for @display.
597 	 *
598 	 * Params:
599 	 *     event = a #GdkEvent.
600 	 *
601 	 * Since: 2.2
602 	 */
603 	public void putEvent(Event event)
604 	{
605 		gdk_display_put_event(gdkDisplay, (event is null) ? null : event.getEventStruct());
606 	}
607 
608 	/**
609 	 * Request #GdkEventOwnerChange events for ownership changes
610 	 * of the selection named by the given atom.
611 	 *
612 	 * Params:
613 	 *     selection = the #GdkAtom naming the selection for which
614 	 *         ownership change notification is requested
615 	 *
616 	 * Return: whether #GdkEventOwnerChange events will
617 	 *     be sent.
618 	 *
619 	 * Since: 2.6
620 	 */
621 	public bool requestSelectionNotification(GdkAtom selection)
622 	{
623 		return gdk_display_request_selection_notification(gdkDisplay, selection) != 0;
624 	}
625 
626 	/**
627 	 * Sets the double click distance (two clicks within this distance
628 	 * count as a double click and result in a #GDK_2BUTTON_PRESS event).
629 	 * See also gdk_display_set_double_click_time().
630 	 * Applications should not set this, it is a global
631 	 * user-configured setting.
632 	 *
633 	 * Params:
634 	 *     distance = distance in pixels
635 	 *
636 	 * Since: 2.4
637 	 */
638 	public void setDoubleClickDistance(uint distance)
639 	{
640 		gdk_display_set_double_click_distance(gdkDisplay, distance);
641 	}
642 
643 	/**
644 	 * Sets the double click time (two clicks within this time interval
645 	 * count as a double click and result in a #GDK_2BUTTON_PRESS event).
646 	 * Applications should not set this, it is a global
647 	 * user-configured setting.
648 	 *
649 	 * Params:
650 	 *     msec = double click time in milliseconds (thousandths of a second)
651 	 *
652 	 * Since: 2.2
653 	 */
654 	public void setDoubleClickTime(uint msec)
655 	{
656 		gdk_display_set_double_click_time(gdkDisplay, msec);
657 	}
658 
659 	/**
660 	 * Issues a request to the clipboard manager to store the
661 	 * clipboard data. On X11, this is a special program that works
662 	 * according to the
663 	 * [FreeDesktop Clipboard Specification](http://www.freedesktop.org/Standards/clipboard-manager-spec).
664 	 *
665 	 * Params:
666 	 *     clipboardWindow = a #GdkWindow belonging to the clipboard owner
667 	 *     time = a timestamp
668 	 *     targets = an array of targets
669 	 *         that should be saved, or %NULL
670 	 *         if all available targets should be saved.
671 	 *     nTargets = length of the @targets array
672 	 *
673 	 * Since: 2.6
674 	 */
675 	public void storeClipboard(Window clipboardWindow, uint time, GdkAtom[] targets)
676 	{
677 		gdk_display_store_clipboard(gdkDisplay, (clipboardWindow is null) ? null : clipboardWindow.getWindowStruct(), time, targets.ptr, cast(int)targets.length);
678 	}
679 
680 	/**
681 	 * Returns whether the speicifed display supports clipboard
682 	 * persistance; i.e. if it’s possible to store the clipboard data after an
683 	 * application has quit. On X11 this checks if a clipboard daemon is
684 	 * running.
685 	 *
686 	 * Return: %TRUE if the display supports clipboard persistance.
687 	 *
688 	 * Since: 2.6
689 	 */
690 	public bool supportsClipboardPersistence()
691 	{
692 		return gdk_display_supports_clipboard_persistence(gdkDisplay) != 0;
693 	}
694 
695 	/**
696 	 * Returns %TRUE if gdk_window_set_composited() can be used
697 	 * to redirect drawing on the window using compositing.
698 	 *
699 	 * Currently this only works on X11 with XComposite and
700 	 * XDamage extensions available.
701 	 *
702 	 * Deprecated: Compositing is an outdated technology that
703 	 * only ever worked on X11.
704 	 *
705 	 * Return: %TRUE if windows may be composited.
706 	 *
707 	 * Since: 2.12
708 	 */
709 	public bool supportsComposite()
710 	{
711 		return gdk_display_supports_composite(gdkDisplay) != 0;
712 	}
713 
714 	/**
715 	 * Returns %TRUE if cursors can use an 8bit alpha channel
716 	 * on @display. Otherwise, cursors are restricted to bilevel
717 	 * alpha (i.e. a mask).
718 	 *
719 	 * Return: whether cursors can have alpha channels.
720 	 *
721 	 * Since: 2.4
722 	 */
723 	public bool supportsCursorAlpha()
724 	{
725 		return gdk_display_supports_cursor_alpha(gdkDisplay) != 0;
726 	}
727 
728 	/**
729 	 * Returns %TRUE if multicolored cursors are supported
730 	 * on @display. Otherwise, cursors have only a forground
731 	 * and a background color.
732 	 *
733 	 * Return: whether cursors can have multiple colors.
734 	 *
735 	 * Since: 2.4
736 	 */
737 	public bool supportsCursorColor()
738 	{
739 		return gdk_display_supports_cursor_color(gdkDisplay) != 0;
740 	}
741 
742 	/**
743 	 * Returns %TRUE if gdk_window_input_shape_combine_mask() can
744 	 * be used to modify the input shape of windows on @display.
745 	 *
746 	 * Return: %TRUE if windows with modified input shape are supported
747 	 *
748 	 * Since: 2.10
749 	 */
750 	public bool supportsInputShapes()
751 	{
752 		return gdk_display_supports_input_shapes(gdkDisplay) != 0;
753 	}
754 
755 	/**
756 	 * Returns whether #GdkEventOwnerChange events will be
757 	 * sent when the owner of a selection changes.
758 	 *
759 	 * Return: whether #GdkEventOwnerChange events will
760 	 *     be sent.
761 	 *
762 	 * Since: 2.6
763 	 */
764 	public bool supportsSelectionNotification()
765 	{
766 		return gdk_display_supports_selection_notification(gdkDisplay) != 0;
767 	}
768 
769 	/**
770 	 * Returns %TRUE if gdk_window_shape_combine_mask() can
771 	 * be used to create shaped windows on @display.
772 	 *
773 	 * Return: %TRUE if shaped windows are supported
774 	 *
775 	 * Since: 2.10
776 	 */
777 	public bool supportsShapes()
778 	{
779 		return gdk_display_supports_shapes(gdkDisplay) != 0;
780 	}
781 
782 	/**
783 	 * Flushes any requests queued for the windowing system and waits until all
784 	 * requests have been handled. This is often used for making sure that the
785 	 * display is synchronized with the current state of the program. Calling
786 	 * gdk_display_sync() before gdk_error_trap_pop() makes sure that any errors
787 	 * generated from earlier requests are handled before the error trap is
788 	 * removed.
789 	 *
790 	 * This is most useful for X11. On windowing systems where requests are
791 	 * handled synchronously, this function will do nothing.
792 	 *
793 	 * Since: 2.2
794 	 */
795 	public void sync()
796 	{
797 		gdk_display_sync(gdkDisplay);
798 	}
799 
800 	/**
801 	 * Warps the pointer of @display to the point @x,@y on
802 	 * the screen @screen, unless the pointer is confined
803 	 * to a window by a grab, in which case it will be moved
804 	 * as far as allowed by the grab. Warping the pointer
805 	 * creates events as if the user had moved the mouse
806 	 * instantaneously to the destination.
807 	 *
808 	 * Note that the pointer should normally be under the
809 	 * control of the user. This function was added to cover
810 	 * some rare use cases like keyboard navigation support
811 	 * for the color picker in the #GtkColorSelectionDialog.
812 	 *
813 	 * Deprecated: Use gdk_device_warp() instead.
814 	 *
815 	 * Params:
816 	 *     screen = the screen of @display to warp the pointer to
817 	 *     x = the x coordinate of the destination
818 	 *     y = the y coordinate of the destination
819 	 *
820 	 * Since: 2.8
821 	 */
822 	public void warpPointer(Screen screen, int x, int y)
823 	{
824 		gdk_display_warp_pointer(gdkDisplay, (screen is null) ? null : screen.getScreenStruct(), x, y);
825 	}
826 
827 	int[string] connectedSignals;
828 
829 	void delegate(bool, Display)[] onClosedListeners;
830 	/**
831 	 * The ::closed signal is emitted when the connection to the windowing
832 	 * system for @display is closed.
833 	 *
834 	 * Params:
835 	 *     isError = %TRUE if the display was closed due to an error
836 	 *
837 	 * Since: 2.2
838 	 */
839 	void addOnClosed(void delegate(bool, Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
840 	{
841 		if ( "closed" !in connectedSignals )
842 		{
843 			Signals.connectData(
844 				this,
845 				"closed",
846 				cast(GCallback)&callBackClosed,
847 				cast(void*)this,
848 				null,
849 				connectFlags);
850 			connectedSignals["closed"] = 1;
851 		}
852 		onClosedListeners ~= dlg;
853 	}
854 	extern(C) static void callBackClosed(GdkDisplay* displayStruct, bool isError, Display _display)
855 	{
856 		foreach ( void delegate(bool, Display) dlg; _display.onClosedListeners )
857 		{
858 			dlg(isError, _display);
859 		}
860 	}
861 
862 	void delegate(Display)[] onOpenedListeners;
863 	/**
864 	 * The ::opened signal is emitted when the connection to the windowing
865 	 * system for @display is opened.
866 	 */
867 	void addOnOpened(void delegate(Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
868 	{
869 		if ( "opened" !in connectedSignals )
870 		{
871 			Signals.connectData(
872 				this,
873 				"opened",
874 				cast(GCallback)&callBackOpened,
875 				cast(void*)this,
876 				null,
877 				connectFlags);
878 			connectedSignals["opened"] = 1;
879 		}
880 		onOpenedListeners ~= dlg;
881 	}
882 	extern(C) static void callBackOpened(GdkDisplay* displayStruct, Display _display)
883 	{
884 		foreach ( void delegate(Display) dlg; _display.onOpenedListeners )
885 		{
886 			dlg(_display);
887 		}
888 	}
889 }