summaryrefslogtreecommitdiff
path: root/src/memory.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-06-16 02:27:32 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-06-16 02:27:32 +0200
commitff88de5cd38b5b51bad0e63d373d66745f1f8d31 (patch)
tree3fbf4adc8c807bc79a8272c4df1623c3677a9b2f /src/memory.h
parentad6faf6c53bc1924986e1cc10bb42e5d157cba8f (diff)
refactor: Move files
Move all headers into include, separate source files into modules match, mtdev, src and driver, move some common definitions to common.h, and include define support for the MT slot protocol. This patch does not introduce any logical changes. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/memory.h')
-rw-r--r--src/memory.h73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/memory.h b/src/memory.h
deleted file mode 100644
index 8ffbdab..0000000
--- a/src/memory.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/***************************************************************************
2 *
3 * Multitouch X driver
4 * Copyright (C) 2008 Henrik Rydberg <rydberg@euromail.se>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 **************************************************************************/
21
22#ifndef MEMORY_H
23#define MEMORY_H
24
25#include "mtstate.h"
26
27/**
28 * struct Memory - parsing state
29 *
30 * @btdata: logical finger state
31 * @same: true if the finger configuration is unchanged
32 * @fingers: bitmask of fingers on the pad
33 * @added: bitmask of new fingers on the pad
34 * @thumb: bitmask of thumbs on the pad
35 * @pointing: bitmask of pointing fingers
36 * @pending: bitmask of tentatively moving fingers
37 * @moving: bitmask of moving fingers
38 * @ybar: vertical position on pad marking the clicking area
39 * @mvhold: movement before this point in time is accumulated
40 * @mvforget: movement before this point in time is discarded
41 * @dx: array of accumulated horiontal movement per finger
42 * @dy: array of accumulated vertical movement per finger
43 *
44 */
45struct Memory {
46 unsigned btdata, same;
47 unsigned fingers, added, thumb;
48 unsigned pointing, pending, moving;
49 int ybar;
50 mstime_t mvhold, mvforget;
51 int dx[DIM_FINGER], dy[DIM_FINGER];
52};
53
54void init_memory(struct Memory *mem);
55void refresh_memory(struct Memory *m,
56 const struct MTState *prev_state,
57 const struct MTState *state,
58 const struct Capabilities *caps);
59void output_memory(const struct Memory *m);
60
61static inline void mem_hold_movement(struct Memory *m, mstime_t t)
62{
63 if (t > m->mvhold)
64 m->mvhold = t;
65}
66
67static inline void mem_forget_movement(struct Memory *m, mstime_t t)
68{
69 if (t > m->mvforget)
70 m->mvforget = t;
71}
72
73#endif