Maurus Cuelenaere | e1753de | 2008-06-06 18:29:46 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2008 by Maurus Cuelenaere |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Maurus Cuelenaere | e1753de | 2008-06-06 18:29:46 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #ifndef _PLUGIN_LIB_TOUCHSCREEN_H_ |
| 23 | #define _PLUGIN_LIB_TOUCHSCREEN_H_ |
| 24 | |
| 25 | #ifdef HAVE_TOUCHPAD |
| 26 | |
| 27 | struct ts_mapping |
| 28 | { |
| 29 | int tl_x; /* top left */ |
| 30 | int tl_y; |
| 31 | int width; |
| 32 | int height; |
| 33 | }; |
| 34 | |
| 35 | struct ts_mappings |
| 36 | { |
| 37 | struct ts_mapping *mappings; |
| 38 | int amount; |
| 39 | }; |
| 40 | |
| 41 | unsigned int touchscreen_map(struct ts_mappings *map, int x, int y); |
| 42 | |
| 43 | struct ts_raster |
| 44 | { |
| 45 | int tl_x; /* top left */ |
| 46 | int tl_y; |
| 47 | int width; |
| 48 | int height; |
| 49 | int raster_width; |
| 50 | int raster_height; |
| 51 | }; |
| 52 | |
| 53 | struct ts_raster_result |
| 54 | { |
| 55 | int x; |
| 56 | int y; |
| 57 | }; |
| 58 | |
| 59 | unsigned int touchscreen_map_raster(struct ts_raster *map, int x, int y, struct ts_raster_result *result); |
| 60 | |
| 61 | struct ts_raster_button_mapping |
| 62 | { |
| 63 | struct ts_raster *raster; |
| 64 | bool drag_drop_enable; /* ... */ |
| 65 | bool double_click_enable; /* ... */ |
| 66 | bool click_enable; /* ... */ |
| 67 | bool move_progress_enable; /* ... */ |
| 68 | bool two_d_movement_enable; /* ... */ |
| 69 | struct ts_raster_result two_d_from; /* ... */ |
| 70 | int _prev_x; /* Internal: DO NOT MODIFY! */ |
| 71 | int _prev_y; /* Internal: DO NOT MODIFY! */ |
| 72 | int _prev_btn_state; /* Internal: DO NOT MODIFY! */ |
| 73 | }; |
| 74 | |
| 75 | struct ts_raster_button_result |
| 76 | { |
| 77 | enum{ |
| 78 | TS_ACTION_NONE, |
| 79 | TS_ACTION_MOVE, |
| 80 | TS_ACTION_CLICK, |
| 81 | TS_ACTION_DOUBLE_CLICK, |
| 82 | TS_ACTION_DRAG_DROP, |
| 83 | TS_ACTION_TWO_D_MOVEMENT |
| 84 | } action; |
| 85 | struct ts_raster_result from; |
| 86 | struct ts_raster_result to; |
| 87 | }; |
| 88 | |
| 89 | struct ts_raster_button_result touchscreen_raster_map_button(struct ts_raster_button_mapping *map, int x, int y, int button); |
| 90 | |
| 91 | #endif /* HAVE_TOUCHPAD */ |
| 92 | #endif /* _PLUGIN_LIB_TOUCHSCREEN_H_ */ |