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 | |
| 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>
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | src/mtdev-details.h | 19 | ||||
| -rw-r--r-- | src/touch-dev.c | 49 | ||||
| -rw-r--r-- | test/Makefile.am | 10 | ||||
| -rw-r--r-- | test/grail-gesture.c (renamed from test/grail.c) | 0 | ||||
| -rw-r--r-- | test/grail-touch.c (renamed from test/touch.c) | 0 |
6 files changed, 39 insertions, 45 deletions
| @@ -76,8 +76,6 @@ core | |||
| 76 | # Edit the following section as needed | 76 | # Edit the following section as needed |
| 77 | # For example, !report.pc overrides *.pc. See 'man gitignore' | 77 | # For example, !report.pc overrides *.pc. See 'man gitignore' |
| 78 | # | 78 | # |
| 79 | test/touch | 79 | test/grail-touch |
| 80 | test/grail | 80 | test/grail-gesture |
| 81 | patches | 81 | patches |
| 82 | .bzr | ||
| 83 | .bzrignore | ||
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, |
diff --git a/test/Makefile.am b/test/Makefile.am index e0498ba..4ccbe0a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | noinst_PROGRAMS = touch grail | 1 | bin_PROGRAMS = grail-touch grail-gesture |
| 2 | 2 | ||
| 3 | INCLUDES=-I$(top_srcdir)/include/ | 3 | INCLUDES=-I$(top_srcdir)/include/ |
| 4 | 4 | ||
| 5 | touch_SOURCES = touch.c | 5 | grail_touch_SOURCES = grail-touch.c |
| 6 | touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm | 6 | grail_touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm |
| 7 | 7 | ||
| 8 | grail_SOURCES = grail.c | 8 | grail_gesture_SOURCES = grail-gesture.c |
| 9 | grail_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm | 9 | grail_gesture_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm |
diff --git a/test/grail.c b/test/grail-gesture.c index f34bd6f..f34bd6f 100644 --- a/test/grail.c +++ b/test/grail-gesture.c | |||
diff --git a/test/touch.c b/test/grail-touch.c index 8893c0d..8893c0d 100644 --- a/test/touch.c +++ b/test/grail-touch.c | |||
