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
GtkGestureSingleinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
gesture_single_ptrDefault implementationTyped pointer to the underlying
GtkGestureSingleinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkGestureSingleinstance.Declaration
Swift
var gesture_single_ptr: UnsafeMutablePointer<GtkGestureSingle>! { get } -
Required Initialiser for types conforming to
GestureSingleProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
GestureSinglePropertyNamesource 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 : 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 GestureSingle property
Declaration
Swift
@inlinable func get(property: GestureSinglePropertyName) -> 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 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
propertythe property to get the value for
Return Value
the value of the named property
-
getButton()Extension methodReturns the button number
gesturelistens 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
trueif the gesture is only triggered by touch events.Declaration
Swift
@inlinable func getTouchOnly() -> Bool -
set(button:Extension method) Sets the button number
gesturelistens 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
gestureis 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_onlyistrue,gesturewill only handle events of typeGDK_TOUCH_BEGIN,GDK_TOUCH_UPDATEorGDK_TOUCH_END. Iffalse, mouse events will be handled too.Declaration
Swift
@inlinable func set(touchOnly: Bool) -
buttonExtension methodMouse button number to listen to, or 0 to listen for any button.
Declaration
Swift
@inlinable var button: Int { get nonmutating set } -
currentButtonExtension methodReturns the button number currently interacting with
gesture, or 0 if there is none.Declaration
Swift
@inlinable var currentButton: Int { get } -
currentSequenceExtension 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 } -
exclusiveExtension methodWhether the gesture is exclusive.
Exclusive gestures only listen to pointer and pointer emulated events.
Declaration
Swift
@inlinable var exclusive: Bool { get nonmutating set } -
touchOnlyExtension methodReturns
trueif the gesture is only triggered by touch events.Declaration
Swift
@inlinable var touchOnly: Bool { get nonmutating set }
View on GitHub
Install in Dash
GestureSingleProtocol Protocol Reference