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.

  • ptr

    Untyped pointer to the underlying GtkGestureSingle instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • gesture_single_ptr Default implementation

    Typed 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)

GestureSingle Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

GestureSingle Class: GestureSingleProtocol extension (methods and fields)

  • getButton() Extension method

    Returns 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 method

    Returns the button number currently interacting with gesture, or 0 if there is none.

    Declaration

    Swift

    @inlinable
    func getCurrentButton() -> Int
  • getCurrentSequence() Extension method

    Returns the event sequence currently interacting with gesture.

    This is only meaningful if [methodGtk.Gesture.is_active] returns true.

    Declaration

    Swift

    @inlinable
    func getCurrentSequence() -> Gdk.EventSequenceRef!
  • getExclusive() Extension method

    Gets whether a gesture is exclusive.

    For more information, see [methodGtk.GestureSingle.set_exclusive].

    Declaration

    Swift

    @inlinable
    func getExclusive() -> Bool
  • getTouchOnly() Extension method

    Returns 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 is true, gesture will only handle events of type GDK_TOUCH_BEGIN, GDK_TOUCH_UPDATE or GDK_TOUCH_END. If false, mouse events will be handled too.

    Declaration

    Swift

    @inlinable
    func set(touchOnly: Bool)
  • button Extension method

    Mouse button number to listen to, or 0 to listen for any button.

    Declaration

    Swift

    @inlinable
    var button: Int { get nonmutating set }
  • currentButton Extension method

    Returns the button number currently interacting with gesture, or 0 if there is none.

    Declaration

    Swift

    @inlinable
    var currentButton: Int { get }
  • currentSequence Extension method

    Returns the event sequence currently interacting with gesture.

    This is only meaningful if [methodGtk.Gesture.is_active] returns true.

    Declaration

    Swift

    @inlinable
    var currentSequence: Gdk.EventSequenceRef! { get }
  • exclusive Extension method

    Whether 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 method

    Returns true if the gesture is only triggered by touch events.

    Declaration

    Swift

    @inlinable
    var touchOnly: Bool { get nonmutating set }