diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:30:41 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-16 02:30:41 +0200 |
| commit | 8dff8642c43a473713d48533974d9c7883bbc5c1 (patch) | |
| tree | ea8513c76d38f2612a1202d30abf0f2e768f204c /include/hwstate.h | |
| parent | 1c73d171b2814bf2809aa48c2d4b683a064a4f7e (diff) | |
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.h | 33 |
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 @@ | |||
| 22 | #ifndef HWSTATE_H | 22 | #ifndef HWSTATE_H |
| 23 | #define HWSTATE_H | 23 | #define HWSTATE_H |
| 24 | 24 | ||
| 25 | #include "mtdev-caps.h" | 25 | #include "mtdev.h" |
| 26 | #include "hwdata.h" | ||
| 27 | 26 | ||
| 28 | /* zero id means not mapped (not touching) */ | ||
| 29 | struct FingerState { | 27 | struct FingerState { |
| 30 | struct FingerData hw; | 28 | int touch_major, touch_minor; |
| 31 | int id; | 29 | int width_major, width_minor; |
| 30 | int orientation, pressure; | ||
| 31 | int position_x, position_y; | ||
| 32 | int tracking_id; | ||
| 32 | }; | 33 | }; |
| 33 | 34 | ||
| 34 | struct HWState { | 35 | struct HWState { |
| 35 | struct FingerState finger[DIM_FINGER]; | 36 | struct FingerState data[DIM_FINGER]; |
| 37 | bitmask_t used; | ||
| 38 | bitmask_t slot; | ||
| 36 | bitmask_t button; | 39 | bitmask_t button; |
| 37 | int nfinger; | ||
| 38 | mstime_t evtime; | 40 | mstime_t evtime; |
| 39 | int lastid; | ||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | void init_hwstate(struct HWState *s); | 43 | void init_hwstate(struct HWState *s, |
| 43 | void modify_hwstate(struct HWState *s, | 44 | const struct Capabilities *caps); |
| 44 | const struct HWData *hw, | 45 | int modify_hwstate(struct HWState *s, struct MTDev *dev, |
| 45 | const struct Capabilities *caps); | 46 | const struct Capabilities *caps); |
| 47 | void output_hwstate(const struct HWState *s); | ||
| 48 | |||
| 49 | static inline int finger_dist2(const struct FingerState *a, | ||
| 50 | const struct FingerState *b) | ||
| 51 | { | ||
| 52 | return dist2(a->position_x - b->position_x, | ||
| 53 | a->position_y - b->position_y); | ||
| 54 | } | ||
| 46 | 55 | ||
| 47 | #endif | 56 | #endif |
