ScreenProtocol
public protocol ScreenProtocol : ObjectProtocol
The ScreenProtocol
protocol exposes the methods and properties of an underlying GdkScreen
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Screen
.
Alternatively, use ScreenRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
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_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.
-
Untyped pointer to the underlying
GdkScreen
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
screen_ptr
Default implementationTyped pointer to the underlying
GdkScreen
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkScreen
instance.Declaration
Swift
var screen_ptr: UnsafeMutablePointer<GdkScreen>! { get }
-
Required Initialiser for types conforming to
ScreenProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
ScreenPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: ScreenPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a Screen property
Declaration
Swift
@inlinable func get(property: ScreenPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a Screen property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: ScreenPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
ScreenSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ScreenSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
ScreenSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ScreenSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onCompositedChanged(flags:
Extension methodhandler: ) The
composited-changed
signal is emitted when the composited status of the screen changesNote
This represents the underlyingcomposited-changed
signalDeclaration
Swift
@discardableResult @inlinable func onCompositedChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ScreenRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
compositedChanged
signal is emitted -
compositedChangedSignal
Extension methodTyped
composited-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var compositedChangedSignal: ScreenSignalName { get }
-
onMonitorsChanged(flags:
Extension methodhandler: ) The
monitors-changed
signal is emitted when the number, size or position of the monitors attached to the screen change.Only for X11 and OS X for now. A future implementation for Win32 may be a possibility.
Note
This represents the underlyingmonitors-changed
signalDeclaration
Swift
@discardableResult @inlinable func onMonitorsChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ScreenRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
monitorsChanged
signal is emitted -
monitorsChangedSignal
Extension methodTyped
monitors-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var monitorsChangedSignal: ScreenSignalName { get }
-
onSizeChanged(flags:
Extension methodhandler: ) The
size-changed
signal is emitted when the pixel width or height of a screen changes.Note
This represents the underlyingsize-changed
signalDeclaration
Swift
@discardableResult @inlinable func onSizeChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ScreenRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
sizeChanged
signal is emitted -
sizeChangedSignal
Extension methodTyped
size-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var sizeChangedSignal: ScreenSignalName { get }
-
onNotifyFontOptions(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::font-options
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyFontOptions(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ScreenRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyFontOptions
signal is emitted -
notifyFontOptionsSignal
Extension methodTyped
notify::font-options
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyFontOptionsSignal: ScreenSignalName { get }
-
onNotifyResolution(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::resolution
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyResolution(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ScreenRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyResolution
signal is emitted -
notifyResolutionSignal
Extension methodTyped
notify::resolution
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyResolutionSignal: ScreenSignalName { get }
-
getActiveWindow()
Extension methodReturns 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
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.get_active_window is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getActiveWindow() -> WindowRef!
-
getDisplay()
Extension methodGets the display to which the
screen
belongs.Declaration
Swift
@inlinable func getDisplay() -> DisplayRef!
-
getFontOptions()
Extension methodGets any options previously set with
gdk_screen_set_font_options()
.Declaration
Swift
@inlinable func getFontOptions() -> Cairo.FontOptionsRef!
-
getHeight()
Extension methodGets the height of
screen
in pixels. The returned size is in ”application pixels”, not in ”device pixels” (seegdk_screen_get_monitor_scale_factor()
).get_height is deprecated: Use per-monitor information instead
Declaration
Swift
@available(*, deprecated) @inlinable func getHeight() -> Int
-
getHeightMm()
Extension methodReturns 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.
get_height_mm is deprecated: Use per-monitor information instead
Declaration
Swift
@available(*, deprecated) @inlinable func getHeightMm() -> Int
-
getMonitorAtPoint(x:
Extension methody: ) Returns the monitor number in which the point (
x
,y
) is located.get_monitor_at_point is deprecated: Use gdk_display_get_monitor_at_point() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorAtPoint(x: Int, y: Int) -> Int
-
getMonitorAt(window:
Extension method) Returns the number of the monitor in which the largest area of the bounding rectangle of
window
resides.get_monitor_at_window is deprecated: Use gdk_display_get_monitor_at_window() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorAt<WindowT>(window: WindowT) -> Int where WindowT : WindowProtocol
-
getMonitorGeometry(monitorNum:
Extension methoddest: ) 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” (seegdk_screen_get_monitor_scale_factor()
).Monitor numbers start at 0. To obtain the number of monitors of
screen
, usegdk_screen_get_n_monitors()
.Note that the size of the entire screen area can be retrieved via
gdk_screen_get_width()
andgdk_screen_get_height()
.get_monitor_geometry is deprecated: Use gdk_monitor_get_geometry() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorGeometry(monitorNum: Int, dest: RectangleRef? = nil)
-
getMonitorGeometry(monitorNum:
Extension methoddest: ) 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” (seegdk_screen_get_monitor_scale_factor()
).Monitor numbers start at 0. To obtain the number of monitors of
screen
, usegdk_screen_get_n_monitors()
.Note that the size of the entire screen area can be retrieved via
gdk_screen_get_width()
andgdk_screen_get_height()
.get_monitor_geometry is deprecated: Use gdk_monitor_get_geometry() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorGeometry<RectangleT>(monitorNum: Int, dest: RectangleT?) where RectangleT : RectangleProtocol
-
getMonitorHeightMm(monitorNum:
Extension method) Gets the height in millimeters of the specified monitor.
get_monitor_height_mm is deprecated: Use gdk_monitor_get_height_mm() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorHeightMm(monitorNum: Int) -> Int
-
getMonitorPlugName(monitorNum:
Extension method) 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_plug_name is deprecated: Use gdk_monitor_get_model() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorPlugName(monitorNum: Int) -> String!
-
getMonitorScaleFactor(monitorNum:
Extension method) 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_scale_factor is deprecated: Use gdk_monitor_get_scale_factor() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorScaleFactor(monitorNum: Int) -> Int
-
getMonitorWidthMm(monitorNum:
Extension method) Gets the width in millimeters of the specified monitor, if available.
get_monitor_width_mm is deprecated: Use gdk_monitor_get_width_mm() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorWidthMm(monitorNum: Int) -> Int
-
getMonitorWorkarea(monitorNum:
Extension methoddest: ) 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 ”device pixels” (seegdk_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
, usegdk_screen_get_n_monitors()
.get_monitor_workarea is deprecated: Use gdk_monitor_get_workarea() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorWorkarea(monitorNum: Int, dest: RectangleRef? = nil)
-
getMonitorWorkarea(monitorNum:
Extension methoddest: ) 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 ”device pixels” (seegdk_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
, usegdk_screen_get_n_monitors()
.get_monitor_workarea is deprecated: Use gdk_monitor_get_workarea() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getMonitorWorkarea<RectangleT>(monitorNum: Int, dest: RectangleT?) where RectangleT : RectangleProtocol
-
getNMonitors()
Extension methodReturns the number of monitors which
screen
consists of.get_n_monitors is deprecated: Use gdk_display_get_n_monitors() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getNMonitors() -> Int
-
getNumber()
Extension methodGets the index of
screen
among the screens in the display to which it belongs. (Seegdk_screen_get_display()
)get_number is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func getNumber() -> Int
-
getPrimaryMonitor()
Extension methodGets 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.
get_primary_monitor is deprecated: Use gdk_display_get_primary_monitor() instead
Declaration
Swift
@available(*, deprecated) @inlinable func getPrimaryMonitor() -> Int
-
getResolution()
Extension methodGets the resolution for font handling on the screen; see
gdk_screen_set_resolution()
for full details.Declaration
Swift
@inlinable func getResolution() -> Double
-
getRgbaVisual()
Extension methodGets 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()
.Declaration
Swift
@inlinable func getRgbaVisual() -> VisualRef!
-
getRootWindow()
Extension methodGets the root window of
screen
.Declaration
Swift
@inlinable func getRootWindow() -> WindowRef!
-
getSetting(name:
Extension methodvalue: ) Retrieves a desktop-wide setting such as double-click time for the
GdkScreen
screen
.FIXME needs a list of valid settings here, or a link to more information.
Declaration
Swift
@inlinable func getSetting<ValueT>(name: UnsafePointer<gchar>!, value: ValueT) -> Bool where ValueT : ValueProtocol
-
getSystemVisual()
Extension methodGet 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.Declaration
Swift
@inlinable func getSystemVisual() -> VisualRef!
-
getToplevelWindows()
Extension methodObtains a list of all toplevel windows known to GDK on the screen
screen
. A toplevel window is a child of the root window (seegdk_get_default_root_window()
).The returned list should be freed with
g_list_free()
, but its elements need not be freed.Declaration
Swift
@inlinable func getToplevelWindows() -> GLib.ListRef!
-
getWidth()
Extension methodGets the width of
screen
in pixels. The returned size is in ”application pixels”, not in ”device pixels” (seegdk_screen_get_monitor_scale_factor()
).get_width is deprecated: Use per-monitor information instead
Declaration
Swift
@available(*, deprecated) @inlinable func getWidth() -> Int
-
getWidthMm()
Extension methodGets 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.
get_width_mm is deprecated: Use per-monitor information instead
Declaration
Swift
@available(*, deprecated) @inlinable func getWidthMm() -> Int
-
getWindowStack()
Extension methodReturns a
GList
ofGdkWindows
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
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 usingg_object_unref()
when no longer needed.Declaration
Swift
@inlinable func getWindowStack() -> GLib.ListRef!
-
listVisuals()
Extension methodLists 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.Declaration
Swift
@inlinable func listVisuals() -> GLib.ListRef!
-
makeDisplayName()
Extension methodDetermines the name to pass to
gdk_display_open()
to get aGdkDisplay
with this screen as the default screen.make_display_name is deprecated: This method is deprecated.
Declaration
Swift
@available(*, deprecated) @inlinable func makeDisplayName() -> String!
-
setFont(options:
Extension method) Sets the default font options for the screen. These options will be set on any
PangoContext
’s newly created withgdk_pango_context_get_for_screen()
. Changing the default set of font options does not affect contexts that have already been created.Declaration
Swift
@inlinable func setFont(options: Cairo.FontOptionsRef? = nil)
-
setFont(options:
Extension method) Sets the default font options for the screen. These options will be set on any
PangoContext
’s newly created withgdk_pango_context_get_for_screen()
. Changing the default set of font options does not affect contexts that have already been created.Declaration
Swift
@inlinable func setFont<FontOptionsT>(options: FontOptionsT?) where FontOptionsT : FontOptionsProtocol
-
setResolution(dpi:
Extension method) 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).Declaration
Swift
@inlinable func setResolution(dpi: Double)
-
Finds the destination window and DND protocol to use at the given pointer position.
This function is called by the drag source to obtain the
dest_window
andprotocol
parameters forgdk_drag_motion()
.Declaration
Swift
@inlinable func dragFindWindowForScreen<DragContextT, WindowT>(context: DragContextT, dragWindow: WindowT, xRoot: Int, yRoot: Int, destWindow: UnsafeMutablePointer<UnsafeMutablePointer<GdkWindow>?>!, protocol: UnsafeMutablePointer<GdkDragProtocol>!) where DragContextT : DragContextProtocol, WindowT : WindowProtocol
-
pangoContextGetForScreen()
Extension methodCreates a
PangoContext
forscreen
.The context must be freed when you’re finished with it.
When using GTK+, normally you should use
gtk_widget_get_pango_context()
instead of this function, to get the appropriate context for the widget you intend to render text onto.The newly created context will have the default font options (see
cairo_font_options_t
) for the screen; if these options change it will not be updated. Usinggtk_widget_get_pango_context()
is more convenient if you want to keep a context around and track changes to the screen’s font rendering settings.Declaration
Swift
@inlinable func pangoContextGetForScreen() -> Pango.ContextRef!
-
activeWindow
Extension methodReturns 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
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.get_active_window is deprecated: This method is deprecated.
Declaration
Swift
@inlinable var activeWindow: WindowRef! { get }
-
display
Extension methodGets the display to which the
screen
belongs.Declaration
Swift
@inlinable var display: DisplayRef! { get }
-
fontOptions
Extension methodGets any options previously set with
gdk_screen_set_font_options()
.Declaration
Swift
@inlinable var fontOptions: Cairo.FontOptionsRef! { get nonmutating set }
-
height
Extension methodGets the height of
screen
in pixels. The returned size is in ”application pixels”, not in ”device pixels” (seegdk_screen_get_monitor_scale_factor()
).get_height is deprecated: Use per-monitor information instead
Declaration
Swift
@inlinable var height: Int { get }
-
heightMm
Extension methodReturns 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.
get_height_mm is deprecated: Use per-monitor information instead
Declaration
Swift
@inlinable var heightMm: Int { get }
-
isComposited
Extension methodReturns 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
.Declaration
Swift
@inlinable var isComposited: Bool { get }
-
nMonitors
Extension methodReturns the number of monitors which
screen
consists of.get_n_monitors is deprecated: Use gdk_display_get_n_monitors() instead
Declaration
Swift
@inlinable var nMonitors: Int { get }
-
number
Extension methodGets the index of
screen
among the screens in the display to which it belongs. (Seegdk_screen_get_display()
)get_number is deprecated: This method is deprecated.
Declaration
Swift
@inlinable var number: Int { get }
-
primaryMonitor
Extension methodGets 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.
get_primary_monitor is deprecated: Use gdk_display_get_primary_monitor() instead
Declaration
Swift
@inlinable var primaryMonitor: Int { get }
-
resolution
Extension methodUndocumented
Declaration
Swift
@inlinable var resolution: Double { get nonmutating set }
-
rgbaVisual
Extension methodGets 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()
.Declaration
Swift
@inlinable var rgbaVisual: VisualRef! { get }
-
rootWindow
Extension methodGets the root window of
screen
.Declaration
Swift
@inlinable var rootWindow: WindowRef! { get }
-
systemVisual
Extension methodGet 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.Declaration
Swift
@inlinable var systemVisual: VisualRef! { get }
-
toplevelWindows
Extension methodObtains a list of all toplevel windows known to GDK on the screen
screen
. A toplevel window is a child of the root window (seegdk_get_default_root_window()
).The returned list should be freed with
g_list_free()
, but its elements need not be freed.Declaration
Swift
@inlinable var toplevelWindows: GLib.ListRef! { get }
-
width
Extension methodGets the width of
screen
in pixels. The returned size is in ”application pixels”, not in ”device pixels” (seegdk_screen_get_monitor_scale_factor()
).get_width is deprecated: Use per-monitor information instead
Declaration
Swift
@inlinable var width: Int { get }
-
widthMm
Extension methodGets 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.
get_width_mm is deprecated: Use per-monitor information instead
Declaration
Swift
@inlinable var widthMm: Int { get }
-
windowStack
Extension methodReturns a
GList
ofGdkWindows
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
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 usingg_object_unref()
when no longer needed.Declaration
Swift
@inlinable var windowStack: GLib.ListRef! { get }