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