diff --git a/menu/cbs/menu_cbs_contentlist_switch.c b/menu/cbs/menu_cbs_contentlist_switch.c index 65d0af05ba..001047b865 100644 --- a/menu/cbs/menu_cbs_contentlist_switch.c +++ b/menu/cbs/menu_cbs_contentlist_switch.c @@ -22,13 +22,14 @@ cbs->action_content_list_switch_ident = #name; #endif -static int deferred_push_content_list(void *data, void *userdata, +static int deferred_push_content_list(void *data, + void *data2, void *userdata, const char *path, const char *label, unsigned type) { file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); menu_navigation_set_selection(0); - return action_refresh_default((file_list_t*)data, selection_buf); + return action_refresh_default(data, (file_list_t*)data2, selection_buf); } int menu_cbs_init_bind_content_list_switch(menu_file_list_cbs_t *cbs, diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index 04a403ca2e..322d10ff0b 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -309,7 +309,8 @@ static int generic_shader_action_parameter_left( return 0; } -static int shader_action_parameter_left(unsigned type, const char *label, bool wraparound) +static int shader_action_parameter_left(void *data, + unsigned type, const char *label, bool wraparound) { video_shader_ctx_t shader_info; struct video_shader *shader = menu_shader_get(); @@ -333,7 +334,8 @@ static int shader_action_parameter_left(unsigned type, const char *label, bool w return ret; } -static int action_left_cheat(unsigned type, const char *label, +static int action_left_cheat(void *data, + unsigned type, const char *label, bool wraparound) { size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN; @@ -341,8 +343,9 @@ static int action_left_cheat(unsigned type, const char *label, wraparound); } -static int action_left_input_desc(unsigned type, const char *label, - bool wraparound) +static int action_left_input_desc(void *data, + unsigned type, const char *label, + bool wraparound) { rarch_system_info_t *system = runloop_get_system_info(); settings_t *settings = config_get_ptr(); @@ -370,13 +373,14 @@ static int action_left_input_desc(unsigned type, const char *label, also skip all the axes until analog remapping is implemented */ if ((string_is_empty(system->input_desc_btn[user_idx][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END) /*|| (remap_idx >= RARCH_FIRST_CUSTOM_BIND && remap_idx < RARCH_CUSTOM_BIND_LIST_END)*/) - action_left_input_desc(type, label, wraparound); + action_left_input_desc(data,type, label, wraparound); return 0; } -static int action_left_input_desc_kbd(unsigned type, const char *label, - bool wraparound) +static int action_left_input_desc_kbd(void *data, + unsigned type, const char *label, + bool wraparound) { unsigned remap_id; unsigned key_id, id, offset; @@ -411,7 +415,8 @@ static int action_left_input_desc_kbd(unsigned type, const char *label, return 0; } -static int action_left_scroll(unsigned type, const char *label, +static int action_left_scroll(void *data, + unsigned type, const char *label, bool wraparound) { size_t scroll_accel = 0; @@ -439,14 +444,15 @@ static int action_left_scroll(unsigned type, const char *label, return 0; } -static int action_left_mainmenu(unsigned type, const char *label, +static int action_left_mainmenu(void *data, + unsigned type, const char *label, bool wraparound) { menu_ctx_list_t list_info; unsigned push_list = 0; - menu_handle_t *menu = NULL; + menu_handle_t *menu = (menu_handle_t*)data; - if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + if (!menu) return menu_cbs_exit(); menu_driver_ctl(RARCH_MENU_CTL_LIST_GET_SELECTION, &list_info); @@ -485,12 +491,12 @@ static int action_left_mainmenu(unsigned type, const char *label, menu_driver_ctl(RARCH_MENU_CTL_LIST_CACHE, &list_info); if (cbs && cbs->action_content_list_switch) - return cbs->action_content_list_switch( + return cbs->action_content_list_switch(menu, selection_buf, menu_stack, "", "", 0); } break; case 2: - action_left_scroll(0, "", false); + action_left_scroll(data, 0, "", false); break; case 0: default: @@ -500,7 +506,8 @@ static int action_left_mainmenu(unsigned type, const char *label, return 0; } -static int action_left_shader_scale_pass(unsigned type, const char *label, +static int action_left_shader_scale_pass(void *data, + unsigned type, const char *label, bool wraparound) { unsigned current_scale, delta; @@ -522,7 +529,8 @@ static int action_left_shader_scale_pass(unsigned type, const char *label, return 0; } -static int action_left_shader_filter_pass(unsigned type, const char *label, +static int action_left_shader_filter_pass(void *data, + unsigned type, const char *label, bool wraparound) { unsigned delta = 2; @@ -537,7 +545,8 @@ static int action_left_shader_filter_pass(unsigned type, const char *label, return 0; } -static int action_left_shader_filter_default(unsigned type, const char *label, +static int action_left_shader_filter_default(void *data, + unsigned type, const char *label, bool wraparound) { rarch_setting_t *setting = menu_setting_find_enum( @@ -548,7 +557,8 @@ static int action_left_shader_filter_default(unsigned type, const char *label, setting_get_type(setting), MENU_ACTION_LEFT, wraparound); } -static int action_left_cheat_num_passes(unsigned type, const char *label, +static int action_left_cheat_num_passes(void *data, + unsigned type, const char *label, bool wraparound) { bool refresh = false; @@ -563,7 +573,8 @@ static int action_left_cheat_num_passes(unsigned type, const char *label, return 0; } -static int action_left_shader_num_passes(unsigned type, const char *label, +static int action_left_shader_num_passes(void *data, + unsigned type, const char *label, bool wraparound) { bool refresh = false; @@ -583,7 +594,8 @@ static int action_left_shader_num_passes(unsigned type, const char *label, return 0; } -static int action_left_netplay_mitm_server(unsigned type, const char *label, +static int action_left_netplay_mitm_server(void *data, + unsigned type, const char *label, bool wraparound) { settings_t *settings = config_get_ptr(); @@ -600,13 +612,17 @@ static int action_left_netplay_mitm_server(unsigned type, const char *label, if (i - 1 >= 0) { found = true; - strlcpy(settings->arrays.netplay_mitm_server, netplay_mitm_server_list[i - 1].name, sizeof(settings->arrays.netplay_mitm_server)); + strlcpy(settings->arrays.netplay_mitm_server, + netplay_mitm_server_list[i - 1].name, + sizeof(settings->arrays.netplay_mitm_server)); break; } else if (wraparound) { found = true; - strlcpy(settings->arrays.netplay_mitm_server, netplay_mitm_server_list[list_len - 1].name, sizeof(settings->arrays.netplay_mitm_server)); + strlcpy(settings->arrays.netplay_mitm_server, + netplay_mitm_server_list[list_len - 1].name, + sizeof(settings->arrays.netplay_mitm_server)); break; } } @@ -615,13 +631,16 @@ static int action_left_netplay_mitm_server(unsigned type, const char *label, if (!found) { /* current entry was invalid, go back to the end */ - strlcpy(settings->arrays.netplay_mitm_server, netplay_mitm_server_list[list_len - 1].name, sizeof(settings->arrays.netplay_mitm_server)); + strlcpy(settings->arrays.netplay_mitm_server, + netplay_mitm_server_list[list_len - 1].name, + sizeof(settings->arrays.netplay_mitm_server)); } return 0; } -static int action_left_shader_watch_for_changes(unsigned type, const char *label, +static int action_left_shader_watch_for_changes(void *data, + unsigned type, const char *label, bool wraparound) { settings_t *settings = config_get_ptr(); @@ -629,14 +648,16 @@ static int action_left_shader_watch_for_changes(unsigned type, const char *label return 0; } -static int action_left_video_resolution(unsigned type, const char *label, +static int action_left_video_resolution(void *data, + unsigned type, const char *label, bool wraparound) { video_driver_get_prev_video_out(); return 0; } -static int playlist_association_left(unsigned type, const char *label, +static int playlist_association_left(void *data, + unsigned type, const char *label, bool wraparound) { unsigned i; @@ -699,7 +720,8 @@ static int playlist_association_left(unsigned type, const char *label, return 0; } -static int core_setting_left(unsigned type, const char *label, +static int core_setting_left(void *data, + unsigned type, const char *label, bool wraparound) { unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; @@ -709,14 +731,16 @@ static int core_setting_left(unsigned type, const char *label, return 0; } -static int disk_options_disk_idx_left(unsigned type, const char *label, +static int disk_options_disk_idx_left(void *data, + unsigned type, const char *label, bool wraparound) { command_event(CMD_EVENT_DISK_PREV, NULL); return 0; } -static int bind_left_generic(unsigned type, const char *label, +static int bind_left_generic(void *data, + unsigned type, const char *label, bool wraparound) { return menu_setting_set(type, label, MENU_ACTION_LEFT, wraparound); diff --git a/menu/cbs/menu_cbs_refresh.c b/menu/cbs/menu_cbs_refresh.c index 54881cfba6..87dba26f59 100644 --- a/menu/cbs/menu_cbs_refresh.c +++ b/menu/cbs/menu_cbs_refresh.c @@ -22,16 +22,18 @@ cbs->action_refresh_ident = #name; #endif -int action_refresh_default(file_list_t *list, file_list_t *menu_list) +int action_refresh_default(void *data, + file_list_t *list, file_list_t *menu_list) { menu_displaylist_ctx_entry_t entry; + menu_handle_t *menu = (menu_handle_t*)data; if (!menu_list) return -1; entry.list = list; entry.stack = menu_list; - if (!menu_displaylist_push(&entry)) + if (!menu_displaylist_push(&entry, menu)) return -1; return 0; } diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index 0f2fa245a6..80572ebf28 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -43,7 +43,7 @@ #ifndef BIND_ACTION_RIGHT #define BIND_ACTION_RIGHT(cbs, name) \ do { \ - cbs->action_right = name; \ + cbs->action_right = name; \ cbs->action_right_ident = #name; \ } while(0) #endif @@ -61,7 +61,8 @@ static int generic_shader_action_parameter_right(struct video_shader_parameter * return 0; } -int shader_action_parameter_right(unsigned type, const char *label, bool wraparound) +int shader_action_parameter_right(void *data, + unsigned type, const char *label, bool wraparound) { video_shader_ctx_t shader_info; struct video_shader *shader = menu_shader_get(); @@ -93,7 +94,8 @@ int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label, return 0; } -int action_right_cheat(unsigned type, const char *label, +int action_right_cheat(void *data, + unsigned type, const char *label, bool wraparound) { size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN; @@ -101,7 +103,8 @@ int action_right_cheat(unsigned type, const char *label, wraparound); } -int action_right_input_desc_kbd(unsigned type, const char *label, +int action_right_input_desc_kbd(void *data, + unsigned type, const char *label, bool wraparound) { unsigned key_id, id, offset; @@ -140,7 +143,8 @@ int action_right_input_desc_kbd(unsigned type, const char *label, } /* fix-me: incomplete, lacks error checking */ -int action_right_input_desc(unsigned type, const char *label, +int action_right_input_desc(void *data, + unsigned type, const char *label, bool wraparound) { rarch_system_info_t *system = runloop_get_system_info(); @@ -166,7 +170,7 @@ int action_right_input_desc(unsigned type, const char *label, also skip all the axes until analog remapping is implemented */ if ((string_is_empty(system->input_desc_btn[user_idx][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END) /*|| (remap_idx >= RARCH_FIRST_CUSTOM_BIND && remap_idx < RARCH_CUSTOM_BIND_LIST_END)*/) - action_right_input_desc(type, label, wraparound); + action_right_input_desc(data, type, label, wraparound); #if 0 int i = 0; @@ -178,7 +182,8 @@ int action_right_input_desc(unsigned type, const char *label, return 0; } -static int action_right_scroll(unsigned type, const char *label, +static int action_right_scroll(void *data, + unsigned type, const char *label, bool wraparound) { size_t scroll_accel = 0; @@ -207,7 +212,7 @@ static int action_right_scroll(unsigned type, const char *label, return 0; } -static int action_right_goto_tab(void) +static int action_right_goto_tab(menu_handle_t *menu) { menu_ctx_list_t list_info; file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); @@ -222,13 +227,14 @@ static int action_right_goto_tab(void) menu_driver_ctl(RARCH_MENU_CTL_LIST_CACHE, &list_info); if (cbs && cbs->action_content_list_switch) - return cbs->action_content_list_switch(selection_buf, menu_stack, + return cbs->action_content_list_switch(menu, selection_buf, menu_stack, "", "", 0); return 0; } -static int action_right_mainmenu(unsigned type, const char *label, +static int action_right_mainmenu(void *data, + unsigned type, const char *label, bool wraparound) { menu_ctx_list_t list_info; @@ -253,15 +259,16 @@ static int action_right_mainmenu(unsigned type, const char *label, if ((list_info.selection != (list_horiz_info.size + list_tabs_info.size)) || settings->bools.menu_navigation_wraparound_enable) - return action_right_goto_tab(); + return action_right_goto_tab((menu_handle_t*)data); } else - action_right_scroll(0, "", false); + action_right_scroll(data, 0, "", false); return 0; } -static int action_right_shader_scale_pass(unsigned type, const char *label, +static int action_right_shader_scale_pass(void *data, + unsigned type, const char *label, bool wraparound) { unsigned current_scale, delta; @@ -282,7 +289,8 @@ static int action_right_shader_scale_pass(unsigned type, const char *label, return 0; } -static int action_right_shader_filter_pass(unsigned type, const char *label, +static int action_right_shader_filter_pass(void *data, + unsigned type, const char *label, bool wraparound) { unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0; @@ -297,7 +305,8 @@ static int action_right_shader_filter_pass(unsigned type, const char *label, return 0; } -static int action_right_shader_filter_default(unsigned type, const char *label, +static int action_right_shader_filter_default(void *data, + unsigned type, const char *label, bool wraparound) { rarch_setting_t *setting = menu_setting_find_enum(MENU_ENUM_LABEL_VIDEO_SMOOTH); @@ -308,13 +317,13 @@ static int action_right_shader_filter_default(unsigned type, const char *label, wraparound); } -static int action_right_cheat_num_passes(unsigned type, const char *label, +static int action_right_cheat_num_passes(void *data, + unsigned type, const char *label, bool wraparound) { bool refresh = false; - unsigned new_size = 0; + unsigned new_size = cheat_manager_get_size() + 1; - new_size = cheat_manager_get_size() + 1; menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL); cheat_manager_realloc(new_size); @@ -322,7 +331,8 @@ static int action_right_cheat_num_passes(unsigned type, const char *label, return 0; } -static int action_right_shader_num_passes(unsigned type, const char *label, +static int action_right_shader_num_passes(void *data, + unsigned type, const char *label, bool wraparound) { bool refresh = false; @@ -342,7 +352,8 @@ static int action_right_shader_num_passes(unsigned type, const char *label, return 0; } -static int action_right_netplay_mitm_server(unsigned type, const char *label, +static int action_right_netplay_mitm_server(void *data, + unsigned type, const char *label, bool wraparound) { settings_t *settings = config_get_ptr(); @@ -380,22 +391,26 @@ static int action_right_netplay_mitm_server(unsigned type, const char *label, return 0; } -static int action_right_shader_watch_for_changes(unsigned type, const char *label, +static int action_right_shader_watch_for_changes(void *data, + unsigned type, const char *label, bool wraparound) { settings_t *settings = config_get_ptr(); - settings->bools.video_shader_watch_files = !settings->bools.video_shader_watch_files; + settings->bools.video_shader_watch_files = + !settings->bools.video_shader_watch_files; return 0; } -static int action_right_video_resolution(unsigned type, const char *label, +static int action_right_video_resolution(void *data, + unsigned type, const char *label, bool wraparound) { video_driver_get_next_video_out(); return 0; } -static int playlist_association_right(unsigned type, const char *label, +static int playlist_association_right(void *data, + unsigned type, const char *label, bool wraparound) { char core_path[PATH_MAX_LENGTH]; @@ -454,7 +469,8 @@ static int playlist_association_right(unsigned type, const char *label, return 0; } -int core_setting_right(unsigned type, const char *label, +int core_setting_right(void *data, + unsigned type, const char *label, bool wraparound) { unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START; @@ -464,7 +480,8 @@ int core_setting_right(unsigned type, const char *label, return 0; } -static int disk_options_disk_idx_right(unsigned type, const char *label, +static int disk_options_disk_idx_right(void *data, + unsigned type, const char *label, bool wraparound) { command_event(CMD_EVENT_DISK_NEXT, NULL); @@ -472,7 +489,8 @@ static int disk_options_disk_idx_right(unsigned type, const char *label, return 0; } -int bind_right_generic(unsigned type, const char *label, +int bind_right_generic(void *data, + unsigned type, const char *label, bool wraparound) { return menu_setting_set(type, label, MENU_ACTION_RIGHT, wraparound); diff --git a/menu/cbs/menu_cbs_select.c b/menu/cbs/menu_cbs_select.c index 8d31efe823..6f3e821e87 100644 --- a/menu/cbs/menu_cbs_select.c +++ b/menu/cbs/menu_cbs_select.c @@ -120,47 +120,74 @@ static int action_select_path_use_directory(const char *path, path, label, type, idx, 0 /* unused */); } -static int action_select_driver_setting(const char *path, const char *label, unsigned type, +static int action_select_driver_setting(const char *path, + const char *label, unsigned type, size_t idx) { - return bind_right_generic(type, label, true); + menu_handle_t *menu = NULL; + if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + return menu_cbs_exit(); + return bind_right_generic(menu, type, label, true); } -static int action_select_core_setting(const char *path, const char *label, unsigned type, +static int action_select_core_setting(const char *path, + const char *label, unsigned type, size_t idx) { - return core_setting_right(type, label, true); + menu_handle_t *menu = NULL; + if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + return menu_cbs_exit(); + return core_setting_right(menu, type, label, true); } -static int shader_action_parameter_select(const char *path, const char *label, unsigned type, +static int shader_action_parameter_select(const char *path, + const char *label, unsigned type, size_t idx) { - return shader_action_parameter_right(type, label, true); + menu_handle_t *menu = NULL; + if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + return menu_cbs_exit(); + return shader_action_parameter_right(menu, type, label, true); } -static int shader_action_parameter_preset_select(const char *path, const char *label, unsigned type, +static int shader_action_parameter_preset_select(const char *path, + const char *label, unsigned type, size_t idx) { - return shader_action_parameter_right(type, label, true); + menu_handle_t *menu = NULL; + if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + return menu_cbs_exit(); + return shader_action_parameter_right(menu, type, label, true); } -static int action_select_cheat(const char *path, const char *label, unsigned type, +static int action_select_cheat(const char *path, + const char *label, unsigned type, size_t idx) { - return action_right_cheat(type, label, true); + menu_handle_t *menu = NULL; + if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + return menu_cbs_exit(); + return action_right_cheat(menu, type, label, true); } -static int action_select_input_desc(const char *path, const char *label, unsigned type, +static int action_select_input_desc(const char *path, + const char *label, unsigned type, size_t idx) { - return action_right_input_desc(type, label, true); + menu_handle_t *menu = NULL; + if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + return menu_cbs_exit(); + return action_right_input_desc(menu, type, label, true); } static int action_select_input_desc_kbd(const char *path, const char *label, unsigned type, size_t idx) { - return action_right_input_desc_kbd(type, label, true); + menu_handle_t *menu = NULL; + if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + return menu_cbs_exit(); + return action_right_input_desc_kbd(menu, type, label, true); } #ifdef HAVE_NETWORKING diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 1e0c9344eb..c4b040e231 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -2354,7 +2354,8 @@ static int materialui_pointer_up(void *data, materialui_preswitch_tabs(mui, action); if (cbs && cbs->action_content_list_switch) - return cbs->action_content_list_switch(selection_buf, menu_stack, + return cbs->action_content_list_switch(data, + selection_buf, menu_stack, "", "", 0); } } diff --git a/menu/menu_cbs.h b/menu/menu_cbs.h index b5f14aa2c3..5083466d18 100644 --- a/menu/menu_cbs.h +++ b/menu/menu_cbs.h @@ -129,9 +129,11 @@ enum /* Function callbacks */ -int action_refresh_default(file_list_t *list, file_list_t *menu_list); +int action_refresh_default(void *data, + file_list_t *list, file_list_t *menu_list); -int shader_action_parameter_right(unsigned type, const char *label, bool wraparound); +int shader_action_parameter_right(void *data, + unsigned type, const char *label, bool wraparound); int generic_action_ok_displaylist_push(void *data, const char *path, const char *new_path, @@ -154,16 +156,16 @@ int generic_action_cheat_toggle(size_t idx, unsigned type, const char *label, bool wraparound); -int core_setting_right(unsigned type, const char *label, +int core_setting_right(void *data, unsigned type, const char *label, bool wraparound); -int action_right_input_desc(unsigned type, const char *label, +int action_right_input_desc(void *data, unsigned type, const char *label, bool wraparound); -int action_right_input_desc_kbd(unsigned type, const char *label, +int action_right_input_desc_kbd(void *data, unsigned type, const char *label, bool wraparound); -int action_right_cheat(unsigned type, const char *label, +int action_right_cheat(void *data, unsigned type, const char *label, bool wraparound); int setting_action_ok_video_refresh_rate_auto(void *data, bool wraparound); @@ -264,8 +266,9 @@ int action_scan_file(const char *path, const char *label, unsigned type, size_t idx); #endif -int bind_right_generic(unsigned type, const char *label, - bool wraparound); +int bind_right_generic(void *data, + unsigned type, const char *label, + bool wraparound); /* This sets up all the callback functions for a menu entry. * diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index e192883774..af25053750 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3904,7 +3904,7 @@ static bool menu_displaylist_push_internal( return false; } -bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry) +bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry, void *data) { menu_displaylist_info_t info; menu_file_list_cbs_t *cbs = NULL; @@ -3913,11 +3913,9 @@ bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry) unsigned type = 0; bool ret = false; enum msg_hash_enums enum_idx = MSG_UNKNOWN; - menu_handle_t *menu = NULL; + menu_handle_t *menu = (menu_handle_t*)data; - if (!entry) - return false; - if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) + if (!entry || !menu) return false; menu_displaylist_info_init(&info); diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 9614c11535..45c66069f0 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -218,7 +218,7 @@ typedef struct menu_displaylist_ctx_entry bool menu_displaylist_process(menu_displaylist_info_t *info); -bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry); +bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry, void *data); void menu_displaylist_info_free(menu_displaylist_info_t *info); diff --git a/menu/menu_entries.h b/menu/menu_entries.h index 57e5f1b604..069c3ead24 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -116,11 +116,15 @@ typedef struct menu_file_list_cbs size_t idx); int (*action_start)(unsigned type, const char *label); int (*action_info)(unsigned type, const char *label); - int (*action_content_list_switch)(void *data, void *userdata, const char + int (*action_content_list_switch)(void *data, + void *data2, void *userdata, const char *path, const char *label, unsigned type); - int (*action_left)(unsigned type, const char *label, bool wraparound); - int (*action_right)(unsigned type, const char *label, bool wraparound); - int (*action_refresh)(file_list_t *list, file_list_t *menu_list); + int (*action_left)(void *data, + unsigned type, const char *label, bool wraparound); + int (*action_right)(void *data, + unsigned type, const char *label, bool wraparound); + int (*action_refresh)(void *data, + file_list_t *list, file_list_t *menu_list); int (*action_up)(unsigned type, const char *label); int (*action_label)(file_list_t *list, unsigned type, unsigned i, diff --git a/menu/widgets/menu_entry.c b/menu/widgets/menu_entry.c index 6e6aea9007..85175600cd 100644 --- a/menu/widgets/menu_entry.c +++ b/menu/widgets/menu_entry.c @@ -466,11 +466,11 @@ int menu_entry_action(menu_entry_t *entry, break; case MENU_ACTION_LEFT: if (cbs && cbs->action_left) - ret = cbs->action_left(entry->type, entry->label, false); + ret = cbs->action_left(data, entry->type, entry->label, false); break; case MENU_ACTION_RIGHT: if (cbs && cbs->action_right) - ret = cbs->action_right(entry->type, entry->label, false); + ret = cbs->action_right(data, entry->type, entry->label, false); break; case MENU_ACTION_INFO: if (cbs && cbs->action_info) @@ -504,7 +504,7 @@ int menu_entry_action(menu_entry_t *entry, bool refresh = false; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); - cbs->action_refresh(selection_buf, menu_stack); + cbs->action_refresh(data, selection_buf, menu_stack); menu_entries_ctl(MENU_ENTRIES_CTL_UNSET_REFRESH, &refresh); } }