GtkGestureSwipe — Swipe gesture
GObject ╰── GtkEventController ╰── GtkGesture ╰── GtkGestureSingle ╰── GtkGestureSwipe
GtkGestureSwipe is a GtkGesture implementation able to recognize swipes, after a press/move/.../move/release sequence happens, the “swipe” signal will be emitted, providing the velocity and directionality of the sequence at the time it was lifted.
All velocities are reported in pixels/sec units.
GtkGesture * gtk_gesture_swipe_new (
Returns a newly created GtkGesture that recognizes swipes.
a newly created GtkGestureSwipe
gboolean gtk_gesture_swipe_get_velocity (
If the gesture is recognized, this function returns
TRUE and fill in
velocity_y with the recorded velocity, as per the last event(s) processed.
return value for the velocity in the X axis, in pixels/sec.
return value for the velocity in the Y axis, in pixels/sec.
whether velocity could be calculated
typedef struct _GtkGestureSwipe GtkGestureSwipe;
void user_function (GtkGestureSwipe *gesture, double velocity_x, double velocity_y, gpointer user_data)
This signal is emitted when the recognized gesture is finished, velocity and direction are a product of previously recorded events.
object which received the signal
velocity in the X axis, in pixels/sec
velocity in the Y axis, in pixels/sec
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.