diff options
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/state.c b/src/state.c new file mode 100644 index 0000000..46b7fef --- /dev/null +++ b/src/state.c | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #include "state.h" | ||
| 2 | |||
| 3 | /******************************************************/ | ||
| 4 | |||
| 5 | void init_state(struct State *s) | ||
| 6 | { | ||
| 7 | memset(s, 0, sizeof(struct State)); | ||
| 8 | } | ||
| 9 | |||
| 10 | /******************************************************/ | ||
| 11 | |||
| 12 | void modify_state(struct State *s, const struct HWData* hw) | ||
| 13 | { | ||
| 14 | int i; | ||
| 15 | if (s->button[0] != hw->button[0]) | ||
| 16 | xf86Msg(X_INFO, "multitouch: button changed\n"); | ||
| 17 | for (i = 0; i < DIM_BUTTON; i++) | ||
| 18 | s->button[i] = hw->button[i]; | ||
| 19 | } | ||
| 20 | |||
| 21 | /******************************************************/ | ||
| 22 | |||
| 23 | const struct FingerState *find_finger(const struct State *s, int id) | ||
| 24 | { | ||
| 25 | int i; | ||
| 26 | for (i = 0; i < s->nfinger; i++) | ||
| 27 | if (s->finger[i].id == id) | ||
| 28 | return s->finger+i; | ||
| 29 | return NULL; | ||
| 30 | } | ||
| 31 | |||
| 32 | /******************************************************/ | ||
| 33 | |||
| 34 | void output_state(const struct State *s) | ||
| 35 | { | ||
| 36 | } | ||
| 37 | |||
| 38 | /******************************************************/ | ||
