]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/gesturedetector.h
Add decorations for things which should be exported from the library
[libs/gui.git] / source / input / gesturedetector.h
index 5f7c4afc4f729ee0322db88c0ff44611e02ee458..8804dd1abc76a073439a1dae8d8fb64bd33cc4ce 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_INPUT_GESTUREDETECTOR_H_
 #define MSP_INPUT_GESTUREDETECTOR_H_
 
+#include <msp/graphics/mspgui_api.h>
 #include "device.h"
 
 namespace Msp {
@@ -27,13 +28,10 @@ provided for each type of gesture.  Axes 0 and 1 indicate the starting position
 of the gesture; axes 2 and 3 track its progress.  The progress axis may exhibit
 absolute values greater than one.
 */
-class GestureDetector: public Device
+class MSPGUI_API GestureDetector: public Device
 {
 private:
-       enum
-       {
-               MAX_POINTS = 3
-       };
+       static constexpr size_t MAX_POINTS = 3;
 
        struct TouchPoint
        {
@@ -49,11 +47,11 @@ private:
 
        Touchscreen &touchscreen;
        TouchPoint points[MAX_POINTS];
-       Gesture current_gesture;
-       Gesture pending_tap;
-       bool invalid_gesture;
-       float threshold_x_sq;
-       float threshold_y_sq;
+       Gesture current_gesture = GESTURE_NONE;
+       Gesture pending_tap = GESTURE_NONE;
+       bool invalid_gesture = false;
+       float threshold_x_sq = 1.0f;
+       float threshold_y_sq = 1.0f;
 
 public:
        GestureDetector(Touchscreen &);
@@ -74,7 +72,7 @@ private:
 };
 
 
-unsigned gesture_points(Gesture);
+MSPGUI_API unsigned gesture_points(Gesture);
 
 } // namespace Input
 } // namespace Msp