Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GestureSingleMeta

[258:14] static extends: object

Generated metadata helpers for GestureSingle class surfaces.

Methods

  • properties ()

    Returns property metadata for GestureSingle.

    • @r A list.

class: GestureSingle

[22:7] extends: object

A GtkGesture subclass optimized for singe-touch and mouse gestures. Under interaction, these gestures stick to the first interacting sequence, which is accessible through [method@Gtk.GestureSingle.get_current_sequence] while the gesture is being interacted with. By default gestures react to both %GDK_BUTTON_PRIMARY and touch events. [method@Gtk.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 [method@Gtk.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 [method@Gtk.GestureSingle.get_current_button].

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GestureSingle (Handle = null)

    Creates a new GestureSingle by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asGesture ()

    Wraps this handle as Gesture.

    • @r A Gesture object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setButton (int Value)

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

    • @p Value is the new property value.
    • @r None.
  • setExclusive (bool Value)

    Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events.

    • @p Value is the new property value.
    • @r None.
  • setTouchonly (bool Value)

    Whether the gesture handles only touch events.

    • @p Value is the new property value.
    • @r None.
  • get_button ()

    Returns the button number @gesture listens for. If this is 0, the gesture reacts to any button press.

  • get_current_button ()

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

  • get_current_sequence ()

    Returns the event sequence currently interacting with @gesture. This is only meaningful if [method@Gtk.Gesture.is_active] returns %TRUE.

  • get_exclusive ()

    Gets whether a gesture is exclusive. For more information, see [method@Gtk.GestureSingle.set_exclusive].

  • get_touch_only ()

    Returns %TRUE if the gesture is only triggered by touch events.

  • set_button (int button)

    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.

    • @p button is button number to listen to, or 0 for any button.
    • @r None.
  • set_exclusive (bool exclusive)

    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.

    • @p exclusive is %TRUE to make @gesture exclusive.
    • @r None.
  • set_touch_only (bool touch_only)

    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.
    • @p touch_only is whether @gesture handles only touch events.
    • @r None.