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 * 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 #GdkDeviceManager associated to @display. 299 * 300 * Return: A #GdkDeviceManager, or 301 * %NULL. This memory is owned by GDK and must not be freed 302 * or unreferenced. 303 * 304 * Since: 3.0 305 */ 306 public DeviceManager getDeviceManager() 307 { 308 auto p = gdk_display_get_device_manager(gdkDisplay); 309 310 if(p is null) 311 { 312 return null; 313 } 314 315 return ObjectG.getDObject!(DeviceManager)(cast(GdkDeviceManager*) p); 316 } 317 318 /** 319 * Gets the next #GdkEvent to be processed for @display, fetching events from the 320 * windowing system if necessary. 321 * 322 * Return: the next #GdkEvent to be processed, or %NULL 323 * if no events are pending. The returned #GdkEvent should be freed 324 * with gdk_event_free(). 325 * 326 * Since: 2.2 327 */ 328 public Event getEvent() 329 { 330 auto p = gdk_display_get_event(gdkDisplay); 331 332 if(p is null) 333 { 334 return null; 335 } 336 337 return ObjectG.getDObject!(Event)(cast(GdkEvent*) p); 338 } 339 340 /** 341 * Gets the maximal size to use for cursors on @display. 342 * 343 * Params: 344 * width = the return location for the maximal cursor width 345 * height = the return location for the maximal cursor height 346 * 347 * Since: 2.4 348 */ 349 public void getMaximalCursorSize(out uint width, out uint height) 350 { 351 gdk_display_get_maximal_cursor_size(gdkDisplay, &width, &height); 352 } 353 354 /** 355 * Gets the number of screen managed by the @display. 356 * 357 * Deprecated: The number of screens is always 1. 358 * 359 * Return: number of screens. 360 * 361 * Since: 2.2 362 */ 363 public int getNScreens() 364 { 365 return gdk_display_get_n_screens(gdkDisplay); 366 } 367 368 /** 369 * Gets the name of the display. 370 * 371 * Return: a string representing the display name. This string is owned 372 * by GDK and should not be modified or freed. 373 * 374 * Since: 2.2 375 */ 376 public string getName() 377 { 378 return Str.toString(gdk_display_get_name(gdkDisplay)); 379 } 380 381 /** 382 * Gets the current location of the pointer and the current modifier 383 * mask for a given display. 384 * 385 * Deprecated: Use gdk_device_get_position() instead. 386 * 387 * Params: 388 * screen = location to store the screen that the 389 * cursor is on, or %NULL. 390 * x = location to store root window X coordinate of pointer, or %NULL. 391 * y = location to store root window Y coordinate of pointer, or %NULL. 392 * mask = location to store current modifier mask, or %NULL 393 * 394 * Since: 2.2 395 */ 396 public void getPointer(out Screen screen, out int x, out int y, out GdkModifierType mask) 397 { 398 GdkScreen* outscreen = null; 399 400 gdk_display_get_pointer(gdkDisplay, &outscreen, &x, &y, &mask); 401 402 screen = ObjectG.getDObject!(Screen)(outscreen); 403 } 404 405 /** 406 * Returns a screen object for one of the screens of the display. 407 * 408 * Params: 409 * screenNum = the screen number 410 * 411 * Return: the #GdkScreen object 412 * 413 * Since: 2.2 414 */ 415 public Screen getScreen(int screenNum) 416 { 417 auto p = gdk_display_get_screen(gdkDisplay, screenNum); 418 419 if(p is null) 420 { 421 return null; 422 } 423 424 return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p); 425 } 426 427 /** 428 * Obtains the window underneath the mouse pointer, returning the location 429 * of the pointer in that window in @win_x, @win_y for @screen. Returns %NULL 430 * if the window under the mouse pointer is not known to GDK (for example, 431 * belongs to another application). 432 * 433 * Deprecated: Use gdk_device_get_window_at_position() instead. 434 * 435 * Params: 436 * winX = return location for x coordinate of the pointer location relative 437 * to the window origin, or %NULL 438 * winY = return location for y coordinate of the pointer location relative 439 * & to the window origin, or %NULL 440 * 441 * Return: the window under the mouse 442 * pointer, or %NULL 443 * 444 * Since: 2.2 445 */ 446 public Window getWindowAtPointer(out int winX, out int winY) 447 { 448 auto p = gdk_display_get_window_at_pointer(gdkDisplay, &winX, &winY); 449 450 if(p is null) 451 { 452 return null; 453 } 454 455 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 456 } 457 458 /** 459 * Returns whether the display has events that are waiting 460 * to be processed. 461 * 462 * Return: %TRUE if there are events ready to be processed. 463 * 464 * Since: 3.0 465 */ 466 public bool hasPending() 467 { 468 return gdk_display_has_pending(gdkDisplay) != 0; 469 } 470 471 /** 472 * Finds out if the display has been closed. 473 * 474 * Return: %TRUE if the display is closed. 475 * 476 * Since: 2.22 477 */ 478 public bool isClosed() 479 { 480 return gdk_display_is_closed(gdkDisplay) != 0; 481 } 482 483 /** 484 * Release any keyboard grab 485 * 486 * Deprecated: Use gdk_device_ungrab(), together with gdk_device_grab() 487 * instead. 488 * 489 * Params: 490 * time = a timestap (e.g #GDK_CURRENT_TIME). 491 * 492 * Since: 2.2 493 */ 494 public void keyboardUngrab(uint time) 495 { 496 gdk_display_keyboard_ungrab(gdkDisplay, time); 497 } 498 499 /** 500 * Returns the list of available input devices attached to @display. 501 * The list is statically allocated and should not be freed. 502 * 503 * Deprecated: Use gdk_device_manager_list_devices() instead. 504 * 505 * Return: a list of #GdkDevice 506 * 507 * Since: 2.2 508 */ 509 public ListG listDevices() 510 { 511 auto p = gdk_display_list_devices(gdkDisplay); 512 513 if(p is null) 514 { 515 return null; 516 } 517 518 return new ListG(cast(GList*) p); 519 } 520 521 /** 522 * Indicates to the GUI environment that the application has 523 * finished loading, using a given identifier. 524 * 525 * GTK+ will call this function automatically for #GtkWindow 526 * with custom startup-notification identifier unless 527 * gtk_window_set_auto_startup_notification() is called to 528 * disable that feature. 529 * 530 * Params: 531 * startupId = a startup-notification identifier, for which 532 * notification process should be completed 533 * 534 * Since: 3.0 535 */ 536 public void notifyStartupComplete(string startupId) 537 { 538 gdk_display_notify_startup_complete(gdkDisplay, Str.toStringz(startupId)); 539 } 540 541 /** 542 * Gets a copy of the first #GdkEvent in the @display’s event queue, without 543 * removing the event from the queue. (Note that this function will 544 * not get more events from the windowing system. It only checks the events 545 * that have already been moved to the GDK event queue.) 546 * 547 * Return: a copy of the first #GdkEvent on the event 548 * queue, or %NULL if no events are in the queue. The returned 549 * #GdkEvent should be freed with gdk_event_free(). 550 * 551 * Since: 2.2 552 */ 553 public Event peekEvent() 554 { 555 auto p = gdk_display_peek_event(gdkDisplay); 556 557 if(p is null) 558 { 559 return null; 560 } 561 562 return ObjectG.getDObject!(Event)(cast(GdkEvent*) p); 563 } 564 565 /** 566 * Test if the pointer is grabbed. 567 * 568 * Deprecated: Use gdk_display_device_is_grabbed() instead. 569 * 570 * Return: %TRUE if an active X pointer grab is in effect 571 * 572 * Since: 2.2 573 */ 574 public bool pointerIsGrabbed() 575 { 576 return gdk_display_pointer_is_grabbed(gdkDisplay) != 0; 577 } 578 579 /** 580 * Release any pointer grab. 581 * 582 * Deprecated: Use gdk_device_ungrab(), together with gdk_device_grab() 583 * instead. 584 * 585 * Params: 586 * time = a timestap (e.g. %GDK_CURRENT_TIME). 587 * 588 * Since: 2.2 589 */ 590 public void pointerUngrab(uint time) 591 { 592 gdk_display_pointer_ungrab(gdkDisplay, time); 593 } 594 595 /** 596 * Appends a copy of the given event onto the front of the event 597 * queue for @display. 598 * 599 * Params: 600 * event = a #GdkEvent. 601 * 602 * Since: 2.2 603 */ 604 public void putEvent(Event event) 605 { 606 gdk_display_put_event(gdkDisplay, (event is null) ? null : event.getEventStruct()); 607 } 608 609 /** 610 * Request #GdkEventOwnerChange events for ownership changes 611 * of the selection named by the given atom. 612 * 613 * Params: 614 * selection = the #GdkAtom naming the selection for which 615 * ownership change notification is requested 616 * 617 * Return: whether #GdkEventOwnerChange events will 618 * be sent. 619 * 620 * Since: 2.6 621 */ 622 public bool requestSelectionNotification(GdkAtom selection) 623 { 624 return gdk_display_request_selection_notification(gdkDisplay, selection) != 0; 625 } 626 627 /** 628 * Sets the double click distance (two clicks within this distance 629 * count as a double click and result in a #GDK_2BUTTON_PRESS event). 630 * See also gdk_display_set_double_click_time(). 631 * Applications should not set this, it is a global 632 * user-configured setting. 633 * 634 * Params: 635 * distance = distance in pixels 636 * 637 * Since: 2.4 638 */ 639 public void setDoubleClickDistance(uint distance) 640 { 641 gdk_display_set_double_click_distance(gdkDisplay, distance); 642 } 643 644 /** 645 * Sets the double click time (two clicks within this time interval 646 * count as a double click and result in a #GDK_2BUTTON_PRESS event). 647 * Applications should not set this, it is a global 648 * user-configured setting. 649 * 650 * Params: 651 * msec = double click time in milliseconds (thousandths of a second) 652 * 653 * Since: 2.2 654 */ 655 public void setDoubleClickTime(uint msec) 656 { 657 gdk_display_set_double_click_time(gdkDisplay, msec); 658 } 659 660 /** 661 * Issues a request to the clipboard manager to store the 662 * clipboard data. On X11, this is a special program that works 663 * according to the 664 * [FreeDesktop Clipboard Specification](http://www.freedesktop.org/Standards/clipboard-manager-spec). 665 * 666 * Params: 667 * clipboardWindow = a #GdkWindow belonging to the clipboard owner 668 * time = a timestamp 669 * targets = an array of targets 670 * that should be saved, or %NULL 671 * if all available targets should be saved. 672 * nTargets = length of the @targets array 673 * 674 * Since: 2.6 675 */ 676 public void storeClipboard(Window clipboardWindow, uint time, GdkAtom[] targets) 677 { 678 gdk_display_store_clipboard(gdkDisplay, (clipboardWindow is null) ? null : clipboardWindow.getWindowStruct(), time, targets.ptr, cast(int)targets.length); 679 } 680 681 /** 682 * Returns whether the speicifed display supports clipboard 683 * persistance; i.e. if it’s possible to store the clipboard data after an 684 * application has quit. On X11 this checks if a clipboard daemon is 685 * running. 686 * 687 * Return: %TRUE if the display supports clipboard persistance. 688 * 689 * Since: 2.6 690 */ 691 public bool supportsClipboardPersistence() 692 { 693 return gdk_display_supports_clipboard_persistence(gdkDisplay) != 0; 694 } 695 696 /** 697 * Returns %TRUE if gdk_window_set_composited() can be used 698 * to redirect drawing on the window using compositing. 699 * 700 * Currently this only works on X11 with XComposite and 701 * XDamage extensions available. 702 * 703 * Deprecated: Compositing is an outdated technology that 704 * only ever worked on X11. 705 * 706 * Return: %TRUE if windows may be composited. 707 * 708 * Since: 2.12 709 */ 710 public bool supportsComposite() 711 { 712 return gdk_display_supports_composite(gdkDisplay) != 0; 713 } 714 715 /** 716 * Returns %TRUE if cursors can use an 8bit alpha channel 717 * on @display. Otherwise, cursors are restricted to bilevel 718 * alpha (i.e. a mask). 719 * 720 * Return: whether cursors can have alpha channels. 721 * 722 * Since: 2.4 723 */ 724 public bool supportsCursorAlpha() 725 { 726 return gdk_display_supports_cursor_alpha(gdkDisplay) != 0; 727 } 728 729 /** 730 * Returns %TRUE if multicolored cursors are supported 731 * on @display. Otherwise, cursors have only a forground 732 * and a background color. 733 * 734 * Return: whether cursors can have multiple colors. 735 * 736 * Since: 2.4 737 */ 738 public bool supportsCursorColor() 739 { 740 return gdk_display_supports_cursor_color(gdkDisplay) != 0; 741 } 742 743 /** 744 * Returns %TRUE if gdk_window_input_shape_combine_mask() can 745 * be used to modify the input shape of windows on @display. 746 * 747 * Return: %TRUE if windows with modified input shape are supported 748 * 749 * Since: 2.10 750 */ 751 public bool supportsInputShapes() 752 { 753 return gdk_display_supports_input_shapes(gdkDisplay) != 0; 754 } 755 756 /** 757 * Returns whether #GdkEventOwnerChange events will be 758 * sent when the owner of a selection changes. 759 * 760 * Return: whether #GdkEventOwnerChange events will 761 * be sent. 762 * 763 * Since: 2.6 764 */ 765 public bool supportsSelectionNotification() 766 { 767 return gdk_display_supports_selection_notification(gdkDisplay) != 0; 768 } 769 770 /** 771 * Returns %TRUE if gdk_window_shape_combine_mask() can 772 * be used to create shaped windows on @display. 773 * 774 * Return: %TRUE if shaped windows are supported 775 * 776 * Since: 2.10 777 */ 778 public bool supportsShapes() 779 { 780 return gdk_display_supports_shapes(gdkDisplay) != 0; 781 } 782 783 /** 784 * Flushes any requests queued for the windowing system and waits until all 785 * requests have been handled. This is often used for making sure that the 786 * display is synchronized with the current state of the program. Calling 787 * gdk_display_sync() before gdk_error_trap_pop() makes sure that any errors 788 * generated from earlier requests are handled before the error trap is 789 * removed. 790 * 791 * This is most useful for X11. On windowing systems where requests are 792 * handled synchronously, this function will do nothing. 793 * 794 * Since: 2.2 795 */ 796 public void sync() 797 { 798 gdk_display_sync(gdkDisplay); 799 } 800 801 /** 802 * Warps the pointer of @display to the point @x,@y on 803 * the screen @screen, unless the pointer is confined 804 * to a window by a grab, in which case it will be moved 805 * as far as allowed by the grab. Warping the pointer 806 * creates events as if the user had moved the mouse 807 * instantaneously to the destination. 808 * 809 * Note that the pointer should normally be under the 810 * control of the user. This function was added to cover 811 * some rare use cases like keyboard navigation support 812 * for the color picker in the #GtkColorSelectionDialog. 813 * 814 * Deprecated: Use gdk_device_warp() instead. 815 * 816 * Params: 817 * screen = the screen of @display to warp the pointer to 818 * x = the x coordinate of the destination 819 * y = the y coordinate of the destination 820 * 821 * Since: 2.8 822 */ 823 public void warpPointer(Screen screen, int x, int y) 824 { 825 gdk_display_warp_pointer(gdkDisplay, (screen is null) ? null : screen.getScreenStruct(), x, y); 826 } 827 828 int[string] connectedSignals; 829 830 void delegate(bool, Display)[] onClosedListeners; 831 /** 832 * The ::closed signal is emitted when the connection to the windowing 833 * system for @display is closed. 834 * 835 * Params: 836 * isError = %TRUE if the display was closed due to an error 837 * 838 * Since: 2.2 839 */ 840 void addOnClosed(void delegate(bool, Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 841 { 842 if ( "closed" !in connectedSignals ) 843 { 844 Signals.connectData( 845 this, 846 "closed", 847 cast(GCallback)&callBackClosed, 848 cast(void*)this, 849 null, 850 connectFlags); 851 connectedSignals["closed"] = 1; 852 } 853 onClosedListeners ~= dlg; 854 } 855 extern(C) static void callBackClosed(GdkDisplay* displayStruct, bool isError, Display _display) 856 { 857 foreach ( void delegate(bool, Display) dlg; _display.onClosedListeners ) 858 { 859 dlg(isError, _display); 860 } 861 } 862 863 void delegate(Display)[] onOpenedListeners; 864 /** 865 * The ::opened signal is emitted when the connection to the windowing 866 * system for @display is opened. 867 */ 868 void addOnOpened(void delegate(Display) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 869 { 870 if ( "opened" !in connectedSignals ) 871 { 872 Signals.connectData( 873 this, 874 "opened", 875 cast(GCallback)&callBackOpened, 876 cast(void*)this, 877 null, 878 connectFlags); 879 connectedSignals["opened"] = 1; 880 } 881 onOpenedListeners ~= dlg; 882 } 883 extern(C) static void callBackOpened(GdkDisplay* displayStruct, Display _display) 884 { 885 foreach ( void delegate(Display) dlg; _display.onOpenedListeners ) 886 { 887 dlg(_display); 888 } 889 } 890 }