Libraries:Gtk:Gdk:Screen
Types
T
Inherits from:T objects are the GDK representation of a physical screen. It 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 colormap (GetDefaultColormap), the screen width (GetWidth), etc.
Note that a screen may consist of multiple monitors which are merged to form a large screen area.
Constants
Nil : T
Functions
GetDefault() : Gtk.Gdk.Screen.T
Gets the default screen for the default display. (See Gtk.Gdk.Display.GetDefault).
GetType() : Gtk.GObject.Type.T
Height() : Std.Integer.SmallT
HeightMm() : Std.Integer.SmallT
Width() : Std.Integer.SmallT
WidthMm() : Std.Integer.SmallT
Methods
:BroadcastClientMessage(self @ T, event @ Gtk.Gdk.Event.T) : Std.Object.T
On X11, sends an X ClientMessage event to all toplevel windows on screen.
Toplevel windows are determined by checking for the WM_STATE property, as described in the Inter-Client Communication Conventions Manual (ICCCM). If no windows are found with the WM_STATE property set, the message is sent to all children of the root window.
On Windows, broadcasts a message registered with the name GDK_WIN32_CLIENT_MESSAGE to all top-level windows. The amount of data is limited to one long, i.e. four bytes.
:ExposureGcs(self @ T, index @ Std.Integer.T) : Gtk.Gdk.GC.T
:GetActiveWindow(self @ T) : Gtk.Gdk.Window.T
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. If there is no currently currently active window, or the window manager does not support the _NET_ACTIVE_WINDOW hint, this function returns NULL.
On other platforms, this function may return NULL, depending on whether it is implementable on that platform.
The returned window should be unrefed using g_object_unref() when no longer needed.
:GetDefaultColormap(self @ T) : Gtk.Gdk.Colormap.T
Gets the default colormap for screen.
screen | a T |
Returns | the default Gtk.Gdk.Colormap.T. [transfer none] |
:GetDisplay(self @ T) : Gtk.Gdk.Display.T
Gets the display to which the screen belongs.
screen | a T |
Returns | the display to which screen belongs |
:GetFontOptions(self @ T) : Gtk.Cairo.FontOptions.T
Gets any options previously set with SetFontOptions.
:GetHeight(self @ T) : Std.Integer.SmallT
:GetHeightMm(self @ T) : Std.Integer.SmallT
Returns the height of screen in millimeters. Note that on some X servers this value will not be correct.
screen | a T |
Returns | the heigth of screen in millimeters. |
:GetMonitorAtPoint(self @ T, x @ Std.Integer.SmallT, y @ Std.Integer.SmallT) : Std.Integer.SmallT
Returns the monitor number in which the point (x,y) is located.
screen | a T. |
x | the x coordinate in the virtual screen. |
y | the y coordinate in the virtual screen. |
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. |
:GetMonitorAtWindow(self @ T, window @ Gtk.Gdk.Window.T) : Std.Integer.SmallT
Returns the number of the monitor in which the largest area of the bounding rectangle of window resides.
screen | a T. |
window | a Gtk.Gdk.Window.T |
Returns | the monitor number in which most of window is located, or if window does not intersect any monitors, a monitor, close to window. |
:GetMonitorGeometry(self @ T, monitor_num @ Std.Integer.SmallT, dest @ Gtk.Gdk.Rectangle.T) : Std.Object.T
Retrieves the Gtk.Gdk.Rectangle.T representing the size and position of the individual monitor within the entire screen area.
Note that the size of the entire screen area can be retrieved via GetWidth and GetHeight.
screen | a T |
monitor_num | the monitor number, between 0 and gdk_screen_get_n_monitors (screen) |
dest | a Gtk.Gdk.Rectangle.T to be filled with the monitor geometry |
:GetMonitorHeightMm(self @ T, monitor_num @ Std.Integer.SmallT) : Std.Integer.SmallT
Gets the height in millimeters of the specified monitor.
screen | a T |
monitor_num | number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) |
Returns | the height of the monitor, or -1 if not available |
:GetMonitorPlugName(self @ T, monitor_num @ Std.Integer.SmallT) : Std.String.T
Returns the output name of the specified monitor. Usually something like VGA, DVI, or TV, not the actual product name of the display device.
screen | a T |
monitor_num | number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) |
Returns | a newly-allocated string containing the name of the monitor, or NULL if the name cannot be determined |
:GetMonitorWidthMm(self @ T, monitor_num @ Std.Integer.SmallT) : Std.Integer.SmallT
Gets the width in millimeters of the specified monitor, if available.
screen | a T |
monitor_num | number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) |
Returns | the width of the monitor, or -1 if not available |
:GetNMonitors(self @ T) : Std.Integer.SmallT
Returns the number of monitors which screen consists of.
screen | a T |
Returns | number of monitors which screen consists of |
:GetNumber(self @ T) : Std.Integer.SmallT
Gets the index of screen among the screens in the display to which it belongs. (See GetDisplay)
screen | a T |
Returns | the index |
:GetPrimaryMonitor(self @ T) : Std.Integer.SmallT
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.
screen | a T. |
Returns | An integer index for the primary monitor, or 0 if none is configured. |
:GetResolution(self @ T) : Std.Real.T
Gets the resolution for font handling on the screen; see SetResolution for full details.
screen | a T |
Returns | the current resolution, or -1 if no resolution has been set. |
:GetRgbColormap(self @ T) : Gtk.Gdk.Colormap.T
Warning
GetRgbColormap has been deprecated since version 2.22 and should not be used in newly-written code. Use GetSystemColormap
:GetRgbVisual(self @ T) : Gtk.Gdk.Visual.T
Warning
GetRgbVisual has been deprecated since version 2.22 and should not be used in newly-written code. Use GetSystemVisual
:GetRgbaColormap(self @ T) : Gtk.Gdk.Colormap.T
Gets a colormap to use for creating windows or pixmaps with an alpha channel. The windowing system on which GTK+ is running may not support this capability, in which case NULL will be returned. Even if a non-NULL 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 Gtk.Gdk.Window.SetOpacity.
screen | a T. |
Returns | a colormap to use for windows with an alpha channel or NULL if the capability is not available. [transfer none] |
:GetRgbaVisual(self @ T) : Gtk.Gdk.Visual.T
Gets a visual to use for creating windows or pixmaps with an alpha channel. See the docs for GetRgbaColormap for caveats.
screen | a T |
Returns | a visual to use for windows with an alpha channel or NULL if the capability is not available. [transfer none] |
:GetRootWindow(self @ T) : Gtk.Gdk.Window.T
:GetSetting(self @ T, name @ Std.String.T, value @ Gtk.GObject.Value.T) : Std.Symbol.T
Retrieves a desktop-wide setting such as double-click time for the T screen.
FIXME needs a list of valid settings here, or a link to more information.
screen | the T where the setting is located |
name | the name of the setting |
value | location to store the value of the setting |
Returns | TRUE if the setting existed and a value was stored in value, FALSE otherwise. |
:GetSystemColormap(self @ T) : Gtk.Gdk.Colormap.T
Gets the system's default colormap for screen
screen | a T |
Returns | the default colormap for screen. [transfer none] |
:GetSystemVisual(self @ T) : Gtk.Gdk.Visual.T
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.
screen | a T. |
Returns | the system visual. [transfer none] |
:GetToplevelWindows(self @ T) : Std.Object.T
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 Gtk.Gdk.Global.GetDefaultRootWindow).
The returned list should be freed with g_list_free(), but its elements need not be freed.
screen | The T where the toplevels are located. |
Returns | list of toplevel windows, free with g_list_free(). [transfer container][element-type GdkWindow] |
:GetWidth(self @ T) : Std.Integer.SmallT
:GetWidthMm(self @ T) : Std.Integer.SmallT
Gets the width of screen in millimeters. Note that on some X servers this value will not be correct.
screen | a T |
Returns | the width of screen in millimeters. |
:GetWindowStack(self @ T) : Std.Object.T
Returns a GList of Gtk.Gdk.Window.Ts 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. If the window manager does not support the _NET_CLIENT_LIST_STACKING hint, this function returns NULL.
On other platforms, this function may return NULL, 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.
screen | a T |
Returns | a list of Gtk.Gdk.Window.Ts for the current window stack, or NULL. [transfer full][element-type GdkWindow] |
:IsComposited(self @ T) : Std.Symbol.T
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.
screen | a T |
Returns | Whether windows with RGBA visuals can reasonably be expected to have their alpha channels drawn correctly on the screen. |
:ListVisuals(self @ T) : Std.Object.T
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.
screen | the relevant T. |
Returns | a list of visuals; the list must be freed, but not its contents. [transfer container][element-type GdkVisual] |
:MakeDisplayName(self @ T) : Std.String.T
Determines the name to pass to Gtk.Gdk.Display.Open to get a Gtk.Gdk.Display.T with this screen as the default screen.
screen | a T |
Returns | a newly allocated string, free with g_free() |
:NormalGcs(self @ T, index @ Std.Integer.T) : Gtk.Gdk.GC.T
:SetDefaultColormap(self @ T, colormap @ Gtk.Gdk.Colormap.T) : Std.Object.T
:SetFontOptions(self @ T, options @ Gtk.Cairo.FontOptions.T) : Std.Object.T
Sets the default font options for the screen. These options will be set on any PangoContext's newly created with Gtk.Gdk.Pango.ContextGetForScreen. Changing the default set of font options does not affect contexts that have already been created.
screen | a T |
options | a Gtk.Cairo.FontOptions.T, or NULL to unset any previously set default font options. [allow-none] |
:SetResolution(self @ T, dpi @ Std.Real.T) : Std.Object.T
Sets the resolution for font handling on the screen. This is a scale factor between points specified in a PangoFontDescription and cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).
screen | a T |
dpi | the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.) |