static bool zarch_menu_init_list(void *data) { int ret; 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); #if 0 menu_entries_increment_menu_stack(); strlcpy(info.label, menu_hash_to_str(MENU_VALUE_MAIN_MENU), sizeof(info.label)); menu_stack = menu_entries_get_menu_stack_ptr(1); menu_entries_push(menu_stack, info.path, info.label, info.type, info.flags, 0); #endif event_command(EVENT_CMD_HISTORY_INIT); info.list = selection_buf; menu_displaylist_push_list(&info, DISPLAYLIST_HISTORY); info.need_push = true; (void)ret; menu_displaylist_push_list_process(&info); return true; }
static int deferred_push_dlist(menu_displaylist_info_t *info, unsigned val) { if (menu_displaylist_push_list(info, val) != 0) return -1; menu_displaylist_push_list_process(info); return 0; }
bool generic_menu_init_list(void *data) { menu_displaylist_info_t info = {0}; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(); file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(); strlcpy(info.label, menu_hash_to_str(MENU_VALUE_MAIN_MENU), sizeof(info.label)); menu_entries_push(menu_stack, info.path, info.label, info.type, info.flags, 0); info.list = selection_buf; menu_displaylist_push_list(&info, DISPLAYLIST_MAIN_MENU); menu_displaylist_push_list_process(&info); return true; }
static int menu_input_key_bind_set_mode_common(rarch_setting_t *setting, enum menu_input_bind_mode type) { 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 (type) { case MENU_INPUT_BIND_NONE: return -1; case MENU_INPUT_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_push_list(&info, DISPLAYLIST_INFO) == 0) menu_displaylist_push_list_process(&info); break; case MENU_INPUT_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_push_list(&info, DISPLAYLIST_INFO) == 0) menu_displaylist_push_list_process(&info); break; } return 0; }