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
GtkGestureMultiPress
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
gesture_multi_press_ptr
Default implementationTyped pointer to the underlying
GtkGestureMultiPress
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkGestureMultiPress
instance.Declaration
Swift
var gesture_multi_press_ptr: UnsafeMutablePointer<GtkGestureMultiPress>! { get }
-
Required Initialiser for types conforming to
GestureMultiPressProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
GestureMultiPressPropertyName
source 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 : 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 GestureMultiPress property
Declaration
Swift
@inlinable func get(property: GestureMultiPressPropertyName) -> 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 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
property
the 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
GestureMultiPressSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureMultiPressSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The 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
GestureMultiPressSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: GestureMultiPressSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The 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 underlyingpressed
signalDeclaration
Swift
@discardableResult @inlinable func onPressed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureMultiPressRef, _ nPress: Int, _ x: Double, _ y: Double) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
nPress
how many touch/button presses happened with this one
x
The X coordinate, in widget allocation coordinates
y
The Y coordinate, in widget allocation coordinates
handler
The signal handler to call Run the given callback whenever the
pressed
signal is emitted -
pressedSignal
Extension methodTyped
pressed
signal 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_press
will report the number of press that is paired to this event, note thatGtkGestureMultiPress::stopped
may have been emitted between the press and its release,n_press
will only start over at the next press.Note
This represents the underlyingreleased
signalDeclaration
Swift
@discardableResult @inlinable func onReleased(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureMultiPressRef, _ nPress: Int, _ x: Double, _ y: Double) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
nPress
number of press that is paired with this release
x
The X coordinate, in widget allocation coordinates
y
The Y coordinate, in widget allocation coordinates
handler
The signal handler to call Run the given callback whenever the
released
signal is emitted -
releasedSignal
Extension methodTyped
released
signal 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 underlyingstopped
signalDeclaration
Swift
@discardableResult @inlinable func onStopped(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureMultiPressRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
stopped
signal is emitted -
stoppedSignal
Extension methodTyped
stopped
signal 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 returntrue
and fill inrect
with 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
rect
is 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. Ifrect
isnil
, 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
rect
is 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. Ifrect
isnil
, 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