From 8dff8642c43a473713d48533974d9c7883bbc5c1 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 16 Jun 2010 02:30:41 +0200 Subject: 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 --- include/mtstate.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'include/mtstate.h') 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 @@ #include "hwstate.h" -struct MTFinger { - struct FingerData hw; - int id, thumb; -}; - struct MTState { - struct MTFinger finger[DIM_FINGER]; + struct FingerState finger[DIM_FINGER]; int nfinger; + bitmask_t thumb; bitmask_t button; mstime_t evtime; }; @@ -42,14 +38,14 @@ void extract_mtstate(struct MTState *s, const struct Capabilities *caps); void output_mtstate(const struct MTState *s); -const struct MTFinger *find_finger(const struct MTState *s, int id); +const struct FingerState *find_finger(const struct MTState *s, int id); -static inline int center_dist2(const struct MTFinger *a, +static inline int center_dist2(const struct FingerState *a, const struct Capabilities *caps) { - return dist2(a->hw.position_x - get_cap_xmid(caps), - a->hw.position_y - get_cap_ymid(caps)); + return dist2(a->position_x - get_cap_xmid(caps), + a->position_y - get_cap_ymid(caps)); } static inline int center_maxdist2(const struct Capabilities *caps) -- cgit v1.2.3