From c39f95465b9844f70f375f1690e0bf75c7ee7cc1 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 19 Jul 2020 13:42:04 -0400 Subject: do_menu pass internal synclist reference to callback keep running into the rigid nature of do_menu it isn't too bad when you don't need voice but once you do the fun awaits do_menu likes to talk on menu enter which is in a loop when you use do_menu I would like to move the processing to the callback TOO BAD you only get an action and the menu_item_ex struct you sent it when calling the function Change-Id: Iaefd0cc133435d675b7dd27a558c504d6ccb327a --- apps/enc_config.c | 14 ++++++--- apps/menu.c | 20 +++++++------ apps/menu.h | 15 ++++++---- apps/menus/display_menu.c | 51 ++++++++++++++++++++++--------- apps/menus/eq_menu.c | 9 ++++-- apps/menus/menu_common.c | 5 +++- apps/menus/menu_common.h | 4 ++- apps/menus/playback_menu.c | 34 ++++++++++++++++----- apps/menus/recording_menu.c | 9 ++++-- apps/menus/settings_menu.c | 57 +++++++++++++++++++++++++++-------- apps/menus/sound_menu.c | 12 ++++++-- apps/menus/theme_menu.c | 20 ++++++++++--- apps/menus/time_menu.c | 9 ++++-- apps/onplay.c | 60 ++++++++++++++++++++++++++++--------- apps/plugins/2048.c | 5 +++- apps/plugins/blackjack.c | 5 +++- apps/plugins/brickmania.c | 5 +++- apps/plugins/bubbles.c | 5 +++- apps/plugins/calendar.c | 5 +++- apps/plugins/chopper.c | 5 +++- apps/plugins/clix.c | 5 +++- apps/plugins/codebuster.c | 5 +++- apps/plugins/disktidy.c | 5 +++- apps/plugins/jewels.c | 5 +++- apps/plugins/keybox.c | 6 +++- apps/plugins/lua/rocklib.c | 9 ++++-- apps/plugins/mazezam.c | 5 +++- apps/plugins/mpegplayer/mpeg_misc.c | 7 +++-- apps/plugins/mpegplayer/mpeg_misc.h | 3 +- apps/plugins/pegbox.c | 6 +++- apps/plugins/puzzles/rockbox.c | 5 +++- apps/plugins/rockblox.c | 5 +++- apps/plugins/snake.c | 5 +++- apps/plugins/solitaire.c | 5 +++- apps/plugins/spacerocks.c | 5 +++- apps/plugins/xobox.c | 5 +++- apps/plugins/xworld/sys.c | 5 +++- apps/radio/presets.c | 4 ++- apps/root_menu.c | 9 ++++-- 39 files changed, 343 insertions(+), 110 deletions(-) (limited to 'apps') diff --git a/apps/enc_config.c b/apps/enc_config.c index 7741c293f0..a971343cab 100644 --- a/apps/enc_config.c +++ b/apps/enc_config.c @@ -40,9 +40,11 @@ if (fn) fn(__VA_ARGS__) static int enc_menuitem_callback(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); static int enc_menuitem_enteritem(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); static void enc_rec_settings_changed(struct encoder_config *cfg); /* this is used by all encoder menu items, MUST be initialised before the call to do_menu() */ @@ -262,9 +264,11 @@ static inline bool rec_format_ok(int rec_format) /* This is called before entering the menu with the encoder settings Its needed to make sure the settings can take effect. */ static int enc_menuitem_enteritem(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; /* this struct must be init'ed before calling do_menu() so this is safe */ struct menucallback_data *data = &menu_callback_data; if (action == ACTION_STD_OK) /* entering the item */ @@ -277,8 +281,10 @@ static int enc_menuitem_enteritem(int action, /* this is called when a encoder setting is exited It is used to update the status bar and save the setting */ static int enc_menuitem_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; struct menucallback_data *data = (struct menucallback_data*)this_item->function->param; diff --git a/apps/menu.c b/apps/menu.c index 929a14e9f0..5a388522fa 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -192,7 +192,7 @@ static void init_menu_lists(const struct menu_item_ex *menu, if (menu_callback) { if (menu_callback(ACTION_REQUEST_MENUITEM, - type==MT_RETURN_ID ? (void*)(intptr_t)i: menu->submenus[i]) + type==MT_RETURN_ID ? (void*)(intptr_t)i: menu->submenus[i], lists) != ACTION_EXIT_MENUITEM) { current_subitems[current_subitems_count] = i; @@ -246,7 +246,7 @@ static void init_menu_lists(const struct menu_item_ex *menu, get_menu_callback(menu,&menu_callback); if (callback && menu_callback) - menu_callback(ACTION_ENTER_MENUITEM,menu); + menu_callback(ACTION_ENTER_MENUITEM, menu, lists); } static int talk_menu_item(int selected_item, void *data) @@ -430,7 +430,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, if (menu_callback) { int old_action = action; - action = menu_callback(action, menu); + action = menu_callback(action, menu, &lists); if (action == ACTION_EXIT_AFTER_THIS_MENUITEM) { action = old_action; @@ -560,7 +560,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, /* might be leaving list, so stop scrolling */ gui_synclist_scroll_stop(&lists); if (menu_callback) - menu_callback(ACTION_EXIT_MENUITEM, menu); + menu_callback(ACTION_EXIT_MENUITEM, menu, &lists); if (menu->flags&MENU_EXITAFTERTHISMENU) done = true; @@ -612,7 +612,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, get_menu_callback(temp, &menu_callback); if (menu_callback) { - action = menu_callback(ACTION_ENTER_MENUITEM,temp); + action = menu_callback(ACTION_ENTER_MENUITEM, temp, &lists); if (action == ACTION_EXIT_MENUITEM) break; } @@ -688,7 +688,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, if (type != MT_MENU) { if (menu_callback) - menu_callback(ACTION_EXIT_MENUITEM,temp); + menu_callback(ACTION_EXIT_MENUITEM, temp, &lists); } if (current_submenus_menu != menu) init_menu_lists(menu,&lists,selected,true,vps); @@ -730,9 +730,11 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, if (redraw_lists && !done) { if (menu_callback) - menu_callback(ACTION_REDRAW, menu); - gui_synclist_draw(&lists); - gui_synclist_speak_item(&lists); + if (menu_callback(ACTION_REDRAW, menu, &lists) == ACTION_REDRAW) + { + gui_synclist_draw(&lists); + gui_synclist_speak_item(&lists); + } } } diff --git a/apps/menu.h b/apps/menu.h index 7ace51329f..e56a4a149b 100644 --- a/apps/menu.h +++ b/apps/menu.h @@ -27,6 +27,7 @@ #include "icons.h" #include "root_menu.h" /* needed for MENU_* return codes */ #include "settings_list.h" +#include "gui/list.h" enum menu_item_type { @@ -79,18 +80,21 @@ struct menu_item_ex { }; union { /* For settings */ - int (*menu_callback)(int action, const struct menu_item_ex *this_item); + int (*menu_callback)(int action, const struct menu_item_ex *this_item, + struct gui_synclist *this_list); /* For everything else, except if the text is dynamic */ const struct menu_callback_with_desc { - int (*menu_callback)(int action, - const struct menu_item_ex *this_item); + int (*menu_callback)(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); unsigned char *desc; /* string or ID */ int icon_id; /* from icons_6x8 in icons.h */ } *callback_and_desc; /* For when the item text is dynamic */ const struct menu_get_name_and_icon { int (*menu_callback)(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); char *(*list_get_name)(int selected_item, void * data, char *buffer, size_t buffer_len); int (*list_speak_item)(int selected_item, void * data); @@ -101,7 +105,8 @@ struct menu_item_ex { }; typedef int (*menu_callback_type)(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); void do_setting_from_menu(const struct menu_item_ex *temp, struct viewport parent[NB_SCREENS]); void do_setting_screen(const struct settings_list *setting, const char * title, diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 5d53cbfe16..83bd8066d5 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c @@ -50,10 +50,12 @@ #include "rbunicode.h" #ifdef HAVE_BACKLIGHT -static int selectivebacklight_callback(int action,const struct menu_item_ex *this_item) +static int selectivebacklight_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; - + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: @@ -69,10 +71,11 @@ static int selectivebacklight_callback(int action,const struct menu_item_ex *thi return action; } -static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) +static int filterfirstkeypress_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { /*(void)this_item;REMOVED*/ - switch (action) { case ACTION_EXIT_MENUITEM: @@ -81,7 +84,7 @@ static int filterfirstkeypress_callback(int action,const struct menu_item_ex *th set_remote_backlight_filter_keypress( global_settings.remote_bl_filter_first_keypress); #endif /* HAVE_REMOTE_LCD */ - selectivebacklight_callback(action,this_item);/*uses Filter First KP*/ + selectivebacklight_callback(action,this_item, this_list);/*uses Filter First KP*/ break; } @@ -118,9 +121,12 @@ static int selectivebacklight_set_mask(void* param) #endif /* HAVE_BACKLIGHT */ #ifdef HAVE_LCD_FLIP -static int flipdisplay_callback(int action,const struct menu_item_ex *this_item) +static int flipdisplay_callback(int action, + const struct menu_item_ex *this_item + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: @@ -265,9 +271,12 @@ MENUITEM_SETTING(remote_flip_display, #endif #ifdef HAVE_REMOTE_LCD_TICKING -static int ticking_callback(int action,const struct menu_item_ex *this_item) +static int ticking_callback(int action, + const struct menu_item_ex *this_item + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: @@ -334,9 +343,12 @@ MENUITEM_SETTING(list_accel_start_delay, MENUITEM_SETTING(list_accel_wait, &global_settings.list_accel_wait, NULL); #endif /* HAVE_WHEEL_ACCELERATION */ #ifdef HAVE_LCD_BITMAP -static int screenscroll_callback(int action,const struct menu_item_ex *this_item) +static int screenscroll_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: @@ -375,9 +387,12 @@ MAKE_MENU(scroll_settings_menu, ID2P(LANG_SCROLL_MENU), 0, Icon_NOICON, /* PEAK METER MENU */ #ifdef HAVE_LCD_BITMAP -static int peakmeter_callback(int action,const struct menu_item_ex *this_item) +static int peakmeter_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: @@ -561,9 +576,12 @@ MAKE_MENU(peak_meter_menu, ID2P(LANG_PM_MENU), NULL, Icon_NOICON, #ifdef HAVE_TOUCHSCREEN -static int touch_mode_callback(int action,const struct menu_item_ex *this_item) +static int touch_mode_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -573,10 +591,12 @@ static int touch_mode_callback(int action,const struct menu_item_ex *this_item) return action; } -static int line_padding_callback(int action,const struct menu_item_ex *this_item) +static int line_padding_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); { (void)this_item; - + (void)this_list; if (action == ACTION_EXIT_MENUITEM) viewportmanager_theme_changed(THEME_LISTS); return action; @@ -594,11 +614,14 @@ MAKE_MENU(touchscreen_menu, ID2P(LANG_TOUCHSCREEN_SETTINGS), NULL, Icon_NOICON, &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration); #endif -static int codepage_callback(int action, const struct menu_item_ex *this_item) +static int codepage_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_item; + (void)this_list; static int old_codepage; int new_codepage = global_settings.default_codepage; - (void)this_item; switch (action) { case ACTION_ENTER_MENUITEM: diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c index 7cbf7b5d90..b41e4b0981 100644 --- a/apps/menus/eq_menu.c +++ b/apps/menus/eq_menu.c @@ -81,16 +81,19 @@ static void eq_apply(void) } } -static int eq_setting_callback(int action, const struct menu_item_ex *this_item) +static int eq_setting_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; switch (action) { case ACTION_ENTER_MENUITEM: - action = lowlatency_callback(action, this_item); + action = lowlatency_callback(action, this_item, NULL); break; case ACTION_EXIT_MENUITEM: eq_apply(); - action = lowlatency_callback(action, this_item); + action = lowlatency_callback(action, this_item, NULL); break; } diff --git a/apps/menus/menu_common.c b/apps/menus/menu_common.c index e8a2a91f12..2ef48cc23b 100644 --- a/apps/menus/menu_common.c +++ b/apps/menus/menu_common.c @@ -31,9 +31,12 @@ #if CONFIG_CODEC == SWCODEC /* Use this callback if your menu adjusts DSP settings. */ -int lowlatency_callback(int action, const struct menu_item_ex *this_item) +int lowlatency_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_ENTER_MENUITEM: /* on entering an item */ diff --git a/apps/menus/menu_common.h b/apps/menus/menu_common.h index bdf02a0092..e85ed8dc61 100644 --- a/apps/menus/menu_common.h +++ b/apps/menus/menu_common.h @@ -25,7 +25,9 @@ #include "config.h" #if CONFIG_CODEC == SWCODEC -int lowlatency_callback(int action, const struct menu_item_ex *this_item); +int lowlatency_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); #endif #endif /* _MENU_COMMON_H */ diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c index 23f1cb55bf..bf770c0f11 100644 --- a/apps/menus/playback_menu.c +++ b/apps/menus/playback_menu.c @@ -45,9 +45,12 @@ #if (CONFIG_CODEC == SWCODEC) && defined(HAVE_CROSSFADE) -static int setcrossfadeonexit_callback(int action,const struct menu_item_ex *this_item) +static int setcrossfadeonexit_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -61,7 +64,9 @@ static int setcrossfadeonexit_callback(int action,const struct menu_item_ex *thi /***********************************/ /* PLAYBACK MENU */ -static int playback_callback(int action,const struct menu_item_ex *this_item); +static int playback_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); MENUITEM_SETTING(shuffle_item, &global_settings.playlist_shuffle, playback_callback); MENUITEM_SETTING(repeat_mode, &global_settings.repeat_mode, playback_callback); @@ -73,9 +78,12 @@ MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, Icon_NOICON, &ff_rewind_min_step, &ff_rewind_accel); #ifdef HAVE_DISK_STORAGE #if CONFIG_CODEC == SWCODEC -static int buffermargin_callback(int action,const struct menu_item_ex *this_item) +static int buffermargin_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -115,9 +123,12 @@ MAKE_MENU(crossfade_settings_menu,ID2P(LANG_CROSSFADE),0, Icon_NOICON, /* replay gain submenu */ -static int replaygain_callback(int action,const struct menu_item_ex *this_item) +static int replaygain_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -147,9 +158,12 @@ MENUITEM_SETTING(spdif_enable, &global_settings.spdif_enable, NULL); MENUITEM_SETTING(next_folder, &global_settings.next_folder, NULL); MENUITEM_SETTING(constrain_next_folder, &global_settings.constrain_next_folder, NULL); -static int audioscrobbler_callback(int action,const struct menu_item_ex *this_item) +static int audioscrobbler_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -165,9 +179,12 @@ static int audioscrobbler_callback(int action,const struct menu_item_ex *this_it MENUITEM_SETTING(audioscrobbler, &global_settings.audioscrobbler, audioscrobbler_callback); -static int cuesheet_callback(int action,const struct menu_item_ex *this_item) +static int cuesheet_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -236,8 +253,11 @@ MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0, #endif ); -static int playback_callback(int action,const struct menu_item_ex *this_item) +static int playback_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; static bool old_shuffle = false; static int old_repeat = 0; switch (action) diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c index 54dc415de7..21c6cff5fb 100644 --- a/apps/menus/recording_menu.c +++ b/apps/menus/recording_menu.c @@ -69,7 +69,9 @@ #include "exported_menus.h" static bool no_source_in_menu = false; -static int recmenu_callback(int action,const struct menu_item_ex *this_item); +static int recmenu_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); static int recsource_func(void) { @@ -313,8 +315,11 @@ MENUITEM_FUNCTION(enc_global_config_menu_item, 0, ID2P(LANG_ENCODER_SETTINGS), #endif /* CONFIG_CODEC == SWCODEC */ -static int recmenu_callback(int action,const struct menu_item_ex *this_item) +static int recmenu_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; switch (action) { case ACTION_REQUEST_MENUITEM: diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 67595498ad..2a08ab0a4e 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -59,9 +59,11 @@ #ifndef HAS_BUTTON_HOLD static int selectivesoftlock_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { @@ -176,7 +178,10 @@ MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON, /***********************************/ /* FILE VIEW MENU */ -static int fileview_callback(int action,const struct menu_item_ex *this_item); +static int fileview_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); + MENUITEM_SETTING(sort_case, &global_settings.sort_case, NULL); MENUITEM_SETTING(sort_dir, &global_settings.sort_dir, fileview_callback); MENUITEM_SETTING(sort_file, &global_settings.sort_file, fileview_callback); @@ -196,8 +201,11 @@ static int clear_start_directory(void) } MENUITEM_FUNCTION(clear_start_directory_item, 0, ID2P(LANG_RESET_START_DIR), clear_start_directory, NULL, NULL, Icon_file_view_menu); -static int fileview_callback(int action,const struct menu_item_ex *this_item) +static int fileview_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; static int oldval; int *variable = this_item->variable; switch (action) @@ -236,9 +244,12 @@ MENUITEM_SETTING(battery_capacity, &global_settings.battery_capacity, NULL); MENUITEM_SETTING(battery_type, &global_settings.battery_type, NULL); #endif #ifdef HAVE_USB_CHARGING_ENABLE -static int usbcharging_callback(int action,const struct menu_item_ex *this_item) +static int usbcharging_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -265,9 +276,12 @@ MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, Icon_NOICON, MENUITEM_SETTING(disk_spindown, &global_settings.disk_spindown, NULL); #endif #ifdef HAVE_DIRCACHE -static int dircache_callback(int action,const struct menu_item_ex *this_item) +static int dircache_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -328,9 +342,12 @@ MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON, #if CONFIG_CODEC == MAS3507D void dac_line_in(bool enable); -static int linein_callback(int action,const struct menu_item_ex *this_item) +static int linein_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -545,9 +562,11 @@ static int toggle_sleeptimer(void) /* Handle restarting a current sleep timer to the newly set default duration */ static int sleeptimer_duration_cb(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; static int initial_duration; switch (action) { @@ -590,9 +609,12 @@ MAKE_MENU(startup_shutdown_menu, ID2P(LANG_STARTUP_SHUTDOWN), /***********************************/ /* BOOKMARK MENU */ -static int bmark_callback(int action,const struct menu_item_ex *this_item) +static int bmark_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -623,9 +645,12 @@ MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0, #ifdef HAVE_TAGCACHE #if CONFIG_CODEC == SWCODEC -static int autoresume_callback(int action, const struct menu_item_ex *this_item) +static int autoresume_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; if (action == ACTION_EXIT_MENUITEM /* on exit */ && global_settings.autoresume_enable @@ -642,9 +667,11 @@ static int autoresume_callback(int action, const struct menu_item_ex *this_item) } static int autoresume_nexttrack_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; static int oldval = 0; switch (action) { @@ -678,14 +705,20 @@ MAKE_MENU(autoresume_menu, ID2P(LANG_AUTORESUME), /***********************************/ /* VOICE MENU */ -static int talk_callback(int action,const struct menu_item_ex *this_item); +static int talk_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); + MENUITEM_SETTING(talk_menu_item, &global_settings.talk_menu, NULL); MENUITEM_SETTING(talk_dir_item, &global_settings.talk_dir, NULL); MENUITEM_SETTING(talk_dir_clip_item, &global_settings.talk_dir_clip, talk_callback); MENUITEM_SETTING(talk_file_item, &global_settings.talk_file, NULL); MENUITEM_SETTING(talk_file_clip_item, &global_settings.talk_file_clip, talk_callback); -static int talk_callback(int action,const struct menu_item_ex *this_item) +static int talk_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; static int oldval = 0; switch (action) { diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c index fb9a7fa26e..f39d980a35 100644 --- a/apps/menus/sound_menu.c +++ b/apps/menus/sound_menu.c @@ -38,9 +38,12 @@ #include "option_select.h" #include "misc.h" -static int volume_limit_callback(int action,const struct menu_item_ex *this_item) +static int volume_limit_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; static struct int_setting volume_limit_int_setting; volume_limit_int_setting.option_callback = NULL; @@ -147,8 +150,11 @@ MENUITEM_SETTING(func_mode, &global_settings.func_mode, NULL); &crossfeed_hf_attenuation, &crossfeed_hf_cutoff); #ifdef HAVE_PITCHCONTROL -static int timestretch_callback(int action,const struct menu_item_ex *this_item) +static int timestretch_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: /* on exit */ @@ -156,7 +162,7 @@ static int timestretch_callback(int action,const struct menu_item_ex *this_item) splash(HZ*2, ID2P(LANG_PLEASE_REBOOT)); break; } - lowlatency_callback(action, this_item); + lowlatency_callback(action, this_item, NULL); return action; } MENUITEM_SETTING(timestretch_enabled, diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c index f64ded1615..10d1291daa 100644 --- a/apps/menus/theme_menu.c +++ b/apps/menus/theme_menu.c @@ -182,20 +182,29 @@ static int statusbar_callback_ex(int action,const struct menu_item_ex *this_item } #ifdef HAVE_REMOTE_LCD -static int statusbar_callback_remote(int action,const struct menu_item_ex *this_item) +static int statusbar_callback_remote(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; return statusbar_callback_ex(action, this_item, SCREEN_REMOTE); } #endif -static int statusbar_callback(int action,const struct menu_item_ex *this_item) +static int statusbar_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; return statusbar_callback_ex(action, this_item, SCREEN_MAIN); } #ifdef HAVE_BUTTONBAR -static int buttonbar_callback(int action, const struct menu_item_ex *this_item) +static int buttonbar_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_EXIT_MENUITEM: @@ -369,9 +378,12 @@ MENUITEM_FUNCTION(browse_rfms, MENU_FUNC_USEPARAM, #endif -static int showicons_callback(int action, const struct menu_item_ex *this_item) +static int showicons_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; static bool old_icons; switch (action) { diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c index 94e19b06aa..811996ca40 100644 --- a/apps/menus/time_menu.c +++ b/apps/menus/time_menu.c @@ -93,9 +93,12 @@ MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU), /* This need only be shown if we dont have recording, because if we do then always show the setting item, because there will always be at least 2 items */ -static int alarm_callback(int action,const struct menu_item_ex *this_item) +static int alarm_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_REQUEST_MENUITEM: @@ -204,9 +207,11 @@ static void draw_timedate(struct viewport *vp, struct screen *display) static struct viewport clock_vps[NB_SCREENS], menu[NB_SCREENS]; static bool menu_was_pressed; static int time_menu_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; static int last_redraw = 0; bool redraw = false; diff --git a/apps/onplay.c b/apps/onplay.c index 095a337d6b..7f96246c08 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -143,7 +143,8 @@ static bool clipboard_clip(struct clipboard *clip, const char *path, /* ----------------------------------------------------------------------- */ static int bookmark_menu_callback(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); MENUITEM_FUNCTION(bookmark_create_menu_item, 0, ID2P(LANG_BOOKMARK_MENU_CREATE), bookmark_create_menu, NULL, @@ -156,8 +157,10 @@ MAKE_ONPLAYMENU(bookmark_menu, ID2P(LANG_BOOKMARK_MENU), bookmark_menu_callback, Icon_Bookmark, &bookmark_create_menu_item, &bookmark_load_menu_item); static int bookmark_menu_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void) this_list; switch (action) { case ACTION_REQUEST_MENUITEM: @@ -574,9 +577,11 @@ static int playlist_queue_func(void *param) } static int treeplaylist_wplayback_callback(int action, - const struct menu_item_ex* this_item) + const struct menu_item_ex* this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_REQUEST_MENUITEM: @@ -590,7 +595,8 @@ static int treeplaylist_wplayback_callback(int action, } static int treeplaylist_callback(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); /* insert items */ MENUITEM_FUNCTION(i_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_INSERT), @@ -656,8 +662,10 @@ MAKE_ONPLAYMENU( tree_playlist_menu, ID2P(LANG_CURRENT_PLAYLIST), &replace_pl_item ); static int treeplaylist_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; switch (action) { case ACTION_REQUEST_MENUITEM: @@ -727,7 +735,10 @@ static bool cat_add_to_a_new_playlist(void) return catalog_add_to_a_playlist(selected_file, selected_file_attr, true, NULL); } -static int clipboard_callback(int action,const struct menu_item_ex *this_item); +static int clipboard_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); + static bool set_catalogdir(void) { catalog_set_directory(selected_file); @@ -738,7 +749,9 @@ MENUITEM_FUNCTION(set_catalogdir_item, 0, ID2P(LANG_SET_AS_PLAYLISTCAT_DIR), set_catalogdir, NULL, clipboard_callback, Icon_Playlist); static int cat_playlist_callback(int action, - const struct menu_item_ex *this_item); + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); + MENUITEM_FUNCTION(cat_add_to_list, 0, ID2P(LANG_CATALOG_ADD_TO), cat_add_to_a_playlist, 0, NULL, Icon_Playlist); MENUITEM_FUNCTION(cat_add_to_new, 0, ID2P(LANG_CATALOG_ADD_TO_NEW), @@ -755,9 +768,11 @@ void onplay_show_playlist_cat_menu(char* track_name) } static int cat_playlist_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; if (!selected_file || (((selected_file_attr & FILE_ATTR_MASK) != FILE_ATTR_AUDIO) && ((selected_file_attr & FILE_ATTR_MASK) != FILE_ATTR_M3U) && @@ -1394,9 +1409,12 @@ static int set_rating_inline(void) splash(HZ*2, ID2P(LANG_ID3_NO_INFO)); return 0; } -static int ratingitem_callback(int action,const struct menu_item_ex *this_item) +static int ratingitem_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; switch (action) { case ACTION_REQUEST_MENUITEM: @@ -1426,9 +1444,11 @@ static bool view_cue(void) return false; } static int view_cue_item_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void)this_item; + (void)this_list; struct mp3entry* id3 = audio_current_track(); switch (action) { @@ -1460,7 +1480,10 @@ MENUITEM_FUNCTION(pitch_screen_item, 0, ID2P(LANG_PITCH), #endif /* CONTEXT_[TREE|ID3DB] items */ -static int clipboard_callback(int action,const struct menu_item_ex *this_item); +static int clipboard_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); + MENUITEM_FUNCTION(rename_file_item, 0, ID2P(LANG_RENAME), rename_file, NULL, clipboard_callback, Icon_NOICON); MENUITEM_FUNCTION(clipboard_cut_item, 0, ID2P(LANG_CUT), @@ -1542,8 +1565,11 @@ static bool set_startdir(void) MENUITEM_FUNCTION(set_startdir_item, 0, ID2P(LANG_SET_AS_START_DIR), set_startdir, NULL, clipboard_callback, Icon_file_view_menu); -static int clipboard_callback(int action,const struct menu_item_ex *this_item) +static int clipboard_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; switch (action) { case ACTION_REQUEST_MENUITEM: @@ -1625,7 +1651,10 @@ static int clipboard_callback(int action,const struct menu_item_ex *this_item) return action; } -static int onplaymenu_callback(int action,const struct menu_item_ex *this_item); +static int onplaymenu_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); + /* used when onplay() is called in the CONTEXT_WPS context */ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE), onplaymenu_callback, Icon_Audio, @@ -1659,8 +1688,11 @@ MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE), #endif &set_startdir_item, &add_to_faves_item, &file_menu, ); -static int onplaymenu_callback(int action,const struct menu_item_ex *this_item) +static int onplaymenu_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; switch (action) { case ACTION_TREE_STOP: diff --git a/apps/plugins/2048.c b/apps/plugins/2048.c index 15d3f41191..5dd5a7e99f 100644 --- a/apps/plugins/2048.c +++ b/apps/plugins/2048.c @@ -989,8 +989,11 @@ static enum plugin_status do_game(bool newgame) /* decide if this_item should be shown in the main menu */ /* used to hide resume option when there is no save */ -static int mainmenu_cb(int action, const struct menu_item_ex *this_item) +static int mainmenu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int idx = ((intptr_t)this_item); if(action == ACTION_REQUEST_MENUITEM && !loaded && (idx == 0 || idx == 5)) return ACTION_EXIT_MENUITEM; diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c index 4511d3fad5..d685de9617 100644 --- a/apps/plugins/blackjack.c +++ b/apps/plugins/blackjack.c @@ -1418,8 +1418,11 @@ static bool blackjack_help(void) { return false; } -static int blackjack_menu_cb(int action, const struct menu_item_ex *this_item) +static int blackjack_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = ((intptr_t)this_item); if(action == ACTION_REQUEST_MENUITEM && !resume && (i==0 || i==5)) diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index b0a1b6565b..182ba4f040 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -1530,8 +1530,11 @@ static int brickmania_help(void) return 0; } -static int brickmania_menu_cb(int action, const struct menu_item_ex *this_item) +static int brickmania_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = ((intptr_t)this_item); if(action == ACTION_REQUEST_MENUITEM && !resume && (i==0 || i==6)) diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index e96010ec02..2d163d8bc9 100644 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c @@ -2414,8 +2414,11 @@ static int bubbles_handlebuttons(struct game_context* bb, bool animblock, return BB_NONE; } -static int bubbles_menu_cb(int action, const struct menu_item_ex *this_item) +static int bubbles_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = ((intptr_t)this_item); if(action == ACTION_REQUEST_MENUITEM && !resume && (i==0)) diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c index 4d89530ca9..ded0a70d26 100644 --- a/apps/plugins/calendar.c +++ b/apps/plugins/calendar.c @@ -876,8 +876,11 @@ static void add_memo(struct shown *shown, int type) rb->splash(HZ/2, "Event not added"); } -static int edit_menu_cb(int action, const struct menu_item_ex *this_item) +static int edit_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = (intptr_t)this_item; if (action == ACTION_REQUEST_MENUITEM && memos_in_shown_memory <= 0 && (i==0 || i==1)) diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c index 71e24deb8f..a206192974 100644 --- a/apps/plugins/chopper.c +++ b/apps/plugins/chopper.c @@ -767,8 +767,11 @@ static void chopDrawScene(void) } static bool _ingame; -static int chopMenuCb(int action, const struct menu_item_ex *this_item) +static int chopMenuCb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; if(action == ACTION_REQUEST_MENUITEM && !_ingame && ((intptr_t)this_item)==0) return ACTION_EXIT_MENUITEM; diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c index e80fdeab8b..748090358c 100644 --- a/apps/plugins/clix.c +++ b/apps/plugins/clix.c @@ -744,8 +744,11 @@ static bool clix_help(void) } static bool _ingame; -static int clix_menu_cb(int action, const struct menu_item_ex *this_item) +static int clix_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; if(action == ACTION_REQUEST_MENUITEM && !_ingame && ((intptr_t)this_item)==0) return ACTION_EXIT_MENUITEM; diff --git a/apps/plugins/codebuster.c b/apps/plugins/codebuster.c index ca36d5d01b..956991575d 100644 --- a/apps/plugins/codebuster.c +++ b/apps/plugins/codebuster.c @@ -363,8 +363,11 @@ static void settings_menu(void) { } static bool resume; -static int menu_cb(int action, const struct menu_item_ex *this_item) +static int menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = ((intptr_t)this_item); if ((action == ACTION_REQUEST_MENUITEM) && (!resume && (i==0))) return ACTION_EXIT_MENUITEM; diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c index 6f131e37a6..013e7a37bd 100644 --- a/apps/plugins/disktidy.c +++ b/apps/plugins/disktidy.c @@ -645,8 +645,11 @@ static bool tidy_types_selected(void) return false; } -static int disktidy_menu_cb(int action, const struct menu_item_ex *this_item) +static int disktidy_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int item = ((intptr_t)this_item); if (action == ACTION_REQUEST_MENUITEM && diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 87a9d2fabf..cae3befb5e 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c @@ -1471,8 +1471,11 @@ static bool jewels_help(void) } static bool _ingame; -static int jewels_menu_cb(int action, const struct menu_item_ex *this_item) +static int jewels_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = ((intptr_t)this_item); if(action == ACTION_REQUEST_MENUITEM && !_ingame && (i==0 || i==6)) diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c index d692c88419..914761e73b 100644 --- a/apps/plugins/keybox.c +++ b/apps/plugins/keybox.c @@ -104,9 +104,13 @@ static void do_decrypt(uint32_t* v, uint32_t* k) v[0]=v0; v[1]=v1; } -static int context_item_cb(int action, const struct menu_item_ex *this_item) +static int context_item_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { int i = (intptr_t)this_item; + (void)this_list; + if (action == ACTION_REQUEST_MENUITEM && pw_list.num_entries == 0 && (i != 0 && i != 5)) diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 6b24984130..6820c30dc3 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c @@ -220,9 +220,12 @@ static lua_State* store_luastate(lua_State *L, bool bStore) return LStored; } -static int menu_callback(int action, const struct menu_item_ex *this_item) +static int menu_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { (void) this_item; + (void) this_list; static int lua_ref = LUA_NOREF; lua_State *L = store_luastate(NULL, false); if(!L) @@ -259,7 +262,7 @@ RB_WRAP(do_menu) { /*lua callback function cb(action) return action end */ ref_lua = luaL_ref(L, LUA_REGISTRYINDEX); - menu_callback(ref_lua, NULL); + menu_callback(ref_lua, NULL, NULL); store_luastate(L, true); menu_desc.menu_callback = &menu_callback; } @@ -277,7 +280,7 @@ RB_WRAP(do_menu) { store_luastate(NULL, true); luaL_unref (L, LUA_REGISTRYINDEX, ref_lua); - menu_callback(LUA_NOREF, NULL); + menu_callback(LUA_NOREF, NULL, NULL); } lua_pushinteger(L, result); diff --git a/apps/plugins/mazezam.c b/apps/plugins/mazezam.c index 759ca6477d..423b09288d 100644 --- a/apps/plugins/mazezam.c +++ b/apps/plugins/mazezam.c @@ -853,8 +853,11 @@ static void resume_save_data (struct resume_data *r, struct resume_data *old) * Manages the main menu ******************************************************************************/ static bool have_continue; -static int main_menu_cb(int action, const struct menu_item_ex *this_item) +static int main_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; if(action == ACTION_REQUEST_MENUITEM && !have_continue && ((intptr_t)this_item)==0) return ACTION_EXIT_MENUITEM; diff --git a/apps/plugins/mpegplayer/mpeg_misc.c b/apps/plugins/mpegplayer/mpeg_misc.c index 7b73c7c376..c85285f4f8 100644 --- a/apps/plugins/mpegplayer/mpeg_misc.c +++ b/apps/plugins/mpegplayer/mpeg_misc.c @@ -183,8 +183,11 @@ long mpeg_sysevent(void) return mpeg_sysevent_id; } -int mpeg_sysevent_callback(int btn, const struct menu_item_ex *menu) +int mpeg_sysevent_callback(int btn, + const struct menu_item_ex *menu, + struct gui_synclist *this_list) { + (void) this_list; switch (btn) { case SYS_USB_CONNECTED: @@ -218,6 +221,6 @@ int mpeg_button_get(int timeout) /* Produce keyclick */ rb->keyclick_click(true, button); - return mpeg_sysevent_callback(button, NULL); + return mpeg_sysevent_callback(button, NULL, NULL); } diff --git a/apps/plugins/mpegplayer/mpeg_misc.h b/apps/plugins/mpegplayer/mpeg_misc.h index 6626bba594..e04db0e19d 100644 --- a/apps/plugins/mpegplayer/mpeg_misc.h +++ b/apps/plugins/mpegplayer/mpeg_misc.h @@ -241,7 +241,8 @@ void mpeg_sysevent_set(void); long mpeg_sysevent(void); /* Call with a system event code and used as menu callback */ -int mpeg_sysevent_callback(int btn, const struct menu_item_ex *menu); +int mpeg_sysevent_callback(int btn, const struct menu_item_ex *menu, + struct gui_synclist *this_list); /* Handle recorded event */ void mpeg_sysevent_handle(void); diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c index b638f2feeb..e000e98d33 100644 --- a/apps/plugins/pegbox.c +++ b/apps/plugins/pegbox.c @@ -1316,8 +1316,12 @@ static bool pegbox_help(void) * pegbox_menu() is the game menu ************************************************************************/ static bool _ingame; -static int pegbox_menu_cb(int action, const struct menu_item_ex *this_item) +static int pegbox_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; + int i = (intptr_t)this_item; if( action == ACTION_REQUEST_MENUITEM ) { diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index 45733c12a3..3bae2e1e64 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c @@ -2827,8 +2827,11 @@ static void debug_menu(void) } #endif -static int pausemenu_cb(int action, const struct menu_item_ex *this_item) +static int pausemenu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = (intptr_t) this_item; if(action == ACTION_REQUEST_MENUITEM) { diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index 93479c5c56..b6cf6e5470 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -1512,8 +1512,11 @@ static bool rockblox_help(void) return false; } -static int rockblox_menu_cb(int action, const struct menu_item_ex *this_item) +static int rockblox_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = ((intptr_t)this_item); if(action == ACTION_REQUEST_MENUITEM && !resume && (i==0 || i==5)) diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c index c885f4ccae..f60ddfe3de 100644 --- a/apps/plugins/snake.c +++ b/apps/plugins/snake.c @@ -496,8 +496,11 @@ static void snake_game_init(void) { board[11][7]=1; } -static int snake_menu_cb(int action, const struct menu_item_ex *this_item) +static int snake_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; if(action == ACTION_REQUEST_MENUITEM && !ingame && ((intptr_t)this_item)==0) return ACTION_EXIT_MENUITEM; diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index c743634279..b830edf857 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c @@ -1060,8 +1060,11 @@ void solitaire_init(void); enum { MENU_RESUME, MENU_SAVE_AND_QUIT, MENU_QUIT, MENU_USB }; static bool _ingame; -static int solitaire_menu_cb(int action, const struct menu_item_ex *this_item) +static int solitaire_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int i = (intptr_t)this_item; if( action == ACTION_REQUEST_MENUITEM ) { diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c index 91bf7757de..ede67291b0 100644 --- a/apps/plugins/spacerocks.c +++ b/apps/plugins/spacerocks.c @@ -1929,8 +1929,11 @@ static bool spacerocks_help(void) #define PLUGIN_OTHER 10 static bool ingame; -static int spacerocks_menu_cb(int action, const struct menu_item_ex *this_item) +static int spacerocks_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; if (action == ACTION_REQUEST_MENUITEM && !ingame && ((intptr_t)this_item)==0) return ACTION_EXIT_MENUITEM; diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index f86992f240..b923e23986 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c @@ -1154,8 +1154,11 @@ static bool save_game(void) } /* the main menu */ -static int xobox_menu_cb(int action, const struct menu_item_ex *this_item) +static int xobox_menu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; intptr_t item = (intptr_t)this_item; if(action == ACTION_REQUEST_MENUITEM && !_ingame && (item == 0 || item == 6)) diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c index 22fc92f7e2..1416a40577 100644 --- a/apps/plugins/xworld/sys.c +++ b/apps/plugins/xworld/sys.c @@ -311,8 +311,11 @@ static void sys_reset_settings(struct System* sys) static struct System* mainmenu_sysptr; -static int mainmenu_cb(int action, const struct menu_item_ex *this_item) +static int mainmenu_cb(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; int idx = ((intptr_t)this_item); if(action == ACTION_REQUEST_MENUITEM && !mainmenu_sysptr->loaded && (idx == 0 || idx == 8 || idx == 10)) return ACTION_EXIT_MENUITEM; diff --git a/apps/radio/presets.c b/apps/radio/presets.c index 368cb71e14..98a33d14ad 100644 --- a/apps/radio/presets.c +++ b/apps/radio/presets.c @@ -433,12 +433,14 @@ MENUITEM_FUNCTION(radio_delete_preset_item, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_FM_DELETE_PRESET), radio_delete_preset, NULL, NULL, Icon_NOICON); static int radio_preset_callback(int action, - const struct menu_item_ex *this_item) + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { if (action == ACTION_STD_OK) action = ACTION_EXIT_AFTER_THIS_MENUITEM; return action; (void)this_item; + (void)this_list; } MAKE_MENU(handle_radio_preset_menu, ID2P(LANG_PRESET), radio_preset_callback, Icon_NOICON, &radio_edit_preset_item, diff --git a/apps/root_menu.c b/apps/root_menu.c index 584328bd4b..49379bbbfc 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -437,7 +437,9 @@ static const struct root_items items[] = { }; static const int nb_items = sizeof(items)/sizeof(*items); -static int item_callback(int action, const struct menu_item_ex *this_item) ; +static int item_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list); MENUITEM_RETURNVALUE(shortcut_menu, ID2P(LANG_SHORTCUTS), GO_TO_SHORTCUTMENU, NULL, Icon_Bookmark); @@ -621,8 +623,11 @@ bool root_menu_is_changed(void* setting, void* defaultval) return *(bool*)setting; } -static int item_callback(int action, const struct menu_item_ex *this_item) +static int item_callback(int action, + const struct menu_item_ex *this_item, + struct gui_synclist *this_list) { + (void)this_list; switch (action) { case ACTION_TREE_STOP: -- cgit