Refactor action_deferred_push
This commit is contained in:
parent
3a0a73a5cb
commit
adc17fdf2b
|
@ -24,6 +24,7 @@
|
|||
#include "menu_display.h"
|
||||
#include "menu_displaylist.h"
|
||||
#include "menu_navigation.h"
|
||||
#include "menu_setting.h"
|
||||
|
||||
#include "../gfx/video_shader_driver.h"
|
||||
#include "../config.features.h"
|
||||
|
@ -1979,7 +1980,7 @@ int menu_displaylist_deferred_push(menu_displaylist_info_t *info)
|
|||
menu_list_get_last_stack_actiondata(menu->menu_list);
|
||||
|
||||
if (cbs->action_deferred_push)
|
||||
return cbs->action_deferred_push(info->list, info->menu_list, info->path, info->label, info->type);
|
||||
return cbs->action_deferred_push(info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
#define _MENU_DISPLAYLIST_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <retro_miscellaneous.h>
|
||||
#include "menu_list.h"
|
||||
#include "menu_setting.h"
|
||||
#include <file/file_list.h>
|
||||
|
||||
#include "../settings.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <retro_miscellaneous.h>
|
||||
#include <queues/message_queue.h>
|
||||
#include "menu_animation.h"
|
||||
#include "menu_displaylist.h"
|
||||
#include "menu_list.h"
|
||||
#include "menu_navigation.h"
|
||||
#include "menu_database.h"
|
||||
|
@ -229,8 +230,7 @@ typedef struct
|
|||
typedef struct menu_file_list_cbs
|
||||
{
|
||||
int (*action_iterate)(const char *label, unsigned action);
|
||||
int (*action_deferred_push)(void *data, void *userdata, const char
|
||||
*path, const char *label, unsigned type);
|
||||
int (*action_deferred_push)(menu_displaylist_info_t *info);
|
||||
int (*action_ok)(const char *path, const char *label, unsigned type,
|
||||
size_t idx);
|
||||
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
||||
|
|
|
@ -24,99 +24,53 @@
|
|||
|
||||
#include "../gfx/video_shader_driver.h"
|
||||
|
||||
static int deferred_push_core_information(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_information(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CORE_INFO);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CORE_INFO);
|
||||
}
|
||||
|
||||
static int deferred_push_system_information(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_system_information(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SYSTEM_INFO);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SYSTEM_INFO);
|
||||
}
|
||||
|
||||
static int deferred_push_rdb_entry_detail(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_rdb_entry_detail(menu_displaylist_info_t *info)
|
||||
{
|
||||
int ret;
|
||||
menu_displaylist_info_t info = {0};
|
||||
struct string_list *str_list = string_split(label, "|");
|
||||
struct string_list *str_list = string_split(info->label, "|");
|
||||
|
||||
if (!str_list)
|
||||
return -1;
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.path_b, str_list->elems[1].data, sizeof(info.path_b));
|
||||
strlcpy(info.label, str_list->elems[0].data, sizeof(info.label));
|
||||
strlcpy(info->path_b, str_list->elems[1].data, sizeof(info->path_b));
|
||||
strlcpy(info->label, str_list->elems[0].data, sizeof(info->label));
|
||||
|
||||
ret = menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_ENTRY);
|
||||
ret = menu_displaylist_push_list(info, DISPLAYLIST_DATABASE_ENTRY);
|
||||
|
||||
string_list_free(str_list);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int deferred_push_core_list_deferred(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_list_deferred(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CORES_ALL);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CORES_ALL);
|
||||
}
|
||||
|
||||
static int deferred_push_database_manager_list_deferred(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_database_manager_list_deferred(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
if (!menu)
|
||||
return -1;
|
||||
strlcpy(info->path_b, info->path, sizeof(info->path_b));
|
||||
info->path_c[0] = '\0';
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.path_b, path, sizeof(info.path_b));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
info.path_c[0] = '\0';
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_QUERY);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_DATABASE_QUERY);
|
||||
}
|
||||
|
||||
static int deferred_push_cursor_manager_list_deferred(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_cursor_manager_list_deferred(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
char *query = NULL, *rdb = NULL;
|
||||
char rdb_path[PATH_MAX_LENGTH];
|
||||
settings_t *settings = config_get_ptr();
|
||||
config_file_t *conf = config_file_new(path);
|
||||
config_file_t *conf = config_file_new(info->path);
|
||||
|
||||
if (!conf || !settings)
|
||||
return -1;
|
||||
|
@ -136,30 +90,23 @@ static int deferred_push_cursor_manager_list_deferred(void *data, void *userdata
|
|||
fill_pathname_join(rdb_path, settings->content_database,
|
||||
rdb, sizeof(rdb_path));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, rdb_path, sizeof(info.path));
|
||||
strlcpy(info.path_b, path, sizeof(info.path_b));
|
||||
strlcpy(info.path_c, query, sizeof(info.path_c));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
strlcpy(info->path_b, info->path, sizeof(info->path_b));
|
||||
strlcpy(info->path, rdb_path, sizeof(info->path));
|
||||
strlcpy(info->path_c, query, sizeof(info->path_c));
|
||||
|
||||
menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_QUERY);
|
||||
menu_displaylist_push_list(info, DISPLAYLIST_DATABASE_QUERY);
|
||||
|
||||
config_file_free(conf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int deferred_push_cursor_manager_list_deferred_query_subsearch(
|
||||
void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_cursor_manager_list_deferred_query_subsearch(menu_displaylist_info_t *info)
|
||||
{
|
||||
int ret;
|
||||
menu_displaylist_info_t info = {0};
|
||||
char query[PATH_MAX_LENGTH];
|
||||
struct string_list *str_list = string_split(path, "|");
|
||||
struct string_list *str_list = string_split(info->path, "|");
|
||||
|
||||
menu_database_build_query(query, sizeof(query), label, str_list->elems[0].data);
|
||||
menu_database_build_query(query, sizeof(query), info->label, str_list->elems[0].data);
|
||||
|
||||
if (query[0] == '\0')
|
||||
{
|
||||
|
@ -167,248 +114,97 @@ static int deferred_push_cursor_manager_list_deferred_query_subsearch(
|
|||
return -1;
|
||||
}
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, str_list->elems[1].data, sizeof(info.path));
|
||||
strlcpy(info.path_b, str_list->elems[0].data, sizeof(info.path_b));
|
||||
strlcpy(info.path_c, query, sizeof(info.path_c));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
strlcpy(info->path, str_list->elems[1].data, sizeof(info->path));
|
||||
strlcpy(info->path_b, str_list->elems[0].data, sizeof(info->path_b));
|
||||
strlcpy(info->path_c, query, sizeof(info->path_c));
|
||||
|
||||
ret = menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_QUERY);
|
||||
ret = menu_displaylist_push_list(info, DISPLAYLIST_DATABASE_QUERY);
|
||||
|
||||
string_list_free(str_list);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int deferred_push_performance_counters(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_performance_counters(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_PERFCOUNTER_SELECTION);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_PERFCOUNTER_SELECTION);
|
||||
}
|
||||
|
||||
static int deferred_push_video_shader_preset_parameters(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_video_shader_preset_parameters(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SHADER_PARAMETERS_PRESET);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SHADER_PARAMETERS_PRESET);
|
||||
}
|
||||
|
||||
static int deferred_push_video_shader_parameters(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_video_shader_parameters(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SHADER_PARAMETERS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SHADER_PARAMETERS);
|
||||
}
|
||||
|
||||
static int deferred_push_settings(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_settings(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SETTINGS_ALL);
|
||||
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SETTINGS_ALL);
|
||||
}
|
||||
|
||||
static int deferred_push_settings_subgroup(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_settings_subgroup(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SETTINGS_SUBGROUP);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SETTINGS_SUBGROUP);
|
||||
}
|
||||
|
||||
static int deferred_push_category(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_category(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
info->flags = SL_FLAG_ALL_SETTINGS;
|
||||
|
||||
if (!menu)
|
||||
return -1;
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.type = type;
|
||||
info.flags = SL_FLAG_ALL_SETTINGS;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SETTINGS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SETTINGS);
|
||||
}
|
||||
|
||||
static int deferred_push_video_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_video_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_VIDEO);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OPTIONS_VIDEO);
|
||||
}
|
||||
|
||||
static int deferred_push_shader_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_shader_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_SHADERS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OPTIONS_SHADERS);
|
||||
}
|
||||
|
||||
static int deferred_push_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OPTIONS);
|
||||
}
|
||||
|
||||
static int deferred_push_management_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_management_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_MANAGEMENT);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OPTIONS_MANAGEMENT);
|
||||
}
|
||||
|
||||
static int deferred_push_core_counters(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_counters(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_PERFCOUNTERS_CORE);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_PERFCOUNTERS_CORE);
|
||||
}
|
||||
|
||||
static int deferred_push_frontend_counters(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_frontend_counters(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_PERFCOUNTERS_FRONTEND);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_PERFCOUNTERS_FRONTEND);
|
||||
}
|
||||
|
||||
static int deferred_push_core_cheat_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_cheat_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_CHEATS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OPTIONS_CHEATS);
|
||||
}
|
||||
|
||||
|
||||
static int deferred_push_core_input_remapping_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_input_remapping_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_REMAPPINGS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OPTIONS_REMAPPINGS);
|
||||
}
|
||||
|
||||
static int deferred_push_core_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CORE_OPTIONS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CORE_OPTIONS);
|
||||
}
|
||||
|
||||
static int deferred_push_disk_options(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_disk_options(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OPTIONS_DISK);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OPTIONS_DISK);
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
|
@ -444,51 +240,24 @@ int cb_core_updater_list(void *data_, size_t len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int deferred_push_core_updater_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_updater_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CORES_UPDATER);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CORES_UPDATER);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int deferred_push_history_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_history_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_HISTORY);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_HISTORY);
|
||||
}
|
||||
|
||||
static int deferred_push_content_actions(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_content_actions(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS);
|
||||
}
|
||||
|
||||
int deferred_push_content_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
int deferred_push_content_list(void *data, void *userdata, const char *path,
|
||||
const char *label, unsigned type)
|
||||
{
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
if (!menu_list)
|
||||
|
@ -496,308 +265,170 @@ int deferred_push_content_list(void *data, void *userdata,
|
|||
return menu_displaylist_push((file_list_t*)data, menu_list->selection_buf);
|
||||
}
|
||||
|
||||
static int deferred_push_database_manager_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_database_manager_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_RDB;
|
||||
strlcpy(info.exts, "rdb", sizeof(info.exts));
|
||||
strlcpy(info.path, settings->content_database, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
info->type_default = MENU_FILE_RDB;
|
||||
strlcpy(info->exts, "rdb", sizeof(info->exts));
|
||||
strlcpy(info->path, settings->content_database, sizeof(info->path));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_DATABASES);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_DATABASES);
|
||||
}
|
||||
|
||||
static int deferred_push_cursor_manager_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_cursor_manager_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_CURSOR;
|
||||
strlcpy(info.exts, "dbc", sizeof(info.exts));
|
||||
strlcpy(info.path, settings->cursor_directory, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
info->type_default = MENU_FILE_CURSOR;
|
||||
strlcpy(info->exts, "dbc", sizeof(info->exts));
|
||||
strlcpy(info->path, settings->cursor_directory, sizeof(info->path));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_CURSORS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_DATABASE_CURSORS);
|
||||
}
|
||||
|
||||
static int deferred_push_core_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_core_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_PLAIN;
|
||||
strlcpy(info->exts, EXT_EXECUTABLES, sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_PLAIN;
|
||||
strlcpy(info.exts, EXT_EXECUTABLES, sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CORES);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CORES);
|
||||
}
|
||||
|
||||
static int deferred_push_configurations(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_configurations(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_CONFIG;
|
||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_CONFIG;
|
||||
strlcpy(info.exts, "cfg", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CONFIG_FILES);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CONFIG_FILES);
|
||||
}
|
||||
|
||||
static int deferred_push_video_shader_preset(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_video_shader_preset(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_SHADER_PRESET;
|
||||
strlcpy(info->exts, "cgp|glslp", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_SHADER_PRESET;
|
||||
strlcpy(info.exts, "cgp|glslp", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SHADER_PRESET);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SHADER_PRESET);
|
||||
}
|
||||
|
||||
static int deferred_push_video_shader_pass(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_video_shader_pass(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_SHADER;
|
||||
strlcpy(info->exts, "cg|glsl", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_SHADER;
|
||||
strlcpy(info.exts, "cg|glsl", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_SHADER_PASS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_SHADER_PASS);
|
||||
}
|
||||
|
||||
static int deferred_push_video_filter(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_video_filter(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_VIDEOFILTER;
|
||||
strlcpy(info->exts, "filt", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_VIDEOFILTER;
|
||||
strlcpy(info.exts, "filt", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_VIDEO_FILTERS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_VIDEO_FILTERS);
|
||||
}
|
||||
|
||||
static int deferred_push_images(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_images(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_IMAGE;
|
||||
strlcpy(info->exts, "png", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_IMAGE;
|
||||
strlcpy(info.exts, "png", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_IMAGES);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_IMAGES);
|
||||
}
|
||||
|
||||
static int deferred_push_audio_dsp_plugin(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_audio_dsp_plugin(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_AUDIOFILTER;
|
||||
strlcpy(info->exts, "dsp", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_AUDIOFILTER;
|
||||
strlcpy(info.exts, "dsp", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_AUDIO_FILTERS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_AUDIO_FILTERS);
|
||||
}
|
||||
|
||||
static int deferred_push_cheat_file_load(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_cheat_file_load(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_CHEAT;
|
||||
strlcpy(info->exts, "cht", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_CHEAT;
|
||||
strlcpy(info.exts, "cht", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CHEAT_FILES);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CHEAT_FILES);
|
||||
}
|
||||
|
||||
static int deferred_push_remap_file_load(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_remap_file_load(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_REMAP;
|
||||
strlcpy(info->exts, "rmp", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_REMAP;
|
||||
strlcpy(info.exts, "rmp", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_REMAP_FILES);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_REMAP_FILES);
|
||||
}
|
||||
|
||||
static int deferred_push_record_configfile(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_record_configfile(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_RECORD_CONFIG;
|
||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_RECORD_CONFIG;
|
||||
strlcpy(info.exts, "cfg", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_RECORD_CONFIG_FILES);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_RECORD_CONFIG_FILES);
|
||||
}
|
||||
|
||||
static int deferred_push_input_overlay(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_input_overlay(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_OVERLAY;
|
||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_OVERLAY;
|
||||
strlcpy(info.exts, "cfg", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OVERLAYS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OVERLAYS);
|
||||
}
|
||||
|
||||
static int deferred_push_input_osk_overlay(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_input_osk_overlay(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_OVERLAY;
|
||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_OVERLAY;
|
||||
strlcpy(info.exts, "cfg", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_OVERLAYS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_OVERLAYS);
|
||||
}
|
||||
|
||||
static int deferred_push_video_font_path(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_video_font_path(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_FONT;
|
||||
strlcpy(info->exts, "ttf", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_FONT;
|
||||
strlcpy(info.exts, "ttf", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_FONTS);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_FONTS);
|
||||
}
|
||||
|
||||
static int deferred_push_content_history_path(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_content_history_path(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
info->type_default = MENU_FILE_PLAIN;
|
||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_PLAIN;
|
||||
strlcpy(info.exts, "cfg", sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CONTENT_HISTORY);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CONTENT_HISTORY);
|
||||
}
|
||||
|
||||
static int deferred_push_detect_core_list(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_detect_core_list(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_PLAIN;
|
||||
info->type_default = MENU_FILE_PLAIN;
|
||||
if (global->core_info)
|
||||
strlcpy(info.exts, core_info_list_get_all_extensions(
|
||||
global->core_info), sizeof(info.exts));
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
strlcpy(info->exts, core_info_list_get_all_extensions(
|
||||
global->core_info), sizeof(info->exts));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_CORES_DETECTED);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_CORES_DETECTED);
|
||||
}
|
||||
|
||||
static int deferred_push_default(void *data, void *userdata,
|
||||
const char *path, const char *label, unsigned type)
|
||||
static int deferred_push_default(menu_displaylist_info_t *info)
|
||||
{
|
||||
menu_displaylist_info_t info = {0};
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
info.list = (file_list_t*)data;
|
||||
info.menu_list = (file_list_t*)userdata;
|
||||
info.type = type;
|
||||
info.type_default = MENU_FILE_PLAIN;
|
||||
strlcpy(info.path, path, sizeof(info.path));
|
||||
strlcpy(info.label, label, sizeof(info.label));
|
||||
info.setting = menu_setting_find(label);
|
||||
info->type_default = MENU_FILE_PLAIN;
|
||||
info->setting = menu_setting_find(info->label);
|
||||
|
||||
if (info.setting && info.setting->browser_selection_type == ST_DIR) {}
|
||||
if (info->setting && info->setting->browser_selection_type == ST_DIR) {}
|
||||
else if (global->menu.info.valid_extensions)
|
||||
{
|
||||
if (*global->menu.info.valid_extensions)
|
||||
snprintf(info.exts, sizeof(info.exts), "%s",
|
||||
snprintf(info->exts, sizeof(info->exts), "%s",
|
||||
global->menu.info.valid_extensions);
|
||||
}
|
||||
else
|
||||
strlcpy(info.exts, global->system.valid_extensions, sizeof(info.exts));
|
||||
strlcpy(info->exts, global->system.valid_extensions, sizeof(info->exts));
|
||||
|
||||
return menu_displaylist_push_list(&info, DISPLAYLIST_DEFAULT);
|
||||
return menu_displaylist_push_list(info, DISPLAYLIST_DEFAULT);
|
||||
}
|
||||
|
||||
void menu_entries_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||
|
|
Loading…
Reference in New Issue