GtkGestureStylus

GtkGestureStylus — Gesture for stylus input

Signals

void down Run Last
void motion Run Last
void proximity Run Last
void up Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GtkEventController
        ╰── GtkGesture
            ╰── GtkGestureSingle
                ╰── GtkGestureStylus

Includes

#include <gtk/gtk.h>

Description

GtkGestureStylus is a GtkGesture implementation specific to stylus input. The provided signals just provide the basic information

Functions

gtk_gesture_stylus_new ()

GtkGesture *
gtk_gesture_stylus_new (void);

Creates a new GtkGestureStylus.

Returns

a newly created stylus gesture


gtk_gesture_stylus_get_axis ()

gboolean
gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture,
                             GdkAxisUse axis,
                             gdouble *value);

Returns the current value for the requested axis . This function must be called from either the “down”, “motion”, “up” or “proximity” signals.

Parameters

gesture

a GtkGestureStylus

 

axis

requested device axis

 

value

return location for the axis value.

[out]

Returns

TRUE if there is a current value for the axis


gtk_gesture_stylus_get_axes ()

gboolean
gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture,
                             GdkAxisUse axes[],
                             gdouble **values);

Returns the current values for the requested axes . This function must be called from either the “down”, “motion”, “up” or “proximity” signals.

Parameters

gesture

a GtkGestureStylus

 

axes

array of requested axes, terminated with GDK_AXIS_IGNORE.

[array]

values

return location for the axis values.

[out][array]

Returns

TRUE if there is a current value for the axes


gtk_gesture_stylus_get_backlog ()

gboolean
gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
                                GdkTimeCoord **backlog,
                                guint *n_elems);

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 “motion” signal.

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

backlog is provided in chronological order.

Parameters

gesture

a GtkGestureStylus

 

backlog

coordinates and times for the backlog events.

[out][array length=n_elems]

n_elems

return location for the number of elements.

[out]

Returns

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


gtk_gesture_stylus_get_device_tool ()

GdkDeviceTool *
gtk_gesture_stylus_get_device_tool (GtkGestureStylus *gesture);

Returns the GdkDeviceTool currently driving input through this gesture. This function must be called from either the “down”, “motion”, “up” or “proximity” signal handlers.

Parameters

gesture

a GtkGestureStylus

 

Returns

The current stylus tool.

[nullable][transfer none]

Types and Values

GtkGestureStylus

typedef struct _GtkGestureStylus GtkGestureStylus;

Signal Details

The “down” signal

void
user_function (GtkGestureStylus *gesturestylus,
               gdouble           arg1,
               gdouble           arg2,
               gpointer          user_data)

Flags: Run Last


The “motion” signal

void
user_function (GtkGestureStylus *gesturestylus,
               gdouble           arg1,
               gdouble           arg2,
               gpointer          user_data)

Flags: Run Last


The “proximity” signal

void
user_function (GtkGestureStylus *gesturestylus,
               gdouble           arg1,
               gdouble           arg2,
               gpointer          user_data)

Flags: Run Last


The “up” signal

void
user_function (GtkGestureStylus *gesturestylus,
               gdouble           arg1,
               gdouble           arg2,
               gpointer          user_data)

Flags: Run Last