Create menu_driver_list_get_size

This commit is contained in:
twinaphex 2015-06-07 15:43:03 +02:00
parent 561f8888c8
commit 38ce8ffcef
9 changed files with 18 additions and 2 deletions

View File

@ -695,6 +695,7 @@ menu_ctx_driver_t menu_ctx_glui = {
NULL,
NULL,
NULL,
NULL,
glui_load_image,
"glui",
NULL,

View File

@ -655,6 +655,7 @@ menu_ctx_driver_t menu_ctx_rgui = {
NULL,
NULL,
NULL,
NULL,
"rgui",
NULL,
};

View File

@ -326,6 +326,7 @@ menu_ctx_driver_t menu_ctx_rmenu = {
NULL,
NULL,
NULL,
NULL,
"rmenu",
NULL,
};

View File

@ -680,6 +680,7 @@ menu_ctx_driver_t menu_ctx_rmenu_xui = {
rmenu_xui_list_delete,
rmenu_xui_list_clear,
NULL,
NULL,
rmenu_xui_list_set_selection,
NULL,
"rmenu_xui",

View File

@ -2118,6 +2118,7 @@ menu_ctx_driver_t menu_ctx_xmb = {
xmb_list_delete,
NULL,
xmb_list_cache,
xmb_list_get_size,
NULL,
xmb_load_image,
"xmb",

View File

@ -259,6 +259,16 @@ void menu_driver_list_cache(menu_list_type_t type, unsigned action)
driver->list_cache(type, action);
}
size_t menu_driver_list_get_size(menu_list_type_t type)
{
menu_handle_t *menu = menu_driver_get_ptr();
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
if (driver->list_get_size)
return driver->list_get_size(menu, type);
return 0;
}
void menu_driver_navigation_increment(void)
{
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();

View File

@ -255,6 +255,7 @@ typedef struct menu_ctx_driver
void (*list_delete)(file_list_t *list, size_t, size_t);
void (*list_clear)(file_list_t *list);
void (*list_cache)(menu_list_type_t, unsigned);
size_t(*list_get_size)(void *data, menu_list_type_t);
void (*list_set_selection)(file_list_t *list);
bool (*load_image)(void *data, menu_image_type_t type);
const char *ident;
@ -345,6 +346,8 @@ void menu_driver_list_insert(file_list_t *list, const char *path,
void menu_driver_list_clear(file_list_t *list);
size_t menu_driver_list_get_size(menu_list_type_t type);
void menu_driver_list_set_selection(file_list_t *list);
const menu_ctx_driver_t *menu_ctx_driver_get_ptr(void);

View File

@ -143,7 +143,6 @@ static int action_left_mainmenu(unsigned type, const char *label,
if (file_list_get_size(menu_list->menu_stack) == 1)
{
if (!strcmp(driver->menu_ctx->ident, "xmb"))
{
menu->navigation.selection_ptr = 0;

View File

@ -151,7 +151,6 @@ static int action_right_mainmenu(unsigned type, const char *label,
if (file_list_get_size(menu_list->menu_stack) == 1)
{
if (!strcmp(driver->menu_ctx->ident, "xmb"))
{
menu->navigation.selection_ptr = 0;