Create menu_list_get_entry
This commit is contained in:
parent
a13442625b
commit
7004451e54
|
@ -214,32 +214,10 @@ bool menu_display_setting_label(
|
||||||
const char *label,
|
const char *label,
|
||||||
void *userdata)
|
void *userdata)
|
||||||
{
|
{
|
||||||
menu_file_list_cbs_t *cbs = NULL;
|
|
||||||
const char *entry_label = NULL;
|
|
||||||
const char *path = NULL;
|
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
|
||||||
file_list_t *list = userdata ? (file_list_t*)userdata
|
|
||||||
: menu->menu_list->selection_buf;
|
|
||||||
|
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
menu_list_get_at_offset(list, i, &path, &entry_label, &entry->type);
|
menu_list_get_entry(entry, i, label, userdata);
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)
|
|
||||||
menu_list_get_actiondata_at_offset(list,
|
|
||||||
i);
|
|
||||||
|
|
||||||
if (cbs && cbs->action_get_representation)
|
|
||||||
cbs->action_get_representation(list,
|
|
||||||
&entry->spacing, entry->type, i, label,
|
|
||||||
entry->value, sizeof(entry->value),
|
|
||||||
entry_label, path,
|
|
||||||
entry->path, sizeof(entry->path));
|
|
||||||
|
|
||||||
if (entry_label)
|
|
||||||
strlcpy(entry->label, entry_label, sizeof(entry->label));
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
RARCH_LOG("Entry label : %s\n", entry->label ? entry->label : "N/A");
|
RARCH_LOG("Entry label : %s\n", entry->label ? entry->label : "N/A");
|
||||||
RARCH_LOG("Entry path : %s\n", entry->path);
|
RARCH_LOG("Entry path : %s\n", entry->path);
|
||||||
|
|
|
@ -443,3 +443,29 @@ int menu_list_populate_generic(file_list_t *list, const char *path,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_list_get_entry(menu_entry_t *entry, size_t i,
|
||||||
|
const char *label, void *userdata)
|
||||||
|
{
|
||||||
|
const char *path = NULL;
|
||||||
|
const char *entry_label = NULL;
|
||||||
|
menu_file_list_cbs_t *cbs = NULL;
|
||||||
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
file_list_t *list = userdata ? (file_list_t*)userdata
|
||||||
|
: menu->menu_list->selection_buf;
|
||||||
|
menu_list_get_at_offset(list, i, &path, &entry_label, &entry->type);
|
||||||
|
|
||||||
|
cbs = (menu_file_list_cbs_t*)
|
||||||
|
menu_list_get_actiondata_at_offset(list,
|
||||||
|
i);
|
||||||
|
|
||||||
|
if (cbs && cbs->action_get_representation)
|
||||||
|
cbs->action_get_representation(list,
|
||||||
|
&entry->spacing, entry->type, i, label,
|
||||||
|
entry->value, sizeof(entry->value),
|
||||||
|
entry_label, path,
|
||||||
|
entry->path, sizeof(entry->path));
|
||||||
|
|
||||||
|
if (entry_label)
|
||||||
|
strlcpy(entry->label, entry_label, sizeof(entry->label));
|
||||||
|
}
|
||||||
|
|
|
@ -105,6 +105,9 @@ void menu_list_set_alt_at_offset(file_list_t *list, size_t idx,
|
||||||
int menu_list_populate_generic(file_list_t *list,
|
int menu_list_populate_generic(file_list_t *list,
|
||||||
const char *path, const char *label, unsigned type);
|
const char *path, const char *label, unsigned type);
|
||||||
|
|
||||||
|
void menu_list_get_entry(menu_entry_t *entry, size_t i, const char *label,
|
||||||
|
void *userdata);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue