Less pointer grabbbing - reduce usage of RARCH_MENU_CTL_DRIVER_DATA_GET

This commit is contained in:
twinaphex 2018-04-10 19:57:33 +02:00
parent b4a2bd5156
commit fbf03df8be
13 changed files with 118 additions and 109 deletions

View File

@ -53,7 +53,7 @@ enum
static int deferred_push_dlist(menu_displaylist_info_t *info,
void *data, enum menu_displaylist_ctl_state state)
{
if (!menu_displaylist_ctl(state, info))
if (!menu_displaylist_ctl(state, info, data))
return menu_cbs_exit();
menu_displaylist_process(info);
return 0;

View File

@ -33,6 +33,7 @@
static int action_info_default(unsigned type, const char *label)
{
menu_displaylist_info_t info;
menu_handle_t *menu = NULL;
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
size_t selection = menu_navigation_get_selection();
@ -44,7 +45,9 @@ static int action_info_default(unsigned type, const char *label)
info.label = strdup(
msg_hash_to_str(MENU_ENUM_LABEL_INFO_SCREEN));
if (!menu_displaylist_ctl(DISPLAYLIST_HELP, &info))
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
if (!menu_displaylist_ctl(DISPLAYLIST_HELP, &info, menu))
goto error;
if (!menu_displaylist_process(&info))

View File

@ -834,7 +834,7 @@ int generic_action_ok_displaylist_push(
if (info_path)
info.path = strdup(info_path);
if (menu_displaylist_ctl(dl_type, &info))
if (menu_displaylist_ctl(dl_type, &info, menu))
{
if (menu_displaylist_process(&info))
{

View File

@ -1962,9 +1962,11 @@ static void materialui_populate_entries(
}
/* Context reset is called on launch or when a core is launched */
static void materialui_context_reset(void *data, bool is_threaded)
static void materialui_context_reset(void *data, void *userdata,
bool is_threaded)
{
materialui_handle_t *mui = (materialui_handle_t*)data;
menu_handle_t *menu = (menu_handle_t*)data;
materialui_handle_t *mui = (materialui_handle_t*)userdata;
settings_t *settings = config_get_ptr();
if (!mui || !settings)
@ -2160,7 +2162,7 @@ static int materialui_list_push(void *data, void *userdata,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
{
entry.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#ifndef HAVE_DYNAMIC
@ -2170,39 +2172,39 @@ static int materialui_list_push(void *data, void *userdata,
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
}
if (system->load_no_content)
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
if (settings->bools.menu_show_load_content)
{
entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
if (settings->bools.menu_content_show_history)
{
entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#if defined(HAVE_NETWORKING)
#ifdef HAVE_LAKKA
entry.enum_idx = MENU_ENUM_LABEL_UPDATE_LAKKA;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
#else
{
settings_t *settings = config_get_ptr();
if (settings->bools.menu_show_online_updater)
{
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
}
#endif
@ -2210,42 +2212,42 @@ static int materialui_list_push(void *data, void *userdata,
if (settings->bools.menu_content_show_netplay)
{
entry.enum_idx = MENU_ENUM_LABEL_NETPLAY;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#endif
if (settings->bools.menu_show_information)
{
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#ifndef HAVE_DYNAMIC
entry.enum_idx = MENU_ENUM_LABEL_RESTART_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
#endif
if (settings->bools.menu_show_configurations)
{
entry.enum_idx = MENU_ENUM_LABEL_CONFIGURATIONS_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
if (settings->bools.menu_show_help)
{
entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#if !defined(IOS)
entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
#endif
#if defined(HAVE_LAKKA)
if (settings->bools.menu_show_reboot)
{
entry.enum_idx = MENU_ENUM_LABEL_REBOOT;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
entry.enum_idx = MENU_ENUM_LABEL_SHUTDOWN;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
#endif
info->need_push = true;
ret = 0;

View File

@ -282,7 +282,7 @@ bool generic_menu_init_list(void *data)
info.list = selection_buf;
if (menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info))
if (menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info, data))
menu_displaylist_process(&info);
menu_displaylist_info_free(&info);

View File

@ -1973,7 +1973,7 @@ static void xmb_context_destroy_horizontal_list(xmb_handle_t *xmb)
}
}
static void xmb_init_horizontal_list(xmb_handle_t *xmb)
static void xmb_init_horizontal_list(menu_handle_t *menu, xmb_handle_t *xmb)
{
menu_displaylist_info_t info;
settings_t *settings = config_get_ptr();
@ -1992,7 +1992,8 @@ static void xmb_init_horizontal_list(xmb_handle_t *xmb)
if (!string_is_empty(info.path))
{
if (menu_displaylist_ctl(DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL, &info))
if (menu_displaylist_ctl(DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL,
&info, menu))
{
size_t i;
for (i = 0; i < xmb->horizontal_list->size; i++)
@ -2031,6 +2032,7 @@ static void xmb_toggle_horizontal_list(xmb_handle_t *xmb)
}
static void xmb_context_reset_horizontal_list(
menu_handle_t *menu,
xmb_handle_t *xmb)
{
unsigned i;
@ -2134,7 +2136,7 @@ static void xmb_context_reset_horizontal_list(
xmb_toggle_horizontal_list(xmb);
}
static void xmb_refresh_horizontal_list(xmb_handle_t *xmb)
static void xmb_refresh_horizontal_list(menu_handle_t *menu, xmb_handle_t *xmb)
{
xmb_context_destroy_horizontal_list(xmb);
if (xmb->horizontal_list)
@ -2150,9 +2152,9 @@ static void xmb_refresh_horizontal_list(xmb_handle_t *xmb)
calloc(1, sizeof(file_list_t));
if (xmb->horizontal_list)
xmb_init_horizontal_list(xmb);
xmb_init_horizontal_list(menu, xmb);
xmb_context_reset_horizontal_list(xmb);
xmb_context_reset_horizontal_list(menu, xmb);
}
static int xmb_environ(enum menu_environ_cb type, void *data, void *userdata)
@ -2175,7 +2177,7 @@ static int xmb_environ(enum menu_environ_cb type, void *data, void *userdata)
if (!xmb)
return -1;
xmb_refresh_horizontal_list(xmb);
xmb_refresh_horizontal_list((menu_handle_t*)data, xmb);
break;
default:
return -1;
@ -4099,7 +4101,7 @@ static void *xmb_init(void **userdata, bool video_is_threaded)
xmb->horizontal_list = (file_list_t*)calloc(1, sizeof(file_list_t));
if (xmb->horizontal_list)
xmb_init_horizontal_list(xmb);
xmb_init_horizontal_list(menu, xmb);
xmb_init_ribbon(xmb);
@ -4433,9 +4435,10 @@ static void xmb_context_reset_background(const char *iconpath)
free(path);
}
static void xmb_context_reset(void *data, bool is_threaded)
static void xmb_context_reset(void *data, void *userdata, bool is_threaded)
{
xmb_handle_t *xmb = (xmb_handle_t*)data;
menu_handle_t *menu = (menu_handle_t*)data;
xmb_handle_t *xmb = (xmb_handle_t*)userdata;
if (xmb)
{
@ -4466,7 +4469,7 @@ static void xmb_context_reset(void *data, bool is_threaded)
is_threaded);
xmb_context_reset_textures(xmb, iconpath);
xmb_context_reset_background(iconpath);
xmb_context_reset_horizontal_list(xmb);
xmb_context_reset_horizontal_list(menu, xmb);
if (!string_is_equal(xmb_thumbnails_ident('R'),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
@ -4833,7 +4836,7 @@ static int deferred_push_content_actions(menu_displaylist_info_t *info,
void *data)
{
if (!menu_displaylist_ctl(
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info))
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info, data))
return -1;
menu_displaylist_process(info);
menu_displaylist_info_free(info);
@ -4943,13 +4946,13 @@ static int xmb_list_push(void *data, void *userdata,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
{
entry.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
if (system->load_no_content)
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#ifndef HAVE_DYNAMIC
@ -4959,7 +4962,7 @@ static int xmb_list_push(void *data, void *userdata,
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
}
@ -4968,7 +4971,7 @@ static int xmb_list_push(void *data, void *userdata,
const struct retro_subsystem_info* subsystem = NULL;
entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
subsystem = system->subsystem.data;
@ -5024,68 +5027,68 @@ static int xmb_list_push(void *data, void *userdata,
}
entry.enum_idx = MENU_ENUM_LABEL_ADD_CONTENT_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
#if defined(HAVE_NETWORKING)
{
settings_t *settings = config_get_ptr();
if (settings->bools.menu_show_online_updater && !settings->bools.kiosk_mode_enable)
{
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
}
#endif
if (!settings->bools.menu_content_show_settings && !string_is_empty(settings->paths.menu_content_show_settings_password))
{
entry.enum_idx = MENU_ENUM_LABEL_XMB_MAIN_MENU_ENABLE_SETTINGS;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
if (settings->bools.kiosk_mode_enable && !string_is_empty(settings->paths.kiosk_mode_password))
{
entry.enum_idx = MENU_ENUM_LABEL_MENU_DISABLE_KIOSK_MODE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
if (settings->bools.menu_show_information)
{
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#ifndef HAVE_DYNAMIC
entry.enum_idx = MENU_ENUM_LABEL_RESTART_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
#endif
if (settings->bools.menu_show_configurations && !settings->bools.kiosk_mode_enable)
{
entry.enum_idx = MENU_ENUM_LABEL_CONFIGURATIONS_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
if (settings->bools.menu_show_help)
{
entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#if !defined(IOS)
if (settings->bools.menu_show_quit_retroarch)
{
entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
#endif
if (settings->bools.menu_show_reboot)
{
entry.enum_idx = MENU_ENUM_LABEL_REBOOT;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
}
entry.enum_idx = MENU_ENUM_LABEL_SHUTDOWN;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry, menu);
info->need_push = true;
ret = 0;
}
@ -5117,7 +5120,7 @@ static bool xmb_menu_init_list(void *data)
info.list = selection_buf;
if (!menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info))
if (!menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info, data))
goto error;
info.need_push = true;

View File

@ -1585,7 +1585,8 @@ static enum msg_file_type extension_to_file_hash_type(const char *ext)
return FILE_TYPE_NONE;
}
static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info,
menu_handle_t *menu)
{
unsigned i, j, k;
char path_playlist[PATH_MAX_LENGTH];
@ -1593,14 +1594,10 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
char query[PATH_MAX_LENGTH];
playlist_t *playlist = NULL;
database_info_list_t *db_info = NULL;
menu_handle_t *menu = NULL;
settings_t *settings = config_get_ptr();
path_playlist[0] = path_base[0] = query[0] = '\0';
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
goto error;
database_info_build_query_enum(query, sizeof(query),
DATABASE_QUERY_ENTRY, info->path_b);
@ -2500,13 +2497,13 @@ static void menu_displaylist_set_new_playlist(
static int menu_displaylist_parse_horizontal_list(
menu_displaylist_info_t *info)
menu_displaylist_info_t *info,
menu_handle_t *menu)
{
menu_ctx_list_t list_info;
menu_ctx_list_t list_horiz_info;
bool is_historylist = false;
playlist_t *playlist = NULL;
menu_handle_t *menu = NULL;
struct item_file *item = NULL;
settings_t *settings = config_get_ptr();
@ -2522,9 +2519,6 @@ static int menu_displaylist_parse_horizontal_list(
item = (struct item_file*)list_horiz_info.entry;
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return -1;
if (!item)
return -1;
@ -2562,14 +2556,10 @@ static int menu_displaylist_parse_horizontal_list(
}
static int menu_displaylist_parse_load_content_settings(
menu_displaylist_info_t *info)
menu_displaylist_info_t *info, menu_handle_t *menu)
{
menu_handle_t *menu = NULL;
settings_t *settings = config_get_ptr();
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return -1;
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
{
#ifdef HAVE_LAKKA
@ -2770,24 +2760,18 @@ static int menu_displaylist_parse_load_content_settings(
}
static int menu_displaylist_parse_horizontal_content_actions(
menu_displaylist_info_t *info)
menu_displaylist_info_t *info, menu_handle_t *menu)
{
bool content_loaded = false;
unsigned idx = 0;
menu_handle_t *menu = NULL;
const char *label = NULL;
const char *entry_path = NULL;
const char *core_path = NULL;
const char *core_name = NULL;
const char *db_name = NULL;
playlist_t *playlist = playlist_get_cached();
settings_t *settings = config_get_ptr();
const char *fullpath = path_get(RARCH_PATH_CONTENT);
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return -1;
idx = menu->rpl_entry_selection_ptr;
unsigned idx = menu->rpl_entry_selection_ptr;
playlist_t *playlist = playlist_get_cached();
if (playlist)
playlist_get_index(playlist, idx,
@ -2797,7 +2781,7 @@ static int menu_displaylist_parse_horizontal_content_actions(
&& string_is_equal(menu->deferred_path, fullpath);
if (content_loaded)
menu_displaylist_parse_load_content_settings(info);
menu_displaylist_parse_load_content_settings(info, menu);
else
{
const char *ext = NULL;
@ -3202,16 +3186,12 @@ static int menu_displaylist_parse_options_cheats(
}
static int menu_displaylist_parse_options_remappings(
menu_displaylist_info_t *info)
menu_displaylist_info_t *info, menu_handle_t *menu)
{
unsigned p, retro_id;
rarch_system_info_t *system = NULL;
menu_handle_t *menu = NULL;
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return -1;
for (p = 0; p < max_users; p++)
{
char key_type[PATH_MAX_LENGTH];
@ -3779,21 +3759,24 @@ static void menu_displaylist_parse_playlist_associations(
static bool menu_displaylist_push_internal(
const char *label,
menu_displaylist_ctx_entry_t *entry,
menu_displaylist_info_t *info)
menu_displaylist_info_t *info,
void *data)
{
menu_handle_t *menu = (menu_handle_t*)data;
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)))
{
if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info))
if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info, menu))
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB)))
{
if (menu_displaylist_ctl(DISPLAYLIST_FAVORITES, info))
if (menu_displaylist_ctl(DISPLAYLIST_FAVORITES, info, menu))
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_TAB)))
{
if (menu_displaylist_ctl(DISPLAYLIST_SETTINGS_ALL, info))
if (menu_displaylist_ctl(DISPLAYLIST_SETTINGS_ALL, info, menu))
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)))
@ -3812,7 +3795,7 @@ static bool menu_displaylist_push_internal(
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST));
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
menu_displaylist_ctl(DISPLAYLIST_MUSIC_HISTORY, info);
menu_displaylist_ctl(DISPLAYLIST_MUSIC_HISTORY, info, menu);
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB)))
@ -3831,7 +3814,7 @@ static bool menu_displaylist_push_internal(
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST));
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
menu_displaylist_ctl(DISPLAYLIST_VIDEO_HISTORY, info);
menu_displaylist_ctl(DISPLAYLIST_VIDEO_HISTORY, info, menu);
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)))
@ -3861,7 +3844,7 @@ static bool menu_displaylist_push_internal(
else
info->need_push_no_playlist_entries = true;
#endif
menu_displaylist_ctl(DISPLAYLIST_IMAGES_HISTORY, info);
menu_displaylist_ctl(DISPLAYLIST_IMAGES_HISTORY, info, menu);
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)))
@ -3898,23 +3881,23 @@ static bool menu_displaylist_push_internal(
info->path = strdup(settings->paths.directory_playlist);
if (menu_displaylist_ctl(
DISPLAYLIST_DATABASE_PLAYLISTS, info))
DISPLAYLIST_DATABASE_PLAYLISTS, info, menu))
return true;
}
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)))
{
if (menu_displaylist_ctl(DISPLAYLIST_SCAN_DIRECTORY_LIST, info))
if (menu_displaylist_ctl(DISPLAYLIST_SCAN_DIRECTORY_LIST, info, menu))
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)))
{
if (menu_displaylist_ctl(DISPLAYLIST_NETPLAY_ROOM_LIST, info))
if (menu_displaylist_ctl(DISPLAYLIST_NETPLAY_ROOM_LIST, info, menu))
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)))
{
if (menu_displaylist_ctl(DISPLAYLIST_HORIZONTAL, info))
if (menu_displaylist_ctl(DISPLAYLIST_HORIZONTAL, info, menu))
return true;
}
@ -3955,7 +3938,7 @@ bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry)
if (!info.list)
goto error;
if (menu_displaylist_push_internal(label, entry, &info))
if (menu_displaylist_push_internal(label, entry, &info, menu))
{
ret = menu_displaylist_process(&info);
goto end;
@ -4183,19 +4166,20 @@ void menu_displaylist_info_init(menu_displaylist_info_t *info)
info->setting = NULL;
}
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data,
void *userdata)
{
size_t i;
menu_ctx_displaylist_t disp_list;
int ret = 0;
core_info_list_t *list = NULL;
menu_handle_t *menu = NULL;
bool load_content = true;
bool use_filebrowser = false;
menu_displaylist_info_t *info = (menu_displaylist_info_t*)data;
menu_handle_t *menu = (menu_handle_t*)userdata;
settings_t *settings = config_get_ptr();
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
if (!menu)
return false;
core_info_get_list(&list);
@ -4273,7 +4257,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
}
#ifdef HAVE_LIBRETRODB
ret = menu_displaylist_parse_database_entry(info);
ret = menu_displaylist_parse_database_entry(info, menu);
#else
ret = 0;
#endif
@ -4391,13 +4375,13 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
if (string_is_equal(info->path, file_path_str(FILE_PATH_CONTENT_HISTORY)))
{
if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info))
if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info, menu))
return menu_displaylist_process(info);
return false;
}
else if (string_is_equal(info->path, file_path_str(FILE_PATH_CONTENT_FAVORITES)))
{
if (menu_displaylist_ctl(DISPLAYLIST_FAVORITES, info))
if (menu_displaylist_ctl(DISPLAYLIST_FAVORITES, info, menu))
return menu_displaylist_process(info);
return false;
}
@ -6159,7 +6143,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
break;
case DISPLAYLIST_HORIZONTAL:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
ret = menu_displaylist_parse_horizontal_list(info);
ret = menu_displaylist_parse_horizontal_list(info, menu);
info->need_sort = true;
info->need_refresh = true;
@ -6167,13 +6151,13 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
break;
case DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
ret = menu_displaylist_parse_horizontal_content_actions(info);
ret = menu_displaylist_parse_horizontal_content_actions(info, menu);
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_CONTENT_SETTINGS:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
ret = menu_displaylist_parse_load_content_settings(info);
ret = menu_displaylist_parse_load_content_settings(info, menu);
info->need_refresh = true;
info->need_push = true;
@ -6308,7 +6292,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
break;
case DISPLAYLIST_OPTIONS_REMAPPINGS:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
ret = menu_displaylist_parse_options_remappings(info);
ret = menu_displaylist_parse_options_remappings(info, menu);
info->need_push = true;
break;

