summaryrefslogtreecommitdiff
path: root/usr/src/dkms_source_tree/input-mt.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/dkms_source_tree/input-mt.h')
-rw-r--r--usr/src/dkms_source_tree/input-mt.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/usr/src/dkms_source_tree/input-mt.h b/usr/src/dkms_source_tree/input-mt.h
new file mode 100644
index 0000000..fdee06e
--- /dev/null
+++ b/usr/src/dkms_source_tree/input-mt.h
@@ -0,0 +1,56 @@
1#ifndef _INPUT_MT_H
2#define _INPUT_MT_H
3
4/*
5 * Input Multitouch Library
6 *
7 * Copyright (c) 2010 Henrik Rydberg
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published by
11 * the Free Software Foundation.
12 */
13
14#include <linux/input.h>
15
16/**
17 * struct trk_coord - contact coordinate
18 * @x: horizontal coordinate
19 * @y: vertical coordinate
20 */
21struct trk_coord {
22 int x;
23 int y;
24};
25
26int input_mt_create_slots_new(struct input_dev *dev, unsigned int num_slots);
27
28int input_mt_assign_slots_by_coord(struct input_dev *dev, int *slots,
29 const struct trk_coord *coords,
30 int num_coords);
31
32void input_mt_sync_slot_complement(struct input_dev *dev,
33 const int *slots, int num_slots);
34
35void input_mt_report_state(struct input_dev *dev, bool active);
36void input_mt_report_emulation(struct input_dev *dev);
37
38static inline int input_mt_get_value(const struct input_mt_slot *slot,
39 unsigned code)
40{
41 return slot->abs[code - ABS_MT_FIRST];
42}
43
44static inline bool input_mt_get_state(struct input_dev *dev, int slot)
45{
46 return dev->mt &&
47 input_mt_get_value(&dev->mt[slot], ABS_MT_TRACKING_ID) >= 0;
48}
49
50static inline void input_abs_set_res(struct input_dev *dev,
51 unsigned int axis, int val)
52{
53 dev->absres[axis] = val;
54}
55
56#endif