mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
commit
62256b77c3
24
Makefile
24
Makefile
@ -150,8 +150,29 @@ ifneq ($(findstring $(GPERFTOOLS),tcmalloc),)
|
||||
LIBS += -ltcmalloc
|
||||
endif
|
||||
|
||||
# Qt MOC generation, required for QObject-derived classes
|
||||
ifneq ($(MOC_HEADERS),)
|
||||
# prefix moc_ to base filename of paths and change extension from h to cpp, so a/b/foo.h becomes a/b/moc_foo.cpp
|
||||
MOC_SRC := $(join $(addsuffix moc_,$(addprefix $(OBJDIR)/,$(dir $(MOC_HEADERS)))), $(notdir $(MOC_HEADERS:.h=.cpp)))
|
||||
MOC_OBJ := $(patsubst %.cpp,%.o,$(MOC_SRC))
|
||||
RARCH_OBJ += $(MOC_OBJ)
|
||||
endif
|
||||
|
||||
all: $(TARGET) config.mk
|
||||
|
||||
$(MOC_SRC):
|
||||
@$(if $(Q), $(shell echo echo MOC $<),)
|
||||
$(eval MOC_TMP := $(patsubst %.h,%_moc.cpp,$@))
|
||||
$(Q)$(MOC) -o $(MOC_TMP) $<
|
||||
|
||||
$(foreach x,$(join $(addsuffix :,$(MOC_SRC)),$(MOC_HEADERS)),$(eval $x))
|
||||
|
||||
$(MOC_OBJ):
|
||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
|
||||
|
||||
$(foreach x,$(join $(addsuffix :,$(MOC_OBJ)),$(MOC_SRC)),$(eval $x))
|
||||
|
||||
ifeq ($(MAKECMDGOALS),clean)
|
||||
config.mk:
|
||||
else
|
||||
@ -250,3 +271,6 @@ clean:
|
||||
rm -f *.d
|
||||
|
||||
.PHONY: all install uninstall clean
|
||||
|
||||
print-%:
|
||||
@echo '$*=$($*)'
|
||||
|
@ -324,23 +324,27 @@ DEFINES += -DHAVE_IMAGEVIEWER
|
||||
OBJ += cores/libretro-imageviewer/image_core.o
|
||||
endif
|
||||
|
||||
# Qt
|
||||
|
||||
ifeq ($(HAVE_QT_WRAPPER), 1)
|
||||
OBJ += ui/drivers/ui_qt.o
|
||||
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -L./ui/drivers/qt/build/release/
|
||||
LIBS += -lwrapper
|
||||
endif
|
||||
# Qt WIMP GUI
|
||||
|
||||
ifeq ($(HAVE_QT), 1)
|
||||
OBJ += ui/drivers/ui_qt.o \
|
||||
ui/drivers/qt/ui_qt_application.o \
|
||||
ui/drivers/qt/ui_qt_window.o \
|
||||
ui/drivers/qt/ui_qt_browser_window.o \
|
||||
ui/drivers/qt/ui_qt_load_core_window.o \
|
||||
ui/drivers/qt/ui_qt_msg_window.o
|
||||
|
||||
MOC_HEADERS += ui/drivers/ui_qt.h \
|
||||
ui/drivers/qt/ui_qt_load_core_window.h
|
||||
|
||||
DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) -DHAVE_MAIN
|
||||
#DEFINES += $(QT5WEBENGINE_CFLAGS)
|
||||
LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS)
|
||||
#LIBS += $(QT5WEBENGINE_LIBS)
|
||||
NEED_CXX_LINKER = 1
|
||||
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
DEFINES += -I/usr/include/qt -fPIC
|
||||
DEFINES += -fPIC
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -1185,7 +1189,7 @@ ifeq ($(HAVE_VULKAN), 1)
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/drivers_display/menu_display_vulkan.o
|
||||
endif
|
||||
LIBS += -lstdc++
|
||||
#LIBS += -lstdc++
|
||||
DEFINES += -DHAVE_VULKAN
|
||||
INCLUDE_DIRS += -Igfx/include
|
||||
|
||||
|
33
command.c
33
command.c
@ -169,6 +169,7 @@ static const struct cmd_map map[] = {
|
||||
{ "DISK_NEXT", RARCH_DISK_NEXT },
|
||||
{ "DISK_PREV", RARCH_DISK_PREV },
|
||||
{ "GRAB_MOUSE_TOGGLE", RARCH_GRAB_MOUSE_TOGGLE },
|
||||
{ "UI_COMPANION_TOGGLE", RARCH_UI_COMPANION_TOGGLE },
|
||||
{ "GAME_FOCUS_TOGGLE", RARCH_GAME_FOCUS_TOGGLE },
|
||||
{ "MENU_TOGGLE", RARCH_MENU_TOGGLE },
|
||||
{ "MENU_UP", RETRO_DEVICE_ID_JOYPAD_UP },
|
||||
@ -1705,7 +1706,7 @@ void command_playlist_update_write(
|
||||
const char *core_path,
|
||||
const char *core_display_name,
|
||||
const char *crc32,
|
||||
const char *db_name)
|
||||
const char *db_name)
|
||||
{
|
||||
playlist_t *plist = (playlist_t*)data;
|
||||
playlist_t *playlist = plist ? plist : playlist_get_cached();
|
||||
@ -1787,10 +1788,11 @@ bool command_event(enum event_command cmd, void *data)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
libretro_get_system_info(
|
||||
if (!libretro_get_system_info(
|
||||
core_path,
|
||||
system,
|
||||
&system_info->load_no_content);
|
||||
&system_info->load_no_content))
|
||||
return false;
|
||||
info_find.path = core_path;
|
||||
|
||||
if (!core_info_load(&info_find))
|
||||
@ -1803,11 +1805,17 @@ bool command_event(enum event_command cmd, void *data)
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_LOAD_CORE:
|
||||
command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
|
||||
{
|
||||
bool success = command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
|
||||
|
||||
#ifndef HAVE_DYNAMIC
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
#else
|
||||
if (!success)
|
||||
return false;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case CMD_EVENT_LOAD_STATE:
|
||||
/* Immutable - disallow savestate load when
|
||||
* we absolutely cannot change game state. */
|
||||
@ -1925,7 +1933,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
cheevos_toggle_hardcore_mode();
|
||||
#endif
|
||||
break;
|
||||
/* this fallthrough is on purpose, it should do
|
||||
/* this fallthrough is on purpose, it should do
|
||||
a CMD_EVENT_REINIT too */
|
||||
case CMD_EVENT_REINIT_FROM_TOGGLE:
|
||||
retroarch_unset_forced_fullscreen();
|
||||
@ -2010,7 +2018,7 @@ TODO: Add a setting for these tweaks */
|
||||
case CMD_EVENT_AUTOSAVE_INIT:
|
||||
command_event(CMD_EVENT_AUTOSAVE_DEINIT, NULL);
|
||||
#ifdef HAVE_THREADS
|
||||
{
|
||||
{
|
||||
#ifdef HAVE_NETWORKING
|
||||
/* Only enable state manager if netplay is not underway
|
||||
TODO: Add a setting for these tweaks */
|
||||
@ -2024,7 +2032,7 @@ TODO: Add a setting for these tweaks */
|
||||
else
|
||||
runloop_unset(RUNLOOP_ACTION_AUTOSAVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case CMD_EVENT_AUTOSAVE_STATE:
|
||||
@ -2306,7 +2314,7 @@ TODO: Add a setting for these tweaks */
|
||||
case CMD_EVENT_RESUME:
|
||||
rarch_menu_running_finished();
|
||||
if (ui_companion_is_on_foreground())
|
||||
ui_companion_driver_toggle();
|
||||
ui_companion_driver_toggle(false);
|
||||
break;
|
||||
case CMD_EVENT_ADD_TO_FAVORITES:
|
||||
{
|
||||
@ -2355,7 +2363,7 @@ TODO: Add a setting for these tweaks */
|
||||
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET_CORE_ASSOCIATION), 1, 180, true);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
case CMD_EVENT_RESTART_RETROARCH:
|
||||
if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART))
|
||||
return false;
|
||||
@ -2577,7 +2585,7 @@ TODO: Add a setting for these tweaks */
|
||||
case CMD_EVENT_FULLSCREEN_TOGGLE:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
bool new_fullscreen_state = !settings->bools.video_fullscreen
|
||||
bool new_fullscreen_state = !settings->bools.video_fullscreen
|
||||
&& !retroarch_is_forced_fullscreen();
|
||||
if (!video_driver_has_windowed())
|
||||
return false;
|
||||
@ -2736,6 +2744,11 @@ TODO: Add a setting for these tweaks */
|
||||
video_driver_show_mouse();
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_UI_COMPANION_TOGGLE:
|
||||
{
|
||||
ui_companion_driver_toggle(true);
|
||||
break;
|
||||
}
|
||||
case CMD_EVENT_GAME_FOCUS_TOGGLE:
|
||||
{
|
||||
static bool game_focus_state = false;
|
||||
|
@ -139,7 +139,7 @@ enum event_command
|
||||
/* Add a playlist entry to favorites. */
|
||||
CMD_EVENT_ADD_TO_FAVORITES,
|
||||
/* Reset playlist entry associated core to DETECT */
|
||||
CMD_EVENT_RESET_CORE_ASSOCIATION,
|
||||
CMD_EVENT_RESET_CORE_ASSOCIATION,
|
||||
/* Toggles pause. */
|
||||
CMD_EVENT_PAUSE_TOGGLE,
|
||||
/* Pauses RetroArch. */
|
||||
@ -218,6 +218,8 @@ enum event_command
|
||||
CMD_EVENT_GRAB_MOUSE_TOGGLE,
|
||||
/* Toggles game focus. */
|
||||
CMD_EVENT_GAME_FOCUS_TOGGLE,
|
||||
/* Toggles desktop menu. */
|
||||
CMD_EVENT_UI_COMPANION_TOGGLE,
|
||||
/* Toggles fullscreen mode. */
|
||||
CMD_EVENT_FULLSCREEN_TOGGLE,
|
||||
CMD_EVENT_PERFCNT_REPORT_FRONTEND_LOG,
|
||||
@ -271,7 +273,7 @@ void command_playlist_push_write(
|
||||
void command_playlist_update_write(
|
||||
void *data,
|
||||
size_t idx,
|
||||
const char *path,
|
||||
const char *path,
|
||||
const char *label,
|
||||
const char *core_path,
|
||||
const char *core_display_name,
|
||||
|
@ -670,6 +670,9 @@ static const bool ui_companion_start_on_boot = true;
|
||||
|
||||
static const bool ui_companion_enable = false;
|
||||
|
||||
/* Currently only used to show the WIMP UI on startup */
|
||||
static const bool ui_companion_toggle = false;
|
||||
|
||||
#if defined(__QNX__) || defined(_XBOX1) || defined(_XBOX360) || defined(__CELLOS_LV2__) || (defined(__MACH__) && defined(IOS)) || defined(ANDROID) || defined(WIIU) || defined(HAVE_NEON) || defined(GEKKO) || defined(__ARM_NEON__)
|
||||
static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_LOWER;
|
||||
#elif defined(PSP) || defined(_3DS) || defined(VITA)
|
||||
|
@ -97,6 +97,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
#else
|
||||
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_z, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
@ -172,6 +173,7 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_F11, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_SCROLLOCK, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE, RETROK_F5, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_F1, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
#endif
|
||||
};
|
||||
|
@ -1180,6 +1180,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("automatically_add_content_to_playlist", &settings->bools.automatically_add_content_to_playlist, true, automatically_add_content_to_playlist, false);
|
||||
SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, ui_companion_start_on_boot, false);
|
||||
SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, ui_companion_enable, false);
|
||||
SETTING_BOOL("ui_companion_toggle", &settings->bools.ui_companion_toggle, false, ui_companion_toggle, false);
|
||||
SETTING_BOOL("video_gpu_record", &settings->bools.video_gpu_record, true, gpu_record, false);
|
||||
SETTING_BOOL("input_remap_binds_enable", &settings->bools.input_remap_binds_enable, true, true, false);
|
||||
SETTING_BOOL("all_users_control_menu", &settings->bools.input_all_users_control_menu, true, all_users_control_menu, false);
|
||||
@ -3526,14 +3527,14 @@ static void save_keybind_mbutton(config_file_t *conf,
|
||||
const char *base,
|
||||
const struct retro_keybind *bind, bool save_empty)
|
||||
{
|
||||
char key[64];
|
||||
char key[64];
|
||||
|
||||
key[0] = '\0';
|
||||
key[0] = '\0';
|
||||
|
||||
fill_pathname_join_delim_concat(key, prefix,
|
||||
base, '_', "_mbtn", sizeof(key));
|
||||
fill_pathname_join_delim_concat(key, prefix,
|
||||
base, '_', "_mbtn", sizeof(key));
|
||||
|
||||
switch ( bind->mbutton )
|
||||
switch ( bind->mbutton )
|
||||
{
|
||||
case RETRO_DEVICE_ID_MOUSE_LEFT:
|
||||
config_set_uint64(conf, key, 1);
|
||||
|
@ -198,6 +198,7 @@ typedef struct settings
|
||||
bool ui_suspend_screensaver_enable;
|
||||
bool ui_companion_start_on_boot;
|
||||
bool ui_companion_enable;
|
||||
bool ui_companion_toggle;
|
||||
|
||||
/* Cheevos */
|
||||
bool cheevos_enable;
|
||||
|
@ -151,6 +151,7 @@ static void core_info_list_free(core_info_list_t *core_info_list)
|
||||
free(info->systemname);
|
||||
free(info->system_manufacturer);
|
||||
free(info->display_name);
|
||||
free(info->display_version);
|
||||
free(info->supported_extensions);
|
||||
free(info->authors);
|
||||
free(info->permissions);
|
||||
@ -278,6 +279,13 @@ static core_info_list_t *core_info_list_new(const char *path,
|
||||
free(tmp);
|
||||
tmp = NULL;
|
||||
}
|
||||
if (config_get_string(conf, "display_version", &tmp)
|
||||
&& !string_is_empty(tmp))
|
||||
{
|
||||
core_info[i].display_version = strdup(tmp);
|
||||
free(tmp);
|
||||
tmp = NULL;
|
||||
}
|
||||
if (config_get_string(conf, "corename", &tmp)
|
||||
&& !string_is_empty(tmp))
|
||||
{
|
||||
|
@ -43,6 +43,7 @@ typedef struct
|
||||
char *path;
|
||||
void *config_data;
|
||||
char *display_name;
|
||||
char *display_version;
|
||||
char *core_name;
|
||||
char *system_manufacturer;
|
||||
char *systemname;
|
||||
|
@ -37,6 +37,13 @@
|
||||
#include "../paths.h"
|
||||
#include "../retroarch.h"
|
||||
|
||||
/* griffin hack */
|
||||
#ifdef HAVE_QT
|
||||
#ifndef HAVE_MAIN
|
||||
#define HAVE_MAIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_MAIN
|
||||
#include "../retroarch.h"
|
||||
#endif
|
||||
@ -98,6 +105,9 @@ void main_exit(void *args)
|
||||
int rarch_main(int argc, char *argv[], void *data)
|
||||
{
|
||||
void *args = (void*)data;
|
||||
#ifdef HAVE_MAIN
|
||||
const ui_application_t *ui_application = NULL;
|
||||
#endif
|
||||
|
||||
rarch_ctl(RARCH_CTL_PREINIT, NULL);
|
||||
frontend_driver_init_first(args);
|
||||
@ -140,6 +150,11 @@ int rarch_main(int argc, char *argv[], void *data)
|
||||
}while(1);
|
||||
|
||||
main_exit(args);
|
||||
#elif HAVE_QT
|
||||
ui_application = ui_companion_driver_get_qt_application_ptr();
|
||||
|
||||
if (ui_application && ui_application->run)
|
||||
ui_application->run(args);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -434,7 +434,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam)
|
||||
|
||||
#ifndef _XBOX
|
||||
static LRESULT win32_handle_keyboard_event(HWND hwnd, UINT message,
|
||||
WPARAM wparam, LPARAM lparam)
|
||||
WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
uint16_t mod = 0;
|
||||
|
||||
@ -818,7 +818,7 @@ bool win32_window_create(void *data, unsigned style,
|
||||
notification_filter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
|
||||
notification_filter.dbcc_classguid = GUID_DEVINTERFACE_HID;
|
||||
notification_handler = RegisterDeviceNotification(
|
||||
main_window.hwnd, ¬ification_filter, DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||
main_window.hwnd, ¬ification_filter, DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||
|
||||
if (!notification_handler)
|
||||
RARCH_ERR("Error registering for notifications\n");
|
||||
@ -1029,7 +1029,7 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
|
||||
float refresh_mod = settings->bools.video_black_frame_insertion ? 2.0f : 1.0f;
|
||||
unsigned refresh = roundf(settings->floats.video_refresh_rate
|
||||
* refresh_mod * settings->uints.video_swap_interval);
|
||||
|
||||
|
||||
if (windowed_full)
|
||||
{
|
||||
*style = WS_EX_TOPMOST | WS_POPUP;
|
||||
|
@ -124,7 +124,7 @@ typedef struct Hints
|
||||
} Hints;
|
||||
|
||||
/* We use long because X11 wants 32-bit pixels for 32-bit systems and 64 for 64... */
|
||||
const unsigned long retroarch_icon_data[] = {
|
||||
static const unsigned long retroarch_icon_data[] = {
|
||||
16, 16,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
|
@ -229,6 +229,8 @@ static void *video_context_data = NULL;
|
||||
static bool deferred_video_context_driver_set_flags = false;
|
||||
static gfx_ctx_flags_t deferred_flag_data = {0};
|
||||
|
||||
static bool video_started_fullscreen = false;
|
||||
|
||||
static shader_backend_t *current_shader = NULL;
|
||||
static void *current_shader_data = NULL;
|
||||
|
||||
@ -422,6 +424,11 @@ static const shader_backend_t *shader_ctx_drivers[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
bool video_driver_started_fullscreen(void)
|
||||
{
|
||||
return video_started_fullscreen;
|
||||
}
|
||||
|
||||
/* Stub functions */
|
||||
|
||||
static void update_window_title_null(void *data, void *data2)
|
||||
@ -1021,6 +1028,8 @@ static bool video_driver_init_internal(bool *video_is_threaded)
|
||||
(video_driver_pix_fmt == RETRO_PIXEL_FORMAT_XRGB8888);
|
||||
video.parent = 0;
|
||||
|
||||
video_started_fullscreen = video.fullscreen;
|
||||
|
||||
/* Reset video frame count */
|
||||
video_driver_frame_count = 0;
|
||||
|
||||
@ -1631,7 +1640,7 @@ bool video_driver_supports_viewport_read(void)
|
||||
bool video_driver_supports_read_frame_raw(void)
|
||||
{
|
||||
if (current_video->read_frame_raw)
|
||||
return true;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2562,11 +2571,11 @@ void video_driver_frame(const void *data, unsigned width,
|
||||
compute_audio_buffer_statistics(&audio_stats);
|
||||
|
||||
snprintf(video_info.stat_text,
|
||||
sizeof(video_info.stat_text),
|
||||
sizeof(video_info.stat_text),
|
||||
"Video Statistics:\n -Frame rate: %6.2f fps\n -Frame time: %6.2f ms\n -Frame time deviation: %.3f %%\n"
|
||||
" -Frame count: %" PRIu64"\n -Viewport: %d x %d x %3.2f\n"
|
||||
"Audio Statistics:\n -Average buffer saturation: %.2f %%\n -Standard deviation: %.2f %%\n -Time spent close to underrun: %.2f %%\n -Time spent close to blocking: %.2f %%\n -Sample count: %d\n"
|
||||
"Core Geometry:\n -Size: %u x %u\n -Max Size: %u x %u\n -Aspect: %3.2f\nCore Timing:\n -FPS: %3.2f\n -Sample Rate: %6.2f\n",
|
||||
"Core Geometry:\n -Size: %u x %u\n -Max Size: %u x %u\n -Aspect: %3.2f\nCore Timing:\n -FPS: %3.2f\n -Sample Rate: %6.2f\n",
|
||||
video_info.frame_rate,
|
||||
video_info.frame_time,
|
||||
100.0 * stddev,
|
||||
@ -3336,7 +3345,7 @@ bool video_context_driver_set_flags(gfx_ctx_flags_t *flags)
|
||||
|
||||
enum gfx_ctx_api video_context_driver_get_api(void)
|
||||
{
|
||||
enum gfx_ctx_api ctx_api = video_context_data ?
|
||||
enum gfx_ctx_api ctx_api = video_context_data ?
|
||||
current_video_context.get_api(video_context_data) : GFX_CTX_NONE;
|
||||
|
||||
if (ctx_api == GFX_CTX_NONE)
|
||||
@ -3436,7 +3445,7 @@ void video_shader_driver_use(void *data)
|
||||
{
|
||||
if (current_shader && current_shader->use)
|
||||
{
|
||||
video_shader_ctx_info_t *shader_info =
|
||||
video_shader_ctx_info_t *shader_info =
|
||||
(video_shader_ctx_info_t*)data;
|
||||
current_shader->use(shader_info->data, current_shader_data,
|
||||
shader_info->idx, shader_info->set_active);
|
||||
|
@ -1347,6 +1347,8 @@ float video_driver_get_refresh_rate(void);
|
||||
|
||||
extern bool (*video_driver_cb_has_focus)(void);
|
||||
|
||||
bool video_driver_started_fullscreen(void);
|
||||
|
||||
extern video_driver_t video_gl;
|
||||
extern video_driver_t video_vulkan;
|
||||
extern video_driver_t video_psp1;
|
||||
|
@ -33,6 +33,7 @@ MENU
|
||||
UI
|
||||
============================================================ */
|
||||
#if defined(HAVE_QT)
|
||||
#define HAVE_MAIN /* also requires defining in frontend.c */
|
||||
#include "../ui/drivers/ui_qt.cpp"
|
||||
|
||||
#include "../ui/drivers/qt/ui_qt_window.cpp"
|
||||
@ -41,10 +42,6 @@ UI
|
||||
#include "../ui/drivers/qt/ui_qt_application.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_QT_WRAPPER)
|
||||
#include "../ui/drivers/ui_qt.cpp"
|
||||
#endif
|
||||
|
||||
/*============================================================
|
||||
VIDEO DRIVER
|
||||
============================================================ */
|
||||
|
@ -53,19 +53,19 @@ enum
|
||||
RARCH_ANALOG_RIGHT_Y_MINUS,
|
||||
RARCH_ANALOG_BIND_LIST_END,
|
||||
|
||||
/* Lightgun */
|
||||
RARCH_LIGHTGUN_TRIGGER = RARCH_FIRST_LIGHTGUN_BIND,
|
||||
RARCH_LIGHTGUN_RELOAD,
|
||||
RARCH_LIGHTGUN_AUX_A,
|
||||
RARCH_LIGHTGUN_AUX_B,
|
||||
RARCH_LIGHTGUN_AUX_C,
|
||||
RARCH_LIGHTGUN_START,
|
||||
RARCH_LIGHTGUN_SELECT,
|
||||
RARCH_LIGHTGUN_DPAD_UP,
|
||||
RARCH_LIGHTGUN_DPAD_DOWN,
|
||||
RARCH_LIGHTGUN_DPAD_LEFT,
|
||||
RARCH_LIGHTGUN_DPAD_RIGHT,
|
||||
RARCH_LIGHTGUN_BIND_LIST_END,
|
||||
/* Lightgun */
|
||||
RARCH_LIGHTGUN_TRIGGER = RARCH_FIRST_LIGHTGUN_BIND,
|
||||
RARCH_LIGHTGUN_RELOAD,
|
||||
RARCH_LIGHTGUN_AUX_A,
|
||||
RARCH_LIGHTGUN_AUX_B,
|
||||
RARCH_LIGHTGUN_AUX_C,
|
||||
RARCH_LIGHTGUN_START,
|
||||
RARCH_LIGHTGUN_SELECT,
|
||||
RARCH_LIGHTGUN_DPAD_UP,
|
||||
RARCH_LIGHTGUN_DPAD_DOWN,
|
||||
RARCH_LIGHTGUN_DPAD_LEFT,
|
||||
RARCH_LIGHTGUN_DPAD_RIGHT,
|
||||
RARCH_LIGHTGUN_BIND_LIST_END,
|
||||
|
||||
/* Turbo */
|
||||
RARCH_TURBO_ENABLE = RARCH_FIRST_MISC_CUSTOM_BIND,
|
||||
@ -107,6 +107,7 @@ enum
|
||||
RARCH_DISK_PREV,
|
||||
RARCH_GRAB_MOUSE_TOGGLE,
|
||||
RARCH_GAME_FOCUS_TOGGLE,
|
||||
RARCH_UI_COMPANION_TOGGLE,
|
||||
|
||||
RARCH_MENU_TOGGLE,
|
||||
|
||||
|
@ -296,17 +296,17 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
|
||||
DECLARE_BIND(r_y_plus, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS),
|
||||
DECLARE_BIND(r_y_minus, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS),
|
||||
|
||||
DECLARE_BIND( gun_trigger, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER ),
|
||||
DECLARE_BIND( gun_offscreen_shot, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD ),
|
||||
DECLARE_BIND( gun_aux_a, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A ),
|
||||
DECLARE_BIND( gun_aux_b, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B ),
|
||||
DECLARE_BIND( gun_aux_c, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C ),
|
||||
DECLARE_BIND( gun_start, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START ),
|
||||
DECLARE_BIND( gun_select, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT ),
|
||||
DECLARE_BIND( gun_dpad_up, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP ),
|
||||
DECLARE_BIND( gun_dpad_down, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN ),
|
||||
DECLARE_BIND( gun_dpad_left, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT ),
|
||||
DECLARE_BIND( gun_dpad_right, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT ),
|
||||
DECLARE_BIND( gun_trigger, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER ),
|
||||
DECLARE_BIND( gun_offscreen_shot, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD ),
|
||||
DECLARE_BIND( gun_aux_a, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A ),
|
||||
DECLARE_BIND( gun_aux_b, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B ),
|
||||
DECLARE_BIND( gun_aux_c, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C ),
|
||||
DECLARE_BIND( gun_start, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START ),
|
||||
DECLARE_BIND( gun_select, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT ),
|
||||
DECLARE_BIND( gun_dpad_up, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP ),
|
||||
DECLARE_BIND( gun_dpad_down, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN ),
|
||||
DECLARE_BIND( gun_dpad_left, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT ),
|
||||
DECLARE_BIND( gun_dpad_right, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT ),
|
||||
|
||||
DECLARE_BIND(turbo, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE),
|
||||
|
||||
@ -343,6 +343,7 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = {
|
||||
DECLARE_META_BIND(2, disk_prev, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV),
|
||||
DECLARE_META_BIND(2, grab_mouse_toggle, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE),
|
||||
DECLARE_META_BIND(2, game_focus_toggle, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE),
|
||||
DECLARE_META_BIND(2, desktop_menu_toggle, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE),
|
||||
#ifdef HAVE_MENU
|
||||
DECLARE_META_BIND(1, menu_toggle, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE),
|
||||
#endif
|
||||
@ -1001,9 +1002,10 @@ void input_menu_keys_pressed(void *data, input_bits_t *p_new_state)
|
||||
|
||||
if (!menu_input_dialog_get_display_kb())
|
||||
{
|
||||
unsigned ids[14][2];
|
||||
unsigned ids[15][2];
|
||||
const struct retro_keybind *quitkey = &input_config_binds[0][RARCH_QUIT_KEY];
|
||||
const struct retro_keybind *fskey = &input_config_binds[0][RARCH_FULLSCREEN_TOGGLE_KEY];
|
||||
const struct retro_keybind *companionkey = &input_config_binds[0][RARCH_UI_COMPANION_TOGGLE];
|
||||
|
||||
ids[0][0] = RETROK_SPACE;
|
||||
ids[0][1] = RETRO_DEVICE_ID_JOYPAD_START;
|
||||
@ -1033,6 +1035,8 @@ void input_menu_keys_pressed(void *data, input_bits_t *p_new_state)
|
||||
ids[12][1] = RETRO_DEVICE_ID_JOYPAD_A;
|
||||
ids[13][0] = RETROK_DELETE;
|
||||
ids[13][1] = RETRO_DEVICE_ID_JOYPAD_Y;
|
||||
ids[14][0] = companionkey->key;
|
||||
ids[14][1] = RARCH_UI_COMPANION_TOGGLE;
|
||||
|
||||
if (settings->bools.input_menu_swap_ok_cancel_buttons)
|
||||
{
|
||||
@ -1040,7 +1044,7 @@ void input_menu_keys_pressed(void *data, input_bits_t *p_new_state)
|
||||
ids[12][1] = RETRO_DEVICE_ID_JOYPAD_B;
|
||||
}
|
||||
|
||||
for (i = 0; i < 14; i++)
|
||||
for (i = 0; i < 15; i++)
|
||||
{
|
||||
if (current_input->input_state(current_input_data,
|
||||
joypad_info, binds, 0,
|
||||
@ -1092,7 +1096,7 @@ void input_keys_pressed(void *data, input_bits_t *p_new_state)
|
||||
|
||||
if (check_input_driver_block_hotkey(binds_norm, binds_auto))
|
||||
{
|
||||
const struct retro_keybind *enable_hotkey =
|
||||
const struct retro_keybind *enable_hotkey =
|
||||
&input_config_binds[0][RARCH_ENABLE_HOTKEY];
|
||||
|
||||
if ( enable_hotkey && enable_hotkey->valid
|
||||
@ -1106,9 +1110,9 @@ void input_keys_pressed(void *data, input_bits_t *p_new_state)
|
||||
|
||||
if (binds[RARCH_GAME_FOCUS_TOGGLE].valid)
|
||||
{
|
||||
const struct retro_keybind *focus_binds_auto =
|
||||
const struct retro_keybind *focus_binds_auto =
|
||||
&input_autoconf_binds[0][RARCH_GAME_FOCUS_TOGGLE];
|
||||
const struct retro_keybind *focus_normal =
|
||||
const struct retro_keybind *focus_normal =
|
||||
&binds[RARCH_GAME_FOCUS_TOGGLE];
|
||||
|
||||
/* Allows rarch_focus_toggle hotkey to still work
|
||||
@ -1172,7 +1176,7 @@ void input_get_state_for_port(void *data, unsigned port, input_bits_t *p_new_sta
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
unsigned offset = 0 + (i * 4) + (j * 2);
|
||||
int16_t val = input_joypad_analog(joypad_driver,
|
||||
int16_t val = input_joypad_analog(joypad_driver,
|
||||
joypad_info, port, i, j, libretro_input_binds[port]);
|
||||
|
||||
if (val >= 0)
|
||||
@ -2761,9 +2765,9 @@ unsigned input_config_get_device_count()
|
||||
unsigned num_devices;
|
||||
for ( num_devices = 0; num_devices < MAX_INPUT_DEVICES; ++num_devices )
|
||||
{
|
||||
const char *device_name = input_config_get_device_name(num_devices);
|
||||
if ( string_is_empty(device_name) )
|
||||
break;
|
||||
const char *device_name = input_config_get_device_name(num_devices);
|
||||
if ( string_is_empty(device_name) )
|
||||
break;
|
||||
}
|
||||
return num_devices;
|
||||
}
|
||||
@ -2797,7 +2801,7 @@ void input_config_set_device_name(unsigned port, const char *name)
|
||||
name,
|
||||
sizeof(input_device_names[port]));
|
||||
|
||||
input_autoconfigure_joypad_reindex_devices();
|
||||
input_autoconfigure_joypad_reindex_devices();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -885,6 +885,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE,
|
||||
"マウスグラブを切り替え")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE,
|
||||
"ゲームのフォーカスを切り替え")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE,
|
||||
"デスクトップメニューを切り替え")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY,
|
||||
"保存状態をロード")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE,
|
||||
@ -1631,6 +1633,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,
|
||||
"UI Companion Enable")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_START_ON_BOOT,
|
||||
"UI Companion Start On Boot")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_TOGGLE,
|
||||
"起動時にデスクトップメニューを表示")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_MENUBAR_ENABLE,
|
||||
"メニューバー")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UNABLE_TO_READ_COMPRESSED_FILE,
|
||||
@ -2124,7 +2128,7 @@ MSG_HASH(MSG_FAILED_TO_LOAD_OVERLAY,
|
||||
MSG_HASH(MSG_FAILED_TO_LOAD_STATE,
|
||||
"Failed to load state from")
|
||||
MSG_HASH(MSG_FAILED_TO_OPEN_LIBRETRO_CORE,
|
||||
"Failed to open libretro core")
|
||||
"コアをロードするに失敗しました")
|
||||
MSG_HASH(MSG_FAILED_TO_PATCH,
|
||||
"パッチに失敗しました")
|
||||
MSG_HASH(MSG_FAILED_TO_RECEIVE_HEADER_FROM_CLIENT,
|
||||
@ -3332,9 +3336,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
|
||||
"Enable background filler thickness")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For 15 kHz CRT displays only. Attempts to use exact core/game resolution and refresh rate.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND,
|
||||
"Show Rewind Settings")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CONTENT_SHOW_REWIND,
|
||||
@ -3355,3 +3359,111 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS,
|
||||
"Mixer Settings")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS,
|
||||
"View and/or modify audio mixer settings.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_INFO,
|
||||
"詳細")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE,
|
||||
"ファイル(&F)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE,
|
||||
"コアをロード(&L)...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE,
|
||||
"コアをアンロード(&U)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT,
|
||||
"終了(&X)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT,
|
||||
"編集(&E)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT_SEARCH,
|
||||
"検索(&S)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW,
|
||||
"表示(&V)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_CLOSED_DOCKS,
|
||||
"閉じたドック")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS,
|
||||
"設定(&O)...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_DOCK_POSITIONS,
|
||||
"ドック配置を記憶:")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_GEOMETRY,
|
||||
"ウィンドウ位置とサイズを記憶:")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_LAST_TAB,
|
||||
"最後のコンテンツブラウザーのタブを記憶:")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME,
|
||||
"テーマ")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_SYSTEM_DEFAULT,
|
||||
"<システムデフォルト>")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_DARK,
|
||||
"ダーク")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_CUSTOM,
|
||||
"カスタム...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_TITLE,
|
||||
"設定")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_NAME,
|
||||
"名前")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOAD_CUSTOM_CORE,
|
||||
"カスタムなコアをロード...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOAD_CORE,
|
||||
"コアをロード")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOADING_CORE,
|
||||
"コアをロード中...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE_VERSION,
|
||||
"バージョン")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS,
|
||||
"プレイリスト")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER,
|
||||
"ファイルブラウザー")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_TOP,
|
||||
"先頭")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_UP,
|
||||
"上へ")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER,
|
||||
"コンテンツブラウザー")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART,
|
||||
"ボックスアート")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT,
|
||||
"スクリーンショット")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN,
|
||||
"タイトルスクリーン")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ALL_PLAYLISTS,
|
||||
"すべてのプレイリスト")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE,
|
||||
"コア")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE_INFO,
|
||||
"コア情報")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE_SELECTION_ASK,
|
||||
"<問い合わせる>")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_INFORMATION,
|
||||
"情報")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_WARNING,
|
||||
"警告")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ERROR,
|
||||
"エラー")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_RESTART_TO_TAKE_EFFECT,
|
||||
"変更はRetroArchを再起動した後に反映されます。")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOG,
|
||||
"ログ")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN,
|
||||
"今後表示しない")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_STOP,
|
||||
"停止")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ASSOCIATE_CORE,
|
||||
"コアに関連付ける")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_HIDDEN_PLAYLISTS,
|
||||
"隠したプレイリスト")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_HIDE,
|
||||
"隠す")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_HIGHLIGHT_COLOR,
|
||||
"ハイライトカラー")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CHOOSE,
|
||||
"選択(&C)...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SELECT_COLOR,
|
||||
"色の選択")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SELECT_THEME,
|
||||
"テーマの選択")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME,
|
||||
"カスタムなテーマ")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_PATH_IS_BLANK,
|
||||
"ファイルのパスは空きです。")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY,
|
||||
"ファイルは空きです。")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED,
|
||||
"ファイルを読み込みのために開けません。")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST,
|
||||
"ファイルは存在しません。")
|
||||
|
@ -1057,6 +1057,8 @@ MSG_HASH(MENU_ENUM_LABEL_UI_COMPANION_ENABLE,
|
||||
"ui_companion_enable")
|
||||
MSG_HASH(MENU_ENUM_LABEL_UI_COMPANION_START_ON_BOOT,
|
||||
"ui_companion_start_on_boot")
|
||||
MSG_HASH(MENU_ENUM_LABEL_UI_COMPANION_TOGGLE,
|
||||
"ui_companion_toggle")
|
||||
MSG_HASH(MENU_ENUM_LABEL_UI_MENUBAR_ENABLE,
|
||||
"ui_menubar_enable")
|
||||
MSG_HASH(MENU_ENUM_LABEL_UNDO_LOAD_STATE,
|
||||
|
@ -871,6 +871,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE,
|
||||
"Grab mouse toggle")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE,
|
||||
"Game focus toggle")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE,
|
||||
"Desktop menu toggle")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY,
|
||||
"Load state")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE,
|
||||
@ -1657,6 +1659,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_ENABLE,
|
||||
"UI Companion Enable")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_START_ON_BOOT,
|
||||
"UI Companion Start On Boot")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_TOGGLE,
|
||||
"Show desktop menu on startup")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_MENUBAR_ENABLE,
|
||||
"Menubar")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_UNABLE_TO_READ_COMPRESSED_FILE,
|
||||
@ -2034,7 +2038,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_HELP_LIST,
|
||||
MSG_HASH(MSG_ADDED_TO_FAVORITES,
|
||||
"Added to favorites")
|
||||
MSG_HASH(MSG_RESET_CORE_ASSOCIATION,
|
||||
"Playlist entry core association has been reset.")
|
||||
"Playlist entry core association has been reset.")
|
||||
MSG_HASH(MSG_APPENDED_DISK,
|
||||
"Appended disk")
|
||||
MSG_HASH(MSG_APPLICATION_DIR,
|
||||
@ -3490,10 +3494,14 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE,
|
||||
"Enable border filler thickness")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE,
|
||||
"Enable background filler thickness")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION, "For 15 kHz CRT displays only. Attempts to use exact core/game resolution and refresh rate.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION, "CRT SwitchRes")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER, "When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER, "CRT Super Resolution")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION,
|
||||
"For 15 kHz CRT displays only. Attempts to use exact core/game resolution and refresh rate.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION,
|
||||
"CRT SwitchRes")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CRT_SWITCH_RESOLUTION_SUPER,
|
||||
"When CRT SwitchRes is enabled, force ultrawide horizontal resolution to minimize mode switching.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CRT_SWITCH_RESOLUTION_SUPER,
|
||||
"CRT Super Resolution")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_REWIND,
|
||||
"Show Rewind Settings")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_CONTENT_SHOW_REWIND,
|
||||
@ -3514,3 +3522,119 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MIXER_SETTINGS,
|
||||
"Mixer Settings")
|
||||
MSG_HASH(MENU_ENUM_SUBLABEL_AUDIO_MIXER_SETTINGS,
|
||||
"View and/or modify audio mixer settings.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_INFO,
|
||||
"Info")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE,
|
||||
"&File")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE,
|
||||
"&Load Core...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE,
|
||||
"&Unload Core")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT,
|
||||
"E&xit")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT,
|
||||
"&Edit")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT_SEARCH,
|
||||
"&Search")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW,
|
||||
"&View")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_CLOSED_DOCKS,
|
||||
"Closed Docks")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS,
|
||||
"&Options...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_DOCK_POSITIONS,
|
||||
"Remember dock positions:")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_GEOMETRY,
|
||||
"Remember window geometry:")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_LAST_TAB,
|
||||
"Remember last content browser tab:")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME,
|
||||
"Theme")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_SYSTEM_DEFAULT,
|
||||
"<System Default>")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_DARK,
|
||||
"Dark")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_CUSTOM,
|
||||
"Custom...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_TITLE,
|
||||
"Options")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOAD_CUSTOM_CORE,
|
||||
"Load Custom Core...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOAD_CORE,
|
||||
"Load Core")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOADING_CORE,
|
||||
"Loading Core...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_NAME,
|
||||
"Name")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE_VERSION,
|
||||
"Version")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS,
|
||||
"Playlists")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER,
|
||||
"File Browser")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_TOP,
|
||||
"Top")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_UP,
|
||||
"Up")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER,
|
||||
"Content Browser")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART,
|
||||
"Boxart")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT,
|
||||
"Screenshot")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN,
|
||||
"Title Screen")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ALL_PLAYLISTS,
|
||||
"All Playlists")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE,
|
||||
"Core")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE_INFO,
|
||||
"Core Info")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CORE_SELECTION_ASK,
|
||||
"<Ask me>")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_INFORMATION,
|
||||
"Information")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_WARNING,
|
||||
"Warning")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ERROR,
|
||||
"Error")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_RESTART_TO_TAKE_EFFECT,
|
||||
"Please restart the program for the changes to take effect.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_LOG,
|
||||
"Log")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED,
|
||||
"Scan Finished.<br><br>\n"
|
||||
"In order for content to be correctly scanned, you must:\n"
|
||||
"<ul><li>have a compatible core already downloaded</li>\n"
|
||||
"<li>have \"Core Info Files\" updated via Online Updater</li>\n"
|
||||
"<li>have \"Databases\" updated via Online Updater</li>\n"
|
||||
"<li>restart RetroArch if any of the above was just done</li></ul>\n"
|
||||
"Finally, the content must match existing databases from <a href=\"https://docs.libretro.com/guides/roms-playlists-thumbnails/#sources\">here</a>. If it is still not working, consider <a href=\"https://www.github.com/libretro/RetroArch/issues\">submitting a bug report</a>.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN,
|
||||
"Don't show this again")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_STOP,
|
||||
"Stop")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ASSOCIATE_CORE,
|
||||
"Associate Core")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_HIDDEN_PLAYLISTS,
|
||||
"Hidden Playlists")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_HIDE,
|
||||
"Hide")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_HIGHLIGHT_COLOR,
|
||||
"Highlight Color")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CHOOSE,
|
||||
"&Choose...")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SELECT_COLOR,
|
||||
"Select Color")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SELECT_THEME,
|
||||
"Select Theme")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME,
|
||||
"Custom Theme")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_PATH_IS_BLANK,
|
||||
"File path is blank.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY,
|
||||
"File is empty.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED,
|
||||
"Could not open file for reading.")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST,
|
||||
"File does not exist.")
|
||||
|
@ -57,8 +57,6 @@ static int generic_shader_action_parameter_right(struct video_shader_parameter *
|
||||
param->current += param->step;
|
||||
param->current = MIN(MAX(param->minimum, param->current), param->maximum);
|
||||
|
||||
if (ui_companion_is_on_foreground())
|
||||
ui_companion_driver_notify_refresh();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -74,7 +72,7 @@ int shader_action_parameter_right(unsigned type, const char *label, bool wraparo
|
||||
video_shader_driver_get_current_shader(&shader_info);
|
||||
|
||||
param_prev = &shader_info.data->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
|
||||
param_menu = shader ? &shader->parameters[type -
|
||||
param_menu = shader ? &shader->parameters[type -
|
||||
MENU_SETTINGS_SHADER_PARAMETER_0] : NULL;
|
||||
|
||||
if (!param_prev || !param_menu)
|
||||
@ -112,8 +110,8 @@ int action_right_input_desc_kbd(unsigned type, const char *label,
|
||||
if (!settings)
|
||||
return 0;
|
||||
|
||||
offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END -
|
||||
(MENU_SETTINGS_INPUT_DESC_KBD_END -
|
||||
offset = type / ((MENU_SETTINGS_INPUT_DESC_KBD_END -
|
||||
(MENU_SETTINGS_INPUT_DESC_KBD_END -
|
||||
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN))) - 1;
|
||||
|
||||
id = (type / (offset + 1)) - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
|
||||
@ -162,7 +160,7 @@ int action_right_input_desc(unsigned type, const char *label,
|
||||
|
||||
/* skip the not used buttons (unless they are at the end by calling the right desc function recursively
|
||||
also skip all the axes until analog remapping is implemented */
|
||||
if ((string_is_empty(system->input_desc_btn[user_idx][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END) /*||
|
||||
if ((string_is_empty(system->input_desc_btn[user_idx][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END) /*||
|
||||
(remap_idx >= RARCH_FIRST_CUSTOM_BIND && remap_idx < RARCH_CUSTOM_BIND_LIST_END)*/)
|
||||
action_right_input_desc(type, label, wraparound);
|
||||
|
||||
@ -230,7 +228,7 @@ static int action_right_goto_tab(void)
|
||||
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
||||
size_t selection = menu_navigation_get_selection();
|
||||
menu_file_list_cbs_t *cbs = selection_buf ? (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(selection_buf, selection) : NULL;
|
||||
file_list_get_actiondata_at_offset(selection_buf, selection) : NULL;
|
||||
|
||||
list_info.type = MENU_LIST_HORIZONTAL;
|
||||
list_info.action = MENU_ACTION_RIGHT;
|
||||
|
@ -2848,7 +2848,7 @@ static int menu_displaylist_parse_horizontal_content_actions(
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_RUN),
|
||||
MENU_ENUM_LABEL_RUN, FILE_TYPE_PLAYLIST_ENTRY, 0, idx);
|
||||
|
||||
if (settings->bools.playlist_entry_rename &&
|
||||
if (settings->bools.playlist_entry_rename &&
|
||||
!settings->bools.kiosk_mode_enable)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RENAME_ENTRY),
|
||||
@ -2856,7 +2856,7 @@ static int menu_displaylist_parse_horizontal_content_actions(
|
||||
MENU_ENUM_LABEL_RENAME_ENTRY,
|
||||
FILE_TYPE_PLAYLIST_ENTRY, 0, idx);
|
||||
|
||||
if (settings->bools.playlist_entry_remove &&
|
||||
if (settings->bools.playlist_entry_remove &&
|
||||
!settings->bools.kiosk_mode_enable)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY),
|
||||
@ -3413,20 +3413,20 @@ static int menu_displaylist_parse_playlists(
|
||||
MENU_ENUM_LABEL_SCAN_FILE,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
#endif
|
||||
if (settings->bools.menu_content_show_favorites)
|
||||
if (settings->bools.menu_content_show_favorites)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
|
||||
MENU_ENUM_LABEL_GOTO_FAVORITES,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
if (settings->bools.menu_content_show_images)
|
||||
if (settings->bools.menu_content_show_images)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_IMAGES),
|
||||
MENU_ENUM_LABEL_GOTO_IMAGES,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
if (settings->bools.menu_content_show_music)
|
||||
if (settings->bools.menu_content_show_music)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_MUSIC),
|
||||
@ -3434,7 +3434,7 @@ static int menu_displaylist_parse_playlists(
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
#ifdef HAVE_FFMPEG
|
||||
if (settings->bools.menu_content_show_video)
|
||||
if (settings->bools.menu_content_show_video)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO),
|
||||
@ -5550,7 +5550,11 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_UI_MENUBAR_ENABLE,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
|
||||
#ifdef HAVE_QT
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_UI_COMPANION_TOGGLE,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
#endif
|
||||
info->need_refresh = true;
|
||||
info->need_push = true;
|
||||
break;
|
||||
@ -6433,21 +6437,21 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
MENU_ENUM_LABEL_FAVORITES,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
if (settings->bools.menu_content_show_favorites)
|
||||
if (settings->bools.menu_content_show_favorites)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
|
||||
MENU_ENUM_LABEL_GOTO_FAVORITES,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
if (settings->bools.menu_content_show_images)
|
||||
if (settings->bools.menu_content_show_images)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_IMAGES),
|
||||
MENU_ENUM_LABEL_GOTO_IMAGES,
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
if (settings->bools.menu_content_show_music)
|
||||
if (settings->bools.menu_content_show_music)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_MUSIC),
|
||||
@ -6455,7 +6459,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
MENU_SETTING_ACTION, 0, 0);
|
||||
|
||||
#ifdef HAVE_FFMPEG
|
||||
if (settings->bools.menu_content_show_video)
|
||||
if (settings->bools.menu_content_show_video)
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO),
|
||||
@ -6626,7 +6630,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
||||
if (frontend_driver_has_fork())
|
||||
#endif
|
||||
{
|
||||
if (settings->bools.menu_show_load_core)
|
||||
if (settings->bools.menu_show_load_core)
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_CORE_LIST, PARSE_ACTION, false);
|
||||
}
|
||||
|
@ -4601,7 +4601,10 @@ static bool setting_append_list(
|
||||
{
|
||||
if (!input_config_bind_map_get_meta(i))
|
||||
continue;
|
||||
|
||||
#ifndef HAVE_QT
|
||||
if (i == RARCH_UI_COMPANION_TOGGLE)
|
||||
continue;
|
||||
#endif
|
||||
CONFIG_BIND_ALT(
|
||||
list, list_info,
|
||||
&input_config_binds[0][i],
|
||||
@ -5630,7 +5633,7 @@ static bool setting_append_list(
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, XMB_THEME_LAST-1, 1, true, true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -5804,20 +5807,20 @@ static bool setting_append_list(
|
||||
SD_FLAG_NONE);
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
|
||||
|
||||
CONFIG_STRING(
|
||||
list, list_info,
|
||||
settings->paths.menu_content_show_settings_password,
|
||||
sizeof(settings->paths.menu_content_show_settings_password),
|
||||
MENU_ENUM_LABEL_CONTENT_SHOW_SETTINGS_PASSWORD,
|
||||
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_SETTINGS_PASSWORD,
|
||||
"",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT | SD_FLAG_LAKKA_ADVANCED);
|
||||
}
|
||||
CONFIG_STRING(
|
||||
list, list_info,
|
||||
settings->paths.menu_content_show_settings_password,
|
||||
sizeof(settings->paths.menu_content_show_settings_password),
|
||||
MENU_ENUM_LABEL_CONTENT_SHOW_SETTINGS_PASSWORD,
|
||||
MENU_ENUM_LABEL_VALUE_CONTENT_SHOW_SETTINGS_PASSWORD,
|
||||
"",
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT | SD_FLAG_LAKKA_ADVANCED);
|
||||
}
|
||||
#endif
|
||||
|
||||
CONFIG_BOOL(
|
||||
@ -6054,7 +6057,7 @@ static bool setting_append_list(
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
menu_settings_list_current_add_range(list, list_info, 0, 3, 1, true, true);
|
||||
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.menu_xmb_vertical_thumbnails,
|
||||
@ -6516,8 +6519,22 @@ static bool setting_append_list(
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE);
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_QT
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.ui_companion_toggle,
|
||||
MENU_ENUM_LABEL_UI_COMPANION_TOGGLE,
|
||||
MENU_ENUM_LABEL_VALUE_UI_COMPANION_TOGGLE,
|
||||
ui_companion_toggle,
|
||||
MENU_ENUM_LABEL_VALUE_OFF,
|
||||
MENU_ENUM_LABEL_VALUE_ON,
|
||||
&group_info,
|
||||
&subgroup_info,
|
||||
parent_group,
|
||||
general_write_handler,
|
||||
general_read_handler,
|
||||
SD_FLAG_ADVANCED);
|
||||
#endif
|
||||
END_SUB_GROUP(list, list_info, parent_group);
|
||||
END_GROUP(list, list_info, parent_group);
|
||||
break;
|
||||
@ -6562,7 +6579,7 @@ static bool setting_append_list(
|
||||
|
||||
END_SUB_GROUP(list, list_info, parent_group);
|
||||
|
||||
START_SUB_GROUP(list, list_info, "Playlist", &group_info, &subgroup_info, parent_group);
|
||||
START_SUB_GROUP(list, list_info, "Playlist", &group_info, &subgroup_info, parent_group);
|
||||
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
@ -6579,7 +6596,7 @@ static bool setting_append_list(
|
||||
general_read_handler,
|
||||
SD_FLAG_NONE);
|
||||
|
||||
CONFIG_BOOL(
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.playlist_entry_remove,
|
||||
MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE,
|
||||
|
58
msg_hash.h
58
msg_hash.h
@ -630,6 +630,7 @@ enum msg_hash_enums
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE,
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE,
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_INPUT_DEVICE_INDEX,
|
||||
@ -806,6 +807,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(VIDEO_DISABLE_COMPOSITION),
|
||||
MENU_LABEL(UI_COMPANION_ENABLE),
|
||||
MENU_LABEL(UI_COMPANION_START_ON_BOOT),
|
||||
MENU_LABEL(UI_COMPANION_TOGGLE),
|
||||
MENU_LABEL(UI_MENUBAR_ENABLE),
|
||||
|
||||
MENU_ENUM_LABEL_FILE_CONFIG,
|
||||
@ -1770,6 +1772,62 @@ enum msg_hash_enums
|
||||
MENU_LABEL(NETPLAY_MITM_SERVER),
|
||||
MENU_LABEL(VIDEO_WINDOW_SHOW_DECORATIONS),
|
||||
|
||||
MENU_ENUM_LABEL_VALUE_QT_INFO,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_FILE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT_SEARCH,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_CLOSED_DOCKS,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_DOCK_POSITIONS,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_GEOMETRY,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_SAVE_LAST_TAB,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_SYSTEM_DEFAULT,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_DARK,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_THEME_CUSTOM,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_TITLE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS_HIGHLIGHT_COLOR,
|
||||
MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER,
|
||||
MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART,
|
||||
MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT,
|
||||
MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN,
|
||||
MENU_ENUM_LABEL_VALUE_QT_LOAD_CORE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_LOAD_CUSTOM_CORE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_LOADING_CORE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_NAME,
|
||||
MENU_ENUM_LABEL_VALUE_QT_CORE_VERSION,
|
||||
MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS,
|
||||
MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER,
|
||||
MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_TOP,
|
||||
MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_UP,
|
||||
MENU_ENUM_LABEL_VALUE_QT_ALL_PLAYLISTS,
|
||||
MENU_ENUM_LABEL_VALUE_QT_CORE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_CORE_INFO,
|
||||
MENU_ENUM_LABEL_VALUE_QT_CORE_SELECTION_ASK,
|
||||
MENU_ENUM_LABEL_VALUE_QT_INFORMATION,
|
||||
MENU_ENUM_LABEL_VALUE_QT_WARNING,
|
||||
MENU_ENUM_LABEL_VALUE_QT_ERROR,
|
||||
MENU_ENUM_LABEL_VALUE_QT_RESTART_TO_TAKE_EFFECT,
|
||||
MENU_ENUM_LABEL_VALUE_QT_LOG,
|
||||
MENU_ENUM_LABEL_VALUE_QT_SCAN_FINISHED,
|
||||
MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN,
|
||||
MENU_ENUM_LABEL_VALUE_QT_STOP,
|
||||
MENU_ENUM_LABEL_VALUE_QT_ASSOCIATE_CORE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_HIDDEN_PLAYLISTS,
|
||||
MENU_ENUM_LABEL_VALUE_QT_HIDE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_CHOOSE,
|
||||
MENU_ENUM_LABEL_VALUE_QT_SELECT_COLOR,
|
||||
MENU_ENUM_LABEL_VALUE_QT_SELECT_THEME,
|
||||
MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME,
|
||||
MENU_ENUM_LABEL_VALUE_QT_FILE_PATH_IS_BLANK,
|
||||
MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY,
|
||||
MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED,
|
||||
MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST,
|
||||
|
||||
MSG_LAST
|
||||
};
|
||||
|
||||
|
@ -270,6 +270,26 @@ check_val '' PULSE -lpulse
|
||||
check_val '' SDL -lSDL SDL
|
||||
check_val '' SDL2 -lSDL2 SDL2
|
||||
|
||||
if [ "$HAVE_QT" = "yes" ]; then
|
||||
check_pkgconf QT5CORE Qt5Core 5.2
|
||||
check_pkgconf QT5GUI Qt5Gui 5.2
|
||||
check_pkgconf QT5WIDGETS Qt5Widgets 5.2
|
||||
#check_pkgconf QT5WEBENGINE Qt5WebEngine 5.4
|
||||
|
||||
check_val '' QT5CORE -lQt5Core QT5CORE
|
||||
check_val '' QT5GUI -lQt5Gui QT5GUI
|
||||
check_val '' QT5WIDGETS -lQt5Widgets QT5WIDGETS
|
||||
#check_val '' QT5WEBENGINE -lQt5WebEngine QT5WEBENGINE
|
||||
|
||||
if [ "$HAVE_QT5CORE" = "no" ] || [ "$HAVE_QT5GUI" = "no" ] || [ "$HAVE_QT5WIDGETS" = "no" ]; then
|
||||
die 1 'Error: Qt support requested, but required libraries could not be found.'
|
||||
fi
|
||||
|
||||
#if [ "$HAVE_QT5WEBENGINE" = "no" ]; then
|
||||
# die : 'Notice: Qt5WebEngine not found, disabling web browser support.'
|
||||
#fi
|
||||
fi
|
||||
|
||||
if [ "$HAVE_SDL2" = 'yes' ] && [ "$HAVE_SDL" = 'yes' ]; then
|
||||
die : 'Notice: SDL drivers will be replaced by SDL2 ones.'
|
||||
HAVE_SDL=no
|
||||
|
@ -102,7 +102,6 @@ HAVE_PARPORT=auto # Parallel port joypad support
|
||||
HAVE_IMAGEVIEWER=yes # Built-in image viewer support.
|
||||
HAVE_MMAP=auto # MMAP support
|
||||
HAVE_QT=no # Qt companion support
|
||||
HAVE_QT_WRAPPER=no # Qt wrapper support
|
||||
HAVE_XSHM=no # XShm video driver support
|
||||
HAVE_CHEEVOS=yes # Retro Achievements
|
||||
HAVE_SHADERPIPELINE=yes # Additional shader-based pipelines
|
||||
|
@ -83,6 +83,15 @@ if [ "$OS" = "Win32" ]; then
|
||||
echo "$echobuf ... $WINDRES"
|
||||
fi
|
||||
|
||||
if [ "$HAVE_QT" = "yes" ]; then
|
||||
echobuf="Checking for moc"
|
||||
if [ -z "$MOC" ]; then
|
||||
MOC="$(exists "moc")" || MOC=""
|
||||
[ -z "$MOC" ] && die 1 "$echobuf ... Not found. Exiting."
|
||||
fi
|
||||
echo "$echobuf ... $MOC"
|
||||
fi
|
||||
|
||||
if [ -z "$PKG_CONF_PATH" ]; then
|
||||
PKG_CONF_PATH="none"
|
||||
for pkgconf in pkgconf pkg-config; do
|
||||
|
@ -226,6 +226,7 @@ create_config_make()
|
||||
[ "$USE_LANG_CXX" = 'yes' ] && printf %s\\n "CXX = $CXX" "CXXFLAGS = $CXXFLAGS"
|
||||
|
||||
printf %s\\n "WINDRES = $WINDRES" \
|
||||
"MOC = $MOC" \
|
||||
"ASFLAGS = $ASFLAGS" \
|
||||
"LDFLAGS = $LDFLAGS" \
|
||||
"INCLUDE_DIRS = $INCLUDE_DIRS" \
|
||||
|
61
retroarch.c
61
retroarch.c
@ -222,6 +222,7 @@ static bool rarch_ups_pref = false;
|
||||
static bool rarch_bps_pref = false;
|
||||
static bool rarch_ips_pref = false;
|
||||
static bool rarch_patch_blocked = false;
|
||||
static bool rarch_first_start = true;
|
||||
|
||||
static bool runloop_force_nonblock = false;
|
||||
static bool runloop_paused = false;
|
||||
@ -238,7 +239,9 @@ static bool runloop_remaps_game_active = false;
|
||||
static bool runloop_game_options_active = false;
|
||||
static bool runloop_missing_bios = false;
|
||||
static bool runloop_autosave = false;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
static bool core_set_on_cmdline = false;
|
||||
#endif
|
||||
static rarch_system_info_t runloop_system;
|
||||
static struct retro_frame_time_callback runloop_frame_time;
|
||||
static retro_keyboard_event_t runloop_key_event = NULL;
|
||||
@ -258,6 +261,13 @@ static retro_time_t frame_limit_last_time = 0.0;
|
||||
|
||||
extern bool input_driver_flushing_input;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
bool retroarch_core_set_on_cmdline(void)
|
||||
{
|
||||
return core_set_on_cmdline;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
void runloop_msg_queue_lock(void)
|
||||
{
|
||||
@ -864,6 +874,11 @@ static void retroarch_parse_input_and_config(int argc, char *argv[])
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (rarch_first_start)
|
||||
{
|
||||
core_set_on_cmdline = true;
|
||||
}
|
||||
|
||||
path_clear(RARCH_PATH_CORE);
|
||||
strlcpy(settings->paths.directory_libretro, optarg,
|
||||
sizeof(settings->paths.directory_libretro));
|
||||
@ -876,6 +891,11 @@ static void retroarch_parse_input_and_config(int argc, char *argv[])
|
||||
}
|
||||
else if (filestream_exists(optarg))
|
||||
{
|
||||
if (rarch_first_start)
|
||||
{
|
||||
core_set_on_cmdline = true;
|
||||
}
|
||||
|
||||
rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, optarg);
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL);
|
||||
|
||||
@ -1352,11 +1372,18 @@ bool retroarch_main_init(int argc, char *argv[])
|
||||
rarch_error_on_init = false;
|
||||
rarch_is_inited = true;
|
||||
|
||||
if (rarch_first_start)
|
||||
rarch_first_start = false;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
command_event(CMD_EVENT_CORE_DEINIT, NULL);
|
||||
rarch_is_inited = false;
|
||||
|
||||
if (rarch_first_start)
|
||||
rarch_first_start = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1821,8 +1848,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
if (!idx)
|
||||
return false;
|
||||
core_option_manager_prev(runloop_core_options, *idx);
|
||||
if (ui_companion_is_on_foreground())
|
||||
ui_companion_driver_notify_refresh();
|
||||
}
|
||||
break;
|
||||
case RARCH_CTL_CORE_OPTION_NEXT:
|
||||
@ -1831,8 +1856,6 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
||||
if (!idx)
|
||||
return false;
|
||||
core_option_manager_next(runloop_core_options, *idx);
|
||||
if (ui_companion_is_on_foreground())
|
||||
ui_companion_driver_notify_refresh();
|
||||
}
|
||||
break;
|
||||
case RARCH_CTL_CORE_OPTIONS_GET:
|
||||
@ -2322,13 +2345,8 @@ void runloop_msg_queue_push(const char *msg,
|
||||
msg_queue_push(runloop_msg_queue, msg_info.msg,
|
||||
msg_info.prio, msg_info.duration);
|
||||
|
||||
if (ui_companion_is_on_foreground())
|
||||
{
|
||||
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
||||
if (ui->msg_queue_push)
|
||||
ui->msg_queue_push(msg_info.msg,
|
||||
msg_info.prio, msg_info.duration, msg_info.flush);
|
||||
}
|
||||
ui_companion_driver_msg_queue_push(msg_info.msg,
|
||||
msg_info.prio, msg_info.duration, msg_info.flush);
|
||||
}
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
@ -2452,10 +2470,10 @@ static enum runloop_state runloop_check_state(
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (menu_is_alive && !(settings->bools.menu_unified_controls && !menu_input_dialog_get_display_kb()))
|
||||
input_menu_keys_pressed(settings, ¤t_input);
|
||||
input_menu_keys_pressed(settings, ¤t_input);
|
||||
else
|
||||
#endif
|
||||
input_keys_pressed(settings, ¤t_input);
|
||||
input_keys_pressed(settings, ¤t_input);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
last_input = current_input;
|
||||
@ -2659,7 +2677,6 @@ static enum runloop_state runloop_check_state(
|
||||
if (runloop_idle)
|
||||
return RUNLOOP_STATE_SLEEP;
|
||||
|
||||
|
||||
/* Check game focus toggle */
|
||||
{
|
||||
static bool old_pressed = false;
|
||||
@ -2672,6 +2689,20 @@ static enum runloop_state runloop_check_state(
|
||||
old_pressed = pressed;
|
||||
}
|
||||
|
||||
/* Check UI companion toggle */
|
||||
{
|
||||
static bool old_pressed = false;
|
||||
bool pressed = BIT256_GET(
|
||||
current_input, RARCH_UI_COMPANION_TOGGLE);
|
||||
|
||||
if (pressed && !old_pressed)
|
||||
{
|
||||
command_event(CMD_EVENT_UI_COMPANION_TOGGLE, (void*)(intptr_t)0);
|
||||
}
|
||||
|
||||
old_pressed = pressed;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
/* Check menu toggle */
|
||||
{
|
||||
|
@ -729,6 +729,9 @@ video_message_bgcolor_opacity = 1.0
|
||||
# Start UI companion driver's interface on boot (if available).
|
||||
# ui_companion_start_on_boot = true
|
||||
|
||||
# Toggle companion UI on startup (currently only used to show the WIMP UI)
|
||||
# ui_companion_toggle = false
|
||||
|
||||
#### Camera
|
||||
|
||||
# Override the default camera device the camera driver uses. This is driver dependant.
|
||||
|
@ -357,6 +357,10 @@ void runloop_msg_queue_lock(void);
|
||||
void runloop_msg_queue_unlock(void);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
bool retroarch_core_set_on_cmdline(void);
|
||||
#endif
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "../retroarch.h"
|
||||
#endif
|
||||
#include "../verbosity.h"
|
||||
|
||||
#include "../ui/ui_companion_driver.h"
|
||||
#ifndef COLLECTION_SIZE
|
||||
#define COLLECTION_SIZE 99999
|
||||
#endif
|
||||
@ -1264,6 +1264,7 @@ static void task_database_handler(retro_task_t *task)
|
||||
#else
|
||||
fprintf(stderr, "msg: %s\n", msg);
|
||||
#endif
|
||||
ui_companion_driver_notify_refresh();
|
||||
goto task_finished;
|
||||
}
|
||||
break;
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "cocoa_common.h"
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static bool ui_application_cocoa_initialize(void)
|
||||
static void* ui_application_cocoa_initialize(void)
|
||||
{
|
||||
return true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool ui_application_cocoa_pending_events(void)
|
||||
@ -49,9 +49,16 @@ static void ui_application_cocoa_process_events(void)
|
||||
}
|
||||
}
|
||||
|
||||
const ui_application_t ui_application_cocoa = {
|
||||
static void ui_application_cocoa_run(void *args)
|
||||
{
|
||||
(void)args;
|
||||
}
|
||||
|
||||
ui_application_t ui_application_cocoa = {
|
||||
ui_application_cocoa_initialize,
|
||||
ui_application_cocoa_pending_events,
|
||||
ui_application_cocoa_process_events,
|
||||
ui_application_cocoa_run,
|
||||
NULL,
|
||||
"cocoa"
|
||||
};
|
||||
|
@ -60,7 +60,7 @@ static bool ui_browser_window_cocoa_save(ui_browser_window_state_t *state)
|
||||
return false;
|
||||
}
|
||||
|
||||
const ui_browser_window_t ui_browser_window_cocoa = {
|
||||
ui_browser_window_t ui_browser_window_cocoa = {
|
||||
ui_browser_window_cocoa_open,
|
||||
ui_browser_window_cocoa_save,
|
||||
"cocoa"
|
||||
|
@ -129,7 +129,7 @@ static enum ui_msg_window_response ui_msg_window_cocoa_warning(ui_msg_window_sta
|
||||
return ui_msg_window_cocoa_dialog(state, UI_MSG_WINDOW_TYPE_WARNING);
|
||||
}
|
||||
|
||||
const ui_msg_window_t ui_msg_window_cocoa = {
|
||||
ui_msg_window_t ui_msg_window_cocoa = {
|
||||
ui_msg_window_cocoa_error,
|
||||
ui_msg_window_cocoa_information,
|
||||
ui_msg_window_cocoa_question,
|
||||
|
@ -25,6 +25,11 @@
|
||||
#include "../ui_cocoa.h"
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static void* ui_window_cocoa_init(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ui_window_cocoa_destroy(void *data)
|
||||
{
|
||||
ui_window_cocoa_t *cocoa = (ui_window_cocoa_t*)data;
|
||||
@ -82,7 +87,8 @@ static bool ui_window_cocoa_focused(void *data)
|
||||
return false;
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_cocoa = {
|
||||
ui_window_t ui_window_cocoa = {
|
||||
ui_window_cocoa_init,
|
||||
ui_window_cocoa_destroy,
|
||||
ui_window_cocoa_set_focused,
|
||||
ui_window_cocoa_set_visible,
|
||||
|
@ -21,9 +21,9 @@
|
||||
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static bool ui_application_null_initialize(void)
|
||||
static void* ui_application_null_initialize(void)
|
||||
{
|
||||
return true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool ui_application_null_pending_events(void)
|
||||
@ -35,9 +35,16 @@ static void ui_application_null_process_events(void)
|
||||
{
|
||||
}
|
||||
|
||||
const ui_application_t ui_application_null = {
|
||||
static void ui_application_null_run(void *args)
|
||||
{
|
||||
(void)args;
|
||||
}
|
||||
|
||||
ui_application_t ui_application_null = {
|
||||
ui_application_null_initialize,
|
||||
ui_application_null_pending_events,
|
||||
ui_application_null_process_events,
|
||||
ui_application_null_run,
|
||||
NULL,
|
||||
"null"
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ static bool ui_browser_window_null_save(ui_browser_window_state_t *state)
|
||||
return false;
|
||||
}
|
||||
|
||||
const ui_browser_window_t ui_browser_window_null = {
|
||||
ui_browser_window_t ui_browser_window_null = {
|
||||
ui_browser_window_null_open,
|
||||
ui_browser_window_null_save,
|
||||
"null"
|
||||
|
@ -41,7 +41,7 @@ static enum ui_msg_window_response ui_msg_window_null_warning(ui_msg_window_stat
|
||||
return UI_MSG_RESPONSE_CANCEL;
|
||||
}
|
||||
|
||||
const ui_msg_window_t ui_msg_window_null = {
|
||||
ui_msg_window_t ui_msg_window_null = {
|
||||
ui_msg_window_null_error,
|
||||
ui_msg_window_null_information,
|
||||
ui_msg_window_null_question,
|
||||
|
@ -21,6 +21,11 @@
|
||||
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static void* ui_window_null_init(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ui_window_null_destroy(void *data)
|
||||
{
|
||||
}
|
||||
@ -47,7 +52,8 @@ static bool ui_window_null_focused(void *data)
|
||||
return true;
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_null = {
|
||||
ui_window_t ui_window_null = {
|
||||
ui_window_null_init,
|
||||
ui_window_null_destroy,
|
||||
ui_window_null_set_focused,
|
||||
ui_window_null_set_visible,
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -13,20 +14,130 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QApplication>
|
||||
|
||||
extern "C" {
|
||||
#include "../../ui_companion_driver.h"
|
||||
#include "../../../retroarch.h"
|
||||
#include "../../../verbosity.h"
|
||||
#include "../../../version.h"
|
||||
#include "../../../frontend/frontend.h"
|
||||
#include "../../../tasks/tasks_internal.h"
|
||||
#include <retro_timers.h>
|
||||
}
|
||||
|
||||
static bool ui_application_qt_initialize(void)
|
||||
#include "../ui_qt.h"
|
||||
|
||||
static AppHandler *appHandler;
|
||||
static ui_application_qt_t ui_application;
|
||||
static bool app_exiting = false;
|
||||
|
||||
/* these must last for the lifetime of the QApplication */
|
||||
static int app_argc = 1;
|
||||
static char app_name[] = "retroarch";
|
||||
static char *app_argv[] = { app_name, NULL };
|
||||
|
||||
static const unsigned retroarch_qt_icon_data[] = {
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x000000ff, 0xffffffff,
|
||||
0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0xffffffff, 0x000000ff,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0x000000ff, 0xffffffff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff,
|
||||
0x000000ff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0xffffffff, 0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xffffffff, 0x000000ff, 0x000000ff, 0x000000ff,
|
||||
0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x000000ff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x000000ff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0x000000ff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||
};
|
||||
|
||||
AppHandler::AppHandler(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
AppHandler::~AppHandler()
|
||||
{
|
||||
}
|
||||
|
||||
void AppHandler::exit()
|
||||
{
|
||||
app_exiting = true;
|
||||
qApp->closeAllWindows();
|
||||
}
|
||||
|
||||
bool AppHandler::isExiting() const
|
||||
{
|
||||
return app_exiting;
|
||||
}
|
||||
|
||||
void AppHandler::onLastWindowClosed()
|
||||
{
|
||||
}
|
||||
|
||||
static void* ui_application_qt_initialize(void)
|
||||
{
|
||||
appHandler = new AppHandler();
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||
/* HiDpi supported since Qt 5.6 */
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
#endif
|
||||
|
||||
QApplication::setStyle("fusion");
|
||||
|
||||
ui_application.app = new QApplication(app_argc, app_argv);
|
||||
ui_application.app->setOrganizationName("libretro");
|
||||
ui_application.app->setApplicationName("RetroArch");
|
||||
ui_application.app->setApplicationVersion(PACKAGE_VERSION);
|
||||
ui_application.app->connect(ui_application.app, SIGNAL(lastWindowClosed()), appHandler, SLOT(onLastWindowClosed()));
|
||||
|
||||
{
|
||||
/* Can't declare the pixmap at the top, because: "QPixmap: Must construct a QGuiApplication before a QPixmap" */
|
||||
QImage iconImage(16, 16, QImage::Format_ARGB32);
|
||||
QPixmap iconPixmap;
|
||||
unsigned char *bits = iconImage.bits();
|
||||
|
||||
memcpy(bits, retroarch_qt_icon_data, 16 * 16 * sizeof(unsigned));
|
||||
|
||||
iconPixmap = QPixmap::fromImage(iconImage);
|
||||
|
||||
ui_application.app->setWindowIcon(QIcon(iconPixmap));
|
||||
}
|
||||
|
||||
return &ui_application;
|
||||
}
|
||||
|
||||
static bool ui_application_qt_pending_events(void)
|
||||
@ -36,13 +147,58 @@ static bool ui_application_qt_pending_events(void)
|
||||
|
||||
static void ui_application_qt_process_events(void)
|
||||
{
|
||||
while(ui_application_qt_pending_events())
|
||||
if(ui_application_qt_pending_events())
|
||||
QApplication::processEvents();
|
||||
}
|
||||
|
||||
const ui_application_t ui_application_qt = {
|
||||
static void ui_application_qt_quit(void)
|
||||
{
|
||||
appHandler->exit();
|
||||
}
|
||||
|
||||
static void ui_application_qt_run(void *args)
|
||||
{
|
||||
#ifdef HAVE_MAIN
|
||||
int ret;
|
||||
unsigned sleep_ms = 0;
|
||||
|
||||
do
|
||||
{
|
||||
ui_application_qt_process_events();
|
||||
|
||||
ret = runloop_iterate(&sleep_ms);
|
||||
|
||||
if (ret == 1 && sleep_ms > 0)
|
||||
retro_sleep(sleep_ms);
|
||||
|
||||
task_queue_check();
|
||||
|
||||
if (ret == -1 || app_exiting)
|
||||
{
|
||||
ui_application_qt_quit();
|
||||
break;
|
||||
}
|
||||
}while(1);
|
||||
|
||||
main_exit(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_MAIN
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return rarch_main(argc, argv, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
ui_application_t ui_application_qt = {
|
||||
ui_application_qt_initialize,
|
||||
ui_application_qt_pending_events,
|
||||
ui_application_qt_process_events,
|
||||
ui_application_qt_run,
|
||||
ui_application_qt_quit,
|
||||
"qt"
|
||||
};
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -34,7 +35,7 @@ static bool ui_browser_window_qt_save(ui_browser_window_state_t *state)
|
||||
return false;
|
||||
}
|
||||
|
||||
const ui_browser_window_t ui_browser_window_qt = {
|
||||
ui_browser_window_t ui_browser_window_qt = {
|
||||
ui_browser_window_qt_open,
|
||||
ui_browser_window_qt_save,
|
||||
"qt"
|
||||
|
283
ui/drivers/qt/ui_qt_load_core_window.cpp
Normal file
283
ui/drivers/qt/ui_qt_load_core_window.cpp
Normal file
@ -0,0 +1,283 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ui_qt_load_core_window.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
extern "C" {
|
||||
#include "../../../core_info.h"
|
||||
#include "../../../verbosity.h"
|
||||
#include "../../../configuration.h"
|
||||
#include "../../../msg_hash.h"
|
||||
#include "../../../retroarch.h"
|
||||
#include "../../../command.h"
|
||||
#include "../../../frontend/frontend_driver.h"
|
||||
#include <string/stdstring.h>
|
||||
#include <file/file_path.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
};
|
||||
|
||||
#define CORE_NAME_COLUMN 0
|
||||
#define CORE_VERSION_COLUMN 1
|
||||
|
||||
LoadCoreTableWidget::LoadCoreTableWidget(QWidget *parent) :
|
||||
QTableWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void LoadCoreTableWidget::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
|
||||
{
|
||||
event->accept();
|
||||
emit enterPressed();
|
||||
}
|
||||
else
|
||||
QTableWidget::keyPressEvent(event);
|
||||
}
|
||||
|
||||
LoadCoreWindow::LoadCoreWindow(QWidget *parent) :
|
||||
QMainWindow(parent)
|
||||
,m_layout()
|
||||
,m_table(new LoadCoreTableWidget())
|
||||
,m_statusLabel(new QLabel())
|
||||
{
|
||||
QHBoxLayout *hbox = new QHBoxLayout();
|
||||
QPushButton *customCoreButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CUSTOM_CORE));
|
||||
|
||||
connect(customCoreButton, SIGNAL(clicked()), this, SLOT(onLoadCustomCoreClicked()));
|
||||
connect(m_table, SIGNAL(enterPressed()), this, SLOT(onCoreEnterPressed()));
|
||||
connect(m_table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(onCellDoubleClicked(int,int)));
|
||||
|
||||
setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CORE));
|
||||
|
||||
setCentralWidget(new QWidget());
|
||||
|
||||
centralWidget()->setLayout(&m_layout);
|
||||
|
||||
hbox->addWidget(customCoreButton);
|
||||
hbox->addItem(new QSpacerItem(width(), 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
|
||||
|
||||
m_layout.addWidget(m_table);
|
||||
m_layout.addLayout(hbox);
|
||||
|
||||
statusBar()->addPermanentWidget(m_statusLabel);
|
||||
}
|
||||
|
||||
void LoadCoreWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
emit windowClosed();
|
||||
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void LoadCoreWindow::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Escape)
|
||||
{
|
||||
event->accept();
|
||||
close();
|
||||
}
|
||||
else
|
||||
QMainWindow::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void LoadCoreWindow::setStatusLabel(QString label)
|
||||
{
|
||||
m_statusLabel->setText(label);
|
||||
}
|
||||
|
||||
void LoadCoreWindow::onCellDoubleClicked(int, int)
|
||||
{
|
||||
onCoreEnterPressed();
|
||||
}
|
||||
|
||||
void LoadCoreWindow::loadCore(const char *path)
|
||||
{
|
||||
QProgressDialog progress(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOADING_CORE), QString(), 0, 0, this);
|
||||
progress.setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CORE));
|
||||
progress.setMinimumDuration(0);
|
||||
progress.setValue(progress.minimum());
|
||||
progress.show();
|
||||
|
||||
/* Because core loading will block, we need to go ahead and process pending events that would allow the progress dialog to fully show its contents before actually starting the core loading process. Must call processEvents() twice. */
|
||||
qApp->processEvents();
|
||||
qApp->processEvents();
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
/* const-removing cast is safe here because the path is never written to */
|
||||
rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, const_cast<char*>(path));
|
||||
|
||||
if (!command_event(CMD_EVENT_LOAD_CORE, NULL))
|
||||
{
|
||||
QMessageBox::critical(this, msg_hash_to_str(MSG_ERROR), msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE));
|
||||
return;
|
||||
}
|
||||
|
||||
setProperty("last_launch_with_index", -1);
|
||||
|
||||
emit coreLoaded();
|
||||
#endif
|
||||
}
|
||||
|
||||
void LoadCoreWindow::onCoreEnterPressed()
|
||||
{
|
||||
QTableWidgetItem *selectedCoreItem = NULL;
|
||||
QString path;
|
||||
QByteArray pathArray;
|
||||
const char *pathData = NULL;
|
||||
QVariantHash hash;
|
||||
|
||||
selectedCoreItem = m_table->item(m_table->currentRow(), CORE_NAME_COLUMN);
|
||||
hash = selectedCoreItem->data(Qt::UserRole).toHash();
|
||||
path = hash["path"].toString();
|
||||
|
||||
pathArray.append(path);
|
||||
pathData = pathArray.constData();
|
||||
|
||||
loadCore(pathData);
|
||||
}
|
||||
|
||||
void LoadCoreWindow::onLoadCustomCoreClicked()
|
||||
{
|
||||
QString path;
|
||||
QByteArray pathArray;
|
||||
settings_t *settings = config_get_ptr();
|
||||
char core_ext[255] = {0};
|
||||
char filters[PATH_MAX_LENGTH] = {0};
|
||||
const char *pathData = NULL;
|
||||
|
||||
frontend_driver_get_core_extension(core_ext, sizeof(core_ext));
|
||||
|
||||
strlcpy(filters, "Cores (*.", sizeof(filters));
|
||||
strlcat(filters, core_ext, sizeof(filters));
|
||||
strlcat(filters, ");;All Files (*.*)", sizeof(filters));
|
||||
|
||||
path = QFileDialog::getOpenFileName(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CORE), settings->paths.directory_libretro, filters, NULL);
|
||||
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
pathArray.append(path);
|
||||
pathData = pathArray.constData();
|
||||
|
||||
loadCore(pathData);
|
||||
}
|
||||
|
||||
void LoadCoreWindow::initCoreList(const QStringList &extensionFilters)
|
||||
{
|
||||
core_info_list_t *cores = NULL;
|
||||
QStringList horizontal_header_labels;
|
||||
QDesktopWidget *desktop = qApp->desktop();
|
||||
QRect desktopRect = desktop->availableGeometry();
|
||||
unsigned i = 0;
|
||||
int j = 0;
|
||||
|
||||
horizontal_header_labels << msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NAME);
|
||||
horizontal_header_labels << msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CORE_VERSION);
|
||||
|
||||
core_info_get_list(&cores);
|
||||
|
||||
m_table->clear();
|
||||
m_table->setColumnCount(0);
|
||||
m_table->setRowCount(0);
|
||||
m_table->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
m_table->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
m_table->setSortingEnabled(false);
|
||||
m_table->setRowCount(cores->count);
|
||||
m_table->setColumnCount(2);
|
||||
m_table->setHorizontalHeaderLabels(horizontal_header_labels);
|
||||
|
||||
for (i = 0; i < cores->count; i++)
|
||||
{
|
||||
core_info_t *core = core_info_get(cores, i);
|
||||
QTableWidgetItem *name_item = NULL;
|
||||
QTableWidgetItem *version_item = new QTableWidgetItem(core->display_version);
|
||||
QVariantHash hash;
|
||||
const char *name = core->display_name;
|
||||
|
||||
if (string_is_empty(name))
|
||||
name = path_basename(core->path);
|
||||
|
||||
name_item = new QTableWidgetItem(name);
|
||||
|
||||
hash["path"] = core->path;
|
||||
hash["extensions"] = QString(core->supported_extensions).split("|");
|
||||
|
||||
name_item->setData(Qt::UserRole, hash);
|
||||
name_item->setFlags(name_item->flags() & ~Qt::ItemIsEditable);
|
||||
version_item->setFlags(version_item->flags() & ~Qt::ItemIsEditable);
|
||||
|
||||
m_table->setItem(i, CORE_NAME_COLUMN, name_item);
|
||||
m_table->setItem(i, CORE_VERSION_COLUMN, version_item);
|
||||
}
|
||||
|
||||
if (!extensionFilters.isEmpty())
|
||||
{
|
||||
QVector<int> rowsToHide;
|
||||
|
||||
for (j = 0; j < m_table->rowCount(); j++)
|
||||
{
|
||||
bool found = false;
|
||||
QTableWidgetItem *item = m_table->item(j, CORE_NAME_COLUMN);
|
||||
QVariantHash hash;
|
||||
QStringList extensions;
|
||||
int k = 0;
|
||||
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
hash = item->data(Qt::UserRole).toHash();
|
||||
extensions = hash["extensions"].toStringList();
|
||||
|
||||
if (!extensions.isEmpty())
|
||||
{
|
||||
for (k = 0; k < extensions.size(); k++)
|
||||
{
|
||||
QString ext = extensions.at(k).toLower();
|
||||
|
||||
if (extensionFilters.contains(ext, Qt::CaseInsensitive))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
rowsToHide.append(j);
|
||||
}
|
||||
}
|
||||
|
||||
if (rowsToHide.size() != m_table->rowCount())
|
||||
{
|
||||
foreach (const int &row, rowsToHide)
|
||||
{
|
||||
m_table->setRowHidden(row, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_table->setSortingEnabled(true);
|
||||
m_table->resizeColumnsToContents();
|
||||
m_table->sortByColumn(0, Qt::AscendingOrder);
|
||||
m_table->selectRow(0);
|
||||
m_table->setAlternatingRowColors(true);
|
||||
|
||||
resize(qMin(desktopRect.width(), contentsMargins().left() + m_table->horizontalHeader()->length() + contentsMargins().right()), height());
|
||||
}
|
67
ui/drivers/qt/ui_qt_load_core_window.h
Normal file
67
ui/drivers/qt/ui_qt_load_core_window.h
Normal file
@ -0,0 +1,67 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _QT_LOAD_CORE_WINDOW_H
|
||||
#define _QT_LOAD_CORE_WINDOW_H
|
||||
|
||||
extern "C" {
|
||||
#include <retro_common_api.h>
|
||||
}
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
class LoadCoreTableWidget : public QTableWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LoadCoreTableWidget(QWidget *parent = NULL);
|
||||
signals:
|
||||
void enterPressed();
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
};
|
||||
|
||||
class LoadCoreWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LoadCoreWindow(QWidget *parent = 0);
|
||||
void initCoreList(const QStringList &extensionFilters = QStringList());
|
||||
void setStatusLabel(QString label);
|
||||
signals:
|
||||
void coreLoaded();
|
||||
void windowClosed();
|
||||
private slots:
|
||||
void onLoadCustomCoreClicked();
|
||||
void onCoreEnterPressed();
|
||||
void onCellDoubleClicked(int row, int column);
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
private:
|
||||
void loadCore(const char *path);
|
||||
|
||||
QVBoxLayout m_layout;
|
||||
LoadCoreTableWidget *m_table;
|
||||
QLabel *m_statusLabel;
|
||||
};
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -97,7 +98,7 @@ static enum ui_msg_window_response ui_msg_window_qt_warning(ui_msg_window_state
|
||||
return ui_msg_window_qt_response(state, QMessageBox::warning((QWidget*)state->window, state->title, state->text, flags));
|
||||
}
|
||||
|
||||
const ui_msg_window_t ui_msg_window_qt = {
|
||||
ui_msg_window_t ui_msg_window_qt = {
|
||||
ui_msg_window_qt_error,
|
||||
ui_msg_window_qt_information,
|
||||
ui_msg_window_qt_question,
|
||||
|
356
ui/drivers/qt/ui_qt_themes.h
Normal file
356
ui/drivers/qt/ui_qt_themes.h
Normal file
@ -0,0 +1,356 @@
|
||||
#include <QString>
|
||||
|
||||
/* %1 is a placeholder for palette(highlight) or the equivalent chosen by the user */
|
||||
static const QString qt_theme_default_stylesheet = QStringLiteral("");
|
||||
|
||||
static const QString qt_theme_dark_stylesheet = QStringLiteral(""
|
||||
"QWidget {\n"
|
||||
" color:white;\n"
|
||||
" background-color:rgb(53,53,53);\n"
|
||||
" selection-background-color:%1;\n"
|
||||
"}\n"
|
||||
"QWidget#playlistWidget, QWidget#browserWidget, QWidget#tableWidget, QWidget#logWidget {\n"
|
||||
" background-color:rgb(66,66,66);\n"
|
||||
" border-top:1px solid rgba(175,175,175,50%);\n"
|
||||
" border-left:1px solid rgba(125,125,125,50%);\n"
|
||||
" border-right:1px solid rgba(125,125,125,50%);\n"
|
||||
" border-bottom:1px solid rgba(25,25,25,75%);\n"
|
||||
"}\n"
|
||||
"QToolTip {\n"
|
||||
" color:white;\n"
|
||||
" background-color:rgb(53,53,53);\n"
|
||||
" border:1px solid rgb(80,80,80);\n"
|
||||
" border-radius:4px;\n"
|
||||
"}\n"
|
||||
"QMenuBar {\n"
|
||||
" background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border-bottom:2px solid rgba(25,25,25,75);\n"
|
||||
"}\n"
|
||||
"QMenuBar::item {\n"
|
||||
" spacing:2px;\n"
|
||||
" padding:3px 4px;\n"
|
||||
" background-color:transparent;\n"
|
||||
"}\n"
|
||||
"QMenuBar::item:selected {\n"
|
||||
" background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(106,106,106,255),stop:1 rgba(106,106,106,75));\n"
|
||||
" border:1px solid %1;\n"
|
||||
"}\n"
|
||||
"QMenuBar::item:pressed {\n"
|
||||
" background-color:%1;\n"
|
||||
" border-left:1px solid rgba(25,25,25,127);\n"
|
||||
" border-right:1px solid rgba(25,25,25,127);\n"
|
||||
"}\n"
|
||||
"QMenu {\n"
|
||||
" background-color:rgb(45,45,45);\n"
|
||||
" border:1px solid palette(shadow);\n"
|
||||
"}\n"
|
||||
"QMenu::item {\n"
|
||||
" padding:3px 25px 3px 25px;\n"
|
||||
" border:1px solid transparent;\n"
|
||||
"}\n"
|
||||
"QMenu::item:disabled {\n"
|
||||
" color:rgb(127,127,127);\n"
|
||||
"}\n"
|
||||
"QMenu::item:selected {\n"
|
||||
" border-color:rgba(200,200,200,127);\n"
|
||||
" background-color:%1;\n"
|
||||
"}\n"
|
||||
"QMenu::icon:checked {\n"
|
||||
" background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:2px;\n"
|
||||
"}\n"
|
||||
"QMenu::separator {\n"
|
||||
" height:1px;\n"
|
||||
" background-color:rgb(100,100,100);\n"
|
||||
" margin-left:5px;\n"
|
||||
" margin-right:5px;\n"
|
||||
"}\n"
|
||||
"QMenu::indicator {\n"
|
||||
" width:18px;\n"
|
||||
" height:18px;\n"
|
||||
"}\n"
|
||||
"QToolBar::top {\n"
|
||||
" background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border-bottom:3px solid qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
"}\n"
|
||||
"QToolBar::bottom {\n"
|
||||
" background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border-top:3px solid qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
"}\n"
|
||||
"QToolBar::left {\n"
|
||||
" background-color:qlineargradient(x1:0,y1:0,x2:1,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border-right:3px solid qlineargradient(x1:0,y1:0,x2:1,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
"}\n"
|
||||
"QToolBar::right {\n"
|
||||
" background-color:qlineargradient(x1:1,y1:0,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border-left:3px solid qlineargradient(x1:1,y1:0,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
"}\n"
|
||||
"QMainWindow {\n"
|
||||
" background-color:rgb(53,53,53);\n"
|
||||
"}\n"
|
||||
"QMainWindow::separator {\n"
|
||||
" width:6px;\n"
|
||||
" height:5px;\n"
|
||||
" padding:2px;\n"
|
||||
" background-color:rgba(25,25,25,50%);\n"
|
||||
"}\n"
|
||||
"QLineEdit {\n"
|
||||
" color:white;\n"
|
||||
" background-color:rgb(25,25,25);\n"
|
||||
"}\n"
|
||||
"QLineEdit::focus {\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:3px;\n"
|
||||
" color:white;\n"
|
||||
" background-color:rgb(25,25,25);\n"
|
||||
"}\n"
|
||||
"QSplitter::handle:horizontal {\n"
|
||||
" width:10px;\n"
|
||||
"}\n"
|
||||
"QSplitter::handle:vertical {\n"
|
||||
" height:10px;\n"
|
||||
"}\n"
|
||||
"QMainWindow::separator:hover, QSplitter::handle:hover {\n"
|
||||
"}\n"
|
||||
"QDockWidget::title {\n"
|
||||
" padding:4px;\n"
|
||||
" background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,175),stop:1 rgba(53,53,53,75));\n"
|
||||
" border:1px solid rgba(25,25,25,75);\n"
|
||||
" border-top:1px solid rgba(175,175,175,50%);\n"
|
||||
" border-bottom:1px solid rgba(25,25,25,127);\n"
|
||||
"}\n"
|
||||
"QDockWidget::close-button, QDockWidget::float-button {\n"
|
||||
" subcontrol-position:top right;\n"
|
||||
" subcontrol-origin:margin;\n"
|
||||
" position:absolute;\n"
|
||||
" top:3px;\n"
|
||||
" bottom:0px;\n"
|
||||
" width:20px;\n"
|
||||
" height:20px;\n"
|
||||
"}\n"
|
||||
"QDockWidget::close-button:hover, QDockWidget::float-button:hover {\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:4px;\n"
|
||||
"}\n"
|
||||
"QDockWidget::close-button {\n"
|
||||
" right:3px;\n"
|
||||
"}\n"
|
||||
"QDockWidget::float-button {\n"
|
||||
" right:25px;\n"
|
||||
"}\n"
|
||||
"QGroupBox {\n"
|
||||
" background-color:rgba(66,66,66,50%);\n"
|
||||
" margin-top:27px;\n"
|
||||
" border:1px solid rgba(25,25,25,127);\n"
|
||||
" border-top-left-radius:4px;\n"
|
||||
" border-top-right-radius:4px;\n"
|
||||
"}\n"
|
||||
"QGroupBox::title {\n"
|
||||
" subcontrol-origin:margin;\n"
|
||||
" subcontrol-position:left top;\n"
|
||||
" padding:4px 6px;\n"
|
||||
" margin-left:3px;\n"
|
||||
" background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border:1px solid rgba(25,25,25,75);\n"
|
||||
" border-top-left-radius:4px;\n"
|
||||
" border-top-right-radius:4px;\n"
|
||||
"}\n"
|
||||
"QTabWidget::pane {\n"
|
||||
" background-color:rgba(66,66,66,50%);\n"
|
||||
"}\n"
|
||||
"QTabWidget::tab-bar {\n"
|
||||
"}\n"
|
||||
"QTabBar {\n"
|
||||
" background-color:transparent;\n"
|
||||
" qproperty-drawBase:0;\n"
|
||||
" border-bottom:1px solid rgba(25,25,25,50%);\n"
|
||||
"}\n"
|
||||
"QTabBar::tab {\n"
|
||||
" padding:4px 6px;\n"
|
||||
" background-color:rgba(25,25,25,127);\n"
|
||||
" border:1px solid rgba(25,25,25,75);\n"
|
||||
"}\n"
|
||||
"QTabBar::tab:selected {\n"
|
||||
" background-color:rgb(66,66,66);\n"
|
||||
" border-bottom-color:rgba(66,66,66,75%);\n"
|
||||
"}\n"
|
||||
"QTabBar::tab:!selected {\n"
|
||||
" color:rgb(175,175,175);\n"
|
||||
"}\n"
|
||||
"QComboBox {\n"
|
||||
" min-height:20px;\n"
|
||||
" padding:1px 18px 1px 3px;\n"
|
||||
"}\n"
|
||||
"QComboBox::focus {\n"
|
||||
" background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgba(255,255,255,50), stop: 1 rgba(100,100,100,25));\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:4px;\n"
|
||||
"}\n"
|
||||
"QComboBox::hover {\n"
|
||||
" background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgba(255,255,255,50), stop: 1 rgba(127,127,127,50));\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:4px;\n"
|
||||
"}\n"
|
||||
"QComboBox::drop-down {\n"
|
||||
" background-color:transparent;\n"
|
||||
"}\n"
|
||||
"QComboBox::selected:on, QComboBox::selected:off {\n"
|
||||
" background-color:%1;\n"
|
||||
"}\n"
|
||||
"QTabBar::tab:hover {\n"
|
||||
" color:white;\n"
|
||||
" background-color:%1;\n"
|
||||
"}\n"
|
||||
"QComboBox::separator {\n"
|
||||
" background-color:rgb(100,100,100);\n"
|
||||
" height:1px;\n"
|
||||
" margin-left:4px;\n"
|
||||
" margin-right:4px;\n"
|
||||
"}\n"
|
||||
"QCheckBox::indicator {\n"
|
||||
" width:18px;\n"
|
||||
" height:18px;\n"
|
||||
"}\n"
|
||||
"QPushButton {\n"
|
||||
" min-height:20px;\n"
|
||||
" min-width:80px;\n"
|
||||
" padding:1px 3px 1px 3px;\n"
|
||||
"}\n"
|
||||
"QPushButton::focus, QToolButton::focus {\n"
|
||||
" background:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgba(255,255,255,50), stop: 1 rgba(100,100,100,25));\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:4px;\n"
|
||||
"}\n"
|
||||
"QPushButton::hover, QToolButton::hover {\n"
|
||||
" background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgba(255,255,255,75), stop: 1 rgba(100,100,100,50));\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:4px;\n"
|
||||
"}\n"
|
||||
"QPushButton::pressed, QToolButton::pressed {\n"
|
||||
" background-color:transparent;\n"
|
||||
" border:1px solid %1;\n"
|
||||
" border-radius:4px;\n"
|
||||
"}\n"
|
||||
"QRadioButton::indicator {\n"
|
||||
" width:18px;\n"
|
||||
" height:18px;\n"
|
||||
"}\n"
|
||||
"QListWidget::item:selected, QTreeView::item:selected, QTableView::item:selected {\n"
|
||||
" color:white;\n"
|
||||
" background-color:%1;\n"
|
||||
"}\n"
|
||||
"QTreeView {\n"
|
||||
" background-color:rgb(25,25,25);\n"
|
||||
" selection-background-color:%1;\n"
|
||||
"}\n"
|
||||
"QTreeView::branch:selected {\n"
|
||||
" background-color:%1;\n"
|
||||
"}\n"
|
||||
"QTreeView::item:selected:disabled, QTableView::item:selected:disabled {\n"
|
||||
" background-color:rgb(80,80,80);\n"
|
||||
"}\n"
|
||||
"QTreeView::branch:open, QTreeView::branch:closed {\n"
|
||||
" background-color:solid;\n"
|
||||
"}\n"
|
||||
"QTableView, QListWidget {\n"
|
||||
" background-color:rgb(25,25,25);\n"
|
||||
"}\n"
|
||||
"QTreeView QHeaderView::section, QTableView QHeaderView::section {\n"
|
||||
" /*height:24px;*/\n"
|
||||
" background-color:qlineargradient(x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
" border-style:none;\n"
|
||||
" border-bottom:1px solid rgb(65,65,65);\n"
|
||||
" padding-left:5px;\n"
|
||||
" padding-right:5px;\n"
|
||||
"}\n"
|
||||
"QTableWidget {\n"
|
||||
" background-color:rgb(25,25,25);\n"
|
||||
" alternate-background-color:rgb(40,40,40);\n"
|
||||
"}\n"
|
||||
"QScrollBar:vertical, QScrollBar:horizontal {\n"
|
||||
" background-color:rgb(35,35,35);\n"
|
||||
"}\n"
|
||||
"QScrollBar::handle:vertical, QScrollBar::handle:horizontal {\n"
|
||||
" background-color:rgb(65,65,65);\n"
|
||||
" border-right:1px solid rgba(175,175,175,50%);\n"
|
||||
" border-top:1px solid rgba(175,175,175,50%);\n"
|
||||
" border-bottom:1px solid rgba(25,25,25,75);\n"
|
||||
" border-radius:2px;\n"
|
||||
"}\n"
|
||||
"QScrollBar::handle:horizontal:hover, QScrollBar::handle:vertical:hover {\n"
|
||||
" border:1px solid %1;\n"
|
||||
" background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 rgba(255,255,255,75), stop: 1 rgba(127,127,127,75));\n"
|
||||
"}\n"
|
||||
"QScrollBar:vertical {\n"
|
||||
" border-top-right-radius:2px;\n"
|
||||
" border-bottom-right-radius:2px;\n"
|
||||
" width:16px;\n"
|
||||
" margin:0px;\n"
|
||||
"}\n"
|
||||
"QScrollBar::handle:vertical {\n"
|
||||
" min-height:20px;\n"
|
||||
" margin:2px 4px 2px 4px;\n"
|
||||
"}\n"
|
||||
"QScrollBar::add-line:vertical {\n"
|
||||
" background:none;\n"
|
||||
" height:0px;\n"
|
||||
" subcontrol-position:right;\n"
|
||||
" subcontrol-origin:margin;\n"
|
||||
"}\n"
|
||||
"QScrollBar::sub-line:vertical {\n"
|
||||
" background:none;\n"
|
||||
" height:0px;\n"
|
||||
" subcontrol-position:left;\n"
|
||||
" subcontrol-origin:margin;\n"
|
||||
"}\n"
|
||||
"QScrollBar:horizontal {\n"
|
||||
" height:16px;\n"
|
||||
" margin:0px;\n"
|
||||
"}\n"
|
||||
"QScrollBar::handle:horizontal {\n"
|
||||
" min-width:20px;\n"
|
||||
" margin:4px 2px 4px 2px;\n"
|
||||
"}\n"
|
||||
"QScrollBar::add-line:horizontal {\n"
|
||||
" background:none;\n"
|
||||
" width:0px;\n"
|
||||
" subcontrol-position:bottom;\n"
|
||||
" subcontrol-origin:margin;\n"
|
||||
"}\n"
|
||||
"QScrollBar::sub-line:horizontal {\n"
|
||||
" background:none;\n"
|
||||
" width:0px;\n"
|
||||
" subcontrol-position:top;\n"
|
||||
" subcontrol-origin:margin;\n"
|
||||
"}\n"
|
||||
"QSlider::handle:horizontal {\n"
|
||||
" border-radius:4px;\n"
|
||||
" border:1px solid rgba(25,25,25,255);\n"
|
||||
" background-color:palette(alternate-base);\n"
|
||||
" min-height:20px;\n"
|
||||
" margin:0 -4px;\n"
|
||||
"}\n"
|
||||
"QSlider::handle:horizontal:hover {\n"
|
||||
" background-color:%1;\n"
|
||||
"}\n"
|
||||
"QSlider::add-page:horizontal {\n"
|
||||
" background-color:palette(base);\n"
|
||||
"}\n"
|
||||
"QSlider::sub-page:horizontal {\n"
|
||||
" background-color:%1;\n"
|
||||
"}\n"
|
||||
"QSlider::sub-page:horizontal:disabled {\n"
|
||||
" background-color:rgb(80,80,80);\n"
|
||||
"}\n"
|
||||
"QStatusBar {\n"
|
||||
" color:white;\n"
|
||||
" background-color:qlineargradient(x1:0,y1:0,x2:0,y2:1,stop:0 rgba(25,25,25,127),stop:1 rgba(53,53,53,75));\n"
|
||||
"}\n"
|
||||
"QStatusBar QLabel {\n"
|
||||
" background-color:transparent;\n"
|
||||
"}\n"
|
||||
"QSizeGrip {\n"
|
||||
" background-color:solid;\n"
|
||||
"}\n"
|
||||
);
|
File diff suppressed because it is too large
Load Diff
@ -1,45 +0,0 @@
|
||||
#include <QDebug>
|
||||
#include "../wrapper/wrapper.h"
|
||||
#include "../wimp/wimp.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
|
||||
struct Wimp* t;
|
||||
|
||||
|
||||
int i=0;
|
||||
|
||||
void *initGui(void *arg)
|
||||
{
|
||||
char **arguments = (char**)arg;
|
||||
t = ctrWimp(i,arguments);
|
||||
CreateMainWindow(t); //-->uncomment this to open the Qt GUI
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
i = argc;
|
||||
|
||||
pthread_t gui;
|
||||
int rc;
|
||||
rc=pthread_create(&gui, NULL, initGui, (void *)argv);
|
||||
if(rc!=0)
|
||||
{
|
||||
printf("failed");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for(int j=0;j<100;j++)
|
||||
{
|
||||
Sleep(1000);
|
||||
printf("test = %d\n",i);
|
||||
i++;
|
||||
}
|
||||
|
||||
pthread_join(gui,NULL);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
TARGET = wimp-test
|
||||
CONFIG += console
|
||||
|
||||
SOURCES += main.cpp
|
||||
|
||||
Release:DESTDIR = ../build/release
|
||||
Release:OBJECTS_DIR = ../build/release/obj
|
||||
Release:MOC_DIR = ../build/release/moc
|
||||
Release:RCC_DIR = ../build/release/rcc
|
||||
Release:UI_DIR = ../build/release/ui
|
||||
|
||||
Debug:DESTDIR = ../build/debug
|
||||
Debug:OBJECTS_DIR = ../build/debug/obj
|
||||
Debug:MOC_DIR = ../build/debug/moc
|
||||
Debug:RCC_DIR = ../build/debug/rcc
|
||||
Debug:UI_DIR = ../build/debug/ui
|
||||
|
||||
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../build/release/ -lwimp.dll
|
||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/build/debug/ -lwimp.dll
|
||||
else:unix: LIBS += -L$$PWD/../wimp/build/ -lwimp.dll
|
||||
|
||||
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../build/release/ -lwrapper.dll
|
||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build/debug/ -lwrapper.dll
|
||||
else:unix:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build/debug/ -lwrapper.so
|
||||
else:unix:CONFIG(release, debug|release): LIBS += -L$$PWD/../build/debug/ -lwrapper.so
|
||||
|
||||
INCLUDEPATH += $$PWD/../../../../
|
||||
INCLUDEPATH += $$PWD/../../../../libretro-common/include/
|
||||
|
||||
win32:CONFIG(release, debug|release): INCLUDEPATH += $$PWD/../build/release
|
||||
else:win32:CONFIG(debug, debug|release): INCLUDEPATH += $$PWD/../build/debug
|
||||
else:unix:CONFIG(debug, debug|release): INCLUDEPATH += $$PWD/../build/release
|
||||
else:unix:CONFIG(release, debug|release): INCLUDEPATH += $$PWD/../build/release
|
@ -1,163 +0,0 @@
|
||||
import QtQuick 2.2
|
||||
import Material 0.1
|
||||
import Material.ListItems 0.1 as ListItem
|
||||
|
||||
ApplicationWindow {
|
||||
id: mainWindow
|
||||
title: "RetroArch"
|
||||
width: 1280
|
||||
height: 720
|
||||
color: "#211822"
|
||||
visible: true
|
||||
theme {
|
||||
primaryColor: Palette.colors["blue"]["500"]
|
||||
primaryDarkColor: Palette.colors["blue"]["700"]
|
||||
accentColor: Palette.colors["red"]["A200"]
|
||||
tabHighlightColor: "white"
|
||||
}
|
||||
|
||||
/* temporary top level folder list */
|
||||
property var folders: [
|
||||
"C:\\", "D:\\"
|
||||
]
|
||||
|
||||
property var sections: [ collections, cores, folders ]
|
||||
property var sectionTitles: [ "Collections", "Cores", "File Browser" ]
|
||||
|
||||
property string selectedItem: collections[0]
|
||||
|
||||
|
||||
initialPage: Page {
|
||||
id: page
|
||||
|
||||
title: "Qt!"
|
||||
|
||||
tabs: navDrawer.enabled ? [] : sectionTitles
|
||||
|
||||
actionBar.maxActionCount: navDrawer.enabled ? 3 : 4
|
||||
|
||||
actions: [
|
||||
Action {
|
||||
iconName: "action/search"
|
||||
name: "Search"
|
||||
enabled: true
|
||||
},
|
||||
|
||||
Action {
|
||||
iconName: "image/color_lens"
|
||||
name: "Colors"
|
||||
onTriggered: colorPicker.show()
|
||||
},
|
||||
|
||||
Action {
|
||||
iconName: "action/settings"
|
||||
name: "Settings"
|
||||
hoverAnimation: true
|
||||
},
|
||||
|
||||
|
||||
Action {
|
||||
iconName: "action/language"
|
||||
name: "Language"
|
||||
enabled: true
|
||||
},
|
||||
|
||||
Action {
|
||||
iconName: "action/account_circle"
|
||||
name: "Accounts"
|
||||
}
|
||||
]
|
||||
|
||||
backAction: navDrawer.action
|
||||
|
||||
NavigationDrawer {
|
||||
id: navDrawer
|
||||
enabled: page.width < Units.dp(500)
|
||||
|
||||
|
||||
Flickable {
|
||||
anchors.fill: parent
|
||||
|
||||
contentHeight: Math.max(content.implicitHeight, height)
|
||||
|
||||
Column {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
|
||||
Repeater {
|
||||
model: sections
|
||||
|
||||
delegate: ListItem.Standard {
|
||||
width: parent.width
|
||||
ListItem.Subheader {
|
||||
text: sectionTitles[index]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Dialog {
|
||||
id: colorPicker
|
||||
title: "Pick color"
|
||||
|
||||
positiveButtonText: "Done"
|
||||
|
||||
MenuField {
|
||||
id: selection
|
||||
model: ["Primary color", "Accent color", "Background color"]
|
||||
width: Units.dp(160)
|
||||
}
|
||||
|
||||
Grid {
|
||||
columns: 7
|
||||
spacing: Units.dp(8)
|
||||
|
||||
Repeater {
|
||||
model: [
|
||||
"red", "pink", "purple", "deepPurple", "indigo",
|
||||
"blue", "lightBlue", "cyan", "teal", "green",
|
||||
"lightGreen", "lime", "yellow", "amber", "orange",
|
||||
"deepOrange", "grey", "blueGrey", "brown", "black",
|
||||
"white"
|
||||
]
|
||||
|
||||
Rectangle {
|
||||
width: Units.dp(30)
|
||||
height: Units.dp(30)
|
||||
radius: Units.dp(2)
|
||||
color: Palette.colors[modelData]["500"]
|
||||
border.width: modelData === "white" ? Units.dp(2) : 0
|
||||
border.color: Theme.alpha("#000", 0.26)
|
||||
|
||||
Ink {
|
||||
anchors.fill: parent
|
||||
|
||||
onPressed: {
|
||||
switch(selection.selectedIndex) {
|
||||
case 0:
|
||||
theme.primaryColor = parent.color
|
||||
break;
|
||||
case 1:
|
||||
theme.accentColor = parent.color
|
||||
break;
|
||||
case 2:
|
||||
theme.backgroundColor = parent.color
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onRejected: {
|
||||
// TODO set default colors again but we currently don't know what that is
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -1,51 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Andres Suarez
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "wimp.h"
|
||||
#include "stdio.h"
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQuickWindow>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include "../../../../file_path_special.h"
|
||||
|
||||
QObject *topLevel;
|
||||
|
||||
int Wimp::CreateMainWindow()
|
||||
{
|
||||
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
topLevel = engine.rootObjects().value(0);
|
||||
window = qobject_cast<QQuickWindow *>(topLevel);
|
||||
|
||||
collections.append("Collection dir not defined");
|
||||
|
||||
engine.rootContext()->setContextProperty("collections", QVariant::fromValue(collections));
|
||||
|
||||
cores.append("Core dir not defined");
|
||||
|
||||
engine.rootContext()->setContextProperty("cores", QVariant::fromValue(cores));
|
||||
|
||||
return this->exec();
|
||||
|
||||
}
|
||||
|
||||
void Wimp::GetSettings(settings_t *s)
|
||||
{
|
||||
settings = s;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Andrés Suárez
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef WIMP_H
|
||||
#define WIMP_H
|
||||
|
||||
/* this is the only define missing from config.h remove these once
|
||||
* we can build everything with a single makefile
|
||||
*/
|
||||
|
||||
#ifndef HAVE_MENU
|
||||
#define HAVE_MENU
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#include "wimp_global.h"
|
||||
#include <QtWidgets/qwidget.h>
|
||||
#include <QtWidgets/qapplication.h>
|
||||
#include <QtQml/qqmlapplicationengine.h>
|
||||
#include <QtQuick/qquickwindow.h>
|
||||
|
||||
class WIMPSHARED_EXPORT Wimp : public QGuiApplication
|
||||
{
|
||||
QQuickWindow *window;
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {}
|
||||
|
||||
/* create the main Qt window */
|
||||
int CreateMainWindow();
|
||||
|
||||
/* get a pointer to RetroArch settings */
|
||||
void GetSettings(settings_t *s);
|
||||
|
||||
void GetCollections(char* path);
|
||||
void GetCores(char* path);
|
||||
|
||||
private:
|
||||
/* pointer to RetroArch settings */
|
||||
settings_t *settings;
|
||||
QStringList collections;
|
||||
QStringList cores;
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
};
|
||||
|
||||
#endif // WIMP_H
|
||||
|
@ -1,37 +0,0 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2014-10-21T21:15:44
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += qml quick widgets
|
||||
|
||||
TARGET = wimp
|
||||
TEMPLATE = lib
|
||||
|
||||
DEFINES += WIMP_LIBRARY
|
||||
|
||||
SOURCES += \
|
||||
wimp.cpp
|
||||
|
||||
HEADERS +=\
|
||||
wimp.h \
|
||||
wimp_global.h
|
||||
|
||||
RESOURCES += \
|
||||
qml.qrc
|
||||
|
||||
Release:DESTDIR = ../build/release
|
||||
Release:OBJECTS_DIR = ../build/release/obj
|
||||
Release:MOC_DIR = ../build/release/moc
|
||||
Release:RCC_DIR = ../build/release/rcc
|
||||
Release:UI_DIR = ../build/release/ui
|
||||
|
||||
Debug:DESTDIR = ../build/debug
|
||||
Debug:OBJECTS_DIR = ../build/debug/obj
|
||||
Debug:MOC_DIR = ../build/debug/moc
|
||||
Debug:RCC_DIR = ../build/debug/rcc
|
||||
Debug:UI_DIR = ../build/debug/ui
|
||||
|
||||
INCLUDEPATH += $$PWD/../../../../
|
||||
INCLUDEPATH += $$PWD/../../../../libretro-common/include/
|
@ -1,28 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Andrés Suárez
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef WIMP_GLOBAL_H
|
||||
#define WIMP_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(WIMP_LIBRARY)
|
||||
# define WIMPSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define WIMPSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // WIMP_GLOBAL_H
|
@ -1,191 +0,0 @@
|
||||
# This file was generated by an application wizard of Qt Creator.
|
||||
# The code below handles deployment to Android and Maemo, aswell as copying
|
||||
# of the application data to shadow build directories on desktop.
|
||||
# It is recommended not to modify this file, since newer versions of Qt Creator
|
||||
# may offer an updated version of it.
|
||||
|
||||
defineTest(qtcAddDeployment) {
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
item = item$${deploymentfolder}
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
itemsources = $${item}.files
|
||||
} else {
|
||||
itemsources = $${item}.sources
|
||||
}
|
||||
$$itemsources = $$eval($${deploymentfolder}.source)
|
||||
itempath = $${item}.path
|
||||
$$itempath= $$eval($${deploymentfolder}.target)
|
||||
export($$itemsources)
|
||||
export($$itempath)
|
||||
DEPLOYMENT += $$item
|
||||
}
|
||||
|
||||
MAINPROFILEPWD = $$PWD
|
||||
|
||||
android-no-sdk {
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
item = item$${deploymentfolder}
|
||||
itemfiles = $${item}.files
|
||||
$$itemfiles = $$eval($${deploymentfolder}.source)
|
||||
itempath = $${item}.path
|
||||
$$itempath = /data/user/qt/$$eval($${deploymentfolder}.target)
|
||||
export($$itemfiles)
|
||||
export($$itempath)
|
||||
INSTALLS += $$item
|
||||
}
|
||||
|
||||
target.path = /data/user/qt
|
||||
|
||||
export(target.path)
|
||||
INSTALLS += target
|
||||
} else:android {
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
item = item$${deploymentfolder}
|
||||
itemfiles = $${item}.files
|
||||
$$itemfiles = $$eval($${deploymentfolder}.source)
|
||||
itempath = $${item}.path
|
||||
$$itempath = /assets/$$eval($${deploymentfolder}.target)
|
||||
export($$itemfiles)
|
||||
export($$itempath)
|
||||
INSTALLS += $$item
|
||||
}
|
||||
|
||||
x86 {
|
||||
target.path = /libs/x86
|
||||
} else: armeabi-v7a {
|
||||
target.path = /libs/armeabi-v7a
|
||||
} else {
|
||||
target.path = /libs/armeabi
|
||||
}
|
||||
|
||||
export(target.path)
|
||||
INSTALLS += target
|
||||
} else:win32 {
|
||||
copyCommand =
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
|
||||
source = $$replace(source, /, \\)
|
||||
sourcePathSegments = $$split(source, \\)
|
||||
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
|
||||
target = $$replace(target, /, \\)
|
||||
target ~= s,\\\\\\.?\\\\,\\,
|
||||
!isEqual(source,$$target) {
|
||||
!isEmpty(copyCommand):copyCommand += &&
|
||||
isEqual(QMAKE_DIR_SEP, \\) {
|
||||
copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
|
||||
} else {
|
||||
source = $$replace(source, \\\\, /)
|
||||
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
|
||||
target = $$replace(target, \\\\, /)
|
||||
copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
|
||||
}
|
||||
}
|
||||
}
|
||||
!isEmpty(copyCommand) {
|
||||
copyCommand = @echo Copying application data... && $$copyCommand
|
||||
copydeploymentfolders.commands = $$copyCommand
|
||||
first.depends = $(first) copydeploymentfolders
|
||||
export(first.depends)
|
||||
export(copydeploymentfolders.commands)
|
||||
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
|
||||
}
|
||||
} else:ios {
|
||||
copyCommand =
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
|
||||
source = $$replace(source, \\\\, /)
|
||||
target = $CODESIGNING_FOLDER_PATH/$$eval($${deploymentfolder}.target)
|
||||
target = $$replace(target, \\\\, /)
|
||||
sourcePathSegments = $$split(source, /)
|
||||
targetFullPath = $$target/$$last(sourcePathSegments)
|
||||
targetFullPath ~= s,/\\.?/,/,
|
||||
!isEqual(source,$$targetFullPath) {
|
||||
!isEmpty(copyCommand):copyCommand += &&
|
||||
copyCommand += mkdir -p \"$$target\"
|
||||
copyCommand += && cp -r \"$$source\" \"$$target\"
|
||||
}
|
||||
}
|
||||
!isEmpty(copyCommand) {
|
||||
copyCommand = echo Copying application data... && $$copyCommand
|
||||
!isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";"
|
||||
QMAKE_POST_LINK += "$$copyCommand"
|
||||
export(QMAKE_POST_LINK)
|
||||
}
|
||||
} else:unix {
|
||||
maemo5 {
|
||||
desktopfile.files = $${TARGET}.desktop
|
||||
desktopfile.path = /usr/share/applications/hildon
|
||||
icon.files = $${TARGET}64.png
|
||||
icon.path = /usr/share/icons/hicolor/64x64/apps
|
||||
} else:!isEmpty(MEEGO_VERSION_MAJOR) {
|
||||
desktopfile.files = $${TARGET}_harmattan.desktop
|
||||
desktopfile.path = /usr/share/applications
|
||||
icon.files = $${TARGET}80.png
|
||||
icon.path = /usr/share/icons/hicolor/80x80/apps
|
||||
} else { # Assumed to be a Desktop Unix
|
||||
copyCommand =
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
|
||||
source = $$replace(source, \\\\, /)
|
||||
macx {
|
||||
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
|
||||
} else {
|
||||
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
|
||||
}
|
||||
target = $$replace(target, \\\\, /)
|
||||
sourcePathSegments = $$split(source, /)
|
||||
targetFullPath = $$target/$$last(sourcePathSegments)
|
||||
targetFullPath ~= s,/\\.?/,/,
|
||||
!isEqual(source,$$targetFullPath) {
|
||||
!isEmpty(copyCommand):copyCommand += &&
|
||||
copyCommand += $(MKDIR) \"$$target\"
|
||||
copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
|
||||
}
|
||||
}
|
||||
!isEmpty(copyCommand) {
|
||||
copyCommand = @echo Copying application data... && $$copyCommand
|
||||
copydeploymentfolders.commands = $$copyCommand
|
||||
first.depends = $(first) copydeploymentfolders
|
||||
export(first.depends)
|
||||
export(copydeploymentfolders.commands)
|
||||
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
|
||||
}
|
||||
}
|
||||
!isEmpty(target.path) {
|
||||
installPrefix = $${target.path}
|
||||
} else {
|
||||
installPrefix = /opt/$${TARGET}
|
||||
}
|
||||
for(deploymentfolder, DEPLOYMENTFOLDERS) {
|
||||
item = item$${deploymentfolder}
|
||||
itemfiles = $${item}.files
|
||||
$$itemfiles = $$eval($${deploymentfolder}.source)
|
||||
itempath = $${item}.path
|
||||
$$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
|
||||
export($$itemfiles)
|
||||
export($$itempath)
|
||||
INSTALLS += $$item
|
||||
}
|
||||
|
||||
!isEmpty(desktopfile.path) {
|
||||
export(icon.files)
|
||||
export(icon.path)
|
||||
export(desktopfile.files)
|
||||
export(desktopfile.path)
|
||||
INSTALLS += icon desktopfile
|
||||
}
|
||||
|
||||
isEmpty(target.path) {
|
||||
target.path = $${installPrefix}/bin
|
||||
export(target.path)
|
||||
}
|
||||
INSTALLS += target
|
||||
}
|
||||
|
||||
export (ICON)
|
||||
export (INSTALLS)
|
||||
export (DEPLOYMENT)
|
||||
export (LIBS)
|
||||
export (QMAKE_EXTRA_TARGETS)
|
||||
}
|
||||
|
@ -1,44 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Andrés Suárez
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "../wimp/wimp.h"
|
||||
#include "../wimp/wimp_global.h"
|
||||
#include "wrapper.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct Wimp Wimp;
|
||||
|
||||
Wimp* ctrWimp(int argc, char *argv[]){
|
||||
return new Wimp(argc,argv);
|
||||
}
|
||||
|
||||
int CreateMainWindow(Wimp* p)
|
||||
{
|
||||
return p->CreateMainWindow();
|
||||
}
|
||||
|
||||
void GetSettings(Wimp* p, settings_t *s)
|
||||
{
|
||||
return p->GetSettings(s);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -1,38 +0,0 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Andrés Suárez
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HAVE_MENU
|
||||
#define HAVE_MENU
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#ifndef WRAPPER_H
|
||||
#define WRAPPER_H
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct Wimp Wimp;
|
||||
typedef settings_t (*config_get_ptr_cb);
|
||||
|
||||
Wimp* ctrWimp(int argc, char *argv[]);
|
||||
|
||||
int CreateMainWindow(Wimp* p);
|
||||
void GetSettings(Wimp* p, settings_t *s);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif // WRAPPER_H
|
@ -1,40 +0,0 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
#CONFIG -= qt
|
||||
QT += qml quick widgets
|
||||
|
||||
SOURCES += \
|
||||
wrapper.cpp
|
||||
|
||||
include(deployment.pri)
|
||||
qtcAddDeployment()
|
||||
|
||||
HEADERS += \
|
||||
wrapper.h
|
||||
|
||||
|
||||
Release:DESTDIR = ../build/release
|
||||
Release:OBJECTS_DIR = ../build/release/obj
|
||||
Release:MOC_DIR = ../build/release/moc
|
||||
Release:RCC_DIR = ../build/release/rcc
|
||||
Release:UI_DIR = ../build/release/ui
|
||||
|
||||
Debug:DESTDIR = ../build/debug
|
||||
Debug:OBJECTS_DIR = ../build/debug/obj
|
||||
Debug:MOC_DIR = ../build/debug/moc
|
||||
Debug:RCC_DIR = ../build/debug/rcc
|
||||
Debug:UI_DIR = ../build/debug/ui
|
||||
|
||||
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../build/release/ -lwimp.dll
|
||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build/debug/ -lwimp.dll
|
||||
else:unix:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build/debug/ -lwimp.so
|
||||
else:unix:CONFIG(release, debug|release): LIBS += -L$$PWD/../build/debug/ -lwimp.so
|
||||
|
||||
win32:CONFIG(release, debug|release): INCLUDEPATH += $$PWD/../build/release
|
||||
else:win32:CONFIG(debug, debug|release): INCLUDEPATH += $$PWD/../build/debug
|
||||
else:unix:CONFIG(debug, debug|release): INCLUDEPATH += $$PWD/../build/release
|
||||
else:unix:CONFIG(release, debug|release): INCLUDEPATH += $$PWD/../build/release
|
||||
|
||||
INCLUDEPATH += $$PWD/../../../../
|
||||
INCLUDEPATH += $$PWD/../../../../libretro-common/include/
|
@ -197,13 +197,13 @@ static char** waiting_argv;
|
||||
SEL selector = NSSelectorFromString(BOXSTRING("setCollectionBehavior:"));
|
||||
SEL fsselector = NSSelectorFromString(BOXSTRING("toggleFullScreen:"));
|
||||
apple_platform = self;
|
||||
|
||||
|
||||
if ([self.window respondsToSelector:selector])
|
||||
{
|
||||
if ([self.window respondsToSelector:fsselector])
|
||||
[self.window setCollectionBehavior:NS_WINDOW_COLLECTION_BEHAVIOR_FULLSCREEN_PRIMARY];
|
||||
}
|
||||
|
||||
|
||||
[self.window setAcceptsMouseMovedEvents: YES];
|
||||
|
||||
[[CocoaView get] setFrame: [[self.window contentView] bounds]];
|
||||
@ -245,7 +245,7 @@ static char** waiting_argv;
|
||||
if (ret == -1)
|
||||
break;
|
||||
}while(1);
|
||||
|
||||
|
||||
main_exit(NULL);
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ static char** waiting_argv;
|
||||
|
||||
if (system)
|
||||
core_name = system->library_name;
|
||||
|
||||
|
||||
if (core_name)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
@ -329,10 +329,10 @@ static void open_core_handler(ui_browser_window_state_t *state, bool result)
|
||||
return;
|
||||
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
|
||||
rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, (void*)state->result);
|
||||
ui_companion_event_command(CMD_EVENT_LOAD_CORE);
|
||||
|
||||
|
||||
if (info && info->load_no_content
|
||||
&& settings->bools.set_supports_no_game_enable)
|
||||
{
|
||||
@ -354,16 +354,16 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result)
|
||||
return;
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
|
||||
rarch_system_info_t *info = runloop_get_system_info();
|
||||
struct retro_system_info *system = &info->info;
|
||||
const char *core_name = NULL;
|
||||
|
||||
|
||||
if (system)
|
||||
core_name = system->library_name;
|
||||
|
||||
|
||||
path_set(RARCH_PATH_CONTENT, state->result);
|
||||
|
||||
|
||||
if (core_name)
|
||||
{
|
||||
content_ctx_info_t content_info = {0};
|
||||
@ -377,20 +377,20 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result)
|
||||
|
||||
- (IBAction)openCore:(id)sender {
|
||||
const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr();
|
||||
|
||||
|
||||
if (browser)
|
||||
{
|
||||
ui_browser_window_state_t browser_state;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
|
||||
browser_state.filters = strdup("dylib");
|
||||
browser_state.filters_title = strdup("Core");
|
||||
browser_state.title = strdup("Load Core");
|
||||
browser_state.startdir = strdup(settings->paths.directory_libretro);
|
||||
|
||||
|
||||
bool result = browser->open(&browser_state);
|
||||
open_core_handler(&browser_state, result);
|
||||
|
||||
|
||||
free(browser_state.filters);
|
||||
free(browser_state.filters_title);
|
||||
free(browser_state.title);
|
||||
@ -401,22 +401,22 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result)
|
||||
- (void)openDocument:(id)sender
|
||||
{
|
||||
const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr();
|
||||
|
||||
|
||||
if (browser)
|
||||
{
|
||||
ui_browser_window_state_t browser_state = {{0}};
|
||||
settings_t *settings = config_get_ptr();
|
||||
NSString *startdir = BOXSTRING(settings->paths.directory_menu_content);
|
||||
|
||||
|
||||
if (!startdir.length)
|
||||
startdir = BOXSTRING("/");
|
||||
|
||||
|
||||
browser_state.title = strdup("Load Content");
|
||||
browser_state.startdir = strdup([startdir UTF8String]);
|
||||
|
||||
|
||||
bool result = browser->open(&browser_state);
|
||||
open_document_handler(&browser_state, result);
|
||||
|
||||
|
||||
free(browser_state.startdir);
|
||||
free(browser_state.title);
|
||||
}
|
||||
@ -440,7 +440,7 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result)
|
||||
{
|
||||
enum event_command cmd;
|
||||
unsigned sender_tag = (unsigned)[sender tag];
|
||||
|
||||
|
||||
switch (sender_tag)
|
||||
{
|
||||
case 1:
|
||||
@ -477,7 +477,7 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result)
|
||||
cmd = CMD_EVENT_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (sender_tag >= 10 && sender_tag <= 19)
|
||||
{
|
||||
unsigned idx = (sender_tag - (10-1));
|
||||
@ -503,7 +503,7 @@ int main(int argc, char *argv[])
|
||||
if (!strncmp(argv[1], "-psn", 4))
|
||||
argc = 1;
|
||||
}
|
||||
|
||||
|
||||
waiting_argc = argc;
|
||||
waiting_argv = argv;
|
||||
|
||||
@ -520,9 +520,10 @@ static void ui_companion_cocoa_notify_content_loaded(void *data)
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void ui_companion_cocoa_toggle(void *data)
|
||||
static void ui_companion_cocoa_toggle(void *data, bool force)
|
||||
{
|
||||
(void)data;
|
||||
(void)force;
|
||||
}
|
||||
|
||||
static int ui_companion_cocoa_iterate(void *data, unsigned action)
|
||||
@ -571,7 +572,7 @@ static void *ui_companion_cocoa_get_main_window(void *data)
|
||||
return ((RetroArch_OSX*)[[NSApplication sharedApplication] delegate]).window;
|
||||
}
|
||||
|
||||
const ui_companion_driver_t ui_companion_cocoa = {
|
||||
ui_companion_driver_t ui_companion_cocoa = {
|
||||
ui_companion_cocoa_init,
|
||||
ui_companion_cocoa_deinit,
|
||||
ui_companion_cocoa_iterate,
|
||||
@ -583,6 +584,7 @@ const ui_companion_driver_t ui_companion_cocoa = {
|
||||
NULL,
|
||||
NULL,
|
||||
ui_companion_cocoa_get_main_window,
|
||||
NULL,
|
||||
&ui_browser_window_cocoa,
|
||||
&ui_msg_window_cocoa,
|
||||
&ui_window_cocoa,
|
||||
|
@ -698,7 +698,7 @@ static void ui_companion_cocoatouch_msg_queue_push(const char *msg,
|
||||
}
|
||||
}
|
||||
|
||||
const ui_companion_driver_t ui_companion_cocoatouch = {
|
||||
ui_companion_driver_t ui_companion_cocoatouch = {
|
||||
ui_companion_cocoatouch_init,
|
||||
ui_companion_cocoatouch_deinit,
|
||||
ui_companion_cocoatouch_iterate,
|
||||
|
@ -58,9 +58,10 @@ static void ui_companion_null_notify_content_loaded(void *data)
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void ui_companion_null_toggle(void *data)
|
||||
static void ui_companion_null_toggle(void *data, bool force)
|
||||
{
|
||||
(void)data;
|
||||
(void)force;
|
||||
}
|
||||
|
||||
static void ui_companion_null_event_command(void *data, enum event_command cmd)
|
||||
@ -77,7 +78,7 @@ static void ui_companion_null_notify_list_pushed(void *data,
|
||||
(void)menu_list;
|
||||
}
|
||||
|
||||
const ui_companion_driver_t ui_companion_null = {
|
||||
ui_companion_driver_t ui_companion_null = {
|
||||
ui_companion_null_init,
|
||||
ui_companion_null_deinit,
|
||||
ui_companion_null_iterate,
|
||||
@ -89,6 +90,7 @@ const ui_companion_driver_t ui_companion_null = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&ui_browser_window_null,
|
||||
&ui_msg_window_null,
|
||||
&ui_window_null,
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
@ -13,59 +14,168 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C" {
|
||||
#include <file/file_path.h>
|
||||
#include <rthreads/rthreads.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
#include "qt/wrapper/wrapper.h"
|
||||
#else
|
||||
#include "ui_qt.h"
|
||||
#endif
|
||||
|
||||
#include "../ui_companion_driver.h"
|
||||
#include "../../core.h"
|
||||
#include "../../configuration.h"
|
||||
#include "../../retroarch.h"
|
||||
#include "../../verbosity.h"
|
||||
#include "../../msg_hash.h"
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
}
|
||||
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
struct Wimp* wimp;
|
||||
char* args[] = {""};
|
||||
#include "ui_qt.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QtWidgets>
|
||||
#include <QDesktopWidget>
|
||||
#include <QtGlobal>
|
||||
#include <QStyle>
|
||||
|
||||
#define INITIAL_WIDTH 1280
|
||||
#define INITIAL_HEIGHT 720
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||
#define GROUPED_DRAGGING QMainWindow::GroupedDragging
|
||||
#else
|
||||
#define GROUPED_DRAGGING static_cast<QMainWindow::DockOption>(0)
|
||||
#endif
|
||||
|
||||
static bool already_started = false;
|
||||
|
||||
typedef struct ui_companion_qt
|
||||
{
|
||||
void *empty;
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
volatile bool quit;
|
||||
slock_t *lock;
|
||||
sthread_t *thread;
|
||||
#endif
|
||||
ui_application_qt_t *app;
|
||||
ui_window_qt_t *window;
|
||||
} ui_companion_qt_t;
|
||||
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
static void qt_thread(void *data)
|
||||
ThumbnailWidget::ThumbnailWidget(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||
wimp = ctrWimp(0, NULL);
|
||||
if(wimp)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
GetSettings(wimp, settings);
|
||||
CreateMainWindow(wimp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void ThumbnailWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QStyleOption o;
|
||||
QPainter p;
|
||||
o.initFrom(this);
|
||||
p.begin(this);
|
||||
style()->drawPrimitive(
|
||||
QStyle::PE_Widget, &o, &p, this);
|
||||
p.end();
|
||||
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
|
||||
void ThumbnailWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
QSize ThumbnailWidget::sizeHint() const
|
||||
{
|
||||
return QSize(256, 256);
|
||||
}
|
||||
|
||||
ThumbnailLabel::ThumbnailLabel(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
,m_pixmap(NULL)
|
||||
,m_pixmapWidth(0)
|
||||
,m_pixmapHeight(0)
|
||||
{
|
||||
}
|
||||
|
||||
ThumbnailLabel::~ThumbnailLabel()
|
||||
{
|
||||
if (m_pixmap)
|
||||
delete m_pixmap;
|
||||
}
|
||||
|
||||
void ThumbnailLabel::setPixmap(const QPixmap &pixmap)
|
||||
{
|
||||
m_pixmapWidth = pixmap.width();
|
||||
m_pixmapHeight = pixmap.height();
|
||||
|
||||
if (m_pixmap)
|
||||
delete m_pixmap;
|
||||
|
||||
m_pixmap = new QPixmap(pixmap);
|
||||
}
|
||||
|
||||
QSize ThumbnailLabel::sizeHint() const
|
||||
{
|
||||
return QSize(256, 256);
|
||||
}
|
||||
|
||||
void ThumbnailLabel::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
int w = width();
|
||||
int h = height();
|
||||
QStyleOption o;
|
||||
QPainter p;
|
||||
|
||||
event->accept();
|
||||
|
||||
o.initFrom(this);
|
||||
p.begin(this);
|
||||
style()->drawPrimitive(
|
||||
QStyle::PE_Widget, &o, &p, this);
|
||||
p.end();
|
||||
|
||||
if (!m_pixmap || m_pixmap->isNull())
|
||||
{
|
||||
m_pixmap = new QPixmap(sizeHint());
|
||||
m_pixmap->fill(QColor(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
if (w > 0 && h > 0 && m_pixmap && !m_pixmap->isNull())
|
||||
{
|
||||
int newHeight = (m_pixmap->height() / static_cast<float>(m_pixmap->width())) * width();
|
||||
QPixmap pixmapScaled = *m_pixmap;
|
||||
QPixmap pixmap;
|
||||
QPainter pScale;
|
||||
int pw = 0;
|
||||
int ph = 0;
|
||||
unsigned *buf = new unsigned[w * h];
|
||||
|
||||
if (newHeight > h)
|
||||
pixmapScaled = pixmapScaled.scaledToHeight(h, Qt::SmoothTransformation);
|
||||
else
|
||||
pixmapScaled = pixmapScaled.scaledToWidth(w, Qt::SmoothTransformation);
|
||||
|
||||
pw = pixmapScaled.width();
|
||||
ph = pixmapScaled.height();
|
||||
|
||||
pixmap = QPixmap(w, h);
|
||||
pixmap.fill(QColor(0, 0, 0, 0));
|
||||
|
||||
pScale.begin(&pixmap);
|
||||
pScale.drawPixmap(QRect((w - pw) / 2, (h - ph) / 2, pw, ph), pixmapScaled, pixmapScaled.rect());
|
||||
pScale.end();
|
||||
|
||||
if (!pixmap.isNull())
|
||||
{
|
||||
p.begin(this);
|
||||
p.drawPixmap(rect(), pixmap, pixmap.rect());
|
||||
p.end();
|
||||
}
|
||||
|
||||
delete []buf;
|
||||
}
|
||||
else
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
|
||||
void ThumbnailLabel::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
}
|
||||
|
||||
static void ui_companion_qt_deinit(void *data)
|
||||
{
|
||||
@ -74,32 +184,305 @@ static void ui_companion_qt_deinit(void *data)
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
slock_free(handle->lock);
|
||||
sthread_join(handle->thread);
|
||||
#endif
|
||||
/* why won't deleteLater() here call the destructor? */
|
||||
delete handle->window->qtWindow;
|
||||
|
||||
free(handle);
|
||||
}
|
||||
|
||||
static void *ui_companion_qt_init(void)
|
||||
static void* ui_companion_qt_init(void)
|
||||
{
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
|
||||
MainWindow *mainwindow = NULL;
|
||||
QHBoxLayout *browserButtonsHBoxLayout = NULL;
|
||||
QVBoxLayout *layout = NULL;
|
||||
QVBoxLayout *launchWithWidgetLayout = NULL;
|
||||
QHBoxLayout *coreComboBoxLayout = NULL;
|
||||
QMenuBar *menu = NULL;
|
||||
QDesktopWidget *desktop = NULL;
|
||||
QMenu *fileMenu = NULL;
|
||||
QMenu *editMenu = NULL;
|
||||
QMenu *viewMenu = NULL;
|
||||
QMenu *viewClosedDocksMenu = NULL;
|
||||
QRect desktopRect;
|
||||
QDockWidget *thumbnailDock = NULL;
|
||||
QDockWidget *thumbnail2Dock = NULL;
|
||||
QDockWidget *thumbnail3Dock = NULL;
|
||||
QDockWidget *browserAndPlaylistTabDock = NULL;
|
||||
QDockWidget *coreSelectionDock = NULL;
|
||||
QTabWidget *browserAndPlaylistTabWidget = NULL;
|
||||
QWidget *widget = NULL;
|
||||
QWidget *browserWidget = NULL;
|
||||
QWidget *playlistWidget = NULL;
|
||||
QWidget *coreSelectionWidget = NULL;
|
||||
QWidget *launchWithWidget = NULL;
|
||||
ThumbnailWidget *thumbnailWidget = NULL;
|
||||
ThumbnailWidget *thumbnail2Widget = NULL;
|
||||
ThumbnailWidget *thumbnail3Widget = NULL;
|
||||
QPushButton *browserDownloadsButton = NULL;
|
||||
QPushButton *browserUpButton = NULL;
|
||||
QPushButton *browserStartButton = NULL;
|
||||
ThumbnailLabel *thumbnail = NULL;
|
||||
ThumbnailLabel *thumbnail2 = NULL;
|
||||
ThumbnailLabel *thumbnail3 = NULL;
|
||||
QAction *editSearchAction = NULL;
|
||||
QAction *loadCoreAction = NULL;
|
||||
QAction *unloadCoreAction = NULL;
|
||||
QAction *exitAction = NULL;
|
||||
QComboBox *launchWithComboBox = NULL;
|
||||
QSettings *qsettings = NULL;
|
||||
|
||||
if (!handle)
|
||||
return NULL;
|
||||
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
settings_t *settings = config_get_ptr();
|
||||
handle->lock = slock_new();
|
||||
handle->thread = sthread_create(qt_thread, handle);
|
||||
if (!handle->thread)
|
||||
{
|
||||
slock_free(handle->lock);
|
||||
free(handle);
|
||||
return NULL;
|
||||
}
|
||||
handle->app = static_cast<ui_application_qt_t*>(ui_application_qt.initialize());
|
||||
handle->window = static_cast<ui_window_qt_t*>(ui_window_qt.init());
|
||||
|
||||
desktop = qApp->desktop();
|
||||
desktopRect = desktop->availableGeometry();
|
||||
|
||||
mainwindow = handle->window->qtWindow;
|
||||
|
||||
qsettings = mainwindow->settings();
|
||||
|
||||
mainwindow->resize(qMin(desktopRect.width(), INITIAL_WIDTH), qMin(desktopRect.height(), INITIAL_HEIGHT));
|
||||
mainwindow->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, mainwindow->size(), desktopRect));
|
||||
|
||||
mainwindow->setWindowTitle("RetroArch");
|
||||
mainwindow->setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks | GROUPED_DRAGGING);
|
||||
|
||||
widget = new QWidget(mainwindow);
|
||||
widget->setObjectName("tableWidget");
|
||||
|
||||
layout = new QVBoxLayout();
|
||||
layout->addWidget(mainwindow->contentTableWidget());
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
mainwindow->setCentralWidget(widget);
|
||||
|
||||
menu = mainwindow->menuBar();
|
||||
|
||||
fileMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE));
|
||||
|
||||
loadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE), mainwindow, SLOT(onLoadCoreClicked()));
|
||||
loadCoreAction->setShortcut(QKeySequence("Ctrl+L"));
|
||||
|
||||
unloadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE), mainwindow, SLOT(onUnloadCoreMenuAction()));
|
||||
unloadCoreAction->setObjectName("unloadCoreAction");
|
||||
unloadCoreAction->setEnabled(false);
|
||||
unloadCoreAction->setShortcut(QKeySequence("Ctrl+U"));
|
||||
|
||||
exitAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT), mainwindow, SLOT(close()));
|
||||
exitAction->setShortcut(QKeySequence::Quit);
|
||||
|
||||
editMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT));
|
||||
editSearchAction = editMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT_SEARCH), mainwindow->searchLineEdit(), SLOT(setFocus()));
|
||||
editSearchAction->setShortcut(QKeySequence::Find);
|
||||
|
||||
viewMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW));
|
||||
viewClosedDocksMenu = viewMenu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_CLOSED_DOCKS));
|
||||
viewClosedDocksMenu->setObjectName("viewClosedDocksMenu");
|
||||
|
||||
QObject::connect(viewClosedDocksMenu, SIGNAL(aboutToShow()), mainwindow, SLOT(onViewClosedDocksAboutToShow()));
|
||||
|
||||
viewMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS), mainwindow->viewOptionsDialog(), SLOT(showDialog()));
|
||||
|
||||
playlistWidget = new QWidget();
|
||||
playlistWidget->setLayout(new QVBoxLayout());
|
||||
playlistWidget->setObjectName("playlistWidget");
|
||||
|
||||
playlistWidget->layout()->addWidget(mainwindow->playlistListWidget());
|
||||
|
||||
browserWidget = new QWidget();
|
||||
browserWidget->setLayout(new QVBoxLayout());
|
||||
browserWidget->setObjectName("browserWidget");
|
||||
|
||||
browserDownloadsButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIRECTORY));
|
||||
browserUpButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_UP));
|
||||
browserStartButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FAVORITES));
|
||||
|
||||
QObject::connect(browserDownloadsButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserDownloadsClicked()));
|
||||
QObject::connect(browserUpButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserUpClicked()));
|
||||
QObject::connect(browserStartButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserStartClicked()));
|
||||
|
||||
browserButtonsHBoxLayout = new QHBoxLayout();
|
||||
browserButtonsHBoxLayout->addWidget(browserUpButton);
|
||||
browserButtonsHBoxLayout->addWidget(browserStartButton);
|
||||
browserButtonsHBoxLayout->addWidget(browserDownloadsButton);
|
||||
|
||||
qobject_cast<QVBoxLayout*>(browserWidget->layout())->addLayout(browserButtonsHBoxLayout);
|
||||
browserWidget->layout()->addWidget(mainwindow->dirTreeView());
|
||||
|
||||
browserAndPlaylistTabWidget = mainwindow->browserAndPlaylistTabWidget();
|
||||
browserAndPlaylistTabWidget->setObjectName("browserAndPlaylistTabWidget");
|
||||
|
||||
/* Several functions depend on the same tab title strings here, so if you change these, make sure to change those too
|
||||
* setCoreActions()
|
||||
* onTabWidgetIndexChanged()
|
||||
* onCurrentListItemChanged()
|
||||
*/
|
||||
browserAndPlaylistTabWidget->addTab(playlistWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS));
|
||||
browserAndPlaylistTabWidget->addTab(browserWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER));
|
||||
|
||||
browserAndPlaylistTabDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER), mainwindow);
|
||||
browserAndPlaylistTabDock->setObjectName("browserAndPlaylistTabDock");
|
||||
browserAndPlaylistTabDock->setProperty("default_area", Qt::LeftDockWidgetArea);
|
||||
browserAndPlaylistTabDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER));
|
||||
browserAndPlaylistTabDock->setWidget(browserAndPlaylistTabWidget);
|
||||
|
||||
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(browserAndPlaylistTabDock->property("default_area").toInt()), browserAndPlaylistTabDock);
|
||||
|
||||
browserButtonsHBoxLayout->addItem(new QSpacerItem(browserAndPlaylistTabWidget->tabBar()->width(), 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
|
||||
|
||||
thumbnailWidget = new ThumbnailWidget();
|
||||
thumbnail2Widget = new ThumbnailWidget();
|
||||
thumbnail3Widget = new ThumbnailWidget();
|
||||
|
||||
thumbnailWidget->setLayout(new QVBoxLayout());
|
||||
thumbnail2Widget->setLayout(new QVBoxLayout());
|
||||
thumbnail3Widget->setLayout(new QVBoxLayout());
|
||||
|
||||
thumbnailWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||
thumbnail2Widget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||
thumbnail3Widget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||
|
||||
thumbnail = new ThumbnailLabel();
|
||||
thumbnail->setObjectName("thumbnail");
|
||||
|
||||
thumbnail2 = new ThumbnailLabel();
|
||||
thumbnail2->setObjectName("thumbnail2");
|
||||
|
||||
thumbnail3 = new ThumbnailLabel();
|
||||
thumbnail3->setObjectName("thumbnail3");
|
||||
|
||||
thumbnail->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||
thumbnail2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||
thumbnail3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||
|
||||
QObject::connect(mainwindow, SIGNAL(thumbnailChanged(const QPixmap&)), thumbnail, SLOT(setPixmap(const QPixmap&)));
|
||||
QObject::connect(mainwindow, SIGNAL(thumbnail2Changed(const QPixmap&)), thumbnail2, SLOT(setPixmap(const QPixmap&)));
|
||||
QObject::connect(mainwindow, SIGNAL(thumbnail3Changed(const QPixmap&)), thumbnail3, SLOT(setPixmap(const QPixmap&)));
|
||||
|
||||
thumbnailWidget->layout()->addWidget(thumbnail);
|
||||
thumbnail2Widget->layout()->addWidget(thumbnail2);
|
||||
thumbnail3Widget->layout()->addWidget(thumbnail3);
|
||||
|
||||
thumbnailDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART), mainwindow);
|
||||
thumbnailDock->setObjectName("thumbnailDock");
|
||||
thumbnailDock->setProperty("default_area", Qt::RightDockWidgetArea);
|
||||
thumbnailDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_BOXART));
|
||||
thumbnailDock->setWidget(thumbnailWidget);
|
||||
|
||||
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnailDock->property("default_area").toInt()), thumbnailDock);
|
||||
|
||||
thumbnail2Dock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN), mainwindow);
|
||||
thumbnail2Dock->setObjectName("thumbnail2Dock");
|
||||
thumbnail2Dock->setProperty("default_area", Qt::RightDockWidgetArea);
|
||||
thumbnail2Dock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_TITLE_SCREEN));
|
||||
thumbnail2Dock->setWidget(thumbnail2Widget);
|
||||
|
||||
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnail2Dock->property("default_area").toInt()), thumbnail2Dock);
|
||||
|
||||
thumbnail3Dock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT), mainwindow);
|
||||
thumbnail3Dock->setObjectName("thumbnail3Dock");
|
||||
thumbnail3Dock->setProperty("default_area", Qt::RightDockWidgetArea);
|
||||
thumbnail3Dock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_THUMBNAIL_SCREENSHOT));
|
||||
thumbnail3Dock->setWidget(thumbnail3Widget);
|
||||
|
||||
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(thumbnail3Dock->property("default_area").toInt()), thumbnail3Dock);
|
||||
|
||||
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail2Dock);
|
||||
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail3Dock);
|
||||
|
||||
/* when tabifying the dock widgets, the last tab added is selected by default, so we need to re-select the first tab */
|
||||
thumbnailDock->raise();
|
||||
|
||||
coreSelectionWidget = new QWidget();
|
||||
coreSelectionWidget->setLayout(new QVBoxLayout());
|
||||
|
||||
launchWithComboBox = mainwindow->launchWithComboBox();
|
||||
|
||||
launchWithWidgetLayout = new QVBoxLayout();
|
||||
|
||||
launchWithWidget = new QWidget();
|
||||
launchWithWidget->setLayout(launchWithWidgetLayout);
|
||||
|
||||
coreComboBoxLayout = new QHBoxLayout();
|
||||
|
||||
mainwindow->runPushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
|
||||
mainwindow->stopPushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
|
||||
mainwindow->startCorePushButton()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
|
||||
|
||||
coreComboBoxLayout->addWidget(launchWithComboBox);
|
||||
coreComboBoxLayout->addWidget(mainwindow->startCorePushButton());
|
||||
coreComboBoxLayout->addWidget(mainwindow->coreInfoPushButton());
|
||||
coreComboBoxLayout->addWidget(mainwindow->runPushButton());
|
||||
coreComboBoxLayout->addWidget(mainwindow->stopPushButton());
|
||||
|
||||
mainwindow->stopPushButton()->hide();
|
||||
|
||||
coreComboBoxLayout->setStretchFactor(launchWithComboBox, 1);
|
||||
|
||||
launchWithWidgetLayout->addLayout(coreComboBoxLayout);
|
||||
|
||||
coreSelectionWidget->layout()->addWidget(launchWithWidget);
|
||||
|
||||
coreSelectionWidget->layout()->addItem(new QSpacerItem(20, browserAndPlaylistTabWidget->height(), QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||
|
||||
coreSelectionDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CORE), mainwindow);
|
||||
coreSelectionDock->setObjectName("coreSelectionDock");
|
||||
coreSelectionDock->setProperty("default_area", Qt::LeftDockWidgetArea);
|
||||
coreSelectionDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CORE));
|
||||
coreSelectionDock->setWidget(coreSelectionWidget);
|
||||
|
||||
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(coreSelectionDock->property("default_area").toInt()), coreSelectionDock);
|
||||
|
||||
mainwindow->splitDockWidget(browserAndPlaylistTabDock, coreSelectionDock, Qt::Vertical);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||
mainwindow->resizeDocks(QList<QDockWidget*>() << coreSelectionDock, QList<int>() << 1, Qt::Vertical);
|
||||
#endif
|
||||
|
||||
/* this should come last */
|
||||
mainwindow->resizeThumbnails(true, true, true);
|
||||
|
||||
if (qsettings->contains("geometry"))
|
||||
if (qsettings->contains("save_geometry"))
|
||||
mainwindow->restoreGeometry(qsettings->value("geometry").toByteArray());
|
||||
|
||||
if (qsettings->value("save_dock_positions", false).toBool())
|
||||
if (qsettings->contains("dock_positions"))
|
||||
mainwindow->restoreState(qsettings->value("dock_positions").toByteArray());
|
||||
|
||||
if (qsettings->value("save_last_tab", false).toBool())
|
||||
{
|
||||
if (qsettings->contains("last_tab"))
|
||||
{
|
||||
int lastTabIndex = qsettings->value("last_tab", 0).toInt();
|
||||
|
||||
if (lastTabIndex >= 0 && browserAndPlaylistTabWidget->count() > lastTabIndex)
|
||||
browserAndPlaylistTabWidget->setCurrentIndex(lastTabIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if (qsettings->contains("theme"))
|
||||
{
|
||||
QString themeStr = qsettings->value("theme").toString();
|
||||
MainWindow::Theme theme = mainwindow->getThemeFromString(themeStr);
|
||||
|
||||
if (qsettings->contains("custom_theme") && theme == MainWindow::THEME_CUSTOM)
|
||||
{
|
||||
QString customThemeFilePath = qsettings->value("custom_theme").toString();
|
||||
|
||||
mainwindow->setCustomThemeFile(customThemeFilePath);
|
||||
}
|
||||
|
||||
mainwindow->setTheme(theme);
|
||||
}
|
||||
else
|
||||
mainwindow->setTheme();
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
@ -115,23 +498,41 @@ static void ui_companion_qt_notify_content_loaded(void *data)
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void ui_companion_qt_toggle(void *data)
|
||||
static void ui_companion_qt_toggle(void *data, bool force)
|
||||
{
|
||||
ui_companion_qt_init();
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||
ui_window_qt_t *win_handle = (ui_window_qt_t*)handle->window;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
if (!retroarch_core_set_on_cmdline())
|
||||
#endif
|
||||
if (settings->bools.ui_companion_toggle || force)
|
||||
{
|
||||
video_driver_show_mouse();
|
||||
win_handle->qtWindow->show();
|
||||
|
||||
if (video_driver_started_fullscreen())
|
||||
win_handle->qtWindow->lower();
|
||||
|
||||
if (!already_started)
|
||||
{
|
||||
already_started = true;
|
||||
|
||||
if (win_handle->qtWindow->settings()->value("show_welcome_screen", true).toBool())
|
||||
win_handle->qtWindow->showWelcomeScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void ui_companion_qt_event_command(void *data, enum event_command cmd)
|
||||
{
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||
|
||||
(void)cmd;
|
||||
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
slock_lock(handle->lock);
|
||||
command_event(cmd, NULL);
|
||||
slock_unlock(handle->lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ui_companion_qt_notify_list_pushed(void *data, file_list_t *list,
|
||||
@ -142,7 +543,37 @@ static void ui_companion_qt_notify_list_pushed(void *data, file_list_t *list,
|
||||
(void)menu_list;
|
||||
}
|
||||
|
||||
const ui_companion_driver_t ui_companion_qt = {
|
||||
static void ui_companion_qt_notify_refresh(void *data)
|
||||
{
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||
ui_window_qt_t *win_handle = (ui_window_qt_t*)handle->window;
|
||||
|
||||
win_handle->qtWindow->deferReloadPlaylists();
|
||||
}
|
||||
|
||||
static void ui_companion_qt_log_msg(void *data, const char *msg)
|
||||
{
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||
ui_window_qt_t *win_handle = (ui_window_qt_t*)handle->window;
|
||||
|
||||
win_handle->qtWindow->appendLogMessage(msg);
|
||||
}
|
||||
|
||||
void ui_companion_qt_msg_queue_push(void *data, const char *msg, unsigned priority, unsigned duration, bool flush)
|
||||
{
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||
ui_window_qt_t *win_handle = NULL;
|
||||
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
win_handle = (ui_window_qt_t*)handle->window;
|
||||
|
||||
if (win_handle)
|
||||
win_handle->qtWindow->showStatusMessage(msg, priority, duration, flush);
|
||||
}
|
||||
|
||||
ui_companion_driver_t ui_companion_qt = {
|
||||
ui_companion_qt_init,
|
||||
ui_companion_qt_deinit,
|
||||
ui_companion_qt_iterate,
|
||||
@ -150,20 +581,14 @@ const ui_companion_driver_t ui_companion_qt = {
|
||||
ui_companion_qt_event_command,
|
||||
ui_companion_qt_notify_content_loaded,
|
||||
ui_companion_qt_notify_list_pushed,
|
||||
ui_companion_qt_notify_refresh,
|
||||
ui_companion_qt_msg_queue_push,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#else
|
||||
ui_companion_qt_log_msg,
|
||||
&ui_browser_window_qt,
|
||||
&ui_msg_window_qt,
|
||||
&ui_window_qt,
|
||||
&ui_application_qt,
|
||||
#endif
|
||||
"qt",
|
||||
};
|
||||
|
366
ui/drivers/ui_qt.h
Normal file
366
ui/drivers/ui_qt.h
Normal file
@ -0,0 +1,366 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2017 - Daniel De Matteis
|
||||
* Copyright (C) 2018 - Brad Parker
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _QT_UI
|
||||
#define _QT_UI
|
||||
|
||||
#include <QObject>
|
||||
#include <QMainWindow>
|
||||
#include <QTreeView>
|
||||
#include <QTableWidget>
|
||||
#include <QWidget>
|
||||
#include <QDialog>
|
||||
#include <QLabel>
|
||||
#include <QRegularExpression>
|
||||
#include <QPalette>
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
extern "C" {
|
||||
#include <retro_common_api.h>
|
||||
#include "../ui_companion_driver.h"
|
||||
}
|
||||
|
||||
class QApplication;
|
||||
class QCloseEvent;
|
||||
class QKeyEvent;
|
||||
class QTimer;
|
||||
class QFileSystemModel;
|
||||
class QListWidget;
|
||||
class QListWidgetItem;
|
||||
class QTableWidgetItem;
|
||||
class QResizeEvent;
|
||||
class QDockWidget;
|
||||
class QComboBox;
|
||||
class QPushButton;
|
||||
class QToolButton;
|
||||
class QTabWidget;
|
||||
class QPixmap;
|
||||
class QPaintEvent;
|
||||
class QSettings;
|
||||
class QCheckBox;
|
||||
class QFormLayout;
|
||||
class QStyle;
|
||||
class QScrollArea;
|
||||
class LoadCoreWindow;
|
||||
class MainWindow;
|
||||
|
||||
class ThumbnailWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ThumbnailWidget(QWidget *parent = 0);
|
||||
QSize sizeHint() const;
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
};
|
||||
|
||||
class ThumbnailLabel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ThumbnailLabel(QWidget *parent = 0);
|
||||
~ThumbnailLabel();
|
||||
QSize sizeHint() const;
|
||||
public slots:
|
||||
void setPixmap(const QPixmap &pixmap);
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
private:
|
||||
void updateMargins();
|
||||
|
||||
QPixmap *m_pixmap;
|
||||
int m_pixmapWidth;
|
||||
int m_pixmapHeight;
|
||||
};
|
||||
|
||||
class TreeView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TreeView(QWidget *parent = 0);
|
||||
signals:
|
||||
void itemsSelected(QModelIndexList selectedIndexes);
|
||||
protected slots:
|
||||
void columnCountChanged(int oldCount, int newCount);
|
||||
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
|
||||
};
|
||||
|
||||
class TableWidget : public QTableWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TableWidget(QWidget *parent = 0);
|
||||
signals:
|
||||
void enterPressed();
|
||||
protected slots:
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
};
|
||||
|
||||
class AppHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AppHandler(QObject *parent = 0);
|
||||
~AppHandler();
|
||||
void exit();
|
||||
bool isExiting() const;
|
||||
|
||||
private slots:
|
||||
void onLastWindowClosed();
|
||||
};
|
||||
|
||||
class ViewOptionsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ViewOptionsDialog(MainWindow *mainwindow, QWidget *parent = 0);
|
||||
public slots:
|
||||
void showDialog();
|
||||
void hideDialog();
|
||||
void onAccepted();
|
||||
void onRejected();
|
||||
private slots:
|
||||
void onThemeComboBoxIndexChanged(int index);
|
||||
void onHighlightColorChoose();
|
||||
private:
|
||||
void loadViewOptions();
|
||||
void saveViewOptions();
|
||||
void showOrHideHighlightColor();
|
||||
|
||||
MainWindow *m_mainwindow;
|
||||
QSettings *m_settings;
|
||||
QCheckBox *m_saveGeometryCheckBox;
|
||||
QCheckBox *m_saveDockPositionsCheckBox;
|
||||
QCheckBox *m_saveLastTabCheckBox;
|
||||
QCheckBox *m_showHiddenFilesCheckBox;
|
||||
QComboBox *m_themeComboBox;
|
||||
QPushButton *m_highlightColorPushButton;
|
||||
QColor m_highlightColor;
|
||||
QLabel *m_highlightColorLabel;
|
||||
QString m_customThemePath;
|
||||
};
|
||||
|
||||
class CoreInfoLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CoreInfoLabel(QString text = QString(), QWidget *parent = 0);
|
||||
};
|
||||
|
||||
class CoreInfoDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CoreInfoDialog(MainWindow *mainwindow, QWidget *parent = 0);
|
||||
public slots:
|
||||
void showCoreInfo();
|
||||
private:
|
||||
QFormLayout *m_formLayout;
|
||||
MainWindow *m_mainwindow;
|
||||
};
|
||||
|
||||
class CoreInfoWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CoreInfoWidget(CoreInfoLabel *label, QWidget *parent = 0);
|
||||
QSize sizeHint() const;
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
private:
|
||||
CoreInfoLabel *m_label;
|
||||
QScrollArea *m_scrollArea;
|
||||
};
|
||||
|
||||
class LogTextEdit : public QPlainTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LogTextEdit(QWidget *parent = 0);
|
||||
public slots:
|
||||
void appendMessage(const QString& text);
|
||||
};
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Theme
|
||||
{
|
||||
THEME_SYSTEM_DEFAULT,
|
||||
THEME_DARK,
|
||||
THEME_CUSTOM
|
||||
};
|
||||
|
||||
enum MessageBoxType
|
||||
{
|
||||
MSGBOX_TYPE_INFO,
|
||||
MSGBOX_TYPE_WARNING,
|
||||
MSGBOX_TYPE_ERROR,
|
||||
};
|
||||
|
||||
MainWindow(QWidget *parent = NULL);
|
||||
~MainWindow();
|
||||
TreeView* dirTreeView();
|
||||
QListWidget* playlistListWidget();
|
||||
TableWidget* contentTableWidget();
|
||||
QWidget* searchWidget();
|
||||
QLineEdit* searchLineEdit();
|
||||
QComboBox* launchWithComboBox();
|
||||
QToolButton* startCorePushButton();
|
||||
QToolButton* coreInfoPushButton();
|
||||
QToolButton* runPushButton();
|
||||
QToolButton* stopPushButton();
|
||||
QTabWidget* browserAndPlaylistTabWidget();
|
||||
QList<QHash<QString, QString> > getPlaylistDefaultCores();
|
||||
ViewOptionsDialog* viewOptionsDialog();
|
||||
QSettings* settings();
|
||||
QList<QHash<QString, QString> > getCoreInfo();
|
||||
void setTheme(Theme theme = THEME_SYSTEM_DEFAULT);
|
||||
Theme theme();
|
||||
Theme getThemeFromString(QString themeString);
|
||||
QString getThemeString(Theme theme);
|
||||
QHash<QString, QString> getSelectedCore();
|
||||
void showStatusMessage(QString msg, unsigned priority, unsigned duration, bool flush);
|
||||
bool showMessageBox(QString msg, MessageBoxType msgType = MSGBOX_TYPE_INFO, Qt::WindowModality modality = Qt::ApplicationModal);
|
||||
bool setCustomThemeFile(QString filePath);
|
||||
void setCustomThemeString(QString qss);
|
||||
const QString& customThemeString() const;
|
||||
|
||||
signals:
|
||||
void thumbnailChanged(const QPixmap &pixmap);
|
||||
void thumbnail2Changed(const QPixmap &pixmap);
|
||||
void thumbnail3Changed(const QPixmap &pixmap);
|
||||
void gotLogMessage(const QString &msg);
|
||||
void gotStatusMessage(QString msg, unsigned priority, unsigned duration, bool flush);
|
||||
void gotReloadPlaylists();
|
||||
|
||||
public slots:
|
||||
void onBrowserDownloadsClicked();
|
||||
void onBrowserUpClicked();
|
||||
void onBrowserStartClicked();
|
||||
void initContentTableWidget();
|
||||
void onViewClosedDocksAboutToShow();
|
||||
void onShowHiddenDockWidgetAction();
|
||||
void setCoreActions();
|
||||
void onRunClicked();
|
||||
void onStartCoreClicked();
|
||||
void onTableWidgetEnterPressed();
|
||||
void selectBrowserDir(QString path);
|
||||
void resizeThumbnails(bool one, bool two, bool three);
|
||||
void onResizeThumbnailOne();
|
||||
void onResizeThumbnailTwo();
|
||||
void onResizeThumbnailThree();
|
||||
void appendLogMessage(const QString &msg);
|
||||
void onGotLogMessage(const QString &msg);
|
||||
void onGotStatusMessage(QString msg, unsigned priority, unsigned duration, bool flush);
|
||||
void reloadPlaylists();
|
||||
void deferReloadPlaylists();
|
||||
void onGotReloadPlaylists();
|
||||
void showWelcomeScreen();
|
||||
|
||||
private slots:
|
||||
void onLoadCoreClicked(const QStringList &extensionFilters = QStringList());
|
||||
void onUnloadCoreMenuAction();
|
||||
void onTimeout();
|
||||
void onCoreLoaded();
|
||||
void onCurrentListItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
|
||||
void onCurrentTableItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);
|
||||
void onSearchEnterPressed();
|
||||
void onSearchLineEditEdited(const QString &text);
|
||||
void addPlaylistItemsToTable(QString path);
|
||||
void onContentItemDoubleClicked(QTableWidgetItem *item);
|
||||
void onCoreLoadWindowClosed();
|
||||
void onTabWidgetIndexChanged(int index);
|
||||
void onTreeViewItemsSelected(QModelIndexList selectedIndexes);
|
||||
void onSearchResetClicked();
|
||||
void onLaunchWithComboBoxIndexChanged(int index);
|
||||
void onFileBrowserTreeContextMenuRequested(const QPoint &pos);
|
||||
void onPlaylistWidgetContextMenuRequested(const QPoint &pos);
|
||||
void onStopClicked();
|
||||
|
||||
private:
|
||||
void setCurrentCoreLabel();
|
||||
void getPlaylistFiles();
|
||||
bool isCoreLoaded();
|
||||
bool isContentLessCore();
|
||||
|
||||
LoadCoreWindow *m_loadCoreWindow;
|
||||
QTimer *m_timer;
|
||||
QString m_currentCore;
|
||||
QString m_currentCoreVersion;
|
||||
QLabel *m_statusLabel;
|
||||
TreeView *m_dirTree;
|
||||
QFileSystemModel *m_dirModel;
|
||||
QListWidget *m_listWidget;
|
||||
TableWidget *m_tableWidget;
|
||||
QWidget *m_searchWidget;
|
||||
QLineEdit *m_searchLineEdit;
|
||||
QDockWidget *m_searchDock;
|
||||
QStringList m_playlistFiles;
|
||||
QComboBox *m_launchWithComboBox;
|
||||
QToolButton *m_startCorePushButton;
|
||||
QToolButton *m_coreInfoPushButton;
|
||||
QToolButton *m_runPushButton;
|
||||
QToolButton *m_stopPushButton;
|
||||
QTabWidget *m_browserAndPlaylistTabWidget;
|
||||
bool m_pendingRun;
|
||||
QPixmap *m_thumbnailPixmap;
|
||||
QPixmap *m_thumbnailPixmap2;
|
||||
QPixmap *m_thumbnailPixmap3;
|
||||
QRegularExpression m_fileSanitizerRegex;
|
||||
QSettings *m_settings;
|
||||
ViewOptionsDialog *m_viewOptionsDialog;
|
||||
CoreInfoDialog *m_coreInfoDialog;
|
||||
QStyle *m_defaultStyle;
|
||||
QPalette m_defaultPalette;
|
||||
Theme m_currentTheme;
|
||||
QDockWidget *m_coreInfoDock;
|
||||
CoreInfoLabel *m_coreInfoLabel;
|
||||
CoreInfoWidget *m_coreInfoWidget;
|
||||
QDockWidget *m_logDock;
|
||||
QWidget *m_logWidget;
|
||||
LogTextEdit *m_logTextEdit;
|
||||
QVector<QByteArray> m_imageFormats;
|
||||
QListWidgetItem *m_historyPlaylistsItem;
|
||||
QIcon m_folderIcon;
|
||||
QString m_customThemeString;
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
};
|
||||
|
||||
RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct ui_application_qt
|
||||
{
|
||||
QApplication *app;
|
||||
} ui_application_qt_t;
|
||||
|
||||
typedef struct ui_window_qt
|
||||
{
|
||||
MainWindow *qtWindow;
|
||||
} ui_window_qt_t;
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
@ -149,7 +149,7 @@ static void shader_dlg_params_refresh(void)
|
||||
{
|
||||
case SHADER_PARAM_CTRL_CHECKBOX:
|
||||
{
|
||||
bool checked;
|
||||
bool checked;
|
||||
|
||||
video_shader_ctx_t shader_info;
|
||||
video_shader_driver_get_current_shader(&shader_info);
|
||||
@ -769,9 +769,10 @@ static void ui_companion_win32_notify_content_loaded(void *data)
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void ui_companion_win32_toggle(void *data)
|
||||
static void ui_companion_win32_toggle(void *data, bool force)
|
||||
{
|
||||
(void)data;
|
||||
(void)force;
|
||||
}
|
||||
|
||||
static void ui_companion_win32_event_command(
|
||||
@ -789,7 +790,7 @@ static void ui_companion_win32_notify_list_pushed(void *data,
|
||||
(void)menu_list;
|
||||
}
|
||||
|
||||
const ui_companion_driver_t ui_companion_win32 = {
|
||||
ui_companion_driver_t ui_companion_win32 = {
|
||||
ui_companion_win32_init,
|
||||
ui_companion_win32_deinit,
|
||||
ui_companion_win32_iterate,
|
||||
@ -801,6 +802,7 @@ const ui_companion_driver_t ui_companion_win32 = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&ui_browser_window_win32,
|
||||
&ui_msg_window_win32,
|
||||
&ui_window_win32,
|
||||
|
@ -23,9 +23,9 @@
|
||||
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static bool ui_application_win32_initialize(void)
|
||||
static void* ui_application_win32_initialize(void)
|
||||
{
|
||||
return true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool ui_application_win32_pending_events(void)
|
||||
@ -48,9 +48,16 @@ static void ui_application_win32_process_events(void)
|
||||
}
|
||||
}
|
||||
|
||||
const ui_application_t ui_application_win32 = {
|
||||
static void ui_application_win32_run(void *args)
|
||||
{
|
||||
(void)args;
|
||||
}
|
||||
|
||||
ui_application_t ui_application_win32 = {
|
||||
ui_application_win32_initialize,
|
||||
ui_application_win32_pending_events,
|
||||
ui_application_win32_process_events,
|
||||
ui_application_win32_run,
|
||||
NULL,
|
||||
"win32"
|
||||
};
|
||||
|
@ -74,7 +74,7 @@ static bool ui_browser_window_win32_save(ui_browser_window_state_t *state)
|
||||
return ui_browser_window_win32_core(state, true);
|
||||
}
|
||||
|
||||
const ui_browser_window_t ui_browser_window_win32 = {
|
||||
ui_browser_window_t ui_browser_window_win32 = {
|
||||
ui_browser_window_win32_open,
|
||||
ui_browser_window_win32_save,
|
||||
"win32"
|
||||
|
@ -97,7 +97,7 @@ static enum ui_msg_window_response ui_msg_window_win32_warning(ui_msg_window_sta
|
||||
return ui_msg_window_win32_response(state, MessageBoxA(NULL, (LPCSTR)state->text, (LPCSTR)state->title, flags));
|
||||
}
|
||||
|
||||
const ui_msg_window_t ui_msg_window_win32 = {
|
||||
ui_msg_window_t ui_msg_window_win32 = {
|
||||
ui_msg_window_win32_error,
|
||||
ui_msg_window_win32_information,
|
||||
ui_msg_window_win32_question,
|
||||
|
@ -50,6 +50,11 @@
|
||||
#include "../../../retroarch.h"
|
||||
#include "../../../tasks/tasks_internal.h"
|
||||
|
||||
static void* ui_window_win32_init(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void ui_window_win32_destroy(void *data)
|
||||
{
|
||||
ui_window_win32_t *window = (ui_window_win32_t*)data;
|
||||
@ -89,7 +94,8 @@ static bool ui_window_win32_focused(void *data)
|
||||
return (GetForegroundWindow() == window->hwnd);
|
||||
}
|
||||
|
||||
const ui_window_t ui_window_win32 = {
|
||||
ui_window_t ui_window_win32 = {
|
||||
ui_window_win32_init,
|
||||
ui_window_win32_destroy,
|
||||
ui_window_win32_set_focused,
|
||||
ui_window_win32_set_visible,
|
||||
|
@ -26,11 +26,7 @@
|
||||
|
||||
#include "ui_companion_driver.h"
|
||||
|
||||
|
||||
static const ui_companion_driver_t *ui_companion_drivers[] = {
|
||||
#ifdef HAVE_QT_WRAPPER
|
||||
&ui_companion_qt,
|
||||
#endif
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
&ui_companion_win32,
|
||||
#endif
|
||||
@ -39,17 +35,18 @@ static const ui_companion_driver_t *ui_companion_drivers[] = {
|
||||
#endif
|
||||
#ifdef HAVE_COCOATOUCH
|
||||
&ui_companion_cocoatouch,
|
||||
#endif
|
||||
#ifdef HAVE_QT
|
||||
&ui_companion_qt,
|
||||
#endif
|
||||
&ui_companion_null,
|
||||
NULL
|
||||
};
|
||||
|
||||
static bool main_ui_companion_is_on_foreground;
|
||||
static const ui_companion_driver_t *ui_companion;
|
||||
static void *ui_companion_data;
|
||||
static bool main_ui_companion_is_on_foreground = false;
|
||||
static const ui_companion_driver_t *ui_companion = NULL;
|
||||
static void *ui_companion_data = NULL;
|
||||
|
||||
#ifdef HAVE_QT
|
||||
static void *ui_companion_qt_data = NULL;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ui_companion_find_driver:
|
||||
@ -114,6 +111,11 @@ void ui_companion_driver_deinit(void)
|
||||
return;
|
||||
if (ui->deinit)
|
||||
ui->deinit(ui_companion_data);
|
||||
|
||||
#ifdef HAVE_QT
|
||||
ui_companion_qt.deinit(ui_companion_qt_data);
|
||||
ui_companion_qt_data = NULL;
|
||||
#endif
|
||||
ui_companion_data = NULL;
|
||||
}
|
||||
|
||||
@ -123,17 +125,36 @@ void ui_companion_driver_init_first(void)
|
||||
|
||||
ui_companion = (ui_companion_driver_t*)ui_companion_init_first();
|
||||
|
||||
if (ui_companion && ui_companion->toggle)
|
||||
#ifdef HAVE_QT
|
||||
ui_companion_qt_data = ui_companion_qt.init();
|
||||
#endif
|
||||
|
||||
if (ui_companion)
|
||||
{
|
||||
if (settings->bools.ui_companion_start_on_boot)
|
||||
ui_companion->toggle(ui_companion_data);
|
||||
{
|
||||
if (ui_companion->init)
|
||||
ui_companion_data = ui_companion->init();
|
||||
|
||||
if (ui_companion->toggle)
|
||||
ui_companion->toggle(ui_companion_data, false);
|
||||
|
||||
#ifdef HAVE_QT
|
||||
ui_companion_qt.toggle(ui_companion_qt_data, false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ui_companion_driver_toggle(void)
|
||||
void ui_companion_driver_toggle(bool force)
|
||||
{
|
||||
if (ui_companion && ui_companion->toggle)
|
||||
ui_companion->toggle(ui_companion_data);
|
||||
ui_companion->toggle(ui_companion_data, false);
|
||||
|
||||
#ifdef HAVE_QT
|
||||
if (ui_companion_qt.toggle)
|
||||
ui_companion_qt.toggle(ui_companion_qt_data, force);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ui_companion_driver_notify_refresh(void)
|
||||
@ -143,6 +164,10 @@ void ui_companion_driver_notify_refresh(void)
|
||||
return;
|
||||
if (ui->notify_refresh)
|
||||
ui->notify_refresh(ui_companion_data);
|
||||
#ifdef HAVE_QT
|
||||
if (ui_companion_qt.notify_refresh)
|
||||
ui_companion_qt.notify_refresh(ui_companion_qt_data);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ui_companion_driver_notify_list_loaded(file_list_t *list, file_list_t *menu_list)
|
||||
@ -192,6 +217,13 @@ const ui_browser_window_t *ui_companion_driver_get_browser_window_ptr(void)
|
||||
return ui->browser_window;
|
||||
}
|
||||
|
||||
#ifdef HAVE_QT
|
||||
const ui_application_t *ui_companion_driver_get_qt_application_ptr(void)
|
||||
{
|
||||
return ui_companion_qt.application;
|
||||
}
|
||||
#endif
|
||||
|
||||
const ui_application_t *ui_companion_driver_get_application_ptr(void)
|
||||
{
|
||||
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
||||
@ -200,6 +232,17 @@ const ui_application_t *ui_companion_driver_get_application_ptr(void)
|
||||
return ui->application;
|
||||
}
|
||||
|
||||
void ui_companion_driver_msg_queue_push(const char *msg, unsigned priority, unsigned duration, bool flush)
|
||||
{
|
||||
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
||||
if (ui && ui->msg_queue_push)
|
||||
ui->msg_queue_push(ui_companion_data, msg, priority, duration, flush);
|
||||
#ifdef HAVE_QT
|
||||
if (ui_companion_qt.msg_queue_push)
|
||||
ui_companion_qt.msg_queue_push(ui_companion_qt_data, msg, priority, duration, flush);
|
||||
#endif
|
||||
}
|
||||
|
||||
void *ui_companion_driver_get_main_window(void)
|
||||
{
|
||||
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
||||
@ -215,3 +258,13 @@ const char *ui_companion_driver_get_ident(void)
|
||||
return "null";
|
||||
return ui->ident;
|
||||
}
|
||||
|
||||
void ui_companion_driver_log_msg(const char *msg)
|
||||
{
|
||||
(void)msg;
|
||||
|
||||
#ifdef HAVE_QT
|
||||
if (ui_companion_qt_data)
|
||||
ui_companion_qt.log_msg(ui_companion_qt_data, msg);
|
||||
#endif
|
||||
}
|
||||
|
@ -104,14 +104,17 @@ typedef struct ui_msg_window
|
||||
|
||||
typedef struct ui_application
|
||||
{
|
||||
bool (*initialize)(void);
|
||||
void* (*initialize)(void);
|
||||
bool (*pending_events)(void);
|
||||
void (*process_events)(void);
|
||||
void (*run)(void *args);
|
||||
void (*quit)(void);
|
||||
const char *ident;
|
||||
} ui_application_t;
|
||||
|
||||
typedef struct ui_window
|
||||
{
|
||||
void* (*init)(void);
|
||||
void (*destroy)(void *data);
|
||||
void (*set_focused)(void *data);
|
||||
void (*set_visible)(void *data, bool visible);
|
||||
@ -126,46 +129,47 @@ typedef struct ui_companion_driver
|
||||
void *(*init)(void);
|
||||
void (*deinit)(void *data);
|
||||
int (*iterate)(void *data, unsigned action);
|
||||
void (*toggle)(void *data);
|
||||
void (*toggle)(void *data, bool force);
|
||||
void (*event_command)(void *data, enum event_command action);
|
||||
void (*notify_content_loaded)(void *data);
|
||||
void (*notify_list_loaded)(void *data, file_list_t *list, file_list_t *menu_list);
|
||||
void (*notify_refresh)(void *data);
|
||||
void (*msg_queue_push)(const char *msg, unsigned priority, unsigned duration, bool flush);
|
||||
void (*msg_queue_push)(void *data, const char *msg, unsigned priority, unsigned duration, bool flush);
|
||||
void (*render_messagebox)(const char *msg);
|
||||
void *(*get_main_window)(void *data);
|
||||
const ui_browser_window_t *browser_window;
|
||||
const ui_msg_window_t *msg_window;
|
||||
const ui_window_t *window;
|
||||
const ui_application_t *application;
|
||||
void (*log_msg)(void *data, const char *msg);
|
||||
ui_browser_window_t *browser_window;
|
||||
ui_msg_window_t *msg_window;
|
||||
ui_window_t *window;
|
||||
ui_application_t *application;
|
||||
const char *ident;
|
||||
} ui_companion_driver_t;
|
||||
|
||||
extern const ui_browser_window_t ui_browser_window_null;
|
||||
extern const ui_browser_window_t ui_browser_window_cocoa;
|
||||
extern const ui_browser_window_t ui_browser_window_qt;
|
||||
extern const ui_browser_window_t ui_browser_window_win32;
|
||||
extern ui_browser_window_t ui_browser_window_null;
|
||||
extern ui_browser_window_t ui_browser_window_cocoa;
|
||||
extern ui_browser_window_t ui_browser_window_qt;
|
||||
extern ui_browser_window_t ui_browser_window_win32;
|
||||
|
||||
extern const ui_window_t ui_window_null;
|
||||
extern const ui_window_t ui_window_cocoa;
|
||||
extern const ui_window_t ui_window_qt;
|
||||
extern const ui_window_t ui_window_win32;
|
||||
extern ui_window_t ui_window_null;
|
||||
extern ui_window_t ui_window_cocoa;
|
||||
extern ui_window_t ui_window_qt;
|
||||
extern ui_window_t ui_window_win32;
|
||||
|
||||
extern const ui_msg_window_t ui_msg_window_null;
|
||||
extern const ui_msg_window_t ui_msg_window_win32;
|
||||
extern const ui_msg_window_t ui_msg_window_qt;
|
||||
extern const ui_msg_window_t ui_msg_window_cocoa;
|
||||
extern ui_msg_window_t ui_msg_window_null;
|
||||
extern ui_msg_window_t ui_msg_window_win32;
|
||||
extern ui_msg_window_t ui_msg_window_qt;
|
||||
extern ui_msg_window_t ui_msg_window_cocoa;
|
||||
|
||||
extern const ui_application_t ui_application_null;
|
||||
extern const ui_application_t ui_application_cocoa;
|
||||
extern const ui_application_t ui_application_qt;
|
||||
extern const ui_application_t ui_application_win32;
|
||||
extern ui_application_t ui_application_null;
|
||||
extern ui_application_t ui_application_cocoa;
|
||||
extern ui_application_t ui_application_qt;
|
||||
extern ui_application_t ui_application_win32;
|
||||
|
||||
extern const ui_companion_driver_t ui_companion_null;
|
||||
extern const ui_companion_driver_t ui_companion_cocoa;
|
||||
extern const ui_companion_driver_t ui_companion_cocoatouch;
|
||||
extern const ui_companion_driver_t ui_companion_qt;
|
||||
extern const ui_companion_driver_t ui_companion_win32;
|
||||
extern ui_companion_driver_t ui_companion_null;
|
||||
extern ui_companion_driver_t ui_companion_cocoa;
|
||||
extern ui_companion_driver_t ui_companion_cocoatouch;
|
||||
extern ui_companion_driver_t ui_companion_qt;
|
||||
extern ui_companion_driver_t ui_companion_win32;
|
||||
|
||||
/**
|
||||
* ui_companion_find_driver:
|
||||
@ -204,7 +208,7 @@ void ui_companion_driver_notify_list_loaded(file_list_t *list, file_list_t *menu
|
||||
|
||||
void ui_companion_driver_notify_content_loaded(void);
|
||||
|
||||
void ui_companion_driver_toggle(void);
|
||||
void ui_companion_driver_toggle(bool force);
|
||||
|
||||
void ui_companion_driver_free(void);
|
||||
|
||||
@ -216,6 +220,14 @@ const ui_window_t *ui_companion_driver_get_window_ptr(void);
|
||||
|
||||
const ui_application_t *ui_companion_driver_get_application_ptr(void);
|
||||
|
||||
#ifdef HAVE_QT
|
||||
const ui_application_t *ui_companion_driver_get_qt_application_ptr(void);
|
||||
#endif
|
||||
|
||||
void ui_companion_driver_log_msg(const char *msg);
|
||||
|
||||
void ui_companion_driver_msg_queue_push(const char *msg, unsigned priority, unsigned duration, bool flush);
|
||||
|
||||
void *ui_companion_driver_get_main_window(void);
|
||||
|
||||
const char *ui_companion_driver_get_ident(void);
|
||||
|
31
verbosity.c
31
verbosity.c
@ -52,6 +52,10 @@
|
||||
#include "file_path_special.h"
|
||||
#include "verbosity.h"
|
||||
|
||||
#ifdef HAVE_QT
|
||||
#include "ui/ui_companion_driver.h"
|
||||
#endif
|
||||
|
||||
/* If this is non-NULL. RARCH_LOG and friends
|
||||
* will write to this file. */
|
||||
static FILE *log_file_fp = NULL;
|
||||
@ -174,16 +178,35 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
|
||||
#else
|
||||
|
||||
{
|
||||
#ifdef HAVE_QT
|
||||
char buffer[1024];
|
||||
#endif
|
||||
#ifdef HAVE_FILE_LOGGER
|
||||
FILE *fp = (FILE*)retro_main_log_file();
|
||||
#else
|
||||
FILE *fp = stderr;
|
||||
#endif
|
||||
|
||||
fprintf(fp, "%s ",
|
||||
tag ? tag : file_path_str(FILE_PATH_LOG_INFO));
|
||||
vfprintf(fp, fmt, ap);
|
||||
fflush(fp);
|
||||
#ifdef HAVE_QT
|
||||
buffer[0] = '\0';
|
||||
vsnprintf(buffer, sizeof(buffer), fmt, ap);
|
||||
|
||||
if (fp)
|
||||
{
|
||||
fprintf(fp, "%s", buffer);
|
||||
fflush(fp);
|
||||
}
|
||||
|
||||
ui_companion_driver_log_msg(buffer);
|
||||
#else
|
||||
if (fp)
|
||||
{
|
||||
fprintf(fp, "%s ",
|
||||
tag ? tag : file_path_str(FILE_PATH_LOG_INFO));
|
||||
vfprintf(fp, fmt, ap);
|
||||
fflush(fp);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user