GestureClickProtocol

public protocol GestureClickProtocol : GestureSingleProtocol

GtkGestureClick is a GtkGesture implementation for clicks.

It is able to recognize multiple clicks on a nearby zone, which can be listened for through the [signalGtk.GestureClick::pressed] signal. Whenever time or distance between clicks exceed the GTK defaults, [signalGtk.GestureClick::stopped] is emitted, and the click counter is reset.

The GestureClickProtocol protocol exposes the methods and properties of an underlying GtkGestureClick 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 GestureClick. Alternatively, use GestureClickRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkGestureClick instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkGestureClick instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkGestureClick instance.

    Declaration

    Swift

    var gesture_click_ptr: UnsafeMutablePointer<GtkGestureClick>! { get }
  • Required Initialiser for types conforming to GestureClickProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

GestureClick Class

  • Bind a GestureClickPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: GestureClickPropertyName, 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 GestureClick property

    Declaration

    Swift

    @inlinable
    func get(property: GestureClickPropertyName) -> 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 GestureClick property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: GestureClickPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

GestureClick signals

  • Connect a Swift signal handler to the given, typed GestureClickSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: GestureClickSignalName, 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 by userData

    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 a C signal handler to the given, typed GestureClickSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: GestureClickSignalName, 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 by userData

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

    Emitted whenever a button or touch press happens.

    Note

    This represents the underlying pressed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onPressed(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef, _ 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 method

    Typed pressed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var pressedSignal: GestureClickSignalName { get }
  • onReleased(flags:handler:) Extension method

    Emitted when a button or touch is released.

    n_press will report the number of press that is paired to this event, note that [signalGtk.GestureClick::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 underlying released signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onReleased(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef, _ 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 method

    Typed released signal for using the connect(signal:) methods

    Declaration

    Swift

    static var releasedSignal: GestureClickSignalName { get }
  • onStopped(flags:handler:) Extension method

    Emitted whenever any time/distance threshold has been exceeded.

    Note

    This represents the underlying stopped signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onStopped(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef) -> 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 method

    Typed stopped signal for using the connect(signal:) methods

    Declaration

    Swift

    static var stoppedSignal: GestureClickSignalName { get }
  • Emitted whenever the gesture receives a release event that had no previous corresponding press.

    Due to implicit grabs, this can only happen on situations where input is grabbed elsewhere mid-press or the pressed widget voluntarily relinquishes its implicit grab.

    Note

    This represents the underlying unpaired-release signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onUnpairedRelease(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: GestureClickRef, _ x: Double, _ y: Double, _ button: UInt, _ sequence: Gdk.EventSequenceRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    x

    X coordinate of the event

    y

    Y coordinate of the event

    button

    Button being released

    sequence

    Sequence being released

    handler

    The signal handler to call Run the given callback whenever the unpairedRelease signal is emitted

  • unpairedReleaseSignal Extension method

    Typed unpaired-release signal for using the connect(signal:) methods

    Declaration

    Swift

    static var unpairedReleaseSignal: GestureClickSignalName { get }