DisplayRef

public struct DisplayRef : DisplayProtocol, GWeakCapturing

The DisplayRef type acts as a lightweight Swift reference to an underlying GdkDisplay instance. It exposes methods that can operate on this data type through DisplayProtocol conformance. Use DisplayRef only as an unowned reference to an existing GdkDisplay instance.

GdkDisplay objects are the GDK representation of a workstation.

Their purpose are two-fold:

  • To manage and provide information about input devices (pointers, keyboards, etc)
  • To manage and provide information about output devices (monitors, projectors, etc)

Most of the input device handling has been factored out into separate [classGdk.Seat] objects. Every display has a one or more seats, which can be accessed with [methodGdk.Display.get_default_seat] and [methodGdk.Display.list_seats].

Output devices are represented by [classGdk.Monitor] objects, which can be accessed with [methodGdk.Display.get_monitor_at_surface] and similar APIs.

  • ptr
    Untyped pointer to the underlying `GdkDisplay` instance.
    

    For type-safe access, use the generated, typed pointer display_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

Display Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GdkDisplay>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GdkDisplay>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GdkDisplay>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GdkDisplay>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements DisplayProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : DisplayProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> DisplayRef where T : DisplayProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DisplayProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DisplayProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DisplayProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DisplayProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to DisplayProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Gets the default `GdkDisplay`.
    

    This is a convenience function for: gdk_display_manager_get_default_display (gdk_display_manager_get ()).

    Declaration

    Swift

    @inlinable
    static func getDefault() -> DisplayRef!
  • Opens a display.

    Declaration

    Swift

    @inlinable
    static func open(displayName: UnsafePointer<CChar>!) -> DisplayRef!