void menu_list_pop_stack_by_needle(menu_list_t *list, const char *needle) { uint32_t needle_hash, label_hash; const char *path = NULL; const char *label = NULL; unsigned type = 0; size_t entry_idx = 0; menu_navigation_t *nav = menu_navigation_get_ptr(); if (!list) return; menu_entries_set_refresh(false); menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx); needle_hash = menu_hash_calculate(needle); label_hash = menu_hash_calculate(label); while (needle_hash == label_hash) { menu_list_pop(list->menu_stack, &nav->selection_ptr); menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx); label_hash = menu_hash_calculate(label); needle_hash = menu_hash_calculate(needle); } }
static int menu_input_mouse_frame( menu_file_list_cbs_t *cbs, menu_entry_t *entry, uint64_t input_mouse) { menu_input_t *menu_input = menu_input_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L)) { if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_TOGGLE)) return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_SELECT); if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_SET_NAVIGATION)) menu_navigation_set(nav, menu_input->mouse.ptr, false); } if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_R)) menu_list_pop_stack(menu_list, &nav->selection_ptr); if (BIT64_GET(input_mouse, MOUSE_ACTION_WHEEL_DOWN)) menu_navigation_increment(nav, 1); if (BIT64_GET(input_mouse, MOUSE_ACTION_WHEEL_UP)) menu_navigation_decrement(nav, 1); return 0; }
static void menu_list_build_scroll_indices(file_list_t *list) { size_t i; int current; bool current_is_dir; menu_navigation_t *nav = menu_navigation_get_ptr(); if (!nav || !list) return; nav->scroll.indices.size = 0; if (!list->size) return; nav->scroll.indices.list[nav->scroll.indices.size++] = 0; current = menu_list_elem_get_first_char(list, 0); current_is_dir = menu_list_elem_is_dir(list, 0); for (i = 1; i < list->size; i++) { int first = menu_list_elem_get_first_char(list, i); bool is_dir = menu_list_elem_is_dir(list, i); if ((current_is_dir && !is_dir) || (first > current)) nav->scroll.indices.list[nav->scroll.indices.size++] = i; current = first; current_is_dir = is_dir; } nav->scroll.indices.list[nav->scroll.indices.size++] = list->size - 1; }
bool menu_entry_is_currently_selected(unsigned id) { menu_navigation_t *nav = menu_navigation_get_ptr(); if (!nav) return false; return (id == nav->selection_ptr); }
ssize_t menu_navigation_get_current_selection(void) { menu_navigation_t *nav = menu_navigation_get_ptr(); if (!nav) return -1; return nav->selection_ptr; }
static void glui_navigation_set(bool scroll) { menu_display_t *disp = menu_display_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr(); float scroll_pos = 0; if (!menu || !disp || !scroll) return; scroll_pos = glui_get_scroll(); if (menu->userdata) { unsigned height = 0, num_lines = 0, end = 0; glui_handle_t *glui = (glui_handle_t*)menu->userdata; menu_navigation_t *nav = menu_navigation_get_ptr(); video_driver_get_size(NULL, &height); num_lines = height / glui->line_height; end = menu_entries_get_end(); if (nav->selection_ptr < num_lines / 2 || end <= num_lines) menu_entries_set_start(0); else if (nav->selection_ptr < (end - num_lines / 2)) menu_entries_set_start(nav->selection_ptr - num_lines / 2); else menu_entries_set_start(end - num_lines); if (menu_entries_get_start() >= 5) menu_entries_set_start(menu_entries_get_start() - 5); } menu_animation_push(disp->animation, 10, scroll_pos, &menu->scroll_y, EASING_IN_OUT_QUAD, -1, NULL); }
bool menu_entry_is_currently_selected(menu_entry_t *entry) { menu_navigation_t *nav = menu_navigation_get_ptr(); if (!entry || !nav) return false; return (entry->id == nav->selection_ptr); }
static void rmenu_xui_navigation_set_visible(void) { menu_handle_t *menu = menu_driver_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (menu) XuiListSetCurSelVisible(m_menulist, nav->selection_ptr); }
static void rmenu_xui_navigation_clear(bool pending_push) { menu_handle_t *menu = menu_driver_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (menu) XuiListSetCurSelVisible(m_menulist, nav->selection_ptr); }
/* Performs whatever actions are associated with menu entry 'i'. * * This is the most important function because it does all the work * associated with clicking on things in the UI. * * This includes loading cores and updating the * currently displayed menu. */ int menu_entry_select(uint32_t i) { menu_entry_t entry = {{0}}; menu_navigation_t *nav = menu_navigation_get_ptr(); nav->selection_ptr = i; menu_entry_get(&entry, i, NULL, false); return menu_entry_action(&entry, i, MENU_ACTION_SELECT); }
static int menu_input_set_bind_mode_common(rarch_setting_t *setting, enum menu_input_bind_mode type) { menu_displaylist_info_t info = {0}; struct retro_keybind *keybind = NULL; settings_t *settings = config_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); menu_input_t *menu_input = menu_input_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (!setting) return -1; switch (type) { case MENU_INPUT_BIND_NONE: return -1; case MENU_INPUT_BIND_SINGLE: keybind = (struct retro_keybind*)setting->value.keybind; if (!keybind) return -1; menu_input->binds.begin = setting->bind_type; menu_input->binds.last = setting->bind_type; menu_input->binds.target = keybind; menu_input->binds.user = setting->index_offset; info.list = menu_list->menu_stack; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = nav->selection_ptr; strlcpy(info.label, menu_hash_to_str(MENU_LABEL_CUSTOM_BIND), sizeof(info.label)); menu_displaylist_push_list(&info, DISPLAYLIST_INFO); break; case MENU_INPUT_BIND_ALL: menu_input->binds.target = &settings->input.binds [setting->index_offset][0]; menu_input->binds.begin = MENU_SETTINGS_BIND_BEGIN; menu_input->binds.last = MENU_SETTINGS_BIND_LAST; info.list = menu_list->menu_stack; info.type = MENU_SETTINGS_CUSTOM_BIND_KEYBOARD; info.directory_ptr = nav->selection_ptr; strlcpy(info.label, menu_hash_to_str(MENU_LABEL_CUSTOM_BIND_ALL), sizeof(info.label)); menu_displaylist_push_list(&info, DISPLAYLIST_INFO); break; } return 0; }
static void menu_input_search_callback(void *userdata, const char *str) { size_t idx = 0; menu_list_t *menu_list = menu_list_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (!menu_list || !nav) return; if (str && *str && file_list_search(menu_list->selection_buf, str, &idx)) menu_navigation_set(nav, idx, true); menu_input_key_end_line(); }
static int pointer_tap(menu_file_list_cbs_t *cbs, menu_entry_t *entry, unsigned action) { menu_input_t *menu_input = menu_input_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (menu_input->pointer.ptr == nav->selection_ptr && cbs && cbs->action_select) return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_SELECT); else menu_navigation_set(nav, menu_input->pointer.ptr, false); return 0; }
static void rmenu_xui_populate_entries(const char *path, const char *label, unsigned i) { menu_handle_t *menu = menu_driver_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (!menu) return; (void)label; (void)path; XuiListSetCurSelVisible(m_menulist, nav->selection_ptr); }
void menu_list_pop_stack(menu_list_t *list) { menu_navigation_t *nav = menu_navigation_get_ptr(); if (!list) return; if (menu_list_get_stack_size(list) <= 1) return; menu_driver_list_cache(MENU_LIST_PLAIN, 0); menu_list_pop(list->menu_stack, &nav->selection_ptr); menu_entries_set_refresh(false); }
static int action_info_default(unsigned type, const char *label) { menu_displaylist_info_t info = {0}; menu_navigation_t *nav = menu_navigation_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); if (!menu_list) return 0; info.list = menu_list->menu_stack; info.directory_ptr = nav->selection_ptr; strlcpy(info.label, menu_hash_to_str(MENU_LABEL_INFO_SCREEN), sizeof(info.label)); return menu_displaylist_push_list(&info, DISPLAYLIST_HELP); }
static int action_left_mainmenu(unsigned type, const char *label, bool wraparound) { menu_file_list_cbs_t *cbs = NULL; unsigned push_list = 0; menu_list_t *menu_list = menu_list_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); unsigned action = MENU_ACTION_LEFT; size_t list_size = menu_driver_list_get_size(MENU_LIST_PLAIN); if (!menu) return -1; if (list_size == 1) { nav->selection_ptr = 0; if (menu_driver_list_get_selection() != 0) push_list = 1; } else push_list = 2; cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, nav->selection_ptr); switch (push_list) { case 1: menu_driver_list_cache(MENU_LIST_HORIZONTAL, action); if (cbs && cbs->action_content_list_switch) return cbs->action_content_list_switch( menu_list->selection_buf, menu_list->menu_stack, "", "", 0); break; case 2: action_left_scroll(0, "", false); break; case 0: default: break; } return 0; }
/** * Before a refresh, we could have deleted a * file on disk, causing selection_ptr to * suddendly be out of range. * * Ensure it doesn't overflow. **/ void menu_list_refresh(file_list_t *list) { menu_navigation_t *nav = menu_navigation_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); if (!nav || !menu_list || !list) return; nav->scroll.indices.size = 0; menu_list_build_scroll_indices(list); if (nav->selection_ptr >= menu_list_get_size(menu_list) && menu_list_get_size(menu_list)) menu_navigation_set(nav, menu_list_get_size(menu_list) - 1, true); else if (!menu_list_get_size(menu_list)) menu_navigation_clear(nav, true); }
static int action_left_scroll(unsigned type, const char *label, bool wraparound) { unsigned scroll_speed = 0, fast_scroll_speed = 0; menu_navigation_t *nav = menu_navigation_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); if (!nav || !menu_list) return -1; scroll_speed = (max(nav->scroll.acceleration, 2) - 2) / 4 + 1; fast_scroll_speed = 4 + 4 * scroll_speed; if (nav->selection_ptr > fast_scroll_speed) menu_navigation_set(nav, nav->selection_ptr - fast_scroll_speed, true); else menu_navigation_clear(nav, false); return 0; }
static float glui_get_scroll(void) { int half; unsigned width, height; glui_handle_t *glui = NULL; menu_handle_t *menu = menu_driver_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (!menu || !menu->userdata) return 0; video_driver_get_size(&width, &height); glui = (glui_handle_t*)menu->userdata; half = (height / glui->line_height) / 2; if (nav->selection_ptr < (unsigned)half) return 0; return ((nav->selection_ptr + 2 - half) * glui->line_height); }
void menu_input_post_iterate(int *ret, unsigned action) { menu_entry_t entry = {{0}}; menu_input_t *menu_input = menu_input_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); settings_t *settings = config_get_ptr(); size_t selected = menu_navigation_get_selection(nav); menu_file_list_cbs_t *cbs = menu_list_get_actiondata_at_offset (menu_list->selection_buf, selected); menu_entry_get(&entry, selected, NULL, false); if (settings->menu.mouse.enable) *ret = menu_input_mouse_post_iterate (&menu_input->mouse.state, cbs, action); *ret = menu_input_mouse_frame(cbs, &entry, menu_input->mouse.state); if (settings->menu.pointer.enable) *ret |= menu_input_pointer_post_iterate(cbs, &entry, action); }
static int archive_open(void) { char cat_path[PATH_MAX_LENGTH] = {0}; menu_displaylist_info_t info = {0}; const char *menu_path = NULL; const char *menu_label = NULL; const char* path = NULL; unsigned int type = 0; size_t entry_idx = 0; menu_navigation_t *nav = menu_navigation_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); if (!menu_list || !nav) return -1; menu_list_pop_stack(menu_list); menu_list_get_last_stack(menu_list, &menu_path, &menu_label, NULL, NULL); if (menu_list_get_size(menu_list) == 0) return 0; menu_list_get_at_offset(menu_list->selection_buf, nav->selection_ptr, &path, NULL, &type, &entry_idx); fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path)); fill_pathname_join(detect_content_path, menu_path, path, sizeof(detect_content_path)); info.list = menu_list->menu_stack; info.type = type; info.directory_ptr = nav->selection_ptr; strlcpy(info.path, cat_path, sizeof(info.path)); strlcpy(info.label, menu_label, sizeof(info.label)); return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC); }
static int pointer_tap(menu_file_list_cbs_t *cbs, menu_entry_t *entry, unsigned action) { menu_handle_t *menu = menu_driver_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); rarch_setting_t *setting = menu_setting_find( menu_list->selection_buf->list[nav->selection_ptr].label); if (menu->pointer.ptr == nav->selection_ptr && cbs && cbs->action_right && setting && (setting->type == ST_BOOL || setting->type == ST_UINT || setting->type == ST_FLOAT || setting->type == ST_STRING)) return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_RIGHT); else if (menu->pointer.ptr == nav->selection_ptr) return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_OK); else menu_navigation_set(nav, menu->pointer.ptr, false); return 0; }
static int action_right_scroll(unsigned type, const char *label, bool wraparound) { unsigned scroll_speed = 0, fast_scroll_speed = 0; menu_list_t *menu_list = menu_list_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (!nav || !menu_list) return -1; scroll_speed = (max(nav->scroll.acceleration, 2) - 2) / 4 + 1; fast_scroll_speed = 4 + 4 * scroll_speed; if (nav->selection_ptr + fast_scroll_speed < (menu_list_get_size(menu_list))) menu_navigation_set(nav, nav->selection_ptr + fast_scroll_speed, true); else { if ((menu_list_get_size(menu_list) > 0)) menu_navigation_set_last(nav); } return 0; }
static int action_iterate_info(char *s, size_t len, const char *label) { uint32_t label_hash = 0; menu_file_list_cbs_t *cbs = NULL; menu_list_t *menu_list = menu_list_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); size_t i = menu_navigation_get_selection(nav); if (!menu_list) return 0; cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, i); if (cbs->setting) { char needle[PATH_MAX_LENGTH]; strlcpy(needle, cbs->setting->name, sizeof(needle)); label_hash = menu_hash_calculate(needle); } return menu_hash_get_help(label_hash, s, len); }
void menu_list_flush_stack(menu_list_t *list, const char *needle, unsigned final_type) { const char *path = NULL; const char *label = NULL; unsigned type = 0; size_t entry_idx = 0; menu_navigation_t *nav = menu_navigation_get_ptr(); if (!list) return; menu_entries_set_refresh(false); menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx); while (menu_list_flush_stack_type( needle, label, type, final_type) != 0) { menu_list_pop(list->menu_stack, &nav->selection_ptr); menu_list_get_last(list->menu_stack, &path, &label, &type, &entry_idx); } }
static void glui_render_menu_list(glui_handle_t *glui, unsigned width, unsigned height, menu_handle_t *menu, uint32_t normal_color, uint32_t hover_color) { size_t i = 0; uint64_t *frame_count = video_driver_get_frame_count(); size_t end = menu_entries_get_end(); menu_display_t *disp = menu_display_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); if (!menu_display_update_pending()) return; glui->list_block.carr.coords.vertices = 0; for (i = menu_entries_get_start(); i < end; i++) { bool entry_selected; menu_entry_t entry; int y = disp->header_height - menu->scroll_y + (glui->line_height * i); if (y > (int)height || ((y + (int)glui->line_height) < 0)) continue; menu_entries_get(i, &entry); entry_selected = (menu_navigation_get_selection(nav) == i); glui_render_label_value(glui, y, width, height, *frame_count / 40, entry_selected ? hover_color : normal_color, entry_selected, entry.path, entry.value); } }
// Performs whatever actions are associated with menu entry 'i'. This // is the most important function because it does all the work // associated with clicking on things in the UI. This includes loading // cores and updating the currently displayed menu int menu_entry_select(uint32_t i) { int ret = 0; menu_entry_t entry; enum menu_action action = MENU_ACTION_NOOP; menu_file_list_cbs_t *cbs = NULL; menu_navigation_t *nav = menu_navigation_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); rarch_setting_t *setting = menu_setting_find( menu_list->selection_buf->list[i].label); menu_entry_get(&entry, i, NULL, false); cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, i); if (setting_is_of_path_type(setting)) return 0; nav->selection_ptr = i; if ((cbs && cbs->action_ok) || setting_is_of_general_type(setting)) action = MENU_ACTION_OK; else { if (cbs && cbs->action_start) action = MENU_ACTION_START; if (cbs && cbs->action_right) action = MENU_ACTION_RIGHT; } if (action != MENU_ACTION_NOOP) ret = menu_entry_action(&entry, i, action); rarch_main_data_iterate(); return ret; }
static void glui_frame(void) { unsigned width, height; char title[PATH_MAX_LENGTH]; char title_buf[PATH_MAX_LENGTH]; char title_msg[PATH_MAX_LENGTH]; char timedate[PATH_MAX_LENGTH]; gl_t *gl = NULL; glui_handle_t *glui = NULL; const struct font_renderer *font_driver = NULL; driver_t *driver = driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr(); menu_animation_t *anim = menu_animation_get_ptr(); menu_navigation_t *nav = menu_navigation_get_ptr(); menu_display_t *disp = menu_display_get_ptr(); settings_t *settings = config_get_ptr(); menu_input_t *menu_input = menu_input_get_ptr(); uint64_t frame_count = video_driver_get_frame_count(); const uint32_t normal_color = FONT_COLOR_ARGB_TO_RGBA( settings->menu.entry_normal_color); const uint32_t hover_color = FONT_COLOR_ARGB_TO_RGBA( settings->menu.entry_hover_color); const uint32_t title_color = FONT_COLOR_ARGB_TO_RGBA( settings->menu.title_color); if (!menu || !menu->userdata) return; gl = (gl_t*)video_driver_get_ptr(NULL); if (!gl) return; glui = (glui_handle_t*)menu->userdata; if ( menu_entries_needs_refresh() && menu_driver_alive() && !disp->msg_force && !glui->box_message[0] ) return; title[0] = '\0'; title_buf[0] = '\0'; title_msg[0] = '\0'; timedate[0] = '\0'; video_driver_get_size(&width, &height); menu_display_set_viewport(); gl_menu_frame_background(menu, settings, gl, glui->textures.bg.id, 0.75f, 0.75f, false); menu_entries_get_title(title, sizeof(title)); font_driver = driver->font_osd_driver; menu_display_font_bind_block(menu, font_driver, &glui->list_block); glui_render_menu_list(glui, menu, normal_color, hover_color); menu_display_font_flush_block(menu, font_driver); glui_render_quad(gl, 0, disp->header_height - menu->scroll_y + glui->line_height * nav->selection_ptr, width, glui->line_height, 1, 1, 1, 0.1); anim->is_active = true; anim->label.is_updated = false; glui_render_quad(gl, 0, 0, width, disp->header_height, 0.2, 0.2, 0.2, 1); menu_animation_ticker_line(title_buf, glui->ticker_limit, frame_count / 100, title, true); glui_blit_line(width / 2, 0, title_buf, title_color, TEXT_ALIGN_CENTER); if (menu_entries_show_back()) glui_blit_line(glui->margin, 0, menu_hash_to_str(MENU_VALUE_BACK), title_color, TEXT_ALIGN_LEFT); glui_render_quad(gl, 0, height - disp->header_height, width, disp->header_height, 0.2, 0.2, 0.2, 1); glui_draw_scrollbar(gl); if (settings->menu.core_enable) { menu_entries_get_core_title(title_msg, sizeof(title_msg)); glui_blit_line(glui->margin, height - glui->line_height, title_msg, title_color, TEXT_ALIGN_LEFT); } if (settings->menu.timedate_enable) { menu_display_timedate(timedate, sizeof(timedate), 0); glui_blit_line(width - glui->margin, height - glui->line_height, timedate, hover_color, TEXT_ALIGN_RIGHT); } if (menu_input->keyboard.display) { char msg[PATH_MAX_LENGTH]; const char *str = *menu_input->keyboard.buffer; msg[0] = '\0'; if (!str) str = ""; glui_render_quad(gl, 0, 0, width, height, 0, 0, 0, 0.75); snprintf(msg, sizeof(msg), "%s\n%s", menu_input->keyboard.label, str); glui_render_messagebox(msg); } if (glui->box_message[0] != '\0') { glui_render_quad(gl, 0, 0, width, height, 0, 0, 0, 0.75); glui_render_messagebox(glui->box_message); glui->box_message[0] = '\0'; } if (settings->menu.mouse.enable) glui_draw_cursor(gl, menu_input->mouse.x, menu_input->mouse.y); gl->shader->use(gl, GL_SHADER_STOCK_BLEND); menu_display_unset_viewport(); }
int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action) { int ret = 0; menu_navigation_t *nav = menu_navigation_get_ptr(); menu_display_t *disp = menu_display_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); menu_file_list_cbs_t *cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, i); switch (action) { case MENU_ACTION_UP: if (cbs && cbs->action_up) ret = cbs->action_up(entry->type, entry->label); break; case MENU_ACTION_DOWN: if (cbs && cbs->action_down) ret = cbs->action_down(entry->type, entry->label); break; case MENU_ACTION_SCROLL_UP: menu_navigation_descend_alphabet(nav, &nav->selection_ptr); break; case MENU_ACTION_SCROLL_DOWN: menu_navigation_ascend_alphabet(nav, &nav->selection_ptr); break; case MENU_ACTION_CANCEL: if (cbs && cbs->action_cancel) ret = cbs->action_cancel(entry->path, entry->label, entry->type, i); break; case MENU_ACTION_OK: if (cbs && cbs->action_ok) ret = cbs->action_ok(entry->path, entry->label, entry->type, i, entry->entry_idx); break; case MENU_ACTION_START: if (cbs && cbs->action_start) ret = cbs->action_start(entry->type, entry->label); break; case MENU_ACTION_LEFT: if (cbs && cbs->action_left) ret = cbs->action_left(entry->type, entry->label, false); break; case MENU_ACTION_RIGHT: if (cbs && cbs->action_right) ret = cbs->action_right(entry->type, entry->label, false); break; case MENU_ACTION_INFO: if (cbs && cbs->action_info) ret = cbs->action_info(entry->type, entry->label); break; case MENU_ACTION_SELECT: if (cbs && cbs->action_select) ret = cbs->action_select(entry->path, entry->label, entry->type, i); break; case MENU_ACTION_REFRESH: if (cbs && cbs->action_refresh) { ret = cbs->action_refresh(menu_list->selection_buf, menu_list->menu_stack); menu_entries_unset_refresh(); } break; case MENU_ACTION_MESSAGE: if (disp) disp->msg_force = true; break; case MENU_ACTION_SEARCH: menu_input_search_start(); break; case MENU_ACTION_SCAN: if (cbs && cbs->action_scan) ret = cbs->action_scan(entry->path, entry->label, entry->type, i); break; default: break; } return ret; }