#ifndef MSP_INPUT_GESTUREDETECTOR_H_
#define MSP_INPUT_GESTUREDETECTOR_H_
+#include <msp/graphics/mspgui_api.h>
#include "device.h"
namespace Msp {
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
{
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 &);
};
-unsigned gesture_points(Gesture);
+MSPGUI_API unsigned gesture_points(Gesture);
} // namespace Input
} // namespace Msp