diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2008-11-06 17:18:16 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2008-11-06 17:18:16 +0100 |
| commit | 63de72d8d810e3692c96c7385b497bb4d68ef54a (patch) | |
| tree | caa3ecce7c826553d611193f6f1363d76ebd906f /src/state.c | |
| parent | 3734c2c5dc65f41aa727d9d69201d604eab6e77d (diff) | |
state added, now do the matching
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
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 | /******************************************************/ | ||
