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