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.MonitorG;
32 private import gdk.Screen;
33 private import gdk.Seat;
34 private import gdk.Window;
35 private import gdk.c.functions;
36 public  import gdk.c.types;
37 private import glib.ListG;
38 private import glib.Str;
39 private import gobject.ObjectG;
40 private import gobject.Signals;
41 public  import gtkc.gdktypes;
42 private import std.algorithm;
43 
44 
45 /**
46  * #GdkDisplay objects purpose are two fold:
47  * 
48  * - To manage and provide information about input devices (pointers and keyboards)
49  * 
50  * - To manage and provide information about the available #GdkScreens
51  * 
52  * GdkDisplay objects are the GDK representation of an X Display,
53  * which can be described as a workstation consisting of
54  * a keyboard, a pointing device (such as a mouse) and one or more
55  * screens.
56  * It is used to open and keep track of various GdkScreen objects
57  * currently instantiated by the application. It is also used to
58  * access the keyboard(s) and mouse pointer(s) of the display.
59  * 
60  * Most of the input device handling has been factored out into
61  * the separate #GdkDeviceManager object. Every display has a
62  * device manager, which you can obtain using
63  * gdk_display_get_device_manager().
64  */
65 public class Display : ObjectG
66 {
67 	/** the main Gtk struct */
68 	protected GdkDisplay* gdkDisplay;
69 
70 	/** Get the main Gtk struct */
71 	public GdkDisplay* getDisplayStruct(bool transferOwnership = false)
72 	{
73 		if (transferOwnership)
74 			ownedRef = false;
75 		return gdkDisplay;
76 	}
77 
78 	/** the main Gtk struct as a void* */
79 	protected override void* getStruct()
80 	{
81 		return cast(void*)gdkDisplay;
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 	 * Returns: 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 	 * Returns: 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 	 * Returns: 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 	 * Returns: %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 	 * Returns: 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 	 * Returns: 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 	 * Returns: 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 	 * Returns: 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 default #GdkSeat for this display.
298 	 *
299 	 * Returns: the default seat.
300 	 *
301 	 * Since: 3.20
302 	 */
303 	public Seat getDefaultSeat()
304 	{
305 		auto p = gdk_display_get_default_seat(gdkDisplay);
306 
307 		if(p is null)
308 		{
309 			return null;
310 		}
311 
312 		return ObjectG.getDObject!(Seat)(cast(GdkSeat*) p);
313 	}
314 
315 	/**
316 	 * Returns the #GdkDeviceManager associated to @display.
317 	 *
318 	 * Deprecated: Use gdk_display_get_default_seat() and #GdkSeat operations.
319 	 *
320 	 * Returns: A #GdkDeviceManager, or
321 	 *     %NULL. This memory is owned by GDK and must not be freed
322 	 *     or unreferenced.
323 	 *
324 	 * Since: 3.0
325 	 */
326 	public DeviceManager getDeviceManager()
327 	{
328 		auto p = gdk_display_get_device_manager(gdkDisplay);
329 
330 		if(p is null)
331 		{
332 			return null;
333 		}
334 
335 		return ObjectG.getDObject!(DeviceManager)(cast(GdkDeviceManager*) p);
336 	}
337 
338 	/**
339 	 * Gets the next #GdkEvent to be processed for @display, fetching events from the
340 	 * windowing system if necessary.
341 	 *
342 	 * Returns: the next #GdkEvent to be processed, or %NULL
343 	 *     if no events are pending. The returned #GdkEvent should be freed
344 	 *     with gdk_event_free().
345 	 *
346 	 * Since: 2.2
347 	 */
348 	public Event getEvent()
349 	{
350 		auto p = gdk_display_get_event(gdkDisplay);
351 
352 		if(p is null)
353 		{
354 			return null;
355 		}
356 
357 		return ObjectG.getDObject!(Event)(cast(GdkEvent*) p, true);
358 	}
359 
360 	/**
361 	 * Gets the maximal size to use for cursors on @display.
362 	 *
363 	 * Params:
364 	 *     width = the return location for the maximal cursor width
365 	 *     height = the return location for the maximal cursor height
366 	 *
367 	 * Since: 2.4
368 	 */
369 	public void getMaximalCursorSize(out uint width, out uint height)
370 	{
371 		gdk_display_get_maximal_cursor_size(gdkDisplay, &width, &height);
372 	}
373 
374 	/**
375 	 * Gets a monitor associated with this display.
376 	 *
377 	 * Params:
378 	 *     monitorNum = number of the monitor
379 	 *
380 	 * Returns: the #GdkMonitor, or %NULL if
381 	 *     @monitor_num is not a valid monitor number
382 	 *
383 	 * Since: 3.22
384 	 */
385 	public MonitorG getMonitor(int monitorNum)
386 	{
387 		auto p = gdk_display_get_monitor(gdkDisplay, monitorNum);
388 
389 		if(p is null)
390 		{
391 			return null;
392 		}
393 
394 		return ObjectG.getDObject!(MonitorG)(cast(GdkMonitor*) p);
395 	}
396 
397 	/**
398 	 * Gets the monitor in which the point (@x, @y) is located,
399 	 * or a nearby monitor if the point is not in any monitor.
400 	 *
401 	 * Params:
402 	 *     x = the x coordinate of the point
403 	 *     y = the y coordinate of the point
404 	 *
405 	 * Returns: the monitor containing the point
406 	 *
407 	 * Since: 3.22
408 	 */
409 	public MonitorG getMonitorAtPoint(int x, int y)
410 	{
411 		auto p = gdk_display_get_monitor_at_point(gdkDisplay, x, y);
412 
413 		if(p is null)
414 		{
415 			return null;
416 		}
417 
418 		return ObjectG.getDObject!(MonitorG)(cast(GdkMonitor*) p);
419 	}
420 
421 	/**
422 	 * Gets the monitor in which the largest area of @window
423 	 * resides, or a monitor close to @window if it is outside
424 	 * of all monitors.
425 	 *
426 	 * Params:
427 	 *     window = a #GdkWindow
428 	 *
429 	 * Returns: the monitor with the largest overlap with @window
430 	 *
431 	 * Since: 3.22
432 	 */
433 	public MonitorG getMonitorAtWindow(Window window)
434 	{
435 		auto p = gdk_display_get_monitor_at_window(gdkDisplay, (window is null) ? null : window.getWindowStruct());
436 
437 		if(p is null)
438 		{
439 			return null;
440 		}
441 
442 		return ObjectG.getDObject!(MonitorG)(cast(GdkMonitor*) p);
443 	}
444 
445 	/**
446 	 * Gets the number of monitors that belong to @display.
447 	 *
448 	 * The returned number is valid until the next emission of the
449 	 * #GdkDisplay::monitor-added or #GdkDisplay::monitor-removed signal.
450 	 *
451 	 * Returns: the number of monitors
452 	 *
453 	 * Since: 3.22
454 	 */
455 	public int getNMonitors()
456 	{
457 		return gdk_display_get_n_monitors(gdkDisplay);
458 	}
459 
460 	/**
461 	 * Gets the number of screen managed by the @display.
462 	 *
463 	 * Deprecated: The number of screens is always 1.
464 	 *
465 	 * Returns: number of screens.
466 	 *
467 	 * Since: 2.2
468 	 */
469 	public int getNScreens()
470 	{
471 		return gdk_display_get_n_screens(gdkDisplay);
472 	}
473 
474 	/**
475 	 * Gets the name of the display.
476 	 *
477 	 * Returns: a string representing the display name. This string is owned
478 	 *     by GDK and should not be modified or freed.
479 	 *
480 	 * Since: 2.2
481 	 */
482 	public string getName()
483 	{
484 		return Str.toString(gdk_display_get_name(gdkDisplay));
485 	}
486 
487 	/**
488 	 * Gets the current location of the pointer and the current modifier
489 	 * mask for a given display.
490 	 *
491 	 * Deprecated: Use gdk_device_get_position() instead.
492 	 *
493 	 * Params:
494 	 *     screen = location to store the screen that the
495 	 *         cursor is on, or %NULL.
496 	 *     x = location to store root window X coordinate of pointer, or %NULL.
497 	 *     y = location to store root window Y coordinate of pointer, or %NULL.
498 	 *     mask = location to store current modifier mask, or %NULL
499 	 *
500 	 * Since: 2.2
501 	 */
502 	public void getPointer(out Screen screen, out int x, out int y, out GdkModifierType mask)
503 	{
504 		GdkScreen* outscreen = null;
505 
506 		gdk_display_get_pointer(gdkDisplay, &outscreen, &x, &y, &mask);
507 
508 		screen = ObjectG.getDObject!(Screen)(outscreen);
509 	}
510 
511 	/**
512 	 * Gets the primary monitor for the display.
513 	 *
514 	 * The primary monitor is considered the monitor where the “main desktop”
515 	 * lives. While normal application windows typically allow the window
516 	 * manager to place the windows, specialized desktop applications
517 	 * such as panels should place themselves on the primary monitor.
518 	 *
519 	 * Returns: the primary monitor, or %NULL if no primary
520 	 *     monitor is configured by the user
521 	 *
522 	 * Since: 3.22
523 	 */
524 	public MonitorG getPrimaryMonitor()
525 	{
526 		auto p = gdk_display_get_primary_monitor(gdkDisplay);
527 
528 		if(p is null)
529 		{
530 			return null;
531 		}
532 
533 		return ObjectG.getDObject!(MonitorG)(cast(GdkMonitor*) p);
534 	}
535 
536 	/**
537 	 * Returns a screen object for one of the screens of the display.
538 	 *
539 	 * Deprecated: There is only one screen; use gdk_display_get_default_screen() to get it.
540 	 *
541 	 * Params:
542 	 *     screenNum = the screen number
543 	 *
544 	 * Returns: the #GdkScreen object
545 	 *
546 	 * Since: 2.2
547 	 */
548 	public Screen getScreen(int screenNum)
549 	{
550 		auto p = gdk_display_get_screen(gdkDisplay, screenNum);
551 
552 		if(p is null)
553 		{
554 			return null;
555 		}
556 
557 		return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p);
558 	}
559 
560 	/**
561 	 * Obtains the window underneath the mouse pointer, returning the location
562 	 * of the pointer in that window in @win_x, @win_y for @screen. Returns %NULL
563 	 * if the window under the mouse pointer is not known to GDK (for example,
564 	 * belongs to another application).
565 	 *
566 	 * Deprecated: Use gdk_device_get_window_at_position() instead.
567 	 *
568 	 * Params:
569 	 *     winX = return location for x coordinate of the pointer location relative
570 	 *         to the window origin, or %NULL
571 	 *     winY = return location for y coordinate of the pointer location relative
572 	 *         &    to the window origin, or %NULL
573 	 *
574 	 * Returns: the window under the mouse
575 	 *     pointer, or %NULL
576 	 *
577 	 * Since: 2.2
578 	 */
579 	public Window getWindowAtPointer(out int winX, out int winY)
580 	{
581 		auto p = gdk_display_get_window_at_pointer(gdkDisplay, &winX, &winY);
582 
583 		if(p is null)
584 		{
585 			return null;
586 		}
587 
588 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
589 	}
590 
591 	/**
592 	 * Returns whether the display has events that are waiting
593 	 * to be processed.
594 	 *
595 	 * Returns: %TRUE if there are events ready to be processed.
596 	 *
597 	 * Since: 3.0
598 	 */
599 	public bool hasPending()
600 	{
601 		return gdk_display_has_pending(gdkDisplay) != 0;
602 	}
603 
604 	/**
605 	 * Finds out if the display has been closed.
606 	 *
607 	 * Returns: %TRUE if the display is closed.
608 	 *
609 	 * Since: 2.22
610 	 */
611 	public bool isClosed()
612 	{
613 		return gdk_display_is_closed(gdkDisplay) != 0;
614 	}
615 
616 	/**
617 	 * Release any keyboard grab
618 	 *
619 	 * Deprecated: Use gdk_device_ungrab(), together with gdk_device_grab()
620 	 * instead.
621 	 *
622 	 * Params:
623 	 *     time = a timestap (e.g #GDK_CURRENT_TIME).
624 	 *
625 	 * Since: 2.2
626 	 */
627 	public void keyboardUngrab(uint time)
628 	{
629 		gdk_display_keyboard_ungrab(gdkDisplay, time);
630 	}
631 
632 	/**
633 	 * Returns the list of available input devices attached to @display.
634 	 * The list is statically allocated and should not be freed.
635 	 *
636 	 * Deprecated: Use gdk_device_manager_list_devices() instead.
637 	 *
638 	 * Returns: a list of #GdkDevice
639 	 *
640 	 * Since: 2.2
641 	 */
642 	public ListG listDevices()
643 	{
644 		auto p = gdk_display_list_devices(gdkDisplay);
645 
646 		if(p is null)
647 		{
648 			return null;
649 		}
650 
651 		return new ListG(cast(GList*) p);
652 	}
653 
654 	/**
655 	 * Returns the list of seats known to @display.
656 	 *
657 	 * Returns: the
658 	 *     list of seats known to the #GdkDisplay
659 	 *
660 	 * Since: 3.20
661 	 */
662 	public ListG listSeats()
663 	{
664 		auto p = gdk_display_list_seats(gdkDisplay);
665 
666 		if(p is null)
667 		{
668 			return null;
669 		}
670 
671 		return new ListG(cast(GList*) p);
672 	}
673 
674 	/**
675 	 * Indicates to the GUI environment that the application has
676 	 * finished loading, using a given identifier.
677 	 *
678 	 * GTK+ will call this function automatically for #GtkWindow
679 	 * with custom startup-notification identifier unless
680 	 * gtk_window_set_auto_startup_notification() is called to
681 	 * disable that feature.
682 	 *
683 	 * Params:
684 	 *     startupId = a startup-notification identifier, for which
685 	 *         notification process should be completed
686 	 *
687 	 * Since: 3.0
688 	 */
689 	public void notifyStartupComplete(string startupId)
690 	{
691 		gdk_display_notify_startup_complete(gdkDisplay, Str.toStringz(startupId));
692 	}
693 
694 	/**
695 	 * Gets a copy of the first #GdkEvent in the @display’s event queue, without
696 	 * removing the event from the queue.  (Note that this function will
697 	 * not get more events from the windowing system.  It only checks the events
698 	 * that have already been moved to the GDK event queue.)
699 	 *
700 	 * Returns: a copy of the first #GdkEvent on the event
701 	 *     queue, or %NULL if no events are in the queue. The returned
702 	 *     #GdkEvent should be freed with gdk_event_free().
703 	 *
704 	 * Since: 2.2
705 	 */
706 	public Event peekEvent()
707 	{
708 		auto p = gdk_display_peek_event(gdkDisplay);
709 
710 		if(p is null)
711 		{
712 			return null;
713 		}
714 
715 		return ObjectG.getDObject!(Event)(cast(GdkEvent*) p, true);
716 	}
717 
718 	/**
719 	 * Test if the pointer is grabbed.
720 	 *
721 	 * Deprecated: Use gdk_display_device_is_grabbed() instead.
722 	 *
723 	 * Returns: %TRUE if an active X pointer grab is in effect
724 	 *
725 	 * Since: 2.2
726 	 */
727 	public bool pointerIsGrabbed()
728 	{
729 		return gdk_display_pointer_is_grabbed(gdkDisplay) != 0;
730 	}
731 
732 	/**
733 	 * Release any pointer grab.
734 	 *
735 	 * Deprecated: Use gdk_device_ungrab(), together with gdk_device_grab()
736 	 * instead.
737 	 *
738 	 * Params:
739 	 *     time = a timestap (e.g. %GDK_CURRENT_TIME).
740 	 *
741 	 * Since: 2.2
742 	 */
743 	public void pointerUngrab(uint time)
744 	{
745 		gdk_display_pointer_ungrab(gdkDisplay, time);
746 	}
747 
748 	/**
749 	 * Appends a copy of the given event onto the front of the event
750 	 * queue for @display.
751 	 *
752 	 * Params:
753 	 *     event = a #GdkEvent.
754 	 *
755 	 * Since: 2.2
756 	 */
757 	public void putEvent(Event event)
758 	{
759 		gdk_display_put_event(gdkDisplay, (event is null) ? null : event.getEventStruct());
760 	}
761 
762 	/**
763 	 * Request #GdkEventOwnerChange events for ownership changes
764 	 * of the selection named by the given atom.
765 	 *
766 	 * Params:
767 	 *     selection = the #GdkAtom naming the selection for which
768 	 *         ownership change notification is requested
769 	 *
770 	 * Returns: whether #GdkEventOwnerChange events will
771 	 *     be sent.
772 	 *
773 	 * Since: 2.6
774 	 */
775 	public bool requestSelectionNotification(GdkAtom selection)
776 	{
777 		return gdk_display_request_selection_notification(gdkDisplay, selection) != 0;
778 	}
779 
780 	/**
781 	 * Sets the double click distance (two clicks within this distance
782 	 * count as a double click and result in a #GDK_2BUTTON_PRESS event).
783 	 * See also gdk_display_set_double_click_time().
784 	 * Applications should not set this, it is a global
785 	 * user-configured setting.
786 	 *
787 	 * Params:
788 	 *     distance = distance in pixels
789 	 *
790 	 * Since: 2.4
791 	 */
792 	public void setDoubleClickDistance(uint distance)
793 	{
794 		gdk_display_set_double_click_distance(gdkDisplay, distance);
795 	}
796 
797 	/**
798 	 * Sets the double click time (two clicks within this time interval
799 	 * count as a double click and result in a #GDK_2BUTTON_PRESS event).
800 	 * Applications should not set this, it is a global
801 	 * user-configured setting.
802 	 *
803 	 * Params:
804 	 *     msec = double click time in milliseconds (thousandths of a second)
805 	 *
806 	 * Since: 2.2
807 	 */
808 	public void setDoubleClickTime(uint msec)
809 	{
810 		gdk_display_set_double_click_time(gdkDisplay, msec);
811 	}
812 
813 	/**
814 	 * Issues a request to the clipboard manager to store the
815 	 * clipboard data. On X11, this is a special program that works
816 	 * according to the
817 	 * [FreeDesktop Clipboard Specification](http://www.freedesktop.org/Standards/clipboard-manager-spec).
818 	 *
819 	 * Params:
820 	 *     clipboardWindow = a #GdkWindow belonging to the clipboard owner
821 	 *     time = a timestamp
822 	 *     targets = an array of targets
823 	 *         that should be saved, or %NULL
824 	 *         if all available targets should be saved.
825 	 *
826 	 * Since: 2.6
827 	 */
828 	public void storeClipboard(Window clipboardWindow, uint time, GdkAtom[] targets)
829 	{
830 		gdk_display_store_clipboard(gdkDisplay, (clipboardWindow is null) ? null : clipboardWindow.getWindowStruct(), time, targets.ptr, cast(int)targets.length);
831 	}
832 
833 	/**
834 	 * Returns whether the speicifed display supports clipboard
835 	 * persistance; i.e. if it’s possible to store the clipboard data after an
836 	 * application has quit. On X11 this checks if a clipboard daemon is
837 	 * running.
838 	 *
839 	 * Returns: %TRUE if the display supports clipboard persistance.
840 	 *
841 	 * Since: 2.6
842 	 */
843 	public bool supportsClipboardPersistence()
844 	{
845 		return gdk_display_supports_clipboard_persistence(gdkDisplay) != 0;
846 	}
847 
848 	/**
849 	 * Returns %TRUE if gdk_window_set_composited() can be used
850 	 * to redirect drawing on the window using compositing.
851 	 *
852 	 * Currently this only works on X11 with XComposite and
853 	 * XDamage extensions available.
854 	 *
855 	 * Deprecated: Compositing is an outdated technology that
856 	 * only ever worked on X11.
857 	 *
858 	 * Returns: %TRUE if windows may be composited.
859 	 *
860 	 * Since: 2.12
861 	 */
862 	public bool supportsComposite()
863 	{
864 		return gdk_display_supports_composite(gdkDisplay) != 0;
865 	}
866 
867 	/**
868 	 * Returns %TRUE if cursors can use an 8bit alpha channel
869 	 * on @display. Otherwise, cursors are restricted to bilevel
870 	 * alpha (i.e. a mask).
871 	 *
872 	 * Returns: whether cursors can have alpha channels.
873 	 *
874 	 * Since: 2.4
875 	 */
876 	public bool supportsCursorAlpha()
877 	{
878 		return gdk_display_supports_cursor_alpha(gdkDisplay) != 0;
879 	}
880 
881 	/**
882 	 * Returns %TRUE if multicolored cursors are supported
883 	 * on @display. Otherwise, cursors have only a forground
884 	 * and a background color.
885 	 *
886 	 * Returns: whether cursors can have multiple colors.
887 	 *
888 	 * Since: 2.4
889 	 */
890 	public bool supportsCursorColor()
891 	{
892 		return gdk_display_supports_cursor_color(gdkDisplay) != 0;
893 	}
894 
895 	/**
896 	 * Returns %TRUE if gdk_window_input_shape_combine_mask() can
897 	 * be used to modify the input shape of windows on @display.
898 	 *
899 	 * Returns: %TRUE if windows with modified input shape are supported
900 	 *
901 	 * Since: 2.10
902 	 */
903 	public bool supportsInputShapes()
904 	{
905 		return gdk_display_supports_input_shapes(gdkDisplay) != 0;
906 	}
907 
908 	/**
909 	 * Returns whether #GdkEventOwnerChange events will be
910 	 * sent when the owner of a selection changes.
911 	 *
912 	 * Returns: whether #GdkEventOwnerChange events will
913 	 *     be sent.
914 	 *
915 	 * Since: 2.6
916 	 */
917 	public bool supportsSelectionNotification()
918 	{
919 		return gdk_display_supports_selection_notification(gdkDisplay) != 0;
920 	}
921 
922 	/**
923 	 * Returns %TRUE if gdk_window_shape_combine_mask() can
924 	 * be used to create shaped windows on @display.
925 	 *
926 	 * Returns: %TRUE if shaped windows are supported
927 	 *
928 	 * Since: 2.10
929 	 */
930 	public bool supportsShapes()
931 	{
932 		return gdk_display_supports_shapes(gdkDisplay) != 0;
933 	}
934 
935 	/**
936 	 * Flushes any requests queued for the windowing system and waits until all
937 	 * requests have been handled. This is often used for making sure that the
938 	 * display is synchronized with the current state of the program. Calling
939 	 * gdk_display_sync() before gdk_error_trap_pop() makes sure that any errors
940 	 * generated from earlier requests are handled before the error trap is
941 	 * removed.
942 	 *
943 	 * This is most useful for X11. On windowing systems where requests are
944 	 * handled synchronously, this function will do nothing.
945 	 *
946 	 * Since: 2.2
947 	 */
948 	public void sync()
949 	{
950 		gdk_display_sync(gdkDisplay);
951 	}
952 
953 	/**
954 	 * Warps the pointer of @display to the point @x,@y on
955 	 * the screen @screen, unless the pointer is confined
956 	 * to a window by a grab, in which case it will be moved
957 	 * as far as allowed by the grab. Warping the pointer
958 	 * creates events as if the user had moved the mouse
959 	 * instantaneously to the destination.
960 	 *
961 	 * Note that the pointer should normally be under the
962 	 * control of the user. This function was added to cover
963 	 * some rare use cases like keyboard navigation support
964 	 * for the color picker in the #GtkColorSelectionDialog.
965 	 *
966 	 * Deprecated: Use gdk_device_warp() instead.
967 	 *
968 	 * Params:
969 	 *     screen = the screen of @display to warp the pointer to
970 	 *     x = the x coordinate of the destination
971 	 *     y = the y coordinate of the destination
972 	 *
973 	 * Since: 2.8
974 	 */
975 	public void warpPointer(Screen screen, int x, int y)
976 	{
977 		gdk_display_warp_pointer(gdkDisplay, (screen is null) ? null : screen.getScreenStruct(), x, y);
978 	}
979 
980 	/**
981 	 * The ::closed signal is emitted when the connection to the windowing
982 	 * system for @display is closed.
983 	 *
984 	 * Params:
985 	 *     isError = %TRUE if the display was closed due to an error
986 	 *
987 	 * Since: 2.2
988 	 */
989 	gulong addOnClosed(void delegate(bool, Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
990 	{
991 		return Signals.connect(this, "closed", dlg, connectFlags ^ ConnectFlags.SWAPPED);
992 	}
993 
994 	/**
995 	 * The ::monitor-added signal is emitted whenever a monitor is
996 	 * added.
997 	 *
998 	 * Params:
999 	 *     monitor = the monitor that was just added
1000 	 *
1001 	 * Since: 3.22
1002 	 */
1003 	gulong addOnMonitorAdded(void delegate(MonitorG, Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1004 	{
1005 		return Signals.connect(this, "monitor-added", dlg, connectFlags ^ ConnectFlags.SWAPPED);
1006 	}
1007 
1008 	/**
1009 	 * The ::monitor-removed signal is emitted whenever a monitor is
1010 	 * removed.
1011 	 *
1012 	 * Params:
1013 	 *     monitor = the monitor that was just removed
1014 	 *
1015 	 * Since: 3.22
1016 	 */
1017 	gulong addOnMonitorRemoved(void delegate(MonitorG, Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1018 	{
1019 		return Signals.connect(this, "monitor-removed", dlg, connectFlags ^ ConnectFlags.SWAPPED);
1020 	}
1021 
1022 	/**
1023 	 * The ::opened signal is emitted when the connection to the windowing
1024 	 * system for @display is opened.
1025 	 */
1026 	gulong addOnOpened(void delegate(Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1027 	{
1028 		return Signals.connect(this, "opened", dlg, connectFlags ^ ConnectFlags.SWAPPED);
1029 	}
1030 
1031 	/**
1032 	 * The ::seat-added signal is emitted whenever a new seat is made
1033 	 * known to the windowing system.
1034 	 *
1035 	 * Params:
1036 	 *     seat = the seat that was just added
1037 	 *
1038 	 * Since: 3.20
1039 	 */
1040 	gulong addOnSeatAdded(void delegate(Seat, Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1041 	{
1042 		return Signals.connect(this, "seat-added", dlg, connectFlags ^ ConnectFlags.SWAPPED);
1043 	}
1044 
1045 	/**
1046 	 * The ::seat-removed signal is emitted whenever a seat is removed
1047 	 * by the windowing system.
1048 	 *
1049 	 * Params:
1050 	 *     seat = the seat that was just removed
1051 	 *
1052 	 * Since: 3.20
1053 	 */
1054 	gulong addOnSeatRemoved(void delegate(Seat, Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
1055 	{
1056 		return Signals.connect(this, "seat-removed", dlg, connectFlags ^ ConnectFlags.SWAPPED);
1057 	}
1058 }