diff options
44 files changed, 201 insertions, 110 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index 1cebcd718f..1a7d58156f 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c | |||
@@ -664,7 +664,7 @@ static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resu | |||
664 | bookmarks->start = 0; | 664 | bookmarks->start = 0; |
665 | bookmarks->show_playlist_name | 665 | bookmarks->show_playlist_name |
666 | = strcmp(bookmark_file_name, RECENT_BOOKMARK_FILE) == 0; | 666 | = strcmp(bookmark_file_name, RECENT_BOOKMARK_FILE) == 0; |
667 | gui_synclist_init(&list, &get_bookmark_info, (void*) bookmarks, false, 2); | 667 | gui_synclist_init(&list, &get_bookmark_info, (void*) bookmarks, false, 2, NULL); |
668 | gui_synclist_set_title(&list, str(LANG_BOOKMARK_SELECT_BOOKMARK), | 668 | gui_synclist_set_title(&list, str(LANG_BOOKMARK_SELECT_BOOKMARK), |
669 | Icon_Bookmark); | 669 | Icon_Bookmark); |
670 | gui_syncstatusbar_draw(&statusbars, true); | 670 | gui_syncstatusbar_draw(&statusbars, true); |
@@ -738,7 +738,7 @@ static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resu | |||
738 | { | 738 | { |
739 | ACTION_STD_OK, ACTION_BMS_DELETE | 739 | ACTION_STD_OK, ACTION_BMS_DELETE |
740 | }; | 740 | }; |
741 | int selection = do_menu(&menu_items, NULL); | 741 | int selection = do_menu(&menu_items, NULL, NULL, false); |
742 | 742 | ||
743 | refresh = true; | 743 | refresh = true; |
744 | 744 | ||
diff --git a/apps/cuesheet.c b/apps/cuesheet.c index cac644805f..9c23d817be 100644 --- a/apps/cuesheet.c +++ b/apps/cuesheet.c | |||
@@ -292,7 +292,7 @@ void browse_cuesheet(struct cuesheet *cue) | |||
292 | struct mp3entry *id3 = audio_current_track(); | 292 | struct mp3entry *id3 = audio_current_track(); |
293 | 293 | ||
294 | snprintf(title, MAX_PATH, "%s: %s", cue->performer, cue->title); | 294 | snprintf(title, MAX_PATH, "%s: %s", cue->performer, cue->title); |
295 | gui_synclist_init(&lists, list_get_name_cb, cue, false, 2); | 295 | gui_synclist_init(&lists, list_get_name_cb, cue, false, 2, NULL); |
296 | gui_synclist_set_nb_items(&lists, 2*cue->track_count); | 296 | gui_synclist_set_nb_items(&lists, 2*cue->track_count); |
297 | gui_synclist_set_title(&lists, title, 0); | 297 | gui_synclist_set_title(&lists, title, 0); |
298 | 298 | ||
diff --git a/apps/enc_config.c b/apps/enc_config.c index c916b295df..3412e966e1 100644 --- a/apps/enc_config.c +++ b/apps/enc_config.c | |||
@@ -396,7 +396,7 @@ bool enc_config_menu(struct encoder_config *cfg) | |||
396 | { | 396 | { |
397 | menu_callback_data.cfg = &cfg; | 397 | menu_callback_data.cfg = &cfg; |
398 | menu_callback_data.global = false; | 398 | menu_callback_data.global = false; |
399 | return do_menu(enc_data[cfg->rec_format].menu, NULL) | 399 | return do_menu(enc_data[cfg->rec_format].menu, NULL, NULL, false) |
400 | == MENU_ATTACHED_USB; | 400 | == MENU_ATTACHED_USB; |
401 | } | 401 | } |
402 | else | 402 | else |
@@ -454,7 +454,7 @@ bool enc_global_config_menu(void) | |||
454 | { | 454 | { |
455 | menu_callback_data.cfg = &cfg; | 455 | menu_callback_data.cfg = &cfg; |
456 | menu_callback_data.global = true; | 456 | menu_callback_data.global = true; |
457 | return do_menu(enc_data[cfg.rec_format].menu, NULL) | 457 | return do_menu(enc_data[cfg.rec_format].menu, NULL, NULL, false) |
458 | == MENU_ATTACHED_USB; | 458 | == MENU_ATTACHED_USB; |
459 | } | 459 | } |
460 | else | 460 | else |
diff --git a/apps/gui/list.c b/apps/gui/list.c index 86de0ae312..1f0f0ff01c 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -107,12 +107,14 @@ bool list_display_title(struct gui_synclist *list, struct viewport *vp) | |||
107 | * - data : extra data passed to the list callback | 107 | * - data : extra data passed to the list callback |
108 | * - scroll_all : | 108 | * - scroll_all : |
109 | * - selected_size : | 109 | * - selected_size : |
110 | * - parent : the parent viewports to use. NULL means the full screen minus | ||
111 | * statusbar if enabled. NOTE: new screens should NOT set this to NULL. | ||
110 | */ | 112 | */ |
111 | void gui_synclist_init(struct gui_synclist * gui_list, | 113 | void gui_synclist_init(struct gui_synclist * gui_list, |
112 | list_get_name callback_get_item_name, | 114 | list_get_name callback_get_item_name, |
113 | void * data, | 115 | void * data, |
114 | bool scroll_all, | 116 | bool scroll_all, |
115 | int selected_size | 117 | int selected_size, struct viewport list_parent[NB_SCREENS] |
116 | ) | 118 | ) |
117 | { | 119 | { |
118 | int i; | 120 | int i; |
@@ -128,7 +130,18 @@ void gui_synclist_init(struct gui_synclist * gui_list, | |||
128 | #ifdef HAVE_LCD_BITMAP | 130 | #ifdef HAVE_LCD_BITMAP |
129 | gui_list->offset_position[i] = 0; | 131 | gui_list->offset_position[i] = 0; |
130 | #endif | 132 | #endif |
131 | gui_list->parent[i] = &parent[i]; | 133 | if (list_parent) |
134 | gui_list->parent[i] = &list_parent[i]; | ||
135 | else | ||
136 | { | ||
137 | gui_list->parent[i] = &parent[i]; | ||
138 | gui_list->parent[i]->y = global_settings.statusbar?STATUSBAR_HEIGHT:0; | ||
139 | gui_list->parent[i]->height = screens[i].height - gui_list->parent[i]->y; | ||
140 | #ifdef HAS_BUTTONBAR | ||
141 | if (screens[i].has_buttonbar) | ||
142 | gui_list->parent[i]->height -= BUTTONBAR_HEIGHT; | ||
143 | #endif | ||
144 | } | ||
132 | } | 145 | } |
133 | gui_list->limit_scroll = false; | 146 | gui_list->limit_scroll = false; |
134 | gui_list->data=data; | 147 | gui_list->data=data; |
@@ -811,7 +824,7 @@ bool simplelist_show_list(struct simplelist_info *info) | |||
811 | else | 824 | else |
812 | getname = simplelist_static_getname; | 825 | getname = simplelist_static_getname; |
813 | gui_synclist_init(&lists, getname, info->callback_data, | 826 | gui_synclist_init(&lists, getname, info->callback_data, |
814 | info->scroll_all, info->selection_size); | 827 | info->scroll_all, info->selection_size, NULL); |
815 | if (info->title) | 828 | if (info->title) |
816 | gui_synclist_set_title(&lists, info->title, NOICON); | 829 | gui_synclist_set_title(&lists, info->title, NOICON); |
817 | if (info->get_icon) | 830 | if (info->get_icon) |
diff --git a/apps/gui/list.h b/apps/gui/list.h index 48dd736d00..12f88174d3 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -142,7 +142,8 @@ extern void gui_synclist_init( | |||
142 | list_get_name callback_get_item_name, | 142 | list_get_name callback_get_item_name, |
143 | void * data, | 143 | void * data, |
144 | bool scroll_all, | 144 | bool scroll_all, |
145 | int selected_size | 145 | int selected_size, |
146 | struct viewport parent[NB_SCREENS] /* NOTE: new screens should NOT set this to NULL */ | ||
146 | ); | 147 | ); |
147 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); | 148 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); |
148 | extern void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback); | 149 | extern void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback); |
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index d9c594bfaa..412a82d688 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c | |||
@@ -373,7 +373,7 @@ bool option_screen(struct settings_list *setting, | |||
373 | } | 373 | } |
374 | else return false; /* only int/bools can go here */ | 374 | else return false; /* only int/bools can go here */ |
375 | gui_synclist_init(&lists, value_setting_get_name_cb, | 375 | gui_synclist_init(&lists, value_setting_get_name_cb, |
376 | (void*)setting, false, 1); | 376 | (void*)setting, false, 1, NULL); |
377 | if (setting->lang_id == -1) | 377 | if (setting->lang_id == -1) |
378 | title = (char*)setting->cfg_vals; | 378 | title = (char*)setting->cfg_vals; |
379 | else | 379 | else |
@@ -460,6 +460,7 @@ bool option_screen(struct settings_list *setting, | |||
460 | gui_synclist_draw(&lists); | 460 | gui_synclist_draw(&lists); |
461 | /* talk the item */ | 461 | /* talk the item */ |
462 | gui_synclist_speak_item(&lists); | 462 | gui_synclist_speak_item(&lists); |
463 | gui_syncstatusbar_draw(&statusbars, false); | ||
463 | while (!done) | 464 | while (!done) |
464 | { | 465 | { |
465 | if (list_do_action(CONTEXT_LIST, TIMEOUT_BLOCK, | 466 | if (list_do_action(CONTEXT_LIST, TIMEOUT_BLOCK, |
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 8f264519ed..8a2e6bb99a 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -45,15 +45,13 @@ int viewport_get_nb_lines(struct viewport *vp) | |||
45 | 45 | ||
46 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) | 46 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) |
47 | { | 47 | { |
48 | vp->xmargin = 0; | ||
49 | vp->ymargin = 0; | ||
48 | vp->x = 0; | 50 | vp->x = 0; |
49 | vp->width = screens[screen].width; | 51 | vp->width = screens[screen].width; |
50 | 52 | ||
51 | vp->y = global_settings.statusbar?STATUSBAR_HEIGHT:0; | 53 | vp->y = global_settings.statusbar?STATUSBAR_HEIGHT:0; |
52 | vp->height = screens[screen].height - vp->y | 54 | vp->height = screens[screen].height - vp->y; |
53 | #ifdef HAS_BUTTONBAR | ||
54 | - (screens[screen].has_buttonbar?BUTTONBAR_HEIGHT:0) | ||
55 | #endif | ||
56 | ; | ||
57 | #ifdef HAVE_LCD_BITMAP | 55 | #ifdef HAVE_LCD_BITMAP |
58 | vp->drawmode = DRMODE_SOLID; | 56 | vp->drawmode = DRMODE_SOLID; |
59 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ | 57 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ |
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h index 93059a4069..1917b7b817 100644 --- a/apps/gui/viewport.h +++ b/apps/gui/viewport.h | |||
@@ -21,9 +21,6 @@ | |||
21 | #include "config.h" | 21 | #include "config.h" |
22 | #include "lcd.h" | 22 | #include "lcd.h" |
23 | #include "font.h" | 23 | #include "font.h" |
24 | #include "sprintf.h" | ||
25 | #include "string.h" | ||
26 | #include "settings.h" | ||
27 | #include "kernel.h" | 24 | #include "kernel.h" |
28 | #include "system.h" | 25 | #include "system.h" |
29 | #include "misc.h" | 26 | #include "misc.h" |
diff --git a/apps/menu.c b/apps/menu.c index 2c2e4ab0d0..d970ac8861 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include "bookmark.h" | 50 | #include "bookmark.h" |
51 | #include "gwps-common.h" /* for fade() */ | 51 | #include "gwps-common.h" /* for fade() */ |
52 | #include "audio.h" | 52 | #include "audio.h" |
53 | #include "viewport.h" | ||
53 | 54 | ||
54 | #ifdef HAVE_LCD_BITMAP | 55 | #ifdef HAVE_LCD_BITMAP |
55 | #include "icons.h" | 56 | #include "icons.h" |
@@ -164,7 +165,8 @@ static int menu_get_icon(int selected_item, void * data) | |||
164 | #endif | 165 | #endif |
165 | 166 | ||
166 | static void init_menu_lists(const struct menu_item_ex *menu, | 167 | static void init_menu_lists(const struct menu_item_ex *menu, |
167 | struct gui_synclist *lists, int selected, bool callback) | 168 | struct gui_synclist *lists, int selected, bool callback, |
169 | struct viewport parent[NB_SCREENS]) | ||
168 | { | 170 | { |
169 | int i, count = MENU_GET_COUNT(menu->flags); | 171 | int i, count = MENU_GET_COUNT(menu->flags); |
170 | int type = (menu->flags&MENU_TYPE_MASK); | 172 | int type = (menu->flags&MENU_TYPE_MASK); |
@@ -197,7 +199,7 @@ static void init_menu_lists(const struct menu_item_ex *menu, | |||
197 | } | 199 | } |
198 | current_submenus_menu = (struct menu_item_ex *)menu; | 200 | current_submenus_menu = (struct menu_item_ex *)menu; |
199 | 201 | ||
200 | gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1); | 202 | gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1, parent); |
201 | #ifdef HAVE_LCD_BITMAP | 203 | #ifdef HAVE_LCD_BITMAP |
202 | if (menu->callback_and_desc->icon_id == Icon_NOICON) | 204 | if (menu->callback_and_desc->icon_id == Icon_NOICON) |
203 | icon = Icon_Submenu_Entered; | 205 | icon = Icon_Submenu_Entered; |
@@ -275,6 +277,29 @@ static int talk_menu_item(int selected_item, void *data) | |||
275 | } | 277 | } |
276 | return 0; | 278 | return 0; |
277 | } | 279 | } |
280 | /* this is used to reload the default menu viewports when the | ||
281 | theme changes. nothing happens if the menu is using a supplied parent vp */ | ||
282 | void init_default_menu_viewports(struct viewport parent[NB_SCREENS], bool hide_bars) | ||
283 | { | ||
284 | int i; | ||
285 | FOR_NB_SCREENS(i) | ||
286 | { | ||
287 | viewport_set_defaults(&parent[i], i); | ||
288 | /* viewport_set_defaults() fixes the vp for the bars, so resize */ | ||
289 | if (hide_bars) | ||
290 | { | ||
291 | if (global_settings.statusbar) | ||
292 | { | ||
293 | parent[i].y -= STATUSBAR_HEIGHT; | ||
294 | parent[i].height += STATUSBAR_HEIGHT; | ||
295 | } | ||
296 | } | ||
297 | } | ||
298 | #ifdef HAS_BUTTONBAR | ||
299 | if (!hide_bars) | ||
300 | parent[0].height -= BUTTONBAR_HEIGHT; | ||
301 | #endif | ||
302 | } | ||
278 | 303 | ||
279 | bool do_setting_from_menu(const struct menu_item_ex *temp) | 304 | bool do_setting_from_menu(const struct menu_item_ex *temp) |
280 | { | 305 | { |
@@ -318,42 +343,71 @@ bool do_setting_from_menu(const struct menu_item_ex *temp) | |||
318 | } | 343 | } |
319 | 344 | ||
320 | /* display a menu */ | 345 | /* display a menu */ |
321 | int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | 346 | int do_menu(const struct menu_item_ex *start_menu, int *start_selected, |
347 | struct viewport parent[NB_SCREENS], bool hide_bars) | ||
322 | { | 348 | { |
323 | int selected = start_selected? *start_selected : 0; | 349 | int selected = start_selected? *start_selected : 0; |
324 | int action; | 350 | int action; |
325 | struct gui_synclist lists; | 351 | struct gui_synclist lists; |
326 | const struct menu_item_ex *temp, *menu; | 352 | const struct menu_item_ex *temp, *menu; |
327 | int ret = 0; | 353 | int ret = 0, i; |
328 | bool redraw_lists; | 354 | bool redraw_lists; |
329 | #ifdef HAS_BUTTONBAR | 355 | |
330 | struct gui_buttonbar buttonbar; | ||
331 | #endif | ||
332 | |||
333 | const struct menu_item_ex *menu_stack[MAX_MENUS]; | 356 | const struct menu_item_ex *menu_stack[MAX_MENUS]; |
334 | int menu_stack_selected_item[MAX_MENUS]; | 357 | int menu_stack_selected_item[MAX_MENUS]; |
335 | int stack_top = 0; | 358 | int stack_top = 0; |
336 | bool in_stringlist, done = false; | 359 | bool in_stringlist, done = false; |
337 | menu_callback_type menu_callback = NULL; | 360 | |
338 | if (start_menu == NULL) | 361 | struct viewport *vps, menu_vp[NB_SCREENS]; /* menu_vp will hopefully be phased out */ |
339 | menu = &main_menu_; | ||
340 | else menu = start_menu; | ||
341 | #ifdef HAS_BUTTONBAR | 362 | #ifdef HAS_BUTTONBAR |
363 | struct gui_buttonbar buttonbar; | ||
342 | gui_buttonbar_init(&buttonbar); | 364 | gui_buttonbar_init(&buttonbar); |
343 | gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) ); | 365 | gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) ); |
344 | gui_buttonbar_set(&buttonbar, "<<<", "", ""); | 366 | gui_buttonbar_set(&buttonbar, "<<<", "", ""); |
345 | gui_buttonbar_draw(&buttonbar); | ||
346 | #endif | 367 | #endif |
347 | init_menu_lists(menu,&lists,selected,true); | 368 | |
369 | menu_callback_type menu_callback = NULL; | ||
370 | if (start_menu == NULL) | ||
371 | menu = &main_menu_; | ||
372 | else menu = start_menu; | ||
373 | |||
374 | if (parent) | ||
375 | { | ||
376 | vps = parent; | ||
377 | /* if hide_bars == true we assume the viewport is correctly sized */ | ||
378 | } | ||
379 | else | ||
380 | { | ||
381 | vps = menu_vp; | ||
382 | init_default_menu_viewports(vps, hide_bars); | ||
383 | } | ||
384 | FOR_NB_SCREENS(i) | ||
385 | { | ||
386 | screens[i].set_viewport(&vps[i]); | ||
387 | screens[i].clear_viewport(); | ||
388 | screens[i].set_viewport(NULL); | ||
389 | } | ||
390 | init_menu_lists(menu, &lists, selected, true, vps); | ||
348 | in_stringlist = ((menu->flags&MENU_TYPE_MASK) == MT_RETURN_ID); | 391 | in_stringlist = ((menu->flags&MENU_TYPE_MASK) == MT_RETURN_ID); |
349 | 392 | ||
350 | /* load the callback, and only reload it if menu changes */ | 393 | /* load the callback, and only reload it if menu changes */ |
351 | get_menu_callback(menu, &menu_callback); | 394 | get_menu_callback(menu, &menu_callback); |
352 | 395 | ||
396 | |||
397 | #ifdef HAS_BUTTONBAR | ||
398 | if (!hide_bars) | ||
399 | { | ||
400 | gui_buttonbar_set(&buttonbar, "<<<", "", ""); | ||
401 | gui_buttonbar_draw(&buttonbar); | ||
402 | } | ||
403 | #endif | ||
353 | while (!done) | 404 | while (!done) |
354 | { | 405 | { |
355 | redraw_lists = false; | 406 | redraw_lists = false; |
356 | gui_syncstatusbar_draw(&statusbars, true); | 407 | if (!hide_bars) |
408 | { | ||
409 | gui_syncstatusbar_draw(&statusbars, true); | ||
410 | } | ||
357 | action = get_action(CONTEXT_MAINMENU, | 411 | action = get_action(CONTEXT_MAINMENU, |
358 | list_do_action_timeout(&lists, HZ)); | 412 | list_do_action_timeout(&lists, HZ)); |
359 | /* HZ so the status bar redraws corectly */ | 413 | /* HZ so the status bar redraws corectly */ |
@@ -430,7 +484,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
430 | done = true; | 484 | done = true; |
431 | else | 485 | else |
432 | init_menu_lists(menu, &lists, | 486 | init_menu_lists(menu, &lists, |
433 | menu_stack_selected_item[stack_top], false); | 487 | menu_stack_selected_item[stack_top], false, vps); |
434 | /* new menu, so reload the callback */ | 488 | /* new menu, so reload the callback */ |
435 | get_menu_callback(menu, &menu_callback); | 489 | get_menu_callback(menu, &menu_callback); |
436 | } | 490 | } |
@@ -444,8 +498,11 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
444 | { | 498 | { |
445 | int type; | 499 | int type; |
446 | #ifdef HAS_BUTTONBAR | 500 | #ifdef HAS_BUTTONBAR |
447 | gui_buttonbar_unset(&buttonbar); | 501 | if (!hide_bars) |
448 | gui_buttonbar_draw(&buttonbar); | 502 | { |
503 | gui_buttonbar_unset(&buttonbar); | ||
504 | gui_buttonbar_draw(&buttonbar); | ||
505 | } | ||
449 | #endif | 506 | #endif |
450 | selected = get_menu_selection(gui_synclist_get_sel_pos(&lists), menu); | 507 | selected = get_menu_selection(gui_synclist_get_sel_pos(&lists), menu); |
451 | temp = menu->submenus[selected]; | 508 | temp = menu->submenus[selected]; |
@@ -471,7 +528,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
471 | menu_stack[stack_top] = menu; | 528 | menu_stack[stack_top] = menu; |
472 | menu_stack_selected_item[stack_top] = selected; | 529 | menu_stack_selected_item[stack_top] = selected; |
473 | stack_top++; | 530 | stack_top++; |
474 | init_menu_lists(temp, &lists, 0, true); | 531 | init_menu_lists(temp, &lists, 0, true, vps); |
475 | redraw_lists = false; /* above does the redraw */ | 532 | redraw_lists = false; /* above does the redraw */ |
476 | menu = temp; | 533 | menu = temp; |
477 | } | 534 | } |
@@ -491,8 +548,9 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
491 | if (temp->flags&MENU_HAS_DESC && | 548 | if (temp->flags&MENU_HAS_DESC && |
492 | temp->callback_and_desc->desc == ID2P(LANG_LANGUAGE)) | 549 | temp->callback_and_desc->desc == ID2P(LANG_LANGUAGE)) |
493 | { | 550 | { |
494 | init_menu_lists(menu, &lists, selected, true); | 551 | init_menu_lists(menu, &lists, selected, true, vps); |
495 | } | 552 | } |
553 | init_default_menu_viewports(menu_vp, hide_bars); | ||
496 | 554 | ||
497 | if (temp->flags&MENU_FUNC_CHECK_RETVAL) | 555 | if (temp->flags&MENU_FUNC_CHECK_RETVAL) |
498 | { | 556 | { |
@@ -509,7 +567,8 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
509 | { | 567 | { |
510 | if (do_setting_from_menu(temp)) | 568 | if (do_setting_from_menu(temp)) |
511 | { | 569 | { |
512 | init_menu_lists(menu, &lists, selected, true); | 570 | init_default_menu_viewports(menu_vp, hide_bars); |
571 | init_menu_lists(menu, &lists, selected, true,vps); | ||
513 | redraw_lists = false; /* above does the redraw */ | 572 | redraw_lists = false; /* above does the redraw */ |
514 | } | 573 | } |
515 | break; | 574 | break; |
@@ -526,7 +585,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
526 | menu_stack_selected_item[stack_top] = selected; | 585 | menu_stack_selected_item[stack_top] = selected; |
527 | stack_top++; | 586 | stack_top++; |
528 | menu = temp; | 587 | menu = temp; |
529 | init_menu_lists(menu,&lists,0,false); | 588 | init_menu_lists(menu,&lists,0,false, vps); |
530 | redraw_lists = false; /* above does the redraw */ | 589 | redraw_lists = false; /* above does the redraw */ |
531 | in_stringlist = true; | 590 | in_stringlist = true; |
532 | } | 591 | } |
@@ -542,7 +601,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
542 | menu_callback(ACTION_EXIT_MENUITEM,temp); | 601 | menu_callback(ACTION_EXIT_MENUITEM,temp); |
543 | } | 602 | } |
544 | if (current_submenus_menu != menu) | 603 | if (current_submenus_menu != menu) |
545 | init_menu_lists(menu,&lists,selected,true); | 604 | init_menu_lists(menu,&lists,selected,true,vps); |
546 | /* callback was changed, so reload the menu's callback */ | 605 | /* callback was changed, so reload the menu's callback */ |
547 | get_menu_callback(menu, &menu_callback); | 606 | get_menu_callback(menu, &menu_callback); |
548 | if ((menu->flags&MENU_EXITAFTERTHISMENU) && | 607 | if ((menu->flags&MENU_EXITAFTERTHISMENU) && |
@@ -552,8 +611,11 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
552 | break; | 611 | break; |
553 | } | 612 | } |
554 | #ifdef HAS_BUTTONBAR | 613 | #ifdef HAS_BUTTONBAR |
555 | gui_buttonbar_set(&buttonbar, "<<<", "", ""); | 614 | if (!hide_bars) |
556 | gui_buttonbar_draw(&buttonbar); | 615 | { |
616 | gui_buttonbar_set(&buttonbar, "<<<", "", ""); | ||
617 | gui_buttonbar_draw(&buttonbar); | ||
618 | } | ||
557 | #endif | 619 | #endif |
558 | } | 620 | } |
559 | else if(default_event_handler(action) == SYS_USB_CONNECTED) | 621 | else if(default_event_handler(action) == SYS_USB_CONNECTED) |
@@ -575,7 +637,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) | |||
575 | if (stack_top > 0) | 637 | if (stack_top > 0) |
576 | { | 638 | { |
577 | menu = menu_stack[0]; | 639 | menu = menu_stack[0]; |
578 | init_menu_lists(menu,&lists,menu_stack_selected_item[0],true); | 640 | init_menu_lists(menu,&lists,menu_stack_selected_item[0],true, vps); |
579 | } | 641 | } |
580 | *start_selected = get_menu_selection( | 642 | *start_selected = get_menu_selection( |
581 | gui_synclist_get_sel_pos(&lists), menu); | 643 | gui_synclist_get_sel_pos(&lists), menu); |
diff --git a/apps/menu.h b/apps/menu.h index d3f7099267..1b4ffd5cd4 100644 --- a/apps/menu.h +++ b/apps/menu.h | |||
@@ -117,7 +117,8 @@ bool do_setting_from_menu(const struct menu_item_ex *temp); | |||
117 | This is always set, even if the menu was cancelled. | 117 | This is always set, even if the menu was cancelled. |
118 | If NULL it is ignored and the firs item starts selected | 118 | If NULL it is ignored and the firs item starts selected |
119 | */ | 119 | */ |
120 | int do_menu(const struct menu_item_ex *menu, int *start_selected); | 120 | int do_menu(const struct menu_item_ex *menu, int *start_selected, |
121 | struct viewport parent[NB_SCREENS], bool hide_bars); | ||
121 | 122 | ||
122 | /* In all the following macros the argument names are as follows: | 123 | /* In all the following macros the argument names are as follows: |
123 | - name: The name for the variable (so it can be used in a MAKE_MENU() | 124 | - name: The name for the variable (so it can be used in a MAKE_MENU() |
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c index 2337b32e6d..9b8c2e3e6b 100644 --- a/apps/menus/eq_menu.c +++ b/apps/menus/eq_menu.c | |||
@@ -199,7 +199,7 @@ int do_center_band_menu(void* param) | |||
199 | menu.flags = MT_MENU|(3<<MENU_COUNT_SHIFT)|MENU_HAS_DESC; | 199 | menu.flags = MT_MENU|(3<<MENU_COUNT_SHIFT)|MENU_HAS_DESC; |
200 | menu.submenus = band_items[band-1]; | 200 | menu.submenus = band_items[band-1]; |
201 | menu.callback_and_desc = &cb_and_desc; | 201 | menu.callback_and_desc = &cb_and_desc; |
202 | do_menu(&menu, NULL); | 202 | do_menu(&menu, NULL, NULL, false); |
203 | return 0; | 203 | return 0; |
204 | } | 204 | } |
205 | MAKE_MENU(band_0_menu, ID2P(LANG_EQUALIZER_BAND_LOW_SHELF), NULL, | 205 | MAKE_MENU(band_0_menu, ID2P(LANG_EQUALIZER_BAND_LOW_SHELF), NULL, |
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c index 13368bd3df..9d7379a6fd 100644 --- a/apps/menus/recording_menu.c +++ b/apps/menus/recording_menu.c | |||
@@ -901,7 +901,7 @@ bool recording_menu(bool no_source) | |||
901 | { | 901 | { |
902 | bool retval; | 902 | bool retval; |
903 | no_source_in_menu = no_source; | 903 | no_source_in_menu = no_source; |
904 | retval = do_menu(&recording_settings_menu, NULL) == MENU_ATTACHED_USB; | 904 | retval = do_menu(&recording_settings_menu, NULL, NULL, false) == MENU_ATTACHED_USB; |
905 | no_source_in_menu = false; /* always fall back to the default */ | 905 | no_source_in_menu = false; /* always fall back to the default */ |
906 | return retval; | 906 | return retval; |
907 | }; | 907 | }; |
diff --git a/apps/onplay.c b/apps/onplay.c index 439220c711..ac772aca0b 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -1197,7 +1197,7 @@ int onplay(char* file, int attr, int from) | |||
1197 | menu = &wps_onplay_menu; | 1197 | menu = &wps_onplay_menu; |
1198 | else | 1198 | else |
1199 | menu = &tree_onplay_menu; | 1199 | menu = &tree_onplay_menu; |
1200 | switch (do_menu(menu, NULL)) | 1200 | switch (do_menu(menu, NULL, NULL, false)) |
1201 | { | 1201 | { |
1202 | case GO_TO_WPS: | 1202 | case GO_TO_WPS: |
1203 | return ONPLAY_START_PLAY; | 1203 | return ONPLAY_START_PLAY; |
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c index c68371af49..af65353b67 100644 --- a/apps/playlist_catalog.c +++ b/apps/playlist_catalog.c | |||
@@ -234,7 +234,7 @@ static int display_playlists(char* playlist, bool view) | |||
234 | playlist = temp_buf; | 234 | playlist = temp_buf; |
235 | 235 | ||
236 | gui_synclist_init(&playlist_lists, playlist_callback_name, playlists, | 236 | gui_synclist_init(&playlist_lists, playlist_callback_name, playlists, |
237 | false, 1); | 237 | false, 1, NULL); |
238 | gui_synclist_set_nb_items(&playlist_lists, num_playlists); | 238 | gui_synclist_set_nb_items(&playlist_lists, num_playlists); |
239 | gui_synclist_draw(&playlist_lists); | 239 | gui_synclist_draw(&playlist_lists); |
240 | 240 | ||
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index db9c974ee8..c34957b332 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -438,7 +438,7 @@ static int onplay_menu(int index) | |||
438 | ID2P(LANG_CATALOG_ADD_TO), ID2P(LANG_CATALOG_ADD_TO_NEW)); | 438 | ID2P(LANG_CATALOG_ADD_TO), ID2P(LANG_CATALOG_ADD_TO_NEW)); |
439 | bool current = (current_track->index == viewer.current_playing_track); | 439 | bool current = (current_track->index == viewer.current_playing_track); |
440 | 440 | ||
441 | result = do_menu(&menu_items, NULL); | 441 | result = do_menu(&menu_items, NULL, NULL, false); |
442 | if (result == MENU_ATTACHED_USB) | 442 | if (result == MENU_ATTACHED_USB) |
443 | { | 443 | { |
444 | ret = -1; | 444 | ret = -1; |
@@ -505,7 +505,7 @@ MAKE_MENU(viewer_settings_menu, ID2P(LANG_PLAYLISTVIEWER_SETTINGS), | |||
505 | &show_icons, &show_indices, &track_display, &save_playlist_item); | 505 | &show_icons, &show_indices, &track_display, &save_playlist_item); |
506 | static bool viewer_menu(void) | 506 | static bool viewer_menu(void) |
507 | { | 507 | { |
508 | return do_menu(&viewer_settings_menu, NULL) == MENU_ATTACHED_USB; | 508 | return do_menu(&viewer_settings_menu, NULL, NULL, false) == MENU_ATTACHED_USB; |
509 | } | 509 | } |
510 | 510 | ||
511 | /* Save playlist to disk */ | 511 | /* Save playlist to disk */ |
@@ -589,7 +589,8 @@ bool playlist_viewer_ex(char* filename) | |||
589 | if (!playlist_viewer_init(&viewer, filename, false)) | 589 | if (!playlist_viewer_init(&viewer, filename, false)) |
590 | goto exit; | 590 | goto exit; |
591 | 591 | ||
592 | gui_synclist_init(&playlist_lists, playlist_callback_name, &viewer, false, 1); | 592 | gui_synclist_init(&playlist_lists, playlist_callback_name, |
593 | &viewer, false, 1, NULL); | ||
593 | gui_synclist_set_icon_callback(&playlist_lists, | 594 | gui_synclist_set_icon_callback(&playlist_lists, |
594 | global_settings.playlist_viewer_icons? | 595 | global_settings.playlist_viewer_icons? |
595 | &playlist_callback_icons:NULL); | 596 | &playlist_callback_icons:NULL); |
@@ -798,7 +799,7 @@ bool search_playlist(void) | |||
798 | } | 799 | } |
799 | backlight_on(); | 800 | backlight_on(); |
800 | gui_synclist_init(&playlist_lists, playlist_search_callback_name, | 801 | gui_synclist_init(&playlist_lists, playlist_search_callback_name, |
801 | found_indicies, false, 1); | 802 | found_indicies, false, 1, NULL); |
802 | gui_synclist_set_icon_callback(&playlist_lists, NULL); | 803 | gui_synclist_set_icon_callback(&playlist_lists, NULL); |
803 | gui_synclist_set_nb_items(&playlist_lists, found_indicies_count); | 804 | gui_synclist_set_nb_items(&playlist_lists, found_indicies_count); |
804 | gui_synclist_select_item(&playlist_lists, 0); | 805 | gui_synclist_select_item(&playlist_lists, 0); |
diff --git a/apps/plugin.c b/apps/plugin.c index db9bd2574a..b7037139b5 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -193,7 +193,8 @@ static const struct plugin_api rockbox_api = { | |||
193 | lcd_remote_bitmap_part, | 193 | lcd_remote_bitmap_part, |
194 | lcd_remote_bitmap, | 194 | lcd_remote_bitmap, |
195 | #endif | 195 | #endif |
196 | 196 | viewport_set_defaults, | |
197 | |||
197 | /* list */ | 198 | /* list */ |
198 | gui_synclist_init, | 199 | gui_synclist_init, |
199 | gui_synclist_set_nb_items, | 200 | gui_synclist_set_nb_items, |
diff --git a/apps/plugin.h b/apps/plugin.h index 1283751fe9..66ed5fdbb2 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -80,6 +80,7 @@ | |||
80 | #include "color_picker.h" | 80 | #include "color_picker.h" |
81 | #include "buffering.h" | 81 | #include "buffering.h" |
82 | #include "tagcache.h" | 82 | #include "tagcache.h" |
83 | #include "viewport.h" | ||
83 | 84 | ||
84 | #ifdef HAVE_ALBUMART | 85 | #ifdef HAVE_ALBUMART |
85 | #include "albumart.h" | 86 | #include "albumart.h" |
@@ -119,12 +120,12 @@ | |||
119 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 120 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
120 | 121 | ||
121 | /* increase this every time the api struct changes */ | 122 | /* increase this every time the api struct changes */ |
122 | #define PLUGIN_API_VERSION 102 | 123 | #define PLUGIN_API_VERSION 103 |
123 | 124 | ||
124 | /* update this to latest version if a change to the api struct breaks | 125 | /* update this to latest version if a change to the api struct breaks |
125 | backwards compatibility (and please take the opportunity to sort in any | 126 | backwards compatibility (and please take the opportunity to sort in any |
126 | new function which are "waiting" at the end of the function table) */ | 127 | new function which are "waiting" at the end of the function table) */ |
127 | #define PLUGIN_MIN_API_VERSION 102 | 128 | #define PLUGIN_MIN_API_VERSION 103 |
128 | 129 | ||
129 | /* plugin return codes */ | 130 | /* plugin return codes */ |
130 | enum plugin_status { | 131 | enum plugin_status { |
@@ -285,10 +286,12 @@ struct plugin_api { | |||
285 | void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width, | 286 | void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width, |
286 | int height); | 287 | int height); |
287 | #endif | 288 | #endif |
289 | void (*viewport_set_defaults)(struct viewport *vp, enum screen_type screen); | ||
288 | /* list */ | 290 | /* list */ |
289 | void (*gui_synclist_init)(struct gui_synclist * lists, | 291 | void (*gui_synclist_init)(struct gui_synclist * lists, |
290 | list_get_name callback_get_item_name,void * data, | 292 | list_get_name callback_get_item_name,void * data, |
291 | bool scroll_all,int selected_size); | 293 | bool scroll_all,int selected_size, |
294 | struct viewport parent[NB_SCREENS]); | ||
292 | void (*gui_synclist_set_nb_items)(struct gui_synclist * lists, int nb_items); | 295 | void (*gui_synclist_set_nb_items)(struct gui_synclist * lists, int nb_items); |
293 | void (*gui_synclist_set_icon_callback)(struct gui_synclist * lists, list_get_icon icon_callback); | 296 | void (*gui_synclist_set_icon_callback)(struct gui_synclist * lists, list_get_icon icon_callback); |
294 | int (*gui_synclist_get_nb_items)(struct gui_synclist * lists); | 297 | int (*gui_synclist_get_nb_items)(struct gui_synclist * lists); |
@@ -555,7 +558,8 @@ struct plugin_api { | |||
555 | #endif | 558 | #endif |
556 | 559 | ||
557 | /* menu */ | 560 | /* menu */ |
558 | int (*do_menu)(const struct menu_item_ex *menu, int *start_selected); | 561 | int (*do_menu)(const struct menu_item_ex *menu, int *start_selected, |
562 | struct viewport parent[NB_SCREENS], bool hide_bars); | ||
559 | 563 | ||
560 | /* scroll bar */ | 564 | /* scroll bar */ |
561 | struct gui_syncstatusbar *statusbars; | 565 | struct gui_syncstatusbar *statusbars; |
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 920def82d5..4129a3c1fb 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c | |||
@@ -393,7 +393,7 @@ static int cb_menu_viewer(void) | |||
393 | 393 | ||
394 | while(!menu_quit) | 394 | while(!menu_quit) |
395 | { | 395 | { |
396 | switch(rb->do_menu(&menu, &selection)) | 396 | switch(rb->do_menu(&menu, &selection, NULL, false)) |
397 | { | 397 | { |
398 | case 0: | 398 | case 0: |
399 | menu_quit = true; | 399 | menu_quit = true; |
@@ -595,7 +595,7 @@ static int cb_menu(void) | |||
595 | 595 | ||
596 | while(!menu_quit) | 596 | while(!menu_quit) |
597 | { | 597 | { |
598 | switch(rb->do_menu(&menu, &selection)) | 598 | switch(rb->do_menu(&menu, &selection, NULL, false)) |
599 | { | 599 | { |
600 | case 0: | 600 | case 0: |
601 | menu_quit = true; | 601 | menu_quit = true; |
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c index b3e71de77f..6d18986f95 100644 --- a/apps/plugins/chessbox/chessbox_pgn.c +++ b/apps/plugins/chessbox/chessbox_pgn.c | |||
@@ -628,7 +628,7 @@ struct pgn_game_node* pgn_show_game_list(struct plugin_api* api, | |||
628 | } | 628 | } |
629 | 629 | ||
630 | 630 | ||
631 | rb->gui_synclist_init(&games_list, &get_game_text, first_game, false, 1); | 631 | rb->gui_synclist_init(&games_list, &get_game_text, first_game, false, 1, NULL); |
632 | rb->gui_synclist_set_title(&games_list, "Games", NOICON); | 632 | rb->gui_synclist_set_title(&games_list, "Games", NOICON); |
633 | rb->gui_synclist_set_icon_callback(&games_list, NULL); | 633 | rb->gui_synclist_set_icon_callback(&games_list, NULL); |
634 | rb->gui_synclist_set_nb_items(&games_list, i); | 634 | rb->gui_synclist_set_nb_items(&games_list, i); |
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index f359023678..71f62f44cc 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c | |||
@@ -684,7 +684,7 @@ static int chopMenu(int menunum) | |||
684 | rb->lcd_clear_display(); | 684 | rb->lcd_clear_display(); |
685 | 685 | ||
686 | while (!menu_quit) { | 686 | while (!menu_quit) { |
687 | switch(rb->do_menu(&menu, &result)) | 687 | switch(rb->do_menu(&menu, &result, NULL, false)) |
688 | { | 688 | { |
689 | case 0: /* Start New Game */ | 689 | case 0: /* Start New Game */ |
690 | menu_quit=true; | 690 | menu_quit=true; |
diff --git a/apps/plugins/clock/clock_menu.c b/apps/plugins/clock/clock_menu.c index 4cbf46af28..a515e87fc3 100644 --- a/apps/plugins/clock/clock_menu.c +++ b/apps/plugins/clock/clock_menu.c | |||
@@ -57,7 +57,7 @@ static const struct opt_items hour_format_text[] = { | |||
57 | bool menu_mode_selector(void){ | 57 | bool menu_mode_selector(void){ |
58 | MENUITEM_STRINGLIST(menu,"Mode Selector",NULL, "Analog", | 58 | MENUITEM_STRINGLIST(menu,"Mode Selector",NULL, "Analog", |
59 | "Digital", "Binary"); | 59 | "Digital", "Binary"); |
60 | if(rb->do_menu(&menu, &clock_settings.mode) >=0) | 60 | if(rb->do_menu(&menu, &clock_settings.mode, NULL, false) >=0) |
61 | return(true); | 61 | return(true); |
62 | return(false); | 62 | return(false); |
63 | } | 63 | } |
@@ -73,7 +73,7 @@ void menu_analog_settings(void) | |||
73 | "Show Second Hand","Show Border"); | 73 | "Show Second Hand","Show Border"); |
74 | 74 | ||
75 | while(result>=0){ | 75 | while(result>=0){ |
76 | result=rb->do_menu(&menu, &selection); | 76 | result=rb->do_menu(&menu, &selection, NULL, false); |
77 | switch(result){ | 77 | switch(result){ |
78 | case 0: | 78 | case 0: |
79 | rb->set_option("Show Date", &clock_settings.analog.show_date, | 79 | rb->set_option("Show Date", &clock_settings.analog.show_date, |
@@ -103,7 +103,7 @@ void menu_digital_settings(void){ | |||
103 | "Blinking Colon"); | 103 | "Blinking Colon"); |
104 | 104 | ||
105 | while(result>=0){ | 105 | while(result>=0){ |
106 | result=rb->do_menu(&menu, &selection); | 106 | result=rb->do_menu(&menu, &selection, NULL, false); |
107 | switch(result){ | 107 | switch(result){ |
108 | case 0: | 108 | case 0: |
109 | rb->set_option("Show Seconds", | 109 | rb->set_option("Show Seconds", |
@@ -148,7 +148,7 @@ void menu_general_settings(void){ | |||
148 | "Idle Poweroff (temporary)"); | 148 | "Idle Poweroff (temporary)"); |
149 | 149 | ||
150 | while(result>=0){ | 150 | while(result>=0){ |
151 | result=rb->do_menu(&menu, &selection); | 151 | result=rb->do_menu(&menu, &selection, NULL, false); |
152 | switch(result){ | 152 | switch(result){ |
153 | case 0: | 153 | case 0: |
154 | rb->set_option("Hour format", | 154 | rb->set_option("Hour format", |
@@ -211,7 +211,7 @@ bool main_menu(void){ | |||
211 | "Mode Settings","General Settings","Quit"); | 211 | "Mode Settings","General Settings","Quit"); |
212 | 212 | ||
213 | while(!done){ | 213 | while(!done){ |
214 | switch(rb->do_menu(&menu, &selection)){ | 214 | switch(rb->do_menu(&menu, &selection, NULL, false)){ |
215 | case 0: | 215 | case 0: |
216 | done = true; | 216 | done = true; |
217 | break; | 217 | break; |
diff --git a/apps/plugins/dice.c b/apps/plugins/dice.c index 84bd3105dc..7688d91a07 100644 --- a/apps/plugins/dice.c +++ b/apps/plugins/dice.c | |||
@@ -177,7 +177,7 @@ bool dice_menu(struct dices * dice) { | |||
177 | 177 | ||
178 | 178 | ||
179 | while (!menu_quit) { | 179 | while (!menu_quit) { |
180 | switch(rb->do_menu(&menu, &selection)){ | 180 | switch(rb->do_menu(&menu, &selection, NULL, false)){ |
181 | case 0: | 181 | case 0: |
182 | menu_quit = true; | 182 | menu_quit = true; |
183 | result = true; | 183 | result = true; |
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c index b32dce2737..c06afeac70 100644 --- a/apps/plugins/disktidy.c +++ b/apps/plugins/disktidy.c | |||
@@ -369,7 +369,7 @@ int tidy_lcd_menu(void) | |||
369 | 369 | ||
370 | while (!menu_quit) | 370 | while (!menu_quit) |
371 | { | 371 | { |
372 | switch(rb->do_menu(&menu, &selection)) | 372 | switch(rb->do_menu(&menu, &selection, NULL, false)) |
373 | { | 373 | { |
374 | 374 | ||
375 | case 0: | 375 | case 0: |
diff --git a/apps/plugins/lib/oldmenuapi.c b/apps/plugins/lib/oldmenuapi.c index 07681a0b18..c21e55f5fc 100644 --- a/apps/plugins/lib/oldmenuapi.c +++ b/apps/plugins/lib/oldmenuapi.c | |||
@@ -74,7 +74,7 @@ int menu_init(struct plugin_api *api, const struct menu_item* mitems, | |||
74 | return -1; | 74 | return -1; |
75 | menus[menu].items = (struct menu_item*)mitems; /* de-const */ | 75 | menus[menu].items = (struct menu_item*)mitems; /* de-const */ |
76 | rb->gui_synclist_init(&(menus[menu].synclist), | 76 | rb->gui_synclist_init(&(menus[menu].synclist), |
77 | &menu_get_itemname, &menus[menu], false, 1); | 77 | &menu_get_itemname, &menus[menu], false, 1, NULL); |
78 | rb->gui_synclist_set_icon_callback(&(menus[menu].synclist), NULL); | 78 | rb->gui_synclist_set_icon_callback(&(menus[menu].synclist), NULL); |
79 | rb->gui_synclist_set_nb_items(&(menus[menu].synclist), count); | 79 | rb->gui_synclist_set_nb_items(&(menus[menu].synclist), count); |
80 | menus[menu].callback = callback; | 80 | menus[menu].callback = callback; |
diff --git a/apps/plugins/lib/playback_control.c b/apps/plugins/lib/playback_control.c index bc8f1c735d..2bed02e7b0 100644 --- a/apps/plugins/lib/playback_control.c +++ b/apps/plugins/lib/playback_control.c | |||
@@ -111,5 +111,5 @@ void playback_control_init(struct plugin_api* newapi) | |||
111 | bool playback_control(struct plugin_api* newapi) | 111 | bool playback_control(struct plugin_api* newapi) |
112 | { | 112 | { |
113 | api = newapi; | 113 | api = newapi; |
114 | return api->do_menu(&playback_control_menu, NULL) == MENU_ATTACHED_USB; | 114 | return api->do_menu(&playback_control_menu, NULL, NULL, false) == MENU_ATTACHED_USB; |
115 | } | 115 | } |
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index 0f3de2fb74..5066844347 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c | |||
@@ -498,7 +498,7 @@ enum minesweeper_status menu( void ) | |||
498 | 498 | ||
499 | while( !menu_quit ) | 499 | while( !menu_quit ) |
500 | { | 500 | { |
501 | switch( rb->do_menu( &menu, &selection ) ) | 501 | switch( rb->do_menu( &menu, &selection, NULL, false ) ) |
502 | { | 502 | { |
503 | case 0: | 503 | case 0: |
504 | result = MINESWEEPER_WIN; /* start playing */ | 504 | result = MINESWEEPER_WIN; /* start playing */ |
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c index 6e88138efc..02f0522f53 100644 --- a/apps/plugins/pictureflow.c +++ b/apps/plugins/pictureflow.c | |||
@@ -1541,7 +1541,7 @@ int settings_menu(void) { | |||
1541 | "Rebuild cache"); | 1541 | "Rebuild cache"); |
1542 | 1542 | ||
1543 | do { | 1543 | do { |
1544 | selection=rb->do_menu(&settings_menu,&selection); | 1544 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); |
1545 | switch(selection) { | 1545 | switch(selection) { |
1546 | case 0: | 1546 | case 0: |
1547 | rb->set_bool("Show FPS", &show_fps); | 1547 | rb->set_bool("Show FPS", &show_fps); |
@@ -1604,7 +1604,7 @@ int main_menu(void) | |||
1604 | "Settings", "Return", "Quit"); | 1604 | "Settings", "Return", "Quit"); |
1605 | 1605 | ||
1606 | while (1) { | 1606 | while (1) { |
1607 | switch (rb->do_menu(&main_menu,&selection)) { | 1607 | switch (rb->do_menu(&main_menu,&selection, NULL, false)) { |
1608 | case 0: | 1608 | case 0: |
1609 | result = settings_menu(); | 1609 | result = settings_menu(); |
1610 | if ( result != 0 ) return result; | 1610 | if ( result != 0 ) return result; |
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index 0811b00ed3..8b1f6ee636 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c | |||
@@ -305,7 +305,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) | |||
305 | prev_show_statusbar = rb->global_settings->statusbar; | 305 | prev_show_statusbar = rb->global_settings->statusbar; |
306 | rb->global_settings->statusbar = false; | 306 | rb->global_settings->statusbar = false; |
307 | 307 | ||
308 | rb->gui_synclist_init(&properties_lists, &get_props, file, false, 1); | 308 | rb->gui_synclist_init(&properties_lists, &get_props, file, false, 1, NULL); |
309 | rb->gui_synclist_set_title(&properties_lists, its_a_dir ? | 309 | rb->gui_synclist_set_title(&properties_lists, its_a_dir ? |
310 | "Directory properties" : | 310 | "Directory properties" : |
311 | "File properties", NOICON); | 311 | "File properties", NOICON); |
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index 656daeaaf8..af415073b3 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c | |||
@@ -278,7 +278,7 @@ void edit_list(void) | |||
278 | list = (struct file_format *)buffer; | 278 | list = (struct file_format *)buffer; |
279 | dirs_count = list->count; | 279 | dirs_count = list->count; |
280 | 280 | ||
281 | rb->gui_synclist_init(&lists,list_get_name_cb,0, false, 1); | 281 | rb->gui_synclist_init(&lists,list_get_name_cb,0, false, 1, NULL); |
282 | rb->gui_synclist_set_icon_callback(&lists,NULL); | 282 | rb->gui_synclist_set_icon_callback(&lists,NULL); |
283 | rb->gui_synclist_set_nb_items(&lists,list->count); | 283 | rb->gui_synclist_set_nb_items(&lists,list->count); |
284 | rb->gui_synclist_limit_scroll(&lists,true); | 284 | rb->gui_synclist_limit_scroll(&lists,true); |
diff --git a/apps/plugins/shortcuts/shortcuts_view.c b/apps/plugins/shortcuts/shortcuts_view.c index 4ef1bbc816..503db56d30 100644 --- a/apps/plugins/shortcuts/shortcuts_view.c +++ b/apps/plugins/shortcuts/shortcuts_view.c | |||
@@ -117,7 +117,7 @@ bool list_sc(bool is_editable) | |||
117 | 117 | ||
118 | /* Setup the GUI list object, draw it to the screen, | 118 | /* Setup the GUI list object, draw it to the screen, |
119 | * and then handle the user input to it */ | 119 | * and then handle the user input to it */ |
120 | rb->gui_synclist_init(&gui_sc, &build_sc_list, &sc_file, false, 1); | 120 | rb->gui_synclist_init(&gui_sc, &build_sc_list, &sc_file, false, 1, NULL); |
121 | rb->gui_synclist_set_title(&gui_sc, | 121 | rb->gui_synclist_set_title(&gui_sc, |
122 | (is_editable?"Shortcuts (editable)":"Shortcuts (sealed)"), NOICON); | 122 | (is_editable?"Shortcuts (editable)":"Shortcuts (sealed)"), NOICON); |
123 | rb->gui_synclist_set_nb_items(&gui_sc, sc_file.entry_cnt); | 123 | rb->gui_synclist_set_nb_items(&gui_sc, sc_file.entry_cnt); |
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index 51d5f5a9e8..fffb70c2bc 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c | |||
@@ -396,7 +396,7 @@ void game_init(void) { | |||
396 | "Quit"); | 396 | "Quit"); |
397 | 397 | ||
398 | while (!menu_quit) { | 398 | while (!menu_quit) { |
399 | switch(rb->do_menu(&menu, &selection)) | 399 | switch(rb->do_menu(&menu, &selection, NULL, false)) |
400 | { | 400 | { |
401 | case 0: | 401 | case 0: |
402 | menu_quit = true; /* start playing */ | 402 | menu_quit = true; /* start playing */ |
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index d4e33f163c..8b1fe508ce 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c | |||
@@ -1173,7 +1173,7 @@ static int sokoban_menu(void) | |||
1173 | 1173 | ||
1174 | do { | 1174 | do { |
1175 | menu_quit = true; | 1175 | menu_quit = true; |
1176 | selection = rb->do_menu(&menu, &start_selected); | 1176 | selection = rb->do_menu(&menu, &start_selected, NULL, false); |
1177 | 1177 | ||
1178 | switch (selection) { | 1178 | switch (selection) { |
1179 | case 0: /* Resume */ | 1179 | case 0: /* Resume */ |
diff --git a/apps/plugins/star.c b/apps/plugins/star.c index efa8d4e6af..c2546d2385 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c | |||
@@ -951,16 +951,28 @@ static int star_menu(void) | |||
951 | { | 951 | { |
952 | int selection, level=1; | 952 | int selection, level=1; |
953 | bool menu_quit = false; | 953 | bool menu_quit = false; |
954 | 954 | struct viewport vp[NB_SCREENS]; | |
955 | /* get the size of char */ | 955 | /* get the size of char */ |
956 | rb->lcd_getstringsize("a", &char_width, &char_height); | 956 | rb->lcd_getstringsize("a", &char_width, &char_height); |
957 | 957 | ||
958 | MENUITEM_STRINGLIST(menu,"Star Menu",NULL,"Play","Choose Level", | 958 | MENUITEM_STRINGLIST(menu,"Star Menu",NULL,"Play","Choose Level", |
959 | "Information","Keys","Quit"); | 959 | "Information","Keys","Quit"); |
960 | 960 | FOR_NB_SCREENS(selection) | |
961 | { | ||
962 | rb->viewport_set_defaults(&vp[selection], selection); | ||
963 | /* we are hiding the statusbar so fix the height also */ | ||
964 | vp->y = 0; vp->height = rb->screens[selection]->height; | ||
965 | #if LCD_DEPTH > 1 | ||
966 | if (rb->screens[selection]->depth > 1) | ||
967 | { | ||
968 | vp->bg_pattern = LCD_BLACK; | ||
969 | vp->fg_pattern = LCD_WHITE; | ||
970 | } | ||
971 | #endif | ||
972 | } | ||
961 | while(!menu_quit) | 973 | while(!menu_quit) |
962 | { | 974 | { |
963 | switch(rb->do_menu(&menu, &selection)) | 975 | switch(rb->do_menu(&menu, &selection, vp, true)) |
964 | { | 976 | { |
965 | case 0: | 977 | case 0: |
966 | menu_quit = true; | 978 | menu_quit = true; |
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index e3f35f91ac..c047ed454a 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c | |||
@@ -493,7 +493,7 @@ int settings_menu_function(void) { | |||
493 | "Human starting farms","Human starting factories", | 493 | "Human starting farms","Human starting factories", |
494 | "Starting cash","Starting food","Moves per turn"); | 494 | "Starting cash","Starting food","Moves per turn"); |
495 | settings_menu: | 495 | settings_menu: |
496 | selection=rb->do_menu(&settings_menu,&selection); | 496 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); |
497 | switch(selection) { | 497 | switch(selection) { |
498 | case 0: | 498 | case 0: |
499 | rb->set_int("Computer starting farms", "", UNIT_INT, | 499 | rb->set_int("Computer starting farms", "", UNIT_INT, |
@@ -557,7 +557,7 @@ int do_help(void) { | |||
557 | "Each tile has a strength, calculated by the ownership", | 557 | "Each tile has a strength, calculated by the ownership", |
558 | "of adjacent tiles, and the type and number of troops", | 558 | "of adjacent tiles, and the type and number of troops", |
559 | "on them."); | 559 | "on them."); |
560 | rb->do_menu(&help_menu,&selection); | 560 | rb->do_menu(&help_menu,&selection, NULL, false); |
561 | switch(selection) { | 561 | switch(selection) { |
562 | case MENU_ATTACHED_USB: | 562 | case MENU_ATTACHED_USB: |
563 | return PLUGIN_USB_CONNECTED; | 563 | return PLUGIN_USB_CONNECTED; |
@@ -573,7 +573,7 @@ int menu(void) { | |||
573 | "Play Super Domination","Settings","Help","Quit"); | 573 | "Play Super Domination","Settings","Help","Quit"); |
574 | 574 | ||
575 | while(1) { | 575 | while(1) { |
576 | selection=rb->do_menu(&main_menu,&selection); | 576 | selection=rb->do_menu(&main_menu,&selection, NULL, false); |
577 | switch(selection) { | 577 | switch(selection) { |
578 | case 0: | 578 | case 0: |
579 | return 0; /* start playing */ | 579 | return 0; /* start playing */ |
@@ -651,7 +651,7 @@ int ingame_menu(void) { | |||
651 | MENUITEM_STRINGLIST(ingame_menu,"Super Domination Menu",NULL, | 651 | MENUITEM_STRINGLIST(ingame_menu,"Super Domination Menu",NULL, |
652 | "Return to game","Save Game", "Quit"); | 652 | "Return to game","Save Game", "Quit"); |
653 | 653 | ||
654 | selection=rb->do_menu(&ingame_menu,&selection); | 654 | selection=rb->do_menu(&ingame_menu,&selection, NULL, false); |
655 | switch(selection) { | 655 | switch(selection) { |
656 | case 0: | 656 | case 0: |
657 | return 0; | 657 | return 0; |
@@ -864,7 +864,7 @@ int buy_resources_menu(void) { | |||
864 | "Finish buying", "Game menu"); | 864 | "Finish buying", "Game menu"); |
865 | 865 | ||
866 | resources_menu: | 866 | resources_menu: |
867 | selection=rb->do_menu(&res_menu,&selection); | 867 | selection=rb->do_menu(&res_menu,&selection, NULL, false); |
868 | switch(selection) { | 868 | switch(selection) { |
869 | case 0: | 869 | case 0: |
870 | nummen = 0; | 870 | nummen = 0; |
@@ -1059,7 +1059,7 @@ int move_unit(void) { | |||
1059 | 1059 | ||
1060 | MENUITEM_STRINGLIST(move_unit_menu, "Move unit", NULL, "Move men", | 1060 | MENUITEM_STRINGLIST(move_unit_menu, "Move unit", NULL, "Move men", |
1061 | "Move tank", "Move plane"); | 1061 | "Move tank", "Move plane"); |
1062 | selection=rb->do_menu(&move_unit_menu,&selection); | 1062 | selection=rb->do_menu(&move_unit_menu,&selection, NULL, false); |
1063 | switch(selection) { | 1063 | switch(selection) { |
1064 | case 0: | 1064 | case 0: |
1065 | rb->splash(HZ, "Select where to move troops from"); | 1065 | rb->splash(HZ, "Select where to move troops from"); |
@@ -1173,7 +1173,7 @@ int movement_menu(void) { | |||
1173 | "Check map", "Finish moving", "Game menu"); | 1173 | "Check map", "Finish moving", "Game menu"); |
1174 | 1174 | ||
1175 | while(!menu_quit) { | 1175 | while(!menu_quit) { |
1176 | selection=rb->do_menu(&move_menu,&selection); | 1176 | selection=rb->do_menu(&move_menu,&selection, NULL, false); |
1177 | switch(selection) { | 1177 | switch(selection) { |
1178 | case 0: | 1178 | case 0: |
1179 | if(humanres.moves) { | 1179 | if(humanres.moves) { |
@@ -1281,7 +1281,7 @@ int production_menu(void) { | |||
1281 | "Withdraw money", "Finish turn", "Game menu"); | 1281 | "Withdraw money", "Finish turn", "Game menu"); |
1282 | 1282 | ||
1283 | while(1) { | 1283 | while(1) { |
1284 | selection=rb->do_menu(&prod_menu,&selection); | 1284 | selection=rb->do_menu(&prod_menu,&selection, NULL, false); |
1285 | switch(selection) { | 1285 | switch(selection) { |
1286 | case 0: | 1286 | case 0: |
1287 | tempmenu = buy_resources_menu(); | 1287 | tempmenu = buy_resources_menu(); |
@@ -1523,7 +1523,7 @@ int war_menu(void) { | |||
1523 | 1523 | ||
1524 | humanres.moves = superdom_settings.movesperturn; | 1524 | humanres.moves = superdom_settings.movesperturn; |
1525 | while(humanres.moves) { | 1525 | while(humanres.moves) { |
1526 | selection=rb->do_menu(&wartime_menu,&selection); | 1526 | selection=rb->do_menu(&wartime_menu,&selection, NULL, false); |
1527 | switch(selection) { | 1527 | switch(selection) { |
1528 | case 0: | 1528 | case 0: |
1529 | if(select_square() == PLUGIN_USB_CONNECTED) | 1529 | if(select_square() == PLUGIN_USB_CONNECTED) |
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 28e3d18431..642c1c39ff 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -715,7 +715,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
715 | 715 | ||
716 | rb->lcd_clear_display(); | 716 | rb->lcd_clear_display(); |
717 | 717 | ||
718 | result=rb->do_menu(&menu,&selection); | 718 | result=rb->do_menu(&menu,&selection, NULL, false); |
719 | 719 | ||
720 | scandir = 0; | 720 | scandir = 0; |
721 | 721 | ||
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c index 780516e896..75bbccf820 100644 --- a/apps/plugins/text_editor.c +++ b/apps/plugins/text_editor.c | |||
@@ -202,7 +202,7 @@ void save_changes(int overwrite) | |||
202 | 202 | ||
203 | void setup_lists(struct gui_synclist *lists, int sel) | 203 | void setup_lists(struct gui_synclist *lists, int sel) |
204 | { | 204 | { |
205 | rb->gui_synclist_init(lists,list_get_name_cb,0, false, 1); | 205 | rb->gui_synclist_init(lists,list_get_name_cb,0, false, 1, NULL); |
206 | rb->gui_synclist_set_icon_callback(lists,NULL); | 206 | rb->gui_synclist_set_icon_callback(lists,NULL); |
207 | rb->gui_synclist_set_nb_items(lists,line_count); | 207 | rb->gui_synclist_set_nb_items(lists,line_count); |
208 | rb->gui_synclist_limit_scroll(lists,true); | 208 | rb->gui_synclist_limit_scroll(lists,true); |
@@ -222,7 +222,7 @@ int do_item_menu(int cur_sel, char* copy_buffer) | |||
222 | "Insert Above", "Insert Below", | 222 | "Insert Above", "Insert Below", |
223 | "Concat To Above", "Save"); | 223 | "Concat To Above", "Save"); |
224 | 224 | ||
225 | switch (rb->do_menu(&menu, NULL)) | 225 | switch (rb->do_menu(&menu, NULL, NULL, false)) |
226 | { | 226 | { |
227 | case 0: /* cut */ | 227 | case 0: /* cut */ |
228 | rb->strcpy(copy_buffer,&buffer[do_action(ACTION_GET,0,cur_sel)]); | 228 | rb->strcpy(copy_buffer,&buffer[do_action(ACTION_GET,0,cur_sel)]); |
@@ -400,7 +400,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
400 | { | 400 | { |
401 | MENUITEM_STRINGLIST(menu, "Edit What?", NULL, | 401 | MENUITEM_STRINGLIST(menu, "Edit What?", NULL, |
402 | "Extension", "Color",); | 402 | "Extension", "Color",); |
403 | switch (rb->do_menu(&menu, NULL)) | 403 | switch (rb->do_menu(&menu, NULL, NULL, false)) |
404 | { | 404 | { |
405 | case 0: | 405 | case 0: |
406 | edit_text = true; | 406 | edit_text = true; |
@@ -468,7 +468,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
468 | "Show Playback Menu", "Save Changes", | 468 | "Show Playback Menu", "Save Changes", |
469 | "Save As...", "Save and Exit", | 469 | "Save As...", "Save and Exit", |
470 | "Ignore Changes and Exit"); | 470 | "Ignore Changes and Exit"); |
471 | switch (rb->do_menu(&menu, NULL)) | 471 | switch (rb->do_menu(&menu, NULL, NULL, false)) |
472 | { | 472 | { |
473 | case 0: | 473 | case 0: |
474 | break; | 474 | break; |
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 97ad12d419..f71118268e 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c | |||
@@ -401,7 +401,7 @@ static bool vu_meter_menu(void) | |||
401 | }; | 401 | }; |
402 | 402 | ||
403 | while (!menu_quit) { | 403 | while (!menu_quit) { |
404 | switch(rb->do_menu(&menu, &selection)) | 404 | switch(rb->do_menu(&menu, &selection, NULL, false)) |
405 | { | 405 | { |
406 | case 0: | 406 | case 0: |
407 | rb->set_option("Meter Type", &vumeter_settings.meter_type, INT, | 407 | rb->set_option("Meter Type", &vumeter_settings.meter_type, INT, |
diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c index b509212239..f6969ff7b5 100644 --- a/apps/plugins/wavrecord.c +++ b/apps/plugins/wavrecord.c | |||
@@ -3716,7 +3716,7 @@ static int recording_menu(void) | |||
3716 | 3716 | ||
3717 | while (!done) | 3717 | while (!done) |
3718 | { | 3718 | { |
3719 | switch (rb->do_menu(&menu, &menupos)) | 3719 | switch (rb->do_menu(&menu, &menupos, NULL, false)) |
3720 | { | 3720 | { |
3721 | case 0: /* Set sample rate */ | 3721 | case 0: /* Set sample rate */ |
3722 | rb->set_option("Sample rate", &reccfg.samplerate, INT, freqs, 9, NULL); | 3722 | rb->set_option("Sample rate", &reccfg.samplerate, INT, freqs, 9, NULL); |
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c index 68b31a1a7c..8b752bf6f5 100644 --- a/apps/plugins/wormlet.c +++ b/apps/plugins/wormlet.c | |||
@@ -2599,7 +2599,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2599 | rb->button_clear_queue(); | 2599 | rb->button_clear_queue(); |
2600 | 2600 | ||
2601 | while (!menu_quit) { | 2601 | while (!menu_quit) { |
2602 | switch(rb->do_menu(&menu, &result)) | 2602 | switch(rb->do_menu(&menu, &result, NULL, false)) |
2603 | { | 2603 | { |
2604 | case 0: | 2604 | case 0: |
2605 | rb->lcd_setfont(FONT_SYSFIXED); | 2605 | rb->lcd_setfont(FONT_SYSFIXED); |
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 743dd41362..879d0e65f7 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c | |||
@@ -851,7 +851,7 @@ static int game_menu (void) | |||
851 | rb->lcd_set_background(LCD_WHITE); | 851 | rb->lcd_set_background(LCD_WHITE); |
852 | #endif | 852 | #endif |
853 | for (;;) { | 853 | for (;;) { |
854 | rb->do_menu(&menu,&selection); | 854 | rb->do_menu(&menu,&selection, NULL, false); |
855 | if (selection==1) | 855 | if (selection==1) |
856 | rb->set_int ("Speed", "", UNIT_INT, &speed, NULL, 1, 1, 10, NULL); | 856 | rb->set_int ("Speed", "", UNIT_INT, &speed, NULL, 1, 1, 10, NULL); |
857 | else if (selection==2) | 857 | else if (selection==2) |
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 0e43cc6735..593cab3cc8 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c | |||
@@ -1331,7 +1331,7 @@ static int handle_radio_presets(void) | |||
1331 | str(LANG_FM_BUTTONBAR_ACTION)); | 1331 | str(LANG_FM_BUTTONBAR_ACTION)); |
1332 | gui_buttonbar_draw(&buttonbar); | 1332 | gui_buttonbar_draw(&buttonbar); |
1333 | #endif | 1333 | #endif |
1334 | gui_synclist_init(&lists, presets_get_name, NULL, false, 1); | 1334 | gui_synclist_init(&lists, presets_get_name, NULL, false, 1, NULL); |
1335 | gui_synclist_set_title(&lists, str(LANG_PRESET), NOICON); | 1335 | gui_synclist_set_title(&lists, str(LANG_PRESET), NOICON); |
1336 | gui_synclist_set_icon_callback(&lists, NULL); | 1336 | gui_synclist_set_icon_callback(&lists, NULL); |
1337 | if(global_settings.talk_file) | 1337 | if(global_settings.talk_file) |
@@ -1364,7 +1364,7 @@ static int handle_radio_presets(void) | |||
1364 | case ACTION_F3: | 1364 | case ACTION_F3: |
1365 | case ACTION_STD_CONTEXT: | 1365 | case ACTION_STD_CONTEXT: |
1366 | selected_preset = gui_synclist_get_sel_pos(&lists); | 1366 | selected_preset = gui_synclist_get_sel_pos(&lists); |
1367 | do_menu(&handle_radio_preset_menu, NULL); | 1367 | do_menu(&handle_radio_preset_menu, NULL, NULL, false); |
1368 | gui_synclist_speak_item(&lists); | 1368 | gui_synclist_speak_item(&lists); |
1369 | break; | 1369 | break; |
1370 | default: | 1370 | default: |
@@ -1583,7 +1583,7 @@ MAKE_MENU(radio_settings_menu, ID2P(LANG_FM_MENU), NULL, | |||
1583 | /* main menu of the radio screen */ | 1583 | /* main menu of the radio screen */ |
1584 | static bool radio_menu(void) | 1584 | static bool radio_menu(void) |
1585 | { | 1585 | { |
1586 | return do_menu(&radio_settings_menu, NULL) == MENU_ATTACHED_USB; | 1586 | return do_menu(&radio_settings_menu, NULL, NULL, false) == MENU_ATTACHED_USB; |
1587 | } | 1587 | } |
1588 | 1588 | ||
1589 | #endif | 1589 | #endif |
diff --git a/apps/root_menu.c b/apps/root_menu.c index abf3269445..ae7f92fc9b 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -221,7 +221,7 @@ static int browser(void* param) | |||
221 | static int menu(void* param) | 221 | static int menu(void* param) |
222 | { | 222 | { |
223 | (void)param; | 223 | (void)param; |
224 | return do_menu(NULL, 0); | 224 | return do_menu(NULL, 0, NULL, false); |
225 | 225 | ||
226 | } | 226 | } |
227 | #ifdef HAVE_RECORDING | 227 | #ifdef HAVE_RECORDING |
@@ -292,7 +292,7 @@ static int plugins_menu(void* param) | |||
292 | int selection = 0, current = 0; | 292 | int selection = 0, current = 0; |
293 | while (retval == GO_TO_PREVIOUS) | 293 | while (retval == GO_TO_PREVIOUS) |
294 | { | 294 | { |
295 | selection = do_menu(&plugins_menu_items, ¤t); | 295 | selection = do_menu(&plugins_menu_items, ¤t, NULL, false); |
296 | switch (selection) | 296 | switch (selection) |
297 | { | 297 | { |
298 | case 0: | 298 | case 0: |
@@ -483,7 +483,7 @@ static int load_context_screen(int selection) | |||
483 | } | 483 | } |
484 | 484 | ||
485 | if (context_menu) | 485 | if (context_menu) |
486 | return do_menu(context_menu, NULL); | 486 | return do_menu(context_menu, NULL, NULL, false); |
487 | else | 487 | else |
488 | return GO_TO_PREVIOUS; | 488 | return GO_TO_PREVIOUS; |
489 | } | 489 | } |
@@ -540,7 +540,7 @@ void root_menu(void) | |||
540 | case GO_TO_ROOT: | 540 | case GO_TO_ROOT: |
541 | if (last_screen != GO_TO_ROOT) | 541 | if (last_screen != GO_TO_ROOT) |
542 | selected = get_selection(last_screen); | 542 | selected = get_selection(last_screen); |
543 | next_screen = do_menu(&root_menu_, &selected); | 543 | next_screen = do_menu(&root_menu_, &selected, NULL, false); |
544 | if (next_screen != GO_TO_PREVIOUS) | 544 | if (next_screen != GO_TO_PREVIOUS) |
545 | last_screen = GO_TO_ROOT; | 545 | last_screen = GO_TO_ROOT; |
546 | break; | 546 | break; |
diff --git a/apps/screens.c b/apps/screens.c index 6654be4961..8d6ebfe36d 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -1223,7 +1223,7 @@ bool browse_id3(void) | |||
1223 | struct mp3entry* id3 = audio_current_track(); | 1223 | struct mp3entry* id3 = audio_current_track(); |
1224 | int key; | 1224 | int key; |
1225 | 1225 | ||
1226 | gui_synclist_init(&id3_lists, &id3_get_info, id3, true, 2); | 1226 | gui_synclist_init(&id3_lists, &id3_get_info, id3, true, 2, NULL); |
1227 | gui_synclist_set_nb_items(&id3_lists, | 1227 | gui_synclist_set_nb_items(&id3_lists, |
1228 | sizeof(id3_headers)/sizeof(id3_headers[0])*2); | 1228 | sizeof(id3_headers)/sizeof(id3_headers[0])*2); |
1229 | gui_synclist_draw(&id3_lists); | 1229 | gui_synclist_draw(&id3_lists); |
@@ -1275,7 +1275,7 @@ bool view_runtime(void) | |||
1275 | 1275 | ||
1276 | struct gui_synclist lists; | 1276 | struct gui_synclist lists; |
1277 | int action; | 1277 | int action; |
1278 | gui_synclist_init(&lists, runtime_get_data, NULL, false, 2); | 1278 | gui_synclist_init(&lists, runtime_get_data, NULL, false, 2, NULL); |
1279 | #if !defined(HAVE_LCD_CHARCELLS) | 1279 | #if !defined(HAVE_LCD_CHARCELLS) |
1280 | gui_synclist_set_title(&lists, str(LANG_RUNNING_TIME), NOICON); | 1280 | gui_synclist_set_title(&lists, str(LANG_RUNNING_TIME), NOICON); |
1281 | #else | 1281 | #else |
diff --git a/apps/tree.c b/apps/tree.c index ec70cb3e2e..fc263a0568 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -307,7 +307,7 @@ void tree_gui_init(void) | |||
307 | /* since archos only have one screen, no need to create more than that */ | 307 | /* since archos only have one screen, no need to create more than that */ |
308 | gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) ); | 308 | gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) ); |
309 | #endif | 309 | #endif |
310 | gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1); | 310 | gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL); |
311 | gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb); | 311 | gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb); |
312 | gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon); | 312 | gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon); |
313 | #ifdef HAVE_LCD_COLOR | 313 | #ifdef HAVE_LCD_COLOR |