diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-10-12 15:38:43 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-10-12 15:38:43 +0200 |
| commit | acea9df3381825a634c000a574f58b4ca5293ee8 (patch) | |
| tree | 3698bd55f137bc377f1b840e4fb5bf9e446e7250 /mtdev/mapgen.c | |
| parent | 7380af2c93dc83f4f09e293717d46eadf7799e89 (diff) | |
Same version, but using the mtdev library.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'mtdev/mapgen.c')
| -rw-r--r-- | mtdev/mapgen.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/mtdev/mapgen.c b/mtdev/mapgen.c deleted file mode 100644 index efb3524..0000000 --- a/mtdev/mapgen.c +++ /dev/null | |||
| @@ -1,69 +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 | #include <common.h> | ||
| 23 | #include <fcntl.h> | ||
| 24 | #include <xbypass.h> | ||
| 25 | |||
| 26 | #define BIT_DEF(name) \ | ||
| 27 | printf("#define BIT_"#name" %d\n", \ | ||
| 28 | cabs2mt[ABS_MT_##name] - 1) | ||
| 29 | |||
| 30 | static unsigned int cabs2mt[ABS_CNT]; | ||
| 31 | static unsigned int cmt2abs[MT_ABS_SIZE]; | ||
| 32 | |||
| 33 | void init_caps() | ||
| 34 | { | ||
| 35 | static const int init_abs_map[MT_ABS_SIZE] = MT_SLOT_ABS_EVENTS; | ||
| 36 | int i; | ||
| 37 | for (i = 0; i < MT_ABS_SIZE; i++) { | ||
| 38 | cabs2mt[init_abs_map[i]] = i + 1; | ||
| 39 | cmt2abs[i] = init_abs_map[i]; | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline const char *newln(int i, int n) | ||
| 44 | { | ||
| 45 | return i == n - 1 || i % 8 == 7 ? "\n" : ""; | ||
| 46 | } | ||
| 47 | |||
| 48 | int main(int argc, char *argv[]) | ||
| 49 | { | ||
| 50 | int i; | ||
| 51 | init_caps(); | ||
| 52 | printf("static const unsigned int map_abs2mt[ABS_CNT] = {\n"); | ||
| 53 | for (i = 0; i < ABS_CNT; i++) | ||
| 54 | printf(" 0x%04x,%s", cabs2mt[i], newln(i, ABS_CNT)); | ||
| 55 | printf("};\n\n"); | ||
| 56 | printf("static const unsigned int map_mt2abs[MT_ABS_SIZE] = {\n"); | ||
| 57 | for (i = 0; i < MT_ABS_SIZE; i++) | ||
| 58 | printf(" 0x%04x,%s", cmt2abs[i], newln(i, MT_ABS_SIZE)); | ||
| 59 | printf("};\n\n"); | ||
| 60 | BIT_DEF(TRACKING_ID); | ||
| 61 | BIT_DEF(POSITION_X); | ||
| 62 | BIT_DEF(POSITION_Y); | ||
| 63 | BIT_DEF(TOUCH_MAJOR); | ||
| 64 | BIT_DEF(TOUCH_MINOR); | ||
| 65 | BIT_DEF(WIDTH_MAJOR); | ||
| 66 | BIT_DEF(WIDTH_MINOR); | ||
| 67 | printf("\n"); | ||
| 68 | return 0; | ||
| 69 | } | ||
