diff options
| author | Henrik Rydberg <rydberg@bitmath.org> | 2010-07-20 12:01:32 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-05 22:48:37 +0200 |
| commit | 3b9c20f869a2f55bd9953665c9e7fd713db4ff43 (patch) | |
| tree | e7cedff7354612d0dd97e2f0f7584d58bff3b223 /include | |
| parent | 49922aacc4e6361e2a11dd2ce8460c80b41ab493 (diff) | |
Merge in fix of dev package. This patch moves header files around, and does not contain any logic changes.
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/gesture-buffer.h | 62 | ||||
| -rw-r--r-- | include/gesture-client.h | 48 | ||||
| -rw-r--r-- | include/gesture-dev.h | 47 | ||||
| -rw-r--r-- | include/gesture.h | 57 | ||||
| -rw-r--r-- | include/grail-touch.h (renamed from include/touch-dev.h) | 57 | ||||
| -rw-r--r-- | include/grail.h | 63 | ||||
| -rw-r--r-- | include/touch-engine.h | 56 | ||||
| -rw-r--r-- | include/touch.h | 57 |
8 files changed, 115 insertions, 332 deletions
diff --git a/include/gesture-buffer.h b/include/gesture-buffer.h deleted file mode 100644 index 49a6dd1..0000000 --- a/include/gesture-buffer.h +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | /***************************************************************************** | ||
| 2 | * | ||
| 3 | * grail - Gesture Recognition And Instantiation Library | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Canonical Ltd. | ||
| 6 | * | ||
| 7 | * This program is free software: you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation, either version 3 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | * Authors: | ||
| 21 | * Henrik Rydberg <rydberg@bitmath.org> | ||
| 22 | * | ||
| 23 | ****************************************************************************/ | ||
| 24 | |||
| 25 | #ifndef _GRAIL_GESTURE_BUFFER_H | ||
| 26 | #define _GRAIL_GESTURE_BUFFER_H | ||
| 27 | |||
| 28 | #include <gesture.h> | ||
| 29 | |||
| 30 | #define DIM_GESTURE_EVENTS 512 | ||
| 31 | |||
| 32 | struct gebuf { | ||
| 33 | int head; | ||
| 34 | int tail; | ||
| 35 | struct gesture_event buffer[DIM_GESTURE_EVENTS]; | ||
| 36 | }; | ||
| 37 | |||
| 38 | static inline void gebuf_clear(struct gebuf *gebuf) | ||
| 39 | { | ||
| 40 | gebuf->head = gebuf->tail = 0; | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline int gebuf_empty(const struct gebuf *gebuf) | ||
| 44 | { | ||
| 45 | return gebuf->head == gebuf->tail; | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void gebuf_put(struct gebuf *gebuf, | ||
| 49 | const struct gesture_event *ev) | ||
| 50 | { | ||
| 51 | gebuf->buffer[gebuf->head++] = *ev; | ||
| 52 | gebuf->head &= DIM_GESTURE_EVENTS - 1; | ||
| 53 | } | ||
| 54 | |||
| 55 | static inline void gebuf_get(struct gebuf *gebuf, | ||
| 56 | struct gesture_event *ev) | ||
| 57 | { | ||
| 58 | *ev = gebuf->buffer[gebuf->tail++]; | ||
| 59 | gebuf->tail &= DIM_GESTURE_EVENTS - 1; | ||
| 60 | } | ||
| 61 | |||
| 62 | #endif | ||
diff --git a/include/gesture-client.h b/include/gesture-client.h deleted file mode 100644 index f507eb4..0000000 --- a/include/gesture-client.h +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | /***************************************************************************** | ||
| 2 | * | ||
| 3 | * grail - Gesture Recognition And Instantiation Library | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Canonical Ltd. | ||
| 6 | * | ||
| 7 | * This program is free software: you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation, either version 3 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | * Authors: | ||
| 21 | * Henrik Rydberg <rydberg@bitmath.org> | ||
| 22 | * | ||
| 23 | ****************************************************************************/ | ||
| 24 | |||
| 25 | #ifndef _GRAIL_GESTURE_CLIENT_H | ||
| 26 | #define _GRAIL_GESTURE_CLIENT_H | ||
| 27 | |||
| 28 | #include <gesture.h> | ||
| 29 | |||
| 30 | struct gesture_client { | ||
| 31 | void (*gesture)(struct gesture_client *client, | ||
| 32 | const struct gesture_event *ev); | ||
| 33 | int priority[DIM_GESTURE_TYPE]; | ||
| 34 | struct client_impl *impl; | ||
| 35 | void *priv; | ||
| 36 | }; | ||
| 37 | |||
| 38 | int client_init(struct gesture_client *client, void *priv); | ||
| 39 | |||
| 40 | void client_flag(struct gesture_client *client, | ||
| 41 | const struct gesture_flag *flag); | ||
| 42 | void client_event(struct gesture_client *client, | ||
| 43 | const struct gesture_event *ev); | ||
| 44 | void client_sync(struct gesture_client *client); | ||
| 45 | |||
| 46 | void client_destroy(struct gesture_client *client); | ||
| 47 | |||
| 48 | #endif | ||
diff --git a/include/gesture-dev.h b/include/gesture-dev.h deleted file mode 100644 index 635fc2f..0000000 --- a/include/gesture-dev.h +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | /***************************************************************************** | ||
| 2 | * | ||
| 3 | * grail - Gesture Recognition And Instantiation Library | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Canonical Ltd. | ||
| 6 | * | ||
| 7 | * This program is free software: you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation, either version 3 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | * Authors: | ||
| 21 | * Henrik Rydberg <rydberg@bitmath.org> | ||
| 22 | * | ||
| 23 | ****************************************************************************/ | ||
| 24 | |||
| 25 | #ifndef _GRAIL_GESTURE_DEV_H | ||
| 26 | #define _GRAIL_GESTURE_DEV_H | ||
| 27 | |||
| 28 | #include <gesture-client.h> | ||
| 29 | |||
| 30 | struct gesture_dev { | ||
| 31 | struct gedev_impl *impl; | ||
| 32 | void *priv; | ||
| 33 | }; | ||
| 34 | |||
| 35 | int gedev_init(struct gesture_dev *dev, void *priv); | ||
| 36 | int gedev_attach_client(struct gesture_dev *dev, | ||
| 37 | struct gesture_client *client); | ||
| 38 | |||
| 39 | void gedev_flag(struct gesture_dev *dev, const struct gesture_flag *flag); | ||
| 40 | void gedev_event(struct gesture_dev *dev, const struct gesture_event *ev); | ||
| 41 | void gedev_sync(struct gesture_dev *dev); | ||
| 42 | |||
| 43 | void gedev_detach_client(struct gesture_dev *dev, | ||
| 44 | struct gesture_client *client); | ||
| 45 | void gedev_destroy(struct gesture_dev *dev); | ||
| 46 | |||
| 47 | #endif | ||
diff --git a/include/gesture.h b/include/gesture.h deleted file mode 100644 index b4f2d5c..0000000 --- a/include/gesture.h +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | /***************************************************************************** | ||
| 2 | * | ||
| 3 | * grail - Gesture Recognition And Instantiation Library | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Canonical Ltd. | ||
| 6 | * | ||
| 7 | * This program is free software: you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation, either version 3 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | * Authors: | ||
| 21 | * Henrik Rydberg <rydberg@bitmath.org> | ||
| 22 | * | ||
| 23 | ****************************************************************************/ | ||
| 24 | |||
| 25 | #ifndef _GRAIL_GESTURE_H | ||
| 26 | #define _GRAIL_GESTURE_H | ||
| 27 | |||
| 28 | #include <touch-dev.h> | ||
| 29 | |||
| 30 | #define DIM_GESTURE_PROP 8 | ||
| 31 | typedef int gesture_prop_t; | ||
| 32 | |||
| 33 | enum gesture_type { | ||
| 34 | GE_MOVE, | ||
| 35 | GE_VSCROLL, | ||
| 36 | DIM_GESTURE_TYPE | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum gesture_state { | ||
| 40 | GS_CANCEL, | ||
| 41 | GS_BEGIN, | ||
| 42 | GS_END | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct gesture_flag { | ||
| 46 | enum gesture_type type; | ||
| 47 | touch_time_t time; | ||
| 48 | enum gesture_state state; | ||
| 49 | }; | ||
| 50 | |||
| 51 | struct gesture_event { | ||
| 52 | enum gesture_type type; | ||
| 53 | touch_time_t time; | ||
| 54 | gesture_prop_t prop[DIM_GESTURE_PROP]; | ||
| 55 | }; | ||
| 56 | |||
| 57 | #endif | ||
diff --git a/include/touch-dev.h b/include/grail-touch.h index 4ecd61b..d6c9bf5 100644 --- a/include/touch-dev.h +++ b/include/grail-touch.h | |||
| @@ -22,13 +22,36 @@ | |||
| 22 | * | 22 | * |
| 23 | ****************************************************************************/ | 23 | ****************************************************************************/ |
| 24 | 24 | ||
| 25 | #ifndef _GRAIL_TOUCH_DEV_H | 25 | #ifndef _GRAIL_TOUCH_H |
| 26 | #define _GRAIL_TOUCH_DEV_H | 26 | #define _GRAIL_TOUCH_H |
| 27 | 27 | ||
| 28 | #include <touch.h> | 28 | #include <mtdev.h> |
| 29 | 29 | ||
| 30 | #define DIM_TOUCHES 32 | ||
| 31 | |||
| 32 | typedef int touch_prop_t; | ||
| 33 | typedef unsigned touch_prop_mask_t; | ||
| 30 | typedef __u64 touch_time_t; | 34 | typedef __u64 touch_time_t; |
| 31 | 35 | ||
| 36 | enum touch_prop_list { | ||
| 37 | TP_POS_X, | ||
| 38 | TP_POS_Y, | ||
| 39 | TP_TOUCH_MAJOR, | ||
| 40 | TP_TOUCH_MINOR, | ||
| 41 | TP_WIDTH_MAJOR, | ||
| 42 | TP_WIDTH_MINOR, | ||
| 43 | TP_ORIENTATION, | ||
| 44 | TP_PRESSURE, | ||
| 45 | DIM_TOUCH_PROP | ||
| 46 | }; | ||
| 47 | |||
| 48 | struct touch { | ||
| 49 | int active; | ||
| 50 | int slot; | ||
| 51 | int next; | ||
| 52 | touch_prop_t prop[DIM_TOUCH_PROP]; | ||
| 53 | }; | ||
| 54 | |||
| 32 | struct touch_dev { | 55 | struct touch_dev { |
| 33 | void (*event)(struct touch_dev *dev, const struct input_event *ev); | 56 | void (*event)(struct touch_dev *dev, const struct input_event *ev); |
| 34 | void (*create)(struct touch_dev *dev, int slot, | 57 | void (*create)(struct touch_dev *dev, int slot, |
| @@ -41,9 +64,37 @@ struct touch_dev { | |||
| 41 | void *priv; | 64 | void *priv; |
| 42 | }; | 65 | }; |
| 43 | 66 | ||
| 67 | struct touch_frame { | ||
| 68 | int ntouch; | ||
| 69 | int slot; | ||
| 70 | struct touch touch[DIM_TOUCHES]; | ||
| 71 | }; | ||
| 72 | |||
| 73 | struct touch_engine { | ||
| 74 | void (*sync)(struct touch_engine *engine, touch_time_t time); | ||
| 75 | struct touch_frame frame; | ||
| 76 | void *priv; | ||
| 77 | }; | ||
| 78 | |||
| 79 | static inline int has_prop(const touch_prop_mask_t *mask, int code) | ||
| 80 | { | ||
| 81 | return (mask[code >> 5] >> (code & 31)) & 1; | ||
| 82 | } | ||
| 83 | |||
| 84 | static inline int next_slot(const struct touch_frame *frame, int slot) | ||
| 85 | { | ||
| 86 | return frame->touch[slot].next; | ||
| 87 | } | ||
| 88 | |||
| 44 | int touch_dev_open(struct touch_dev *dev, int fd); | 89 | int touch_dev_open(struct touch_dev *dev, int fd); |
| 45 | int touch_dev_idle(struct touch_dev *dev, int fd, int ms); | 90 | int touch_dev_idle(struct touch_dev *dev, int fd, int ms); |
| 46 | int touch_dev_pull(struct touch_dev *dev, int fd); | 91 | int touch_dev_pull(struct touch_dev *dev, int fd); |
| 47 | void touch_dev_close(struct touch_dev *dev, int fd); | 92 | void touch_dev_close(struct touch_dev *dev, int fd); |
| 48 | 93 | ||
| 94 | void touch_engine_init(struct touch_engine *engine, | ||
| 95 | void (*sync)(struct touch_engine *engine, | ||
| 96 | touch_time_t time), | ||
| 97 | void *priv); | ||
| 98 | void touch_engine_attach(struct touch_engine *engine, struct touch_dev *dev); | ||
| 99 | |||
| 49 | #endif | 100 | #endif |
diff --git a/include/grail.h b/include/grail.h index b2f4a0d..087cf0c 100644 --- a/include/grail.h +++ b/include/grail.h | |||
| @@ -25,7 +25,66 @@ | |||
| 25 | #ifndef _GRAIL_H | 25 | #ifndef _GRAIL_H |
| 26 | #define _GRAIL_H | 26 | #define _GRAIL_H |
| 27 | 27 | ||
| 28 | #include <touch-engine.h> | 28 | #include <grail-touch.h> |
| 29 | #include <gesture-dev.h> | 29 | |
| 30 | #define DIM_GESTURE_PROP 8 | ||
| 31 | typedef int gesture_prop_t; | ||
| 32 | |||
| 33 | enum gesture_type { | ||
| 34 | GE_MOVE, | ||
| 35 | GE_VSCROLL, | ||
| 36 | DIM_GESTURE_TYPE | ||
| 37 | }; | ||
| 38 | |||
| 39 | enum gesture_state { | ||
| 40 | GS_CANCEL, | ||
| 41 | GS_BEGIN, | ||
| 42 | GS_END | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct gesture_flag { | ||
| 46 | enum gesture_type type; | ||
| 47 | touch_time_t time; | ||
| 48 | enum gesture_state state; | ||
| 49 | }; | ||
| 50 | |||
| 51 | struct gesture_event { | ||
| 52 | enum gesture_type type; | ||
| 53 | touch_time_t time; | ||
| 54 | gesture_prop_t prop[DIM_GESTURE_PROP]; | ||
| 55 | }; | ||
| 56 | |||
| 57 | struct gesture_dev { | ||
| 58 | struct gedev_impl *impl; | ||
| 59 | void *priv; | ||
| 60 | }; | ||
| 61 | |||
| 62 | struct gesture_client { | ||
| 63 | void (*gesture)(struct gesture_client *client, | ||
| 64 | const struct gesture_event *ev); | ||
| 65 | int priority[DIM_GESTURE_TYPE]; | ||
| 66 | struct client_impl *impl; | ||
| 67 | void *priv; | ||
| 68 | }; | ||
| 69 | |||
| 70 | int client_init(struct gesture_client *client, void *priv); | ||
| 71 | void client_flag(struct gesture_client *client, | ||
| 72 | const struct gesture_flag *flag); | ||
| 73 | void client_event(struct gesture_client *client, | ||
| 74 | const struct gesture_event *ev); | ||
| 75 | void client_sync(struct gesture_client *client); | ||
| 76 | void client_destroy(struct gesture_client *client); | ||
| 77 | |||
| 78 | int gedev_init(struct gesture_dev *dev, void *priv); | ||
| 79 | int gedev_attach_client(struct gesture_dev *dev, | ||
| 80 | struct gesture_client *client); | ||
| 81 | |||
| 82 | void gedev_flag(struct gesture_dev *dev, const struct gesture_flag *flag); | ||
| 83 | void gedev_event(struct gesture_dev *dev, const struct gesture_event *ev); | ||
| 84 | void gedev_sync(struct gesture_dev *dev); | ||
| 85 | |||
| 86 | void gedev_detach_client(struct gesture_dev *dev, | ||
| 87 | struct gesture_client *client); | ||
| 88 | void gedev_destroy(struct gesture_dev *dev); | ||
| 30 | 89 | ||
| 31 | #endif | 90 | #endif |
diff --git a/include/touch-engine.h b/include/touch-engine.h deleted file mode 100644 index 389c2a7..0000000 --- a/include/touch-engine.h +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | /***************************************************************************** | ||
| 2 | * | ||
| 3 | * grail - Gesture Recognition And Instantiation Library | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Canonical Ltd. | ||
| 6 | * | ||
| 7 | * This program is free software: you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation, either version 3 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | * Authors: | ||
| 21 | * Henrik Rydberg <rydberg@bitmath.org> | ||
| 22 | * | ||
| 23 | ****************************************************************************/ | ||
| 24 | |||
| 25 | #ifndef _GRAIL_TOUCH_ENGINE_H | ||
| 26 | #define _GRAIL_TOUCH_ENGINE_H | ||
| 27 | |||
| 28 | #include <touch-dev.h> | ||
| 29 | |||
| 30 | #define DIM_TOUCHES 32 | ||
| 31 | |||
| 32 | struct touch_frame { | ||
| 33 | int ntouch; | ||
| 34 | int slot; | ||
| 35 | struct touch touch[DIM_TOUCHES]; | ||
| 36 | }; | ||
| 37 | |||
| 38 | static inline int next_slot(const struct touch_frame *frame, int slot) | ||
| 39 | { | ||
| 40 | return frame->touch[slot].next; | ||
| 41 | } | ||
| 42 | |||
| 43 | struct touch_engine { | ||
| 44 | void (*sync)(struct touch_engine *engine, touch_time_t time); | ||
| 45 | struct touch_frame frame; | ||
| 46 | void *priv; | ||
| 47 | }; | ||
| 48 | |||
| 49 | void touch_engine_init(struct touch_engine *engine, | ||
| 50 | void (*sync)(struct touch_engine *engine, | ||
| 51 | touch_time_t time), | ||
| 52 | void *priv); | ||
| 53 | void touch_engine_attach(struct touch_engine *engine, struct touch_dev *dev); | ||
| 54 | void touch_engine_detach(struct touch_engine *engine, struct touch_dev *dev); | ||
| 55 | |||
| 56 | #endif | ||
diff --git a/include/touch.h b/include/touch.h deleted file mode 100644 index 56c0044..0000000 --- a/include/touch.h +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | /***************************************************************************** | ||
| 2 | * | ||
| 3 | * grail - Gesture Recognition And Instantiation Library | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Canonical Ltd. | ||
| 6 | * | ||
| 7 | * This program is free software: you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation, either version 3 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, but | ||
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | * General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License along | ||
| 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | * | ||
| 20 | * Authors: | ||
| 21 | * Henrik Rydberg <rydberg@bitmath.org> | ||
| 22 | * | ||
| 23 | ****************************************************************************/ | ||
| 24 | |||
| 25 | #ifndef _GRAIL_TOUCH_H | ||
| 26 | #define _GRAIL_TOUCH_H | ||
| 27 | |||
| 28 | #include <mtdev.h> | ||
| 29 | |||
| 30 | enum touch_prop_list { | ||
| 31 | TP_POS_X, | ||
| 32 | TP_POS_Y, | ||
| 33 | TP_TOUCH_MAJOR, | ||
| 34 | TP_TOUCH_MINOR, | ||
| 35 | TP_WIDTH_MAJOR, | ||
| 36 | TP_WIDTH_MINOR, | ||
| 37 | TP_ORIENTATION, | ||
| 38 | TP_PRESSURE, | ||
| 39 | DIM_TOUCH_PROP | ||
| 40 | }; | ||
| 41 | |||
| 42 | typedef int touch_prop_t; | ||
| 43 | typedef unsigned touch_prop_mask_t; | ||
| 44 | |||
| 45 | struct touch { | ||
| 46 | int active; | ||
| 47 | int slot; | ||
| 48 | int next; | ||
| 49 | touch_prop_t prop[DIM_TOUCH_PROP]; | ||
| 50 | }; | ||
| 51 | |||
| 52 | static inline int has_prop(const touch_prop_mask_t *mask, int code) | ||
| 53 | { | ||
| 54 | return (mask[code >> 5] >> (code & 31)) & 1; | ||
| 55 | } | ||
| 56 | |||
| 57 | #endif | ||
