GestureSingleProtocol
public protocol GestureSingleProtocol : GestureProtocol
GtkGestureSingle
is a GtkGestures
subclass optimized for singe-touch
and mouse gestures.
Under interaction, these gestures stick to the first interacting sequence,
which is accessible through [methodGtk.GestureSingle.get_current_sequence
]
while the gesture is being interacted with.
By default gestures react to both GDK_BUTTON_PRIMARY
and touch events.
[methodGtk.GestureSingle.set_touch_only
] can be used to change the
touch behavior. Callers may also specify a different mouse button number
to interact with through [methodGtk.GestureSingle.set_button
], or react
to any mouse button by setting it to 0. While the gesture is active, the
button being currently pressed can be known through
[methodGtk.GestureSingle.get_current_button
].
The GestureSingleProtocol
protocol exposes the methods and properties of an underlying GtkGestureSingle
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 GestureSingle
.
Alternatively, use GestureSingleRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkGestureSingle
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
gesture_single_ptr
Default implementationTyped pointer to the underlying
GtkGestureSingle
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkGestureSingle
instance.Declaration
Swift
var gesture_single_ptr: UnsafeMutablePointer<GtkGestureSingle>! { get }
-
Required Initialiser for types conforming to
GestureSingleProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
GestureSinglePropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: GestureSinglePropertyName, 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 GestureSingle property
Declaration
Swift
@inlinable func get(property: GestureSinglePropertyName) -> 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 GestureSingle property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: GestureSinglePropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
getButton()
Extension methodReturns the button number
gesture
listens for.If this is 0, the gesture reacts to any button press.
Declaration
Swift
@inlinable func getButton() -> Int
-
getCurrentButton()
Extension methodReturns the button number currently interacting with
gesture
, or 0 if there is none.Declaration
Swift
@inlinable func getCurrentButton() -> Int
-
getCurrentSequence()
Extension methodReturns the event sequence currently interacting with
gesture
.This is only meaningful if [method
Gtk.Gesture.is_active
] returnstrue
.Declaration
Swift
@inlinable func getCurrentSequence() -> Gdk.EventSequenceRef!
-
getExclusive()
Extension methodGets whether a gesture is exclusive.
For more information, see [method
Gtk.GestureSingle.set_exclusive
].Declaration
Swift
@inlinable func getExclusive() -> Bool
-
getTouchOnly()
Extension methodReturns
true
if the gesture is only triggered by touch events.Declaration
Swift
@inlinable func getTouchOnly() -> Bool
-
set(button:
Extension method) Sets the button number
gesture
listens to.If non-0, every button press from a different button number will be ignored. Touch events implicitly match with button 1.
Declaration
Swift
@inlinable func set(button: Int)
-
set(exclusive:
Extension method) Sets whether
gesture
is exclusive.An exclusive gesture will only handle pointer and “pointer emulated” touch events, so at any given time, there is only one sequence able to interact with those.
Declaration
Swift
@inlinable func set(exclusive: Bool)
-
set(touchOnly:
Extension method) Sets whether to handle only touch events.
If
touch_only
istrue
,gesture
will only handle events of typeGDK_TOUCH_BEGIN
,GDK_TOUCH_UPDATE
orGDK_TOUCH_END
. Iffalse
, mouse events will be handled too.Declaration
Swift
@inlinable func set(touchOnly: Bool)
-
button
Extension methodMouse button number to listen to, or 0 to listen for any button.
Declaration
Swift
@inlinable var button: Int { get nonmutating set }
-
currentButton
Extension methodReturns the button number currently interacting with
gesture
, or 0 if there is none.Declaration
Swift
@inlinable var currentButton: Int { get }
-
currentSequence
Extension methodReturns the event sequence currently interacting with
gesture
.This is only meaningful if [method
Gtk.Gesture.is_active
] returnstrue
.Declaration
Swift
@inlinable var currentSequence: Gdk.EventSequenceRef! { get }
-
exclusive
Extension methodWhether the gesture is exclusive.
Exclusive gestures only listen to pointer and pointer emulated events.
Declaration
Swift
@inlinable var exclusive: Bool { get nonmutating set }
-
touchOnly
Extension methodReturns
true
if the gesture is only triggered by touch events.Declaration
Swift
@inlinable var touchOnly: Bool { get nonmutating set }