GtkGestureStylus — Gesture for stylus input
GtkGesture * | gtk_gesture_stylus_new () |
gboolean | gtk_gesture_stylus_get_axis () |
gboolean | gtk_gesture_stylus_get_axes () |
gboolean | gtk_gesture_stylus_get_backlog () |
GdkDeviceTool * | gtk_gesture_stylus_get_device_tool () |
GObject ╰── GtkEventController ╰── GtkGesture ╰── GtkGestureSingle ╰── GtkGestureStylus
#include <gtk/gtk.h>
GtkGestureStylus is a GtkGesture implementation specific to stylus input. The provided signals just relay the basic information of the stylus events.
GtkGesture *
gtk_gesture_stylus_new (void
);
Creates a new GtkGestureStylus.
a newly created stylus gesture
gboolean gtk_gesture_stylus_get_axis (GtkGestureStylus *gesture
,GdkAxisUse axis
,double *value
);
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.
gesture | ||
axis | requested device axis | |
value | return location for the axis value. | [out] |
TRUE
if there is a current value for the axis
gboolean gtk_gesture_stylus_get_axes (GtkGestureStylus *gesture
,GdkAxisUse axes[]
,double **values
);
Returns the current values for the requested axes
. This function must be called from either the “down”, “motion”, “up” or “proximity” signals.
gesture | a GtkGestureStylus | |
axes | array of requested axes, terminated with GDK_AXIS_IGNORE. | [array] |
values | return location for the axis values. | [out][array] |
TRUE
if there is a current value for the axes
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.
The backlog
is provided in chronological order.
gesture | ||
backlog | coordinates and times for the backlog events. | [out][array length=n_elems] |
n_elems | return location for the number of elements. | [out] |
TRUE
if there is a backlog to unfold in the current state.
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.
gesture |
The current stylus tool.
[nullable][transfer none]
typedef struct _GtkGestureStylus GtkGestureStylus;
“down”
signalvoid user_function (GtkGestureStylus *gesture, double x, double y, gpointer user_data)
A signal emitted when the stylus touches the device.
gesture | the GtkGestureStylus that emitted the signal | |
x | the X coordinate of the stylus event | |
y | the Y coordinate of the stylus event | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“motion”
signalvoid user_function (GtkGestureStylus *gesture, double x, double y, gpointer user_data)
A signal emitted when the stylus moves while touching the device.
gesture | the GtkGestureStylus that emitted the signal | |
x | the X coordinate of the stylus event | |
y | the Y coordinate of the stylus event | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“proximity”
signalvoid user_function (GtkGestureStylus *gesture, double x, double y, gpointer user_data)
A signal emitted when the stylus is in proximity of the device.
gesture | the GtkGestureStylus that emitted the signal | |
x | the X coordinate of the stylus event | |
y | the Y coordinate of the stylus event | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
“up”
signalvoid user_function (GtkGestureStylus *gesture, double x, double y, gpointer user_data)
A signal emitted when the stylus no longer touches the device.
gesture | the GtkGestureStylus that emitted the signal | |
x | the X coordinate of the stylus event | |
y | the Y coordinate of the stylus event | |
user_data | user data set when the signal handler was connected. |
Flags: Run Last
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkGestureStylus.html