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/mtstate.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/mtstate.h')
| -rw-r--r-- | include/mtstate.h | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/include/mtstate.h b/include/mtstate.h index b6b8e8d..a474114 100644 --- a/include/mtstate.h +++ b/include/mtstate.h | |||
| @@ -24,14 +24,10 @@ | |||
| 24 | 24 | ||
| 25 | #include "hwstate.h" | 25 | #include "hwstate.h" |
| 26 | 26 | ||
| 27 | struct MTFinger { | ||
| 28 | struct FingerData hw; | ||
| 29 | int id, thumb; | ||
| 30 | }; | ||
| 31 | |||
| 32 | struct MTState { | 27 | struct MTState { |
| 33 | struct MTFinger finger[DIM_FINGER]; | 28 | struct FingerState finger[DIM_FINGER]; |
| 34 | int nfinger; | 29 | int nfinger; |
| 30 | bitmask_t thumb; | ||
| 35 | bitmask_t button; | 31 | bitmask_t button; |
| 36 | mstime_t evtime; | 32 | mstime_t evtime; |
| 37 | }; | 33 | }; |
| @@ -42,14 +38,14 @@ void extract_mtstate(struct MTState *s, | |||
| 42 | const struct Capabilities *caps); | 38 | const struct Capabilities *caps); |
| 43 | void output_mtstate(const struct MTState *s); | 39 | void output_mtstate(const struct MTState *s); |
| 44 | 40 | ||
| 45 | const struct MTFinger *find_finger(const struct MTState *s, int id); | 41 | const struct FingerState *find_finger(const struct MTState *s, int id); |
| 46 | 42 | ||
| 47 | 43 | ||
| 48 | static inline int center_dist2(const struct MTFinger *a, | 44 | static inline int center_dist2(const struct FingerState *a, |
| 49 | const struct Capabilities *caps) | 45 | const struct Capabilities *caps) |
| 50 | { | 46 | { |
| 51 | return dist2(a->hw.position_x - get_cap_xmid(caps), | 47 | return dist2(a->position_x - get_cap_xmid(caps), |
| 52 | a->hw.position_y - get_cap_ymid(caps)); | 48 | a->position_y - get_cap_ymid(caps)); |
| 53 | } | 49 | } |
| 54 | 50 | ||
| 55 | static inline int center_maxdist2(const struct Capabilities *caps) | 51 | static inline int center_maxdist2(const struct Capabilities *caps) |
