About all my projects
Gnome::Gtk4::GestureStylus

Gnome::Gtk4::GestureStylus

Description

Gnome::Gtk4::GestureStylus is a Gnome::Gtk4::Gesture specific to stylus input.

The provided signals just relay the basic information of the stylus events.

Uml Diagram

No caption

Class initialization

new

:native-object

Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object() :$native-object! )

new-gesturestylus

Creates a new Gnome::Gtk4::GestureStylus.

method new-gesturestylus ( --> Gnome::Gtk4::GestureStylus )

Methods

get-axes

Returns the current values for the requested $axes.

This function must be called from the handler of one of the down, motion, up or proximity signals.

method get-axes ( GdkAxisUse $axes, Num() $values --> Bool )
  • $axes; array of requested axes, terminated with GDK_AXIS_IGNORE.

  • $values; (transfer ownership: full) return location for the axis values.

Return value; True if there is a current value for the axes.

get-axis

Returns the current value for the requested $axis.

This function must be called from the handler of one of the down, motion, up or proximity signals.

method get-axis ( GdkAxisUse $axis, Num() $value --> Bool )
  • $axis; requested device axis.

  • $value; (transfer ownership: full) return location for the axis value.

Return value; True if there is a current value for the axis.

get-backlog

Returns the accumulated backlog of tracking information.

By default, GTK will limit rate of input events. On stylus input where accuracy of strokes is paramount, this function returns the accumulated coordinate/timing state before the emission of the current [Gtk.GestureStylus::motion] signal.

This function may only be called within a motion signal handler, the state given in this signal and obtainable through .get-axis() express the latest (most up-to-date) state in motion history.

The $backlog is provided in chronological order.

method get-backlog ( N-Object $backlog, Array[Int] $n-elems --> Bool )
  • $backlog; (transfer ownership: full) coordinates and times for the backlog events

  • $n-elems; (transfer ownership: full) return location for the number of elements.

Return value; True if there is a backlog to unfold in the current state..

get-device-tool

Returns the Gnome::Gdk4::DeviceTool currently driving input through this gesture.

This function must be called from the handler of one of the down, motion, up or proximity signals.

method get-device-tool (--> N-Object )

Return value; The current stylus tool.

get-stylus-only

Checks whether the gesture is for styluses only.

Stylus-only gestures will signal events exclusively from stylus input devices.

method get-stylus-only (--> Bool )

Return value; True if the gesture is only for stylus events.

set-stylus-only

Sets the state of stylus-only

If true, the gesture will exclusively handle events from stylus input devices, otherwise it'll handle events from any pointing device.

method set-stylus-only ( Bool() $stylus-only )
  • $stylus-only; whether the gesture is used exclusively for stylus events.

Signals

down

Emitted when the stylus touches the device.

method handler (
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureStylus :$_widget,
  *%user-options
)
  • $x; the X coordinate of the stylus event.

  • $y; the Y coordinate of the stylus event.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::GestureStylus object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.

motion

Emitted when the stylus moves while touching the device.

method handler (
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureStylus :$_widget,
  *%user-options
)
  • $x; the X coordinate of the stylus event.

  • $y; the Y coordinate of the stylus event.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::GestureStylus object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.

proximity

Emitted when the stylus is in proximity of the device.

method handler (
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureStylus :$_widget,
  *%user-options
)
  • $x; the X coordinate of the stylus event.

  • $y; the Y coordinate of the stylus event.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::GestureStylus object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.

up

Emitted when the stylus no longer touches the device.

method handler (
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureStylus :$_widget,
  *%user-options
)
  • $x; the X coordinate of the stylus event.

  • $y; the Y coordinate of the stylus event.

  • $_handle_id; The registered event handler id.

  • $_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::GestureStylus object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.