GestureMultiPressProtocol
public protocol GestureMultiPressProtocol : GestureSingleProtocol
GtkGestureMultiPress is a GtkGesture implementation able to recognize
multiple clicks on a nearby zone, which can be listened for through the
GtkGestureMultiPress::pressed signal. Whenever time or distance between
clicks exceed the GTK+ defaults, GtkGestureMultiPress::stopped is emitted,
and the click counter is reset.
Callers may also restrict the area that is considered valid for a >1
touch/button press through gtk_gesture_multi_press_set_area(), so any
click happening outside that area is considered to be a first click of
its own.
The GestureMultiPressProtocol protocol exposes the methods and properties of an underlying GtkGestureMultiPress 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 GestureMultiPress.
Alternatively, use GestureMultiPressRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkGestureMultiPressinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
gesture_multi_press_ptrDefault implementationTyped pointer to the underlying
GtkGestureMultiPressinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkGestureMultiPressinstance.Declaration
Swift
var gesture_multi_press_ptr: UnsafeMutablePointer<GtkGestureMultiPress>! { get } -
Required Initialiser for types conforming to
GestureMultiPressProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
GestureMultiPressPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: GestureMultiPressPropertyName, 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 GestureMultiPress property
Declaration
Swift
@inlinable func get(property: GestureMultiPressPropertyName) -> 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 GestureMultiPress property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: GestureMultiPressPropertyName, 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
GestureMultiPressSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureMultiPressSignalName, 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
GestureMultiPressSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureMultiPressSignalName, 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: ) This signal is 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: GestureMultiPressRef, _ 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: GestureMultiPressSignalName { get } -
onReleased(flags:Extension methodhandler: ) This signal is emitted when a button or touch is released.
n_presswill report the number of press that is paired to this event, note thatGtkGestureMultiPress::stoppedmay 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: GestureMultiPressRef, _ 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: GestureMultiPressSignalName { get } -
onStopped(flags:Extension methodhandler: ) This signal is 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: GestureMultiPressRef) -> 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: GestureMultiPressSignalName { get }
-
getArea(rect:Extension method) If an area was set through
gtk_gesture_multi_press_set_area(), this function will returntrueand fill inrectwith the press area. Seegtk_gesture_multi_press_set_area()for more details on what the press area represents.Declaration
Swift
@inlinable func getArea<RectangleT>(rect: RectangleT) -> Bool where RectangleT : RectangleProtocol -
setArea(rect:Extension method) If
rectis non-nil, the press area will be checked to be confined within the rectangle, otherwise the button count will be reset so the press is seen as being the first one. Ifrectisnil, the area will be reset to an unrestricted state.Note: The rectangle is only used to determine whether any non-first click falls within the expected area. This is not akin to an input shape.
Declaration
Swift
@inlinable func setArea(rect: Gdk.RectangleRef? = nil) -
setArea(rect:Extension method) If
rectis non-nil, the press area will be checked to be confined within the rectangle, otherwise the button count will be reset so the press is seen as being the first one. Ifrectisnil, the area will be reset to an unrestricted state.Note: The rectangle is only used to determine whether any non-first click falls within the expected area. This is not akin to an input shape.
Declaration
Swift
@inlinable func setArea<RectangleT>(rect: RectangleT?) where RectangleT : RectangleProtocol
View on GitHub
Install in Dash
GestureMultiPressProtocol Protocol Reference