From 78085b21f2dc7b1d49a0c54ab56b567fc195d440 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 15 Jun 2010 20:24:14 +0200 Subject: refactor: Simplify capabilities Use the generated abs2mt mapping to simplify the MT device capabilities. Signed-off-by: Henrik Rydberg --- include/mtdev-caps.h | 23 ++++++++--------------- include/mtstate.h | 3 +-- 2 files changed, 9 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/mtdev-caps.h b/include/mtdev-caps.h index 8f88404..4460eca 100644 --- a/include/mtdev-caps.h +++ b/include/mtdev-caps.h @@ -23,25 +23,18 @@ #define MTDEV_CAPS_H #include "common.h" +#include "abs2mt.h" +#include "mtbit.h" struct Capabilities { struct input_id devid; char devname[32]; - int has_left, has_middle; - int has_right, has_mtdata, has_ibt; - int has_touch_major, has_touch_minor; - int has_width_major, has_width_minor; - int has_orientation, has_dummy; - int has_position_x, has_position_y; - struct input_absinfo abs_touch_major; - struct input_absinfo abs_touch_minor; - struct input_absinfo abs_width_major; - struct input_absinfo abs_width_minor; - struct input_absinfo abs_orientation; - struct input_absinfo abs_position_x; - struct input_absinfo abs_position_y; - int xfuzz, yfuzz, wfuzz; - int yclick; + int has_left, has_middle, has_right; + int has_mtdata, has_ibt; + int has_slot, nullid; + int has_abs[MT_ABS_SIZE]; + struct input_absinfo slot; + struct input_absinfo abs[MT_ABS_SIZE]; }; int read_capabilities(struct Capabilities *cap, int fd); diff --git a/include/mtstate.h b/include/mtstate.h index ac0b18d..b5f5dd1 100644 --- a/include/mtstate.h +++ b/include/mtstate.h @@ -54,8 +54,7 @@ static inline int center_dist2(const struct MTFinger *a, static inline int center_maxdist2(const struct Capabilities *caps) { - return dist2(caps->abs_position_x.maximum - get_cap_xmid(caps), - caps->abs_position_y.maximum - get_cap_ymid(caps)); + return dist2(get_cap_xsize(caps) / 2, get_cap_ysize(caps) / 2); } #endif -- cgit v1.2.3