mirror of
https://github.com/libretro/RetroArch
synced 2025-04-23 11:43:20 +00:00
Make iterate no longer a function pointer
This commit is contained in:
parent
5839abd44a
commit
acfa43dfe9
@ -418,7 +418,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
|||||||
menu/cbs/menu_cbs_deferred_push.o \
|
menu/cbs/menu_cbs_deferred_push.o \
|
||||||
menu/cbs/menu_cbs_scan.o \
|
menu/cbs/menu_cbs_scan.o \
|
||||||
menu/cbs/menu_cbs_get_value.o \
|
menu/cbs/menu_cbs_get_value.o \
|
||||||
menu/cbs/menu_cbs_iterate.o \
|
menu/menu_iterate.o \
|
||||||
menu/cbs/menu_cbs_title.o \
|
menu/cbs/menu_cbs_title.o \
|
||||||
menu/cbs/menu_cbs_up.o \
|
menu/cbs/menu_cbs_up.o \
|
||||||
menu/cbs/menu_cbs_down.o \
|
menu/cbs/menu_cbs_down.o \
|
||||||
|
@ -767,7 +767,7 @@ MENU
|
|||||||
#include "../menu/cbs/menu_cbs_deferred_push.c"
|
#include "../menu/cbs/menu_cbs_deferred_push.c"
|
||||||
#include "../menu/cbs/menu_cbs_scan.c"
|
#include "../menu/cbs/menu_cbs_scan.c"
|
||||||
#include "../menu/cbs/menu_cbs_get_value.c"
|
#include "../menu/cbs/menu_cbs_get_value.c"
|
||||||
#include "../menu/cbs/menu_cbs_iterate.c"
|
#include "../menu/menu_iterate.c"
|
||||||
#include "../menu/cbs/menu_cbs_up.c"
|
#include "../menu/cbs/menu_cbs_up.c"
|
||||||
#include "../menu/cbs/menu_cbs_down.c"
|
#include "../menu/cbs/menu_cbs_down.c"
|
||||||
#include "../menu/cbs/menu_cbs_contentlist_switch.c"
|
#include "../menu/cbs/menu_cbs_contentlist_switch.c"
|
||||||
|
@ -177,6 +177,9 @@ void *menu_init(const void *data);
|
|||||||
int menu_iterate(retro_input_t input,
|
int menu_iterate(retro_input_t input,
|
||||||
retro_input_t old_input, retro_input_t trigger_input);
|
retro_input_t old_input, retro_input_t trigger_input);
|
||||||
|
|
||||||
|
int menu_iterate_main(const char *label,
|
||||||
|
unsigned action);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* menu_free:
|
* menu_free:
|
||||||
* @menu : Menu handle.
|
* @menu : Menu handle.
|
||||||
|
@ -149,10 +149,6 @@ void menu_cbs_init(void *data,
|
|||||||
|
|
||||||
menu_cbs_init_log(ret, "REFRESH", label, elem0, elem1, type);
|
menu_cbs_init_log(ret, "REFRESH", label, elem0, elem1, type);
|
||||||
|
|
||||||
ret = menu_cbs_init_bind_iterate(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
|
||||||
|
|
||||||
menu_cbs_init_log(ret, "ITERATE", label, elem0, elem1, type);
|
|
||||||
|
|
||||||
ret = menu_cbs_init_bind_get_string_representation(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
ret = menu_cbs_init_bind_get_string_representation(cbs, path, label, type, idx, elem0, elem1, label_hash, menu_label_hash);
|
||||||
|
|
||||||
menu_cbs_init_log(ret, "REPRESENTATION", label, elem0, elem1, type);
|
menu_cbs_init_log(ret, "REPRESENTATION", label, elem0, elem1, type);
|
||||||
|
@ -107,11 +107,6 @@ int menu_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
|||||||
const char *elem0, const char *elem1, const char *menu_label,
|
const char *elem0, const char *elem1, const char *menu_label,
|
||||||
uint32_t label_hash, uint32_t menu_label_hash);
|
uint32_t label_hash, uint32_t menu_label_hash);
|
||||||
|
|
||||||
int menu_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
|
|
||||||
const char *path, const char *label, unsigned type, size_t idx,
|
|
||||||
const char *elem0, const char *elem1,
|
|
||||||
uint32_t label_hash, uint32_t menu_label_hash);
|
|
||||||
|
|
||||||
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
int menu_cbs_init_bind_deferred_push(menu_file_list_cbs_t *cbs,
|
||||||
const char *path, const char *label, unsigned type, size_t idx,
|
const char *path, const char *label, unsigned type, size_t idx,
|
||||||
const char *elem0, const char *elem1,
|
const char *elem0, const char *elem1,
|
||||||
|
@ -393,14 +393,9 @@ int menu_entry_iterate(unsigned action)
|
|||||||
if (action != MENU_ACTION_NOOP || menu_entries_needs_refresh() || menu_display_update_pending())
|
if (action != MENU_ACTION_NOOP || menu_entries_needs_refresh() || menu_display_update_pending())
|
||||||
menu_display_fb_set_dirty();
|
menu_display_fb_set_dirty();
|
||||||
|
|
||||||
cbs = (menu_file_list_cbs_t*)menu_list_get_last_stack_actiondata(menu_list);
|
|
||||||
|
|
||||||
menu_list_get_last_stack(menu_list, NULL, &label, NULL, NULL);
|
menu_list_get_last_stack(menu_list, NULL, &label, NULL, NULL);
|
||||||
|
|
||||||
if (cbs && cbs->action_iterate)
|
return menu_iterate_main(label, action);
|
||||||
return cbs->action_iterate(label, action);
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
||||||
|
@ -17,21 +17,21 @@
|
|||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <retro_inline.h>
|
#include <retro_inline.h>
|
||||||
|
|
||||||
#include "../menu.h"
|
#include "menu.h"
|
||||||
#include "../menu_cbs.h"
|
#include "menu_cbs.h"
|
||||||
#include "../menu_display.h"
|
#include "menu_display.h"
|
||||||
#include "../menu_hash.h"
|
#include "menu_hash.h"
|
||||||
#include "../menu_entry.h"
|
#include "menu_entry.h"
|
||||||
#include "../menu_setting.h"
|
#include "menu_setting.h"
|
||||||
#include "../menu_input.h"
|
#include "menu_input.h"
|
||||||
#include "../menu_shader.h"
|
#include "menu_shader.h"
|
||||||
#include "../menu_navigation.h"
|
#include "menu_navigation.h"
|
||||||
|
|
||||||
#include "../../general.h"
|
#include "../general.h"
|
||||||
#include "../../performance.h"
|
#include "../performance.h"
|
||||||
#include "../../retroarch.h"
|
#include "../retroarch.h"
|
||||||
#include "../../input/input_common.h"
|
#include "../input/input_common.h"
|
||||||
#include "../../input/input_autodetect.h"
|
#include "../input/input_autodetect.h"
|
||||||
|
|
||||||
static int action_iterate_help(char *s, size_t len, const char *label)
|
static int action_iterate_help(char *s, size_t len, const char *label)
|
||||||
{
|
{
|
||||||
@ -412,7 +412,7 @@ static enum action_iterate_type action_iterate_type(uint32_t hash)
|
|||||||
return ITERATE_TYPE_DEFAULT;
|
return ITERATE_TYPE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_iterate_main(const char *label, unsigned action)
|
int menu_iterate_main(const char *label, unsigned action)
|
||||||
{
|
{
|
||||||
menu_entry_t entry;
|
menu_entry_t entry;
|
||||||
char msg[PATH_MAX_LENGTH] = {0};
|
char msg[PATH_MAX_LENGTH] = {0};
|
||||||
@ -521,16 +521,3 @@ static int action_iterate_main(const char *label, unsigned action)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu_cbs_init_bind_iterate(menu_file_list_cbs_t *cbs,
|
|
||||||
const char *path, const char *label, unsigned type, size_t idx,
|
|
||||||
const char *elem0, const char *elem1,
|
|
||||||
uint32_t label_hash, uint32_t menu_label_hash)
|
|
||||||
{
|
|
||||||
if (!cbs)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
cbs->action_iterate = action_iterate_main;
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
@ -1458,7 +1458,6 @@ static rarch_setting_t setting_action_setting(const char* name,
|
|||||||
result.read_handler = NULL;
|
result.read_handler = NULL;
|
||||||
result.get_string_representation = &setting_get_string_representation_default;
|
result.get_string_representation = &setting_get_string_representation_default;
|
||||||
result.action_start = NULL;
|
result.action_start = NULL;
|
||||||
result.action_iterate = NULL;
|
|
||||||
result.action_left = NULL;
|
result.action_left = NULL;
|
||||||
result.action_right = NULL;
|
result.action_right = NULL;
|
||||||
result.action_ok = setting_action_action_ok;
|
result.action_ok = setting_action_action_ok;
|
||||||
|
@ -106,7 +106,6 @@ typedef int (*action_right_handler_t )(void *data, bool wraparound);
|
|||||||
typedef int (*action_up_handler_t )(void *data);
|
typedef int (*action_up_handler_t )(void *data);
|
||||||
typedef int (*action_down_handler_t )(void *data);
|
typedef int (*action_down_handler_t )(void *data);
|
||||||
typedef int (*action_start_handler_t )(void *data);
|
typedef int (*action_start_handler_t )(void *data);
|
||||||
typedef int (*action_iterate_handler_t )(unsigned action);
|
|
||||||
typedef int (*action_cancel_handler_t )(void *data);
|
typedef int (*action_cancel_handler_t )(void *data);
|
||||||
typedef int (*action_ok_handler_t )(void *data, bool wraparound);
|
typedef int (*action_ok_handler_t )(void *data, bool wraparound);
|
||||||
typedef int (*action_select_handler_t )(void *data, bool wraparound);
|
typedef int (*action_select_handler_t )(void *data, bool wraparound);
|
||||||
@ -148,7 +147,6 @@ typedef struct rarch_setting
|
|||||||
change_handler_t change_handler;
|
change_handler_t change_handler;
|
||||||
change_handler_t read_handler;
|
change_handler_t read_handler;
|
||||||
action_start_handler_t action_start;
|
action_start_handler_t action_start;
|
||||||
action_iterate_handler_t action_iterate;
|
|
||||||
action_left_handler_t action_left;
|
action_left_handler_t action_left;
|
||||||
action_right_handler_t action_right;
|
action_right_handler_t action_right;
|
||||||
action_up_handler_t action_up;
|
action_up_handler_t action_up;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user