From 56a77e68fb91eef928d8a95c50ae14508e37ae0f Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 22 Dec 2010 18:29:00 +0100 Subject: Introduce a stable ABI The current mtdev is not ABI stable, and the upcoming additions to the kernel api will break ABI. This patch starts the process of keeping binary compatibility with old programs, by moving the abi-specific parts under a special flag, MTDEV_NO_LEGACY_API, and makes sure the internal parts compiles with MTDEV_NO_LEGACY_API set. This way, older programs will still work, old programs will still compile, and new programs will be able to use the additions. Signed-off-by: Henrik Rydberg --- src/state.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/state.h') diff --git a/src/state.h b/src/state.h index df12139..4e98a08 100644 --- a/src/state.h +++ b/src/state.h @@ -37,9 +37,29 @@ * @abs: current values of ABS_MT axes for this slot */ struct mtdev_slot { - int abs[MT_ABS_SIZE]; + int touch_major; + int touch_minor; + int width_major; + int width_minor; + int orientation; + int position_x; + int position_y; + int tool_type; + int blob_id; + int tracking_id; + int pressure; }; +static inline int get_sval(const struct mtdev_slot *slot, int ix) +{ + return (&slot->touch_major)[ix]; +} + +static inline void set_sval(struct mtdev_slot *slot, int ix, int value) +{ + (&slot->touch_major)[ix] = value; +} + /* * struct mtdev_state - MT slot parsing * @inbuf: input event buffer @@ -50,10 +70,15 @@ struct mtdev_slot { * @lastid: last used tracking id */ struct mtdev_state { + + int has_ext_abs[MT_ABS_SIZE - 11]; + struct input_absinfo ext_abs[MT_ABS_SIZE - 11]; + struct mtdev_iobuf iobuf; struct mtdev_evbuf inbuf; struct mtdev_evbuf outbuf; struct mtdev_slot data[DIM_FINGER]; + bitmask_t used; bitmask_t slot; bitmask_t lastid; -- cgit v1.2.3