CursorProtocol
public protocol CursorProtocol : ObjectProtocol
The CursorProtocol
protocol exposes the methods and properties of an underlying GdkCursor
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 Cursor
.
Alternatively, use CursorRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
A GdkCursor
represents a cursor. Its contents are private.
-
Untyped pointer to the underlying
GdkCursor
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
cursor_ptr
Default implementationTyped pointer to the underlying
GdkCursor
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkCursor
instance.Declaration
Swift
var cursor_ptr: UnsafeMutablePointer<GdkCursor>! { get }
-
Required Initialiser for types conforming to
CursorProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
CursorPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: CursorPropertyName, 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 Cursor property
Declaration
Swift
@inlinable func get(property: CursorPropertyName) -> 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 Cursor property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: CursorPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
getCursorType()
Extension methodReturns the cursor type for this cursor.
Declaration
Swift
@inlinable func getCursorType() -> GdkCursorType
-
getDisplay()
Extension methodReturns the display on which the
GdkCursor
is defined.Declaration
Swift
@inlinable func getDisplay() -> DisplayRef!
-
getImage()
Extension methodReturns a
GdkPixbuf
with the image used to display the cursor.Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case,
nil
is returned.Declaration
Swift
@inlinable func getImage() -> PixbufRef!
-
getSurface(xHot:
Extension methodyHot: ) Returns a cairo image surface with the image used to display the cursor.
Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case,
nil
is returned.Declaration
Swift
@inlinable func getSurface(xHot: UnsafeMutablePointer<gdouble>! = nil, yHot: UnsafeMutablePointer<gdouble>! = nil) -> Cairo.SurfaceRef!
-
ref()
Extension methodAdds a reference to
cursor
.ref is deprecated: Use g_object_ref() instead
Declaration
Swift
@available(*, deprecated) @discardableResult @inlinable func ref() -> CursorRef!
-
unref()
Extension methodRemoves a reference from
cursor
, deallocating the cursor if no references remain.unref is deprecated: Use g_object_unref() instead
Declaration
Swift
@available(*, deprecated) @inlinable func unref()
-
pointerGrab(window:
Extension methodownerEvents: eventMask: confineTo: time_: ) Grabs the pointer (usually a mouse) so that all events are passed to this application until the pointer is ungrabbed with
gdk_pointer_ungrab()
, or the grab window becomes unviewable. This overrides any previous pointer grab by this client.Pointer grabs are used for operations which need complete control over mouse events, even if the mouse leaves the application. For example in GTK+ it is used for Drag and Drop, for dragging the handle in the
GtkHPaned
andGtkVPaned
widgets.Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with
owner_events
set totrue
.If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the
GdkEventGrabBroken
events that are emitted when the grab ends unvoluntarily.pointer_grab is deprecated: Use gdk_device_grab() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func pointerGrab<WindowT>(window: WindowT, ownerEvents: Bool, eventMask: EventMask, confineTo: WindowT?, time_: guint32) -> GdkGrabStatus where WindowT : WindowProtocol
-
cursorType
Extension methodReturns the cursor type for this cursor.
Declaration
Swift
@inlinable var cursorType: GdkCursorType { get }
-
display
Extension methodUndocumented
Declaration
Swift
@inlinable var display: DisplayRef! { get }
-
image
Extension methodReturns a
GdkPixbuf
with the image used to display the cursor.Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case,
nil
is returned.Declaration
Swift
@inlinable var image: PixbufRef! { get }