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