summaryrefslogtreecommitdiff
path: root/gtk/gtkgestureswipe.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-04-09 18:28:27 +0200
committerCarlos Garnacho <carlosg@gnome.org>2014-05-23 19:54:27 +0200
commit2df48ba8863adb118528da15db5dcdc5cff5d7d0 (patch)
treef277fcda7886b3808ac7ee18b5de22f67d06ac54 /gtk/gtkgestureswipe.c
parent28237f80f59666a5049d505cf0b6b89c90584b77 (diff)
downloadgtk+-2df48ba8863adb118528da15db5dcdc5cff5d7d0.tar.gz
swipe: Add missing documentation
Diffstat (limited to 'gtk/gtkgestureswipe.c')
-rw-r--r--gtk/gtkgestureswipe.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/gtk/gtkgestureswipe.c b/gtk/gtkgestureswipe.c
index e4f6e29dfa..bca8d621e8 100644
--- a/gtk/gtkgestureswipe.c
+++ b/gtk/gtkgestureswipe.c
@@ -17,6 +17,24 @@
*
* Author(s): Carlos Garnacho <carlosg@gnome.org>
*/
+
+/**
+ * SECTION:gtkgestureswipe
+ * @Short_description: Swipe gesture
+ * @Title: GtkGestureSwipe
+ *
+ * #GtkGestureSwipe is a #GtkGesture implementation able to recognize
+ * swipes, after a press/move/.../move/release sequence happens, the
+ * GtkGestureSwipe:swipe signal will be emitted, providing the velocity
+ * and directionality of the sequence at the time it was lifted.
+ *
+ * If the velocity is desired in intermediate points,
+ * gtk_gesture_swipe_get_velocity() can be called on eg. a
+ * #GtkGesture:update handler.
+ *
+ * All velocities are reported in pixels/sec values.
+ */
+
#include "config.h"
#include <gtk/gtkgestureswipe.h>
#include "gtkmarshalers.h"
@@ -172,6 +190,17 @@ gtk_gesture_swipe_class_init (GtkGestureSwipeClass *klass)
gesture_class->update = gtk_gesture_swipe_update;
gesture_class->end = gtk_gesture_swipe_end;
+ /**
+ * GtkGestureSwipe:swipe:
+ * @gesture: object which received the signal
+ * @velocity_x: velocity in the X axis, in pixels/sec
+ * @velocity_y: velocity in the Y axis, in pixels/sec
+ *
+ * This signal is emitted when the recognized gesture is finished, velocity
+ * and direction are a product of previously recorded events.
+ *
+ * Since: 3.14
+ */
signals[SWIPE] =
g_signal_new ("swipe",
G_TYPE_FROM_CLASS (klass),
@@ -208,6 +237,20 @@ gtk_gesture_swipe_new (GtkWidget *widget)
NULL);
}
+/**
+ * gtk_gesture_swipe_get_velocity:
+ * @gesture: a #GtkGestureSwipe
+ * @velocity_x: (out): return value for the velocity in the X axis, in pixels/sec
+ * @velocity_y: (out): return value for the velocity in the Y axis, in pixels/sec
+ *
+ * If the gesture is recognized, this function returns %TRUE and fill in
+ * @velocity_x and @velocity_y with the recorded velocity, as per the
+ * last event(s) processed.
+ *
+ * Returns: whether velocity could be calculated
+ *
+ * Since: 3.14
+ **/
gboolean
gtk_gesture_swipe_get_velocity (GtkGestureSwipe *gesture,
gdouble *velocity_x,