This commit is contained in:
twinaphex 2016-09-15 16:07:20 +02:00
parent 233925bea6
commit f648ea8602
10 changed files with 118 additions and 120 deletions

View File

@ -1805,7 +1805,7 @@ void handle_quit_event()
settings_t *settings = config_get_ptr();
#ifdef HAVE_MENU
if (settings && settings->confirm_on_exit &&
menu_popup_is_active())
menu_dialog_is_active())
return;
#endif
@ -2027,9 +2027,9 @@ bool command_event(enum event_command cmd, void *data)
case CMD_EVENT_QUIT:
#ifdef HAVE_MENU
if (settings && settings->confirm_on_exit &&
!menu_popup_is_active() && !runloop_is_quit_confirm())
!menu_dialog_is_active() && !runloop_is_quit_confirm())
{
menu_popup_show_message(MENU_POPUP_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT);
menu_dialog_show_message(MENU_DIALOG_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT);
break;
}
#endif

View File

@ -245,7 +245,7 @@ int generic_action_ok_displaylist_push(const char *path,
break;
case ACTION_OK_DL_HELP:
info_label = label;
menu_popup_push_pending(true, (enum menu_popup_type)type);
menu_dialog_push_pending(true, (enum menu_dialog_type)type);
dl_type = DISPLAYLIST_HELP;
break;
case ACTION_OK_DL_RPL_ENTRY:
@ -1446,7 +1446,7 @@ static int action_ok_shader_pass_load(const char *path,
static int generic_action_ok_help(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx,
enum msg_hash_enums id, enum menu_popup_type id2)
enum msg_hash_enums id, enum menu_dialog_type id2)
{
const char *lbl = msg_hash_to_str(id);
@ -1461,7 +1461,7 @@ static int action_ok_cheevos(const char *path,
return generic_action_ok_help(path, label, new_id, idx, entry_idx,
MENU_ENUM_LABEL_CHEEVOS_DESCRIPTION,
MENU_POPUP_HELP_CHEEVOS_DESCRIPTION);
MENU_DIALOG_HELP_CHEEVOS_DESCRIPTION);
}
static int action_ok_cheat(const char *path,
@ -3150,35 +3150,35 @@ static int action_ok_help_audio_video_troubleshooting(const char *path,
{
return generic_action_ok_help(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_HELP_AUDIO_VIDEO_TROUBLESHOOTING,
MENU_POPUP_HELP_AUDIO_VIDEO_TROUBLESHOOTING);
MENU_DIALOG_HELP_AUDIO_VIDEO_TROUBLESHOOTING);
}
static int action_ok_help(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_help(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_HELP, MENU_POPUP_WELCOME);
MENU_ENUM_LABEL_HELP, MENU_DIALOG_WELCOME);
}
static int action_ok_help_controls(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_help(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_HELP_CONTROLS, MENU_POPUP_HELP_CONTROLS);
MENU_ENUM_LABEL_HELP_CONTROLS, MENU_DIALOG_HELP_CONTROLS);
}
static int action_ok_help_what_is_a_core(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_help(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_HELP_WHAT_IS_A_CORE, MENU_POPUP_HELP_WHAT_IS_A_CORE);
MENU_ENUM_LABEL_HELP_WHAT_IS_A_CORE, MENU_DIALOG_HELP_WHAT_IS_A_CORE);
}
static int action_ok_help_scanning_content(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_help(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_HELP_SCANNING_CONTENT, MENU_POPUP_HELP_SCANNING_CONTENT);
MENU_ENUM_LABEL_HELP_SCANNING_CONTENT, MENU_DIALOG_HELP_SCANNING_CONTENT);
}
static int action_ok_help_change_virtual_gamepad(const char *path,
@ -3186,14 +3186,14 @@ static int action_ok_help_change_virtual_gamepad(const char *path,
{
return generic_action_ok_help(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_HELP_CHANGE_VIRTUAL_GAMEPAD,
MENU_POPUP_HELP_CHANGE_VIRTUAL_GAMEPAD);
MENU_DIALOG_HELP_CHANGE_VIRTUAL_GAMEPAD);
}
static int action_ok_help_load_content(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
return generic_action_ok_help(path, label, type, idx, entry_idx,
MENU_ENUM_LABEL_HELP_LOADING_CONTENT, MENU_POPUP_HELP_LOADING_CONTENT);
MENU_ENUM_LABEL_HELP_LOADING_CONTENT, MENU_DIALOG_HELP_LOADING_CONTENT);
}
static int action_ok_video_resolution(const char *path,

View File

@ -34,6 +34,10 @@
#include "../../config.h"
#endif
#ifndef HAVE_DYNAMIC
#include "../../frontend/frontend_driver.h"
#endif
#include "menu_generic.h"
#include "../menu_driver.h"
@ -44,7 +48,6 @@
#include "../../core_info.h"
#include "../../core.h"
#include "../../configuration.h"
#include "../../frontend/frontend_driver.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#include "../../verbosity.h"

View File

@ -22,14 +22,9 @@
#include "../menu_driver.h"
#include "../menu_display.h"
#include "../menu_displaylist.h"
#include "../menu_navigation.h"
#include "../menu_entries.h"
#include "../widgets/menu_dialog.h"
#include "../../configuration.h"
#include "../../performance_counters.h"
#include "../../verbosity.h"
#include "../../runloop.h"
#include "../../content.h"
@ -103,16 +98,16 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action)
switch (iterate_type)
{
case ITERATE_TYPE_HELP:
ret = menu_popup_iterate(
ret = menu_dialog_iterate(
menu->menu_state.msg, sizeof(menu->menu_state.msg), label);
BIT64_SET(menu->state, MENU_STATE_RENDER_MESSAGEBOX);
BIT64_SET(menu->state, MENU_STATE_POST_ITERATE);
if (ret == 1 || action == MENU_ACTION_OK)
{
BIT64_SET(menu->state, MENU_STATE_POP_STACK);
menu_popup_set_active(false);
menu_dialog_set_active(false);
if (menu_popup_get_current_type() == MENU_POPUP_QUIT_CONFIRM)
if (menu_dialog_get_current_type() == MENU_DIALOG_QUIT_CONFIRM)
{
runloop_set_quit_confirm(true);
command_event(CMD_EVENT_QUIT_CONFIRM, NULL);
@ -122,9 +117,9 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action)
if (action == MENU_ACTION_CANCEL)
{
BIT64_SET(menu->state, MENU_STATE_POP_STACK);
menu_popup_set_active(false);
menu_dialog_set_active(false);
if (menu_popup_get_current_type() == MENU_POPUP_QUIT_CONFIRM)
if (menu_dialog_get_current_type() == MENU_DIALOG_QUIT_CONFIRM)
{
runloop_set_quit_confirm(false);
@ -234,7 +229,7 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action)
BIT64_SET(menu->state, MENU_STATE_POST_ITERATE);
if (action == MENU_ACTION_OK || action == MENU_ACTION_CANCEL)
BIT64_SET(menu->state, MENU_STATE_POP_STACK);
menu_popup_set_active(false);
menu_dialog_set_active(false);
break;
case ITERATE_TYPE_DEFAULT:
/* FIXME: Crappy hack, needed for mouse controls
@ -253,7 +248,7 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action)
BIT64_SET(menu->state, MENU_STATE_POST_ITERATE);
/* Have to defer it so we let settings refresh. */
menu_popup_push();
menu_dialog_push();
break;
}

View File

@ -33,25 +33,25 @@
#include "../../config.h"
#endif
#ifndef HAVE_DYNAMIC
#include "../../frontend/frontend_driver.h"
#endif
#include "menu_generic.h"
#include "../menu_driver.h"
#include "../widgets/menu_entry.h"
#include "../menu_animation.h"
#include "../menu_display.h"
#include "../menu_display.h"
#include "../menu_navigation.h"
#include "../widgets/menu_entry.h"
#include "../widgets/menu_list.h"
#include "../menu_cbs.h"
#include "../../frontend/frontend_driver.h"
#include "../../core.h"
#include "../../verbosity.h"
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../file_path_special.h"
#include "../../tasks/tasks_internal.h"

View File

@ -4187,7 +4187,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
case DISPLAYLIST_HELP:
menu_entries_append_enum(info->list, info->path,
info->label, MSG_UNKNOWN, info->type, info->directory_ptr, 0);
menu_popup_unset_pending_push();
menu_dialog_unset_pending_push();
break;
case DISPLAYLIST_SETTING_ENUM:
{

View File

@ -180,7 +180,7 @@ static bool menu_init(menu_handle_t *menu_data)
if (settings->menu_show_start_screen)
{
menu_popup_push_pending(true, MENU_POPUP_WELCOME);
menu_dialog_push_pending(true, MENU_DIALOG_WELCOME);
settings->menu_show_start_screen = false;
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
}
@ -189,14 +189,14 @@ static bool menu_init(menu_handle_t *menu_data)
&& !string_is_empty(settings->path.bundle_assets_src)
&& !string_is_empty(settings->path.bundle_assets_dst)
#ifdef IOS
&& menu_popup_is_push_pending()
&& menu_dialog_is_push_pending()
#else
&& (settings->bundle_assets_extract_version_current
!= settings->bundle_assets_extract_last_version)
#endif
)
{
menu_popup_push_pending(true, MENU_POPUP_HELP_EXTRACT);
menu_dialog_push_pending(true, MENU_DIALOG_HELP_EXTRACT);
#ifdef HAVE_ZLIB
task_push_decompress(settings->path.bundle_assets_src,
settings->path.bundle_assets_dst,
@ -580,7 +580,7 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
core_info_deinit_list();
core_info_free_current_core();
menu_popup_reset();
menu_dialog_reset();
free(menu_driver_data);
}

View File

@ -35,13 +35,13 @@
#include "../../input/input_autodetect.h"
#include "../../input/input_config.h"
static bool menu_popup_pending_push = false;
static bool menu_popup_active = false;
static unsigned menu_popup_current_id = 0;
static enum menu_popup_type menu_popup_current_type = MENU_POPUP_NONE;
static enum msg_hash_enums menu_popup_current_msg = MSG_UNKNOWN;
static bool menu_dialog_pending_push = false;
static bool menu_dialog_active = false;
static unsigned menu_dialog_current_id = 0;
static enum menu_dialog_type menu_dialog_current_type = MENU_DIALOG_NONE;
static enum msg_hash_enums menu_dialog_current_msg = MSG_UNKNOWN;
int menu_popup_iterate(char *s, size_t len, const char *label)
int menu_dialog_iterate(char *s, size_t len, const char *label)
{
#ifdef HAVE_CHEEVOS
cheevos_ctx_desc_t desc_info;
@ -49,9 +49,9 @@ int menu_popup_iterate(char *s, size_t len, const char *label)
bool do_exit = false;
settings_t *settings = config_get_ptr();
switch (menu_popup_current_type)
switch (menu_dialog_current_type)
{
case MENU_POPUP_WELCOME:
case MENU_DIALOG_WELCOME:
{
static int64_t timeout_end;
int64_t timeout;
@ -82,7 +82,7 @@ int menu_popup_iterate(char *s, size_t len, const char *label)
}
}
break;
case MENU_POPUP_HELP_CONTROLS:
case MENU_DIALOG_HELP_CONTROLS:
{
unsigned i;
char s2[PATH_MAX_LENGTH] = {0};
@ -180,37 +180,37 @@ int menu_popup_iterate(char *s, size_t len, const char *label)
break;
#ifdef HAVE_CHEEVOS
case MENU_POPUP_HELP_CHEEVOS_DESCRIPTION:
desc_info.idx = menu_popup_current_id;
case MENU_DIALOG_HELP_CHEEVOS_DESCRIPTION:
desc_info.idx = menu_dialog_current_id;
desc_info.s = s;
desc_info.len = len;
cheevos_get_description(&desc_info);
break;
#endif
case MENU_POPUP_HELP_WHAT_IS_A_CORE:
case MENU_DIALOG_HELP_WHAT_IS_A_CORE:
menu_hash_get_help_enum(MENU_ENUM_LABEL_VALUE_WHAT_IS_A_CORE_DESC,
s, len);
break;
case MENU_POPUP_HELP_LOADING_CONTENT:
case MENU_DIALOG_HELP_LOADING_CONTENT:
menu_hash_get_help_enum(MENU_ENUM_LABEL_LOAD_CONTENT_LIST,
s, len);
break;
case MENU_POPUP_HELP_CHANGE_VIRTUAL_GAMEPAD:
case MENU_DIALOG_HELP_CHANGE_VIRTUAL_GAMEPAD:
menu_hash_get_help_enum(
MENU_ENUM_LABEL_VALUE_HELP_CHANGE_VIRTUAL_GAMEPAD_DESC,
s, len);
break;
case MENU_POPUP_HELP_AUDIO_VIDEO_TROUBLESHOOTING:
case MENU_DIALOG_HELP_AUDIO_VIDEO_TROUBLESHOOTING:
menu_hash_get_help_enum(
MENU_ENUM_LABEL_VALUE_HELP_AUDIO_VIDEO_TROUBLESHOOTING_DESC,
s, len);
break;
case MENU_POPUP_HELP_SCANNING_CONTENT:
case MENU_DIALOG_HELP_SCANNING_CONTENT:
menu_hash_get_help_enum(MENU_ENUM_LABEL_VALUE_HELP_SCANNING_CONTENT_DESC,
s, len);
break;
case MENU_POPUP_HELP_EXTRACT:
case MENU_DIALOG_HELP_EXTRACT:
menu_hash_get_help_enum(MENU_ENUM_LABEL_VALUE_EXTRACTING_PLEASE_WAIT,
s, len);
@ -220,50 +220,50 @@ int menu_popup_iterate(char *s, size_t len, const char *label)
do_exit = true;
}
break;
case MENU_POPUP_QUIT_CONFIRM:
case MENU_POPUP_INFORMATION:
case MENU_POPUP_QUESTION:
case MENU_POPUP_WARNING:
case MENU_POPUP_ERROR:
menu_hash_get_help_enum(menu_popup_current_msg,
case MENU_DIALOG_QUIT_CONFIRM:
case MENU_DIALOG_INFORMATION:
case MENU_DIALOG_QUESTION:
case MENU_DIALOG_WARNING:
case MENU_DIALOG_ERROR:
menu_hash_get_help_enum(menu_dialog_current_msg,
s, len);
break;
case MENU_POPUP_NONE:
case MENU_DIALOG_NONE:
default:
break;
}
if (do_exit)
{
menu_popup_current_type = MENU_POPUP_NONE;
menu_dialog_current_type = MENU_DIALOG_NONE;
return 1;
}
return 0;
}
bool menu_popup_is_push_pending(void)
bool menu_dialog_is_push_pending(void)
{
return menu_popup_pending_push;
return menu_dialog_pending_push;
}
void menu_popup_unset_pending_push(void)
void menu_dialog_unset_pending_push(void)
{
menu_popup_pending_push = false;
menu_dialog_pending_push = false;
}
void menu_popup_push_pending(bool push, enum menu_popup_type type)
void menu_dialog_push_pending(bool push, enum menu_dialog_type type)
{
menu_popup_pending_push = push;
menu_popup_current_type = type;
menu_popup_active = true;
menu_dialog_pending_push = push;
menu_dialog_current_type = type;
menu_dialog_active = true;
}
void menu_popup_push(void)
void menu_dialog_push(void)
{
menu_displaylist_info_t info = {0};
if (!menu_popup_is_push_pending())
if (!menu_dialog_is_push_pending())
return;
info.list = menu_entries_get_menu_stack_ptr(0);
@ -275,39 +275,39 @@ void menu_popup_push(void)
menu_displaylist_ctl(DISPLAYLIST_HELP, &info);
}
void menu_popup_reset(void)
void menu_dialog_reset(void)
{
menu_popup_pending_push = false;
menu_popup_current_id = 0;
menu_popup_current_type = MENU_POPUP_NONE;
menu_popup_current_msg = MSG_UNKNOWN;
menu_dialog_pending_push = false;
menu_dialog_current_id = 0;
menu_dialog_current_type = MENU_DIALOG_NONE;
menu_dialog_current_msg = MSG_UNKNOWN;
menu_display_toggle_set_reason(MENU_TOGGLE_REASON_NONE);
}
void menu_popup_show_message(
enum menu_popup_type type, enum msg_hash_enums msg)
void menu_dialog_show_message(
enum menu_dialog_type type, enum msg_hash_enums msg)
{
menu_popup_current_msg = msg;
menu_dialog_current_msg = msg;
if (!menu_driver_ctl(RARCH_MENU_CTL_IS_TOGGLE, NULL))
menu_display_toggle_set_reason(MENU_TOGGLE_REASON_MESSAGE);
menu_popup_push_pending(true, type);
menu_popup_push();
menu_dialog_push_pending(true, type);
menu_dialog_push();
}
bool menu_popup_is_active(void)
bool menu_dialog_is_active(void)
{
return menu_popup_active;
return menu_dialog_active;
}
void menu_popup_set_active(bool on)
void menu_dialog_set_active(bool on)
{
menu_popup_active = on;
menu_dialog_active = on;
}
enum menu_popup_type menu_popup_get_current_type(void)
enum menu_dialog_type menu_dialog_get_current_type(void)
{
return menu_popup_current_type;
return menu_dialog_current_type;
}

View File

@ -14,8 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MENU_POPUP_H
#define _MENU_POPUP_H
#ifndef _MENU_DIALOG_H
#define _MENU_DIALOG_H
#include <stdint.h>
#include <stdlib.h>
@ -26,50 +26,50 @@
#include "../../msg_hash.h"
enum menu_popup_type
enum menu_dialog_type
{
MENU_POPUP_NONE = 0,
MENU_POPUP_WELCOME,
MENU_POPUP_HELP_EXTRACT,
MENU_POPUP_HELP_CONTROLS,
MENU_POPUP_HELP_CHEEVOS_DESCRIPTION,
MENU_POPUP_HELP_LOADING_CONTENT,
MENU_POPUP_HELP_WHAT_IS_A_CORE,
MENU_POPUP_HELP_CHANGE_VIRTUAL_GAMEPAD,
MENU_POPUP_HELP_AUDIO_VIDEO_TROUBLESHOOTING,
MENU_POPUP_HELP_SCANNING_CONTENT,
MENU_POPUP_QUIT_CONFIRM,
MENU_POPUP_INFORMATION,
MENU_POPUP_QUESTION,
MENU_POPUP_WARNING,
MENU_POPUP_ERROR,
MENU_POPUP_LAST
MENU_DIALOG_NONE = 0,
MENU_DIALOG_WELCOME,
MENU_DIALOG_HELP_EXTRACT,
MENU_DIALOG_HELP_CONTROLS,
MENU_DIALOG_HELP_CHEEVOS_DESCRIPTION,
MENU_DIALOG_HELP_LOADING_CONTENT,
MENU_DIALOG_HELP_WHAT_IS_A_CORE,
MENU_DIALOG_HELP_CHANGE_VIRTUAL_GAMEPAD,
MENU_DIALOG_HELP_AUDIO_VIDEO_TROUBLESHOOTING,
MENU_DIALOG_HELP_SCANNING_CONTENT,
MENU_DIALOG_QUIT_CONFIRM,
MENU_DIALOG_INFORMATION,
MENU_DIALOG_QUESTION,
MENU_DIALOG_WARNING,
MENU_DIALOG_ERROR,
MENU_DIALOG_LAST
};
RETRO_BEGIN_DECLS
void menu_popup_push_pending(
bool push, enum menu_popup_type type);
void menu_dialog_push_pending(
bool push, enum menu_dialog_type type);
int menu_popup_iterate(
int menu_dialog_iterate(
char *s, size_t len, const char *label);
void menu_popup_unset_pending_push(void);
void menu_dialog_unset_pending_push(void);
bool menu_popup_is_push_pending(void);
bool menu_dialog_is_push_pending(void);
void menu_popup_push(void);
void menu_dialog_push(void);
void menu_popup_reset(void);
void menu_dialog_reset(void);
void menu_popup_show_message(
enum menu_popup_type type, enum msg_hash_enums msg);
void menu_dialog_show_message(
enum menu_dialog_type type, enum msg_hash_enums msg);
bool menu_popup_is_active(void);
bool menu_dialog_is_active(void);
void menu_popup_set_active(bool on);
void menu_dialog_set_active(bool on);
enum menu_popup_type menu_popup_get_current_type(void);
enum menu_dialog_type menu_dialog_get_current_type(void);
RETRO_END_DECLS

View File

@ -1362,7 +1362,7 @@ static INLINE int runloop_iterate_time_to_exit(bool quit_key_pressed)
if (settings && settings->confirm_on_exit &&
!runloop_quit_confirm)
{
if (menu_popup_is_active())
if (menu_dialog_is_active())
return 1;
if (content_is_inited())
@ -1372,7 +1372,7 @@ static INLINE int runloop_iterate_time_to_exit(bool quit_key_pressed)
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
}
menu_popup_show_message(MENU_POPUP_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT);
menu_dialog_show_message(MENU_DIALOG_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT);
return 1;
}
#endif