summaryrefslogtreecommitdiff
path: root/include/gestures.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gestures.h')
-rw-r--r--include/gestures.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/include/gestures.h b/include/gestures.h
index 318a22c..3ccaa20 100644
--- a/include/gestures.h
+++ b/include/gestures.h
@@ -48,9 +48,9 @@ stime_t StimeFromTimespec(const struct timespec*);
struct HardwareProperties {
// Touch properties
// The minimum X coordinate that the device can report.
- float left;
+ float left = 0;
// The minimum Y coordinate that the device can report.
- float top;
+ float top = 0;
// The maximum X coordinate that the device can report.
float right;
// The maximum Y coordinate that the device can report.
@@ -165,6 +165,10 @@ struct HardwareProperties {
// Describes a single contact on a touch surface. Generally, the fields have the
// same meaning as the equivalent ABS_MT_... axis in the Linux evdev protocol.
struct FingerState {
+ enum class ToolType {
+ kFinger = 0,
+ kPalm,
+ };
// The large and small radii of the ellipse of the finger touching the pad.
float touch_major, touch_minor;
@@ -188,6 +192,8 @@ struct FingerState {
// A bit field of flags that are used internally by the library. (See the
// GESTURES_FINGER_* constants.) Should be set to 0 on incoming FingerStates.
unsigned flags;
+
+ ToolType tool_type = ToolType::kFinger;
#ifdef __cplusplus
bool NonFlagsEquals(const FingerState& that) const {
return touch_major == that.touch_major &&
@@ -215,6 +221,8 @@ struct FingerState {
#define GESTURES_BUTTON_RIGHT 4
#define GESTURES_BUTTON_BACK 8
#define GESTURES_BUTTON_FORWARD 16
+#define GESTURES_BUTTON_SIDE 32
+#define GESTURES_BUTTON_EXTRA 64
// Describes one frame of data from the input device.
struct HardwareState {
@@ -235,12 +243,14 @@ struct HardwareState {
// The number of fingers touching the pad, which may be more than finger_cnt.
unsigned short touch_cnt;
// A pointer to an array of FingerState structs with finger_cnt entries,
- // representing the contacts currently being tracked. The order in which
- // FingerStates appear need not be stable between HardwareStates — only the
- // tracking ID is used to track individual contacts over time. Accordingly,
- // when a finger is lifted from the pad (and therefore its ABS_MT_TRACKING_ID
- // becomes -1), the client should simply stop including it in this array,
- // rather than including a final FingerState for it.
+ // representing the contacts currently being tracked. If finger_cnt is 0, this
+ // pointer will be null.
+ //
+ // The order in which FingerStates appear need not be stable between
+ // HardwareStates — only the tracking ID is used to track individual contacts
+ // over time. Accordingly, when a finger is lifted from the pad (and therefore
+ // its ABS_MT_TRACKING_ID becomes -1), the client should simply stop including
+ // it in this array, rather than including a final FingerState for it.
struct FingerState* fingers;
// Mouse axes, which have the same meanings as the Linux evdev axes of the
@@ -657,6 +667,7 @@ typedef struct GesturesPropProvider {
namespace gestures {
class Interpreter;
+class IntProperty;
class PropRegistry;
class LoggingFilterInterpreter;
class Tracer;
@@ -702,6 +713,7 @@ struct GestureInterpreter {
std::unique_ptr<Tracer> tracer_;
std::unique_ptr<Interpreter> interpreter_;
std::unique_ptr<MetricsProperties> mprops_;
+ std::unique_ptr<IntProperty> stack_version_;
GesturesTimerProvider* timer_provider_;
void* timer_provider_data_;