X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fgesturedetector.h;h=5f7c4afc4f729ee0322db88c0ff44611e02ee458;hb=2ed9d7a0a96638bdf0614c1cf858719e7ced40d3;hp=fdd083de0372feb7cb4cde113881f6175d1e27cb;hpb=a5be5c703808817dda8feafb03b0aec04b20afbb;p=libs%2Fgui.git diff --git a/source/input/gesturedetector.h b/source/input/gesturedetector.h index fdd083d..5f7c4af 100644 --- a/source/input/gesturedetector.h +++ b/source/input/gesturedetector.h @@ -11,8 +11,14 @@ class Touchscreen; enum Gesture { GESTURE_NONE, + GESTURE_TAP, + GESTURE_TAP_2, + GESTURE_TAP_3, GESTURE_DRAG, - GESTURE_PINCH + GESTURE_DRAG_2, + GESTURE_DRAG_3, + GESTURE_PINCH, + GESTURE_ROTATE }; /** @@ -44,7 +50,7 @@ private: Touchscreen &touchscreen; TouchPoint points[MAX_POINTS]; Gesture current_gesture; - unsigned active_points; + Gesture pending_tap; bool invalid_gesture; float threshold_x_sq; float threshold_y_sq; @@ -52,19 +58,24 @@ private: public: GestureDetector(Touchscreen &); - virtual std::string get_button_name(unsigned) const; - virtual std::string get_axis_name(unsigned) const; + std::string get_button_name(unsigned) const override; + std::string get_axis_name(unsigned) const override; private: void touch_down(unsigned); void touch_up(unsigned); void touch_move(unsigned, float, float); void start_gesture(); + void set_gesture_location(unsigned); + void set_gesture_delta(unsigned); void update_progress(); void end_gesture(); void window_resized(unsigned, unsigned); }; + +unsigned gesture_points(Gesture); + } // namespace Input } // namespace Msp