Class GestureZoom

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class GestureZoom extends Gesture

Recognizes 2-finger pinch/zoom gestures.

Whenever the distance between both tracked sequences changes, the Gtk.GestureZoom::scale-changed signal is emitted to report the scale factor.

  • Constructor Details

    • GestureZoom

      public GestureZoom(MemorySegment address)
      Create a GestureZoom instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • GestureZoom

      public GestureZoom()
      Create a new GestureZoom.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the GestureZoom class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected GestureZoom asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Gesture
      Returns:
      the instance as if it were its parent type
    • getScaleDelta

      public double getScaleDelta()

      Gets the scale delta.

      If this GestureZoom is active, this function returns the zooming difference since the gesture was recognized (hence the starting point is considered 1:1). If this GestureZoom is not active, 1 is returned.

      Returns:
      the scale delta
    • onScaleChanged

      Emitted whenever the distance between both tracked sequences changes.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitScaleChanged

      public void emitScaleChanged(double scale)
      Emits the "scale-changed" signal. See onScaleChanged(GestureZoom.ScaleChangedCallback).
    • builder

      public static GestureZoom.Builder<? extends GestureZoom.Builder> builder()
      A GestureZoom.Builder object constructs a GestureZoom with the specified properties. Use the various set...() methods to set properties, and finish construction with GestureZoom.Builder.build().
      Returns:
      the builder object