RetroArch/menu/menu_entries.c

1355 lines
38 KiB
C
Raw Normal View History

2015-06-12 16:07:12 +02:00
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2015 - Jay McCarthy
2017-01-22 13:40:32 +01:00
* Copyright (C) 2011-2017 - Daniel De Matteis
2015-06-12 16:07:12 +02:00
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
2015-10-17 19:38:33 +02:00
#include <string.h>
#include <retro_inline.h>
#include <compat/strl.h>
#include <lists/string_list.h>
#include <string/stdstring.h>
2015-12-06 17:55:27 +01:00
#include "menu_driver.h"
2015-10-17 19:38:33 +02:00
#include "menu_cbs.h"
2015-06-16 02:15:32 +02:00
#include "widgets/menu_input_dialog.h"
2016-09-06 06:11:44 +02:00
#include "../core.h"
2017-05-11 09:11:46 +02:00
#include "../retroarch.h"
#include "../version.h"
2015-06-12 16:07:12 +02:00
2017-05-27 01:01:58 +02:00
/* Flagged when menu entries need to be refreshed */
static bool menu_entries_need_refresh = false;
static bool menu_entries_nonblocking_refresh = false;
static size_t menu_entries_begin = 0;
static rarch_setting_t *menu_entries_list_settings = NULL;
static menu_list_t *menu_entries_list = NULL;
2018-02-25 00:39:20 +01:00
struct menu_list
{
size_t menu_stack_size;
size_t selection_buf_size;
file_list_t **menu_stack;
file_list_t **selection_buf;
};
2019-05-01 12:32:49 +02:00
#define menu_entries_need_refresh() ((!menu_entries_nonblocking_refresh) && menu_entries_need_refresh)
/* This file provides an abstraction of the currently displayed
* menu.
*
* It is organized into an event-based system where the UI companion
* calls this functions and RetroArch responds by changing the global
* state (including arranging for these functions to return different
* values).
*
* Its only interaction back to the UI is to arrange for
* notify_list_loaded on the UI companion.
*/
enum menu_entry_type menu_entry_get_type(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = NULL;
rarch_setting_t *setting = NULL;
/* FIXME/TODO - XXX Really a special kind of ST_ACTION,
* but this should be changed */
if (menu_setting_ctl(MENU_SETTING_CTL_IS_OF_PATH_TYPE, (void*)setting))
return MENU_ENTRY_PATH;
2019-05-18 21:07:04 +02:00
cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
setting = cbs ? cbs->setting : NULL;
if (setting)
{
switch (setting_get_type(setting))
{
case ST_BOOL:
return MENU_ENTRY_BOOL;
case ST_BIND:
return MENU_ENTRY_BIND;
case ST_INT:
return MENU_ENTRY_INT;
case ST_UINT:
return MENU_ENTRY_UINT;
case ST_SIZE:
return MENU_ENTRY_SIZE;
case ST_FLOAT:
return MENU_ENTRY_FLOAT;
case ST_PATH:
return MENU_ENTRY_PATH;
case ST_DIR:
return MENU_ENTRY_DIR;
case ST_STRING_OPTIONS:
return MENU_ENTRY_ENUM;
case ST_STRING:
return MENU_ENTRY_STRING;
case ST_HEX:
return MENU_ENTRY_HEX;
default:
break;
}
}
return MENU_ENTRY_ACTION;
}
void menu_entry_free(menu_entry_t *entry)
{
if (!entry)
return;
if (!string_is_empty(entry->label))
free(entry->label);
if (!string_is_empty(entry->rich_label))
free(entry->rich_label);
if (!string_is_empty(entry->sublabel))
free(entry->sublabel);
if (!string_is_empty(entry->path))
free(entry->path);
if (!string_is_empty(entry->value))
free(entry->value);
entry->path = NULL;
entry->label = NULL;
entry->value = NULL;
entry->sublabel = NULL;
entry->rich_label = NULL;
}
void menu_entry_init(menu_entry_t *entry)
{
entry->path = NULL;
entry->label = NULL;
entry->value = NULL;
entry->sublabel = NULL;
entry->rich_label = NULL;
entry->enum_idx = MSG_UNKNOWN;
entry->entry_idx = 0;
entry->idx = 0;
entry->type = 0;
entry->spacing = 0;
}
char *menu_entry_get_path(menu_entry_t *entry)
{
if (!entry || string_is_empty(entry->path))
return NULL;
return strdup(entry->path);
}
/*
* Return Value
*
* The function returns a heap-allocated string if
* successful. It's the callee's responsibility to
* free this.
*/
char *menu_entry_get_rich_label(menu_entry_t *entry)
{
if (!entry)
return NULL;
if (!string_is_empty(entry->rich_label))
return strdup(entry->rich_label);
if (!string_is_empty(entry->path))
return strdup(entry->path);
return NULL;
}
/*
* Return Value
*
* The function returns a heap-allocated string if
* successful. It's the callee's responsibility to
* free this.
*/
char *menu_entry_get_sublabel(menu_entry_t *entry)
{
if (!entry || string_is_empty(entry->sublabel))
return NULL;
return strdup(entry->sublabel);
}
void menu_entry_get_label(menu_entry_t *entry, char *s, size_t len)
{
if (entry && !string_is_empty(entry->label))
strlcpy(s, entry->label, len);
}
unsigned menu_entry_get_spacing(menu_entry_t *entry)
{
if (entry)
return entry->spacing;
return 0;
}
unsigned menu_entry_get_type_new(menu_entry_t *entry)
{
if (!entry)
return 0;
return entry->type;
}
uint32_t menu_entry_get_bool_value(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
bool *ptr = setting ? (bool*)setting->value.target.boolean : NULL;
if (!ptr)
return 0;
return *ptr;
}
struct string_list *menu_entry_enum_values(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
const char *values = setting->values;
if (!values)
return NULL;
return string_split(values, "|");
}
void menu_entry_enum_set_value_with_string(uint32_t i, const char *s)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
setting_set_with_string_representation(setting, s);
}
int32_t menu_entry_bind_index(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
if (setting)
return setting->index - 1;
return 0;
}
void menu_entry_bind_key_set(uint32_t i, int32_t value)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
struct retro_keybind *keybind = setting ? (struct retro_keybind*)setting->value.target.keybind : NULL;
if (keybind)
keybind->key = (enum retro_key)value;
}
void menu_entry_bind_joykey_set(uint32_t i, int32_t value)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
struct retro_keybind *keybind = setting ? (struct retro_keybind*)setting->value.target.keybind : NULL;
if (keybind)
keybind->joykey = value;
}
void menu_entry_bind_joyaxis_set(uint32_t i, int32_t value)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
struct retro_keybind *keybind = setting ? (struct retro_keybind*)setting->value.target.keybind : NULL;
if (keybind)
keybind->joyaxis = value;
}
void menu_entry_pathdir_selected(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
if (menu_setting_ctl(MENU_SETTING_CTL_IS_OF_PATH_TYPE, (void*)setting))
menu_setting_ctl(MENU_SETTING_CTL_ACTION_RIGHT, setting);
}
bool menu_entry_pathdir_allow_empty(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
uint64_t flags = setting->flags;
return flags & SD_FLAG_ALLOW_EMPTY;
}
uint32_t menu_entry_pathdir_for_directory(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
uint64_t flags = setting->flags;
return flags & SD_FLAG_PATH_DIR;
}
void menu_entry_pathdir_extensions(uint32_t i, char *s, size_t len)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
const char *values = setting->values;
if (!values)
return;
strlcpy(s, values, len);
}
void menu_entry_reset(uint32_t i)
{
menu_entry_t entry;
menu_entry_init(&entry);
menu_entry_get(&entry, 0, i, NULL, true);
menu_entry_action(&entry, i, MENU_ACTION_START);
}
void menu_entry_get_value(menu_entry_t *entry, char *s, size_t len)
{
size_t size, i;
if (!entry || string_is_empty(entry->value))
return;
size = strlcpy(s, entry->value, len);
if (menu_entry_is_password(entry))
{
for (i = 0; i < size; i++)
s[i] = '*';
}
}
void menu_entry_set_value(uint32_t i, const char *s)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
setting_set_with_string_representation(setting, s);
}
bool menu_entry_is_password(menu_entry_t *entry)
{
return entry->enum_idx == MENU_ENUM_LABEL_CHEEVOS_PASSWORD;
}
uint32_t menu_entry_num_has_range(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
uint64_t flags = setting->flags;
return (flags & SD_FLAG_HAS_RANGE);
}
float menu_entry_num_min(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
double min = setting->min;
return (float)min;
}
float menu_entry_num_max(uint32_t i)
{
2019-05-18 21:07:04 +02:00
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
rarch_setting_t *setting = cbs ? cbs->setting : NULL;
double max = setting->max;
return (float)max;
}
void menu_entry_get(menu_entry_t *entry, size_t stack_idx,
size_t i, void *userdata, bool use_representation)
{
char newpath[255];
const char *path = NULL;
const char *entry_label = NULL;
menu_file_list_cbs_t *cbs = NULL;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(stack_idx);
file_list_t *list = (userdata) ? (file_list_t*)userdata : selection_buf;
newpath[0] = '\0';
if (!list)
return;
file_list_get_at_offset(list, i, &path, &entry_label, &entry->type,
&entry->entry_idx);
2019-05-13 04:05:11 +02:00
cbs = (menu_file_list_cbs_t*)list->list[i].actiondata;
2019-05-13 03:36:59 +02:00
entry->idx = (unsigned)i;
if (!string_is_empty(entry_label))
entry->label = strdup(entry_label);
if (cbs)
{
const char *label = NULL;
entry->enum_idx = cbs->enum_idx;
entry->checked = cbs->checked;
menu_entries_get_last_stack(NULL, &label, NULL, NULL, NULL);
if (cbs->action_get_value && use_representation)
{
char tmp[255];
tmp[0] = '\0';
cbs->action_get_value(list,
&entry->spacing, entry->type,
(unsigned)i, label,
tmp,
sizeof(tmp),
2019-05-13 03:36:59 +02:00
path,
newpath,
sizeof(newpath)
);
if (!string_is_empty(tmp))
entry->value = strdup(tmp);
}
if (cbs->action_label)
{
char tmp[255];
tmp[0] = '\0';
cbs->action_label(list,
entry->type, (unsigned)i,
label, path,
tmp,
sizeof(tmp));
if (!string_is_empty(tmp))
entry->rich_label = strdup(tmp);
}
if (cbs->action_sublabel)
{
char tmp[512];
tmp[0] = '\0';
if (!string_is_empty(cbs->action_sublabel_cache))
entry->sublabel = strdup(cbs->action_sublabel_cache);
else
{
if (cbs->action_sublabel(list,
entry->type, (unsigned)i,
label, path,
tmp,
sizeof(tmp)))
{
/* if this function callback returns true,
* we know that the value won't change - so we
* can cache it instead. */
strlcpy(cbs->action_sublabel_cache,
tmp, sizeof(cbs->action_sublabel_cache));
}
if (!string_is_empty(tmp))
entry->sublabel = strdup(tmp);
}
}
}
if (!string_is_empty(path) && !use_representation)
strlcpy(newpath, path, sizeof(newpath));
else if (cbs && cbs->setting && cbs->setting->enum_value_idx != MSG_UNKNOWN
&& !cbs->setting->dont_use_enum_idx_representation)
strlcpy(newpath,
msg_hash_to_str(cbs->setting->enum_value_idx),
sizeof(newpath));
if (!string_is_empty(newpath))
entry->path = strdup(newpath);
}
bool menu_entry_is_currently_selected(unsigned id)
{
return (id == menu_navigation_get_selection());
}
/* 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;
menu_navigation_set_selection(i);
menu_entry_init(&entry);
menu_entry_get(&entry, 0, i, NULL, false);
return menu_entry_action(&entry, i, MENU_ACTION_SELECT);
}
int menu_entry_action(menu_entry_t *entry,
unsigned i, enum menu_action action)
{
int ret = 0;
file_list_t *selection_buf =
menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs = selection_buf ?
2019-05-13 04:05:11 +02:00
(menu_file_list_cbs_t*)selection_buf->list[i].actiondata : NULL;
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_driver_ctl(MENU_NAVIGATION_CTL_DESCEND_ALPHABET, NULL);
break;
case MENU_ACTION_SCROLL_DOWN:
menu_driver_ctl(MENU_NAVIGATION_CTL_ASCEND_ALPHABET, NULL);
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_SEARCH:
menu_input_dialog_start_search();
break;
case MENU_ACTION_SCAN:
if (cbs && cbs->action_scan)
ret = cbs->action_scan(entry->path,
entry->label, entry->type, i);
break;
default:
break;
}
cbs = selection_buf ? (menu_file_list_cbs_t*)
2019-05-13 04:05:11 +02:00
selection_buf->list[i].actiondata : NULL;
2019-05-01 12:32:49 +02:00
if (menu_entries_need_refresh())
{
if (cbs && cbs->action_refresh)
{
bool refresh = false;
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
cbs->action_refresh(selection_buf, menu_stack);
menu_entries_ctl(MENU_ENTRIES_CTL_UNSET_REFRESH, &refresh);
}
}
return ret;
}
2018-02-25 00:39:20 +01:00
static void menu_list_free_list(file_list_t *list)
{
unsigned i;
for (i = 0; i < list->size; i++)
{
menu_ctx_list_t list_info;
list_info.list = list;
list_info.idx = i;
list_info.list_size = list->size;
menu_driver_ctl(RARCH_MENU_CTL_LIST_FREE, &list_info);
}
file_list_free(list);
}
static void menu_list_free(menu_list_t *menu_list)
{
if (!menu_list)
return;
if (menu_list->menu_stack)
2018-02-25 00:39:20 +01:00
{
unsigned i;
for (i = 0; i < menu_list->menu_stack_size; i++)
{
if (!menu_list->menu_stack[i])
continue;
2018-02-25 00:39:20 +01:00
menu_list_free_list(menu_list->menu_stack[i]);
menu_list->menu_stack[i] = NULL;
}
free(menu_list->menu_stack);
2018-02-25 00:39:20 +01:00
}
if (menu_list->selection_buf)
2018-02-25 00:39:20 +01:00
{
unsigned i;
2018-02-25 00:39:20 +01:00
for (i = 0; i < menu_list->selection_buf_size; i++)
{
if (!menu_list->selection_buf[i])
continue;
menu_list_free_list(menu_list->selection_buf[i]);
menu_list->selection_buf[i] = NULL;
}
2018-02-25 00:39:20 +01:00
free(menu_list->selection_buf);
}
2018-02-25 00:39:20 +01:00
free(menu_list);
}
static menu_list_t *menu_list_new(void)
{
unsigned i;
menu_list_t *list = (menu_list_t*)malloc(sizeof(*list));
if (!list)
return NULL;
list->menu_stack_size = 1;
list->selection_buf_size = 1;
list->selection_buf = NULL;
list->menu_stack = (file_list_t**)
calloc(list->menu_stack_size, sizeof(*list->menu_stack));
if (!list->menu_stack)
goto error;
list->selection_buf = (file_list_t**)
calloc(list->selection_buf_size, sizeof(*list->selection_buf));
if (!list->selection_buf)
goto error;
for (i = 0; i < list->menu_stack_size; i++)
list->menu_stack[i] = (file_list_t*)
calloc(1, sizeof(*list->menu_stack[i]));
for (i = 0; i < list->selection_buf_size; i++)
list->selection_buf[i] = (file_list_t*)
calloc(1, sizeof(*list->selection_buf[i]));
return list;
error:
menu_list_free(list);
return NULL;
}
#define menu_list_get(list, idx) ((list) ? ((list)->menu_stack[(idx)]) : NULL)
2018-02-25 00:39:20 +01:00
#define menu_list_get_selection(list, idx) ((list) ? ((list)->selection_buf[(idx)]) : NULL)
2018-02-25 00:39:20 +01:00
2019-05-13 04:05:11 +02:00
#define menu_list_get_stack_size(list, idx) ((list)->menu_stack[(idx)]->size)
2018-02-25 00:39:20 +01:00
static int menu_list_flush_stack_type(const char *needle, const char *label,
unsigned type, unsigned final_type)
{
return needle ? !string_is_equal(needle, label) : (type != final_type);
}
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)
2018-09-26 14:22:22 +02:00
menu_driver_list_cache(&list_info);
2018-02-25 00:39:20 +01:00
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);
2018-09-26 14:22:22 +02:00
menu_driver_list_set_selection(menu_list);
2018-02-25 00:39:20 +01:00
if (animate)
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
return true;
}
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);
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();
2019-05-02 16:21:12 +02:00
if (!menu_list_pop_stack(list, idx, &new_selection_ptr, 1))
2018-02-25 00:39:20 +01:00
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);
}
}
2015-10-18 21:54:20 +02:00
void menu_entries_get_at_offset(const file_list_t *list, size_t idx,
2015-10-17 19:38:33 +02:00
const char **path, const char **label, unsigned *file_type,
2015-10-18 21:54:20 +02:00
size_t *entry_idx, const char **alt)
2015-10-17 19:38:33 +02:00
{
file_list_get_at_offset(list, idx, path, label, file_type, entry_idx);
2015-10-18 21:54:20 +02:00
file_list_get_alt_at_offset(list, idx, alt);
2015-10-17 19:38:33 +02:00
}
/**
2015-10-19 16:43:07 +02:00
* menu_entries_elem_get_first_char:
2015-10-17 19:38:33 +02:00
* @list : File list handle.
* @offset : Offset index of element.
*
* Gets the first character of an element in the
* file list.
*
* Returns: first character of element in file list.
**/
2015-10-19 16:43:07 +02:00
static int menu_entries_elem_get_first_char(
2015-10-17 19:38:33 +02:00
file_list_t *list, unsigned offset)
{
int ret = 0;
2015-10-17 19:38:33 +02:00
const char *path = NULL;
2019-05-02 16:21:12 +02:00
file_list_get_at_offset(list, offset, NULL, NULL, NULL, NULL);
file_list_get_alt_at_offset(list, offset, &path);
2019-05-01 12:32:49 +02:00
if (path)
ret = tolower((int)*path);
2015-10-17 19:38:33 +02:00
/* "Normalize" non-alphabetical entries so they
* are lumped together for purposes of jumping. */
if (ret < 'a')
2019-05-02 16:21:12 +02:00
return ('a' - 1);
2015-10-17 19:38:33 +02:00
else if (ret > 'z')
2019-05-02 16:21:12 +02:00
return ('z' + 1);
2015-10-17 19:38:33 +02:00
return ret;
}
static void menu_entries_build_scroll_indices(file_list_t *list)
2015-10-17 19:38:33 +02:00
{
int current;
2019-05-01 12:32:49 +02:00
bool current_is_dir = false;
unsigned type = 0;
2015-10-17 19:38:33 +02:00
size_t i, scroll_value = 0;
menu_driver_ctl(MENU_NAVIGATION_CTL_CLEAR_SCROLL_INDICES, NULL);
menu_driver_ctl(MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX, &scroll_value);
2015-10-17 19:38:33 +02:00
2015-10-19 16:43:07 +02:00
current = menu_entries_elem_get_first_char(list, 0);
2019-05-01 12:32:49 +02:00
2019-05-02 16:21:12 +02:00
file_list_get_at_offset(list, 0, NULL, NULL, &type, NULL);
2019-05-01 12:32:49 +02:00
if (type == FILE_TYPE_DIRECTORY)
current_is_dir = true;
2015-10-17 19:38:33 +02:00
for (i = 1; i < list->size; i++)
{
2019-05-02 16:21:12 +02:00
int first = menu_entries_elem_get_first_char(list, (unsigned)i);
bool is_dir = false;
unsigned idx = (unsigned)i;
2019-05-01 12:32:49 +02:00
2019-05-02 16:21:12 +02:00
file_list_get_at_offset(list, idx, NULL, NULL, &type, NULL);
2019-05-01 12:32:49 +02:00
if (type == FILE_TYPE_DIRECTORY)
is_dir = true;
2015-10-17 19:38:33 +02:00
if ((current_is_dir && !is_dir) || (first > current))
menu_driver_ctl(MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX, &i);
2015-10-17 19:38:33 +02:00
current = first;
current_is_dir = is_dir;
}
scroll_value = list->size - 1;
menu_driver_ctl(MENU_NAVIGATION_CTL_ADD_SCROLL_INDEX, &scroll_value);
2015-10-17 19:38:33 +02:00
}
/**
* 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.
**/
2019-05-01 12:32:49 +02:00
static bool menu_entries_refresh(file_list_t *list)
2015-10-17 19:38:33 +02:00
{
size_t list_size;
size_t selection = menu_navigation_get_selection();
2015-10-17 19:38:33 +02:00
2019-05-01 12:32:49 +02:00
if (list->size)
menu_entries_build_scroll_indices(list);
2015-10-17 19:38:33 +02:00
2019-05-01 12:32:49 +02:00
list_size = menu_entries_get_size();
2015-10-17 19:38:33 +02:00
if ((selection >= list_size) && list_size)
{
size_t idx = list_size - 1;
menu_navigation_set_selection(idx);
2017-05-15 07:56:22 +02:00
menu_driver_navigation_set(true);
2015-10-17 19:38:33 +02:00
}
else if (!list_size)
{
bool pending_push = true;
menu_driver_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
2015-10-17 19:38:33 +02:00
}
2016-02-04 21:13:38 +01:00
return true;
2015-10-17 19:38:33 +02:00
}
2019-05-01 12:32:49 +02:00
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void)
{
if (menu_entries_list)
2019-05-13 04:05:11 +02:00
{
const file_list_t *list = menu_list_get(menu_entries_list, 0);
return (menu_file_list_cbs_t*)list->list[list->size - 1].actiondata;
}
2019-05-01 12:32:49 +02:00
return NULL;
}
2015-06-12 16:07:12 +02:00
/* 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;
2019-05-13 04:05:11 +02:00
const file_list_t *list = menu_entries_list ?
menu_list_get(menu_entries_list, 0) : NULL;
menu_file_list_cbs_t *cbs = list
? (menu_file_list_cbs_t*)list->list[list->size - 1].actiondata
2019-05-01 12:32:49 +02:00
: NULL;
if (!cbs)
2015-06-12 16:07:12 +02:00
return -1;
menu_entries_get_last_stack(&path, &label, &menu_type, NULL, NULL);
2015-06-12 16:07:12 +02:00
if (cbs && cbs->action_get_title)
{
int ret;
if (!string_is_empty(cbs->action_title_cache))
{
strlcpy(s, cbs->action_title_cache, len);
return 0;
}
ret = cbs->action_get_title(path, label, menu_type, s, len);
if (ret == 1)
strlcpy(cbs->action_title_cache, s, sizeof(cbs->action_title_cache));
return ret;
}
2015-06-12 16:07:12 +02:00
return 0;
}
/* Sets 's' to the name of the current core
2015-06-12 16:07:12 +02:00
* (shown at the top of the UI). */
2015-08-17 18:14:51 +02:00
int menu_entries_get_core_title(char *s, size_t len)
2015-06-12 16:07:12 +02:00
{
2018-10-30 08:21:32 +01:00
struct retro_system_info *system = runloop_get_libretro_system_info();
2019-05-18 19:16:23 +02:00
const char *core_name = (system && !string_is_empty(system->library_name)) ? system->library_name : msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
const char *core_version = (system && system->library_version) ? system->library_version : "";
#if _MSC_VER == 1200
const char *extra_version = " msvc6";
#elif _MSC_VER == 1300
const char *extra_version = " msvc2002";
#elif _MSC_VER == 1310
const char *extra_version = " msvc2003";
#elif _MSC_VER == 1400
const char *extra_version = " msvc2005";
#elif _MSC_VER == 1500
const char *extra_version = " msvc2008";
#elif _MSC_VER == 1600
const char *extra_version = " msvc2010";
#elif _MSC_VER == 1700
const char *extra_version = " msvc2012";
#elif _MSC_VER == 1800
const char *extra_version = " msvc2013";
#elif _MSC_VER == 1900
const char *extra_version = " msvc2015";
#elif _MSC_VER >= 1910 && _MSC_VER < 2000
const char *extra_version = " msvc2017";
#else
const char *extra_version = "";
#endif
snprintf(s, len, "%s%s - %s %s", PACKAGE_VERSION, extra_version,
2015-06-12 16:07:12 +02:00
core_name, core_version);
2015-08-17 18:14:51 +02:00
return 0;
2015-06-12 16:07:12 +02:00
}
file_list_t *menu_entries_get_menu_stack_ptr(size_t idx)
2015-10-17 17:44:57 +02:00
{
2017-05-27 01:01:58 +02:00
menu_list_t *menu_list = menu_entries_list;
2015-10-17 17:44:57 +02:00
if (!menu_list)
return NULL;
2017-02-26 21:46:19 +01:00
return menu_list_get(menu_list, (unsigned)idx);
2015-10-17 17:44:57 +02:00
}
file_list_t *menu_entries_get_selection_buf_ptr(size_t idx)
2015-10-17 17:44:57 +02:00
{
2017-05-27 01:01:58 +02:00
menu_list_t *menu_list = menu_entries_list;
2015-10-17 17:44:57 +02:00
if (!menu_list)
return NULL;
return menu_list_get_selection(menu_list, (unsigned)idx);
2015-10-17 17:44:57 +02:00
}
2015-12-11 21:41:59 +01:00
static bool menu_entries_init(void)
2015-08-21 21:19:29 +02:00
{
if (!menu_entries_ctl(MENU_ENTRIES_CTL_LIST_INIT, NULL))
2015-09-06 02:56:57 +02:00
goto error;
2015-08-21 21:19:29 +02:00
if (!menu_entries_ctl(MENU_ENTRIES_CTL_SETTINGS_INIT, NULL))
2015-12-11 18:56:00 +01:00
goto error;
2015-08-21 21:19:29 +02:00
return true;
2015-09-06 02:56:57 +02:00
error:
menu_entries_ctl(MENU_ENTRIES_CTL_LIST_DEINIT, NULL);
menu_entries_ctl(MENU_ENTRIES_CTL_SETTINGS_DEINIT, NULL);
2015-09-06 02:56:57 +02:00
return false;
2015-08-21 21:19:29 +02:00
}
void menu_entries_set_checked(file_list_t *list, size_t entry_idx,
bool checked)
{
2019-05-13 04:05:11 +02:00
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)list->list[entry_idx].actiondata;
if (cbs)
cbs->checked = checked;
}
void menu_entries_append(file_list_t *list, const char *path, const char *label,
2015-10-17 17:10:29 +02:00
unsigned type, size_t directory_ptr, size_t entry_idx)
{
2016-02-10 06:38:57 +01:00
menu_ctx_list_t list_info;
2015-10-18 21:41:08 +02:00
size_t idx;
const char *menu_path = NULL;
2015-10-18 21:41:08 +02:00
menu_file_list_cbs_t *cbs = NULL;
if (!list || !label)
return;
file_list_append(list, path, label, type, directory_ptr, entry_idx);
2015-10-18 21:41:08 +02:00
2017-01-08 02:44:40 +01:00
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL);
2016-02-10 06:38:57 +01:00
idx = list->size - 1;
list_info.list = list;
list_info.path = path;
list_info.fullpath = NULL;
if (!string_is_empty(menu_path))
list_info.fullpath = strdup(menu_path);
list_info.label = label;
list_info.idx = idx;
list_info.entry_type = type;
2015-10-18 21:41:08 +02:00
2018-09-26 14:25:28 +02:00
menu_driver_list_insert(&list_info);
2015-10-18 21:41:08 +02:00
if (list_info.fullpath)
free(list_info.fullpath);
2015-10-18 21:41:08 +02:00
file_list_free_actiondata(list, idx);
cbs = (menu_file_list_cbs_t*)
calloc(1, sizeof(menu_file_list_cbs_t));
if (!cbs)
return;
file_list_set_actiondata(list, idx, cbs);
cbs->enum_idx = MSG_UNKNOWN;
cbs->setting = menu_setting_find(label);
2015-10-18 21:41:08 +02:00
menu_cbs_init(list, cbs, path, label, type, idx);
2015-10-17 17:10:29 +02:00
}
bool menu_entries_append_enum(file_list_t *list, const char *path,
const char *label,
enum msg_hash_enums enum_idx,
2016-06-15 01:15:37 +02:00
unsigned type, size_t directory_ptr, size_t entry_idx)
{
menu_ctx_list_t list_info;
size_t idx;
const char *menu_path = NULL;
2016-06-15 01:15:37 +02:00
menu_file_list_cbs_t *cbs = NULL;
if (!list || !label)
return false;
2016-06-15 01:15:37 +02:00
file_list_append(list, path, label, type, directory_ptr, entry_idx);
2017-01-08 02:44:40 +01:00
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL);
2016-06-15 01:15:37 +02:00
idx = list->size - 1;
list_info.fullpath = NULL;
if (!string_is_empty(menu_path))
list_info.fullpath = strdup(menu_path);
list_info.list = list;
list_info.path = path;
list_info.label = label;
list_info.idx = idx;
list_info.entry_type = type;
2016-06-15 01:15:37 +02:00
2018-09-26 14:25:28 +02:00
menu_driver_list_insert(&list_info);
2016-06-15 01:15:37 +02:00
if (list_info.fullpath)
free(list_info.fullpath);
2016-06-15 01:15:37 +02:00
file_list_free_actiondata(list, idx);
cbs = (menu_file_list_cbs_t*)
calloc(1, sizeof(menu_file_list_cbs_t));
file_list_set_actiondata(list, idx, cbs);
2016-06-27 21:34:05 +02:00
cbs->enum_idx = enum_idx;
2017-08-12 20:04:37 -03:00
if ( enum_idx != MENU_ENUM_LABEL_PLAYLIST_ENTRY
&& enum_idx != MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY
&& enum_idx != MENU_ENUM_LABEL_RDB_ENTRY)
2017-08-12 20:04:37 -03:00
cbs->setting = menu_setting_find_enum(enum_idx);
2016-06-15 01:15:37 +02:00
menu_cbs_init(list, cbs, path, label, type, idx);
return true;
2016-06-15 01:15:37 +02:00
}
void menu_entries_prepend(file_list_t *list, const char *path, const char *label,
enum msg_hash_enums enum_idx,
unsigned type, size_t directory_ptr, size_t entry_idx)
{
menu_ctx_list_t list_info;
size_t idx;
2017-01-08 02:33:06 +01:00
const char *menu_path = NULL;
menu_file_list_cbs_t *cbs = NULL;
if (!list || !label)
return;
file_list_prepend(list, path, label, type, directory_ptr, entry_idx);
2017-01-08 02:44:40 +01:00
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL, NULL);
2017-01-08 02:33:06 +01:00
idx = 0;
list_info.fullpath = NULL;
2017-01-08 02:33:06 +01:00
if (!string_is_empty(menu_path))
list_info.fullpath = strdup(menu_path);
list_info.list = list;
list_info.path = path;
list_info.label = label;
list_info.idx = idx;
list_info.entry_type = type;
2018-09-26 14:25:28 +02:00
menu_driver_list_insert(&list_info);
2017-01-08 02:33:06 +01:00
if (list_info.fullpath)
free(list_info.fullpath);
file_list_free_actiondata(list, idx);
cbs = (menu_file_list_cbs_t*)
calloc(1, sizeof(menu_file_list_cbs_t));
if (!cbs)
return;
file_list_set_actiondata(list, idx, cbs);
2016-06-17 14:54:29 +02:00
cbs->enum_idx = enum_idx;
cbs->setting = menu_setting_find_enum(cbs->enum_idx);
menu_cbs_init(list, cbs, path, label, type, 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)
{
2019-05-01 12:44:51 +02:00
file_list_t *list = NULL;
if (!menu_entries_list)
return;
2019-05-01 12:44:51 +02:00
list = menu_list_get(menu_entries_list, 0);
file_list_get_last(list,
path, label, file_type, entry_idx);
2019-05-01 12:32:49 +02:00
2019-05-01 12:44:51 +02:00
if (enum_idx)
{
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
2019-05-13 04:05:11 +02:00
list->list[list->size - 1].actiondata;
2019-05-01 12:32:49 +02:00
2019-05-01 12:44:51 +02:00
if (cbs)
*enum_idx = cbs->enum_idx;
}
}
2015-10-17 18:38:14 +02:00
2015-10-17 19:10:37 +02:00
void menu_entries_flush_stack(const char *needle, unsigned final_type)
{
2017-05-27 01:01:58 +02:00
menu_list_t *menu_list = menu_entries_list;
2015-10-17 19:10:37 +02:00
if (menu_list)
2015-10-27 10:29:50 +01:00
menu_list_flush_stack(menu_list, 0, needle, final_type);
2015-10-17 19:10:37 +02:00
}
2016-04-26 00:19:23 +07:00
void menu_entries_pop_stack(size_t *ptr, size_t idx, bool animate)
2015-10-17 18:38:14 +02:00
{
2017-05-27 01:01:58 +02:00
menu_list_t *menu_list = menu_entries_list;
2015-10-17 18:38:14 +02:00
if (menu_list)
2016-04-26 00:19:23 +07:00
menu_list_pop_stack(menu_list, idx, ptr, animate);
2015-10-17 18:38:14 +02:00
}
2015-10-17 19:14:49 +02:00
2015-10-27 10:29:50 +01:00
size_t menu_entries_get_stack_size(size_t idx)
2015-10-17 19:14:49 +02:00
{
2017-05-27 01:01:58 +02:00
menu_list_t *menu_list = menu_entries_list;
2015-10-17 19:14:49 +02:00
if (!menu_list)
return 0;
2015-10-27 10:29:50 +01:00
return menu_list_get_stack_size(menu_list, idx);
2015-10-17 19:14:49 +02:00
}
2015-10-17 19:21:18 +02:00
size_t menu_entries_get_size(void)
{
2019-05-13 04:05:11 +02:00
const file_list_t *list = NULL;
2017-05-27 01:01:58 +02:00
menu_list_t *menu_list = menu_entries_list;
2015-10-17 19:21:18 +02:00
if (!menu_list)
return 0;
2019-05-13 04:05:11 +02:00
list = menu_list_get_selection(menu_list, 0);
return list->size;
2015-10-17 19:21:18 +02:00
}
2015-12-11 21:32:00 +01:00
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
{
switch (state)
{
2015-12-11 21:37:11 +01:00
case MENU_ENTRIES_CTL_DEINIT:
menu_entries_ctl(MENU_ENTRIES_CTL_SETTINGS_DEINIT, NULL);
menu_entries_ctl(MENU_ENTRIES_CTL_LIST_DEINIT, NULL);
2015-12-11 21:37:11 +01:00
2016-02-26 00:49:23 +01:00
menu_entries_need_refresh = false;
menu_entries_nonblocking_refresh = false;
menu_entries_begin = 0;
2016-02-10 04:15:18 +01:00
break;
2015-12-11 21:41:59 +01:00
case MENU_ENTRIES_CTL_NEEDS_REFRESH:
if (menu_entries_nonblocking_refresh)
2015-12-11 21:41:59 +01:00
return false;
if (!menu_entries_need_refresh)
2015-12-11 21:41:59 +01:00
return false;
2016-02-10 04:15:18 +01:00
break;
2015-12-11 22:05:54 +01:00
case MENU_ENTRIES_CTL_LIST_GET:
{
menu_list_t **list = (menu_list_t**)data;
if (!list)
2015-12-11 22:05:54 +01:00
return false;
*list = menu_entries_list;
2015-12-11 22:05:54 +01:00
}
return true;
case MENU_ENTRIES_CTL_LIST_DEINIT:
if (menu_entries_list)
menu_list_free(menu_entries_list);
menu_entries_list = NULL;
2016-02-10 04:15:18 +01:00
break;
case MENU_ENTRIES_CTL_LIST_INIT:
if (!(menu_entries_list = (menu_list_t*)menu_list_new()))
return false;
2016-02-10 04:15:18 +01:00
break;
2015-12-11 22:30:19 +01:00
case MENU_ENTRIES_CTL_SETTINGS_GET:
{
rarch_setting_t **settings = (rarch_setting_t**)data;
if (!settings)
2015-12-11 22:30:19 +01:00
return false;
*settings = menu_entries_list_settings;
2015-12-11 22:30:19 +01:00
}
2016-02-10 04:15:18 +01:00
break;
case MENU_ENTRIES_CTL_SETTINGS_DEINIT:
2016-06-17 01:07:52 +02:00
menu_setting_free(menu_entries_list_settings);
2018-09-17 10:02:31 +02:00
if (menu_entries_list_settings)
free(menu_entries_list_settings);
menu_entries_list_settings = NULL;
2016-02-10 04:15:18 +01:00
break;
case MENU_ENTRIES_CTL_SETTINGS_INIT:
2016-03-18 22:31:14 +01:00
menu_setting_ctl(MENU_SETTING_CTL_NEW, &menu_entries_list_settings);
if (!menu_entries_list_settings)
return false;
2016-02-10 04:15:18 +01:00
break;
case MENU_ENTRIES_CTL_SET_REFRESH:
{
bool *nonblocking = (bool*)data;
if (*nonblocking)
menu_entries_nonblocking_refresh = true;
else
menu_entries_need_refresh = true;
}
2016-02-10 04:15:18 +01:00
break;
case MENU_ENTRIES_CTL_UNSET_REFRESH:
{
bool *nonblocking = (bool*)data;
if (*nonblocking)
menu_entries_nonblocking_refresh = false;
else
menu_entries_need_refresh = false;
}
2016-02-10 04:15:18 +01:00
break;
case MENU_ENTRIES_CTL_SET_START:
{
size_t *idx = (size_t*)data;
if (idx)
menu_entries_begin = *idx;
}
case MENU_ENTRIES_CTL_START_GET:
{
size_t *idx = (size_t*)data;
if (!idx)
return 0;
*idx = menu_entries_begin;
}
2016-02-10 04:15:18 +01:00
break;
2016-02-04 21:13:38 +01:00
case MENU_ENTRIES_CTL_REFRESH:
if (!data)
return false;
2019-05-01 12:32:49 +02:00
return menu_entries_refresh((file_list_t*)data);
2016-02-24 22:45:21 +01:00
case MENU_ENTRIES_CTL_CLEAR:
2019-05-02 16:21:12 +02:00
{
unsigned i;
file_list_t *list = (file_list_t*)data;
if (!list)
return false;
menu_driver_list_clear(list);
for (i = 0; i < list->size; i++)
file_list_free_actiondata(list, i);
file_list_clear(list);
}
break;
2015-12-11 21:41:59 +01:00
case MENU_ENTRIES_CTL_INIT:
return menu_entries_init();
2015-12-11 21:34:27 +01:00
case MENU_ENTRIES_CTL_SHOW_BACK:
/* Returns true if a Back button should be shown
2015-12-11 21:37:11 +01:00
* (i.e. we are at least
* one level deep in the menu hierarchy). */
2019-05-01 12:32:49 +02:00
if (!menu_entries_list)
return false;
return (menu_list_get_stack_size(menu_entries_list, 0) > 1);
2015-12-11 21:32:00 +01:00
case MENU_ENTRIES_CTL_NONE:
default:
break;
}
2016-02-10 04:15:18 +01:00
return true;
2015-12-11 21:32:00 +01:00
}