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
GdkCursorinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
cursor_ptrDefault implementationTyped pointer to the underlying
GdkCursorinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkCursorinstance.Declaration
Swift
var cursor_ptr: UnsafeMutablePointer<GdkCursor>! { get } -
Required Initialiser for types conforming to
CursorProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
CursorPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Cursor property
Declaration
Swift
@inlinable func get(property: CursorPropertyName) -> GLibObject.ValueParameters
propertythe 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
propertythe 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
GdkCursoris defined.Declaration
Swift
@inlinable func getDisplay() -> DisplayRef! -
getImage()Extension methodReturns a
GdkPixbufwith 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,
nilis 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,
nilis 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
GtkHPanedandGtkVPanedwidgets.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_eventsset 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
GdkEventGrabBrokenevents 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 -
cursorTypeExtension methodReturns the cursor type for this cursor.
Declaration
Swift
@inlinable var cursorType: GdkCursorType { get } -
displayExtension methodUndocumented
Declaration
Swift
@inlinable var display: DisplayRef! { get } -
imageExtension methodReturns a
GdkPixbufwith 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,
nilis returned.Declaration
Swift
@inlinable var image: PixbufRef! { get }
View on GitHub
Install in Dash
CursorProtocol Protocol Reference