Create menu_entries_get_last_stack_actiondata
This commit is contained in:
parent
5d036f70d1
commit
5663f6d60f
|
@ -646,7 +646,7 @@ static int generic_action_ok(const char *path,
|
||||||
flush_char = NULL;
|
flush_char = NULL;
|
||||||
flush_type = 49;
|
flush_type = 49;
|
||||||
{
|
{
|
||||||
menu_file_list_cbs_t *cbs = menu_list_get_last_stack_actiondata(menu_list);
|
menu_file_list_cbs_t *cbs = menu_entries_get_last_stack_actiondata();
|
||||||
|
|
||||||
if (cbs)
|
if (cbs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2875,7 +2875,6 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
|
||||||
uint32_t hash_label = 0;
|
uint32_t hash_label = 0;
|
||||||
unsigned type = 0;
|
unsigned type = 0;
|
||||||
menu_displaylist_info_t info = {0};
|
menu_displaylist_info_t info = {0};
|
||||||
menu_list_t *_menu_list = menu_list_get_ptr();
|
|
||||||
|
|
||||||
menu_entries_get_last_stack(&path, &label, &type, NULL);
|
menu_entries_get_last_stack(&path, &label, &type, NULL);
|
||||||
|
|
||||||
|
@ -2899,10 +2898,9 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
|
||||||
return menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL);
|
return menu_displaylist_push_list(&info, DISPLAYLIST_HORIZONTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)
|
cbs = menu_entries_get_last_stack_actiondata();
|
||||||
menu_list_get_last_stack_actiondata(_menu_list);
|
|
||||||
|
|
||||||
if (cbs->action_deferred_push)
|
if (cbs && cbs->action_deferred_push)
|
||||||
return cbs->action_deferred_push(&info);
|
return cbs->action_deferred_push(&info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -122,14 +122,11 @@ int menu_entries_get_title(char *s, size_t len)
|
||||||
unsigned menu_type = 0;
|
unsigned menu_type = 0;
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
const char *label = NULL;
|
const char *label = NULL;
|
||||||
menu_file_list_cbs_t *cbs = NULL;
|
menu_file_list_cbs_t *cbs = menu_entries_get_last_stack_actiondata();
|
||||||
menu_list_t *menu_list = menu_list_get_ptr();
|
|
||||||
|
|
||||||
if (!menu_list)
|
if (!cbs)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);
|
|
||||||
|
|
||||||
menu_entries_get_last_stack(&path, &label, &menu_type, NULL);
|
menu_entries_get_last_stack(&path, &label, &menu_type, NULL);
|
||||||
|
|
||||||
if (cbs && cbs->action_get_title)
|
if (cbs && cbs->action_get_title)
|
||||||
|
@ -295,6 +292,14 @@ void menu_entries_push(file_list_t *list, const char *path, const char *label,
|
||||||
menu_list_push(list, path, label, type, directory_ptr, entry_idx);
|
menu_list_push(list, path, label, type, directory_ptr, entry_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void)
|
||||||
|
{
|
||||||
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
if (!menu_list)
|
||||||
|
return NULL;
|
||||||
|
return (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);
|
||||||
|
}
|
||||||
|
|
||||||
void menu_entries_get_last_stack(const char **path, const char **label,
|
void menu_entries_get_last_stack(const char **path, const char **label,
|
||||||
unsigned *file_type, size_t *entry_idx)
|
unsigned *file_type, size_t *entry_idx)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,6 +28,71 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct menu_file_list_cbs
|
||||||
|
{
|
||||||
|
rarch_setting_t *setting;
|
||||||
|
|
||||||
|
int (*action_iterate)(const char *label, unsigned action);
|
||||||
|
const char *action_iterate_ident;
|
||||||
|
|
||||||
|
int (*action_deferred_push)(menu_displaylist_info_t *info);
|
||||||
|
const char *action_deferred_push_ident;
|
||||||
|
|
||||||
|
int (*action_select)(const char *path, const char *label, unsigned type,
|
||||||
|
size_t idx);
|
||||||
|
const char *action_select_ident;
|
||||||
|
|
||||||
|
int (*action_get_title)(const char *path, const char *label,
|
||||||
|
unsigned type, char *s, size_t len);
|
||||||
|
const char *action_get_title_ident;
|
||||||
|
|
||||||
|
int (*action_ok)(const char *path, const char *label, unsigned type,
|
||||||
|
size_t idx, size_t entry_idx);
|
||||||
|
const char *action_ok_ident;
|
||||||
|
|
||||||
|
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
||||||
|
size_t idx);
|
||||||
|
const char *action_cancel_ident;
|
||||||
|
|
||||||
|
int (*action_scan)(const char *path, const char *label, unsigned type,
|
||||||
|
size_t idx);
|
||||||
|
const char *action_scan_ident;
|
||||||
|
|
||||||
|
int (*action_start)(unsigned type, const char *label);
|
||||||
|
const char *action_start_ident;
|
||||||
|
|
||||||
|
int (*action_info)(unsigned type, const char *label);
|
||||||
|
const char *action_info_ident;
|
||||||
|
|
||||||
|
int (*action_content_list_switch)(void *data, void *userdata, const char
|
||||||
|
*path, const char *label, unsigned type);
|
||||||
|
const char *action_content_list_switch_ident;
|
||||||
|
|
||||||
|
int (*action_left)(unsigned type, const char *label, bool wraparound);
|
||||||
|
const char *action_left_ident;
|
||||||
|
|
||||||
|
int (*action_right)(unsigned type, const char *label, bool wraparound);
|
||||||
|
const char *action_right_ident;
|
||||||
|
|
||||||
|
int (*action_refresh)(file_list_t *list, file_list_t *menu_list);
|
||||||
|
const char *action_refresh_ident;
|
||||||
|
|
||||||
|
int (*action_up)(unsigned type, const char *label);
|
||||||
|
const char *action_up_ident;
|
||||||
|
|
||||||
|
int (*action_down)(unsigned type, const char *label);
|
||||||
|
const char *action_down_ident;
|
||||||
|
|
||||||
|
void (*action_get_value)(file_list_t* list,
|
||||||
|
unsigned *w, unsigned type, unsigned i,
|
||||||
|
const char *label, char *s, size_t len,
|
||||||
|
const char *entry_label,
|
||||||
|
const char *path,
|
||||||
|
char *path_buf, size_t path_buf_size);
|
||||||
|
const char *action_get_value_ident;
|
||||||
|
|
||||||
|
} menu_file_list_cbs_t;
|
||||||
|
|
||||||
typedef struct menu_entries menu_entries_t;
|
typedef struct menu_entries menu_entries_t;
|
||||||
|
|
||||||
void menu_entries_set_start(size_t i);
|
void menu_entries_set_start(size_t i);
|
||||||
|
@ -70,6 +135,8 @@ void menu_entries_new_list(menu_entries_t *entries, unsigned flags);
|
||||||
void menu_entries_get_last_stack(const char **path, const char **label,
|
void menu_entries_get_last_stack(const char **path, const char **label,
|
||||||
unsigned *file_type, size_t *entry_idx);
|
unsigned *file_type, size_t *entry_idx);
|
||||||
|
|
||||||
|
menu_file_list_cbs_t *menu_entries_get_last_stack_actiondata(void);
|
||||||
|
|
||||||
void menu_entries_pop_stack(size_t *ptr);
|
void menu_entries_pop_stack(size_t *ptr);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -220,14 +220,11 @@ void menu_entry_pathdir_get_value(uint32_t i, char *s, size_t len)
|
||||||
|
|
||||||
int menu_entry_pathdir_set_value(uint32_t i, const char *s)
|
int menu_entry_pathdir_set_value(uint32_t i, const char *s)
|
||||||
{
|
{
|
||||||
menu_file_list_cbs_t *cbs = NULL;
|
|
||||||
const char *menu_path = NULL;
|
const char *menu_path = NULL;
|
||||||
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_entries_get_last_stack_actiondata();
|
||||||
(void)s;
|
|
||||||
|
|
||||||
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL);
|
menu_entries_get_last_stack(&menu_path, NULL, NULL, NULL);
|
||||||
cbs = (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);
|
|
||||||
|
|
||||||
if (!cbs || !cbs->setting)
|
if (!cbs || !cbs->setting)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <file/file_list.h>
|
#include <file/file_list.h>
|
||||||
|
|
||||||
|
#include "menu_entries.h"
|
||||||
#include "menu_setting.h"
|
#include "menu_setting.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -37,70 +39,6 @@ typedef enum
|
||||||
MENU_LIST_HORIZONTAL
|
MENU_LIST_HORIZONTAL
|
||||||
} menu_list_type_t;
|
} menu_list_type_t;
|
||||||
|
|
||||||
typedef struct menu_file_list_cbs
|
|
||||||
{
|
|
||||||
rarch_setting_t *setting;
|
|
||||||
|
|
||||||
int (*action_iterate)(const char *label, unsigned action);
|
|
||||||
const char *action_iterate_ident;
|
|
||||||
|
|
||||||
int (*action_deferred_push)(menu_displaylist_info_t *info);
|
|
||||||
const char *action_deferred_push_ident;
|
|
||||||
|
|
||||||
int (*action_select)(const char *path, const char *label, unsigned type,
|
|
||||||
size_t idx);
|
|
||||||
const char *action_select_ident;
|
|
||||||
|
|
||||||
int (*action_get_title)(const char *path, const char *label,
|
|
||||||
unsigned type, char *s, size_t len);
|
|
||||||
const char *action_get_title_ident;
|
|
||||||
|
|
||||||
int (*action_ok)(const char *path, const char *label, unsigned type,
|
|
||||||
size_t idx, size_t entry_idx);
|
|
||||||
const char *action_ok_ident;
|
|
||||||
|
|
||||||
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
|
||||||
size_t idx);
|
|
||||||
const char *action_cancel_ident;
|
|
||||||
|
|
||||||
int (*action_scan)(const char *path, const char *label, unsigned type,
|
|
||||||
size_t idx);
|
|
||||||
const char *action_scan_ident;
|
|
||||||
|
|
||||||
int (*action_start)(unsigned type, const char *label);
|
|
||||||
const char *action_start_ident;
|
|
||||||
|
|
||||||
int (*action_info)(unsigned type, const char *label);
|
|
||||||
const char *action_info_ident;
|
|
||||||
|
|
||||||
int (*action_content_list_switch)(void *data, void *userdata, const char
|
|
||||||
*path, const char *label, unsigned type);
|
|
||||||
const char *action_content_list_switch_ident;
|
|
||||||
|
|
||||||
int (*action_left)(unsigned type, const char *label, bool wraparound);
|
|
||||||
const char *action_left_ident;
|
|
||||||
|
|
||||||
int (*action_right)(unsigned type, const char *label, bool wraparound);
|
|
||||||
const char *action_right_ident;
|
|
||||||
|
|
||||||
int (*action_refresh)(file_list_t *list, file_list_t *menu_list);
|
|
||||||
const char *action_refresh_ident;
|
|
||||||
|
|
||||||
int (*action_up)(unsigned type, const char *label);
|
|
||||||
const char *action_up_ident;
|
|
||||||
|
|
||||||
int (*action_down)(unsigned type, const char *label);
|
|
||||||
const char *action_down_ident;
|
|
||||||
|
|
||||||
void (*action_get_value)(file_list_t* list,
|
|
||||||
unsigned *w, unsigned type, unsigned i,
|
|
||||||
const char *label, char *s, size_t len,
|
|
||||||
const char *entry_label,
|
|
||||||
const char *path,
|
|
||||||
char *path_buf, size_t path_buf_size);
|
|
||||||
const char *action_get_value_ident;
|
|
||||||
|
|
||||||
} menu_file_list_cbs_t;
|
|
||||||
|
|
||||||
menu_list_t *menu_list_get_ptr(void);
|
menu_list_t *menu_list_get_ptr(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue