Interface TextView.MoveCursorCallback

All Superinterfaces:
FunctionPointer
Enclosing class:
TextView
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface TextView.MoveCursorCallback extends FunctionPointer

Functional interface declaration of the MoveCursorCallback callback.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run(MovementStep step, int count, boolean extendSelection)
    Gets emitted when the user initiates a cursor movement.
    Creates a native function pointer to the upcall(MemorySegment, int, int, int) method.
    default void
    upcall(MemorySegment sourceTextView, int step, int count, int extendSelection)
    The upcall method is called from native code.
  • Method Details

    • run

      void run(MovementStep step, int count, boolean extendSelection)

      Gets emitted when the user initiates a cursor movement.

      The ::move-cursor signal is a keybinding signal. If the cursor is not visible in textView, this signal causes the viewport to be moved instead.

      Applications should not connect to it, but may emit it with g_signal_emit_by_name() if they need to control the cursor programmatically.

      The default bindings for this signal come in two variants, the variant with the Shift modifier extends the selection, the variant without it does not. There are too many key combinations to list them all here.

      • , , , move by individual characters/lines
      • Ctrl+, etc. move by words/paragraphs
      • Home and End move to the ends of the buffer
      • PgUp and PgDn move vertically by pages
      • Ctrl+PgUp and Ctrl+PgDn move horizontally by pages
    • upcall

      default void upcall(MemorySegment sourceTextView, int step, int count, int extendSelection)
      The upcall method is called from native code. The parameters are marshaled and run(MovementStep, int, boolean) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, int, int, int) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer