diff options
Diffstat (limited to 'apps/plugins/lib/touchscreen.h')
-rw-r--r-- | apps/plugins/lib/touchscreen.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/apps/plugins/lib/touchscreen.h b/apps/plugins/lib/touchscreen.h new file mode 100644 index 0000000000..e7bc0004cc --- /dev/null +++ b/apps/plugins/lib/touchscreen.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Maurus Cuelenaere | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef _PLUGIN_LIB_TOUCHSCREEN_H_ | ||
21 | #define _PLUGIN_LIB_TOUCHSCREEN_H_ | ||
22 | |||
23 | #ifdef HAVE_TOUCHPAD | ||
24 | |||
25 | struct ts_mapping | ||
26 | { | ||
27 | int tl_x; /* top left */ | ||
28 | int tl_y; | ||
29 | int width; | ||
30 | int height; | ||
31 | }; | ||
32 | |||
33 | struct ts_mappings | ||
34 | { | ||
35 | struct ts_mapping *mappings; | ||
36 | int amount; | ||
37 | }; | ||
38 | |||
39 | unsigned int touchscreen_map(struct ts_mappings *map, int x, int y); | ||
40 | |||
41 | struct ts_raster | ||
42 | { | ||
43 | int tl_x; /* top left */ | ||
44 | int tl_y; | ||
45 | int width; | ||
46 | int height; | ||
47 | int raster_width; | ||
48 | int raster_height; | ||
49 | }; | ||
50 | |||
51 | struct ts_raster_result | ||
52 | { | ||
53 | int x; | ||
54 | int y; | ||
55 | }; | ||
56 | |||
57 | unsigned int touchscreen_map_raster(struct ts_raster *map, int x, int y, struct ts_raster_result *result); | ||
58 | |||
59 | struct ts_raster_button_mapping | ||
60 | { | ||
61 | struct ts_raster *raster; | ||
62 | bool drag_drop_enable; /* ... */ | ||
63 | bool double_click_enable; /* ... */ | ||
64 | bool click_enable; /* ... */ | ||
65 | bool move_progress_enable; /* ... */ | ||
66 | bool two_d_movement_enable; /* ... */ | ||
67 | struct ts_raster_result two_d_from; /* ... */ | ||
68 | int _prev_x; /* Internal: DO NOT MODIFY! */ | ||
69 | int _prev_y; /* Internal: DO NOT MODIFY! */ | ||
70 | int _prev_btn_state; /* Internal: DO NOT MODIFY! */ | ||
71 | }; | ||
72 | |||
73 | struct ts_raster_button_result | ||
74 | { | ||
75 | enum{ | ||
76 | TS_ACTION_NONE, | ||
77 | TS_ACTION_MOVE, | ||
78 | TS_ACTION_CLICK, | ||
79 | TS_ACTION_DOUBLE_CLICK, | ||
80 | TS_ACTION_DRAG_DROP, | ||
81 | TS_ACTION_TWO_D_MOVEMENT | ||
82 | } action; | ||
83 | struct ts_raster_result from; | ||
84 | struct ts_raster_result to; | ||
85 | }; | ||
86 | |||
87 | struct ts_raster_button_result touchscreen_raster_map_button(struct ts_raster_button_mapping *map, int x, int y, int button); | ||
88 | |||
89 | #endif /* HAVE_TOUCHPAD */ | ||
90 | #endif /* _PLUGIN_LIB_TOUCHSCREEN_H_ */ | ||