summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@bitmath.org>2010-08-05 19:33:58 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-08-05 22:48:38 +0200
commit7559b3d7aa725cd75ee4e6746246205392fe1c0f (patch)
tree364e0201c2bb4e853c5aaba0a61e5929fa857de2
parent8bbf06f8d0056ae30fdfaf260000e763fad2345c (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--.gitignore6
-rw-r--r--src/mtdev-details.h19
-rw-r--r--src/touch-dev.c49
-rw-r--r--test/Makefile.am10
-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
diff --git a/.gitignore b/.gitignore
index 904dc45..87fa680 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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#
79test/touch 79test/grail-touch
80test/grail 80test/grail-gesture
81patches 81patches
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
14int mtdev_fetch_event(struct mtdev *dev, int fd, struct input_event *ev);
15void mtdev_put_event(struct mtdev *dev, const struct input_event *ev);
16int mtdev_empty(struct mtdev *dev);
17void 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
42int mtdev_fetch_event(struct mtdev *dev, int fd, struct input_event *ev);
43void mtdev_put_event(struct mtdev *dev, const struct input_event *ev);
44int mtdev_empty(struct mtdev *dev);
45void mtdev_get_event(struct mtdev *dev, struct input_event* ev);
31 46
32struct touch_dev_impl { 47struct 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,
49static void set_caps(struct touch_dev_caps *caps, 64static 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
70static int touch_get_fetched(struct touch_dev_impl *x, 85static 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 @@
1noinst_PROGRAMS = touch grail 1bin_PROGRAMS = grail-touch grail-gesture
2 2
3INCLUDES=-I$(top_srcdir)/include/ 3INCLUDES=-I$(top_srcdir)/include/
4 4
5touch_SOURCES = touch.c 5grail_touch_SOURCES = grail-touch.c
6touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm 6grail_touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm
7 7
8grail_SOURCES = grail.c 8grail_gesture_SOURCES = grail-gesture.c
9grail_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm 9grail_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