]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/gesturedetector.h
Implement tap gestures
[libs/gui.git] / source / input / gesturedetector.h
index b2d0d4fdd36139411c3fb61e8b1062e575ea3ba4..a6186fdef815dce6fa56956bd8261360b1632f3f 100644 (file)
@@ -11,17 +11,18 @@ class Touchscreen;
 enum Gesture
 {
        GESTURE_NONE,
-       GESTURE_SWIPE_DOWN,
-       GESTURE_SWIPE_UP,
-       GESTURE_SWIPE_LEFT,
-       GESTURE_SWIPE_RIGHT,
-       GESTURE_PINCH
+       GESTURE_TAP,
+       GESTURE_TAP_2,
+       GESTURE_DRAG,
+       GESTURE_DRAG_2,
+       GESTURE_PINCH,
+       GESTURE_ROTATE
 };
 
 /**
 Interprets events from a Touchscreen as high-level gestures.  One button is
 provided for each type of gesture.  Axes 0 and 1 indicate the starting position
-of the gesture; axis 2 tracks its progress.  The progress axis may exhibit
+of the gesture; axes 2 and 3 track its progress.  The progress axis may exhibit
 absolute values greater than one.
 */
 class GestureDetector: public Device
@@ -48,6 +49,7 @@ private:
        TouchPoint points[MAX_POINTS];
        Gesture current_gesture;
        unsigned active_points;
+       Gesture pending_tap;
        bool invalid_gesture;
        float threshold_x_sq;
        float threshold_y_sq;
@@ -63,6 +65,7 @@ private:
        void touch_up(unsigned);
        void touch_move(unsigned, float, float);
        void start_gesture();
+       void set_gesture_location(unsigned);
        void update_progress();
        void end_gesture();
        void window_resized(unsigned, unsigned);