aboutsummaryrefslogtreecommitdiffstats
path: root/include/hwstate.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-06-16 02:30:41 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-06-16 02:30:41 +0200
commit8dff8642c43a473713d48533974d9c7883bbc5c1 (patch)
treeea8513c76d38f2612a1202d30abf0f2e768f204c /include/hwstate.h
parent1c73d171b2814bf2809aa48c2d4b683a064a4f7e (diff)
downloadxorg-input-kobomultitouch-8dff8642c43a473713d48533974d9c7883bbc5c1.tar.gz
xorg-input-kobomultitouch-8dff8642c43a473713d48533974d9c7883bbc5c1.tar.bz2
xorg-input-kobomultitouch-8dff8642c43a473713d48533974d9c7883bbc5c1.zip
refactor: Replace hwdata by mtdev
This patch makes the switch, from using hwdata and the associated type A parser, to using mtdev and the associated type B parser. A command-line gesture test program is included. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'include/hwstate.h')
-rw-r--r--include/hwstate.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/include/hwstate.h b/include/hwstate.h
index 07d4ed6..4243292 100644
--- a/include/hwstate.h
+++ b/include/hwstate.h
@@ -22,26 +22,35 @@
#ifndef HWSTATE_H
#define HWSTATE_H
-#include "mtdev-caps.h"
-#include "hwdata.h"
+#include "mtdev.h"
-/* zero id means not mapped (not touching) */
struct FingerState {
- struct FingerData hw;
- int id;
+ int touch_major, touch_minor;
+ int width_major, width_minor;
+ int orientation, pressure;
+ int position_x, position_y;
+ int tracking_id;
};
struct HWState {
- struct FingerState finger[DIM_FINGER];
+ struct FingerState data[DIM_FINGER];
+ bitmask_t used;
+ bitmask_t slot;
bitmask_t button;
- int nfinger;
mstime_t evtime;
- int lastid;
};
-void init_hwstate(struct HWState *s);
-void modify_hwstate(struct HWState *s,
- const struct HWData *hw,
- const struct Capabilities *caps);
+void init_hwstate(struct HWState *s,
+ const struct Capabilities *caps);
+int modify_hwstate(struct HWState *s, struct MTDev *dev,
+ const struct Capabilities *caps);
+void output_hwstate(const struct HWState *s);
+
+static inline int finger_dist2(const struct FingerState *a,
+ const struct FingerState *b)
+{
+ return dist2(a->position_x - b->position_x,
+ a->position_y - b->position_y);
+}
#endif