diff options
author | Rob Purchase <shotofadds@rockbox.org> | 2009-03-24 21:55:05 +0000 |
---|---|---|
committer | Rob Purchase <shotofadds@rockbox.org> | 2009-03-24 21:55:05 +0000 |
commit | ed1a3355deac93683a25296e573d65729bb3f2e7 (patch) | |
tree | 47d58088364cf9f042770e72b51fea223ace8bc7 | |
parent | 3adb821ad05d9c1169816379092cc807556cc822 (diff) |
Add a Touchscreen Mode setting to switch between 3x3 grid and absolute point modes. Note that many screens have not yet been adjusted to absolute point mode, so use with caution.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20520 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/features.txt | 3 | ||||
-rw-r--r-- | apps/lang/english.lang | 51 | ||||
-rw-r--r-- | apps/main.c | 3 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 19 | ||||
-rw-r--r-- | apps/settings.c | 4 | ||||
-rw-r--r-- | apps/settings.h | 4 | ||||
-rw-r--r-- | apps/settings_list.c | 9 |
7 files changed, 87 insertions, 6 deletions
diff --git a/apps/features.txt b/apps/features.txt index b510136a33..af4b18648e 100644 --- a/apps/features.txt +++ b/apps/features.txt @@ -192,3 +192,6 @@ usbstack wheel_acceleration #endif +#if defined(HAVE_TOUCHSCREEN) +touchscreen +#endif diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 8971cfb0a9..b2f08222ce 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -12403,3 +12403,54 @@ speaker: "Enable Speaker" </voice> </phrase> +<phrase> + id: LANG_TOUCHSCREEN_MODE + desc: in Settings -> General -> System menu + user: core + <source> + *: none + touchscreen: "Touchscreen Mode" + </source> + <dest> + *: none + touchscreen: "Touchscreen Mode" + </dest> + <voice> + *: none + touchscreen: "Touchscreen Mode" + </voice> +</phrase> +<phrase> + id: LANG_TOUCHSCREEN_GRID + desc: in Settings -> General -> System menu + user: core + <source> + *: none + touchscreen: "3x3 Grid" + </source> + <dest> + *: none + touchscreen: "3x3 Grid" + </dest> + <voice> + *: none + touchscreen: "3 by 3 grid" + </voice> +</phrase> +<phrase> + id: LANG_TOUCHSCREEN_POINT + desc: in Settings -> General -> System menu + user: core + <source> + *: none + touchscreen: "Absolute Point" + </source> + <dest> + *: none + touchscreen: "Absolute Point" + </dest> + <voice> + *: none + touchscreen: "Absolute Point" + </voice> +</phrase>
\ No newline at end of file diff --git a/apps/main.c b/apps/main.c index 20cec9bbfa..54ff191a3a 100644 --- a/apps/main.c +++ b/apps/main.c @@ -136,9 +136,6 @@ static void app_main(void) screens[i].update(); } tree_gui_init(); -#ifdef HAVE_TOUCHSCREEN - touchscreen_set_mode(TOUCHSCREEN_BUTTON); -#endif viewportmanager_set_statusbar(VP_SB_ALLSCREENS); add_event(GUI_EVENT_STATUSBAR_TOGGLE, false, viewportmanager_statusbar_changed); diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 73d2463c36..56a0178000 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -265,6 +265,20 @@ MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL); #endif +#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); +#endif MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), 0, Icon_System_menu, @@ -284,7 +298,7 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), &car_adapter_mode, #endif #ifdef IPOD_ACCESSORY_PROTOCOL - &serial_bitrate, + &serial_bitrate, #endif #ifdef HAVE_ACCESSORY_SUPPLY &accessory_supply, @@ -301,6 +315,9 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING &touchpad_sensitivity, #endif +#ifdef HAVE_TOUCHSCREEN + &touch_mode, +#endif ); /* SYSTEM MENU */ diff --git a/apps/settings.c b/apps/settings.c index 71c29f67c4..4db4f4405c 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -960,6 +960,10 @@ void settings_apply(bool read_disk) usb_charging_enable(global_settings.usb_charging); #endif +#ifdef HAVE_TOUCHSCREEN + touchscreen_set_mode(global_settings.touch_mode); +#endif + /* This should stay last */ #if defined(HAVE_RECORDING) && CONFIG_CODEC == SWCODEC enc_global_settings_apply(); diff --git a/apps/settings.h b/apps/settings.h index c376a46dea..dfd3998d83 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -726,6 +726,10 @@ struct user_settings bool speaker_enabled; #endif +#ifdef HAVE_TOUCHSCREEN + int touch_mode; +#endif + /* If values are just added to the end, no need to bump plugin API version. */ /* new stuff to be added at the end */ diff --git a/apps/settings_list.c b/apps/settings_list.c index 2d9be0873c..6255580991 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -602,8 +602,8 @@ const struct settings_list settings[] = { #ifdef IPOD_ACCESSORY_PROTOCOL CHOICE_SETTING(0, serial_bitrate, LANG_SERIAL_BITRATE, 0, "serial bitrate", "auto,9600,19200,38400,57600", iap_bitrate_set, 5, ID2P(LANG_SERIAL_BITRATE_AUTO), - ID2P(LANG_SERIAL_BITRATE_9600),ID2P(LANG_SERIAL_BITRATE_19200), - ID2P(LANG_SERIAL_BITRATE_38400),ID2P(LANG_SERIAL_BITRATE_57600)), + ID2P(LANG_SERIAL_BITRATE_9600),ID2P(LANG_SERIAL_BITRATE_19200), + ID2P(LANG_SERIAL_BITRATE_38400),ID2P(LANG_SERIAL_BITRATE_57600)), #endif #ifdef HAVE_ACCESSORY_SUPPLY OFFON_SETTING(0, accessory_supply, LANG_ACCESSORY_SUPPLY, @@ -1462,6 +1462,11 @@ const struct settings_list settings[] = { OFFON_SETTING(0, speaker_enabled, LANG_ENABLE_SPEAKER, false, "speaker", audiohw_enable_speaker), #endif +#ifdef HAVE_TOUCHSCREEN + CHOICE_SETTING(0, touch_mode, LANG_TOUCHSCREEN_MODE, TOUCHSCREEN_BUTTON, + "touchscreen mode", "point,grid", NULL, 2, + ID2P(LANG_TOUCHSCREEN_POINT), ID2P(LANG_TOUCHSCREEN_GRID)), +#endif }; const int nb_settings = sizeof(settings)/sizeof(*settings); |