Class: Gtk::GestureStylus

Inherits:
GestureSingle show all
Defined in:
lib/gtk4/gesture-stylus.rb

Instance Method Summary collapse

Methods inherited from GestureSingle

#button, #button=, #current_button, #current_sequence, #exclusive, #exclusive=, #exclusive?, #touch_only, #touch_only=, #touch_only?

Methods inherited from Gesture

#device, #get_bounding_box, #get_bounding_box_center, #get_last_event, #get_point, #get_sequence_state, #group, #handles_sequence, #is_active, #is_grouped_with, #is_recognized, #last_updated_sequence, #n_points, #n_points=, #sequences, #set_sequence_state, #state=, #ungroup

Methods inherited from EventController

#current_event, #current_event_device, #current_event_state, #current_event_time, #name, #name=, #propagation_limit, #propagation_limit=, #propagation_phase, #propagation_phase=, #reset, #static_name=, #widget, #widget=

Constructor Details

#initializeGtk::Gesture

Creates a new GtkGestureStylus.

Instance Method Details

#backlogObject



20
21
22
23
24
25
26
27
# File 'lib/gtk4/gesture-stylus.rb', line 20

def backlog
  have_backlog, backlog = backlog_raw
  if have_backlog
    backlog
  else
    nil
  end
end

#backlog_rawObject



19
# File 'lib/gtk4/gesture-stylus.rb', line 19

alias_method :backlog_raw, :backlog

#device_toolGdk::DeviceTool

Returns the GdkDeviceTool currently driving input through this gesture.

This function must be called from the handler of one of the [signalGtk.GestureStylus::down], [signalGtk.GestureStylus::motion], [signalGtk.GestureStylus::up] or [signalGtk.GestureStylus::proximity] signals.

Returns:

#get_axes(axes, values) ⇒ Boolean

Returns the current values for the requested axes.

This function must be called from the handler of one of the [signalGtk.GestureStylus::down], [signalGtk.GestureStylus::motion], [signalGtk.GestureStylus::up] or [signalGtk.GestureStylus::proximity] signals.

Parameters:

  • axes (Array<Gdk::AxisUse>)

    array of requested axes, terminated with %GDK_AXIS_IGNORE

  • values (Array<Float>)

    return location for the axis values

Returns:

  • (Boolean)

    true if there is a current value for the axes

#get_axis(axis, value) ⇒ Boolean

Returns the current value for the requested axis.

This function must be called from the handler of one of the [signalGtk.GestureStylus::down], [signalGtk.GestureStylus::motion], [signalGtk.GestureStylus::up] or [signalGtk.GestureStylus::proximity] signals.

Parameters:

  • axis (Gdk::AxisUse)

    requested device axis

  • value (Float)

    return location for the axis value

Returns:

  • (Boolean)

    true if there is a current value for the axis

#get_backlog(backlog, n_elems) ⇒ Boolean

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 [signalGtk.GestureStylus::motion] signal handler, the state given in this signal and obtainable through [methodGtk.GestureStylus.get_axis] express the latest (most up-to-date) state in motion history.

The backlog is provided in chronological order.

Parameters:

  • backlog (Array<Gdk::TimeCoord>)

    coordinates and times for the backlog events

  • n_elems (Integer)

    return location for the number of elements

Returns:

  • (Boolean)

    true if there is a backlog to unfold in the current state.

#stylus_onlyBoolean

Checks whether the gesture is for styluses only.

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

Returns:

  • (Boolean)

    true if the gesture is only for stylus events

#stylus_only=(stylus_only) ⇒ Boolean

If this gesture should exclusively react to stylus input devices.

Parameters:

  • stylus_only (Boolean)

Returns:

  • (Boolean)

    stylus-only

  • (Boolean)

    stylus-only

#stylus_only?Boolean

If this gesture should exclusively react to stylus input devices.

Returns:

  • (Boolean)

    stylus-only