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.

  • ptr

    Untyped pointer to the underlying GdkScreen instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • screen_ptr Default implementation

    Typed 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)

Screen Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

Screen signals

  • Connect a Swift signal handler to the given, typed ScreenSignalName signal

    Declaration

    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 by userData

    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 a C signal handler to the given, typed ScreenSignalName signal

    Declaration

    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 by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • The composited-changed signal is emitted when the composited status of the screen changes

    Note

    This represents the underlying composited-changed signal

    Declaration

    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 method

    Typed composited-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var compositedChangedSignal: ScreenSignalName { get }
  • 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 underlying monitors-changed signal

    Declaration

    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 method

    Typed monitors-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var monitorsChangedSignal: ScreenSignalName { get }
  • The size-changed signal is emitted when the pixel width or height of a screen changes.

    Note

    This represents the underlying size-changed signal

    Declaration

    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 method

    Typed size-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var sizeChangedSignal: ScreenSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::font-options signal

    Declaration

    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 method

    Typed notify::font-options signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyFontOptionsSignal: ScreenSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::resolution signal

    Declaration

    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 method

    Typed notify::resolution signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyResolutionSignal: ScreenSignalName { get }

Screen Class: ScreenProtocol extension (methods and fields)

  • getActiveWindow() Extension method

    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 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 method

    Gets the display to which the screen belongs.

    Declaration

    Swift

    @inlinable
    func getDisplay() -> DisplayRef!
  • getFontOptions() Extension method

    Gets any options previously set with gdk_screen_set_font_options().

    Declaration

    Swift

    @inlinable
    func getFontOptions() -> Cairo.FontOptionsRef!
  • getHeight() Extension method

    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()).

    get_height is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getHeight() -> Int
  • getHeightMm() Extension method

    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.

    get_height_mm is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getHeightMm() -> Int
  • getMonitorAtPoint(x:y:) Extension method

    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
  • 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” (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_geometry is deprecated: Use gdk_monitor_get_geometry() instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getMonitorGeometry(monitorNum: Int, dest: RectangleRef? = nil)
  • 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” (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_geometry is deprecated: Use gdk_monitor_get_geometry() instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getMonitorGeometry<RectangleT>(monitorNum: Int, dest: RectangleT?) where RectangleT : RectangleProtocol
  • 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
  • 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!
  • 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
  • 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
  • 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” (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_monitor_workarea is deprecated: Use gdk_monitor_get_workarea() instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getMonitorWorkarea(monitorNum: Int, dest: RectangleRef? = nil)
  • 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” (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_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 method

    Returns 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 method

    Gets the index of screen among the screens in the display to which it belongs. (See gdk_screen_get_display())

    get_number is deprecated: This method is deprecated.

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getNumber() -> Int
  • getPrimaryMonitor() Extension method

    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.

    get_primary_monitor is deprecated: Use gdk_display_get_primary_monitor() instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getPrimaryMonitor() -> Int
  • getResolution() Extension method

    Gets the resolution for font handling on the screen; see gdk_screen_set_resolution() for full details.

    Declaration

    Swift

    @inlinable
    func getResolution() -> Double
  • getRgbaVisual() Extension method

    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().

    Declaration

    Swift

    @inlinable
    func getRgbaVisual() -> VisualRef!
  • getRootWindow() Extension method

    Gets the root window of screen.

    Declaration

    Swift

    @inlinable
    func getRootWindow() -> WindowRef!
  • getSetting(name:value:) Extension method

    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 method

    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.

    Declaration

    Swift

    @inlinable
    func getSystemVisual() -> VisualRef!
  • getToplevelWindows() Extension method

    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.

    Declaration

    Swift

    @inlinable
    func getToplevelWindows() -> GLib.ListRef!
  • getWidth() Extension method

    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()).

    get_width is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getWidth() -> Int
  • getWidthMm() Extension method

    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.

    get_width_mm is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @available(*, deprecated)
    @inlinable
    func getWidthMm() -> Int
  • getWindowStack() Extension method

    Returns a GList of GdkWindows 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 using g_object_unref() when no longer needed.

    Declaration

    Swift

    @inlinable
    func getWindowStack() -> GLib.ListRef!
  • listVisuals() Extension method

    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.

    Declaration

    Swift

    @inlinable
    func listVisuals() -> GLib.ListRef!
  • makeDisplayName() Extension method

    Determines the name to pass to gdk_display_open() to get a GdkDisplay 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 with gdk_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 with gdk_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 and protocol parameters for gdk_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 method

    Creates a PangoContext for screen.

    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. Using gtk_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 method

    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 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 method

    Gets the display to which the screen belongs.

    Declaration

    Swift

    @inlinable
    var display: DisplayRef! { get }
  • fontOptions Extension method

    Gets any options previously set with gdk_screen_set_font_options().

    Declaration

    Swift

    @inlinable
    var fontOptions: Cairo.FontOptionsRef! { get nonmutating set }
  • height Extension method

    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()).

    get_height is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @inlinable
    var height: Int { get }
  • heightMm Extension method

    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.

    get_height_mm is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @inlinable
    var heightMm: Int { get }
  • isComposited Extension method

    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.

    Declaration

    Swift

    @inlinable
    var isComposited: Bool { get }
  • nMonitors Extension method

    Returns 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 method

    Gets the index of screen among the screens in the display to which it belongs. (See gdk_screen_get_display())

    get_number is deprecated: This method is deprecated.

    Declaration

    Swift

    @inlinable
    var number: Int { get }
  • primaryMonitor Extension method

    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.

    get_primary_monitor is deprecated: Use gdk_display_get_primary_monitor() instead

    Declaration

    Swift

    @inlinable
    var primaryMonitor: Int { get }
  • resolution Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var resolution: Double { get nonmutating set }
  • rgbaVisual Extension method

    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().

    Declaration

    Swift

    @inlinable
    var rgbaVisual: VisualRef! { get }
  • rootWindow Extension method

    Gets the root window of screen.

    Declaration

    Swift

    @inlinable
    var rootWindow: WindowRef! { get }
  • systemVisual Extension method

    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.

    Declaration

    Swift

    @inlinable
    var systemVisual: VisualRef! { get }
  • toplevelWindows Extension method

    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.

    Declaration

    Swift

    @inlinable
    var toplevelWindows: GLib.ListRef! { get }
  • width Extension method

    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()).

    get_width is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @inlinable
    var width: Int { get }
  • widthMm Extension method

    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.

    get_width_mm is deprecated: Use per-monitor information instead

    Declaration

    Swift

    @inlinable
    var widthMm: Int { get }
  • windowStack Extension method

    Returns a GList of GdkWindows 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 using g_object_unref() when no longer needed.

    Declaration

    Swift

    @inlinable
    var windowStack: GLib.ListRef! { get }