]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/gesturedetector.h
Refactor GestureDetector and add some comments to it
[libs/gui.git] / source / input / gesturedetector.h
index 2b5ea3c3203219d2153b78cd22e19c65aed3d291..b2d0d4fdd36139411c3fb61e8b1062e575ea3ba4 100644 (file)
@@ -27,6 +27,11 @@ absolute values greater than one.
 class GestureDetector: public Device
 {
 private:
+       enum
+       {
+               MAX_POINTS = 3
+       };
+
        struct TouchPoint
        {
                bool down;
@@ -34,12 +39,13 @@ private:
                float down_y;
                float x;
                float y;
+               bool threshold_exceeded;
 
                TouchPoint();
        };
 
        Touchscreen &touchscreen;
-       TouchPoint points[3];
+       TouchPoint points[MAX_POINTS];
        Gesture current_gesture;
        unsigned active_points;
        bool invalid_gesture;
@@ -58,6 +64,7 @@ private:
        void touch_move(unsigned, float, float);
        void start_gesture();
        void update_progress();
+       void end_gesture();
        void window_resized(unsigned, unsigned);
 };