GestureClickProtocol
public protocol GestureClickProtocol : GestureSingleProtocol
GtkGestureClick is a GtkGesture implementation for clicks.
It is able to recognize multiple clicks on a nearby zone, which
can be listened for through the [signalGtk.GestureClick::pressed]
signal. Whenever time or distance between clicks exceed the GTK
defaults, [signalGtk.GestureClick::stopped] is emitted, and the
click counter is reset.
The GestureClickProtocol protocol exposes the methods and properties of an underlying GtkGestureClick 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 GestureClick.
Alternatively, use GestureClickRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkGestureClickinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
gesture_click_ptrDefault implementationTyped pointer to the underlying
GtkGestureClickinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkGestureClickinstance.Declaration
Swift
var gesture_click_ptr: UnsafeMutablePointer<GtkGestureClick>! { get } -
Required Initialiser for types conforming to
GestureClickProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
GestureClickPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: GestureClickPropertyName, 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 GestureClick property
Declaration
Swift
@inlinable func get(property: GestureClickPropertyName) -> 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 GestureClick property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: GestureClickPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
GestureClickSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureClickSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
GestureClickSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureClickSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onPressed(flags:Extension methodhandler: ) Emitted whenever a button or touch press happens.
Note
This represents the underlyingpressedsignalDeclaration
Swift
@discardableResult @inlinable func onPressed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef, _ nPress: Int, _ x: Double, _ y: Double) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
nPresshow many touch/button presses happened with this one
xThe X coordinate, in widget allocation coordinates
yThe Y coordinate, in widget allocation coordinates
handlerThe signal handler to call Run the given callback whenever the
pressedsignal is emitted -
pressedSignalExtension methodTyped
pressedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var pressedSignal: GestureClickSignalName { get } -
onReleased(flags:Extension methodhandler: ) Emitted when a button or touch is released.
n_presswill report the number of press that is paired to this event, note that [signalGtk.GestureClick::stopped] may have been emitted between the press and its release,n_presswill only start over at the next press.Note
This represents the underlyingreleasedsignalDeclaration
Swift
@discardableResult @inlinable func onReleased(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef, _ nPress: Int, _ x: Double, _ y: Double) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
nPressnumber of press that is paired with this release
xThe X coordinate, in widget allocation coordinates
yThe Y coordinate, in widget allocation coordinates
handlerThe signal handler to call Run the given callback whenever the
releasedsignal is emitted -
releasedSignalExtension methodTyped
releasedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var releasedSignal: GestureClickSignalName { get } -
onStopped(flags:Extension methodhandler: ) Emitted whenever any time/distance threshold has been exceeded.
Note
This represents the underlyingstoppedsignalDeclaration
Swift
@discardableResult @inlinable func onStopped(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
stoppedsignal is emitted -
stoppedSignalExtension methodTyped
stoppedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var stoppedSignal: GestureClickSignalName { get } -
onUnpairedRelease(flags:Extension methodhandler: ) Emitted whenever the gesture receives a release event that had no previous corresponding press.
Due to implicit grabs, this can only happen on situations where input is grabbed elsewhere mid-press or the pressed widget voluntarily relinquishes its implicit grab.
Note
This represents the underlyingunpaired-releasesignalDeclaration
Swift
@discardableResult @inlinable func onUnpairedRelease(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef, _ x: Double, _ y: Double, _ button: UInt, _ sequence: Gdk.EventSequenceRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
xX coordinate of the event
yY coordinate of the event
buttonButton being released
sequenceSequence being released
handlerThe signal handler to call Run the given callback whenever the
unpairedReleasesignal is emitted -
unpairedReleaseSignalExtension methodTyped
unpaired-releasesignal for using theconnect(signal:)methodsDeclaration
Swift
static var unpairedReleaseSignal: GestureClickSignalName { get }
View on GitHub
Install in Dash
GestureClickProtocol Protocol Reference