DisplayManagerRef
public struct DisplayManagerRef : DisplayManagerProtocol, GWeakCapturing
The DisplayManagerRef
type acts as a lightweight Swift reference to an underlying GdkDisplayManager
instance.
It exposes methods that can operate on this data type through DisplayManagerProtocol
conformance.
Use DisplayManagerRef
only as an unowned
reference to an existing GdkDisplayManager
instance.
A singleton object that offers notification when displays appear or disappear.
You can use [funcGdk.DisplayManager.get
] to obtain the GdkDisplayManager
singleton, but that should be rarely necessary. Typically, initializing
GTK opens a display that you can work with without ever accessing the
GdkDisplayManager
.
The GDK library can be built with support for multiple backends.
The GdkDisplayManager
object determines which backend is used
at runtime.
In the rare case that you need to influence which of the backends
is being used, you can use [funcGdk.set_allowed_backends
]. Note
that you need to call this function before initializing GTK.
Backend-specific code
When writing backend-specific code that is supposed to work with
multiple GDK backends, you have to consider both compile time and
runtime. At compile time, use the GDK_WINDOWING_X11
, GDK_WINDOWING_WIN32
macros, etc. to find out which backends are present in the GDK library
you are building your application against. At runtime, use type-check
macros like GDK_IS_X11_DISPLAY()
to find out which backend is in use:
`ifdef` GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (display))
{
// make X11-specific calls here
}
else
`endif`
`ifdef` GDK_WINDOWING_MACOS
if (GDK_IS_MACOS_DISPLAY (display))
{
// make Quartz-specific calls here
}
else
`endif`
g_error ("Unsupported GDK backend");
-
Untyped pointer to the underlying `GdkDisplayManager` instance.
For type-safe access, use the generated, typed pointer
display_manager_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GdkDisplayManager>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GdkDisplayManager>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GdkDisplayManager>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GdkDisplayManager>?)
-
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
DisplayManagerProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : DisplayManagerProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> DisplayManagerRef where T : DisplayManagerProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
DisplayManagerProtocol
.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
DisplayManagerProtocol
.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
DisplayManagerProtocol
.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
DisplayManagerProtocol
.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
DisplayManagerProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)
-
Gets the singleton `GdkDisplayManager` object.
When called for the first time, this function consults the
GDK_BACKEND
environment variable to find out which of the supported GDK backends to use (in case GDK has been compiled with multiple backends).Applications can use [func
set_allowed_backends
] to limit what backends wil be used.Declaration
Swift
@inlinable static func displayManagerGet() -> DisplayManagerRef!