static int deferred_push_dlist(menu_displaylist_info_t *info, enum menu_displaylist_ctl_state state) { if (!menu_displaylist_ctl(state, info)) return menu_cbs_exit(); menu_displaylist_ctl(DISPLAYLIST_PROCESS, info); return 0; }
static bool zarch_menu_init_list(void *data) { menu_displaylist_info_t info = {0}; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); strlcpy(info.label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB), sizeof(info.label)); info.enum_idx = MENU_ENUM_LABEL_HISTORY_TAB; menu_entries_append_enum(menu_stack, info.path, info.label, MENU_ENUM_LABEL_HISTORY_TAB, info.type, info.flags, 0); command_event(CMD_EVENT_HISTORY_INIT, NULL); info.list = selection_buf; if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, &info)) { info.need_push = true; return menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info); } return false; }
static int menu_input_key_bind_set_mode_common( enum menu_input_binds_ctl_state state, rarch_setting_t *setting) { unsigned bind_type = 0; menu_displaylist_info_t info = {0}; struct retro_keybind *keybind = NULL; unsigned index_offset = setting->index_offset; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); size_t selection = menu_navigation_get_selection(); switch (state) { case MENU_INPUT_BINDS_CTL_BIND_SINGLE: keybind = (struct retro_keybind*)setting_get_ptr(setting); if (!keybind) return -1; bind_type = setting_get_bind_type(setting); menu_input_binds.begin = bind_type; menu_input_binds.last = bind_type; menu_input_binds.target = keybind; menu_input_binds.user = index_offset; info.list = menu_stack; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = selection; info.enum_idx = MENU_ENUM_LABEL_CUSTOM_BIND; strlcpy(info.label, msg_hash_to_str(MENU_ENUM_LABEL_CUSTOM_BIND), sizeof(info.label)); if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info)) menu_displaylist_process(&info); break; case MENU_INPUT_BINDS_CTL_BIND_ALL: menu_input_binds.target = &input_config_binds[index_offset][0]; menu_input_binds.begin = MENU_SETTINGS_BIND_BEGIN; menu_input_binds.last = MENU_SETTINGS_BIND_LAST; info.list = menu_stack; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = selection; info.enum_idx = MENU_ENUM_LABEL_CUSTOM_BIND_ALL; strlcpy(info.label, msg_hash_to_str(MENU_ENUM_LABEL_CUSTOM_BIND_ALL), sizeof(info.label)); if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info)) menu_displaylist_process(&info); break; default: case MENU_INPUT_BINDS_CTL_BIND_NONE: break; } return 0; }
void menu_dialog_push(void) { menu_displaylist_info_t info; if (!menu_dialog_is_push_pending()) return; info.need_sort = false; info.need_refresh = false; info.need_entries_refresh = false; info.need_push = false; info.need_clear = false; info.need_navigation_clear= false; info.list = menu_entries_get_menu_stack_ptr(0); info.menu_list = NULL; info.path[0] = '\0'; info.path_b[0] = '\0'; info.path_c[0] = '\0'; info.label[0] = '\0'; info.label_hash = 0; info.exts[0] = '\0'; info.type = 0; info.type_default = 0; info.directory_ptr = 0; info.flags = 0; info.enum_idx = MENU_ENUM_LABEL_HELP; info.setting = NULL; strlcpy(info.label, msg_hash_to_str(MENU_ENUM_LABEL_HELP), sizeof(info.label)); menu_displaylist_ctl(DISPLAYLIST_HELP, &info); }
void ozone_init_horizontal_list(ozone_handle_t *ozone) { menu_displaylist_info_t info; settings_t *settings = config_get_ptr(); menu_displaylist_info_init(&info); info.list = ozone->horizontal_list; info.path = strdup( settings->paths.directory_playlist); info.label = strdup( msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST)); info.exts = strdup( file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT)); info.type_default = FILE_TYPE_PLAIN; info.enum_idx = MENU_ENUM_LABEL_CONTENT_COLLECTION_LIST; if (settings->bools.menu_content_show_playlists && !string_is_empty(info.path)) { if (menu_displaylist_ctl(DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL, &info)) menu_displaylist_process(&info); } menu_displaylist_info_free(&info); }
bool generic_menu_init_list(void *data) { menu_displaylist_info_t info = {0}; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); strlcpy(info.label, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU), sizeof(info.label)); info.enum_idx = MENU_ENUM_LABEL_MAIN_MENU; menu_entries_append_enum(menu_stack, info.path, info.label, MENU_ENUM_LABEL_MAIN_MENU, info.type, info.flags, 0); info.list = selection_buf; if (menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info)) menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info); return true; }
int action_refresh_default(file_list_t *list, file_list_t *menu_list) { menu_displaylist_ctx_entry_t entry; if (!menu_list) return -1; entry.list = list; entry.stack = menu_list; if (!menu_displaylist_ctl(DISPLAYLIST_PUSH_ONTO_STACK, &entry)) return -1; return 0; }
static bool zarch_menu_init_list(void *data) { menu_displaylist_info_t info = {0}; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); strlcpy(info.label, menu_hash_to_str(MENU_VALUE_HISTORY_TAB), sizeof(info.label)); menu_entries_push(menu_stack, info.path, info.label, info.type, info.flags, 0); event_cmd_ctl(EVENT_CMD_HISTORY_INIT, NULL); info.list = selection_buf; if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, &info)) { info.need_push = true; return menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info); } return false; }
void menu_popup_push(void) { menu_displaylist_info_t info = {0}; if (!menu_popup_is_push_pending()) return; info.list = menu_entries_get_menu_stack_ptr(0); strlcpy(info.label, msg_hash_to_str(MENU_ENUM_LABEL_HELP), sizeof(info.label)); info.enum_idx = MENU_ENUM_LABEL_HELP; menu_displaylist_ctl(DISPLAYLIST_HELP, &info); }
void menu_dialog_push(void) { menu_displaylist_info_t info; const char *label; if (!menu_dialog_is_push_pending()) return; menu_displaylist_info_init(&info); info.list = menu_entries_get_menu_stack_ptr(0); info.enum_idx = MENU_ENUM_LABEL_HELP; /* Set the label string, if it exists. */ label = msg_hash_to_str(MENU_ENUM_LABEL_HELP); if (label) info.label = strdup(label); menu_displaylist_ctl(DISPLAYLIST_HELP, &info); }
static int menu_input_key_bind_set_mode_common( enum menu_input_ctl_state state, rarch_setting_t *setting) { size_t selection; unsigned index_offset, bind_type; menu_displaylist_info_t info = {0}; struct retro_keybind *keybind = NULL; file_list_t *menu_stack = NULL; settings_t *settings = config_get_ptr(); menu_input_t *menu_input = menu_input_get_ptr(); if (!setting) return -1; index_offset = menu_setting_get_index_offset(setting); menu_stack = menu_entries_get_menu_stack_ptr(0); menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); switch (state) { case MENU_INPUT_CTL_BIND_NONE: return -1; case MENU_INPUT_CTL_BIND_SINGLE: keybind = (struct retro_keybind*)setting_get_ptr(setting); if (!keybind) return -1; bind_type = menu_setting_get_bind_type(setting); menu_input->binds.begin = bind_type; menu_input->binds.last = bind_type; menu_input->binds.target = keybind; menu_input->binds.user = index_offset; info.list = menu_stack; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = selection; strlcpy(info.label, menu_hash_to_str(MENU_LABEL_CUSTOM_BIND), sizeof(info.label)); if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info)) menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info); break; case MENU_INPUT_CTL_BIND_ALL: menu_input->binds.target = &settings->input.binds [index_offset][0]; menu_input->binds.begin = MENU_SETTINGS_BIND_BEGIN; menu_input->binds.last = MENU_SETTINGS_BIND_LAST; info.list = menu_stack; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = selection; strlcpy(info.label, menu_hash_to_str(MENU_LABEL_CUSTOM_BIND_ALL), sizeof(info.label)); if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info)) menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info); break; default: case MENU_INPUT_CTL_NONE: break; } return 0; }