static void menu_list_flush_stack(menu_list_t *list, size_t idx, const char *needle, unsigned final_type) { bool refresh = false; const char *path = NULL; const char *label = NULL; unsigned type = 0; size_t entry_idx = 0; file_list_t *menu_list = menu_list_get(list, (unsigned)idx); if (!list) return; menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); file_list_get_last(menu_list, &path, &label, &type, &entry_idx); while (menu_list_flush_stack_type( needle, label, type, final_type) != 0) { size_t new_selection_ptr = menu_navigation_get_selection(); if (!menu_list_pop_stack(list, idx, &new_selection_ptr, 1)) break; menu_navigation_set_selection(new_selection_ptr); menu_list = menu_list_get(list, (unsigned)idx); file_list_get_last(menu_list, &path, &label, &type, &entry_idx); } }
file_list_t *menu_entries_get_menu_stack_ptr(size_t idx) { menu_list_t *menu_list = menu_entries_list; if (!menu_list) return NULL; return menu_list_get(menu_list, (unsigned)idx); }
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void) { if (menu_entries_list) return (menu_file_list_cbs_t*)file_list_get_last_actiondata( menu_list_get(menu_entries_list, 0)); return NULL; }
static bool menu_list_pop_stack(menu_list_t *list, size_t idx, size_t *directory_ptr, bool animate) { menu_ctx_list_t list_info; bool refresh = false; file_list_t *menu_list = menu_list_get(list, (unsigned)idx); if (menu_list_get_stack_size(list, idx) <= 1) return false; list_info.type = MENU_LIST_PLAIN; list_info.action = 0; if (animate) menu_driver_list_cache(&list_info); if (menu_list->size != 0) { menu_ctx_list_t list_info; list_info.list = menu_list; list_info.idx = menu_list->size - 1; list_info.list_size = menu_list->size - 1; menu_driver_ctl(RARCH_MENU_CTL_LIST_FREE, &list_info); } file_list_pop(menu_list, directory_ptr); menu_driver_list_set_selection(menu_list); if (animate) menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh); return true; }
file_list_t *menu_entries_get_menu_stack_ptr(size_t idx) { menu_list_t *menu_list = NULL; menu_entries_ctl(MENU_ENTRIES_CTL_LIST_GET, &menu_list); if (!menu_list) return NULL; return menu_list_get(menu_list, idx); }
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void) { menu_list_t *menu_list = NULL; menu_entries_ctl(MENU_ENTRIES_CTL_LIST_GET, &menu_list); if (!menu_list) return NULL; return (menu_file_list_cbs_t*)file_list_get_last_actiondata( menu_list_get(menu_list, 0)); }
void menu_entries_get_last_stack(const char **path, const char **label, unsigned *file_type, enum msg_hash_enums *enum_idx, size_t *entry_idx) { menu_file_list_cbs_t *cbs = NULL; menu_list_t *menu_list = menu_entries_list; if (!menu_list) return; file_list_get_last(menu_list_get(menu_list, 0), path, label, file_type, entry_idx); cbs = menu_entries_get_last_stack_actiondata(); if (cbs && enum_idx) *enum_idx = cbs->enum_idx; }
void menu_entries_get_last_stack(const char **path, const char **label, unsigned *file_type, enum msg_hash_enums *enum_idx, size_t *entry_idx) { menu_file_list_cbs_t *cbs = NULL; menu_list_t *menu_list = NULL; menu_entries_ctl(MENU_ENTRIES_CTL_LIST_GET, &menu_list); if (!menu_list) return; menu_entries_get_last(menu_list_get(menu_list, 0), path, label, file_type, entry_idx); cbs = menu_entries_get_last_stack_actiondata(); if (cbs) *enum_idx = cbs->enum_idx; }
/* Sets title to what the name of the current menu should be. */ int menu_entries_get_title(char *s, size_t len) { unsigned menu_type = 0; const char *path = NULL; const char *label = NULL; enum msg_hash_enums enum_idx = MSG_UNKNOWN; menu_file_list_cbs_t *cbs = menu_entries_list ? (menu_file_list_cbs_t*)file_list_get_last_actiondata( menu_list_get(menu_entries_list, 0)) : NULL; if (!cbs) return -1; menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); if (cbs && cbs->action_get_title) return cbs->action_get_title(path, label, menu_type, s, len); return 0; }
void menu_entries_get_last_stack(const char **path, const char **label, unsigned *file_type, enum msg_hash_enums *enum_idx, size_t *entry_idx) { file_list_t *list = NULL; if (!menu_entries_list) return; list = menu_list_get(menu_entries_list, 0); file_list_get_last(list, path, label, file_type, entry_idx); if (enum_idx) { menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*) file_list_get_last_actiondata(list); if (cbs) *enum_idx = cbs->enum_idx; } }