Revert "Pass around void pointer data - menu handle"

This reverts commit b4a2bd5156354b084283165be96d43ee99bf50ec.
This commit is contained in:
twinaphex 2018-04-11 06:11:54 +02:00
parent fdffb7059d
commit 6c99acb23e
4 changed files with 27 additions and 36 deletions

View File

@ -38,7 +38,7 @@
#ifndef BIND_ACTION_DEFERRED_PUSH
#define BIND_ACTION_DEFERRED_PUSH(cbs, name) \
cbs->action_deferred_push = name; \
cbs->action_deferred_push = name; \
cbs->action_deferred_push_ident = #name;
#endif
@ -50,8 +50,7 @@ enum
PUSH_DETECT_CORE_LIST
};
static int deferred_push_dlist(menu_displaylist_info_t *info,
void *data, enum menu_displaylist_ctl_state state)
static int deferred_push_dlist(menu_displaylist_info_t *info, enum menu_displaylist_ctl_state state)
{
if (!menu_displaylist_ctl(state, info))
return menu_cbs_exit();
@ -60,7 +59,7 @@ static int deferred_push_dlist(menu_displaylist_info_t *info,
}
static int deferred_push_database_manager_list_deferred(
menu_displaylist_info_t *info, void *data)
menu_displaylist_info_t *info)
{
if (!string_is_empty(info->path_b))
free(info->path_b);
@ -70,13 +69,13 @@ static int deferred_push_database_manager_list_deferred(
info->path_b = strdup(info->path);
info->path_c = NULL;
return deferred_push_dlist(info, data, DISPLAYLIST_DATABASE_QUERY);
return deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
}
#define generic_deferred_push(name, type) \
static int (name)(menu_displaylist_info_t *info, void *data) \
static int (name)(menu_displaylist_info_t *info) \
{ \
return deferred_push_dlist(info, data, type); \
return deferred_push_dlist(info, type); \
}
generic_deferred_push(deferred_push_video_shader_preset_parameters, DISPLAYLIST_SHADER_PARAMETERS_PRESET)
@ -176,7 +175,7 @@ generic_deferred_push(deferred_push_lakka_list, DISPLAYLIST_
#endif
static int deferred_push_cursor_manager_list_deferred(
menu_displaylist_info_t *info, void *data)
menu_displaylist_info_t *info)
{
char rdb_path[PATH_MAX_LENGTH];
int ret = -1;
@ -215,8 +214,7 @@ static int deferred_push_cursor_manager_list_deferred(
info->path_c = strdup(query);
info->path = strdup(rdb_path);
ret = deferred_push_dlist(info, data,
DISPLAYLIST_DATABASE_QUERY);
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
end:
if (conf)
@ -229,8 +227,7 @@ end:
#ifdef HAVE_LIBRETRODB
static int deferred_push_cursor_manager_list_generic(
menu_displaylist_info_t *info, void *data,
enum database_query_type type)
menu_displaylist_info_t *info, enum database_query_type type)
{
char query[PATH_MAX_LENGTH];
int ret = -1;
@ -242,8 +239,7 @@ static int deferred_push_cursor_manager_list_generic(
query[0] = '\0';
database_info_build_query_enum(query,
sizeof(query), type, str_list->elems[0].data);
database_info_build_query_enum(query, sizeof(query), type, str_list->elems[0].data);
if (string_is_empty(query))
goto end;
@ -259,8 +255,7 @@ static int deferred_push_cursor_manager_list_generic(
info->path_b = strdup(str_list->elems[0].data);
info->path_c = strdup(query);
ret = deferred_push_dlist(info, data,
DISPLAYLIST_DATABASE_QUERY);
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
end:
string_list_free(str_list);
@ -268,9 +263,9 @@ end:
}
#define generic_deferred_cursor_manager(name, type) \
static int (name)(menu_displaylist_info_t *info, void *data) \
static int (name)(menu_displaylist_info_t *info) \
{ \
return deferred_push_cursor_manager_list_generic(info, data, type); \
return deferred_push_cursor_manager_list_generic(info, type); \
}
generic_deferred_cursor_manager(deferred_push_cursor_manager_list_deferred_query_rdb_entry_max_users, DATABASE_QUERY_ENTRY_MAX_USERS)
@ -294,7 +289,7 @@ generic_deferred_cursor_manager(deferred_push_cursor_manager_list_deferred_query
#if 0
static int deferred_push_cursor_manager_list_deferred_query_subsearch(
menu_displaylist_info_t *info, void *data)
menu_displaylist_info_t *info)
{
int ret = -1;
#ifdef HAVE_LIBRETRODB
@ -319,8 +314,7 @@ static int deferred_push_cursor_manager_list_deferred_query_subsearch(
info->path_b = strdup(str_list->elems[0].data);
info->path_c = strdup(query);
ret = deferred_push_dlist(info, data,
DISPLAYLIST_DATABASE_QUERY);
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
end:
string_list_free(str_list);
@ -330,17 +324,16 @@ end:
#endif
static int general_push(menu_displaylist_info_t *info,
void *data,
unsigned id, enum menu_displaylist_ctl_state state)
{
settings_t *settings = config_get_ptr();
char *newstring2 = NULL;
core_info_list_t *list = NULL;
menu_handle_t *menu = (menu_handle_t*)data;
menu_handle_t *menu = NULL;
rarch_system_info_t *system = runloop_get_system_info();
struct retro_system_info *system_menu = &system->info;
if (!data)
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return menu_cbs_exit();
core_info_get_list(&list);
@ -569,20 +562,20 @@ static int general_push(menu_displaylist_info_t *info,
}
free(newstring2);
return deferred_push_dlist(info, data, state);
return deferred_push_dlist(info, state);
}
#define generic_deferred_push_general(name, a, b) \
static int (name)(menu_displaylist_info_t *info, void *data) \
static int (name)(menu_displaylist_info_t *info) \
{ \
return general_push(info, data, a, b); \
return general_push(info, a, b); \
}
#define generic_deferred_push_clear_general(name, a, b) \
static int (name)(menu_displaylist_info_t *info, void *data) \
static int (name)(menu_displaylist_info_t *info) \
{ \
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list); \
return general_push(info, data, a, b); \
return general_push(info, a, b); \
}
generic_deferred_push_general(deferred_push_detect_core_list, PUSH_DETECT_CORE_LIST, DISPLAYLIST_CORES_DETECTED)

View File

@ -4829,8 +4829,7 @@ static void xmb_toggle(void *userdata, bool menu_on)
xmb_toggle_horizontal_list(xmb);
}
static int deferred_push_content_actions(menu_displaylist_info_t *info,
void *data)
static int deferred_push_content_actions(menu_displaylist_info_t *info)
{
if (!menu_displaylist_ctl(
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info))

View File

@ -3930,12 +3930,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;
if (!entry)
return false;
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return false;
menu_displaylist_info_init(&info);
@ -3964,8 +3961,10 @@ bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry)
cbs = menu_entries_get_last_stack_actiondata();
if (cbs && cbs->action_deferred_push)
if (cbs->action_deferred_push(&info, menu) != 0)
{
if (cbs->action_deferred_push(&info) != 0)
goto error;
}
ret = true;

View File

@ -102,7 +102,7 @@ typedef struct menu_file_list_cbs
rarch_setting_t *setting;
int (*action_iterate)(const char *label, unsigned action);
int (*action_deferred_push)(menu_displaylist_info_t *info, void *data);
int (*action_deferred_push)(menu_displaylist_info_t *info);
int (*action_select)(const char *path, const char *label, unsigned type,
size_t idx);
int (*action_get_title)(const char *path, const char *label,