aboutsummaryrefslogtreecommitdiffstats
path: root/include/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 /include/memory.h
parentad6faf6c53bc1924986e1cc10bb42e5d157cba8f (diff)
downloadxorg-input-kobomultitouch-ff88de5cd38b5b51bad0e63d373d66745f1f8d31.tar.gz
xorg-input-kobomultitouch-ff88de5cd38b5b51bad0e63d373d66745f1f8d31.tar.bz2
xorg-input-kobomultitouch-ff88de5cd38b5b51bad0e63d373d66745f1f8d31.zip
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 'include/memory.h')
-rw-r--r--include/memory.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/include/memory.h b/include/memory.h
new file mode 100644
index 0000000..8ffbdab
--- /dev/null
+++ b/include/memory.h
@@ -0,0 +1,73 @@
+/***************************************************************************
+ *
+ * Multitouch X driver
+ * Copyright (C) 2008 Henrik Rydberg <rydberg@euromail.se>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ **************************************************************************/
+
+#ifndef MEMORY_H
+#define MEMORY_H
+
+#include "mtstate.h"
+
+/**
+ * struct Memory - parsing state
+ *
+ * @btdata: logical finger state
+ * @same: true if the finger configuration is unchanged
+ * @fingers: bitmask of fingers on the pad
+ * @added: bitmask of new fingers on the pad
+ * @thumb: bitmask of thumbs on the pad
+ * @pointing: bitmask of pointing fingers
+ * @pending: bitmask of tentatively moving fingers
+ * @moving: bitmask of moving fingers
+ * @ybar: vertical position on pad marking the clicking area
+ * @mvhold: movement before this point in time is accumulated
+ * @mvforget: movement before this point in time is discarded
+ * @dx: array of accumulated horiontal movement per finger
+ * @dy: array of accumulated vertical movement per finger
+ *
+ */
+struct Memory {
+ unsigned btdata, same;
+ unsigned fingers, added, thumb;
+ unsigned pointing, pending, moving;
+ int ybar;
+ mstime_t mvhold, mvforget;
+ int dx[DIM_FINGER], dy[DIM_FINGER];
+};
+
+void init_memory(struct Memory *mem);
+void refresh_memory(struct Memory *m,
+ const struct MTState *prev_state,
+ const struct MTState *state,
+ const struct Capabilities *caps);
+void output_memory(const struct Memory *m);
+
+static inline void mem_hold_movement(struct Memory *m, mstime_t t)
+{
+ if (t > m->mvhold)
+ m->mvhold = t;
+}
+
+static inline void mem_forget_movement(struct Memory *m, mstime_t t)
+{
+ if (t > m->mvforget)
+ m->mvforget = t;
+}
+
+#endif