gdk.screen
Module for [Screen] class
Types 3
classScreen : gobject.object.ObjectWrap
#GdkScreen 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 #GdkScreen which combines several physical monitors (see [gdk.screen.Screen.getNMonitors]).
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.Screen.getSystemVisual]), the dimensions of the physical monitors ([gdk.screen.Screen.getMonitorGeometry]), etc.
Methods
Screen self()Returns `this`, for use in `with` statements.ScreenGidBuilder builder()Get builder for [gdk.screen.Screen] Returns: New builder objectvoid * fontOptions() @propertyvoid fontOptions(void * propval) @propertydouble resolution() @propertyvoid resolution(double propval) @propertygdk.screen.Screen getDefault()Gets the default screen for the default display. (See gdkdisplayget_default ()). Returns: a #GdkScreen, or null if there is no default display.int height()Gets the height of the default screen in pixels. The returned size is in ”application pixels”, not in ”device pixels” (see [gdk.screen.Screen.getMonitorScaleFactor]). Returns: the height of...int heightMm()Returns the height of the default screen in millimeters. Note that on many X servers this value will not be correct. Returns: the height of the default screen in millimeters, though it is not alway...int width()Gets the width of the default screen in pixels. The returned size is in ”application pixels”, not in ”device pixels” (see [gdk.screen.Screen.getMonitorScaleFactor]). Returns: the width of t...int widthMm()Returns the width of the default screen in millimeters. Note that on many X servers this value will not be correct. Returns: the width of the default screen in millimeters, though it is not always ...gdk.window.Window getActiveWindow()Returns the screen’s currently active window.gdk.display.Display getDisplay()Gets the display to which the screen belongs. Returns: the display to which screen belongscairo.font_options.FontOptions getFontOptions()Gets any options previously set with [gdk.screen.Screen.setFontOptions]. Returns: the current font options, or null if no default font options have been set.int getHeight()Gets the height of screen in pixels. The returned size is in ”application pixels”, not in ”device pixels” (see [gdk.screen.Screen.getMonitorScaleFactor]). Returns: the height of screen in p...int getHeightMm()Returns the height of screen in millimeters.int getMonitorAtPoint(int x, int y)Returns the monitor number in which the point (`x`,`y`) is located.int getMonitorAtWindow(gdk.window.Window window)Returns the number of the monitor in which the largest area of the bounding rectangle of window resides.void getMonitorGeometry(int monitorNum, out gdk.rectangle.Rectangle dest)Retrieves the #GdkRectangle 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...int getMonitorHeightMm(int monitorNum)Gets the height in millimeters of the specified monitor.string getMonitorPlugName(int monitorNum)Returns the output name of the specified monitor. Usually something like VGA, DVI, or TV, not the actual product name of the display device.int getMonitorScaleFactor(int monitorNum)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 (ofte...int getMonitorWidthMm(int monitorNum)Gets the width in millimeters of the specified monitor, if available.void getMonitorWorkarea(int monitorNum, out gdk.rectangle.Rectangle dest)Retrieves the #GdkRectangle 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 ”dev...int getNMonitors()Returns the number of monitors which screen consists of. Returns: number of monitors which screen consists ofint getNumber()Gets the index of screen among the screens in the display to which it belongs. (See [gdk.screen.Screen.getDisplay]) Returns: the indexint getPrimaryMonitor()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 ...double getResolution()Gets the resolution for font handling on the screen; see [gdk.screen.Screen.setResolution] for full details. Returns: the current resolution, or -1 if no resolution has been set.gdk.visual.Visual getRgbaVisual()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 null will be returned. Even if a non-nu...gdk.window.Window getRootWindow()Gets the root window of screen. Returns: the root windowbool getSetting(string name, gobject.value.Value value)Retrieves a desktop-wide setting such as double-click time for the #GdkScreen screen.gdk.visual.Visual getSystemVisual()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. Returns: the system visualgdk.window.Window[] getToplevelWindows()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.global.getDefaultRootWindow]).int getWidth()Gets the width of screen in pixels. The returned size is in ”application pixels”, not in ”device pixels” (see [gdk.screen.Screen.getMonitorScaleFactor]). Returns: the width of screen in pix...int getWidthMm()Gets the width of screen in millimeters.gdk.window.Window[] getWindowStack()Returns a #GList of #GdkWindows representing the current window stack.bool isComposited()Returns whether windows with an RGBA visual can reasonably be expected to have their alpha channel drawn correctly on the screen.gdk.visual.Visual[] listVisuals()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 b...string makeDisplayName()Determines the name to pass to [gdk.display.Display.open] to get a #GdkDisplay with this screen as the default screen. Returns: a newly allocated string, free with [glib.global.gfree]void setFontOptions(cairo.font_options.FontOptions options = null)Sets the default font options for the screen. These options will be set on any #PangoContext’s newly created with [gdk.global.pangoContextGetForScreen]. Changing the default set of font options d...void setResolution(double dpi)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 fon...gulong connectCompositedChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.screen.Screen)))
&& Parameters!T.length < 2)Connect to `CompositedChanged` signal.gulong connectMonitorsChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.screen.Screen)))
&& Parameters!T.length < 2)Connect to `MonitorsChanged` signal.gulong connectSizeChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.screen.Screen)))
&& Parameters!T.length < 2)Connect to `SizeChanged` signal.Fluent builder for [gdk.screen.Screen]
Methods
Screen build()