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.Screen; 26 27 private import cairo.FontOption; 28 private import gdk.Display; 29 private import gdk.Visual; 30 private import gdk.Window; 31 private import glib.ListG; 32 private import glib.Str; 33 private import gobject.ObjectG; 34 private import gobject.Signals; 35 private import gobject.Value; 36 private import gtkc.gdk; 37 public import gtkc.gdktypes; 38 39 40 /** 41 * #GdkScreen objects are the GDK representation of the screen on 42 * which windows can be displayed and on which the pointer moves. 43 * X originally identified screens with physical screens, but 44 * nowadays it is more common to have a single #GdkScreen which 45 * combines several physical monitors (see gdk_screen_get_n_monitors()). 46 * 47 * GdkScreen is used throughout GDK and GTK+ to specify which screen 48 * the top level windows are to be displayed on. it is also used to 49 * query the screen specification and default settings such as 50 * the default visual (gdk_screen_get_system_visual()), the dimensions 51 * of the physical monitors (gdk_screen_get_monitor_geometry()), etc. 52 */ 53 public class Screen : ObjectG 54 { 55 /** the main Gtk struct */ 56 protected GdkScreen* gdkScreen; 57 58 /** Get the main Gtk struct */ 59 public GdkScreen* getScreenStruct() 60 { 61 return gdkScreen; 62 } 63 64 /** the main Gtk struct as a void* */ 65 protected override void* getStruct() 66 { 67 return cast(void*)gdkScreen; 68 } 69 70 protected override void setStruct(GObject* obj) 71 { 72 gdkScreen = cast(GdkScreen*)obj; 73 super.setStruct(obj); 74 } 75 76 /** 77 * Sets our main struct and passes it to the parent class. 78 */ 79 public this (GdkScreen* gdkScreen, bool ownedRef = false) 80 { 81 this.gdkScreen = gdkScreen; 82 super(cast(GObject*)gdkScreen, ownedRef); 83 } 84 85 86 /** */ 87 public static GType getType() 88 { 89 return gdk_screen_get_type(); 90 } 91 92 /** 93 * Gets the default screen for the default display. (See 94 * gdk_display_get_default ()). 95 * 96 * Return: a #GdkScreen, or %NULL if 97 * there is no default display. 98 * 99 * Since: 2.2 100 */ 101 public static Screen getDefault() 102 { 103 auto p = gdk_screen_get_default(); 104 105 if(p is null) 106 { 107 return null; 108 } 109 110 return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p); 111 } 112 113 /** 114 * Gets the height of the default screen in pixels. The returned 115 * size is in ”application pixels”, not in ”device pixels” (see 116 * gdk_screen_get_monitor_scale_factor()). 117 * 118 * Deprecated: Use per-monitor information 119 * 120 * Return: the height of the default screen in pixels. 121 */ 122 public static int height() 123 { 124 return gdk_screen_height(); 125 } 126 127 /** 128 * Returns the height of the default screen in millimeters. 129 * Note that on many X servers this value will not be correct. 130 * 131 * Deprecated: Use per-monitor information 132 * 133 * Return: the height of the default screen in millimeters, 134 * though it is not always correct. 135 */ 136 public static int heightMm() 137 { 138 return gdk_screen_height_mm(); 139 } 140 141 /** 142 * Gets the width of the default screen in pixels. The returned 143 * size is in ”application pixels”, not in ”device pixels” (see 144 * gdk_screen_get_monitor_scale_factor()). 145 * 146 * Deprecated: Use per-monitor information 147 * 148 * Return: the width of the default screen in pixels. 149 */ 150 public static int width() 151 { 152 return gdk_screen_width(); 153 } 154 155 /** 156 * Returns the width of the default screen in millimeters. 157 * Note that on many X servers this value will not be correct. 158 * 159 * Deprecated: Use per-monitor information 160 * 161 * Return: the width of the default screen in millimeters, 162 * though it is not always correct. 163 */ 164 public static int widthMm() 165 { 166 return gdk_screen_width_mm(); 167 } 168 169 /** 170 * Returns the screen’s currently active window. 171 * 172 * On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property 173 * on the root window, as described in the 174 * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec). 175 * If there is no currently currently active 176 * window, or the window manager does not support the 177 * _NET_ACTIVE_WINDOW hint, this function returns %NULL. 178 * 179 * On other platforms, this function may return %NULL, depending on whether 180 * it is implementable on that platform. 181 * 182 * The returned window should be unrefed using g_object_unref() when 183 * no longer needed. 184 * 185 * Return: the currently active window, 186 * or %NULL. 187 * 188 * Since: 2.10 189 */ 190 public Window getActiveWindow() 191 { 192 auto p = gdk_screen_get_active_window(gdkScreen); 193 194 if(p is null) 195 { 196 return null; 197 } 198 199 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p, true); 200 } 201 202 /** 203 * Gets the display to which the @screen belongs. 204 * 205 * Return: the display to which @screen belongs 206 * 207 * Since: 2.2 208 */ 209 public Display getDisplay() 210 { 211 auto p = gdk_screen_get_display(gdkScreen); 212 213 if(p is null) 214 { 215 return null; 216 } 217 218 return ObjectG.getDObject!(Display)(cast(GdkDisplay*) p); 219 } 220 221 /** 222 * Gets any options previously set with gdk_screen_set_font_options(). 223 * 224 * Return: the current font options, or %NULL if no 225 * default font options have been set. 226 * 227 * Since: 2.10 228 */ 229 public FontOption getFontOptions() 230 { 231 auto p = gdk_screen_get_font_options(gdkScreen); 232 233 if(p is null) 234 { 235 return null; 236 } 237 238 return new FontOption(cast(cairo_font_options_t*) p); 239 } 240 241 /** 242 * Gets the height of @screen in pixels. The returned size is in 243 * ”application pixels”, not in ”device pixels” (see 244 * gdk_screen_get_monitor_scale_factor()). 245 * 246 * Deprecated: Use per-monitor information instead 247 * 248 * Return: the height of @screen in pixels. 249 * 250 * Since: 2.2 251 */ 252 public int getHeight() 253 { 254 return gdk_screen_get_height(gdkScreen); 255 } 256 257 /** 258 * Returns the height of @screen in millimeters. 259 * 260 * Note that this value is somewhat ill-defined when the screen 261 * has multiple monitors of different resolution. It is recommended 262 * to use the monitor dimensions instead. 263 * 264 * Deprecated: Use per-monitor information instead 265 * 266 * Return: the heigth of @screen in millimeters. 267 * 268 * Since: 2.2 269 */ 270 public int getHeightMm() 271 { 272 return gdk_screen_get_height_mm(gdkScreen); 273 } 274 275 /** 276 * Returns the monitor number in which the point (@x,@y) is located. 277 * 278 * Deprecated: Use gdk_display_get_monitor_at_point() instead 279 * 280 * Params: 281 * x = the x coordinate in the virtual screen. 282 * y = the y coordinate in the virtual screen. 283 * 284 * Return: the monitor number in which the point (@x,@y) lies, or 285 * a monitor close to (@x,@y) if the point is not in any monitor. 286 * 287 * Since: 2.2 288 */ 289 public int getMonitorAtPoint(int x, int y) 290 { 291 return gdk_screen_get_monitor_at_point(gdkScreen, x, y); 292 } 293 294 /** 295 * Returns the number of the monitor in which the largest area of the 296 * bounding rectangle of @window resides. 297 * 298 * Deprecated: Use gdk_display_get_monitor_at_window() instead 299 * 300 * Params: 301 * window = a #GdkWindow 302 * 303 * Return: the monitor number in which most of @window is located, 304 * or if @window does not intersect any monitors, a monitor, 305 * close to @window. 306 * 307 * Since: 2.2 308 */ 309 public int getMonitorAtWindow(Window window) 310 { 311 return gdk_screen_get_monitor_at_window(gdkScreen, (window is null) ? null : window.getWindowStruct()); 312 } 313 314 /** 315 * Retrieves the #GdkRectangle representing the size and position of 316 * the individual monitor within the entire screen area. The returned 317 * geometry is in ”application pixels”, not in ”device pixels” (see 318 * gdk_screen_get_monitor_scale_factor()). 319 * 320 * Monitor numbers start at 0. To obtain the number of monitors of 321 * @screen, use gdk_screen_get_n_monitors(). 322 * 323 * Note that the size of the entire screen area can be retrieved via 324 * gdk_screen_get_width() and gdk_screen_get_height(). 325 * 326 * Deprecated: Use gdk_monitor_get_geometry() instead 327 * 328 * Params: 329 * monitorNum = the monitor number 330 * dest = a #GdkRectangle to be filled with 331 * the monitor geometry 332 * 333 * Since: 2.2 334 */ 335 public void getMonitorGeometry(int monitorNum, out GdkRectangle dest) 336 { 337 gdk_screen_get_monitor_geometry(gdkScreen, monitorNum, &dest); 338 } 339 340 /** 341 * Gets the height in millimeters of the specified monitor. 342 * 343 * Deprecated: Use gdk_monitor_get_height_mm() instead 344 * 345 * Params: 346 * monitorNum = number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) 347 * 348 * Return: the height of the monitor, or -1 if not available 349 * 350 * Since: 2.14 351 */ 352 public int getMonitorHeightMm(int monitorNum) 353 { 354 return gdk_screen_get_monitor_height_mm(gdkScreen, monitorNum); 355 } 356 357 /** 358 * Returns the output name of the specified monitor. 359 * Usually something like VGA, DVI, or TV, not the actual 360 * product name of the display device. 361 * 362 * Deprecated: Use gdk_monitor_get_model() instead 363 * 364 * Params: 365 * monitorNum = number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) 366 * 367 * Return: a newly-allocated string containing the name 368 * of the monitor, or %NULL if the name cannot be determined 369 * 370 * Since: 2.14 371 */ 372 public string getMonitorPlugName(int monitorNum) 373 { 374 auto retStr = gdk_screen_get_monitor_plug_name(gdkScreen, monitorNum); 375 376 scope(exit) Str.freeString(retStr); 377 return Str.toString(retStr); 378 } 379 380 /** 381 * Returns the internal scale factor that maps from monitor coordinates 382 * to the actual device pixels. On traditional systems this is 1, but 383 * on very high density outputs this can be a higher value (often 2). 384 * 385 * This can be used if you want to create pixel based data for a 386 * particular monitor, but most of the time you’re drawing to a window 387 * where it is better to use gdk_window_get_scale_factor() instead. 388 * 389 * Deprecated: Use gdk_monitor_get_scale_factor() instead 390 * 391 * Params: 392 * monitorNum = number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) 393 * 394 * Return: the scale factor 395 * 396 * Since: 3.10 397 */ 398 public int getMonitorScaleFactor(int monitorNum) 399 { 400 return gdk_screen_get_monitor_scale_factor(gdkScreen, monitorNum); 401 } 402 403 /** 404 * Gets the width in millimeters of the specified monitor, if available. 405 * 406 * Deprecated: Use gdk_monitor_get_width_mm() instead 407 * 408 * Params: 409 * monitorNum = number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) 410 * 411 * Return: the width of the monitor, or -1 if not available 412 * 413 * Since: 2.14 414 */ 415 public int getMonitorWidthMm(int monitorNum) 416 { 417 return gdk_screen_get_monitor_width_mm(gdkScreen, monitorNum); 418 } 419 420 /** 421 * Retrieves the #GdkRectangle representing the size and position of 422 * the “work area” on a monitor within the entire screen area. The returned 423 * geometry is in ”application pixels”, not in ”device pixels” (see 424 * gdk_screen_get_monitor_scale_factor()). 425 * 426 * The work area should be considered when positioning menus and 427 * similar popups, to avoid placing them below panels, docks or other 428 * desktop components. 429 * 430 * Note that not all backends may have a concept of workarea. This 431 * function will return the monitor geometry if a workarea is not 432 * available, or does not apply. 433 * 434 * Monitor numbers start at 0. To obtain the number of monitors of 435 * @screen, use gdk_screen_get_n_monitors(). 436 * 437 * Deprecated: Use gdk_monitor_get_workarea() instead 438 * 439 * Params: 440 * monitorNum = the monitor number 441 * dest = a #GdkRectangle to be filled with 442 * the monitor workarea 443 * 444 * Since: 3.4 445 */ 446 public void getMonitorWorkarea(int monitorNum, out GdkRectangle dest) 447 { 448 gdk_screen_get_monitor_workarea(gdkScreen, monitorNum, &dest); 449 } 450 451 /** 452 * Returns the number of monitors which @screen consists of. 453 * 454 * Deprecated: Use gdk_display_get_n_monitors() instead 455 * 456 * Return: number of monitors which @screen consists of 457 * 458 * Since: 2.2 459 */ 460 public int getNMonitors() 461 { 462 return gdk_screen_get_n_monitors(gdkScreen); 463 } 464 465 /** 466 * Gets the index of @screen among the screens in the display 467 * to which it belongs. (See gdk_screen_get_display()) 468 * 469 * Return: the index 470 * 471 * Since: 2.2 472 */ 473 public int getNumber() 474 { 475 return gdk_screen_get_number(gdkScreen); 476 } 477 478 /** 479 * Gets the primary monitor for @screen. The primary monitor 480 * is considered the monitor where the “main desktop” lives. 481 * While normal application windows typically allow the window 482 * manager to place the windows, specialized desktop applications 483 * such as panels should place themselves on the primary monitor. 484 * 485 * If no primary monitor is configured by the user, the return value 486 * will be 0, defaulting to the first monitor. 487 * 488 * Deprecated: Use gdk_display_get_primary_monitor() instead 489 * 490 * Return: An integer index for the primary monitor, or 0 if none is configured. 491 * 492 * Since: 2.20 493 */ 494 public int getPrimaryMonitor() 495 { 496 return gdk_screen_get_primary_monitor(gdkScreen); 497 } 498 499 /** 500 * Gets the resolution for font handling on the screen; see 501 * gdk_screen_set_resolution() for full details. 502 * 503 * Return: the current resolution, or -1 if no resolution 504 * has been set. 505 * 506 * Since: 2.10 507 */ 508 public double getResolution() 509 { 510 return gdk_screen_get_resolution(gdkScreen); 511 } 512 513 /** 514 * Gets a visual to use for creating windows with an alpha channel. 515 * The windowing system on which GTK+ is running 516 * may not support this capability, in which case %NULL will 517 * be returned. Even if a non-%NULL value is returned, its 518 * possible that the window’s alpha channel won’t be honored 519 * when displaying the window on the screen: in particular, for 520 * X an appropriate windowing manager and compositing manager 521 * must be running to provide appropriate display. 522 * 523 * This functionality is not implemented in the Windows backend. 524 * 525 * For setting an overall opacity for a top-level window, see 526 * gdk_window_set_opacity(). 527 * 528 * Return: a visual to use for windows 529 * with an alpha channel or %NULL if the capability is not 530 * available. 531 * 532 * Since: 2.8 533 */ 534 public Visual getRgbaVisual() 535 { 536 auto p = gdk_screen_get_rgba_visual(gdkScreen); 537 538 if(p is null) 539 { 540 return null; 541 } 542 543 return ObjectG.getDObject!(Visual)(cast(GdkVisual*) p); 544 } 545 546 /** 547 * Gets the root window of @screen. 548 * 549 * Return: the root window 550 * 551 * Since: 2.2 552 */ 553 public Window getRootWindow() 554 { 555 auto p = gdk_screen_get_root_window(gdkScreen); 556 557 if(p is null) 558 { 559 return null; 560 } 561 562 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 563 } 564 565 /** 566 * Retrieves a desktop-wide setting such as double-click time 567 * for the #GdkScreen @screen. 568 * 569 * FIXME needs a list of valid settings here, or a link to 570 * more information. 571 * 572 * Params: 573 * name = the name of the setting 574 * value = location to store the value of the setting 575 * 576 * Return: %TRUE if the setting existed and a value was stored 577 * in @value, %FALSE otherwise. 578 * 579 * Since: 2.2 580 */ 581 public bool getSetting(string name, Value value) 582 { 583 return gdk_screen_get_setting(gdkScreen, Str.toStringz(name), (value is null) ? null : value.getValueStruct()) != 0; 584 } 585 586 /** 587 * Get the system’s default visual for @screen. 588 * This is the visual for the root window of the display. 589 * The return value should not be freed. 590 * 591 * Return: the system visual 592 * 593 * Since: 2.2 594 */ 595 public Visual getSystemVisual() 596 { 597 auto p = gdk_screen_get_system_visual(gdkScreen); 598 599 if(p is null) 600 { 601 return null; 602 } 603 604 return ObjectG.getDObject!(Visual)(cast(GdkVisual*) p); 605 } 606 607 /** 608 * Obtains a list of all toplevel windows known to GDK on the screen @screen. 609 * A toplevel window is a child of the root window (see 610 * gdk_get_default_root_window()). 611 * 612 * The returned list should be freed with g_list_free(), but 613 * its elements need not be freed. 614 * 615 * Return: list of toplevel windows, free with g_list_free() 616 * 617 * Since: 2.2 618 */ 619 public ListG getToplevelWindows() 620 { 621 auto p = gdk_screen_get_toplevel_windows(gdkScreen); 622 623 if(p is null) 624 { 625 return null; 626 } 627 628 return new ListG(cast(GList*) p); 629 } 630 631 /** 632 * Gets the width of @screen in pixels. The returned size is in 633 * ”application pixels”, not in ”device pixels” (see 634 * gdk_screen_get_monitor_scale_factor()). 635 * 636 * Deprecated: Use per-monitor information instead 637 * 638 * Return: the width of @screen in pixels. 639 * 640 * Since: 2.2 641 */ 642 public int getWidth() 643 { 644 return gdk_screen_get_width(gdkScreen); 645 } 646 647 /** 648 * Gets the width of @screen in millimeters. 649 * 650 * Note that this value is somewhat ill-defined when the screen 651 * has multiple monitors of different resolution. It is recommended 652 * to use the monitor dimensions instead. 653 * 654 * Deprecated: Use per-monitor information instead 655 * 656 * Return: the width of @screen in millimeters. 657 * 658 * Since: 2.2 659 */ 660 public int getWidthMm() 661 { 662 return gdk_screen_get_width_mm(gdkScreen); 663 } 664 665 /** 666 * Returns a #GList of #GdkWindows representing the current 667 * window stack. 668 * 669 * On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING 670 * property on the root window, as described in the 671 * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec). 672 * If the window manager does not support the 673 * _NET_CLIENT_LIST_STACKING hint, this function returns %NULL. 674 * 675 * On other platforms, this function may return %NULL, depending on whether 676 * it is implementable on that platform. 677 * 678 * The returned list is newly allocated and owns references to the 679 * windows it contains, so it should be freed using g_list_free() and 680 * its windows unrefed using g_object_unref() when no longer needed. 681 * 682 * Return: a 683 * list of #GdkWindows for the current window stack, or %NULL. 684 * 685 * Since: 2.10 686 */ 687 public ListG getWindowStack() 688 { 689 auto p = gdk_screen_get_window_stack(gdkScreen); 690 691 if(p is null) 692 { 693 return null; 694 } 695 696 return new ListG(cast(GList*) p, true); 697 } 698 699 /** 700 * Returns whether windows with an RGBA visual can reasonably 701 * be expected to have their alpha channel drawn correctly on 702 * the screen. 703 * 704 * On X11 this function returns whether a compositing manager is 705 * compositing @screen. 706 * 707 * Return: Whether windows with RGBA visuals can reasonably be 708 * expected to have their alpha channels drawn correctly on the screen. 709 * 710 * Since: 2.10 711 */ 712 public bool isComposited() 713 { 714 return gdk_screen_is_composited(gdkScreen) != 0; 715 } 716 717 /** 718 * Lists the available visuals for the specified @screen. 719 * A visual describes a hardware image data format. 720 * For example, a visual might support 24-bit color, or 8-bit color, 721 * and might expect pixels to be in a certain format. 722 * 723 * Call g_list_free() on the return value when you’re finished with it. 724 * 725 * Return: a list of visuals; the list must be freed, but not its contents 726 * 727 * Since: 2.2 728 */ 729 public ListG listVisuals() 730 { 731 auto p = gdk_screen_list_visuals(gdkScreen); 732 733 if(p is null) 734 { 735 return null; 736 } 737 738 return new ListG(cast(GList*) p); 739 } 740 741 /** 742 * Determines the name to pass to gdk_display_open() to get 743 * a #GdkDisplay with this screen as the default screen. 744 * 745 * Return: a newly allocated string, free with g_free() 746 * 747 * Since: 2.2 748 */ 749 public string makeDisplayName() 750 { 751 auto retStr = gdk_screen_make_display_name(gdkScreen); 752 753 scope(exit) Str.freeString(retStr); 754 return Str.toString(retStr); 755 } 756 757 /** 758 * Sets the default font options for the screen. These 759 * options will be set on any #PangoContext’s newly created 760 * with gdk_pango_context_get_for_screen(). Changing the 761 * default set of font options does not affect contexts that 762 * have already been created. 763 * 764 * Params: 765 * options = a #cairo_font_options_t, or %NULL to unset any 766 * previously set default font options. 767 * 768 * Since: 2.10 769 */ 770 public void setFontOptions(FontOption options) 771 { 772 gdk_screen_set_font_options(gdkScreen, (options is null) ? null : options.getFontOptionStruct()); 773 } 774 775 /** 776 * Sets the resolution for font handling on the screen. This is a 777 * scale factor between points specified in a #PangoFontDescription 778 * and cairo units. The default value is 96, meaning that a 10 point 779 * font will be 13 units high. (10 * 96. / 72. = 13.3). 780 * 781 * Params: 782 * dpi = the resolution in “dots per inch”. (Physical inches aren’t actually 783 * involved; the terminology is conventional.) 784 * 785 * Since: 2.10 786 */ 787 public void setResolution(double dpi) 788 { 789 gdk_screen_set_resolution(gdkScreen, dpi); 790 } 791 792 int[string] connectedSignals; 793 794 void delegate(Screen)[] onCompositedChangedListeners; 795 /** 796 * The ::composited-changed signal is emitted when the composited 797 * status of the screen changes 798 * 799 * Since: 2.10 800 */ 801 void addOnCompositedChanged(void delegate(Screen) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 802 { 803 if ( "composited-changed" !in connectedSignals ) 804 { 805 Signals.connectData( 806 this, 807 "composited-changed", 808 cast(GCallback)&callBackCompositedChanged, 809 cast(void*)this, 810 null, 811 connectFlags); 812 connectedSignals["composited-changed"] = 1; 813 } 814 onCompositedChangedListeners ~= dlg; 815 } 816 extern(C) static void callBackCompositedChanged(GdkScreen* screenStruct, Screen _screen) 817 { 818 foreach ( void delegate(Screen) dlg; _screen.onCompositedChangedListeners ) 819 { 820 dlg(_screen); 821 } 822 } 823 824 void delegate(Screen)[] onMonitorsChangedListeners; 825 /** 826 * The ::monitors-changed signal is emitted when the number, size 827 * or position of the monitors attached to the screen change. 828 * 829 * Only for X11 and OS X for now. A future implementation for Win32 830 * may be a possibility. 831 * 832 * Since: 2.14 833 */ 834 void addOnMonitorsChanged(void delegate(Screen) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 835 { 836 if ( "monitors-changed" !in connectedSignals ) 837 { 838 Signals.connectData( 839 this, 840 "monitors-changed", 841 cast(GCallback)&callBackMonitorsChanged, 842 cast(void*)this, 843 null, 844 connectFlags); 845 connectedSignals["monitors-changed"] = 1; 846 } 847 onMonitorsChangedListeners ~= dlg; 848 } 849 extern(C) static void callBackMonitorsChanged(GdkScreen* screenStruct, Screen _screen) 850 { 851 foreach ( void delegate(Screen) dlg; _screen.onMonitorsChangedListeners ) 852 { 853 dlg(_screen); 854 } 855 } 856 857 void delegate(Screen)[] onSizeChangedListeners; 858 /** 859 * The ::size-changed signal is emitted when the pixel width or 860 * height of a screen changes. 861 * 862 * Since: 2.2 863 */ 864 void addOnSizeChanged(void delegate(Screen) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 865 { 866 if ( "size-changed" !in connectedSignals ) 867 { 868 Signals.connectData( 869 this, 870 "size-changed", 871 cast(GCallback)&callBackSizeChanged, 872 cast(void*)this, 873 null, 874 connectFlags); 875 connectedSignals["size-changed"] = 1; 876 } 877 onSizeChangedListeners ~= dlg; 878 } 879 extern(C) static void callBackSizeChanged(GdkScreen* screenStruct, Screen _screen) 880 { 881 foreach ( void delegate(Screen) dlg; _screen.onSizeChangedListeners ) 882 { 883 dlg(_screen); 884 } 885 } 886 }