mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
Create menu_environ callback
This commit is contained in:
parent
908eafa604
commit
f2a608b131
@ -773,6 +773,18 @@ static void glui_context_reset(void)
|
||||
settings->menu.wallpaper, "cb_menu_wallpaper", 0, 1, true);
|
||||
}
|
||||
|
||||
static int glui_environ(void *data, void *data2,
|
||||
menu_environ_cb_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
menu_ctx_driver_t menu_ctx_glui = {
|
||||
NULL,
|
||||
glui_get_message,
|
||||
@ -802,5 +814,6 @@ menu_ctx_driver_t menu_ctx_glui = {
|
||||
NULL,
|
||||
glui_load_image,
|
||||
"glui",
|
||||
glui_environ,
|
||||
NULL,
|
||||
};
|
||||
|
@ -53,4 +53,5 @@ menu_ctx_driver_t menu_ctx_null = {
|
||||
NULL, /* load_image */
|
||||
"null",
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
@ -736,6 +736,17 @@ static void rgui_populate_entries(const char *path,
|
||||
rgui_navigation_set(true);
|
||||
}
|
||||
|
||||
static int rgui_environ(void *data, void *data2, menu_environ_cb_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
menu_ctx_driver_t menu_ctx_rgui = {
|
||||
rgui_set_texture,
|
||||
rgui_set_message,
|
||||
@ -765,5 +776,6 @@ menu_ctx_driver_t menu_ctx_rgui = {
|
||||
NULL,
|
||||
NULL,
|
||||
"rgui",
|
||||
rgui_environ,
|
||||
NULL,
|
||||
};
|
||||
|
@ -312,6 +312,17 @@ static void rmenu_free(void *data)
|
||||
{
|
||||
}
|
||||
|
||||
static int rmenu_environ(void *data, void *data2, menu_environ_cb_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
menu_ctx_driver_t menu_ctx_rmenu = {
|
||||
rmenu_set_texture,
|
||||
rmenu_render_messagebox,
|
||||
@ -341,5 +352,6 @@ menu_ctx_driver_t menu_ctx_rmenu = {
|
||||
NULL,
|
||||
NULL,
|
||||
"rmenu",
|
||||
rmenu_environ,
|
||||
NULL,
|
||||
};
|
||||
|
@ -676,6 +676,17 @@ static void rmenu_xui_list_set_selection(file_list_t *list)
|
||||
XuiListSetCurSel(m_menulist, file_list_get_directory_ptr(list));
|
||||
}
|
||||
|
||||
static int rmenu_xui_environ(void *data, void *data2, menu_environ_cb_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
menu_ctx_driver_t menu_ctx_rmenu_xui = {
|
||||
NULL,
|
||||
rmenu_xui_render_messagebox,
|
||||
@ -705,5 +716,6 @@ menu_ctx_driver_t menu_ctx_rmenu_xui = {
|
||||
rmenu_xui_list_set_selection,
|
||||
NULL,
|
||||
"rmenu_xui",
|
||||
rmenu_xui_environ,
|
||||
NULL,
|
||||
};
|
||||
|
@ -1056,6 +1056,31 @@ static void xmb_refresh_horizontal_list(xmb_handle_t *xmb,
|
||||
xmb_context_reset_horizontal_list(xmb, menu, themepath);
|
||||
}
|
||||
|
||||
static int xmb_environ(void *data, void *data2, menu_environ_cb_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case MENU_ENVIRON_RESET_HORIZONTAL_LIST:
|
||||
{
|
||||
char mediapath[PATH_MAX_LENGTH] = {0};
|
||||
char themepath[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||
menu_handle_t *menu = (menu_handle_t*)data2;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
fill_pathname_join(mediapath, settings->assets_directory, "xmb", sizeof(mediapath));
|
||||
fill_pathname_join(themepath, mediapath, XMB_THEME, sizeof(themepath));
|
||||
xmb_context_reset_horizontal_list(xmb, menu, themepath);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void xmb_list_open(xmb_handle_t *xmb)
|
||||
{
|
||||
int dir = 0;
|
||||
@ -2572,5 +2597,6 @@ menu_ctx_driver_t menu_ctx_xmb = {
|
||||
xmb_list_bind_init,
|
||||
xmb_load_image,
|
||||
"xmb",
|
||||
xmb_environ,
|
||||
NULL,
|
||||
};
|
||||
|
@ -43,6 +43,13 @@ typedef enum
|
||||
MENU_IMAGE_BOXART
|
||||
} menu_image_type_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MENU_ENVIRON_NONE = 0,
|
||||
MENU_ENVIRON_RESET_HORIZONTAL_LIST,
|
||||
MENU_ENVIRON_LAST
|
||||
} menu_environ_cb_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *userdata;
|
||||
@ -107,6 +114,8 @@ typedef struct menu_ctx_driver
|
||||
uint32_t label_hash, uint32_t menu_label_hash);
|
||||
bool (*load_image)(void *data, menu_image_type_t type);
|
||||
const char *ident;
|
||||
int (*environ_cb)(void *data, void *data2,
|
||||
menu_environ_cb_t type);
|
||||
bool (*perform_action)(void* data, unsigned action);
|
||||
} menu_ctx_driver_t;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user