Create more menu wrapper functions

This commit is contained in:
twinaphex 2015-03-22 07:07:07 +01:00
parent 36351bf78d
commit c260f28603
3 changed files with 26 additions and 4 deletions

View File

@ -336,3 +336,23 @@ bool menu_driver_load_background(void *data)
return false;
}
void menu_driver_navigation_descend_alphabet(size_t *ptr_out)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return;
if (driver->menu_ctx && driver->menu_ctx->navigation_descend_alphabet)
driver->menu_ctx->navigation_descend_alphabet(ptr_out);
}
void menu_driver_navigation_ascend_alphabet(size_t *ptr_out)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return;
if (driver->menu_ctx && driver->menu_ctx->navigation_ascend_alphabet)
driver->menu_ctx->navigation_ascend_alphabet(ptr_out);
}

View File

@ -319,6 +319,10 @@ void menu_driver_populate_entries(const char *path, const char *label,
bool menu_driver_load_background(void *data);
void menu_driver_navigation_descend_alphabet(size_t *);
void menu_driver_navigation_ascend_alphabet(size_t *);
#ifdef __cplusplus
}
#endif

View File

@ -157,8 +157,7 @@ void menu_navigation_descend_alphabet(menu_navigation_t *nav, size_t *ptr_out)
i--;
*ptr_out = nav->scroll.indices.list[i - 1];
if (driver->menu_ctx && driver->menu_ctx->navigation_descend_alphabet)
driver->menu_ctx->navigation_descend_alphabet(ptr_out);
menu_driver_navigation_descend_alphabet(ptr_out);
}
/**
@ -189,6 +188,5 @@ void menu_navigation_ascend_alphabet(menu_navigation_t *nav, size_t *ptr_out)
i++;
*ptr_out = nav->scroll.indices.list[i + 1];
if (driver->menu_ctx && driver->menu_ctx->navigation_descend_alphabet)
driver->menu_ctx->navigation_descend_alphabet(ptr_out);
menu_driver_navigation_ascend_alphabet(ptr_out);
}