diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mtdev-details.h | 19 | ||||
| -rw-r--r-- | src/touch-dev.c | 49 |
2 files changed, 32 insertions, 36 deletions
diff --git a/src/mtdev-details.h b/src/mtdev-details.h deleted file mode 100644 index 873528d..0000000 --- a/src/mtdev-details.h +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | #ifndef _MTDEV_DETAILS_H | ||
| 2 | #define _MTDEV_DETAILS_H | ||
| 3 | |||
| 4 | #define MTDEV_TRACKING_ID 9 | ||
| 5 | #define MTDEV_POSITION_X 5 | ||
| 6 | #define MTDEV_POSITION_Y 6 | ||
| 7 | #define MTDEV_TOUCH_MAJOR 0 | ||
| 8 | #define MTDEV_TOUCH_MINOR 1 | ||
| 9 | #define MTDEV_WIDTH_MAJOR 2 | ||
| 10 | #define MTDEV_WIDTH_MINOR 3 | ||
| 11 | #define MTDEV_ORIENTATION 4 | ||
| 12 | #define MTDEV_PRESSURE 10 | ||
| 13 | |||
| 14 | int mtdev_fetch_event(struct mtdev *dev, int fd, struct input_event *ev); | ||
| 15 | void mtdev_put_event(struct mtdev *dev, const struct input_event *ev); | ||
| 16 | int mtdev_empty(struct mtdev *dev); | ||
| 17 | void mtdev_get_event(struct mtdev *dev, struct input_event* ev); | ||
| 18 | |||
| 19 | #endif | ||
diff --git a/src/touch-dev.c b/src/touch-dev.c index 3c3036c..b327266 100644 --- a/src/touch-dev.c +++ b/src/touch-dev.c | |||
| @@ -27,7 +27,22 @@ | |||
| 27 | #include <string.h> | 27 | #include <string.h> |
| 28 | #include <errno.h> | 28 | #include <errno.h> |
| 29 | #include "evbuf.h" | 29 | #include "evbuf.h" |
| 30 | #include "mtdev-details.h" | 30 | |
| 31 | /* from mtdev-mapping.h */ | ||
| 32 | #define MT_TOUCH_MAJOR 0 | ||
| 33 | #define MT_TOUCH_MINOR 1 | ||
| 34 | #define MT_WIDTH_MAJOR 2 | ||
| 35 | #define MT_WIDTH_MINOR 3 | ||
| 36 | #define MT_ORIENTATION 4 | ||
| 37 | #define MT_POSITION_X 5 | ||
| 38 | #define MT_POSITION_Y 6 | ||
| 39 | #define MT_TRACKING_ID 9 | ||
| 40 | #define MT_PRESSURE 10 | ||
| 41 | |||
| 42 | int mtdev_fetch_event(struct mtdev *dev, int fd, struct input_event *ev); | ||
| 43 | void mtdev_put_event(struct mtdev *dev, const struct input_event *ev); | ||
| 44 | int mtdev_empty(struct mtdev *dev); | ||
| 45 | void mtdev_get_event(struct mtdev *dev, struct input_event* ev); | ||
| 31 | 46 | ||
| 32 | struct touch_dev_impl { | 47 | struct touch_dev_impl { |
| 33 | int id[DIM_TOUCH]; | 48 | int id[DIM_TOUCH]; |
| @@ -49,22 +64,22 @@ static inline void set_info(struct touch_dev_caps *caps, int code, | |||
| 49 | static void set_caps(struct touch_dev_caps *caps, | 64 | static void set_caps(struct touch_dev_caps *caps, |
| 50 | const struct mtdev_caps *mtcaps) | 65 | const struct mtdev_caps *mtcaps) |
| 51 | { | 66 | { |
| 52 | if (mtcaps->has_abs[MTDEV_POSITION_X]) | 67 | if (mtcaps->has_abs[MT_POSITION_X]) |
| 53 | set_info(caps, TP_POS_X, &mtcaps->abs[MTDEV_POSITION_X]); | 68 | set_info(caps, TP_POS_X, &mtcaps->abs[MT_POSITION_X]); |
| 54 | if (mtcaps->has_abs[MTDEV_POSITION_Y]) | 69 | if (mtcaps->has_abs[MT_POSITION_Y]) |
| 55 | set_info(caps, TP_POS_Y, &mtcaps->abs[MTDEV_POSITION_Y]); | 70 | set_info(caps, TP_POS_Y, &mtcaps->abs[MT_POSITION_Y]); |
| 56 | if (mtcaps->has_abs[MTDEV_TOUCH_MAJOR]) | 71 | if (mtcaps->has_abs[MT_TOUCH_MAJOR]) |
| 57 | set_info(caps, TP_TOUCH_MAJOR, &mtcaps->abs[MTDEV_TOUCH_MAJOR]); | 72 | set_info(caps, TP_TOUCH_MAJOR, &mtcaps->abs[MT_TOUCH_MAJOR]); |
| 58 | if (mtcaps->has_abs[MTDEV_TOUCH_MINOR]) | 73 | if (mtcaps->has_abs[MT_TOUCH_MINOR]) |
| 59 | set_info(caps, TP_TOUCH_MINOR, &mtcaps->abs[MTDEV_TOUCH_MINOR]); | 74 | set_info(caps, TP_TOUCH_MINOR, &mtcaps->abs[MT_TOUCH_MINOR]); |
| 60 | if (mtcaps->has_abs[MTDEV_WIDTH_MAJOR]) | 75 | if (mtcaps->has_abs[MT_WIDTH_MAJOR]) |
| 61 | set_info(caps, TP_WIDTH_MAJOR, &mtcaps->abs[MTDEV_WIDTH_MAJOR]); | 76 | set_info(caps, TP_WIDTH_MAJOR, &mtcaps->abs[MT_WIDTH_MAJOR]); |
| 62 | if (mtcaps->has_abs[MTDEV_WIDTH_MINOR]) | 77 | if (mtcaps->has_abs[MT_WIDTH_MINOR]) |
| 63 | set_info(caps, TP_WIDTH_MINOR, &mtcaps->abs[MTDEV_WIDTH_MINOR]); | 78 | set_info(caps, TP_WIDTH_MINOR, &mtcaps->abs[MT_WIDTH_MINOR]); |
| 64 | if (mtcaps->has_abs[MTDEV_ORIENTATION]) | 79 | if (mtcaps->has_abs[MT_ORIENTATION]) |
| 65 | set_info(caps, TP_ORIENTATION, &mtcaps->abs[MTDEV_ORIENTATION]); | 80 | set_info(caps, TP_ORIENTATION, &mtcaps->abs[MT_ORIENTATION]); |
| 66 | if (mtcaps->has_abs[MTDEV_PRESSURE]) | 81 | if (mtcaps->has_abs[MT_PRESSURE]) |
| 67 | set_info(caps, TP_PRESSURE, &mtcaps->abs[MTDEV_PRESSURE]); | 82 | set_info(caps, TP_PRESSURE, &mtcaps->abs[MT_PRESSURE]); |
| 68 | } | 83 | } |
| 69 | 84 | ||
| 70 | static int touch_get_fetched(struct touch_dev_impl *x, | 85 | static int touch_get_fetched(struct touch_dev_impl *x, |
