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 = GdkScreen.html 27 * outPack = gdk 28 * outFile = Screen 29 * strct = GdkScreen 30 * realStrct= 31 * ctorStrct= 32 * clss = Screen 33 * interf = 34 * class Code: No 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gdk_screen_ 41 * omit structs: 42 * omit prefixes: 43 * omit code: 44 * omit signals: 45 * imports: 46 * - glib.Str 47 * - glib.ErrorG 48 * - glib.GException 49 * - cairo.FontOption 50 * - gdk.Screen 51 * - gdk.Colormap 52 * - gdk.Visual 53 * - gdk.Window 54 * - gdk.Display 55 * - glib.ListG 56 * - gdk.Rectangle 57 * - gdk.Event 58 * - gobject.Value 59 * structWrap: 60 * - GList* -> ListG 61 * - GValue* -> Value 62 * - GdkColormap* -> Colormap 63 * - GdkDisplay* -> Display 64 * - GdkEvent* -> Event 65 * - GdkRectangle* -> Rectangle 66 * - GdkScreen* -> Screen 67 * - GdkVisual* -> Visual 68 * - GdkWindow* -> Window 69 * - cairo_font_options_t* -> FontOption 70 * module aliases: 71 * local aliases: 72 * overrides: 73 */ 74 75 module gdk.Screen; 76 77 public import gtkc.gdktypes; 78 79 private import gtkc.gdk; 80 private import glib.ConstructionException; 81 private import gobject.ObjectG; 82 83 private import gobject.Signals; 84 public import gtkc.gdktypes; 85 86 private import glib.Str; 87 private import glib.ErrorG; 88 private import glib.GException; 89 private import cairo.FontOption; 90 private import gdk.Screen; 91 private import gdk.Colormap; 92 private import gdk.Visual; 93 private import gdk.Window; 94 private import gdk.Display; 95 private import glib.ListG; 96 private import gdk.Rectangle; 97 private import gdk.Event; 98 private import gobject.Value; 99 100 101 102 private import gobject.ObjectG; 103 104 /** 105 * Description 106 * GdkScreen objects are the GDK representation of a physical screen. It is used 107 * throughout GDK and GTK+ to specify which screen the top level windows 108 * are to be displayed on. 109 * It is also used to query the screen specification and default settings such as 110 * the default colormap (gdk_screen_get_default_colormap()), 111 * the screen width (gdk_screen_get_width()), etc. 112 * Note that a screen may consist of multiple monitors which are merged to 113 * form a large screen area. 114 */ 115 public class Screen : ObjectG 116 { 117 118 /** the main Gtk struct */ 119 protected GdkScreen* gdkScreen; 120 121 122 public GdkScreen* getScreenStruct() 123 { 124 return gdkScreen; 125 } 126 127 128 /** the main Gtk struct as a void* */ 129 protected override void* getStruct() 130 { 131 return cast(void*)gdkScreen; 132 } 133 134 /** 135 * Sets our main struct and passes it to the parent class 136 */ 137 public this (GdkScreen* gdkScreen) 138 { 139 super(cast(GObject*)gdkScreen); 140 this.gdkScreen = gdkScreen; 141 } 142 143 protected override void setStruct(GObject* obj) 144 { 145 super.setStruct(obj); 146 gdkScreen = cast(GdkScreen*)obj; 147 } 148 149 /** 150 */ 151 int[string] connectedSignals; 152 153 void delegate(Screen)[] onCompositedChangedListeners; 154 /** 155 * The ::composited-changed signal is emitted when the composited 156 * status of the screen changes 157 * Since 2.10 158 */ 159 void addOnCompositedChanged(void delegate(Screen) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 160 { 161 if ( !("composited-changed" in connectedSignals) ) 162 { 163 Signals.connectData( 164 getStruct(), 165 "composited-changed", 166 cast(GCallback)&callBackCompositedChanged, 167 cast(void*)this, 168 null, 169 connectFlags); 170 connectedSignals["composited-changed"] = 1; 171 } 172 onCompositedChangedListeners ~= dlg; 173 } 174 extern(C) static void callBackCompositedChanged(GdkScreen* screenStruct, Screen _screen) 175 { 176 foreach ( void delegate(Screen) dlg ; _screen.onCompositedChangedListeners ) 177 { 178 dlg(_screen); 179 } 180 } 181 182 void delegate(Screen)[] onMonitorsChangedListeners; 183 /** 184 * The ::monitors-changed signal is emitted when the number, size 185 * or position of the monitors attached to the screen change. 186 * Only for X11 and OS X for now. A future implementation for Win32 187 * may be a possibility. 188 * Since 2.14 189 */ 190 void addOnMonitorsChanged(void delegate(Screen) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 191 { 192 if ( !("monitors-changed" in connectedSignals) ) 193 { 194 Signals.connectData( 195 getStruct(), 196 "monitors-changed", 197 cast(GCallback)&callBackMonitorsChanged, 198 cast(void*)this, 199 null, 200 connectFlags); 201 connectedSignals["monitors-changed"] = 1; 202 } 203 onMonitorsChangedListeners ~= dlg; 204 } 205 extern(C) static void callBackMonitorsChanged(GdkScreen* screenStruct, Screen _screen) 206 { 207 foreach ( void delegate(Screen) dlg ; _screen.onMonitorsChangedListeners ) 208 { 209 dlg(_screen); 210 } 211 } 212 213 void delegate(Screen)[] onSizeChangedListeners; 214 /** 215 * The ::size-changed signal is emitted when the pixel width or 216 * height of a screen changes. 217 * Since 2.2 218 */ 219 void addOnSizeChanged(void delegate(Screen) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0) 220 { 221 if ( !("size-changed" in connectedSignals) ) 222 { 223 Signals.connectData( 224 getStruct(), 225 "size-changed", 226 cast(GCallback)&callBackSizeChanged, 227 cast(void*)this, 228 null, 229 connectFlags); 230 connectedSignals["size-changed"] = 1; 231 } 232 onSizeChangedListeners ~= dlg; 233 } 234 extern(C) static void callBackSizeChanged(GdkScreen* screenStruct, Screen _screen) 235 { 236 foreach ( void delegate(Screen) dlg ; _screen.onSizeChangedListeners ) 237 { 238 dlg(_screen); 239 } 240 } 241 242 243 /** 244 * Gets the default screen for the default display. (See 245 * gdk_display_get_default()). 246 * Since 2.2 247 * Returns: a GdkScreen, or NULL if there is no default display. [transfer none] 248 */ 249 public static Screen getDefault() 250 { 251 // GdkScreen * gdk_screen_get_default (void); 252 auto p = gdk_screen_get_default(); 253 254 if(p is null) 255 { 256 return null; 257 } 258 259 return ObjectG.getDObject!(Screen)(cast(GdkScreen*) p); 260 } 261 262 /** 263 * Gets the default colormap for screen. 264 * Since 2.2 265 * Returns: the default GdkColormap. [transfer none] 266 */ 267 public Colormap getDefaultColormap() 268 { 269 // GdkColormap * gdk_screen_get_default_colormap (GdkScreen *screen); 270 auto p = gdk_screen_get_default_colormap(gdkScreen); 271 272 if(p is null) 273 { 274 return null; 275 } 276 277 return ObjectG.getDObject!(Colormap)(cast(GdkColormap*) p); 278 } 279 280 /** 281 * Sets the default colormap for screen. 282 * Since 2.2 283 * Params: 284 * colormap = a GdkColormap 285 */ 286 public void setDefaultColormap(Colormap colormap) 287 { 288 // void gdk_screen_set_default_colormap (GdkScreen *screen, GdkColormap *colormap); 289 gdk_screen_set_default_colormap(gdkScreen, (colormap is null) ? null : colormap.getColormapStruct()); 290 } 291 292 /** 293 * Gets the system's default colormap for screen 294 * Since 2.2 295 * Returns: the default colormap for screen. [transfer none] 296 */ 297 public Colormap getSystemColormap() 298 { 299 // GdkColormap * gdk_screen_get_system_colormap (GdkScreen *screen); 300 auto p = gdk_screen_get_system_colormap(gdkScreen); 301 302 if(p is null) 303 { 304 return null; 305 } 306 307 return ObjectG.getDObject!(Colormap)(cast(GdkColormap*) p); 308 } 309 310 /** 311 * Get the system's default visual for screen. 312 * This is the visual for the root window of the display. 313 * The return value should not be freed. 314 * Since 2.2 315 * Returns: the system visual. [transfer none] 316 */ 317 public Visual getSystemVisual() 318 { 319 // GdkVisual * gdk_screen_get_system_visual (GdkScreen *screen); 320 auto p = gdk_screen_get_system_visual(gdkScreen); 321 322 if(p is null) 323 { 324 return null; 325 } 326 327 return ObjectG.getDObject!(Visual)(cast(GdkVisual*) p); 328 } 329 330 /** 331 * Warning 332 * gdk_screen_get_rgb_colormap has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_screen_get_system_colormap() 333 * Gets the preferred colormap for rendering image data on screen. 334 * Not a very useful function; historically, GDK could only render RGB 335 * image data to one colormap and visual, but in the current version 336 * it can render to any colormap and visual. So there's no need to 337 * call this function. 338 * Since 2.2 339 * Returns: the preferred colormap. [transfer none] 340 */ 341 public Colormap getRgbColormap() 342 { 343 // GdkColormap * gdk_screen_get_rgb_colormap (GdkScreen *screen); 344 auto p = gdk_screen_get_rgb_colormap(gdkScreen); 345 346 if(p is null) 347 { 348 return null; 349 } 350 351 return ObjectG.getDObject!(Colormap)(cast(GdkColormap*) p); 352 } 353 354 /** 355 * Warning 356 * gdk_screen_get_rgb_visual has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_screen_get_system_visual() 357 * Gets a "preferred visual" chosen by GdkRGB for rendering image data 358 * on screen. In previous versions of 359 * GDK, this was the only visual GdkRGB could use for rendering. In 360 * current versions, it's simply the visual GdkRGB would have chosen as 361 * the optimal one in those previous versions. GdkRGB can now render to 362 * drawables with any visual. 363 * Since 2.2 364 * Returns: The GdkVisual chosen by GdkRGB. [transfer none] 365 */ 366 public Visual getRgbVisual() 367 { 368 // GdkVisual * gdk_screen_get_rgb_visual (GdkScreen *screen); 369 auto p = gdk_screen_get_rgb_visual(gdkScreen); 370 371 if(p is null) 372 { 373 return null; 374 } 375 376 return ObjectG.getDObject!(Visual)(cast(GdkVisual*) p); 377 } 378 379 /** 380 * Gets a colormap to use for creating windows or pixmaps with an 381 * alpha channel. The windowing system on which GTK+ is running 382 * may not support this capability, in which case NULL will 383 * be returned. Even if a non-NULL value is returned, its 384 * possible that the window's alpha channel won't be honored 385 * when displaying the window on the screen: in particular, for 386 * X an appropriate windowing manager and compositing manager 387 * must be running to provide appropriate display. 388 * This functionality is not implemented in the Windows backend. 389 * For setting an overall opacity for a top-level window, see 390 * gdk_window_set_opacity(). 391 * Since 2.8 392 * Returns: a colormap to use for windows with an alpha channel or NULL if the capability is not available. [transfer none] 393 */ 394 public Colormap getRgbaColormap() 395 { 396 // GdkColormap * gdk_screen_get_rgba_colormap (GdkScreen *screen); 397 auto p = gdk_screen_get_rgba_colormap(gdkScreen); 398 399 if(p is null) 400 { 401 return null; 402 } 403 404 return ObjectG.getDObject!(Colormap)(cast(GdkColormap*) p); 405 } 406 407 /** 408 * Gets a visual to use for creating windows or pixmaps with an 409 * alpha channel. See the docs for gdk_screen_get_rgba_colormap() 410 * for caveats. 411 * Since 2.8 412 * Returns: a visual to use for windows with an alpha channel or NULL if the capability is not available. [transfer none] 413 */ 414 public Visual getRgbaVisual() 415 { 416 // GdkVisual * gdk_screen_get_rgba_visual (GdkScreen *screen); 417 auto p = gdk_screen_get_rgba_visual(gdkScreen); 418 419 if(p is null) 420 { 421 return null; 422 } 423 424 return ObjectG.getDObject!(Visual)(cast(GdkVisual*) p); 425 } 426 427 /** 428 * Returns whether windows with an RGBA visual can reasonably 429 * be expected to have their alpha channel drawn correctly on 430 * the screen. 431 * On X11 this function returns whether a compositing manager is 432 * compositing screen. 433 * Since 2.10 434 * Returns: Whether windows with RGBA visuals can reasonably be expected to have their alpha channels drawn correctly on the screen. 435 */ 436 public int isComposited() 437 { 438 // gboolean gdk_screen_is_composited (GdkScreen *screen); 439 return gdk_screen_is_composited(gdkScreen); 440 } 441 442 /** 443 * Gets the root window of screen. 444 * Since 2.2 445 * Returns: the root window. [transfer none] 446 */ 447 public Window getRootWindow() 448 { 449 // GdkWindow * gdk_screen_get_root_window (GdkScreen *screen); 450 auto p = gdk_screen_get_root_window(gdkScreen); 451 452 if(p is null) 453 { 454 return null; 455 } 456 457 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 458 } 459 460 /** 461 * Gets the display to which the screen belongs. 462 * Since 2.2 463 * Returns: the display to which screen belongs 464 */ 465 public Display getDisplay() 466 { 467 // GdkDisplay * gdk_screen_get_display (GdkScreen *screen); 468 auto p = gdk_screen_get_display(gdkScreen); 469 470 if(p is null) 471 { 472 return null; 473 } 474 475 return ObjectG.getDObject!(Display)(cast(GdkDisplay*) p); 476 } 477 478 /** 479 * Gets the index of screen among the screens in the display 480 * to which it belongs. (See gdk_screen_get_display()) 481 * Since 2.2 482 * Returns: the index 483 */ 484 public int getNumber() 485 { 486 // gint gdk_screen_get_number (GdkScreen *screen); 487 return gdk_screen_get_number(gdkScreen); 488 } 489 490 /** 491 * Gets the width of screen in pixels 492 * Since 2.2 493 * Returns: the width of screen in pixels. 494 */ 495 public int getWidth() 496 { 497 // gint gdk_screen_get_width (GdkScreen *screen); 498 return gdk_screen_get_width(gdkScreen); 499 } 500 501 /** 502 * Gets the height of screen in pixels 503 * Since 2.2 504 * Returns: the height of screen in pixels. 505 */ 506 public int getHeight() 507 { 508 // gint gdk_screen_get_height (GdkScreen *screen); 509 return gdk_screen_get_height(gdkScreen); 510 } 511 512 /** 513 * Gets the width of screen in millimeters. 514 * Note that on some X servers this value will not be correct. 515 * Since 2.2 516 * Returns: the width of screen in millimeters. 517 */ 518 public int getWidthMm() 519 { 520 // gint gdk_screen_get_width_mm (GdkScreen *screen); 521 return gdk_screen_get_width_mm(gdkScreen); 522 } 523 524 /** 525 * Returns the height of screen in millimeters. 526 * Note that on some X servers this value will not be correct. 527 * Since 2.2 528 * Returns: the heigth of screen in millimeters. 529 */ 530 public int getHeightMm() 531 { 532 // gint gdk_screen_get_height_mm (GdkScreen *screen); 533 return gdk_screen_get_height_mm(gdkScreen); 534 } 535 536 /** 537 * Lists the available visuals for the specified screen. 538 * A visual describes a hardware image data format. 539 * For example, a visual might support 24-bit color, or 8-bit color, 540 * and might expect pixels to be in a certain format. 541 * Call g_list_free() on the return value when you're finished with it. 542 * Since 2.2 543 * Returns: a list of visuals; the list must be freed, but not its contents. [transfer container][element-type GdkVisual] 544 */ 545 public ListG listVisuals() 546 { 547 // GList * gdk_screen_list_visuals (GdkScreen *screen); 548 auto p = gdk_screen_list_visuals(gdkScreen); 549 550 if(p is null) 551 { 552 return null; 553 } 554 555 return ObjectG.getDObject!(ListG)(cast(GList*) p); 556 } 557 558 /** 559 * Obtains a list of all toplevel windows known to GDK on the screen screen. 560 * A toplevel window is a child of the root window (see 561 * gdk_get_default_root_window()). 562 * The returned list should be freed with g_list_free(), but 563 * its elements need not be freed. 564 * Since 2.2 565 * Returns: list of toplevel windows, free with g_list_free(). [transfer container][element-type GdkWindow] 566 */ 567 public ListG getToplevelWindows() 568 { 569 // GList * gdk_screen_get_toplevel_windows (GdkScreen *screen); 570 auto p = gdk_screen_get_toplevel_windows(gdkScreen); 571 572 if(p is null) 573 { 574 return null; 575 } 576 577 return ObjectG.getDObject!(ListG)(cast(GList*) p); 578 } 579 580 /** 581 * Determines the name to pass to gdk_display_open() to get 582 * a GdkDisplay with this screen as the default screen. 583 * Since 2.2 584 * Returns: a newly allocated string, free with g_free() 585 */ 586 public string makeDisplayName() 587 { 588 // gchar * gdk_screen_make_display_name (GdkScreen *screen); 589 return Str.toString(gdk_screen_make_display_name(gdkScreen)); 590 } 591 592 /** 593 * Returns the number of monitors which screen consists of. 594 * Since 2.2 595 * Returns: number of monitors which screen consists of 596 */ 597 public int getNMonitors() 598 { 599 // gint gdk_screen_get_n_monitors (GdkScreen *screen); 600 return gdk_screen_get_n_monitors(gdkScreen); 601 } 602 603 /** 604 * Gets the primary monitor for screen. The primary monitor 605 * is considered the monitor where the 'main desktop' lives. 606 * While normal application windows typically allow the window 607 * manager to place the windows, specialized desktop applications 608 * such as panels should place themselves on the primary monitor. 609 * If no primary monitor is configured by the user, the return value 610 * will be 0, defaulting to the first monitor. 611 * Since 2.20 612 * Returns: An integer index for the primary monitor, or 0 if none is configured. 613 */ 614 public int getPrimaryMonitor() 615 { 616 // gint gdk_screen_get_primary_monitor (GdkScreen *screen); 617 return gdk_screen_get_primary_monitor(gdkScreen); 618 } 619 620 /** 621 * Retrieves the GdkRectangle representing the size and position of 622 * the individual monitor within the entire screen area. 623 * Note that the size of the entire screen area can be retrieved via 624 * gdk_screen_get_width() and gdk_screen_get_height(). 625 * Since 2.2 626 * Params: 627 * monitorNum = the monitor number, between 0 and gdk_screen_get_n_monitors (screen) 628 * dest = a GdkRectangle to be filled with the monitor geometry 629 */ 630 public void getMonitorGeometry(int monitorNum, Rectangle dest) 631 { 632 // void gdk_screen_get_monitor_geometry (GdkScreen *screen, gint monitor_num, GdkRectangle *dest); 633 gdk_screen_get_monitor_geometry(gdkScreen, monitorNum, (dest is null) ? null : dest.getRectangleStruct()); 634 } 635 636 /** 637 * Returns the monitor number in which the point (x,y) is located. 638 * Since 2.2 639 * Params: 640 * x = the x coordinate in the virtual screen. 641 * y = the y coordinate in the virtual screen. 642 * Returns: the monitor number in which the point (x,y) lies, or a monitor close to (x,y) if the point is not in any monitor. 643 */ 644 public int getMonitorAtPoint(int x, int y) 645 { 646 // gint gdk_screen_get_monitor_at_point (GdkScreen *screen, gint x, gint y); 647 return gdk_screen_get_monitor_at_point(gdkScreen, x, y); 648 } 649 650 /** 651 * Returns the number of the monitor in which the largest area of the 652 * bounding rectangle of window resides. 653 * Since 2.2 654 * Params: 655 * window = a GdkWindow 656 * Returns: the monitor number in which most of window is located, or if window does not intersect any monitors, a monitor, close to window. 657 */ 658 public int getMonitorAtWindow(Window window) 659 { 660 // gint gdk_screen_get_monitor_at_window (GdkScreen *screen, GdkWindow *window); 661 return gdk_screen_get_monitor_at_window(gdkScreen, (window is null) ? null : window.getWindowStruct()); 662 } 663 664 /** 665 * Gets the height in millimeters of the specified monitor. 666 * Since 2.14 667 * Params: 668 * monitorNum = number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) 669 * Returns: the height of the monitor, or -1 if not available 670 */ 671 public int getMonitorHeightMm(int monitorNum) 672 { 673 // gint gdk_screen_get_monitor_height_mm (GdkScreen *screen, gint monitor_num); 674 return gdk_screen_get_monitor_height_mm(gdkScreen, monitorNum); 675 } 676 677 /** 678 * Gets the width in millimeters of the specified monitor, if available. 679 * Since 2.14 680 * Params: 681 * monitorNum = number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) 682 * Returns: the width of the monitor, or -1 if not available 683 */ 684 public int getMonitorWidthMm(int monitorNum) 685 { 686 // gint gdk_screen_get_monitor_width_mm (GdkScreen *screen, gint monitor_num); 687 return gdk_screen_get_monitor_width_mm(gdkScreen, monitorNum); 688 } 689 690 /** 691 * Returns the output name of the specified monitor. 692 * Usually something like VGA, DVI, or TV, not the actual 693 * product name of the display device. 694 * Since 2.14 695 * Params: 696 * monitorNum = number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) 697 * Returns: a newly-allocated string containing the name of the monitor, or NULL if the name cannot be determined 698 */ 699 public string getMonitorPlugName(int monitorNum) 700 { 701 // gchar * gdk_screen_get_monitor_plug_name (GdkScreen *screen, gint monitor_num); 702 return Str.toString(gdk_screen_get_monitor_plug_name(gdkScreen, monitorNum)); 703 } 704 705 /** 706 * On X11, sends an X ClientMessage event to all toplevel windows on 707 * screen. 708 * Toplevel windows are determined by checking for the WM_STATE property, 709 * as described in the Inter-Client Communication Conventions Manual (ICCCM). 710 * If no windows are found with the WM_STATE property set, the message is 711 * sent to all children of the root window. 712 * On Windows, broadcasts a message registered with the name 713 * GDK_WIN32_CLIENT_MESSAGE to all top-level windows. The amount of 714 * data is limited to one long, i.e. four bytes. 715 * Since 2.2 716 * Params: 717 * event = the GdkEvent. 718 */ 719 public void broadcastClientMessage(Event event) 720 { 721 // void gdk_screen_broadcast_client_message (GdkScreen *screen, GdkEvent *event); 722 gdk_screen_broadcast_client_message(gdkScreen, (event is null) ? null : event.getEventStruct()); 723 } 724 725 /** 726 * Retrieves a desktop-wide setting such as double-click time 727 * for the GdkScreen screen. 728 * FIXME needs a list of valid settings here, or a link to 729 * more information. 730 * Since 2.2 731 * Params: 732 * name = the name of the setting 733 * value = location to store the value of the setting 734 * Returns: TRUE if the setting existed and a value was stored in value, FALSE otherwise. 735 */ 736 public int getSetting(string name, Value value) 737 { 738 // gboolean gdk_screen_get_setting (GdkScreen *screen, const gchar *name, GValue *value); 739 return gdk_screen_get_setting(gdkScreen, Str.toStringz(name), (value is null) ? null : value.getValueStruct()); 740 } 741 742 /** 743 * Gets any options previously set with gdk_screen_set_font_options(). 744 * Since 2.10 745 * Returns: the current font options, or NULL if no default font options have been set. 746 */ 747 public FontOption getFontOptions() 748 { 749 // const cairo_font_options_t * gdk_screen_get_font_options (GdkScreen *screen); 750 auto p = gdk_screen_get_font_options(gdkScreen); 751 752 if(p is null) 753 { 754 return null; 755 } 756 757 return ObjectG.getDObject!(FontOption)(cast(cairo_font_options_t*) p); 758 } 759 760 /** 761 * Sets the default font options for the screen. These 762 * options will be set on any PangoContext's newly created 763 * with gdk_pango_context_get_for_screen(). Changing the 764 * default set of font options does not affect contexts that 765 * have already been created. 766 * Since 2.10 767 * Params: 768 * options = a cairo_font_options_t, or NULL to unset any 769 * previously set default font options. [allow-none] 770 */ 771 public void setFontOptions(FontOption options) 772 { 773 // void gdk_screen_set_font_options (GdkScreen *screen, const cairo_font_options_t *options); 774 gdk_screen_set_font_options(gdkScreen, (options is null) ? null : options.getFontOptionStruct()); 775 } 776 777 /** 778 * Gets the resolution for font handling on the screen; see 779 * gdk_screen_set_resolution() for full details. 780 * Since 2.10 781 * Returns: the current resolution, or -1 if no resolution has been set. 782 */ 783 public double getResolution() 784 { 785 // gdouble gdk_screen_get_resolution (GdkScreen *screen); 786 return gdk_screen_get_resolution(gdkScreen); 787 } 788 789 /** 790 * Sets the resolution for font handling on the screen. This is a 791 * scale factor between points specified in a PangoFontDescription 792 * and cairo units. The default value is 96, meaning that a 10 point 793 * font will be 13 units high. (10 * 96. / 72. = 13.3). 794 * Since 2.10 795 * Params: 796 * dpi = the resolution in "dots per inch". (Physical inches aren't actually 797 * involved; the terminology is conventional.) 798 */ 799 public void setResolution(double dpi) 800 { 801 // void gdk_screen_set_resolution (GdkScreen *screen, gdouble dpi); 802 gdk_screen_set_resolution(gdkScreen, dpi); 803 } 804 805 /** 806 * Returns the screen's currently active window. 807 * On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property 808 * on the root window, as described in the Extended Window 809 * Manager Hints. If there is no currently currently active 810 * window, or the window manager does not support the 811 * _NET_ACTIVE_WINDOW hint, this function returns NULL. 812 * On other platforms, this function may return NULL, depending on whether 813 * it is implementable on that platform. 814 * The returned window should be unrefed using g_object_unref() when 815 * no longer needed. 816 * Since 2.10 817 * Returns: the currently active window, or NULL. 818 */ 819 public Window getActiveWindow() 820 { 821 // GdkWindow * gdk_screen_get_active_window (GdkScreen *screen); 822 auto p = gdk_screen_get_active_window(gdkScreen); 823 824 if(p is null) 825 { 826 return null; 827 } 828 829 return ObjectG.getDObject!(Window)(cast(GdkWindow*) p); 830 } 831 832 /** 833 * Returns a GList of GdkWindows representing the current 834 * window stack. 835 * On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING 836 * property on the root window, as described in the Extended Window 837 * Manager Hints. If the window manager does not support the 838 * _NET_CLIENT_LIST_STACKING hint, this function returns NULL. 839 * On other platforms, this function may return NULL, depending on whether 840 * it is implementable on that platform. 841 * The returned list is newly allocated and owns references to the 842 * windows it contains, so it should be freed using g_list_free() and 843 * its windows unrefed using g_object_unref() when no longer needed. 844 * Since 2.10 845 * Returns: a list of GdkWindows for the current window stack, or NULL. [transfer full][element-type GdkWindow] 846 */ 847 public ListG getWindowStack() 848 { 849 // GList * gdk_screen_get_window_stack (GdkScreen *screen); 850 auto p = gdk_screen_get_window_stack(gdkScreen); 851 852 if(p is null) 853 { 854 return null; 855 } 856 857 return ObjectG.getDObject!(ListG)(cast(GList*) p); 858 } 859 860 /** 861 * Warning 862 * gdk_spawn_on_screen has been deprecated since version 2.24 and should not be used in newly-written code. This function is being removed in 3.0. Use 863 * either g_spawn_sync(), g_spawn_async(), or GdkAppLaunchContext instead. 864 * Like g_spawn_async(), except the child process is spawned in such 865 * an environment that on calling gdk_display_open() it would be 866 * returned a GdkDisplay with screen as the default screen. 867 * This is useful for applications which wish to launch an application 868 * on a specific screen. 869 * Since 2.4 870 * Params: 871 * workingDirectory = child's current working directory, or NULL to 872 * inherit parent's 873 * argv = child's argument vector 874 * envp = child's environment, or NULL to inherit parent's 875 * flags = flags from GSpawnFlags 876 * childSetup = function to run in the child just before exec() 877 * userData = user data for child_setup 878 * childPid = return location for child process ID, or NULL 879 * Returns: TRUE on success, FALSE if error is set 880 * Throws: GException on failure. 881 */ 882 public int gdkSpawnOnScreen(string workingDirectory, string[] argv, string[] envp, GSpawnFlags flags, GSpawnChildSetupFunc childSetup, void* userData, out int childPid) 883 { 884 // gboolean gdk_spawn_on_screen (GdkScreen *screen, const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, gint *child_pid, GError **error); 885 GError* err = null; 886 887 auto p = gdk_spawn_on_screen(gdkScreen, Str.toStringz(workingDirectory), Str.toStringzArray(argv), Str.toStringzArray(envp), flags, childSetup, userData, &childPid, &err); 888 889 if (err !is null) 890 { 891 throw new GException( new ErrorG(err) ); 892 } 893 894 return p; 895 } 896 897 /** 898 * Warning 899 * gdk_spawn_on_screen_with_pipes has been deprecated since version 2.24 and should not be used in newly-written code. This function is being removed in 3.0. Use 900 * either g_spawn_async_with_pipes() or GdkAppLaunchContext instead. 901 * Like g_spawn_async_with_pipes(), except the child process is 902 * spawned in such an environment that on calling gdk_display_open() 903 * it would be returned a GdkDisplay with screen as the default 904 * screen. 905 * This is useful for applications which wish to launch an application 906 * on a specific screen. 907 * Since 2.4 908 * Params: 909 * workingDirectory = child's current working directory, or NULL to 910 * inherit parent's 911 * argv = child's argument vector 912 * envp = child's environment, or NULL to inherit parent's 913 * flags = flags from GSpawnFlags 914 * childSetup = function to run in the child just before exec() 915 * userData = user data for child_setup 916 * childPid = return location for child process ID, or NULL 917 * standardInput = return location for file descriptor to write to 918 * child's stdin, or NULL 919 * standardOutput = return location for file descriptor to read child's 920 * stdout, or NULL 921 * standardError = return location for file descriptor to read child's 922 * stderr, or NULL 923 * Returns: TRUE on success, FALSE if an error was set 924 */ 925 public int gdkSpawnOnScreenWithPipes(string workingDirectory, string[] argv, string[] envp, GSpawnFlags flags, GSpawnChildSetupFunc childSetup, void* userData, out int childPid, out int standardInput, out int standardOutput, out int standardError) 926 { 927 // gboolean gdk_spawn_on_screen_with_pipes (GdkScreen *screen, const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, gpointer user_data, gint *child_pid, gint *standard_input, gint *standard_output, gint *standard_error, GError **error); 928 GError* err = null; 929 930 auto p = gdk_spawn_on_screen_with_pipes(gdkScreen, Str.toStringz(workingDirectory), Str.toStringzArray(argv), Str.toStringzArray(envp), flags, childSetup, userData, &childPid, &standardInput, &standardOutput, &standardError, &err); 931 932 if (err !is null) 933 { 934 throw new GException( new ErrorG(err) ); 935 } 936 937 return p; 938 } 939 940 /** 941 * Warning 942 * gdk_spawn_command_line_on_screen has been deprecated since version 2.24 and should not be used in newly-written code. This function is being removed in 3.0. Use 943 * either g_spawn_command_line_sync(), g_spawn_command_line_async() or 944 * GdkAppLaunchContext instead. 945 * Like g_spawn_command_line_async(), except the child process is 946 * spawned in such an environment that on calling gdk_display_open() 947 * it would be returned a GdkDisplay with screen as the default 948 * screen. 949 * This is useful for applications which wish to launch an application 950 * on a specific screen. 951 * Since 2.4 952 * Params: 953 * commandLine = a command line 954 * Returns: TRUE on success, FALSE if error is set. 955 * Throws: GException on failure. 956 */ 957 public int gdkSpawnCommandLineOnScreen(string commandLine) 958 { 959 // gboolean gdk_spawn_command_line_on_screen (GdkScreen *screen, const gchar *command_line, GError **error); 960 GError* err = null; 961 962 auto p = gdk_spawn_command_line_on_screen(gdkScreen, Str.toStringz(commandLine), &err); 963 964 if (err !is null) 965 { 966 throw new GException( new ErrorG(err) ); 967 } 968 969 return p; 970 } 971 }