summaryrefslogtreecommitdiff
path: root/src/state.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-12-22 18:29:00 +0100
committerHenrik Rydberg <rydberg@euromail.se>2010-12-22 18:29:00 +0100
commit56a77e68fb91eef928d8a95c50ae14508e37ae0f (patch)
tree51af9bb9dd508bca58e8b9416479e79f8bb7ee10 /src/state.h
parent0e2ab3b5940e70493aaabdfe5e8da1c75db4db72 (diff)
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 <rydberg@euromail.se>
Diffstat (limited to 'src/state.h')
-rw-r--r--src/state.h27
1 files changed, 26 insertions, 1 deletions
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 @@
37 * @abs: current values of ABS_MT axes for this slot 37 * @abs: current values of ABS_MT axes for this slot
38 */ 38 */
39struct mtdev_slot { 39struct mtdev_slot {
40 int abs[MT_ABS_SIZE]; 40 int touch_major;
41 int touch_minor;
42 int width_major;
43 int width_minor;
44 int orientation;
45 int position_x;
46 int position_y;
47 int tool_type;
48 int blob_id;
49 int tracking_id;
50 int pressure;
41}; 51};
42 52
53static inline int get_sval(const struct mtdev_slot *slot, int ix)
54{
55 return (&slot->touch_major)[ix];
56}
57
58static inline void set_sval(struct mtdev_slot *slot, int ix, int value)
59{
60 (&slot->touch_major)[ix] = value;
61}
62
43/* 63/*
44 * struct mtdev_state - MT slot parsing 64 * struct mtdev_state - MT slot parsing
45 * @inbuf: input event buffer 65 * @inbuf: input event buffer
@@ -50,10 +70,15 @@ struct mtdev_slot {
50 * @lastid: last used tracking id 70 * @lastid: last used tracking id
51 */ 71 */
52struct mtdev_state { 72struct mtdev_state {
73
74 int has_ext_abs[MT_ABS_SIZE - 11];
75 struct input_absinfo ext_abs[MT_ABS_SIZE - 11];
76
53 struct mtdev_iobuf iobuf; 77 struct mtdev_iobuf iobuf;
54 struct mtdev_evbuf inbuf; 78 struct mtdev_evbuf inbuf;
55 struct mtdev_evbuf outbuf; 79 struct mtdev_evbuf outbuf;
56 struct mtdev_slot data[DIM_FINGER]; 80 struct mtdev_slot data[DIM_FINGER];
81
57 bitmask_t used; 82 bitmask_t used;
58 bitmask_t slot; 83 bitmask_t slot;
59 bitmask_t lastid; 84 bitmask_t lastid;