summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-03-26 03:35:24 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-03-26 03:35:24 +0000
commit5ca15399690a686646d4739b3f4c51c62cc88b68 (patch)
tree1c12dc34bae30aedcb38bf5ceed8a2fcedc250c8
parentaf395f4db6ad7b83f9d9afefb1c0ceeedd140a45 (diff)
downloadrockbox-5ca15399690a686646d4739b3f4c51c62cc88b68.tar.gz
rockbox-5ca15399690a686646d4739b3f4c51c62cc88b68.zip
the menu and list now accepts a parent viewport to draw in (and the menu can be told to not show status/button bars). This lays the groundwork to fix colour problems with plugin menus (see star.c for an example.) This hopefully fixes some button bar issues as well as theme problems.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16812 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/bookmark.c4
-rw-r--r--apps/cuesheet.c2
-rw-r--r--apps/enc_config.c4
-rw-r--r--apps/gui/list.c19
-rw-r--r--apps/gui/list.h3
-rw-r--r--apps/gui/option_select.c3
-rw-r--r--apps/gui/viewport.c8
-rw-r--r--apps/gui/viewport.h3
-rw-r--r--apps/menu.c114
-rw-r--r--apps/menu.h3
-rw-r--r--apps/menus/eq_menu.c2
-rw-r--r--apps/menus/recording_menu.c2
-rw-r--r--apps/onplay.c2
-rw-r--r--apps/playlist_catalog.c2
-rw-r--r--apps/playlist_viewer.c9
-rw-r--r--apps/plugin.c3
-rw-r--r--apps/plugin.h12
-rw-r--r--apps/plugins/chessbox/chessbox.c4
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.c2
-rw-r--r--apps/plugins/chopper.c2
-rw-r--r--apps/plugins/clock/clock_menu.c10
-rw-r--r--apps/plugins/dice.c2
-rw-r--r--apps/plugins/disktidy.c2
-rw-r--r--apps/plugins/lib/oldmenuapi.c2
-rw-r--r--apps/plugins/lib/playback_control.c2
-rw-r--r--apps/plugins/minesweeper.c2
-rw-r--r--apps/plugins/pictureflow.c4
-rw-r--r--apps/plugins/properties.c2
-rw-r--r--apps/plugins/random_folder_advance_config.c2
-rw-r--r--apps/plugins/shortcuts/shortcuts_view.c2
-rw-r--r--apps/plugins/snake.c2
-rw-r--r--apps/plugins/sokoban.c2
-rw-r--r--apps/plugins/star.c18
-rw-r--r--apps/plugins/superdom.c18
-rw-r--r--apps/plugins/test_codec.c2
-rw-r--r--apps/plugins/text_editor.c8
-rw-r--r--apps/plugins/vu_meter.c2
-rw-r--r--apps/plugins/wavrecord.c2
-rw-r--r--apps/plugins/wormlet.c2
-rw-r--r--apps/plugins/xobox.c2
-rw-r--r--apps/recorder/radio.c6
-rw-r--r--apps/root_menu.c8
-rw-r--r--apps/screens.c4
-rw-r--r--apps/tree.c2
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
bookmarks->start = 0;
bookmarks->show_playlist_name
= strcmp(bookmark_file_name, RECENT_BOOKMARK_FILE) == 0;
- gui_synclist_init(&list, &get_bookmark_info, (void*) bookmarks, false, 2);
+ gui_synclist_init(&list, &get_bookmark_info, (void*) bookmarks, false, 2, NULL);
gui_synclist_set_title(&list, str(LANG_BOOKMARK_SELECT_BOOKMARK),
Icon_Bookmark);
gui_syncstatusbar_draw(&statusbars, true);
@@ -738,7 +738,7 @@ static char* select_bookmark(const char* bookmark_file_name, bool show_dont_resu
{
ACTION_STD_OK, ACTION_BMS_DELETE
};
- int selection = do_menu(&menu_items, NULL);
+ int selection = do_menu(&menu_items, NULL, NULL, false);
refresh = true;
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)
struct mp3entry *id3 = audio_current_track();
snprintf(title, MAX_PATH, "%s: %s", cue->performer, cue->title);
- gui_synclist_init(&lists, list_get_name_cb, cue, false, 2);
+ gui_synclist_init(&lists, list_get_name_cb, cue, false, 2, NULL);
gui_synclist_set_nb_items(&lists, 2*cue->track_count);
gui_synclist_set_title(&lists, title, 0);
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)
{
menu_callback_data.cfg = &cfg;
menu_callback_data.global = false;
- return do_menu(enc_data[cfg->rec_format].menu, NULL)
+ return do_menu(enc_data[cfg->rec_format].menu, NULL, NULL, false)
== MENU_ATTACHED_USB;
}
else
@@ -454,7 +454,7 @@ bool enc_global_config_menu(void)
{
menu_callback_data.cfg = &cfg;
menu_callback_data.global = true;
- return do_menu(enc_data[cfg.rec_format].menu, NULL)
+ return do_menu(enc_data[cfg.rec_format].menu, NULL, NULL, false)
== MENU_ATTACHED_USB;
}
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)
* - data : extra data passed to the list callback
* - scroll_all :
* - selected_size :
+ * - parent : the parent viewports to use. NULL means the full screen minus
+ * statusbar if enabled. NOTE: new screens should NOT set this to NULL.
*/
void gui_synclist_init(struct gui_synclist * gui_list,
list_get_name callback_get_item_name,
void * data,
bool scroll_all,
- int selected_size
+ int selected_size, struct viewport list_parent[NB_SCREENS]
)
{
int i;
@@ -128,7 +130,18 @@ void gui_synclist_init(struct gui_synclist * gui_list,
#ifdef HAVE_LCD_BITMAP
gui_list->offset_position[i] = 0;
#endif
- gui_list->parent[i] = &parent[i];
+ if (list_parent)
+ gui_list->parent[i] = &list_parent[i];
+ else
+ {
+ gui_list->parent[i] = &parent[i];
+ gui_list->parent[i]->y = global_settings.statusbar?STATUSBAR_HEIGHT:0;
+ gui_list->parent[i]->height = screens[i].height - gui_list->parent[i]->y;
+#ifdef HAS_BUTTONBAR
+ if (screens[i].has_buttonbar)
+ gui_list->parent[i]->height -= BUTTONBAR_HEIGHT;
+#endif
+ }
}
gui_list->limit_scroll = false;
gui_list->data=data;
@@ -811,7 +824,7 @@ bool simplelist_show_list(struct simplelist_info *info)
else
getname = simplelist_static_getname;
gui_synclist_init(&lists, getname, info->callback_data,
- info->scroll_all, info->selection_size);
+ info->scroll_all, info->selection_size, NULL);
if (info->title)
gui_synclist_set_title(&lists, info->title, NOICON);
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(
list_get_name callback_get_item_name,
void * data,
bool scroll_all,
- int selected_size
+ int selected_size,
+ struct viewport parent[NB_SCREENS] /* NOTE: new screens should NOT set this to NULL */
);
extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items);
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,
}
else return false; /* only int/bools can go here */
gui_synclist_init(&lists, value_setting_get_name_cb,
- (void*)setting, false, 1);
+ (void*)setting, false, 1, NULL);
if (setting->lang_id == -1)
title = (char*)setting->cfg_vals;
else
@@ -460,6 +460,7 @@ bool option_screen(struct settings_list *setting,
gui_synclist_draw(&lists);
/* talk the item */
gui_synclist_speak_item(&lists);
+ gui_syncstatusbar_draw(&statusbars, false);
while (!done)
{
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)
void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
{
+ vp->xmargin = 0;
+ vp->ymargin = 0;
vp->x = 0;
vp->width = screens[screen].width;
vp->y = global_settings.statusbar?STATUSBAR_HEIGHT:0;
- vp->height = screens[screen].height - vp->y
-#ifdef HAS_BUTTONBAR
- - (screens[screen].has_buttonbar?BUTTONBAR_HEIGHT:0)
-#endif
- ;
+ vp->height = screens[screen].height - vp->y;
#ifdef HAVE_LCD_BITMAP
vp->drawmode = DRMODE_SOLID;
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 @@
#include "config.h"
#include "lcd.h"
#include "font.h"
-#include "sprintf.h"
-#include "string.h"
-#include "settings.h"
#include "kernel.h"
#include "system.h"
#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 @@
#include "bookmark.h"
#include "gwps-common.h" /* for fade() */
#include "audio.h"
+#include "viewport.h"
#ifdef HAVE_LCD_BITMAP
#include "icons.h"
@@ -164,7 +165,8 @@ static int menu_get_icon(int selected_item, void * data)
#endif
static void init_menu_lists(const struct menu_item_ex *menu,
- struct gui_synclist *lists, int selected, bool callback)
+ struct gui_synclist *lists, int selected, bool callback,
+ struct viewport parent[NB_SCREENS])
{
int i, count = MENU_GET_COUNT(menu->flags);
int type = (menu->flags&MENU_TYPE_MASK);
@@ -197,7 +199,7 @@ static void init_menu_lists(const struct menu_item_ex *menu,
}
current_submenus_menu = (struct menu_item_ex *)menu;
- gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1);
+ gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1, parent);
#ifdef HAVE_LCD_BITMAP
if (menu->callback_and_desc->icon_id == Icon_NOICON)
icon = Icon_Submenu_Entered;
@@ -275,6 +277,29 @@ static int talk_menu_item(int selected_item, void *data)
}
return 0;
}
+/* this is used to reload the default menu viewports when the
+ theme changes. nothing happens if the menu is using a supplied parent vp */
+void init_default_menu_viewports(struct viewport parent[NB_SCREENS], bool hide_bars)
+{
+ int i;
+ FOR_NB_SCREENS(i)
+ {
+ viewport_set_defaults(&parent[i], i);
+ /* viewport_set_defaults() fixes the vp for the bars, so resize */
+ if (hide_bars)
+ {
+ if (global_settings.statusbar)
+ {
+ parent[i].y -= STATUSBAR_HEIGHT;
+ parent[i].height += STATUSBAR_HEIGHT;
+ }
+ }
+ }
+#ifdef HAS_BUTTONBAR
+ if (!hide_bars)
+ parent[0].height -= BUTTONBAR_HEIGHT;
+#endif
+}
bool do_setting_from_menu(const struct menu_item_ex *temp)
{
@@ -318,42 +343,71 @@ bool do_setting_from_menu(const struct menu_item_ex *temp)
}
/* display a menu */
-int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
+int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
+ struct viewport parent[NB_SCREENS], bool hide_bars)
{
int selected = start_selected? *start_selected : 0;
int action;
struct gui_synclist lists;
const struct menu_item_ex *temp, *menu;
- int ret = 0;
+ int ret = 0, i;
bool redraw_lists;
-#ifdef HAS_BUTTONBAR
- struct gui_buttonbar buttonbar;
-#endif
-
+
const struct menu_item_ex *menu_stack[MAX_MENUS];
int menu_stack_selected_item[MAX_MENUS];
int stack_top = 0;
bool in_stringlist, done = false;
- menu_callback_type menu_callback = NULL;
- if (start_menu == NULL)
- menu = &main_menu_;
- else menu = start_menu;
+
+ struct viewport *vps, menu_vp[NB_SCREENS]; /* menu_vp will hopefully be phased out */
#ifdef HAS_BUTTONBAR
+ struct gui_buttonbar buttonbar;
gui_buttonbar_init(&buttonbar);
gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
gui_buttonbar_set(&buttonbar, "<<<", "", "");
- gui_buttonbar_draw(&buttonbar);
#endif
- init_menu_lists(menu,&lists,selected,true);
+
+ menu_callback_type menu_callback = NULL;
+ if (start_menu == NULL)
+ menu = &main_menu_;
+ else menu = start_menu;
+
+ if (parent)
+ {
+ vps = parent;
+ /* if hide_bars == true we assume the viewport is correctly sized */
+ }
+ else
+ {
+ vps = menu_vp;
+ init_default_menu_viewports(vps, hide_bars);
+ }
+ FOR_NB_SCREENS(i)
+ {
+ screens[i].set_viewport(&vps[i]);
+ screens[i].clear_viewport();
+ screens[i].set_viewport(NULL);
+ }
+ init_menu_lists(menu, &lists, selected, true, vps);
in_stringlist = ((menu->flags&MENU_TYPE_MASK) == MT_RETURN_ID);
/* load the callback, and only reload it if menu changes */
get_menu_callback(menu, &menu_callback);
+
+#ifdef HAS_BUTTONBAR
+ if (!hide_bars)
+ {
+ gui_buttonbar_set(&buttonbar, "<<<", "", "");
+ gui_buttonbar_draw(&buttonbar);
+ }
+#endif
while (!done)
{
redraw_lists = false;
- gui_syncstatusbar_draw(&statusbars, true);
+ if (!hide_bars)
+ {
+ gui_syncstatusbar_draw(&statusbars, true);
+ }
action = get_action(CONTEXT_MAINMENU,
list_do_action_timeout(&lists, HZ));
/* HZ so the status bar redraws corectly */
@@ -430,7 +484,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
done = true;
else
init_menu_lists(menu, &lists,
- menu_stack_selected_item[stack_top], false);
+ menu_stack_selected_item[stack_top], false, vps);
/* new menu, so reload the callback */
get_menu_callback(menu, &menu_callback);
}
@@ -444,8 +498,11 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
{
int type;
#ifdef HAS_BUTTONBAR
- gui_buttonbar_unset(&buttonbar);
- gui_buttonbar_draw(&buttonbar);
+ if (!hide_bars)
+ {
+ gui_buttonbar_unset(&buttonbar);
+ gui_buttonbar_draw(&buttonbar);
+ }
#endif
selected = get_menu_selection(gui_synclist_get_sel_pos(&lists), menu);
temp = menu->submenus[selected];
@@ -471,7 +528,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
menu_stack[stack_top] = menu;
menu_stack_selected_item[stack_top] = selected;
stack_top++;
- init_menu_lists(temp, &lists, 0, true);
+ init_menu_lists(temp, &lists, 0, true, vps);
redraw_lists = false; /* above does the redraw */
menu = temp;
}
@@ -491,8 +548,9 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
if (temp->flags&MENU_HAS_DESC &&
temp->callback_and_desc->desc == ID2P(LANG_LANGUAGE))
{
- init_menu_lists(menu, &lists, selected, true);
+ init_menu_lists(menu, &lists, selected, true, vps);
}
+ init_default_menu_viewports(menu_vp, hide_bars);
if (temp->flags&MENU_FUNC_CHECK_RETVAL)
{
@@ -509,7 +567,8 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
{
if (do_setting_from_menu(temp))
{
- init_menu_lists(menu, &lists, selected, true);
+ init_default_menu_viewports(menu_vp, hide_bars);
+ init_menu_lists(menu, &lists, selected, true,vps);
redraw_lists = false; /* above does the redraw */
}
break;
@@ -526,7 +585,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
menu_stack_selected_item[stack_top] = selected;
stack_top++;
menu = temp;
- init_menu_lists(menu,&lists,0,false);
+ init_menu_lists(menu,&lists,0,false, vps);
redraw_lists = false; /* above does the redraw */
in_stringlist = true;
}
@@ -542,7 +601,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
menu_callback(ACTION_EXIT_MENUITEM,temp);
}
if (current_submenus_menu != menu)
- init_menu_lists(menu,&lists,selected,true);
+ init_menu_lists(menu,&lists,selected,true,vps);
/* callback was changed, so reload the menu's callback */
get_menu_callback(menu, &menu_callback);
if ((menu->flags&MENU_EXITAFTERTHISMENU) &&
@@ -552,8 +611,11 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
break;
}
#ifdef HAS_BUTTONBAR
- gui_buttonbar_set(&buttonbar, "<<<", "", "");
- gui_buttonbar_draw(&buttonbar);
+ if (!hide_bars)
+ {
+ gui_buttonbar_set(&buttonbar, "<<<", "", "");
+ gui_buttonbar_draw(&buttonbar);
+ }
#endif
}
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)
if (stack_top > 0)
{
menu = menu_stack[0];
- init_menu_lists(menu,&lists,menu_stack_selected_item[0],true);
+ init_menu_lists(menu,&lists,menu_stack_selected_item[0],true, vps);
}
*start_selected = get_menu_selection(
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);
This is always set, even if the menu was cancelled.
If NULL it is ignored and the firs item starts selected
*/
-int do_menu(const struct menu_item_ex *menu, int *start_selected);
+int do_menu(const struct menu_item_ex *menu, int *start_selected,
+ struct viewport parent[NB_SCREENS], bool hide_bars);
/* In all the following macros the argument names are as follows:
- 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)
menu.flags = MT_MENU|(3<<MENU_COUNT_SHIFT)|MENU_HAS_DESC;
menu.submenus = band_items[band-1];
menu.callback_and_desc = &cb_and_desc;
- do_menu(&menu, NULL);
+ do_menu(&menu, NULL, NULL, false);
return 0;
}
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)
{
bool retval;
no_source_in_menu = no_source;
- retval = do_menu(&recording_settings_menu, NULL) == MENU_ATTACHED_USB;
+ retval = do_menu(&recording_settings_menu, NULL, NULL, false) == MENU_ATTACHED_USB;
no_source_in_menu = false; /* always fall back to the default */
return retval;
};
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)
menu = &wps_onplay_menu;
else
menu = &tree_onplay_menu;
- switch (do_menu(menu, NULL))
+ switch (do_menu(menu, NULL, NULL, false))
{
case GO_TO_WPS:
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)
playlist = temp_buf;
gui_synclist_init(&playlist_lists, playlist_callback_name, playlists,
- false, 1);
+ false, 1, NULL);
gui_synclist_set_nb_items(&playlist_lists, num_playlists);
gui_synclist_draw(&playlist_lists);
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)
ID2P(LANG_CATALOG_ADD_TO), ID2P(LANG_CATALOG_ADD_TO_NEW));
bool current = (current_track->index == viewer.current_playing_track);
- result = do_menu(&menu_items, NULL);
+ result = do_menu(&menu_items, NULL, NULL, false);
if (result == MENU_ATTACHED_USB)
{
ret = -1;
@@ -505,7 +505,7 @@ MAKE_MENU(viewer_settings_menu, ID2P(LANG_PLAYLISTVIEWER_SETTINGS),
&show_icons, &show_indices, &track_display, &save_playlist_item);
static bool viewer_menu(void)
{
- return do_menu(&viewer_settings_menu, NULL) == MENU_ATTACHED_USB;
+ return do_menu(&viewer_settings_menu, NULL, NULL, false) == MENU_ATTACHED_USB;
}
/* Save playlist to disk */
@@ -589,7 +589,8 @@ bool playlist_viewer_ex(char* filename)
if (!playlist_viewer_init(&viewer, filename, false))
goto exit;
- gui_synclist_init(&playlist_lists, playlist_callback_name, &viewer, false, 1);
+ gui_synclist_init(&playlist_lists, playlist_callback_name,
+ &viewer, false, 1, NULL);
gui_synclist_set_icon_callback(&playlist_lists,
global_settings.playlist_viewer_icons?
&playlist_callback_icons:NULL);
@@ -798,7 +799,7 @@ bool search_playlist(void)
}
backlight_on();
gui_synclist_init(&playlist_lists, playlist_search_callback_name,
- found_indicies, false, 1);
+ found_indicies, false, 1, NULL);
gui_synclist_set_icon_callback(&playlist_lists, NULL);
gui_synclist_set_nb_items(&playlist_lists, found_indicies_count);
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 = {
lcd_remote_bitmap_part,
lcd_remote_bitmap,
#endif
-
+ viewport_set_defaults,
+
/* list */
gui_synclist_init,
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 @@
#include "color_picker.h"
#include "buffering.h"
#include "tagcache.h"
+#include "viewport.h"
#ifdef HAVE_ALBUMART
#include "albumart.h"
@@ -119,12 +120,12 @@
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 102
+#define PLUGIN_API_VERSION 103
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
-#define PLUGIN_MIN_API_VERSION 102
+#define PLUGIN_MIN_API_VERSION 103
/* plugin return codes */
enum plugin_status {
@@ -285,10 +286,12 @@ struct plugin_api {
void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width,
int height);
#endif
+ void (*viewport_set_defaults)(struct viewport *vp, enum screen_type screen);
/* list */
void (*gui_synclist_init)(struct gui_synclist * lists,
list_get_name callback_get_item_name,void * data,
- bool scroll_all,int selected_size);
+ bool scroll_all,int selected_size,
+ struct viewport parent[NB_SCREENS]);
void (*gui_synclist_set_nb_items)(struct gui_synclist * lists, int nb_items);
void (*gui_synclist_set_icon_callback)(struct gui_synclist * lists, list_get_icon icon_callback);
int (*gui_synclist_get_nb_items)(struct gui_synclist * lists);
@@ -555,7 +558,8 @@ struct plugin_api {
#endif
/* menu */
- int (*do_menu)(const struct menu_item_ex *menu, int *start_selected);
+ int (*do_menu)(const struct menu_item_ex *menu, int *start_selected,
+ struct viewport parent[NB_SCREENS], bool hide_bars);
/* scroll bar */
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)
while(!menu_quit)
{
- switch(rb->do_menu(&menu, &selection))
+ switch(rb->do_menu(&menu, &selection, NULL, false))
{
case 0:
menu_quit = true;
@@ -595,7 +595,7 @@ static int cb_menu(void)
while(!menu_quit)
{
- switch(rb->do_menu(&menu, &selection))
+ switch(rb->do_menu(&menu, &selection, NULL, false))
{
case 0:
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,
}
- rb->gui_synclist_init(&games_list, &get_game_text, first_game, false, 1);
+ rb->gui_synclist_init(&games_list, &get_game_text, first_game, false, 1, NULL);
rb->gui_synclist_set_title(&games_list, "Games", NOICON);
rb->gui_synclist_set_icon_callback(&games_list, NULL);
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)
rb->lcd_clear_display();
while (!menu_quit) {
- switch(rb->do_menu(&menu, &result))
+ switch(rb->do_menu(&menu, &result, NULL, false))
{
case 0: /* Start New Game */
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[] = {
bool menu_mode_selector(void){
MENUITEM_STRINGLIST(menu,"Mode Selector",NULL, "Analog",
"Digital", "Binary");
- if(rb->do_menu(&menu, &clock_settings.mode) >=0)
+ if(rb->do_menu(&menu, &clock_settings.mode, NULL, false) >=0)
return(true);
return(false);
}
@@ -73,7 +73,7 @@ void menu_analog_settings(void)
"Show Second Hand","Show Border");
while(result>=0){
- result=rb->do_menu(&menu, &selection);
+ result=rb->do_menu(&menu, &selection, NULL, false);
switch(result){
case 0:
rb->set_option("Show Date", &clock_settings.analog.show_date,
@@ -103,7 +103,7 @@ void menu_digital_settings(void){
"Blinking Colon");
while(result>=0){
- result=rb->do_menu(&menu, &selection);
+ result=rb->do_menu(&menu, &selection, NULL, false);
switch(result){
case 0:
rb->set_option("Show Seconds",
@@ -148,7 +148,7 @@ void menu_general_settings(void){
"Idle Poweroff (temporary)");
while(result>=0){
- result=rb->do_menu(&menu, &selection);
+ result=rb->do_menu(&menu, &selection, NULL, false);
switch(result){
case 0:
rb->set_option("Hour format",
@@ -211,7 +211,7 @@ bool main_menu(void){
"Mode Settings","General Settings","Quit");
while(!done){
- switch(rb->do_menu(&menu, &selection)){
+ switch(rb->do_menu(&menu, &selection, NULL, false)){
case 0:
done = true;
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) {
while (!menu_quit) {
- switch(rb->do_menu(&menu, &selection)){
+ switch(rb->do_menu(&menu, &selection, NULL, false)){
case 0:
menu_quit = true;
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)
while (!menu_quit)
{
- switch(rb->do_menu(&menu, &selection))
+ switch(rb->do_menu(&menu, &selection, NULL, false))
{
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,
return -1;
menus[menu].items = (struct menu_item*)mitems; /* de-const */
rb->gui_synclist_init(&(menus[menu].synclist),
- &menu_get_itemname, &menus[menu], false, 1);
+ &menu_get_itemname, &menus[menu], false, 1, NULL);
rb->gui_synclist_set_icon_callback(&(menus[menu].synclist), NULL);
rb->gui_synclist_set_nb_items(&(menus[menu].synclist), count);
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)
bool playback_control(struct plugin_api* newapi)
{
api = newapi;
- return api->do_menu(&playback_control_menu, NULL) == MENU_ATTACHED_USB;
+ return api->do_menu(&playback_control_menu, NULL, NULL, false) == MENU_ATTACHED_USB;
}
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 )
while( !menu_quit )
{
- switch( rb->do_menu( &menu, &selection ) )
+ switch( rb->do_menu( &menu, &selection, NULL, false ) )
{
case 0:
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) {
"Rebuild cache");
do {
- selection=rb->do_menu(&settings_menu,&selection);
+ selection=rb->do_menu(&settings_menu,&selection, NULL, false);
switch(selection) {
case 0:
rb->set_bool("Show FPS", &show_fps);
@@ -1604,7 +1604,7 @@ int main_menu(void)
"Settings", "Return", "Quit");
while (1) {
- switch (rb->do_menu(&main_menu,&selection)) {
+ switch (rb->do_menu(&main_menu,&selection, NULL, false)) {
case 0:
result = settings_menu();
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)
prev_show_statusbar = rb->global_settings->statusbar;
rb->global_settings->statusbar = false;
- rb->gui_synclist_init(&properties_lists, &get_props, file, false, 1);
+ rb->gui_synclist_init(&properties_lists, &get_props, file, false, 1, NULL);
rb->gui_synclist_set_title(&properties_lists, its_a_dir ?
"Directory properties" :
"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)
list = (struct file_format *)buffer;
dirs_count = list->count;
- rb->gui_synclist_init(&lists,list_get_name_cb,0, false, 1);
+ rb->gui_synclist_init(&lists,list_get_name_cb,0, false, 1, NULL);
rb->gui_synclist_set_icon_callback(&lists,NULL);
rb->gui_synclist_set_nb_items(&lists,list->count);
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)
/* Setup the GUI list object, draw it to the screen,
* and then handle the user input to it */
- rb->gui_synclist_init(&gui_sc, &build_sc_list, &sc_file, false, 1);
+ rb->gui_synclist_init(&gui_sc, &build_sc_list, &sc_file, false, 1, NULL);
rb->gui_synclist_set_title(&gui_sc,
(is_editable?"Shortcuts (editable)":"Shortcuts (sealed)"), NOICON);
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) {
"Quit");
while (!menu_quit) {
- switch(rb->do_menu(&menu, &selection))
+ switch(rb->do_menu(&menu, &selection, NULL, false))
{
case 0:
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)
do {
menu_quit = true;
- selection = rb->do_menu(&menu, &start_selected);
+ selection = rb->do_menu(&menu, &start_selected, NULL, false);
switch (selection) {
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)
{
int selection, level=1;
bool menu_quit = false;
-
+ struct viewport vp[NB_SCREENS];
/* get the size of char */
rb->lcd_getstringsize("a", &char_width, &char_height);
MENUITEM_STRINGLIST(menu,"Star Menu",NULL,"Play","Choose Level",
"Information","Keys","Quit");
-
+ FOR_NB_SCREENS(selection)
+ {
+ rb->viewport_set_defaults(&vp[selection], selection);
+ /* we are hiding the statusbar so fix the height also */
+ vp->y = 0; vp->height = rb->screens[selection]->height;
+#if LCD_DEPTH > 1
+ if (rb->screens[selection]->depth > 1)
+ {
+ vp->bg_pattern = LCD_BLACK;
+ vp->fg_pattern = LCD_WHITE;
+ }
+#endif
+ }
while(!menu_quit)
{
- switch(rb->do_menu(&menu, &selection))
+ switch(rb->do_menu(&menu, &selection, vp, true))
{
case 0:
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) {
"Human starting farms","Human starting factories",
"Starting cash","Starting food","Moves per turn");
settings_menu:
- selection=rb->do_menu(&settings_menu,&selection);
+ selection=rb->do_menu(&settings_menu,&selection, NULL, false);
switch(selection) {
case 0:
rb->set_int("Computer starting farms", "", UNIT_INT,
@@ -557,7 +557,7 @@ int do_help(void) {
"Each tile has a strength, calculated by the ownership",
"of adjacent tiles, and the type and number of troops",
"on them.");
- rb->do_menu(&help_menu,&selection);
+ rb->do_menu(&help_menu,&selection, NULL, false);
switch(selection) {
case MENU_ATTACHED_USB:
return PLUGIN_USB_CONNECTED;
@@ -573,7 +573,7 @@ int menu(void) {
"Play Super Domination","Settings","Help","Quit");
while(1) {
- selection=rb->do_menu(&main_menu,&selection);
+ selection=rb->do_menu(&main_menu,&selection, NULL, false);
switch(selection) {
case 0:
return 0; /* start playing */
@@ -651,7 +651,7 @@ int ingame_menu(void) {
MENUITEM_STRINGLIST(ingame_menu,"Super Domination Menu",NULL,
"Return to game","Save Game", "Quit");
- selection=rb->do_menu(&ingame_menu,&selection);
+ selection=rb->do_menu(&ingame_menu,&selection, NULL, false);
switch(selection) {
case 0:
return 0;
@@ -864,7 +864,7 @@ int buy_resources_menu(void) {
"Finish buying", "Game menu");
resources_menu:
- selection=rb->do_menu(&res_menu,&selection);
+ selection=rb->do_menu(&res_menu,&selection, NULL, false);
switch(selection) {
case 0:
nummen = 0;
@@ -1059,7 +1059,7 @@ int move_unit(void) {
MENUITEM_STRINGLIST(move_unit_menu, "Move unit", NULL, "Move men",
"Move tank", "Move plane");
- selection=rb->do_menu(&move_unit_menu,&selection);
+ selection=rb->do_menu(&move_unit_menu,&selection, NULL, false);
switch(selection) {
case 0:
rb->splash(HZ, "Select where to move troops from");
@@ -1173,7 +1173,7 @@ int movement_menu(void) {
"Check map", "Finish moving", "Game menu");
while(!menu_quit) {
- selection=rb->do_menu(&move_menu,&selection);
+ selection=rb->do_menu(&move_menu,&selection, NULL, false);
switch(selection) {
case 0:
if(humanres.moves) {
@@ -1281,7 +1281,7 @@ int production_menu(void) {
"Withdraw money", "Finish turn", "Game menu");
while(1) {
- selection=rb->do_menu(&prod_menu,&selection);
+ selection=rb->do_menu(&prod_menu,&selection, NULL, false);
switch(selection) {
case 0:
tempmenu = buy_resources_menu();
@@ -1523,7 +1523,7 @@ int war_menu(void) {
humanres.moves = superdom_settings.movesperturn;
while(humanres.moves) {
- selection=rb->do_menu(&wartime_menu,&selection);
+ selection=rb->do_menu(&wartime_menu,&selection, NULL, false);
switch(selection) {
case 0:
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)
rb->lcd_clear_display();
- result=rb->do_menu(&menu,&selection);
+ result=rb->do_menu(&menu,&selection, NULL, false);
scandir = 0;
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)
void setup_lists(struct gui_synclist *lists, int sel)
{
- rb->gui_synclist_init(lists,list_get_name_cb,0, false, 1);
+ rb->gui_synclist_init(lists,list_get_name_cb,0, false, 1, NULL);
rb->gui_synclist_set_icon_callback(lists,NULL);
rb->gui_synclist_set_nb_items(lists,line_count);
rb->gui_synclist_limit_scroll(lists,true);
@@ -222,7 +222,7 @@ int do_item_menu(int cur_sel, char* copy_buffer)
"Insert Above", "Insert Below",
"Concat To Above", "Save");
- switch (rb->do_menu(&menu, NULL))
+ switch (rb->do_menu(&menu, NULL, NULL, false))
{
case 0: /* cut */
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)
{
MENUITEM_STRINGLIST(menu, "Edit What?", NULL,
"Extension", "Color",);
- switch (rb->do_menu(&menu, NULL))
+ switch (rb->do_menu(&menu, NULL, NULL, false))
{
case 0:
edit_text = true;
@@ -468,7 +468,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
"Show Playback Menu", "Save Changes",
"Save As...", "Save and Exit",
"Ignore Changes and Exit");
- switch (rb->do_menu(&menu, NULL))
+ switch (rb->do_menu(&menu, NULL, NULL, false))
{
case 0:
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)
};
while (!menu_quit) {
- switch(rb->do_menu(&menu, &selection))
+ switch(rb->do_menu(&menu, &selection, NULL, false))
{
case 0:
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)
while (!done)
{
- switch (rb->do_menu(&menu, &menupos))
+ switch (rb->do_menu(&menu, &menupos, NULL, false))
{
case 0: /* Set sample rate */
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)
rb->button_clear_queue();
while (!menu_quit) {
- switch(rb->do_menu(&menu, &result))
+ switch(rb->do_menu(&menu, &result, NULL, false))
{
case 0:
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)
rb->lcd_set_background(LCD_WHITE);
#endif
for (;;) {
- rb->do_menu(&menu,&selection);
+ rb->do_menu(&menu,&selection, NULL, false);
if (selection==1)
rb->set_int ("Speed", "", UNIT_INT, &speed, NULL, 1, 1, 10, NULL);
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)
str(LANG_FM_BUTTONBAR_ACTION));
gui_buttonbar_draw(&buttonbar);
#endif
- gui_synclist_init(&lists, presets_get_name, NULL, false, 1);
+ gui_synclist_init(&lists, presets_get_name, NULL, false, 1, NULL);
gui_synclist_set_title(&lists, str(LANG_PRESET), NOICON);
gui_synclist_set_icon_callback(&lists, NULL);
if(global_settings.talk_file)
@@ -1364,7 +1364,7 @@ static int handle_radio_presets(void)
case ACTION_F3:
case ACTION_STD_CONTEXT:
selected_preset = gui_synclist_get_sel_pos(&lists);
- do_menu(&handle_radio_preset_menu, NULL);
+ do_menu(&handle_radio_preset_menu, NULL, NULL, false);
gui_synclist_speak_item(&lists);
break;
default:
@@ -1583,7 +1583,7 @@ MAKE_MENU(radio_settings_menu, ID2P(LANG_FM_MENU), NULL,
/* main menu of the radio screen */
static bool radio_menu(void)
{
- return do_menu(&radio_settings_menu, NULL) == MENU_ATTACHED_USB;
+ return do_menu(&radio_settings_menu, NULL, NULL, false) == MENU_ATTACHED_USB;
}
#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)
static int menu(void* param)
{
(void)param;
- return do_menu(NULL, 0);
+ return do_menu(NULL, 0, NULL, false);
}
#ifdef HAVE_RECORDING
@@ -292,7 +292,7 @@ static int plugins_menu(void* param)
int selection = 0, current = 0;
while (retval == GO_TO_PREVIOUS)
{
- selection = do_menu(&plugins_menu_items, &current);
+ selection = do_menu(&plugins_menu_items, &current, NULL, false);
switch (selection)
{
case 0:
@@ -483,7 +483,7 @@ static int load_context_screen(int selection)
}
if (context_menu)
- return do_menu(context_menu, NULL);
+ return do_menu(context_menu, NULL, NULL, false);
else
return GO_TO_PREVIOUS;
}
@@ -540,7 +540,7 @@ void root_menu(void)
case GO_TO_ROOT:
if (last_screen != GO_TO_ROOT)
selected = get_selection(last_screen);
- next_screen = do_menu(&root_menu_, &selected);
+ next_screen = do_menu(&root_menu_, &selected, NULL, false);
if (next_screen != GO_TO_PREVIOUS)
last_screen = GO_TO_ROOT;
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)
struct mp3entry* id3 = audio_current_track();
int key;
- gui_synclist_init(&id3_lists, &id3_get_info, id3, true, 2);
+ gui_synclist_init(&id3_lists, &id3_get_info, id3, true, 2, NULL);
gui_synclist_set_nb_items(&id3_lists,
sizeof(id3_headers)/sizeof(id3_headers[0])*2);
gui_synclist_draw(&id3_lists);
@@ -1275,7 +1275,7 @@ bool view_runtime(void)
struct gui_synclist lists;
int action;
- gui_synclist_init(&lists, runtime_get_data, NULL, false, 2);
+ gui_synclist_init(&lists, runtime_get_data, NULL, false, 2, NULL);
#if !defined(HAVE_LCD_CHARCELLS)
gui_synclist_set_title(&lists, str(LANG_RUNNING_TIME), NOICON);
#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)
/* since archos only have one screen, no need to create more than that */
gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) );
#endif
- gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1);
+ gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL);
gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb);
gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon);
#ifdef HAVE_LCD_COLOR