Class: Gdk::Screen
- Inherits:
-
Object
- Object
- Gdk::Screen
- Defined in:
- (unknown)
Overview
Gdk::Screen objects are the GDK representation of the screen on which windows can be displayed and on which the pointer moves. X originally identified screens with physical screens, but nowadays it is more common to have a single Gdk::Screen which combines several physical monitors (see gdk_screen_get_n_monitors()).
GdkScreen is used throughout GDK and GTK+ to specify which screen the top level windows are to be displayed on. it is also used to query the screen specification and default settings such as the default visual (gdk_screen_get_system_visual()), the dimensions of the physical monitors (gdk_screen_get_monitor_geometry()), etc.
Instance Method Summary collapse
-
#active_window ⇒ Gdk::Window
Returns the screen’s currently active window.
-
#display ⇒ Gdk::Display
Gets the display to which the screen belongs.
-
#font_options ⇒ GObject
Font-options.
- #font_options=(font_options) ⇒ GObject
-
#get_monitor_at_point(x, y) ⇒ Integer
Returns the monitor number in which the point (x,y) is located.
-
#get_monitor_at_window(window) ⇒ Integer
Returns the number of the monitor in which the largest area of the bounding rectangle of window resides.
-
#get_monitor_geometry(monitor_num, dest) ⇒ nil
Retrieves the Gdk::Rectangle representing the size and position of the individual monitor within the entire screen area.
-
#get_monitor_height_mm(monitor_num) ⇒ Integer
Gets the height in millimeters of the specified monitor.
-
#get_monitor_plug_name(monitor_num) ⇒ String
Returns the output name of the specified monitor.
-
#get_monitor_scale_factor(monitor_num) ⇒ Integer
Returns the internal scale factor that maps from monitor coordinates to the actual device pixels.
-
#get_monitor_width_mm(monitor_num) ⇒ Integer
Gets the width in millimeters of the specified monitor, if available.
-
#get_monitor_workarea(monitor_num, dest) ⇒ nil
Retrieves the Gdk::Rectangle representing the size and position of the “work area” on a monitor within the entire screen area.
-
#get_setting(name, value) ⇒ TrueClass
Retrieves a desktop-wide setting such as double-click time for the Gdk::Screen screen.
-
#height ⇒ Integer
Gets the height of screen in pixels.
-
#height_mm ⇒ Integer
Returns the height of screen in millimeters.
-
#is_composited ⇒ TrueClass
Returns whether windows with an RGBA visual can reasonably be expected to have their alpha channel drawn correctly on the screen.
-
#list_visuals ⇒ GLib::List
Lists the available visuals for the specified screen.
-
#make_display_name ⇒ String
Determines the name to pass to gdk_display_open() to get a Gdk::Display with this screen as the default screen.
-
#n_monitors ⇒ Integer
Returns the number of monitors which screen consists of.
-
#number ⇒ Integer
Gets the index of screen among the screens in the display to which it belongs.
-
#primary_monitor ⇒ Integer
Gets the primary monitor for screen.
-
#resolution ⇒ Float
Resolution.
- #resolution=(resolution) ⇒ Float
-
#rgba_visual ⇒ Gdk::Visual
Gets a visual to use for creating windows with an alpha channel.
-
#root_window ⇒ Gdk::Window
Gets the root window of screen.
-
#system_visual ⇒ Gdk::Visual
Get the system’s default visual for screen.
-
#toplevel_windows ⇒ GLib::List
Obtains a list of all toplevel windows known to GDK on the screen screen.
-
#width ⇒ Integer
Gets the width of screen in pixels.
-
#width_mm ⇒ Integer
Gets the width of screen in millimeters.
-
#window_stack ⇒ GLib::List
Returns a #GList of Gdk::Windows representing the current window stack.
Instance Method Details
#active_window ⇒ Gdk::Window
Returns the screen’s currently active window.
On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property on the root window, as described in the [Extended Window Manager Hints](www.freedesktop.org/Standards/wm-spec). If there is no currently currently active window, or the window manager does not support the _NET_ACTIVE_WINDOW hint, this function returns nil.
On other platforms, this function may return nil, depending on whether it is implementable on that platform.
The returned window should be unrefed using g_object_unref() when no longer needed.
#display ⇒ Gdk::Display
Gets the display to which the screen belongs.
#font_options ⇒ GObject
Returns font-options.
#font_options=(font_options) ⇒ GObject
#get_monitor_at_point(x, y) ⇒ Integer
Returns the monitor number in which the point (x,y) is located.
#get_monitor_at_window(window) ⇒ Integer
Returns the number of the monitor in which the largest area of the bounding rectangle of window resides.
#get_monitor_geometry(monitor_num, dest) ⇒ nil
Retrieves the Gdk::Rectangle representing the size and position of the individual monitor within the entire screen area. The returned geometry is in ”application pixels”, not in ”device pixels” (see gdk_screen_get_monitor_scale_factor()).
Monitor numbers start at 0. To obtain the number of monitors of screen, use gdk_screen_get_n_monitors().
Note that the size of the entire screen area can be retrieved via gdk_screen_get_width() and gdk_screen_get_height().
#get_monitor_height_mm(monitor_num) ⇒ Integer
Gets the height in millimeters of the specified monitor.
#get_monitor_plug_name(monitor_num) ⇒ String
Returns the output name of the specified monitor. Usually something like VGA, DVI, or TV, not the actual product name of the display device.
#get_monitor_scale_factor(monitor_num) ⇒ Integer
Returns the internal scale factor that maps from monitor coordinates to the actual device pixels. On traditional systems this is 1, but on very high density outputs this can be a higher value (often 2).
This can be used if you want to create pixel based data for a particular monitor, but most of the time you’re drawing to a window where it is better to use gdk_window_get_scale_factor() instead.
#get_monitor_width_mm(monitor_num) ⇒ Integer
Gets the width in millimeters of the specified monitor, if available.
#get_monitor_workarea(monitor_num, dest) ⇒ nil
Retrieves the Gdk::Rectangle representing the size and position of the “work area” on a monitor within the entire screen area. The returned geometry is in ”application pixels”, not in ”device pixels” (see gdk_screen_get_monitor_scale_factor()).
The work area should be considered when positioning menus and similar popups, to avoid placing them below panels, docks or other desktop components.
Note that not all backends may have a concept of workarea. This function will return the monitor geometry if a workarea is not available, or does not apply.
Monitor numbers start at 0. To obtain the number of monitors of screen, use gdk_screen_get_n_monitors().
#get_setting(name, value) ⇒ TrueClass
Retrieves a desktop-wide setting such as double-click time for the Gdk::Screen screen.
FIXME needs a list of valid settings here, or a link to more information.
#height ⇒ Integer
Gets the height of screen in pixels. The returned size is in ”application pixels”, not in ”device pixels” (see gdk_screen_get_monitor_scale_factor()).
#height_mm ⇒ Integer
Returns the height of screen in millimeters.
Note that this value is somewhat ill-defined when the screen has multiple monitors of different resolution. It is recommended to use the monitor dimensions instead.
#is_composited ⇒ TrueClass
Returns whether windows with an RGBA visual can reasonably be expected to have their alpha channel drawn correctly on the screen.
On X11 this function returns whether a compositing manager is compositing screen. expected to have their alpha channels drawn correctly on the screen.
#list_visuals ⇒ GLib::List
Lists the available visuals for the specified screen. A visual describes a hardware image data format. For example, a visual might support 24-bit color, or 8-bit color, and might expect pixels to be in a certain format.
Call g_list_free() on the return value when you’re finished with it.
#make_display_name ⇒ String
Determines the name to pass to gdk_display_open() to get a Gdk::Display with this screen as the default screen.
#n_monitors ⇒ Integer
Returns the number of monitors which screen consists of.
#number ⇒ Integer
Gets the index of screen among the screens in the display to which it belongs. (See gdk_screen_get_display())
#primary_monitor ⇒ Integer
Gets the primary monitor for screen. The primary monitor is considered the monitor where the “main desktop” lives. While normal application windows typically allow the window manager to place the windows, specialized desktop applications such as panels should place themselves on the primary monitor.
If no primary monitor is configured by the user, the return value will be 0, defaulting to the first monitor.
#resolution ⇒ Float
Returns resolution.
#resolution=(resolution) ⇒ Float
#rgba_visual ⇒ Gdk::Visual
Gets a visual to use for creating windows with an alpha channel. The windowing system on which GTK+ is running may not support this capability, in which case nil will be returned. Even if a non-nil value is returned, its possible that the window’s alpha channel won’t be honored when displaying the window on the screen: in particular, for X an appropriate windowing manager and compositing manager must be running to provide appropriate display.
This functionality is not implemented in the Windows backend.
For setting an overall opacity for a top-level window, see gdk_window_set_opacity().
#root_window ⇒ Gdk::Window
Gets the root window of screen.
#system_visual ⇒ Gdk::Visual
Get the system’s default visual for screen. This is the visual for the root window of the display. The return value should not be freed.
#toplevel_windows ⇒ GLib::List
Obtains a list of all toplevel windows known to GDK on the screen screen. A toplevel window is a child of the root window (see gdk_get_default_root_window()).
The returned list should be freed with g_list_free(), but its elements need not be freed.
#width ⇒ Integer
Gets the width of screen in pixels. The returned size is in ”application pixels”, not in ”device pixels” (see gdk_screen_get_monitor_scale_factor()).
#width_mm ⇒ Integer
Gets the width of screen in millimeters.
Note that this value is somewhat ill-defined when the screen has multiple monitors of different resolution. It is recommended to use the monitor dimensions instead.
#window_stack ⇒ GLib::List
Returns a #GList of Gdk::Windows representing the current window stack.
On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING property on the root window, as described in the [Extended Window Manager Hints](www.freedesktop.org/Standards/wm-spec). If the window manager does not support the _NET_CLIENT_LIST_STACKING hint, this function returns nil.
On other platforms, this function may return nil, depending on whether it is implementable on that platform.
The returned list is newly allocated and owns references to the windows it contains, so it should be freed using g_list_free() and its windows unrefed using g_object_unref() when no longer needed.