diff options
| author | Henrik Rydberg <rydberg@bitmath.org> | 2010-08-05 19:33:58 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-05 22:48:38 +0200 |
| commit | 7559b3d7aa725cd75ee4e6746246205392fe1c0f (patch) | |
| tree | 364e0201c2bb4e853c5aaba0a61e5929fa857de2 /src/touch-dev.c | |
| parent | 8bbf06f8d0056ae30fdfaf260000e763fad2345c (diff) | |
Rename and install test binaries
Install the test programs as grail-touch and grail-gesture.
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Diffstat (limited to 'src/touch-dev.c')
| -rw-r--r-- | src/touch-dev.c | 49 |
1 files changed, 32 insertions, 17 deletions
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, |
