diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-06-16 17:04:47 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-06-16 17:04:47 +0000 |
commit | b8435f54464fd50c145d321b118d773ea05ef6a2 (patch) | |
tree | a514bbe44e41c454dfca56184376209787c40268 /apps/menus | |
parent | b1a60934c5d178842ec3bec83a3e5286410cab7d (diff) | |
download | rockbox-b8435f54464fd50c145d321b118d773ea05ef6a2.tar.gz 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')
-rw-r--r-- | apps/menus/display_menu.c | 29 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 18 |
2 files changed, 29 insertions, 18 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 @@ | |||
36 | #include "talk.h" | 36 | #include "talk.h" |
37 | #include "lcd.h" | 37 | #include "lcd.h" |
38 | #include "lcd-remote.h" | 38 | #include "lcd-remote.h" |
39 | #ifdef HAVE_TOUCHSCREEN | ||
40 | #include "screens.h" | ||
41 | #endif | ||
39 | 42 | ||
40 | #ifdef HAVE_BACKLIGHT | 43 | #ifdef HAVE_BACKLIGHT |
41 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | 44 | 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, | |||
496 | /***********************************/ | 499 | /***********************************/ |
497 | 500 | ||
498 | 501 | ||
502 | #ifdef HAVE_TOUCHSCREEN | ||
503 | static int touch_mode_callback(int action,const struct menu_item_ex *this_item) | ||
504 | { | ||
505 | (void)this_item; | ||
506 | switch (action) | ||
507 | { | ||
508 | case ACTION_EXIT_MENUITEM: /* on exit */ | ||
509 | touchscreen_set_mode(global_settings.touch_mode); | ||
510 | break; | ||
511 | } | ||
512 | return action; | ||
513 | } | ||
514 | MENUITEM_SETTING(touch_mode, &global_settings.touch_mode, touch_mode_callback); | ||
515 | |||
516 | MENUITEM_FUNCTION(touchscreen_menu_calibrate, 0, ID2P(LANG_TOUCHSCREEN_CALIBRATE), calibrate, | ||
517 | NULL, NULL, Icon_NOICON); | ||
518 | MENUITEM_FUNCTION(touchscreen_menu_reset_calibration, 0, ID2P(LANG_TOUCHSCREEN_RESET_CALIBRATION), reset_mapping, | ||
519 | NULL, NULL, Icon_NOICON); | ||
520 | |||
521 | MAKE_MENU(touchscreen_menu, ID2P(LANG_TOUCHSCREEN_SETTINGS), NULL, Icon_NOICON, &touch_mode, | ||
522 | &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration); | ||
523 | #endif | ||
524 | |||
499 | 525 | ||
500 | MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL); | 526 | MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL); |
501 | 527 | ||
@@ -511,4 +537,7 @@ MAKE_MENU(display_menu, ID2P(LANG_DISPLAY), | |||
511 | &bars_menu, &peak_meter_menu, | 537 | &bars_menu, &peak_meter_menu, |
512 | #endif | 538 | #endif |
513 | &codepage_setting, | 539 | &codepage_setting, |
540 | #ifdef HAVE_TOUCHSCREEN | ||
541 | &touchscreen_menu, | ||
542 | #endif | ||
514 | ); | 543 | ); |
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 56a0178000..fdc775877a 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -265,21 +265,6 @@ MENUITEM_SETTING(buttonlight_brightness, &global_settings.buttonlight_brightness | |||
265 | MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL); | 265 | MENUITEM_SETTING(touchpad_sensitivity, &global_settings.touchpad_sensitivity, NULL); |
266 | #endif | 266 | #endif |
267 | 267 | ||
268 | #ifdef HAVE_TOUCHSCREEN | ||
269 | static int touch_mode_callback(int action,const struct menu_item_ex *this_item) | ||
270 | { | ||
271 | (void)this_item; | ||
272 | switch (action) | ||
273 | { | ||
274 | case ACTION_EXIT_MENUITEM: /* on exit */ | ||
275 | touchscreen_set_mode(global_settings.touch_mode); | ||
276 | break; | ||
277 | } | ||
278 | return action; | ||
279 | } | ||
280 | MENUITEM_SETTING(touch_mode, &global_settings.touch_mode, touch_mode_callback); | ||
281 | #endif | ||
282 | |||
283 | MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), | 268 | MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), |
284 | 0, Icon_System_menu, | 269 | 0, Icon_System_menu, |
285 | &start_screen, | 270 | &start_screen, |
@@ -315,9 +300,6 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), | |||
315 | #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING | 300 | #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING |
316 | &touchpad_sensitivity, | 301 | &touchpad_sensitivity, |
317 | #endif | 302 | #endif |
318 | #ifdef HAVE_TOUCHSCREEN | ||
319 | &touch_mode, | ||
320 | #endif | ||
321 | ); | 303 | ); |
322 | 304 | ||
323 | /* SYSTEM MENU */ | 305 | /* SYSTEM MENU */ |