mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-26 14:45:45 +00:00
Go through more menu driver wrapper functions
This commit is contained in:
parent
8b10d0adc2
commit
aeb359f5b5
15
driver.c
15
driver.c
@ -431,15 +431,14 @@ void uninit_drivers(int flags)
|
|||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
if (flags & DRIVER_MENU)
|
if (flags & DRIVER_MENU)
|
||||||
{
|
{
|
||||||
if (driver->menu_ctx && driver->menu_ctx->context_destroy)
|
menu_driver_context_destroy();
|
||||||
driver->menu_ctx->context_destroy();
|
|
||||||
|
|
||||||
if (!driver->menu_data_own)
|
if (!driver->menu_data_own)
|
||||||
{
|
{
|
||||||
menu_free_list(driver->menu);
|
menu_free_list(driver->menu);
|
||||||
menu_free(driver->menu);
|
menu_free(driver->menu);
|
||||||
driver->menu = NULL;
|
driver->menu = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -182,6 +182,55 @@ static const menu_ctx_driver_t *menu_ctx_driver_get_ptr(void)
|
|||||||
return driver->menu_ctx;
|
return driver->menu_ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_driver_list_delete(file_list_t *list, size_t i, size_t list_size)
|
||||||
|
{
|
||||||
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
|
||||||
|
if (driver->list_delete)
|
||||||
|
driver->list_delete(list, i, list_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void menu_driver_list_clear(file_list_t *list)
|
||||||
|
{
|
||||||
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
|
||||||
|
if (driver->list_clear)
|
||||||
|
driver->list_clear(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
void menu_driver_context_destroy(void)
|
||||||
|
{
|
||||||
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
|
||||||
|
if (driver->context_destroy)
|
||||||
|
driver->context_destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
void menu_driver_list_set_selection(file_list_t *list)
|
||||||
|
{
|
||||||
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
|
||||||
|
if (driver->list_set_selection)
|
||||||
|
driver->list_set_selection(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
void menu_driver_list_insert(file_list_t *list, const char *path,
|
||||||
|
const char *label, size_t list_size)
|
||||||
|
{
|
||||||
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
|
||||||
|
if (driver->list_insert)
|
||||||
|
driver->list_insert(list, path, label, list_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void menu_driver_list_cache(bool state, unsigned action)
|
||||||
|
{
|
||||||
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
|
||||||
|
if (driver->list_cache)
|
||||||
|
driver->list_cache(state, action);
|
||||||
|
}
|
||||||
|
|
||||||
void menu_driver_navigation_increment(void)
|
void menu_driver_navigation_increment(void)
|
||||||
{
|
{
|
||||||
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
const menu_ctx_driver_t *driver = menu_ctx_driver_get_ptr();
|
||||||
|
@ -336,6 +336,19 @@ void menu_driver_navigation_descend_alphabet(size_t *);
|
|||||||
|
|
||||||
void menu_driver_navigation_ascend_alphabet(size_t *);
|
void menu_driver_navigation_ascend_alphabet(size_t *);
|
||||||
|
|
||||||
|
void menu_driver_list_cache(bool state, unsigned action);
|
||||||
|
|
||||||
|
void menu_driver_list_delete(file_list_t *list, size_t i, size_t list_size);
|
||||||
|
|
||||||
|
void menu_driver_list_insert(file_list_t *list, const char *path,
|
||||||
|
const char *label, size_t list_size);
|
||||||
|
|
||||||
|
void menu_driver_list_clear(file_list_t *list);
|
||||||
|
|
||||||
|
void menu_driver_list_set_selection(file_list_t *list);
|
||||||
|
|
||||||
|
void menu_driver_context_destroy(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -235,8 +235,7 @@ static int action_toggle_mainmenu(unsigned type, const char *label,
|
|||||||
switch (push_list)
|
switch (push_list)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if (driver->menu_ctx->list_cache)
|
menu_driver_list_cache(true, action);
|
||||||
driver->menu_ctx->list_cache(true, action);
|
|
||||||
|
|
||||||
if (cbs && cbs->action_content_list_switch)
|
if (cbs && cbs->action_content_list_switch)
|
||||||
return cbs->action_content_list_switch(
|
return cbs->action_content_list_switch(
|
||||||
|
@ -149,8 +149,7 @@ static void menu_list_destroy(file_list_t *list)
|
|||||||
|
|
||||||
for (i = 0; i < list->size; i++)
|
for (i = 0; i < list->size; i++)
|
||||||
{
|
{
|
||||||
if (driver->menu_ctx->list_delete)
|
menu_driver_list_delete(list, i, list->size);
|
||||||
driver->menu_ctx->list_delete(list, i, list->size);
|
|
||||||
menu_common_list_delete(list, i, list->size);
|
menu_common_list_delete(list, i, list->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,8 +286,7 @@ void menu_list_pop_stack(menu_list_t *list)
|
|||||||
if (file_list_get_size(list->menu_stack) <= 1)
|
if (file_list_get_size(list->menu_stack) <= 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (driver->menu_ctx->list_cache)
|
menu_driver_list_cache(false, 0);
|
||||||
driver->menu_ctx->list_cache(false, 0);
|
|
||||||
|
|
||||||
menu_list_pop(list->menu_stack, &menu->navigation.selection_ptr);
|
menu_list_pop(list->menu_stack, &menu->navigation.selection_ptr);
|
||||||
menu->need_refresh = true;
|
menu->need_refresh = true;
|
||||||
@ -325,8 +323,7 @@ void menu_list_pop(file_list_t *list, size_t *directory_ptr)
|
|||||||
{
|
{
|
||||||
size_t list_size = list->size - 1;
|
size_t list_size = list->size - 1;
|
||||||
|
|
||||||
if (driver->menu_ctx->list_delete)
|
menu_driver_list_delete(list, list_size, list_size);
|
||||||
driver->menu_ctx->list_delete(list, list_size, list_size);
|
|
||||||
menu_common_list_delete(list, list_size, list_size);
|
menu_common_list_delete(list, list_size, list_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,9 +333,7 @@ end:
|
|||||||
if (!driver->menu_ctx)
|
if (!driver->menu_ctx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (driver->menu_ctx->list_set_selection)
|
menu_driver_list_set_selection(list);
|
||||||
driver->menu_ctx->list_set_selection(list);
|
|
||||||
|
|
||||||
menu_common_list_set_selection(list);
|
menu_common_list_set_selection(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,8 +343,7 @@ void menu_list_clear(file_list_t *list)
|
|||||||
if (!driver->menu_ctx)
|
if (!driver->menu_ctx)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (driver->menu_ctx->list_clear)
|
menu_driver_list_clear(list);
|
||||||
driver->menu_ctx->list_clear(list);
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
menu_common_list_clear(list);
|
menu_common_list_clear(list);
|
||||||
@ -363,9 +357,7 @@ static void menu_list_insert(file_list_t *list,
|
|||||||
if (!driver->menu_ctx)
|
if (!driver->menu_ctx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (driver->menu_ctx->list_insert)
|
menu_driver_list_insert(list, path, label, list->size - 1);
|
||||||
driver->menu_ctx->list_insert(list, path, label, list->size - 1);
|
|
||||||
|
|
||||||
menu_common_list_insert(list, path, label, type, list->size - 1);
|
menu_common_list_insert(list, path, label, type, list->size - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,8 +402,7 @@ int menu_list_push_stack_refresh(menu_list_t *list, const char *path, const char
|
|||||||
if (!list)
|
if (!list)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (driver->menu_ctx->list_cache)
|
menu_driver_list_cache(false, 0);
|
||||||
driver->menu_ctx->list_cache(false, 0);
|
|
||||||
|
|
||||||
menu_list_push_stack(list, path, label, type, directory_ptr);
|
menu_list_push_stack(list, path, label, type, directory_ptr);
|
||||||
menu_navigation_clear(&menu->navigation, true);
|
menu_navigation_clear(&menu->navigation, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user