Cursor
open class Cursor : GLibObject.Object, CursorProtocol
The Cursor
type acts as a reference-counted owner of an underlying GdkCursor
instance.
It provides the methods that can operate on this data type through CursorProtocol
conformance.
Use Cursor
as a strong reference or owner of a GdkCursor
instance.
A GdkCursor
represents a cursor. Its contents are private.
-
Designated initialiser from the underlying `C` data type.
This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the
Cursor
instance.Declaration
Swift
@inlinable public init(_ op: UnsafeMutablePointer<GdkCursor>)
Parameters
op
pointer to the underlying object
-
Designated initialiser from a constant pointer to the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theCursor
instance.Declaration
Swift
@inlinable public init(_ op: UnsafePointer<GdkCursor>)
Parameters
op
pointer to the underlying object
-
Optional initialiser from a non-mutating
gpointer
to the underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theCursor
instance.Declaration
Swift
@inlinable override public init!(gpointer op: gpointer?)
Parameters
op
gpointer to the underlying object
-
Optional initialiser from a non-mutating
gconstpointer
to the underlyingC
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theCursor
instance.Declaration
Swift
@inlinable override public init!(gconstpointer op: gconstpointer?)
Parameters
op
pointer to the underlying object
-
Optional initialiser from a constant pointer to the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theCursor
instance.Declaration
Swift
@inlinable public init!(_ op: UnsafePointer<GdkCursor>?)
Parameters
op
pointer to the underlying object
-
Optional initialiser from the underlying
C
data type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theCursor
instance.Declaration
Swift
@inlinable public init!(_ op: UnsafeMutablePointer<GdkCursor>?)
Parameters
op
pointer to the underlying object
-
Designated initialiser from the underlying
C
data type. Will retainGdkCursor
. i.e., ownership is transferred to theCursor
instance.Declaration
Swift
@inlinable public init(retaining op: UnsafeMutablePointer<GdkCursor>)
Parameters
op
pointer to the underlying object
-
Reference intialiser for a related type that implements
CursorProtocol
Will retainGdkCursor
.Declaration
Swift
@inlinable public init<T>(cursor other: T) where T : CursorProtocol
Parameters
other
an instance of a related type that implements
CursorProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable override public init<T>(cPointer p: UnsafeMutablePointer<T>)
Parameters
cPointer
pointer to the underlying object
-
Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)
Parameters
cPointer
pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable override public init(raw p: UnsafeRawPointer)
Parameters
p
raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable override public init(retainingRaw raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable public required init(raw p: UnsafeMutableRawPointer)
Parameters
p
mutable raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable required public init(retainingRaw raw: UnsafeMutableRawPointer)
Parameters
raw
mutable raw pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable override public init(opaquePointer p: OpaquePointer)
Parameters
p
opaque pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
CursorProtocol
.Declaration
Swift
@inlinable override public init(retainingOpaquePointer p: OpaquePointer)
Parameters
p
opaque pointer to the underlying object
-
Creates a new cursor from the set of builtin cursors for the default display. See
gdk_cursor_new_for_display()
.To make the cursor invisible, use
GDK_BLANK_CURSOR
.new is deprecated: Use gdk_cursor_new_for_display() instead.
Declaration
Swift
@available(*, deprecated) @inlinable public init(cursorType: GdkCursorType)
-
Creates a new cursor from the set of builtin cursors.
Declaration
Swift
@inlinable public init<DisplayT>(display: DisplayT, cursorType: GdkCursorType) where DisplayT : DisplayProtocol
-
Creates a new cursor by looking up
name
in the current cursor theme.A recommended set of cursor names that will work across different platforms can be found in the CSS specification:
- “none”
- “default”
- “help”
- “pointer”
- “context-menu”
- “progress”
- “wait”
- “cell”
- “crosshair”
- “text”
- “vertical-text”
- “alias”
- “copy”
- “no-drop”
- “move”
- “not-allowed”
- “grab”
- “grabbing”
- “all-scroll”
- “col-resize”
- “row-resize”
- “n-resize”
- “e-resize”
- “s-resize”
- “w-resize”
- “ne-resize”
- “nw-resize”
- “sw-resize”
- “se-resize”
- “ew-resize”
- “ns-resize”
- “nesw-resize”
- “nwse-resize”
- “zoom-in”
- “zoom-out”
Declaration
Swift
@inlinable public init<DisplayT>(name display: DisplayT, name: UnsafePointer<gchar>!) where DisplayT : DisplayProtocol
-
Creates a new cursor from a pixbuf.
Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions
gdk_display_supports_cursor_alpha()
andgdk_display_supports_cursor_color()
can be used to determine whether RGBA cursors are supported;gdk_display_get_default_cursor_size()
andgdk_display_get_maximal_cursor_size()
give information about cursor sizes.If
x
ory
are-1
, the pixbuf must have options named “x_hot” and “y_hot”, resp., containing integer values between0
and the width resp. height of the pixbuf. (Since: 3.0)On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.
Declaration
Swift
@inlinable public init<DisplayT, PixbufT>(pixbuf display: DisplayT, pixbuf: PixbufT, x: Int, y: Int) where DisplayT : DisplayProtocol, PixbufT : PixbufProtocol
-
Creates a new cursor from a cairo image surface.
Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions
gdk_display_supports_cursor_alpha()
andgdk_display_supports_cursor_color()
can be used to determine whether RGBA cursors are supported;gdk_display_get_default_cursor_size()
andgdk_display_get_maximal_cursor_size()
give information about cursor sizes.On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.
Declaration
Swift
@inlinable public init<DisplayT, SurfaceT>(surface display: DisplayT, surface: SurfaceT, x: Double, y: Double) where DisplayT : DisplayProtocol, SurfaceT : SurfaceProtocol
-
Creates a new cursor from the set of builtin cursors.
Declaration
Swift
@inlinable public static func newFor<DisplayT>(display: DisplayT, cursorType: GdkCursorType) -> Cursor! where DisplayT : DisplayProtocol
-
Creates a new cursor by looking up
name
in the current cursor theme.A recommended set of cursor names that will work across different platforms can be found in the CSS specification:
- “none”
- “default”
- “help”
- “pointer”
- “context-menu”
- “progress”
- “wait”
- “cell”
- “crosshair”
- “text”
- “vertical-text”
- “alias”
- “copy”
- “no-drop”
- “move”
- “not-allowed”
- “grab”
- “grabbing”
- “all-scroll”
- “col-resize”
- “row-resize”
- “n-resize”
- “e-resize”
- “s-resize”
- “w-resize”
- “ne-resize”
- “nw-resize”
- “sw-resize”
- “se-resize”
- “ew-resize”
- “ns-resize”
- “nesw-resize”
- “nwse-resize”
- “zoom-in”
- “zoom-out”
Declaration
Swift
@inlinable public static func newFrom<DisplayT>(name display: DisplayT, name: UnsafePointer<gchar>!) -> Cursor! where DisplayT : DisplayProtocol
-
Creates a new cursor from a pixbuf.
Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions
gdk_display_supports_cursor_alpha()
andgdk_display_supports_cursor_color()
can be used to determine whether RGBA cursors are supported;gdk_display_get_default_cursor_size()
andgdk_display_get_maximal_cursor_size()
give information about cursor sizes.If
x
ory
are-1
, the pixbuf must have options named “x_hot” and “y_hot”, resp., containing integer values between0
and the width resp. height of the pixbuf. (Since: 3.0)On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.
Declaration
Swift
@inlinable public static func newFrom<DisplayT, PixbufT>(pixbuf display: DisplayT, pixbuf: PixbufT, x: Int, y: Int) -> Cursor! where DisplayT : DisplayProtocol, PixbufT : PixbufProtocol
-
Creates a new cursor from a cairo image surface.
Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions
gdk_display_supports_cursor_alpha()
andgdk_display_supports_cursor_color()
can be used to determine whether RGBA cursors are supported;gdk_display_get_default_cursor_size()
andgdk_display_get_maximal_cursor_size()
give information about cursor sizes.On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.
Declaration
Swift
@inlinable public static func newFrom<DisplayT, SurfaceT>(surface display: DisplayT, surface: SurfaceT, x: Double, y: Double) -> Cursor! where DisplayT : DisplayProtocol, SurfaceT : SurfaceProtocol