summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/grail-touch.h65
1 files changed, 22 insertions, 43 deletions
diff --git a/include/grail-touch.h b/include/grail-touch.h
index 9d96cc3..acfc779 100644
--- a/include/grail-touch.h
+++ b/include/grail-touch.h
@@ -29,27 +29,20 @@
29#define DIM_TOUCH 32 29#define DIM_TOUCH 32
30#define DIM_TOUCH_BYTES ((DIM_TOUCH + 7) >> 3) 30#define DIM_TOUCH_BYTES ((DIM_TOUCH + 7) >> 3)
31 31
32typedef int touch_prop_t;
33typedef __u64 touch_time_t; 32typedef __u64 touch_time_t;
34 33
35enum touch_prop_list {
36 TP_POS_X,
37 TP_POS_Y,
38 TP_TOUCH_MAJOR,
39 TP_TOUCH_MINOR,
40 TP_WIDTH_MAJOR,
41 TP_WIDTH_MINOR,
42 TP_ORIENTATION,
43 TP_PRESSURE,
44 DIM_TOUCH_PROP
45};
46
47#define DIM_TOUCH_PROP_BYTES ((DIM_TOUCH_PROP + 7) >> 3)
48
49struct touch { 34struct touch {
50 int active; 35 int active;
51 int slot; 36 int slot;
52 touch_prop_t prop[DIM_TOUCH_PROP]; 37 int id;
38 int tool_type;
39 int x, y;
40 int touch_major;
41 int touch_minor;
42 int width_major;
43 int width_minor;
44 int orientation;
45 int pressure;
53}; 46};
54 47
55struct touch_frame { 48struct touch_frame {
@@ -61,45 +54,31 @@ struct touch_frame {
61 struct touch touch[DIM_TOUCH]; 54 struct touch touch[DIM_TOUCH];
62}; 55};
63 56
64struct touch_dev_caps { 57struct touch_caps {
65 grail_mask_t mask[DIM_TOUCH_PROP_BYTES]; 58 float min_x, max_x;
66 struct input_absinfo info[DIM_TOUCH_PROP]; 59 float min_y, max_y;
60 float min_orient, max_orient;
61 float min_press, max_press;
67}; 62};
68 63
69struct touch_dev { 64struct touch_dev {
70 void (*event)(struct touch_dev *dev, const struct input_event *ev); 65 void (*event)(struct touch_dev *dev, const struct input_event *ev);
71 void (*create)(struct touch_dev *dev, int slot,
72 const grail_mask_t *mask, const touch_prop_t *prop);
73 void (*modify)(struct touch_dev *dev, int slot,
74 const grail_mask_t *mask, const touch_prop_t *prop);
75 void (*destroy)(struct touch_dev *dev, int slot);
76 void (*sync)(struct touch_dev *dev, const struct input_event *syn); 66 void (*sync)(struct touch_dev *dev, const struct input_event *syn);
77 struct touch_dev_caps caps;
78 struct touch_dev_impl *impl;
79 void *priv; 67 void *priv;
80}; 68 struct mtdev mtdev;
81
82struct touch_engine {
83 void (*event)(struct touch_engine *engine,
84 const struct input_event *ev);
85 void (*sync)(struct touch_engine *engine,
86 const struct input_event *syn);
87 struct touch_frame frame; 69 struct touch_frame frame;
88 void *priv; 70 struct touch_caps caps;
71 int slot;
72 int state;
89}; 73};
90 74
75void touch_caps_init(struct touch_dev *dev);
76float touch_angle(const struct touch_dev *dev, int orientation);
77float touch_pressure(const struct touch_dev *dev, int pressure);
78
91int touch_dev_open(struct touch_dev *dev, int fd); 79int touch_dev_open(struct touch_dev *dev, int fd);
92int touch_dev_idle(struct touch_dev *dev, int fd, int ms); 80int touch_dev_idle(struct touch_dev *dev, int fd, int ms);
93int touch_dev_pull(struct touch_dev *dev, int fd); 81int touch_dev_pull(struct touch_dev *dev, int fd);
94void touch_dev_close(struct touch_dev *dev, int fd); 82void touch_dev_close(struct touch_dev *dev, int fd);
95 83
96void touch_engine_init(struct touch_engine *engine,
97 void (*event)(struct touch_engine *engine,
98 const struct input_event *ev),
99 void (*sync)(struct touch_engine *engine,
100 const struct input_event *ev),
101 void *priv);
102void touch_engine_attach(struct touch_engine *engine, struct touch_dev *dev);
103void touch_engine_detach(struct touch_engine *engine, struct touch_dev *dev);
104
105#endif 84#endif