View File

@ -224,7 +224,8 @@ void menu_displaylist_info_free(menu_displaylist_info_t *info);
void menu_displaylist_info_init(menu_displaylist_info_t *info);
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data);
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data,
void *userdata);
#ifdef HAVE_NETWORKING
void netplay_refresh_rooms_menu(file_list_t *list);
#endif

View File

@ -1798,7 +1798,8 @@ static bool menu_driver_context_reset(bool video_is_threaded)
{
if (!menu_driver_ctx || !menu_driver_ctx->context_reset)
return false;
menu_driver_ctx->context_reset(menu_userdata, video_is_threaded);
menu_driver_ctx->context_reset(menu_driver_data,
menu_userdata, video_is_threaded);
return true;
}

View File

@ -443,7 +443,7 @@ typedef struct menu_ctx_driver
* just toggled fullscreen, the GL driver did a teardown/setup -
* we now need to rebuild all of our textures and state for the
* menu driver. */
void (*context_reset)(void *data, bool video_is_threaded);
void (*context_reset)(void *data, void *userdata, bool video_is_threaded);
/* This will be invoked when we are running a hardware context
* and the context in question wants to tear itself down. All
* textures and related state on the menu driver will also

View File

@ -667,6 +667,7 @@ int menu_action_handle_setting(rarch_setting_t *setting,
if (action == MENU_ACTION_OK)
{
menu_displaylist_info_t info;
menu_handle_t *menu = NULL;
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
const char *name = setting->name;
size_t selection = menu_navigation_get_selection();
@ -679,7 +680,9 @@ int menu_action_handle_setting(rarch_setting_t *setting,
info.directory_ptr = selection;
info.list = menu_stack;
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info))
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info, menu))
menu_displaylist_process(&info);
menu_displaylist_info_free(&info);
@ -1372,6 +1375,7 @@ void general_write_handler(void *data)
if (*setting->value.target.boolean)
{
menu_displaylist_info_t info;
menu_handle_t *menu = NULL;
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
menu_displaylist_info_init(&info);
@ -1381,7 +1385,9 @@ void general_write_handler(void *data)
msg_hash_to_str(MENU_ENUM_LABEL_HELP));
info.list = menu_stack;
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info))
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info, menu))
menu_displaylist_process(&info);
menu_displaylist_info_free(&info);
setting_set_with_string_representation(setting, "false");

View File

@ -255,7 +255,8 @@ void menu_dialog_push_pending(bool push, enum menu_dialog_type type)
void menu_dialog_push(void)
{
menu_displaylist_info_t info;
const char *label;
const char *label = NULL;
menu_handle_t *menu = NULL;
if (!menu_dialog_is_push_pending())
return;
@ -270,7 +271,9 @@ void menu_dialog_push(void)
if (label)
info.label = strdup(label);
menu_displaylist_ctl(DISPLAYLIST_HELP, &info);
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
menu_displaylist_ctl(DISPLAYLIST_HELP, &info, menu);
}
void menu_dialog_set_current_id(unsigned id)

View File

@ -86,6 +86,7 @@ static int menu_input_key_bind_set_mode_common(
{
menu_displaylist_info_t info;
unsigned bind_type = 0;
menu_handle_t *menu = NULL;
struct retro_keybind *keybind = NULL;
unsigned index_offset = setting->index_offset;
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
@ -114,7 +115,10 @@ static int menu_input_key_bind_set_mode_common(
info.enum_idx = MENU_ENUM_LABEL_CUSTOM_BIND;
info.label = strdup(
msg_hash_to_str(MENU_ENUM_LABEL_CUSTOM_BIND));
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info))
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info, menu))
menu_displaylist_process(&info);
menu_displaylist_info_free(&info);
break;
@ -130,7 +134,9 @@ static int menu_input_key_bind_set_mode_common(
info.label = strdup(
msg_hash_to_str(MENU_ENUM_LABEL_CUSTOM_BIND_ALL));
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info))
menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu);
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info, menu))
menu_displaylist_process(&info);
menu_displaylist_info_free(&info);
break;