static int action_left_mainmenu(unsigned type, const char *label, bool wraparound) { menu_ctx_list_t list_info; unsigned push_list = 0; menu_handle_t *menu = NULL; if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) return menu_cbs_exit(); menu_driver_ctl(RARCH_MENU_CTL_LIST_GET_SELECTION, &list_info); list_info.type = MENU_LIST_PLAIN; menu_driver_ctl(RARCH_MENU_CTL_LIST_GET_SIZE, &list_info); if (list_info.size == 1) { settings_t *settings = config_get_ptr(); if ((list_info.selection != 0) || settings->bools.menu_navigation_wraparound_enable) push_list = 1; } else push_list = 2; switch (push_list) { case 1: { menu_ctx_list_t list_info; file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); size_t selection = menu_navigation_get_selection(); menu_file_list_cbs_t *cbs = selection_buf ? (menu_file_list_cbs_t*)file_list_get_actiondata_at_offset(selection_buf, selection) : NULL; list_info.type = MENU_LIST_HORIZONTAL; list_info.action = MENU_ACTION_LEFT; menu_driver_ctl(RARCH_MENU_CTL_LIST_CACHE, &list_info); if (cbs && cbs->action_content_list_switch) return cbs->action_content_list_switch( selection_buf, menu_stack, "", "", 0); } break; case 2: action_left_scroll(0, "", false); break; case 0: default: break; } return 0; }
static int action_left_mainmenu(unsigned type, const char *label, bool wraparound) { size_t selection = 0; menu_file_list_cbs_t *cbs = NULL; unsigned push_list = 0; file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0); file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0); settings_t *settings = config_get_ptr(); menu_handle_t *menu = menu_driver_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) { menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection); if (menu_driver_list_get_selection() != 0 || settings->menu.navigation.wraparound.enable) push_list = 1; } else push_list = 2; menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection); cbs = menu_entries_get_actiondata_at_offset(selection_buf, selection); 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( selection_buf, menu_stack, "", "", 0); break; case 2: action_left_scroll(0, "", false); break; case 0: default: break; } return 0; }
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; }