mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
menu_list_get_actiondata_at_offset - modify signature
This commit is contained in:
parent
9f8f176141
commit
d11e36cfb9
@ -227,31 +227,6 @@ typedef struct
|
|||||||
|
|
||||||
} menu_handle_t;
|
} menu_handle_t;
|
||||||
|
|
||||||
typedef struct menu_file_list_cbs
|
|
||||||
{
|
|
||||||
int (*action_iterate)(const char *label, unsigned action);
|
|
||||||
int (*action_deferred_push)(menu_displaylist_info_t *info);
|
|
||||||
int (*action_ok)(const char *path, const char *label, unsigned type,
|
|
||||||
size_t idx);
|
|
||||||
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
|
||||||
size_t idx);
|
|
||||||
int (*action_start)(unsigned type, const char *label, unsigned action);
|
|
||||||
int (*action_select)(unsigned type, const char *label, unsigned action);
|
|
||||||
int (*action_content_list_switch)(void *data, void *userdata, const char
|
|
||||||
*path, const char *label, unsigned type);
|
|
||||||
int (*action_toggle)(unsigned type, const char *label, unsigned action,
|
|
||||||
bool wraparound);
|
|
||||||
int (*action_refresh)(file_list_t *list, file_list_t *menu_list);
|
|
||||||
int (*action_up_or_down)(unsigned type, const char *label, unsigned action);
|
|
||||||
void (*action_get_representation)(file_list_t* list,
|
|
||||||
unsigned *w, unsigned type, unsigned i,
|
|
||||||
const char *label,
|
|
||||||
char *type_str, size_t type_str_size,
|
|
||||||
const char *entry_label,
|
|
||||||
const char *path,
|
|
||||||
char *path_buf, size_t path_buf_size);
|
|
||||||
} menu_file_list_cbs_t;
|
|
||||||
|
|
||||||
typedef struct menu_ctx_driver
|
typedef struct menu_ctx_driver
|
||||||
{
|
{
|
||||||
void (*set_texture)(void);
|
void (*set_texture)(void);
|
||||||
|
@ -214,9 +214,8 @@ static int action_toggle_mainmenu(unsigned type, const char *label,
|
|||||||
else
|
else
|
||||||
push_list = 2;
|
push_list = 2;
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)
|
cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf,
|
||||||
menu_list_get_actiondata_at_offset(menu_list->selection_buf,
|
menu->navigation.selection_ptr);
|
||||||
menu->navigation.selection_ptr);
|
|
||||||
|
|
||||||
switch (push_list)
|
switch (push_list)
|
||||||
{
|
{
|
||||||
|
@ -342,7 +342,7 @@ void menu_entry_get(menu_entry_t *entry, size_t i,
|
|||||||
|
|
||||||
menu_list_get_at_offset(list, i, &path, &entry_label, &entry->type);
|
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);
|
cbs = menu_list_get_actiondata_at_offset(list, i);
|
||||||
|
|
||||||
if (cbs && cbs->action_get_representation && use_representation)
|
if (cbs && cbs->action_get_representation && use_representation)
|
||||||
cbs->action_get_representation(list,
|
cbs->action_get_representation(list,
|
||||||
@ -402,8 +402,7 @@ int menu_entry_select(uint32_t i)
|
|||||||
|
|
||||||
menu_entry_get(&entry, i, NULL, false);
|
menu_entry_get(&entry, i, NULL, false);
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)
|
cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, i);
|
||||||
menu_list_get_actiondata_at_offset(menu_list->selection_buf, i);
|
|
||||||
|
|
||||||
if (setting_is_of_path_type(setting))
|
if (setting_is_of_path_type(setting))
|
||||||
return 0;
|
return 0;
|
||||||
@ -455,7 +454,7 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
|||||||
menu_navigation_t *nav = menu_navigation_get_ptr();
|
menu_navigation_t *nav = menu_navigation_get_ptr();
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
menu_list_t *menu_list = menu_list_get_ptr();
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)menu_list_get_actiondata_at_offset(menu_list->selection_buf, i);
|
menu_file_list_cbs_t *cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, i);
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
@ -938,8 +938,8 @@ void menu_input_post_iterate(int *ret, unsigned action)
|
|||||||
menu_list_t *menu_list = menu_list_get_ptr();
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
size_t selected = menu_navigation_get_current_selection();
|
size_t selected = menu_navigation_get_current_selection();
|
||||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
menu_file_list_cbs_t *cbs = menu_list_get_actiondata_at_offset
|
||||||
menu_list_get_actiondata_at_offset(menu_list->selection_buf, selected);
|
(menu_list->selection_buf, selected);
|
||||||
|
|
||||||
menu_entry_get(&entry, selected, NULL, false);
|
menu_entry_get(&entry, selected, NULL, false);
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ void menu_list_get_last_stack(const menu_list_t *list,
|
|||||||
file_list_get_last(list->menu_stack, path, label, file_type);
|
file_list_get_last(list->menu_stack, path, label, file_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx)
|
menu_file_list_cbs_t *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx)
|
||||||
{
|
{
|
||||||
if (!list)
|
if (!list)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -32,6 +32,31 @@ typedef struct menu_list
|
|||||||
file_list_t *selection_buf;
|
file_list_t *selection_buf;
|
||||||
} menu_list_t;
|
} menu_list_t;
|
||||||
|
|
||||||
|
typedef struct menu_file_list_cbs
|
||||||
|
{
|
||||||
|
int (*action_iterate)(const char *label, unsigned action);
|
||||||
|
int (*action_deferred_push)(menu_displaylist_info_t *info);
|
||||||
|
int (*action_ok)(const char *path, const char *label, unsigned type,
|
||||||
|
size_t idx);
|
||||||
|
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
||||||
|
size_t idx);
|
||||||
|
int (*action_start)(unsigned type, const char *label, unsigned action);
|
||||||
|
int (*action_select)(unsigned type, const char *label, unsigned action);
|
||||||
|
int (*action_content_list_switch)(void *data, void *userdata, const char
|
||||||
|
*path, const char *label, unsigned type);
|
||||||
|
int (*action_toggle)(unsigned type, const char *label, unsigned action,
|
||||||
|
bool wraparound);
|
||||||
|
int (*action_refresh)(file_list_t *list, file_list_t *menu_list);
|
||||||
|
int (*action_up_or_down)(unsigned type, const char *label, unsigned action);
|
||||||
|
void (*action_get_representation)(file_list_t* list,
|
||||||
|
unsigned *w, unsigned type, unsigned i,
|
||||||
|
const char *label,
|
||||||
|
char *type_str, size_t type_str_size,
|
||||||
|
const char *entry_label,
|
||||||
|
const char *path,
|
||||||
|
char *path_buf, size_t path_buf_size);
|
||||||
|
} menu_file_list_cbs_t;
|
||||||
|
|
||||||
menu_list_t *menu_list_get_ptr(void);
|
menu_list_t *menu_list_get_ptr(void);
|
||||||
|
|
||||||
void menu_list_free(menu_list_t *menu_list);
|
void menu_list_free(menu_list_t *menu_list);
|
||||||
@ -54,7 +79,7 @@ void menu_list_pop_stack_by_needle(menu_list_t *list,
|
|||||||
void menu_list_get_at_offset(const file_list_t *list, size_t idx,
|
void menu_list_get_at_offset(const file_list_t *list, size_t idx,
|
||||||
const char **path, const char **label, unsigned *file_type);
|
const char **path, const char **label, unsigned *file_type);
|
||||||
|
|
||||||
void *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx);
|
menu_file_list_cbs_t *menu_list_get_actiondata_at_offset(const file_list_t *list, size_t idx);
|
||||||
|
|
||||||
size_t menu_list_get_stack_size(menu_list_t *list);
|
size_t menu_list_get_stack_size(menu_list_t *list);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user