mirror of
https://github.com/libretro/RetroArch
synced 2024-12-28 09:29:16 +00:00
Compiles without HAVE_MENU defined again
This commit is contained in:
parent
dc0666555f
commit
8e4683fa10
@ -1876,6 +1876,7 @@ static void frontend_linux_init(void *data)
|
||||
|
||||
static int frontend_linux_parse_drive_list(void *data)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
file_list_t *list = (file_list_t*)data;
|
||||
|
||||
#ifdef ANDROID
|
||||
@ -1896,6 +1897,7 @@ static int frontend_linux_parse_drive_list(void *data)
|
||||
|
||||
menu_entries_append_enum(list, "/", "",
|
||||
MSG_UNKNOWN, FILE_TYPE_DIRECTORY, 0, 0);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1374,46 +1374,6 @@ static void menu_input_st_string_cb(void *userdata, const char *str)
|
||||
menu_input_key_end_line();
|
||||
}
|
||||
|
||||
static int setting_generic_action_ok_linefeed(void *data, bool wraparound)
|
||||
{
|
||||
menu_input_ctx_line_t line;
|
||||
input_keyboard_line_complete_t cb = NULL;
|
||||
rarch_setting_t *setting = (rarch_setting_t*)data;
|
||||
const char *short_description = menu_setting_get_short_description(setting);
|
||||
|
||||
if (!setting)
|
||||
return -1;
|
||||
|
||||
(void)wraparound;
|
||||
|
||||
switch (setting_get_type(setting))
|
||||
{
|
||||
case ST_UINT:
|
||||
cb = menu_input_st_uint_cb;
|
||||
break;
|
||||
case ST_HEX:
|
||||
cb = menu_input_st_hex_cb;
|
||||
break;
|
||||
case ST_STRING:
|
||||
case ST_STRING_OPTIONS:
|
||||
cb = menu_input_st_string_cb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
line.label = short_description;
|
||||
line.label_setting = setting->name;
|
||||
line.type = 0;
|
||||
line.idx = 0;
|
||||
line.cb = cb;
|
||||
|
||||
if (!menu_input_ctl(MENU_INPUT_CTL_START_LINE, &line))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void get_string_representation_bind_device(void * data, char *s,
|
||||
size_t len)
|
||||
{
|
||||
@ -1743,53 +1703,6 @@ void general_write_handler(void *data)
|
||||
command_event(rarch_cmd, NULL);
|
||||
}
|
||||
|
||||
static void setting_add_special_callbacks(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values)
|
||||
{
|
||||
unsigned idx = list_info->index - 1;
|
||||
|
||||
if (values & SD_FLAG_ALLOW_INPUT)
|
||||
{
|
||||
(*list)[idx].action_ok = setting_generic_action_ok_linefeed;
|
||||
(*list)[idx].action_select = setting_generic_action_ok_linefeed;
|
||||
|
||||
switch ((*list)[idx].type)
|
||||
{
|
||||
case ST_UINT:
|
||||
(*list)[idx].action_cancel = NULL;
|
||||
break;
|
||||
case ST_HEX:
|
||||
(*list)[idx].action_cancel = NULL;
|
||||
break;
|
||||
case ST_STRING:
|
||||
(*list)[idx].action_start = setting_string_action_start_generic;
|
||||
(*list)[idx].action_cancel = NULL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void settings_data_list_current_add_flags(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values)
|
||||
{
|
||||
(*list)[list_info->index - 1].flags |= values;
|
||||
setting_add_special_callbacks(list, list_info, values);
|
||||
}
|
||||
|
||||
void settings_data_list_current_add_free_flags(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values)
|
||||
{
|
||||
(*list)[list_info->index - 1].free_flags |= values;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
static void overlay_enable_toggle_change_handler(void *data)
|
||||
{
|
||||
|
112
setting_list.c
112
setting_list.c
@ -166,9 +166,11 @@ static int setting_int_action_right_default(void *data, bool wraparound)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (settings && settings->menu.navigation.wraparound.enable)
|
||||
*setting->value.target.integer = min;
|
||||
else
|
||||
#endif
|
||||
*setting->value.target.integer = max;
|
||||
}
|
||||
}
|
||||
@ -176,6 +178,7 @@ static int setting_int_action_right_default(void *data, bool wraparound)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
static int setting_bind_action_start(void *data)
|
||||
{
|
||||
unsigned bind_type;
|
||||
@ -201,6 +204,7 @@ static int setting_bind_action_start(void *data)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void setting_get_string_representation_hex(void *data,
|
||||
char *s, size_t len)
|
||||
@ -264,9 +268,11 @@ static int setting_uint_action_right_default(void *data, bool wraparound)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (settings && settings->menu.navigation.wraparound.enable)
|
||||
*setting->value.target.unsigned_integer = min;
|
||||
else
|
||||
#endif
|
||||
*setting->value.target.unsigned_integer = max;
|
||||
}
|
||||
}
|
||||
@ -344,9 +350,11 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (settings && settings->menu.navigation.wraparound.enable)
|
||||
*setting->value.target.integer = min;
|
||||
else
|
||||
#endif
|
||||
*setting->value.target.integer = max;
|
||||
}
|
||||
}
|
||||
@ -362,9 +370,11 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (settings && settings->menu.navigation.wraparound.enable)
|
||||
*setting->value.target.unsigned_integer = min;
|
||||
else
|
||||
#endif
|
||||
*setting->value.target.unsigned_integer = max;
|
||||
}
|
||||
}
|
||||
@ -380,9 +390,11 @@ int setting_set_with_string_representation(rarch_setting_t* setting,
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (settings && settings->menu.navigation.wraparound.enable)
|
||||
*setting->value.target.fraction = min;
|
||||
else
|
||||
#endif
|
||||
*setting->value.target.fraction = max;
|
||||
}
|
||||
}
|
||||
@ -454,9 +466,11 @@ static int setting_fraction_action_right_default(
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (settings && settings->menu.navigation.wraparound.enable)
|
||||
*setting->value.target.fraction = min;
|
||||
else
|
||||
#endif
|
||||
*setting->value.target.fraction = max;
|
||||
}
|
||||
}
|
||||
@ -1018,7 +1032,11 @@ static rarch_setting_t setting_bind_setting(const char* name,
|
||||
|
||||
result.change_handler = NULL;
|
||||
result.read_handler = NULL;
|
||||
#ifdef HAVE_MENU
|
||||
result.action_start = setting_bind_action_start;
|
||||
#else
|
||||
result.action_start = NULL;
|
||||
#endif
|
||||
result.action_left = NULL;
|
||||
result.action_right = NULL;
|
||||
result.action_up = NULL;
|
||||
@ -1748,3 +1766,97 @@ bool END_SUB_GROUP(
|
||||
(*list)[list_info->index++] = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
static int setting_generic_action_ok_linefeed(void *data, bool wraparound)
|
||||
{
|
||||
menu_input_ctx_line_t line;
|
||||
input_keyboard_line_complete_t cb = NULL;
|
||||
rarch_setting_t *setting = (rarch_setting_t*)data;
|
||||
const char *short_description = menu_setting_get_short_description(setting);
|
||||
|
||||
if (!setting)
|
||||
return -1;
|
||||
|
||||
(void)wraparound;
|
||||
|
||||
switch (setting_get_type(setting))
|
||||
{
|
||||
case ST_UINT:
|
||||
cb = menu_input_st_uint_cb;
|
||||
break;
|
||||
case ST_HEX:
|
||||
cb = menu_input_st_hex_cb;
|
||||
break;
|
||||
case ST_STRING:
|
||||
case ST_STRING_OPTIONS:
|
||||
cb = menu_input_st_string_cb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
line.label = short_description;
|
||||
line.label_setting = setting->name;
|
||||
line.type = 0;
|
||||
line.idx = 0;
|
||||
line.cb = cb;
|
||||
|
||||
if (!menu_input_ctl(MENU_INPUT_CTL_START_LINE, &line))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void setting_add_special_callbacks(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values)
|
||||
{
|
||||
unsigned idx = list_info->index - 1;
|
||||
|
||||
if (values & SD_FLAG_ALLOW_INPUT)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
(*list)[idx].action_ok = setting_generic_action_ok_linefeed;
|
||||
(*list)[idx].action_select = setting_generic_action_ok_linefeed;
|
||||
#else
|
||||
(*list)[idx].action_ok = NULL;
|
||||
(*list)[idx].action_select = NULL;
|
||||
#endif
|
||||
|
||||
switch ((*list)[idx].type)
|
||||
{
|
||||
case ST_UINT:
|
||||
(*list)[idx].action_cancel = NULL;
|
||||
break;
|
||||
case ST_HEX:
|
||||
(*list)[idx].action_cancel = NULL;
|
||||
break;
|
||||
case ST_STRING:
|
||||
(*list)[idx].action_start = setting_string_action_start_generic;
|
||||
(*list)[idx].action_cancel = NULL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void settings_data_list_current_add_flags(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values)
|
||||
{
|
||||
(*list)[list_info->index - 1].flags |= values;
|
||||
setting_add_special_callbacks(list, list_info, values);
|
||||
}
|
||||
|
||||
void settings_data_list_current_add_free_flags(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values)
|
||||
{
|
||||
(*list)[list_info->index - 1].free_flags |= values;
|
||||
}
|
||||
|
@ -357,6 +357,16 @@ int setting_generic_action_ok_default(void *data, bool wraparound);
|
||||
|
||||
int setting_generic_action_start_default(void *data);
|
||||
|
||||
void settings_data_list_current_add_flags(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values);
|
||||
|
||||
void settings_data_list_current_add_free_flags(
|
||||
rarch_setting_t **list,
|
||||
rarch_setting_info_t *list_info,
|
||||
unsigned values);
|
||||
|
||||
rarch_setting_t setting_terminator_setting(void);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user