summaryrefslogtreecommitdiffstats
path: root/apps/menus/display_menu.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-06-16 17:04:47 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-06-16 17:04:47 +0000
commitb8435f54464fd50c145d321b118d773ea05ef6a2 (patch)
treea514bbe44e41c454dfca56184376209787c40268 /apps/menus/display_menu.c
parentb1a60934c5d178842ec3bec83a3e5286410cab7d (diff)
downloadrockbox-b8435f54464fd50c145d321b118d773ea05ef6a2.tar.gz
rockbox-b8435f54464fd50c145d321b118d773ea05ef6a2.tar.bz2
rockbox-b8435f54464fd50c145d321b118d773ea05ef6a2.zip
Touchscreen targets: add calibration screen + rewrite calibration driver (FS#10295)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21312 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menus/display_menu.c')
-rw-r--r--apps/menus/display_menu.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index a015be3a23..aee9c1828d 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -36,6 +36,9 @@
#include "talk.h"
#include "lcd.h"
#include "lcd-remote.h"
+#ifdef HAVE_TOUCHSCREEN
+#include "screens.h"
+#endif
#ifdef HAVE_BACKLIGHT
static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item)
@@ -496,6 +499,29 @@ MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON,
/***********************************/
+#ifdef HAVE_TOUCHSCREEN
+static int touch_mode_callback(int action,const struct menu_item_ex *this_item)
+{
+ (void)this_item;
+ switch (action)
+ {
+ case ACTION_EXIT_MENUITEM: /* on exit */
+ touchscreen_set_mode(global_settings.touch_mode);
+ break;
+ }
+ return action;
+}
+MENUITEM_SETTING(touch_mode, &global_settings.touch_mode, touch_mode_callback);
+
+MENUITEM_FUNCTION(touchscreen_menu_calibrate, 0, ID2P(LANG_TOUCHSCREEN_CALIBRATE), calibrate,
+ NULL, NULL, Icon_NOICON);
+MENUITEM_FUNCTION(touchscreen_menu_reset_calibration, 0, ID2P(LANG_TOUCHSCREEN_RESET_CALIBRATION), reset_mapping,
+ NULL, NULL, Icon_NOICON);
+
+MAKE_MENU(touchscreen_menu, ID2P(LANG_TOUCHSCREEN_SETTINGS), NULL, Icon_NOICON, &touch_mode,
+ &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration);
+#endif
+
MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL);
@@ -511,4 +537,7 @@ MAKE_MENU(display_menu, ID2P(LANG_DISPLAY),
&bars_menu, &peak_meter_menu,
#endif
&codepage_setting,
+#ifdef HAVE_TOUCHSCREEN
+ &touchscreen_menu,
+#endif
);