diff --git a/src/eden/CMakeLists.txt b/src/eden/CMakeLists.txt index 50d9b30db7..329b07bae7 100644 --- a/src/eden/CMakeLists.txt +++ b/src/eden/CMakeLists.txt @@ -6,78 +6,4 @@ find_package(Qt6 REQUIRED COMPONENTS Widgets Core Gui Quick QuickControls2) qt_standard_project_setup(REQUIRES 6.7) -qt_add_executable(yuzu - main.cpp - icons.qrc -) - -add_subdirectory(qml) -add_subdirectory(interface) -add_subdirectory(models) - -set(PLUGINS - edenMainplugin - edenItemsplugin - edenConfigplugin - edenInterfaceplugin - edenConstantsplugin - edenUtilplugin -) - -if (ENABLE_SDL2) - add_subdirectory(gamepad) - set(PLUGINS ${PLUGINS} edenGamepadplugin) -endif() - -target_link_libraries(yuzu - PRIVATE - Qt6::Core - Qt6::Widgets - Qt6::Gui - Qt6::Quick - Qt6::QuickControls2 - edenModels - - # Explicitly link to static plugins - ${PLUGINS} -) - -set(NATIVE_MODULES yuzu edenInterface) - -foreach(MODULE ${NATIVE_MODULES}) - target_link_libraries(${MODULE} PRIVATE common core input_common frontend_common network video_core) - target_link_libraries(${MODULE} PRIVATE Boost::headers glad fmt) - target_link_libraries(${MODULE} PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) - - target_link_libraries(${MODULE} PRIVATE Vulkan::Headers) - - if (NOT WIN32) - target_include_directories(${MODULE} PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS}) - endif() - if (UNIX AND NOT APPLE) - target_link_libraries(${MODULE} PRIVATE Qt6::DBus) - endif() - - target_compile_definitions(${MODULE} PRIVATE - # Use QStringBuilder for string concatenation to reduce - # the overall number of temporary strings created. - -DQT_USE_QSTRINGBUILDER - - # Disable implicit type narrowing in signal/slot connect() calls. - -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT - - # Disable unsafe overloads of QProcess' start() function. - -DQT_NO_PROCESS_COMBINED_ARGUMENT_START - - # Disable implicit QString->QUrl conversions to enforce use of proper resolving functions. - -DQT_NO_URL_CAST_FROM_STRING - ) -endforeach() - -set_target_properties(yuzu PROPERTIES OUTPUT_NAME "eden") -include(GNUInstallDirs) -install(TARGETS yuzu - BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +add_subdirectory(Eden) diff --git a/src/eden/Eden/CMakeLists.txt b/src/eden/Eden/CMakeLists.txt new file mode 100644 index 0000000000..c3904c36d0 --- /dev/null +++ b/src/eden/Eden/CMakeLists.txt @@ -0,0 +1,9 @@ +include_directories(AFTER "${CMAKE_CURRENT_SOURCE_DIR}") + +add_subdirectory(Config) +add_subdirectory(Constants) +add_subdirectory(Items) +add_subdirectory(Util) +add_subdirectory(Main) + +add_subdirectory(Native) diff --git a/src/eden/qml/config/CMakeLists.txt b/src/eden/Eden/Config/CMakeLists.txt similarity index 95% rename from src/eden/qml/config/CMakeLists.txt rename to src/eden/Eden/Config/CMakeLists.txt index 94b0bf7a0e..d5aefc012b 100644 --- a/src/eden/qml/config/CMakeLists.txt +++ b/src/eden/Eden/Config/CMakeLists.txt @@ -1,8 +1,8 @@ set(CMAKE_AUTOMOC ON) -qt_add_library(edenConfig STATIC) -qt_add_qml_module(edenConfig - URI org.eden_emu.config +qt_add_library(EdenConfig STATIC) +qt_add_qml_module(EdenConfig + URI Eden.Config VERSION 1.0 QML_FILES GlobalConfigureDialog.qml diff --git a/src/eden/qml/config/GlobalConfigureDialog.qml b/src/eden/Eden/Config/GlobalConfigureDialog.qml similarity index 93% rename from src/eden/qml/config/GlobalConfigureDialog.qml rename to src/eden/Eden/Config/GlobalConfigureDialog.qml index 50d81a5469..3d4ad2c955 100644 --- a/src/eden/qml/config/GlobalConfigureDialog.qml +++ b/src/eden/Eden/Config/GlobalConfigureDialog.qml @@ -2,10 +2,10 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.constants -import org.eden_emu.items -import org.eden_emu.interface -import org.eden_emu.util +import Eden.Constants +import Eden.Items +import Eden.Native.Interface +import Eden.Util AnimatedDialog { property list configs diff --git a/src/eden/qml/config/SectionHeader.qml b/src/eden/Eden/Config/SectionHeader.qml similarity index 71% rename from src/eden/qml/config/SectionHeader.qml rename to src/eden/Eden/Config/SectionHeader.qml index 2a69504bd2..47da4fb070 100644 --- a/src/eden/qml/config/SectionHeader.qml +++ b/src/eden/Eden/Config/SectionHeader.qml @@ -1,6 +1,6 @@ import QtQuick -import org.eden_emu.constants +import Eden.Constants Text { color: Constants.text diff --git a/src/eden/qml/config/Setting.qml b/src/eden/Eden/Config/Setting.qml similarity index 98% rename from src/eden/qml/config/Setting.qml rename to src/eden/Eden/Config/Setting.qml index 5da913689c..8f2518c7e9 100644 --- a/src/eden/qml/config/Setting.qml +++ b/src/eden/Eden/Config/Setting.qml @@ -2,7 +2,7 @@ import QtQuick import Qt.labs.qmlmodels -import org.eden_emu.config +import Eden.Config // TODO: make settings independently available (model vs setting? DelegateChooser { diff --git a/src/eden/qml/config/TestSetting.qml b/src/eden/Eden/Config/TestSetting.qml similarity index 96% rename from src/eden/qml/config/TestSetting.qml rename to src/eden/Eden/Config/TestSetting.qml index e8d6e36d50..9029f8dc4b 100644 --- a/src/eden/qml/config/TestSetting.qml +++ b/src/eden/Eden/Config/TestSetting.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.constants +import Eden.Constants Column { topPadding: 5 * Constants.scalar diff --git a/src/eden/qml/config/fields/BaseField.qml b/src/eden/Eden/Config/fields/BaseField.qml similarity index 97% rename from src/eden/qml/config/fields/BaseField.qml rename to src/eden/Eden/Config/fields/BaseField.qml index dc9f22d92b..23973e29d9 100644 --- a/src/eden/qml/config/fields/BaseField.qml +++ b/src/eden/Eden/Config/fields/BaseField.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.items -import org.eden_emu.config -import org.eden_emu.constants +import Eden.Items +import Eden.Config +import Eden.Constants Item { id: field diff --git a/src/eden/qml/config/fields/ConfigCheckbox.qml b/src/eden/Eden/Config/fields/ConfigCheckbox.qml similarity index 95% rename from src/eden/qml/config/fields/ConfigCheckbox.qml rename to src/eden/Eden/Config/fields/ConfigCheckbox.qml index e40d28833b..8b41ae5b8a 100644 --- a/src/eden/qml/config/fields/ConfigCheckbox.qml +++ b/src/eden/Eden/Config/fields/ConfigCheckbox.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.constants +import Eden.Constants BaseField { forceCheckbox: true diff --git a/src/eden/qml/config/fields/ConfigComboBox.qml b/src/eden/Eden/Config/fields/ConfigComboBox.qml similarity index 94% rename from src/eden/qml/config/fields/ConfigComboBox.qml rename to src/eden/Eden/Config/fields/ConfigComboBox.qml index c4762813b7..bf555d279a 100644 --- a/src/eden/qml/config/fields/ConfigComboBox.qml +++ b/src/eden/Eden/Config/fields/ConfigComboBox.qml @@ -3,8 +3,8 @@ import QtQuick.Controls.Material import QtQuick.Layouts import QtQuick.Controls.Material.impl -import org.eden_emu.constants -import org.eden_emu.config +import Eden.Constants +import Eden.Config BaseField { contentItem: ComboBox { diff --git a/src/eden/qml/config/fields/ConfigHexEdit.qml b/src/eden/Eden/Config/fields/ConfigHexEdit.qml similarity index 85% rename from src/eden/qml/config/fields/ConfigHexEdit.qml rename to src/eden/Eden/Config/fields/ConfigHexEdit.qml index 0e4a3c1974..043b48ec42 100644 --- a/src/eden/qml/config/fields/ConfigHexEdit.qml +++ b/src/eden/Eden/Config/fields/ConfigHexEdit.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.items -import org.eden_emu.config -import org.eden_emu.constants +import Eden.Items +import Eden.Config +import Eden.Constants BaseField { contentItem: BetterTextField { diff --git a/src/eden/qml/config/fields/ConfigIntLine.qml b/src/eden/Eden/Config/fields/ConfigIntLine.qml similarity index 85% rename from src/eden/qml/config/fields/ConfigIntLine.qml rename to src/eden/Eden/Config/fields/ConfigIntLine.qml index 6f48b72492..5dc45343ec 100644 --- a/src/eden/qml/config/fields/ConfigIntLine.qml +++ b/src/eden/Eden/Config/fields/ConfigIntLine.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.items -import org.eden_emu.config -import org.eden_emu.constants +import Eden.Items +import Eden.Config +import Eden.Constants BaseField { contentItem: BetterTextField { diff --git a/src/eden/qml/config/fields/ConfigIntSlider.qml b/src/eden/Eden/Config/fields/ConfigIntSlider.qml similarity index 89% rename from src/eden/qml/config/fields/ConfigIntSlider.qml rename to src/eden/Eden/Config/fields/ConfigIntSlider.qml index 9428a0c791..7693ad824e 100644 --- a/src/eden/qml/config/fields/ConfigIntSlider.qml +++ b/src/eden/Eden/Config/fields/ConfigIntSlider.qml @@ -2,9 +2,9 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.items -import org.eden_emu.config -import org.eden_emu.constants +import Eden.Items +import Eden.Config +import Eden.Constants // Lots of cancer but idrc BaseField { diff --git a/src/eden/qml/config/fields/ConfigIntSpin.qml b/src/eden/Eden/Config/fields/ConfigIntSpin.qml similarity index 83% rename from src/eden/qml/config/fields/ConfigIntSpin.qml rename to src/eden/Eden/Config/fields/ConfigIntSpin.qml index 3fe0a82183..8e8c23f76f 100644 --- a/src/eden/qml/config/fields/ConfigIntSpin.qml +++ b/src/eden/Eden/Config/fields/ConfigIntSpin.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.items -import org.eden_emu.config -import org.eden_emu.constants +import Eden.Items +import Eden.Config +import Eden.Constants BaseField { id: field diff --git a/src/eden/qml/config/fields/ConfigStringEdit.qml b/src/eden/Eden/Config/fields/ConfigStringEdit.qml similarity index 80% rename from src/eden/qml/config/fields/ConfigStringEdit.qml rename to src/eden/Eden/Config/fields/ConfigStringEdit.qml index 11c58ac7a3..beae2b0362 100644 --- a/src/eden/qml/config/fields/ConfigStringEdit.qml +++ b/src/eden/Eden/Config/fields/ConfigStringEdit.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.items -import org.eden_emu.config -import org.eden_emu.constants +import Eden.Items +import Eden.Config +import Eden.Constants BaseField { contentItem: BetterTextField { diff --git a/src/eden/qml/config/fields/ConfigTimeEdit.qml b/src/eden/Eden/Config/fields/ConfigTimeEdit.qml similarity index 85% rename from src/eden/qml/config/fields/ConfigTimeEdit.qml rename to src/eden/Eden/Config/fields/ConfigTimeEdit.qml index 66c731c7ed..01ebc6d6b1 100644 --- a/src/eden/qml/config/fields/ConfigTimeEdit.qml +++ b/src/eden/Eden/Config/fields/ConfigTimeEdit.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.items -import org.eden_emu.config -import org.eden_emu.constants +import Eden.Items +import Eden.Config +import Eden.Constants BaseField { // TODO: real impl diff --git a/src/eden/qml/config/fields/FieldCheckbox.qml b/src/eden/Eden/Config/fields/FieldCheckbox.qml similarity index 93% rename from src/eden/qml/config/fields/FieldCheckbox.qml rename to src/eden/Eden/Config/fields/FieldCheckbox.qml index 0e4e00d6a8..531f2bb624 100644 --- a/src/eden/qml/config/fields/FieldCheckbox.qml +++ b/src/eden/Eden/Config/fields/FieldCheckbox.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -import org.eden_emu.constants +import Eden.Constants CheckBox { property bool force: false diff --git a/src/eden/qml/config/fields/FieldLabel.qml b/src/eden/Eden/Config/fields/FieldLabel.qml similarity index 90% rename from src/eden/qml/config/fields/FieldLabel.qml rename to src/eden/Eden/Config/fields/FieldLabel.qml index 71ef3ad228..d94ee58c92 100644 --- a/src/eden/qml/config/fields/FieldLabel.qml +++ b/src/eden/Eden/Config/fields/FieldLabel.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -import org.eden_emu.constants +import Eden.Constants Text { property var setting diff --git a/src/eden/qml/config/icons.qrc b/src/eden/Eden/Config/icons.qrc similarity index 100% rename from src/eden/qml/config/icons.qrc rename to src/eden/Eden/Config/icons.qrc diff --git a/src/eden/qml/config/pages/SettingsList.qml b/src/eden/Eden/Config/pages/SettingsList.qml similarity index 91% rename from src/eden/qml/config/pages/SettingsList.qml rename to src/eden/Eden/Config/pages/SettingsList.qml index 13a1b4fdbf..73c6b27c76 100644 --- a/src/eden/qml/config/pages/SettingsList.qml +++ b/src/eden/Eden/Config/pages/SettingsList.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Layouts -import org.eden_emu.config -import org.eden_emu.constants -import org.eden_emu.interface +import Eden.Config +import Eden.Constants +import Eden.Native.Interface ColumnLayout { required property int category diff --git a/src/eden/qml/config/pages/audio/AudioGeneralPage.qml b/src/eden/Eden/Config/pages/audio/AudioGeneralPage.qml similarity index 82% rename from src/eden/qml/config/pages/audio/AudioGeneralPage.qml rename to src/eden/Eden/Config/pages/audio/AudioGeneralPage.qml index 83217cb420..9c86400a8c 100644 --- a/src/eden/qml/config/pages/audio/AudioGeneralPage.qml +++ b/src/eden/Eden/Config/pages/audio/AudioGeneralPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/cpu/CpuGeneralPage.qml b/src/eden/Eden/Config/pages/cpu/CpuGeneralPage.qml similarity index 82% rename from src/eden/qml/config/pages/cpu/CpuGeneralPage.qml rename to src/eden/Eden/Config/pages/cpu/CpuGeneralPage.qml index 49e52a87f9..a3c44e4892 100644 --- a/src/eden/qml/config/pages/cpu/CpuGeneralPage.qml +++ b/src/eden/Eden/Config/pages/cpu/CpuGeneralPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/debug/DebugAdvancedPage.qml b/src/eden/Eden/Config/pages/debug/DebugAdvancedPage.qml similarity index 83% rename from src/eden/qml/config/pages/debug/DebugAdvancedPage.qml rename to src/eden/Eden/Config/pages/debug/DebugAdvancedPage.qml index c5ee3b73b3..5d0443334f 100644 --- a/src/eden/qml/config/pages/debug/DebugAdvancedPage.qml +++ b/src/eden/Eden/Config/pages/debug/DebugAdvancedPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/debug/DebugCpuPage.qml b/src/eden/Eden/Config/pages/debug/DebugCpuPage.qml similarity index 82% rename from src/eden/qml/config/pages/debug/DebugCpuPage.qml rename to src/eden/Eden/Config/pages/debug/DebugCpuPage.qml index 67c9f612d1..aa58851cd7 100644 --- a/src/eden/qml/config/pages/debug/DebugCpuPage.qml +++ b/src/eden/Eden/Config/pages/debug/DebugCpuPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/debug/DebugGeneralPage.qml b/src/eden/Eden/Config/pages/debug/DebugGeneralPage.qml similarity index 90% rename from src/eden/qml/config/pages/debug/DebugGeneralPage.qml rename to src/eden/Eden/Config/pages/debug/DebugGeneralPage.qml index 7fa39e315e..0c0fb00f72 100644 --- a/src/eden/qml/config/pages/debug/DebugGeneralPage.qml +++ b/src/eden/Eden/Config/pages/debug/DebugGeneralPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/debug/DebugGraphicsPage.qml b/src/eden/Eden/Config/pages/debug/DebugGraphicsPage.qml similarity index 84% rename from src/eden/qml/config/pages/debug/DebugGraphicsPage.qml rename to src/eden/Eden/Config/pages/debug/DebugGraphicsPage.qml index 8f34c525ee..bcae356161 100644 --- a/src/eden/qml/config/pages/debug/DebugGraphicsPage.qml +++ b/src/eden/Eden/Config/pages/debug/DebugGraphicsPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/general/UiGameListPage.qml b/src/eden/Eden/Config/pages/general/UiGameListPage.qml similarity index 84% rename from src/eden/qml/config/pages/general/UiGameListPage.qml rename to src/eden/Eden/Config/pages/general/UiGameListPage.qml index 7ec92a11ba..930e4fe61b 100644 --- a/src/eden/qml/config/pages/general/UiGameListPage.qml +++ b/src/eden/Eden/Config/pages/general/UiGameListPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/general/UiGeneralPage.qml b/src/eden/Eden/Config/pages/general/UiGeneralPage.qml similarity index 89% rename from src/eden/qml/config/pages/general/UiGeneralPage.qml rename to src/eden/Eden/Config/pages/general/UiGeneralPage.qml index 06ad55d49c..16ee8a6ecc 100644 --- a/src/eden/qml/config/pages/general/UiGeneralPage.qml +++ b/src/eden/Eden/Config/pages/general/UiGeneralPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/global/GlobalAudioPage.qml b/src/eden/Eden/Config/pages/global/GlobalAudioPage.qml similarity index 88% rename from src/eden/qml/config/pages/global/GlobalAudioPage.qml rename to src/eden/Eden/Config/pages/global/GlobalAudioPage.qml index 73ed7f20fe..1edff2a9b4 100644 --- a/src/eden/qml/config/pages/global/GlobalAudioPage.qml +++ b/src/eden/Eden/Config/pages/global/GlobalAudioPage.qml @@ -1,6 +1,6 @@ import QtQuick -import org.eden_emu.config +import Eden.Config GlobalTab { property alias swipe: swipe diff --git a/src/eden/qml/config/pages/global/GlobalCpuPage.qml b/src/eden/Eden/Config/pages/global/GlobalCpuPage.qml similarity index 88% rename from src/eden/qml/config/pages/global/GlobalCpuPage.qml rename to src/eden/Eden/Config/pages/global/GlobalCpuPage.qml index 457565ede7..ead6fdd9c6 100644 --- a/src/eden/qml/config/pages/global/GlobalCpuPage.qml +++ b/src/eden/Eden/Config/pages/global/GlobalCpuPage.qml @@ -1,6 +1,6 @@ import QtQuick -import org.eden_emu.config +import Eden.Config GlobalTab { property alias swipe: swipe diff --git a/src/eden/qml/config/pages/global/GlobalDebugPage.qml b/src/eden/Eden/Config/pages/global/GlobalDebugPage.qml similarity index 92% rename from src/eden/qml/config/pages/global/GlobalDebugPage.qml rename to src/eden/Eden/Config/pages/global/GlobalDebugPage.qml index bbbbfbf29f..ee1f49a005 100644 --- a/src/eden/qml/config/pages/global/GlobalDebugPage.qml +++ b/src/eden/Eden/Config/pages/global/GlobalDebugPage.qml @@ -1,6 +1,6 @@ import QtQuick -import org.eden_emu.config +import Eden.Config GlobalTab { property alias swipe: swipe diff --git a/src/eden/qml/config/pages/global/GlobalGeneralPage.qml b/src/eden/Eden/Config/pages/global/GlobalGeneralPage.qml similarity index 91% rename from src/eden/qml/config/pages/global/GlobalGeneralPage.qml rename to src/eden/Eden/Config/pages/global/GlobalGeneralPage.qml index feae9cd482..e1e5a906a7 100644 --- a/src/eden/qml/config/pages/global/GlobalGeneralPage.qml +++ b/src/eden/Eden/Config/pages/global/GlobalGeneralPage.qml @@ -1,6 +1,6 @@ import QtQuick -import org.eden_emu.config +import Eden.Config GlobalTab { property alias swipe: swipe diff --git a/src/eden/qml/config/pages/global/GlobalGraphicsPage.qml b/src/eden/Eden/Config/pages/global/GlobalGraphicsPage.qml similarity index 91% rename from src/eden/qml/config/pages/global/GlobalGraphicsPage.qml rename to src/eden/Eden/Config/pages/global/GlobalGraphicsPage.qml index 67380be9e4..4e15cd01f6 100644 --- a/src/eden/qml/config/pages/global/GlobalGraphicsPage.qml +++ b/src/eden/Eden/Config/pages/global/GlobalGraphicsPage.qml @@ -1,6 +1,6 @@ import QtQuick -import org.eden_emu.config +import Eden.Config GlobalTab { property alias swipe: swipe diff --git a/src/eden/qml/config/pages/global/GlobalSystemPage.qml b/src/eden/Eden/Config/pages/global/GlobalSystemPage.qml similarity index 92% rename from src/eden/qml/config/pages/global/GlobalSystemPage.qml rename to src/eden/Eden/Config/pages/global/GlobalSystemPage.qml index 1fa34e0d26..b482f7b57f 100644 --- a/src/eden/qml/config/pages/global/GlobalSystemPage.qml +++ b/src/eden/Eden/Config/pages/global/GlobalSystemPage.qml @@ -1,6 +1,6 @@ import QtQuick -import org.eden_emu.config +import Eden.Config GlobalTab { property alias swipe: swipe diff --git a/src/eden/qml/config/pages/global/GlobalTab.qml b/src/eden/Eden/Config/pages/global/GlobalTab.qml similarity index 95% rename from src/eden/qml/config/pages/global/GlobalTab.qml rename to src/eden/Eden/Config/pages/global/GlobalTab.qml index 68a262aedc..463a7c2d83 100644 --- a/src/eden/qml/config/pages/global/GlobalTab.qml +++ b/src/eden/Eden/Config/pages/global/GlobalTab.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls.Material -import org.eden_emu.constants +import Eden.Constants Item { required property list tabs diff --git a/src/eden/qml/config/pages/global/GlobalTabSwipeView.qml b/src/eden/Eden/Config/pages/global/GlobalTabSwipeView.qml similarity index 90% rename from src/eden/qml/config/pages/global/GlobalTabSwipeView.qml rename to src/eden/Eden/Config/pages/global/GlobalTabSwipeView.qml index b5f746d02e..eaa63c5265 100644 --- a/src/eden/qml/config/pages/global/GlobalTabSwipeView.qml +++ b/src/eden/Eden/Config/pages/global/GlobalTabSwipeView.qml @@ -1,7 +1,7 @@ import QtQuick 2.15 import QtQuick.Controls.Material -import org.eden_emu.constants +import Eden.Constants SwipeView { anchors { diff --git a/src/eden/qml/config/pages/graphics/RendererAdvancedPage.qml b/src/eden/Eden/Config/pages/graphics/RendererAdvancedPage.qml similarity index 83% rename from src/eden/qml/config/pages/graphics/RendererAdvancedPage.qml rename to src/eden/Eden/Config/pages/graphics/RendererAdvancedPage.qml index d9699a5120..f6e8983eae 100644 --- a/src/eden/qml/config/pages/graphics/RendererAdvancedPage.qml +++ b/src/eden/Eden/Config/pages/graphics/RendererAdvancedPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/graphics/RendererExtensionsPage.qml b/src/eden/Eden/Config/pages/graphics/RendererExtensionsPage.qml similarity index 83% rename from src/eden/qml/config/pages/graphics/RendererExtensionsPage.qml rename to src/eden/Eden/Config/pages/graphics/RendererExtensionsPage.qml index ce6f5536d7..be9efcbd28 100644 --- a/src/eden/qml/config/pages/graphics/RendererExtensionsPage.qml +++ b/src/eden/Eden/Config/pages/graphics/RendererExtensionsPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/graphics/RendererPage.qml b/src/eden/Eden/Config/pages/graphics/RendererPage.qml similarity index 82% rename from src/eden/qml/config/pages/graphics/RendererPage.qml rename to src/eden/Eden/Config/pages/graphics/RendererPage.qml index 99b95a2699..d1d63ff717 100644 --- a/src/eden/qml/config/pages/graphics/RendererPage.qml +++ b/src/eden/Eden/Config/pages/graphics/RendererPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/system/AppletsPage.qml b/src/eden/Eden/Config/pages/system/AppletsPage.qml similarity index 82% rename from src/eden/qml/config/pages/system/AppletsPage.qml rename to src/eden/Eden/Config/pages/system/AppletsPage.qml index 4759fe1546..b3171d9d8b 100644 --- a/src/eden/qml/config/pages/system/AppletsPage.qml +++ b/src/eden/Eden/Config/pages/system/AppletsPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/system/FileSystemPage.qml b/src/eden/Eden/Config/pages/system/FileSystemPage.qml similarity index 82% rename from src/eden/qml/config/pages/system/FileSystemPage.qml rename to src/eden/Eden/Config/pages/system/FileSystemPage.qml index ad0b230e5b..90f6395f8f 100644 --- a/src/eden/qml/config/pages/system/FileSystemPage.qml +++ b/src/eden/Eden/Config/pages/system/FileSystemPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/system/SystemCorePage.qml b/src/eden/Eden/Config/pages/system/SystemCorePage.qml similarity index 82% rename from src/eden/qml/config/pages/system/SystemCorePage.qml rename to src/eden/Eden/Config/pages/system/SystemCorePage.qml index 913e9a456f..562ba17d60 100644 --- a/src/eden/qml/config/pages/system/SystemCorePage.qml +++ b/src/eden/Eden/Config/pages/system/SystemCorePage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/config/pages/system/SystemGeneralPage.qml b/src/eden/Eden/Config/pages/system/SystemGeneralPage.qml similarity index 88% rename from src/eden/qml/config/pages/system/SystemGeneralPage.qml rename to src/eden/Eden/Config/pages/system/SystemGeneralPage.qml index dab840e5ad..2d2e02b2b4 100644 --- a/src/eden/qml/config/pages/system/SystemGeneralPage.qml +++ b/src/eden/Eden/Config/pages/system/SystemGeneralPage.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.interface -import org.eden_emu.config +import Eden.Native.Interface +import Eden.Config ScrollView { id: scroll diff --git a/src/eden/qml/constants/CMakeLists.txt b/src/eden/Eden/Constants/CMakeLists.txt similarity index 66% rename from src/eden/qml/constants/CMakeLists.txt rename to src/eden/Eden/Constants/CMakeLists.txt index 27e8a6a6c1..3fb7aec6d0 100644 --- a/src/eden/qml/constants/CMakeLists.txt +++ b/src/eden/Eden/Constants/CMakeLists.txt @@ -7,9 +7,9 @@ set_source_files_properties(Constants.qml QT_QML_SINGLETON_TYPE true ) -qt_add_library(edenConstants STATIC) -qt_add_qml_module(edenConstants - URI org.eden_emu.constants +qt_add_library(EdenConstants STATIC) +qt_add_qml_module(EdenConstants + URI Eden.Constants OUTPUT_DIRECTORY EdenConstants VERSION 1.0 QML_FILES @@ -17,7 +17,7 @@ qt_add_qml_module(edenConstants Constants.qml ) -target_link_libraries(edenConstants +target_link_libraries(EdenConstants PRIVATE Qt6::Quick ) diff --git a/src/eden/qml/constants/Constants.qml b/src/eden/Eden/Constants/Constants.qml similarity index 100% rename from src/eden/qml/constants/Constants.qml rename to src/eden/Eden/Constants/Constants.qml diff --git a/src/eden/qml/items/AnimatedDialog.qml b/src/eden/Eden/Items/AnimatedDialog.qml similarity index 98% rename from src/eden/qml/items/AnimatedDialog.qml rename to src/eden/Eden/Items/AnimatedDialog.qml index 98fc2e8d9e..c623574ae1 100644 --- a/src/eden/qml/items/AnimatedDialog.qml +++ b/src/eden/Eden/Items/AnimatedDialog.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Controls.Material -import org.eden_emu.constants +import Eden.Constants Dialog { id: dia diff --git a/src/eden/qml/items/BetterMenu.qml b/src/eden/Eden/Items/BetterMenu.qml similarity index 98% rename from src/eden/qml/items/BetterMenu.qml rename to src/eden/Eden/Items/BetterMenu.qml index 51a38451e5..97bd3ca244 100644 --- a/src/eden/qml/items/BetterMenu.qml +++ b/src/eden/Eden/Items/BetterMenu.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Controls -import org.eden_emu.constants +import Eden.Constants Menu { background: Rectangle { diff --git a/src/eden/qml/items/BetterMenuBar.qml b/src/eden/Eden/Items/BetterMenuBar.qml similarity index 95% rename from src/eden/qml/items/BetterMenuBar.qml rename to src/eden/Eden/Items/BetterMenuBar.qml index 8b5fd10d9a..be35c7ded5 100644 --- a/src/eden/qml/items/BetterMenuBar.qml +++ b/src/eden/Eden/Items/BetterMenuBar.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Controls -import org.eden_emu.constants +import Eden.Constants MenuBar { background: Rectangle { diff --git a/src/eden/qml/items/CMakeLists.txt b/src/eden/Eden/Items/CMakeLists.txt similarity index 80% rename from src/eden/qml/items/CMakeLists.txt rename to src/eden/Eden/Items/CMakeLists.txt index 57ff683ec2..06764ee7bb 100644 --- a/src/eden/qml/items/CMakeLists.txt +++ b/src/eden/Eden/Items/CMakeLists.txt @@ -1,9 +1,9 @@ set(CMAKE_AUTOMOC ON) -qt_add_library(edenItems STATIC) +qt_add_library(EdenItems STATIC) -qt_add_qml_module(edenItems - URI org.eden_emu.items +qt_add_qml_module(EdenItems + URI Eden.Items VERSION 1.0 QML_FILES diff --git a/src/eden/qml/items/IconButton.qml b/src/eden/Eden/Items/IconButton.qml similarity index 93% rename from src/eden/qml/items/IconButton.qml rename to src/eden/Eden/Items/IconButton.qml index 14f28b3fff..70192e9ea7 100644 --- a/src/eden/qml/items/IconButton.qml +++ b/src/eden/Eden/Items/IconButton.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Controls.Material -import org.eden_emu.constants +import Eden.Constants Button { required property string label diff --git a/src/eden/qml/items/SettingsTabButton.qml b/src/eden/Eden/Items/SettingsTabButton.qml similarity index 96% rename from src/eden/qml/items/SettingsTabButton.qml rename to src/eden/Eden/Items/SettingsTabButton.qml index bdc0190aaa..e4d7bd0891 100644 --- a/src/eden/qml/items/SettingsTabButton.qml +++ b/src/eden/Eden/Items/SettingsTabButton.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.constants +import Eden.Constants TabButton { required property string label diff --git a/src/eden/qml/items/StatusBarButton.qml b/src/eden/Eden/Items/StatusBarButton.qml similarity index 95% rename from src/eden/qml/items/StatusBarButton.qml rename to src/eden/Eden/Items/StatusBarButton.qml index 211795e337..47691bc8b4 100644 --- a/src/eden/qml/items/StatusBarButton.qml +++ b/src/eden/Eden/Items/StatusBarButton.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -import org.eden_emu.constants +import Eden.Constants MouseArea { id: button diff --git a/src/eden/qml/items/VerticalTabBar.qml b/src/eden/Eden/Items/VerticalTabBar.qml similarity index 97% rename from src/eden/qml/items/VerticalTabBar.qml rename to src/eden/Eden/Items/VerticalTabBar.qml index 2c4fe85886..b5d8b8c13f 100644 --- a/src/eden/qml/items/VerticalTabBar.qml +++ b/src/eden/Eden/Items/VerticalTabBar.qml @@ -1,7 +1,7 @@ import QtQuick import QtQuick.Controls.Material -import org.eden_emu.constants +import Eden.Constants TabBar { clip: true diff --git a/src/eden/qml/items/fields/BetterSpinBox.qml b/src/eden/Eden/Items/fields/BetterSpinBox.qml similarity index 97% rename from src/eden/qml/items/fields/BetterSpinBox.qml rename to src/eden/Eden/Items/fields/BetterSpinBox.qml index 709b7b75e0..0d4980506b 100644 --- a/src/eden/qml/items/fields/BetterSpinBox.qml +++ b/src/eden/Eden/Items/fields/BetterSpinBox.qml @@ -2,7 +2,7 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Controls.impl -import org.eden_emu.constants +import Eden.Constants SpinBox { id: control diff --git a/src/eden/qml/items/fields/BetterTextField.qml b/src/eden/Eden/Items/fields/BetterTextField.qml similarity index 92% rename from src/eden/qml/items/fields/BetterTextField.qml rename to src/eden/Eden/Items/fields/BetterTextField.qml index 5d32b4022e..a72865b18d 100644 --- a/src/eden/qml/items/fields/BetterTextField.qml +++ b/src/eden/Eden/Items/fields/BetterTextField.qml @@ -1,8 +1,8 @@ import QtQuick import QtQuick.Controls.Material -import org.eden_emu.constants -import org.eden_emu.items +import Eden.Constants +import Eden.Items TextField { property string suffix: "" diff --git a/src/eden/qml/items/fields/FieldFooter.qml b/src/eden/Eden/Items/fields/FieldFooter.qml similarity index 92% rename from src/eden/qml/items/fields/FieldFooter.qml rename to src/eden/Eden/Items/fields/FieldFooter.qml index 897785a21b..58d237d1ea 100644 --- a/src/eden/qml/items/fields/FieldFooter.qml +++ b/src/eden/Eden/Items/fields/FieldFooter.qml @@ -1,6 +1,6 @@ import QtQuick import QtQuick.Controls.Material -import org.eden_emu.constants +import Eden.Constants Rectangle { height: 2 * Constants.scalar diff --git a/src/eden/qml/main/CMakeLists.txt b/src/eden/Eden/Main/CMakeLists.txt similarity index 71% rename from src/eden/qml/main/CMakeLists.txt rename to src/eden/Eden/Main/CMakeLists.txt index c0441d539d..b802ab1b40 100644 --- a/src/eden/qml/main/CMakeLists.txt +++ b/src/eden/Eden/Main/CMakeLists.txt @@ -1,8 +1,8 @@ set(CMAKE_AUTOMOC ON) -qt_add_library(edenMain STATIC) -qt_add_qml_module(edenMain - URI org.eden_emu.main +qt_add_library(EdenMain STATIC) +qt_add_qml_module(EdenMain + URI Eden.Main VERSION 1.0 QML_FILES diff --git a/src/eden/qml/main/GameCarousel.qml b/src/eden/Eden/Main/GameCarousel.qml similarity index 57% rename from src/eden/qml/main/GameCarousel.qml rename to src/eden/Eden/Main/GameCarousel.qml index 7989d46d71..eb9d90a85c 100644 --- a/src/eden/qml/main/GameCarousel.qml +++ b/src/eden/Eden/Main/GameCarousel.qml @@ -3,8 +3,8 @@ import QtQuick.Controls import Qt.labs.platform import QtCore -import org.eden_emu.constants -import org.eden_emu.interface +import Eden.Constants +import Eden.Native.Interface ListView { id: carousel @@ -15,24 +15,42 @@ ListView { model: EdenGameList orientation: ListView.Horizontal clip: false - flickDeceleration: 1000 + flickDeceleration: 1500 snapMode: ListView.SnapToItem onHeightChanged: console.log(width, height) spacing: 20 - Keys.enabled: true - Keys.onRightPressed: incrementCurrentIndex() - Keys.onLeftPressed: decrementCurrentIndex() + keyNavigationWraps: true - onCurrentIndexChanged: scrollToCenter() + function increment() { + incrementCurrentIndex() + if (currentIndex === count) + currentIndex = 0 + } - highlight: Rectangle { + function decrement() { + decrementCurrentIndex() + if (currentIndex === -1) + currentIndex = count - 1 + } + + // TODO(crueter): handle move/displace/add (requires thread worker on game list and a bunch of other shit) + Rectangle { id: hg clip: false z: 3 + property var item: carousel.currentItem + + anchors { + centerIn: parent + } + + height: item === null ? 0 : item.height + 10 + width: item === null ? 0 : item.width + 10 + color: "transparent" border { color: "deepskyblue" @@ -48,9 +66,7 @@ ListView { ) + text.substring(1).toLowerCase()) } - property var item: carousel.currentItem - - text: toTitleCase(item.title) + text: hg.item === null ? "" : toTitleCase(hg.item.title) font.pixelSize: 22 * Constants.scalar color: "lightblue" @@ -67,28 +83,14 @@ ListView { } } - highlightFollowsCurrentItem: true - highlightMoveDuration: 300 - highlightMoveVelocity: -1 + highlightRangeMode: ListView.StrictlyEnforceRange + preferredHighlightBegin: currentItem === null ? 0 : x + width / 2 - currentItem.width / 2 + preferredHighlightEnd: currentItem === null ? 0 : x + width / 2 + currentItem.width / 2 + highlightMoveDuration: 300 delegate: GameCarouselCard { id: game width: 300 height: 300 } - - function scrollToCenter() { - let targetX = currentIndex * 320 - (width - 320) / 2 - let min = 0 - let max = contentWidth - - contentX = Math.max(min, Math.min(max, targetX)) - } - - Behavior on contentX { - NumberAnimation { - duration: 300 - easing.type: Easing.OutQuad - } - } } diff --git a/src/eden/qml/main/GameCarouselCard.qml b/src/eden/Eden/Main/GameCarouselCard.qml similarity index 95% rename from src/eden/qml/main/GameCarouselCard.qml rename to src/eden/Eden/Main/GameCarouselCard.qml index 7e7514f7ec..51cb3a1f23 100644 --- a/src/eden/qml/main/GameCarouselCard.qml +++ b/src/eden/Eden/Main/GameCarouselCard.qml @@ -3,7 +3,7 @@ import QtQuick.Controls import Qt.labs.platform import QtCore -import org.eden_emu.constants +import Eden.Constants Item { property string title: model.name.replace(/-/g, " ") diff --git a/src/eden/qml/main/GameGrid.qml b/src/eden/Eden/Main/GameGrid.qml similarity index 89% rename from src/eden/qml/main/GameGrid.qml rename to src/eden/Eden/Main/GameGrid.qml index 8094ae4cdd..9231d2b7a8 100644 --- a/src/eden/qml/main/GameGrid.qml +++ b/src/eden/Eden/Main/GameGrid.qml @@ -3,9 +3,9 @@ import QtQuick.Controls import Qt.labs.platform import QtCore -import org.eden_emu.constants -import org.eden_emu.interface -import org.eden_emu.gamepad +import Eden.Constants +import Eden.Native.Interface +import Eden.Native.Gamepad GridView { property var setting diff --git a/src/eden/qml/main/GameGridCard.qml b/src/eden/Eden/Main/GameGridCard.qml similarity index 98% rename from src/eden/qml/main/GameGridCard.qml rename to src/eden/Eden/Main/GameGridCard.qml index c1af89bce7..634c325974 100644 --- a/src/eden/qml/main/GameGridCard.qml +++ b/src/eden/Eden/Main/GameGridCard.qml @@ -3,7 +3,7 @@ import QtQuick.Controls import Qt.labs.platform import QtCore -import org.eden_emu.constants +import Eden.Constants Rectangle { id: wrapper diff --git a/src/eden/qml/main/GameList.qml b/src/eden/Eden/Main/GameList.qml similarity index 85% rename from src/eden/qml/main/GameList.qml rename to src/eden/Eden/Main/GameList.qml index 81937d1f87..7af19bbe88 100644 --- a/src/eden/qml/main/GameList.qml +++ b/src/eden/Eden/Main/GameList.qml @@ -3,9 +3,9 @@ import QtQuick.Controls import Qt.labs.platform import QtCore -import org.eden_emu.constants -import org.eden_emu.interface -import org.eden_emu.gamepad +import Eden.Constants +import Eden.Native.Interface +import Eden.Native.Gamepad Rectangle { id: root @@ -28,8 +28,8 @@ Rectangle { // onDownPressed: grid.moveCurrentIndexDown() // onLeftPressed: grid.moveCurrentIndexLeft() // onRightPressed: grid.moveCurrentIndexRight() - onLeftPressed: carousel.decrementCurrentIndex() - onRightPressed: carousel.incrementCurrentIndex() + onLeftPressed: carousel.decrement() + onRightPressed: carousel.increment() onAPressed: console.log("A pressed") onLeftStickMoved: (x, y) => { gx = x @@ -71,17 +71,6 @@ Rectangle { } } - // GameGrid { - // setting: parent.setting - - // id: grid - - // anchors.bottom: button.top - // anchors.left: parent.left - // anchors.margins: 8 - // anchors.right: parent.right - // anchors.top: parent.top - // } Item { id: view @@ -93,6 +82,13 @@ Rectangle { margins: 8 * Constants.scalar } + // GameGrid { + // setting: root.setting + + // id: grid + + // anchors.fill: parent + // } GameCarousel { id: carousel diff --git a/src/eden/qml/main/Main.qml b/src/eden/Eden/Main/Main.qml similarity index 98% rename from src/eden/qml/main/Main.qml rename to src/eden/Eden/Main/Main.qml index 071b052525..d0be3a27f5 100644 --- a/src/eden/qml/main/Main.qml +++ b/src/eden/Eden/Main/Main.qml @@ -1,9 +1,9 @@ import QtQuick import QtQuick.Controls.Material -import org.eden_emu.config -import org.eden_emu.items -import org.eden_emu.constants +import Eden.Config +import Eden.Items +import Eden.Constants ApplicationWindow { width: Constants.width diff --git a/src/eden/qml/main/MarqueeText.qml b/src/eden/Eden/Main/MarqueeText.qml similarity index 100% rename from src/eden/qml/main/MarqueeText.qml rename to src/eden/Eden/Main/MarqueeText.qml diff --git a/src/eden/qml/main/StatusBar.qml b/src/eden/Eden/Main/StatusBar.qml similarity index 98% rename from src/eden/qml/main/StatusBar.qml rename to src/eden/Eden/Main/StatusBar.qml index 39aeaed393..d47acd82ee 100644 --- a/src/eden/qml/main/StatusBar.qml +++ b/src/eden/Eden/Main/StatusBar.qml @@ -2,8 +2,8 @@ import QtQuick import QtQuick.Controls.Material import QtQuick.Layouts -import org.eden_emu.constants -import org.eden_emu.items +import Eden.Constants +import Eden.Items ToolBar { id: toolbar diff --git a/src/eden/Eden/Native/CMakeLists.txt b/src/eden/Eden/Native/CMakeLists.txt new file mode 100644 index 0000000000..289504b4cf --- /dev/null +++ b/src/eden/Eden/Native/CMakeLists.txt @@ -0,0 +1,71 @@ +qt_add_executable(eden + main.cpp + icons.qrc +) + +add_subdirectory(Interface) +add_subdirectory(Models) + +set(PLUGINS + EdenUtilplugin + EdenItemsplugin + EdenConfigplugin + EdenInterfaceplugin + EdenConstantsplugin + EdenMainplugin +) + +if (ENABLE_SDL2) + add_subdirectory(Gamepad) + set(PLUGINS ${PLUGINS} edenGamepadplugin) +endif() + +target_link_libraries(eden + PRIVATE + Qt6::Core + Qt6::Widgets + Qt6::Gui + Qt6::Quick + Qt6::QuickControls2 + EdenModels + + # Explicitly link to static plugins + ${PLUGINS} +) + +set(NATIVE_MODULES eden EdenInterface) + +foreach(MODULE ${NATIVE_MODULES}) + target_link_libraries(${MODULE} PRIVATE common core input_common frontend_common qt_common network video_core) + target_link_libraries(${MODULE} PRIVATE Boost::headers glad fmt) + target_link_libraries(${MODULE} PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) + + target_link_libraries(${MODULE} PRIVATE Vulkan::Headers) + + if (UNIX AND NOT APPLE) + target_link_libraries(${MODULE} PRIVATE Qt6::DBus) + endif() + + target_compile_definitions(${MODULE} PRIVATE + # Use QStringBuilder for string concatenation to reduce + # the overall number of temporary strings created. + -DQT_USE_QSTRINGBUILDER + + # Disable implicit type narrowing in signal/slot connect() calls. + -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT + + # Disable unsafe overloads of QProcess' start() function. + -DQT_NO_PROCESS_COMBINED_ARGUMENT_START + + # Disable implicit QString->QUrl conversions to enforce use of proper resolving functions. + -DQT_NO_URL_CAST_FROM_STRING + ) +endforeach() + +set_target_properties(eden PROPERTIES OUTPUT_NAME "eden") +include(GNUInstallDirs) +install(TARGETS eden + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/src/eden/gamepad/CMakeLists.txt b/src/eden/Eden/Native/Gamepad/CMakeLists.txt similarity index 82% rename from src/eden/gamepad/CMakeLists.txt rename to src/eden/Eden/Native/Gamepad/CMakeLists.txt index f4bbb7cf54..70a69b35ad 100644 --- a/src/eden/gamepad/CMakeLists.txt +++ b/src/eden/Eden/Native/Gamepad/CMakeLists.txt @@ -3,7 +3,7 @@ set(CMAKE_AUTOMOC ON) qt_add_library(edenGamepad STATIC) qt_add_qml_module(edenGamepad - URI org.eden_emu.gamepad + URI Eden.Native.Gamepad VERSION 1.0 SOURCES gamepad.h gamepad.cpp ) diff --git a/src/eden/gamepad/gamepad.cpp b/src/eden/Eden/Native/Gamepad/gamepad.cpp similarity index 98% rename from src/eden/gamepad/gamepad.cpp rename to src/eden/Eden/Native/Gamepad/gamepad.cpp index daba8e35e8..37e062dc50 100644 --- a/src/eden/gamepad/gamepad.cpp +++ b/src/eden/Eden/Native/Gamepad/gamepad.cpp @@ -1,5 +1,6 @@ #include "gamepad.h" +// TODO(crueter): This is just temporary Gamepad::Gamepad(QObject *parent) : QObject(parent) { diff --git a/src/eden/gamepad/gamepad.h b/src/eden/Eden/Native/Gamepad/gamepad.h similarity index 100% rename from src/eden/gamepad/gamepad.h rename to src/eden/Eden/Native/Gamepad/gamepad.h diff --git a/src/eden/Eden/Native/Interface/CMakeLists.txt b/src/eden/Eden/Native/Interface/CMakeLists.txt new file mode 100644 index 0000000000..3c35df6ce5 --- /dev/null +++ b/src/eden/Eden/Native/Interface/CMakeLists.txt @@ -0,0 +1,11 @@ +qt_add_library(EdenInterface STATIC) +qt_add_qml_module(EdenInterface + URI Eden.Native.Interface + VERSION 1.0 + SOURCES + SettingsInterface.h SettingsInterface.cpp + QMLSetting.h QMLSetting.cpp + MetaObjectHelper.h + SOURCES QMLConfig.h + +) diff --git a/src/eden/interface/MetaObjectHelper.h b/src/eden/Eden/Native/Interface/MetaObjectHelper.h similarity index 100% rename from src/eden/interface/MetaObjectHelper.h rename to src/eden/Eden/Native/Interface/MetaObjectHelper.h diff --git a/src/eden/interface/QMLConfig.h b/src/eden/Eden/Native/Interface/QMLConfig.h similarity index 91% rename from src/eden/interface/QMLConfig.h rename to src/eden/Eden/Native/Interface/QMLConfig.h index 83b7f174cb..e22926bb23 100644 --- a/src/eden/interface/QMLConfig.h +++ b/src/eden/Eden/Native/Interface/QMLConfig.h @@ -1,7 +1,7 @@ #ifndef QMLCONFIG_H #define QMLCONFIG_H -#include "eden/interface/qt_config.h" +#include "qt_common/qt_config.h" #include diff --git a/src/eden/interface/QMLSetting.cpp b/src/eden/Eden/Native/Interface/QMLSetting.cpp similarity index 100% rename from src/eden/interface/QMLSetting.cpp rename to src/eden/Eden/Native/Interface/QMLSetting.cpp diff --git a/src/eden/interface/QMLSetting.h b/src/eden/Eden/Native/Interface/QMLSetting.h similarity index 100% rename from src/eden/interface/QMLSetting.h rename to src/eden/Eden/Native/Interface/QMLSetting.h diff --git a/src/eden/interface/SettingsInterface.cpp b/src/eden/Eden/Native/Interface/SettingsInterface.cpp similarity index 99% rename from src/eden/interface/SettingsInterface.cpp rename to src/eden/Eden/Native/Interface/SettingsInterface.cpp index 0265440628..3760978f47 100644 --- a/src/eden/interface/SettingsInterface.cpp +++ b/src/eden/Eden/Native/Interface/SettingsInterface.cpp @@ -1,7 +1,7 @@ #include "SettingsInterface.h" #include "common/settings.h" #include "common/logging/log.h" -#include "uisettings.h" +#include "qt_common/uisettings.h" SettingsInterface::SettingsInterface(QObject* parent) : QObject{parent} diff --git a/src/eden/interface/SettingsInterface.h b/src/eden/Eden/Native/Interface/SettingsInterface.h similarity index 96% rename from src/eden/interface/SettingsInterface.h rename to src/eden/Eden/Native/Interface/SettingsInterface.h index c5a0617f26..5b31c02661 100644 --- a/src/eden/interface/SettingsInterface.h +++ b/src/eden/Eden/Native/Interface/SettingsInterface.h @@ -2,11 +2,11 @@ #define SETTINGSINTERFACE_H #include -#include +#include #include "QMLSetting.h" -#include "shared_translation.h" -#include "eden/models/SettingsModel.h" +#include "qt_common/shared_translation.h" +#include "Native/Models/SettingsModel.h" namespace SettingsCategories { Q_NAMESPACE diff --git a/src/eden/models/CMakeLists.txt b/src/eden/Eden/Native/Models/CMakeLists.txt similarity index 62% rename from src/eden/models/CMakeLists.txt rename to src/eden/Eden/Native/Models/CMakeLists.txt index f4e1f1f92f..3a86bed1c4 100644 --- a/src/eden/models/CMakeLists.txt +++ b/src/eden/Eden/Native/Models/CMakeLists.txt @@ -1,16 +1,16 @@ set(CMAKE_AUTOMOC ON) # TODO: This might not need to be exposed to QML? -qt_add_library(edenModels STATIC) -qt_add_qml_module(edenModels - URI org.eden_emu.models +qt_add_library(EdenModels STATIC) +qt_add_qml_module(EdenModels + URI Eden.Native.Models VERSION 1.0 SOURCES GameListModel.h GameListModel.cpp SettingsModel.h SettingsModel.cpp ) -target_link_libraries(edenModels +target_link_libraries(EdenModels PRIVATE Qt6::Gui ) diff --git a/src/eden/models/GameListModel.cpp b/src/eden/Eden/Native/Models/GameListModel.cpp similarity index 100% rename from src/eden/models/GameListModel.cpp rename to src/eden/Eden/Native/Models/GameListModel.cpp diff --git a/src/eden/models/GameListModel.h b/src/eden/Eden/Native/Models/GameListModel.h similarity index 100% rename from src/eden/models/GameListModel.h rename to src/eden/Eden/Native/Models/GameListModel.h diff --git a/src/eden/models/SettingsModel.cpp b/src/eden/Eden/Native/Models/SettingsModel.cpp similarity index 100% rename from src/eden/models/SettingsModel.cpp rename to src/eden/Eden/Native/Models/SettingsModel.cpp diff --git a/src/eden/models/SettingsModel.h b/src/eden/Eden/Native/Models/SettingsModel.h similarity index 95% rename from src/eden/models/SettingsModel.h rename to src/eden/Eden/Native/Models/SettingsModel.h index 4f7ff9860e..26729f45aa 100644 --- a/src/eden/models/SettingsModel.h +++ b/src/eden/Eden/Native/Models/SettingsModel.h @@ -2,7 +2,7 @@ #define SETTINGSMODEL_H #include -#include "eden/interface/QMLSetting.h" +#include "Native/Interface/QMLSetting.h" class SettingsModel : public QAbstractListModel { Q_OBJECT diff --git a/src/eden/icons.qrc b/src/eden/Eden/Native/icons.qrc similarity index 100% rename from src/eden/icons.qrc rename to src/eden/Eden/Native/icons.qrc diff --git a/src/eden/icons/audio.svg b/src/eden/Eden/Native/icons/audio.svg similarity index 100% rename from src/eden/icons/audio.svg rename to src/eden/Eden/Native/icons/audio.svg diff --git a/src/eden/icons/back.svg b/src/eden/Eden/Native/icons/back.svg similarity index 100% rename from src/eden/icons/back.svg rename to src/eden/Eden/Native/icons/back.svg diff --git a/src/eden/icons/controls.svg b/src/eden/Eden/Native/icons/controls.svg similarity index 100% rename from src/eden/icons/controls.svg rename to src/eden/Eden/Native/icons/controls.svg diff --git a/src/eden/icons/cpu.svg b/src/eden/Eden/Native/icons/cpu.svg similarity index 100% rename from src/eden/icons/cpu.svg rename to src/eden/Eden/Native/icons/cpu.svg diff --git a/src/eden/icons/debug.svg b/src/eden/Eden/Native/icons/debug.svg similarity index 100% rename from src/eden/icons/debug.svg rename to src/eden/Eden/Native/icons/debug.svg diff --git a/src/eden/icons/forward.svg b/src/eden/Eden/Native/icons/forward.svg similarity index 100% rename from src/eden/icons/forward.svg rename to src/eden/Eden/Native/icons/forward.svg diff --git a/src/eden/icons/general.svg b/src/eden/Eden/Native/icons/general.svg similarity index 100% rename from src/eden/icons/general.svg rename to src/eden/Eden/Native/icons/general.svg diff --git a/src/eden/icons/graphics.svg b/src/eden/Eden/Native/icons/graphics.svg similarity index 100% rename from src/eden/icons/graphics.svg rename to src/eden/Eden/Native/icons/graphics.svg diff --git a/src/eden/icons/help.svg b/src/eden/Eden/Native/icons/help.svg similarity index 100% rename from src/eden/icons/help.svg rename to src/eden/Eden/Native/icons/help.svg diff --git a/src/eden/icons/system.svg b/src/eden/Eden/Native/icons/system.svg similarity index 100% rename from src/eden/icons/system.svg rename to src/eden/Eden/Native/icons/system.svg diff --git a/src/eden/main.cpp b/src/eden/Eden/Native/main.cpp similarity index 85% rename from src/eden/main.cpp rename to src/eden/Eden/Native/main.cpp index 810d293c36..6fbf1e57d9 100644 --- a/src/eden/main.cpp +++ b/src/eden/Eden/Native/main.cpp @@ -2,9 +2,9 @@ #include #include #include "core/core.h" -#include "interface/QMLConfig.h" -#include "models/GameListModel.h" -#include "interface/SettingsInterface.h" +#include "Native/Interface/QMLConfig.h" +#include "Native/Models/GameListModel.h" +#include "Native/Interface/SettingsInterface.h" #include @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) ctx->setContextProperty(QStringLiteral("QtConfig"), QVariant::fromValue(config)); // Enums - qmlRegisterUncreatableMetaObject(SettingsCategories::staticMetaObject, "org.eden_emu.interface", 1, 0, "SettingsCategories", QString()); + qmlRegisterUncreatableMetaObject(SettingsCategories::staticMetaObject, "Eden.Native.Interface", 1, 0, "SettingsCategories", QString()); // Directory List GameListModel *gameListModel = new GameListModel(&app); @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); - engine.loadFromModule("org.eden_emu.main", "Main"); + engine.loadFromModule("Eden.Main", "Main"); return app.exec(); } diff --git a/src/eden/qml/util/CMakeLists.txt b/src/eden/Eden/Util/CMakeLists.txt similarity index 69% rename from src/eden/qml/util/CMakeLists.txt rename to src/eden/Eden/Util/CMakeLists.txt index a2243aa611..5761da0b3f 100644 --- a/src/eden/qml/util/CMakeLists.txt +++ b/src/eden/Eden/Util/CMakeLists.txt @@ -7,9 +7,9 @@ set_source_files_properties(Util.qml QT_QML_SINGLETON_TYPE true ) -qt_add_library(edenUtil STATIC) -qt_add_qml_module(edenUtil - URI org.eden_emu.util +qt_add_library(EdenUtil STATIC) +qt_add_qml_module(EdenUtil + URI Eden.Util OUTPUT_DIRECTORY EdenUtil VERSION 1.0 QML_FILES @@ -17,7 +17,7 @@ qt_add_qml_module(edenUtil Util.qml ) -target_link_libraries(edenUtil +target_link_libraries(EdenUtil PRIVATE Qt6::Quick ) diff --git a/src/eden/qml/util/Util.qml b/src/eden/Eden/Util/Util.qml similarity index 100% rename from src/eden/qml/util/Util.qml rename to src/eden/Eden/Util/Util.qml diff --git a/src/eden/interface/CMakeLists.txt b/src/eden/interface/CMakeLists.txt deleted file mode 100644 index 290dec22b9..0000000000 --- a/src/eden/interface/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -qt_add_library(edenInterface STATIC) -qt_add_qml_module(edenInterface - URI org.eden_emu.interface - VERSION 1.0 - SOURCES - SettingsInterface.h SettingsInterface.cpp - uisettings.h uisettings.cpp - qt_config.h qt_config.cpp - shared_translation.h shared_translation.cpp - QMLSetting.h QMLSetting.cpp - MetaObjectHelper.h - SOURCES QMLConfig.h - -) diff --git a/src/eden/interface/qt_config.cpp b/src/eden/interface/qt_config.cpp deleted file mode 100644 index 463bbc72a8..0000000000 --- a/src/eden/interface/qt_config.cpp +++ /dev/null @@ -1,562 +0,0 @@ -// SPDX-FileCopyrightText: 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "qt_config.h" -#include "common/logging/log.h" -#include "input_common/main.h" -#include "uisettings.h" - -const std::array QtConfig::default_buttons = { - Qt::Key_C, Qt::Key_X, Qt::Key_V, Qt::Key_Z, Qt::Key_F, - Qt::Key_G, Qt::Key_Q, Qt::Key_E, Qt::Key_R, Qt::Key_T, - Qt::Key_M, Qt::Key_N, Qt::Key_Left, Qt::Key_Up, Qt::Key_Right, - Qt::Key_Down, Qt::Key_Q, Qt::Key_E, 0, 0, - Qt::Key_Q, Qt::Key_E, -}; - -const std::array QtConfig::default_motions = { - Qt::Key_7, - Qt::Key_8, -}; - -const std::array, Settings::NativeAnalog::NumAnalogs> QtConfig::default_analogs{{ - { - Qt::Key_W, - Qt::Key_S, - Qt::Key_A, - Qt::Key_D, - }, - { - Qt::Key_I, - Qt::Key_K, - Qt::Key_J, - Qt::Key_L, - }, -}}; - -const std::array QtConfig::default_stick_mod = { - Qt::Key_Shift, - 0, -}; - -const std::array QtConfig::default_ringcon_analogs{{ - Qt::Key_A, - Qt::Key_D, -}}; - -QtConfig::QtConfig(const std::string& config_name, const ConfigType config_type) - : Config(config_type) { - Initialize(config_name); - if (config_type != ConfigType::InputProfile) { - ReadQtValues(); - SaveQtValues(); - } -} - -QtConfig::~QtConfig() { - if (global) { - QtConfig::SaveAllValues(); - } -} - -void QtConfig::ReloadAllValues() { - Reload(); - ReadQtValues(); - SaveQtValues(); -} - -void QtConfig::SaveAllValues() { - SaveValues(); - SaveQtValues(); -} - -void QtConfig::ReadQtValues() { - if (global) { - ReadUIValues(); - } - ReadQtControlValues(); -} - -void QtConfig::ReadQtPlayerValues(const std::size_t player_index) { - std::string player_prefix; - if (type != ConfigType::InputProfile) { - player_prefix.append("player_").append(ToString(player_index)).append("_"); - } - - auto& player = Settings::values.players.GetValue()[player_index]; - if (IsCustomConfig()) { - const auto profile_name = - ReadStringSetting(std::string(player_prefix).append("profile_name")); - if (profile_name.empty()) { - // Use the global input config - player = Settings::values.players.GetValue(true)[player_index]; - player.profile_name = ""; - return; - } - } - - for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { - const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); - auto& player_buttons = player.buttons[i]; - - player_buttons = ReadStringSetting( - std::string(player_prefix).append(Settings::NativeButton::mapping[i]), default_param); - if (player_buttons.empty()) { - player_buttons = default_param; - } - } - - for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { - const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( - default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], - default_analogs[i][3], default_stick_mod[i], 0.5f); - auto& player_analogs = player.analogs[i]; - - player_analogs = ReadStringSetting( - std::string(player_prefix).append(Settings::NativeAnalog::mapping[i]), default_param); - if (player_analogs.empty()) { - player_analogs = default_param; - } - } - - for (int i = 0; i < Settings::NativeMotion::NumMotions; ++i) { - const std::string default_param = InputCommon::GenerateKeyboardParam(default_motions[i]); - auto& player_motions = player.motions[i]; - - player_motions = ReadStringSetting( - std::string(player_prefix).append(Settings::NativeMotion::mapping[i]), default_param); - if (player_motions.empty()) { - player_motions = default_param; - } - } -} - -void QtConfig::ReadHidbusValues() { - const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( - 0, 0, default_ringcon_analogs[0], default_ringcon_analogs[1], 0, 0.05f); - auto& ringcon_analogs = Settings::values.ringcon_analogs; - - ringcon_analogs = ReadStringSetting(std::string("ring_controller"), default_param); - if (ringcon_analogs.empty()) { - ringcon_analogs = default_param; - } -} - -void QtConfig::ReadDebugControlValues() { - for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { - const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); - auto& debug_pad_buttons = Settings::values.debug_pad_buttons[i]; - - debug_pad_buttons = ReadStringSetting( - std::string("debug_pad_").append(Settings::NativeButton::mapping[i]), default_param); - if (debug_pad_buttons.empty()) { - debug_pad_buttons = default_param; - } - } - - for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { - const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( - default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], - default_analogs[i][3], default_stick_mod[i], 0.5f); - auto& debug_pad_analogs = Settings::values.debug_pad_analogs[i]; - - debug_pad_analogs = ReadStringSetting( - std::string("debug_pad_").append(Settings::NativeAnalog::mapping[i]), default_param); - if (debug_pad_analogs.empty()) { - debug_pad_analogs = default_param; - } - } -} - -void QtConfig::ReadQtControlValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Controls)); - - Settings::values.players.SetGlobal(!IsCustomConfig()); - for (std::size_t p = 0; p < Settings::values.players.GetValue().size(); ++p) { - ReadQtPlayerValues(p); - } - if (IsCustomConfig()) { - EndGroup(); - return; - } - ReadDebugControlValues(); - ReadHidbusValues(); - - EndGroup(); -} - -void QtConfig::ReadPathValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Paths)); - - UISettings::values.roms_path = ReadStringSetting(std::string("romsPath")); - UISettings::values.game_dir_deprecated = - ReadStringSetting(std::string("gameListRootDir"), std::string(".")); - UISettings::values.game_dir_deprecated_deepscan = - ReadBooleanSetting(std::string("gameListDeepScan"), std::make_optional(false)); - - const int gamedirs_size = BeginArray(std::string("gamedirs")); - for (int i = 0; i < gamedirs_size; ++i) { - SetArrayIndex(i); - UISettings::GameDir game_dir; - game_dir.path = ReadStringSetting(std::string("path")); - game_dir.deep_scan = - ReadBooleanSetting(std::string("deep_scan"), std::make_optional(false)); - game_dir.expanded = ReadBooleanSetting(std::string("expanded"), std::make_optional(true)); - UISettings::values.game_dirs.append(game_dir); - } - EndArray(); - - // Create NAND and SD card directories if empty, these are not removable through the UI, - // also carries over old game list settings if present - if (UISettings::values.game_dirs.empty()) { - UISettings::GameDir game_dir; - game_dir.path = std::string("SDMC"); - game_dir.expanded = true; - UISettings::values.game_dirs.append(game_dir); - game_dir.path = std::string("UserNAND"); - UISettings::values.game_dirs.append(game_dir); - game_dir.path = std::string("SysNAND"); - UISettings::values.game_dirs.append(game_dir); - if (UISettings::values.game_dir_deprecated != std::string(".")) { - game_dir.path = UISettings::values.game_dir_deprecated; - game_dir.deep_scan = UISettings::values.game_dir_deprecated_deepscan; - UISettings::values.game_dirs.append(game_dir); - } - } - UISettings::values.recent_files = - QString::fromStdString(ReadStringSetting(std::string("recentFiles"))) - .split(QStringLiteral(", "), Qt::SkipEmptyParts, Qt::CaseSensitive); - - ReadCategory(Settings::Category::Paths); - - EndGroup(); -} - -void QtConfig::ReadShortcutValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Shortcuts)); - - for (const auto& [name, group, shortcut] : UISettings::default_hotkeys) { - BeginGroup(group); - BeginGroup(name); - - // No longer using ReadSetting for shortcut.second as it inaccurately returns a value of 1 - // for WidgetWithChildrenShortcut which is a value of 3. Needed to fix shortcuts the open - // a file dialog in windowed mode - UISettings::values.shortcuts.push_back( - {name, - group, - {ReadStringSetting(std::string("KeySeq"), shortcut.keyseq), - ReadStringSetting(std::string("Controller_KeySeq"), shortcut.controller_keyseq), - shortcut.context, - ReadBooleanSetting(std::string("Repeat"), std::optional(shortcut.repeat))}}); - - EndGroup(); // name - EndGroup(); // group - } - - EndGroup(); -} - -void QtConfig::ReadUIValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Ui)); - - UISettings::values.theme = ReadStringSetting( - std::string("theme"), - std::string(UISettings::themes[static_cast(UISettings::default_theme)].second)); - - ReadUIGamelistValues(); - ReadUILayoutValues(); - ReadPathValues(); - ReadScreenshotValues(); - ReadShortcutValues(); - ReadMultiplayerValues(); - - ReadCategory(Settings::Category::Ui); - ReadCategory(Settings::Category::UiGeneral); - - EndGroup(); -} - -void QtConfig::ReadUIGamelistValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::UiGameList)); - - ReadCategory(Settings::Category::UiGameList); - - // const int favorites_size = BeginArray("favorites"); - // for (int i = 0; i < favorites_size; i++) { - // SetArrayIndex(i); - // UISettings::values.favorited_ids.append( - // ReadUnsignedIntegerSetting(std::string("program_id"))); - // } - // EndArray(); - - EndGroup(); -} - -void QtConfig::ReadUILayoutValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::UiGameList)); - - ReadCategory(Settings::Category::UiLayout); - - EndGroup(); -} - -void QtConfig::ReadMultiplayerValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Multiplayer)); - - ReadCategory(Settings::Category::Multiplayer); - - // Read ban list back - int size = BeginArray(std::string("username_ban_list")); - UISettings::values.multiplayer_ban_list.first.resize(size); - for (int i = 0; i < size; ++i) { - SetArrayIndex(i); - UISettings::values.multiplayer_ban_list.first[i] = - ReadStringSetting(std::string("username"), std::string("")); - } - EndArray(); - - size = BeginArray(std::string("ip_ban_list")); - UISettings::values.multiplayer_ban_list.second.resize(size); - for (int i = 0; i < size; ++i) { - UISettings::values.multiplayer_ban_list.second[i] = - ReadStringSetting("username", std::string("")); - } - EndArray(); - - EndGroup(); -} - -void QtConfig::SaveQtValues() -{ - if (global) { - LOG_DEBUG(Config, "Saving global Qt configuration values"); - SaveUIValues(); - } else { - LOG_DEBUG(Config, "Saving Qt configuration values"); - } - SaveQtControlValues(); - - WriteToIni(); -} - -void QtConfig::SaveQtPlayerValues(const std::size_t player_index) { - std::string player_prefix; - if (type != ConfigType::InputProfile) { - player_prefix = std::string("player_").append(ToString(player_index)).append("_"); - } - - const auto& player = Settings::values.players.GetValue()[player_index]; - if (IsCustomConfig() && player.profile_name.empty()) { - // No custom profile selected - return; - } - - for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { - const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); - WriteStringSetting(std::string(player_prefix).append(Settings::NativeButton::mapping[i]), - player.buttons[i], std::make_optional(default_param)); - } - for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { - const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( - default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], - default_analogs[i][3], default_stick_mod[i], 0.5f); - WriteStringSetting(std::string(player_prefix).append(Settings::NativeAnalog::mapping[i]), - player.analogs[i], std::make_optional(default_param)); - } - for (int i = 0; i < Settings::NativeMotion::NumMotions; ++i) { - const std::string default_param = InputCommon::GenerateKeyboardParam(default_motions[i]); - WriteStringSetting(std::string(player_prefix).append(Settings::NativeMotion::mapping[i]), - player.motions[i], std::make_optional(default_param)); - } -} - -void QtConfig::SaveDebugControlValues() { - for (int i = 0; i < Settings::NativeButton::NumButtons; ++i) { - const std::string default_param = InputCommon::GenerateKeyboardParam(default_buttons[i]); - WriteStringSetting(std::string("debug_pad_").append(Settings::NativeButton::mapping[i]), - Settings::values.debug_pad_buttons[i], - std::make_optional(default_param)); - } - for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { - const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( - default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], - default_analogs[i][3], default_stick_mod[i], 0.5f); - WriteStringSetting(std::string("debug_pad_").append(Settings::NativeAnalog::mapping[i]), - Settings::values.debug_pad_analogs[i], - std::make_optional(default_param)); - } -} - -void QtConfig::SaveHidbusValues() { - const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( - 0, 0, default_ringcon_analogs[0], default_ringcon_analogs[1], 0, 0.05f); - WriteStringSetting(std::string("ring_controller"), Settings::values.ringcon_analogs, - std::make_optional(default_param)); -} - -void QtConfig::SaveQtControlValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Controls)); - - Settings::values.players.SetGlobal(!IsCustomConfig()); - for (std::size_t p = 0; p < Settings::values.players.GetValue().size(); ++p) { - SaveQtPlayerValues(p); - } - if (IsCustomConfig()) { - EndGroup(); - return; - } - SaveDebugControlValues(); - SaveHidbusValues(); - - EndGroup(); -} - -void QtConfig::SavePathValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Paths)); - - WriteCategory(Settings::Category::Paths); - - WriteStringSetting(std::string("romsPath"), UISettings::values.roms_path); - BeginArray(std::string("gamedirs")); - for (int i = 0; i < UISettings::values.game_dirs.size(); ++i) { - SetArrayIndex(i); - const auto& game_dir = UISettings::values.game_dirs[i]; - WriteStringSetting(std::string("path"), game_dir.path); - WriteBooleanSetting(std::string("deep_scan"), game_dir.deep_scan, - std::make_optional(false)); - WriteBooleanSetting(std::string("expanded"), game_dir.expanded, std::make_optional(true)); - } - EndArray(); - - WriteStringSetting(std::string("recentFiles"), - UISettings::values.recent_files.join(QStringLiteral(", ")).toStdString()); - - EndGroup(); -} - -void QtConfig::SaveShortcutValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Shortcuts)); - - // Lengths of UISettings::values.shortcuts & default_hotkeys are same. - // However, their ordering must also be the same. - for (std::size_t i = 0; i < UISettings::default_hotkeys.size(); i++) { - const auto& [name, group, shortcut] = UISettings::values.shortcuts[i]; - const auto& default_hotkey = UISettings::default_hotkeys[i].shortcut; - - BeginGroup(group); - BeginGroup(name); - - WriteStringSetting(std::string("KeySeq"), shortcut.keyseq, - std::make_optional(default_hotkey.keyseq)); - WriteStringSetting(std::string("Controller_KeySeq"), shortcut.controller_keyseq, - std::make_optional(default_hotkey.controller_keyseq)); - WriteIntegerSetting(std::string("Context"), shortcut.context, - std::make_optional(default_hotkey.context)); - WriteBooleanSetting(std::string("Repeat"), shortcut.repeat, - std::make_optional(default_hotkey.repeat)); - - EndGroup(); // name - EndGroup(); // group - } - - EndGroup(); -} - -void QtConfig::SaveUIValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::Ui)); - - WriteCategory(Settings::Category::Ui); - WriteCategory(Settings::Category::UiGeneral); - - WriteStringSetting( - std::string("theme"), UISettings::values.theme, - std::make_optional(std::string( - UISettings::themes[static_cast(UISettings::default_theme)].second))); - - SaveUIGamelistValues(); - SaveUILayoutValues(); - SavePathValues(); - SaveScreenshotValues(); - SaveShortcutValues(); - SaveMultiplayerValues(); - - EndGroup(); -} - -void QtConfig::SaveUIGamelistValues() -{ - BeginGroup(Settings::TranslateCategory(Settings::Category::UiGameList)); - - WriteCategory(Settings::Category::UiGameList); - - // BeginArray(std::string("favorites")); - // for (int i = 0; i < UISettings::values.favorited_ids.size(); i++) { - // SetArrayIndex(i); - // WriteIntegerSetting(std::string("program_id"), UISettings::values.favorited_ids[i]); - // } - // EndArray(); // favorites - - EndGroup(); -} - -void QtConfig::SaveUILayoutValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::UiLayout)); - - WriteCategory(Settings::Category::UiLayout); - - EndGroup(); -} - -void QtConfig::SaveMultiplayerValues() { - BeginGroup(std::string("Multiplayer")); - - WriteCategory(Settings::Category::Multiplayer); - - // Write ban list - BeginArray(std::string("username_ban_list")); - for (std::size_t i = 0; i < UISettings::values.multiplayer_ban_list.first.size(); ++i) { - SetArrayIndex(static_cast(i)); - WriteStringSetting(std::string("username"), - UISettings::values.multiplayer_ban_list.first[i]); - } - EndArray(); // username_ban_list - - BeginArray(std::string("ip_ban_list")); - for (std::size_t i = 0; i < UISettings::values.multiplayer_ban_list.second.size(); ++i) { - SetArrayIndex(static_cast(i)); - WriteStringSetting(std::string("ip"), UISettings::values.multiplayer_ban_list.second[i]); - } - EndArray(); // ip_ban_list - - EndGroup(); -} - -std::vector& QtConfig::FindRelevantList(Settings::Category category) { - auto& map = Settings::values.linkage.by_category; - if (!map[category].empty()) { - return map[category]; - } - return UISettings::values.linkage.by_category[category]; -} - -void QtConfig::ReadQtControlPlayerValues(std::size_t player_index) { - BeginGroup(Settings::TranslateCategory(Settings::Category::Controls)); - - ReadPlayerValues(player_index); - ReadQtPlayerValues(player_index); - - EndGroup(); -} - -void QtConfig::SaveQtControlPlayerValues(std::size_t player_index) { - BeginGroup(Settings::TranslateCategory(Settings::Category::Controls)); - - LOG_DEBUG(Config, "Saving players control configuration values"); - SavePlayerValues(player_index); - SaveQtPlayerValues(player_index); - - EndGroup(); - - WriteToIni(); -} diff --git a/src/eden/interface/qt_config.h b/src/eden/interface/qt_config.h deleted file mode 100644 index dc2dceb4d7..0000000000 --- a/src/eden/interface/qt_config.h +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-FileCopyrightText: 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include "frontend_common/config.h" - -class QtConfig final : public Config { -public: - explicit QtConfig(const std::string& config_name = "qt-config", - ConfigType config_type = ConfigType::GlobalConfig); - ~QtConfig() override; - - void ReloadAllValues() override; - void SaveAllValues() override; - - void ReadQtControlPlayerValues(std::size_t player_index); - void SaveQtControlPlayerValues(std::size_t player_index); - -protected: - void ReadQtValues(); - void ReadQtPlayerValues(std::size_t player_index); - void ReadQtControlValues(); - void ReadHidbusValues() override; - void ReadDebugControlValues() override; - void ReadPathValues() override; - void ReadShortcutValues() override; - void ReadUIValues() override; - void ReadUIGamelistValues() override; - void ReadUILayoutValues() override; - void ReadMultiplayerValues() override; - - void SaveQtValues(); - void SaveQtPlayerValues(std::size_t player_index); - void SaveQtControlValues(); - void SaveHidbusValues() override; - void SaveDebugControlValues() override; - void SavePathValues() override; - void SaveShortcutValues() override; - void SaveUIValues() override; - void SaveUIGamelistValues() override; - void SaveUILayoutValues() override; - void SaveMultiplayerValues() override; - - std::vector& FindRelevantList(Settings::Category category) override; - -public: - static const std::array default_buttons; - static const std::array default_motions; - static const std::array, Settings::NativeAnalog::NumAnalogs> default_analogs; - static const std::array default_stick_mod; - static const std::array default_ringcon_analogs; -}; diff --git a/src/eden/interface/shared_translation.cpp b/src/eden/interface/shared_translation.cpp deleted file mode 100644 index 59c1011465..0000000000 --- a/src/eden/interface/shared_translation.cpp +++ /dev/null @@ -1,692 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "eden/interface/shared_translation.h" - -#include -#include "common/settings.h" -#include "common/settings_enums.h" -#include "common/settings_setting.h" -#include "common/time_zone.h" -#include "yuzu/uisettings.h" -#include -#include -#include -#include - -namespace ConfigurationShared { - -std::unique_ptr InitializeTranslations(QObject* parent) -{ - std::unique_ptr translations = std::make_unique(); - const auto& tr = [parent](const char* text) -> QString { return parent->tr(text); }; - -#define INSERT(SETTINGS, ID, NAME, TOOLTIP) \ - translations->insert(std::pair{SETTINGS::values.ID.Id(), std::pair{(NAME), (TOOLTIP)}}) - - // A setting can be ignored by giving it a blank name - - // Applets - INSERT(Settings, cabinet_applet_mode, tr("Amiibo editor"), QString()); - INSERT(Settings, controller_applet_mode, tr("Controller configuration"), QString()); - INSERT(Settings, data_erase_applet_mode, tr("Data erase"), QString()); - INSERT(Settings, error_applet_mode, tr("Error"), QString()); - INSERT(Settings, net_connect_applet_mode, tr("Net connect"), QString()); - INSERT(Settings, player_select_applet_mode, tr("Player select"), QString()); - INSERT(Settings, swkbd_applet_mode, tr("Software keyboard"), QString()); - INSERT(Settings, mii_edit_applet_mode, tr("Mii Edit"), QString()); - INSERT(Settings, web_applet_mode, tr("Online web"), QString()); - INSERT(Settings, shop_applet_mode, tr("Shop"), QString()); - INSERT(Settings, photo_viewer_applet_mode, tr("Photo viewer"), QString()); - INSERT(Settings, offline_web_applet_mode, tr("Offline web"), QString()); - INSERT(Settings, login_share_applet_mode, tr("Login share"), QString()); - INSERT(Settings, wifi_web_auth_applet_mode, tr("Wifi web auth"), QString()); - INSERT(Settings, my_page_applet_mode, tr("My page"), QString()); - - // Audio - INSERT(Settings, sink_id, tr("Output Engine:"), QString()); - INSERT(Settings, audio_output_device_id, tr("Output Device:"), QString()); - INSERT(Settings, audio_input_device_id, tr("Input Device:"), QString()); - INSERT(Settings, audio_muted, tr("Mute audio"), QString()); - INSERT(Settings, volume, tr("Volume:"), QString()); - INSERT(Settings, dump_audio_commands, QString(), QString()); - INSERT(UISettings, mute_when_in_background, tr("Mute audio when in background"), QString()); - - // Core - INSERT( - Settings, - use_multi_core, - tr("Multicore CPU Emulation"), - tr("This option increases CPU emulation thread use from 1 to the Switch’s maximum of 4.\n" - "This is mainly a debug option and shouldn’t be disabled.")); - INSERT( - Settings, - memory_layout_mode, - tr("Memory Layout"), - tr("Increases the amount of emulated RAM from the stock 4GB of the retail Switch to the " - "developer kit's 8/6GB.\nIt’s doesn’t improve stability or performance and is intended " - "to let big texture mods fit in emulated RAM.\nEnabling it will increase memory " - "use. It is not recommended to enable unless a specific game with a texture mod needs " - "it.")); - INSERT(Settings, use_speed_limit, QString(), QString()); - INSERT(Settings, - speed_limit, - tr("Limit Speed Percent"), - tr("Controls the game's maximum rendering speed, but it’s up to each game if it runs " - "faster or not.\n200% for a 30 FPS game is 60 FPS, and for a " - "60 FPS game it will be 120 FPS.\nDisabling it means unlocking the framerate to the " - "maximum your PC can reach.")); - INSERT(Settings, - sync_core_speed, - tr("Synchronize Core Speed"), - tr("Synchronizes CPU core speed with the game's maximum rendering speed to boost FPS " - "without affecting game speed (animations, physics, etc.).\n" - "Compatibility varies by game; many (especially older ones) may not respond well.\n" - "Can help reduce stuttering at lower framerates.")); - - // Cpu - INSERT(Settings, - cpu_accuracy, - tr("Accuracy:"), - tr("This setting controls the accuracy of the emulated CPU.\nDon't change this unless " - "you know what you are doing.")); - INSERT(Settings, cpu_backend, tr("Backend:"), QString()); - - INSERT(Settings, use_fast_cpu_time, QString(), QString()); - INSERT(Settings, - fast_cpu_time, - tr("Fast CPU Time"), - tr("Overclocks the emulated CPU to remove some FPS limiters. Weaker CPUs may see reduced performance, " - "and certain games may behave improperly.\nUse Boost (1700MHz) to run at the Switch's highest native " - "clock, or Fast (2000MHz) to run at 2x clock.")); - INSERT(Settings, cpu_backend, tr("Backend:"), QString()); - - // Cpu Debug - - // Cpu Unsafe - INSERT( - Settings, - cpuopt_unsafe_unfuse_fma, - tr("Unfuse FMA (improve performance on CPUs without FMA)"), - tr("This option improves speed by reducing accuracy of fused-multiply-add instructions on " - "CPUs without native FMA support.")); - INSERT( - Settings, - cpuopt_unsafe_reduce_fp_error, - tr("Faster FRSQRTE and FRECPE"), - tr("This option improves the speed of some approximate floating-point functions by using " - "less accurate native approximations.")); - INSERT(Settings, - cpuopt_unsafe_ignore_standard_fpcr, - tr("Faster ASIMD instructions (32 bits only)"), - tr("This option improves the speed of 32 bits ASIMD floating-point functions by running " - "with incorrect rounding modes.")); - INSERT(Settings, - cpuopt_unsafe_inaccurate_nan, - tr("Inaccurate NaN handling"), - tr("This option improves speed by removing NaN checking.\nPlease note this also reduces " - "accuracy of certain floating-point instructions.")); - INSERT(Settings, - cpuopt_unsafe_fastmem_check, - tr("Disable address space checks"), - tr("This option improves speed by eliminating a safety check before every memory " - "read/write in guest.\nDisabling it may allow a game to read/write the emulator's " - "memory.")); - INSERT( - Settings, - cpuopt_unsafe_ignore_global_monitor, - tr("Ignore global monitor"), - tr("This option improves speed by relying only on the semantics of cmpxchg to ensure " - "safety of exclusive access instructions.\nPlease note this may result in deadlocks and " - "other race conditions.")); - - // Renderer - INSERT( - Settings, - renderer_backend, - tr("API:"), - tr("Switches between the available graphics APIs.\nVulkan is recommended in most cases.")); - INSERT(Settings, - vulkan_device, - tr("Device:"), - tr("This setting selects the GPU to use with the Vulkan backend.")); - INSERT(Settings, - shader_backend, - tr("Shader Backend:"), - tr("The shader backend to use for the OpenGL renderer.\nGLSL is the fastest in " - "performance and the best in rendering accuracy.\n" - "GLASM is a deprecated NVIDIA-only backend that offers much better shader building " - "performance at the cost of FPS and rendering accuracy.\n" - "SPIR-V compiles the fastest, but yields poor results on most GPU drivers.")); - INSERT(Settings, - resolution_setup, - tr("Resolution:"), - tr("Forces the game to render at a different resolution.\nHigher resolutions require " - "much more VRAM and bandwidth.\n" - "Options lower than 1X can cause rendering issues.")); - INSERT(Settings, scaling_filter, tr("Window Adapting Filter:"), QString()); - INSERT(Settings, - fsr_sharpening_slider, - tr("FSR Sharpness:"), - tr("Determines how sharpened the image will look while using FSR’s dynamic contrast.")); - INSERT(Settings, - anti_aliasing, - tr("Anti-Aliasing Method:"), - tr("The anti-aliasing method to use.\nSMAA offers the best quality.\nFXAA has a " - "lower performance impact and can produce a better and more stable picture under " - "very low resolutions.")); - INSERT(Settings, - fullscreen_mode, - tr("Fullscreen Mode:"), - tr("The method used to render the window in fullscreen.\nBorderless offers the best " - "compatibility with the on-screen keyboard that some games request for " - "input.\nExclusive " - "fullscreen may offer better performance and better Freesync/Gsync support.")); - INSERT(Settings, - aspect_ratio, - tr("Aspect Ratio:"), - tr("Stretches the game to fit the specified aspect ratio.\nSwitch games only support " - "16:9, so custom game mods are required to get other ratios.\nAlso controls the " - "aspect ratio of captured screenshots.")); - INSERT(Settings, - use_disk_shader_cache, - tr("Use disk pipeline cache"), - tr("Allows saving shaders to storage for faster loading on following game " - "boots.\nDisabling " - "it is only intended for debugging.")); - INSERT(Settings, - optimize_spirv_output, - tr("Optimize SPIRV output shader"), - tr("Runs an additional optimization pass over generated SPIRV shaders.\n" - "Will increase time required for shader compilation.\nMay slightly improve " - "performance.\nThis feature is experimental.")); - INSERT( - Settings, - use_asynchronous_gpu_emulation, - tr("Use asynchronous GPU emulation"), - tr("Uses an extra CPU thread for rendering.\nThis option should always remain enabled.")); - INSERT(Settings, - nvdec_emulation, - tr("NVDEC emulation:"), - tr("Specifies how videos should be decoded.\nIt can either use the CPU or the GPU for " - "decoding, or perform no decoding at all (black screen on videos).\n" - "In most cases, GPU decoding provides the best performance.")); - INSERT(Settings, - accelerate_astc, - tr("ASTC Decoding Method:"), - tr("This option controls how ASTC textures should be decoded.\n" - "CPU: Use the CPU for decoding, slowest but safest method.\n" - "GPU: Use the GPU's compute shaders to decode ASTC textures, recommended for most " - "games and users.\n" - "CPU Asynchronously: Use the CPU to decode ASTC textures as they arrive. Completely " - "eliminates ASTC decoding\nstuttering at the cost of rendering issues while the " - "texture is being decoded.")); - INSERT( - Settings, - astc_recompression, - tr("ASTC Recompression Method:"), - tr("Almost all desktop and laptop dedicated GPUs lack support for ASTC textures, forcing " - "the emulator to decompress to an intermediate format any card supports, RGBA8.\n" - "This option recompresses RGBA8 to either the BC1 or BC3 format, saving VRAM but " - "negatively affecting image quality.")); - INSERT(Settings, - vram_usage_mode, - tr("VRAM Usage Mode:"), - tr("Selects whether the emulator should prefer to conserve memory or make maximum usage " - "of available video memory for performance. Has no effect on integrated graphics. " - "Aggressive mode may severely impact the performance of other applications such as " - "recording software.")); - INSERT( - Settings, - vsync_mode, - tr("VSync Mode:"), - tr("FIFO (VSync) does not drop frames or exhibit tearing but is limited by the screen " - "refresh rate.\nFIFO Relaxed is similar to FIFO but allows tearing as it recovers from " - "a slow down.\nMailbox can have lower latency than FIFO and does not tear but may drop " - "frames.\nImmediate (no synchronization) just presents whatever is available and can " - "exhibit tearing.")); - INSERT(Settings, bg_red, QString(), QString()); - INSERT(Settings, bg_green, QString(), QString()); - INSERT(Settings, bg_blue, QString(), QString()); - - // Renderer (Advanced Graphics) - INSERT(Settings, - async_presentation, - tr("Enable asynchronous presentation (Vulkan only)"), - tr("Slightly improves performance by moving presentation to a separate CPU thread.")); - INSERT( - Settings, - renderer_force_max_clock, - tr("Force maximum clocks (Vulkan only)"), - tr("Runs work in the background while waiting for graphics commands to keep the GPU from " - "lowering its clock speed.")); - INSERT(Settings, - max_anisotropy, - tr("Anisotropic Filtering:"), - tr("Controls the quality of texture rendering at oblique angles.\nIt’s a light setting " - "and safe to set at 16x on most GPUs.")); - INSERT(Settings, - gpu_accuracy, - tr("Accuracy Level:"), - tr("GPU emulation accuracy.\nMost games render fine with Normal, but High is still " - "required for some.\nParticles tend to only render correctly with High " - "accuracy.\nExtreme should only be used for debugging.\nThis option can " - "be changed while playing.\nSome games may require booting on high to render " - "properly.")); - INSERT(Settings, - use_asynchronous_shaders, - tr("Use asynchronous shader building (Hack)"), - tr("Enables asynchronous shader compilation, which may reduce shader stutter.\nThis " - "feature " - "is experimental.")); - INSERT(Settings, use_fast_gpu_time, QString(), QString()); - INSERT(Settings, - fast_gpu_time, - tr("Fast GPU Time (Hack)"), - tr("Overclocks the emulated GPU to increase dynamic resolution and render " - "distance.\nUse 128 for maximal performance and 512 for maximal graphics fidelity.")); - - INSERT(Settings, - use_vulkan_driver_pipeline_cache, - tr("Use Vulkan pipeline cache"), - tr("Enables GPU vendor-specific pipeline cache.\nThis option can improve shader loading " - "time significantly in cases where the Vulkan driver does not store pipeline cache " - "files internally.")); - INSERT( - Settings, - enable_compute_pipelines, - tr("Enable Compute Pipelines (Intel Vulkan Only)"), - tr("Enable compute pipelines, required by some games.\nThis setting only exists for Intel " - "proprietary drivers, and may crash if enabled.\nCompute pipelines are always enabled " - "on all other drivers.")); - INSERT( - Settings, - use_reactive_flushing, - tr("Enable Reactive Flushing"), - tr("Uses reactive flushing instead of predictive flushing, allowing more accurate memory " - "syncing.")); - INSERT(Settings, - use_video_framerate, - tr("Sync to framerate of video playback"), - tr("Run the game at normal speed during video playback, even when the framerate is " - "unlocked.")); - INSERT(Settings, - barrier_feedback_loops, - tr("Barrier feedback loops"), - tr("Improves rendering of transparency effects in specific games.")); - - // Renderer (Extensions) - INSERT(Settings, - dyna_state, - tr("Extended Dynamic State"), - tr("Enables the VkExtendedDynamicState* extensions.\nHigher dynamic states will " - "generally improve " - "performance, but may cause issues on certain games or devices.")); - - INSERT(Settings, - provoking_vertex, - tr("Provoking Vertex"), - tr("Improves lighting and vertex handling in certain games.\n" - "Only Vulkan 1.0+ devices support this extension.")); - - INSERT(Settings, - descriptor_indexing, - tr("Descriptor Indexing"), - tr("Improves texture & buffer handling and the Maxwell translation layer.\n" - "Some Vulkan 1.1+ and all 1.2+ devices support this extension.")); - - // Renderer (Debug) - - // System - INSERT(Settings, - rng_seed, - tr("RNG Seed"), - tr("Controls the seed of the random number generator.\nMainly used for speedrunning " - "purposes.")); - INSERT(Settings, rng_seed_enabled, QString(), QString()); - INSERT(Settings, device_name, tr("Device Name"), tr("The name of the emulated Switch.")); - INSERT(Settings, - custom_rtc, - tr("Custom RTC Date:"), - tr("This option allows to change the emulated clock of the Switch.\n" - "Can be used to manipulate time in games.")); - INSERT(Settings, custom_rtc_enabled, QString(), QString()); - INSERT(Settings, - custom_rtc_offset, - QStringLiteral(" "), - QStringLiteral("The number of seconds from the current unix time")); - INSERT(Settings, - language_index, - tr("Language:"), - tr("Note: this can be overridden when region setting is auto-select")); - INSERT(Settings, region_index, tr("Region:"), tr("The region of the emulated Switch.")); - INSERT(Settings, time_zone_index, tr("Time Zone:"), tr("The time zone of the emulated Switch.")); - INSERT(Settings, sound_index, tr("Sound Output Mode:"), QString()); - INSERT(Settings, - use_docked_mode, - tr("Console Mode:"), - tr("Selects if the console is emulated in Docked or Handheld mode.\nGames will change " - "their resolution, details and supported controllers and depending on this setting.\n" - "Setting to Handheld can help improve performance for low end systems.")); - INSERT(Settings, current_user, QString(), QString()); - - // Controls - - // Data Storage - - // Debugging - - // Debugging Graphics - - // Network - - // Web Service - - // Ui - - // Ui General - INSERT(UISettings, - select_user_on_boot, - tr("Prompt for user on game boot"), - tr("Ask to select a user profile on each boot, useful if multiple people use eden on " - "the same PC.")); - INSERT(UISettings, - pause_when_in_background, - tr("Pause emulation when in background"), - tr("This setting pauses eden when focusing other windows.")); - INSERT(UISettings, - confirm_before_stopping, - tr("Confirm before stopping emulation"), - tr("This setting overrides game prompts asking to confirm stopping the game.\nEnabling " - "it bypasses such prompts and directly exits the emulation.")); - INSERT(UISettings, - hide_mouse, - tr("Hide mouse on inactivity"), - tr("This setting hides the mouse after 2.5s of inactivity.")); - INSERT(UISettings, - controller_applet_disabled, - tr("Disable controller applet"), - tr("Forcibly disables the use of the controller applet by guests.\nWhen a guest " - "attempts to open the controller applet, it is immediately closed.")); - INSERT(UISettings, - check_for_updates, - tr("Check for updates"), - tr("Whether or not to check for updates upon startup.")); - - // Linux - INSERT(Settings, enable_gamemode, tr("Enable Gamemode"), QString()); - - // Ui Debugging - - // Ui Multiplayer - - // Ui Games list - -#undef INSERT - - return translations; -} - -std::unique_ptr ComboboxEnumeration(QObject* parent) -{ - std::unique_ptr translations = std::make_unique(); - const auto& tr = [&](const char* text, const char* context = "") { - return parent->tr(text, context); - }; - -#define PAIR(ENUM, VALUE, TRANSLATION) {static_cast(Settings::ENUM::VALUE), (TRANSLATION)} - - // Intentionally skipping VSyncMode to let the UI fill that one out - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(AppletMode, HLE, tr("Custom frontend")), - PAIR(AppletMode, LLE, tr("Real applet")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(SpirvOptimizeMode, Never, tr("Never")), - PAIR(SpirvOptimizeMode, OnLoad, tr("On Load")), - PAIR(SpirvOptimizeMode, Always, tr("Always")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(AstcDecodeMode, Cpu, tr("CPU")), - PAIR(AstcDecodeMode, Gpu, tr("GPU")), - PAIR(AstcDecodeMode, CpuAsynchronous, tr("CPU Asynchronous")), - }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - PAIR(AstcRecompression, Uncompressed, tr("Uncompressed (Best quality)")), - PAIR(AstcRecompression, Bc1, tr("BC1 (Low quality)")), - PAIR(AstcRecompression, Bc3, tr("BC3 (Medium quality)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(VramUsageMode, Conservative, tr("Conservative")), - PAIR(VramUsageMode, Aggressive, tr("Aggressive")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { -#ifdef HAS_OPENGL - PAIR(RendererBackend, OpenGL, tr("OpenGL")), -#endif - PAIR(RendererBackend, Vulkan, tr("Vulkan")), - PAIR(RendererBackend, Null, tr("Null")), - }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - PAIR(ShaderBackend, Glsl, tr("GLSL")), - PAIR(ShaderBackend, Glasm, tr("GLASM (Assembly Shaders, NVIDIA Only)")), - PAIR(ShaderBackend, SpirV, tr("SPIR-V (Experimental, AMD/Mesa Only)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(GpuAccuracy, Normal, tr("Normal")), - PAIR(GpuAccuracy, High, tr("High")), - PAIR(GpuAccuracy, Extreme, tr("Extreme")), - }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - PAIR(CpuAccuracy, Auto, tr("Auto")), - PAIR(CpuAccuracy, Accurate, tr("Accurate")), - PAIR(CpuAccuracy, Unsafe, tr("Unsafe")), - PAIR(CpuAccuracy, Paranoid, tr("Paranoid (disables most optimizations)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(CpuBackend, Dynarmic, tr("Dynarmic")), - PAIR(CpuBackend, Nce, tr("NCE")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(FullscreenMode, Borderless, tr("Borderless Windowed")), - PAIR(FullscreenMode, Exclusive, tr("Exclusive Fullscreen")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(NvdecEmulation, Off, tr("No Video Output")), - PAIR(NvdecEmulation, Cpu, tr("CPU Video Decoding")), - PAIR(NvdecEmulation, Gpu, tr("GPU Video Decoding (Default)")), - }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - PAIR(ResolutionSetup, Res1_4X, tr("0.25X (180p/270p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res1_2X, tr("0.5X (360p/540p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res3_4X, tr("0.75X (540p/810p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res1X, tr("1X (720p/1080p)")), - PAIR(ResolutionSetup, Res3_2X, tr("1.5X (1080p/1620p) [EXPERIMENTAL]")), - PAIR(ResolutionSetup, Res2X, tr("2X (1440p/2160p)")), - PAIR(ResolutionSetup, Res3X, tr("3X (2160p/3240p)")), - PAIR(ResolutionSetup, Res4X, tr("4X (2880p/4320p)")), - PAIR(ResolutionSetup, Res5X, tr("5X (3600p/5400p)")), - PAIR(ResolutionSetup, Res6X, tr("6X (4320p/6480p)")), - PAIR(ResolutionSetup, Res7X, tr("7X (5040p/7560p)")), - PAIR(ResolutionSetup, Res8X, tr("8X (5760p/8640p)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(ScalingFilter, NearestNeighbor, tr("Nearest Neighbor")), - PAIR(ScalingFilter, Bilinear, tr("Bilinear")), - PAIR(ScalingFilter, Bicubic, tr("Bicubic")), - PAIR(ScalingFilter, Gaussian, tr("Gaussian")), - PAIR(ScalingFilter, ScaleForce, tr("ScaleForce")), - PAIR(ScalingFilter, Fsr, tr("AMD FidelityFX™️ Super Resolution")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(AntiAliasing, None, tr("None")), - PAIR(AntiAliasing, Fxaa, tr("FXAA")), - PAIR(AntiAliasing, Smaa, tr("SMAA")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(AspectRatio, R16_9, tr("Default (16:9)")), - PAIR(AspectRatio, R4_3, tr("Force 4:3")), - PAIR(AspectRatio, R21_9, tr("Force 21:9")), - PAIR(AspectRatio, R16_10, tr("Force 16:10")), - PAIR(AspectRatio, Stretch, tr("Stretch to Window")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(AnisotropyMode, Automatic, tr("Automatic")), - PAIR(AnisotropyMode, Default, tr("Default")), - PAIR(AnisotropyMode, X2, tr("2x")), - PAIR(AnisotropyMode, X4, tr("4x")), - PAIR(AnisotropyMode, X8, tr("8x")), - PAIR(AnisotropyMode, X16, tr("16x")), - }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - PAIR(Language, Japanese, tr("Japanese (日本語)")), - PAIR(Language, EnglishAmerican, tr("American English")), - PAIR(Language, French, tr("French (français)")), - PAIR(Language, German, tr("German (Deutsch)")), - PAIR(Language, Italian, tr("Italian (italiano)")), - PAIR(Language, Spanish, tr("Spanish (español)")), - PAIR(Language, Chinese, tr("Chinese")), - PAIR(Language, Korean, tr("Korean (한국어)")), - PAIR(Language, Dutch, tr("Dutch (Nederlands)")), - PAIR(Language, Portuguese, tr("Portuguese (português)")), - PAIR(Language, Russian, tr("Russian (Русский)")), - PAIR(Language, Taiwanese, tr("Taiwanese")), - PAIR(Language, EnglishBritish, tr("British English")), - PAIR(Language, FrenchCanadian, tr("Canadian French")), - PAIR(Language, SpanishLatin, tr("Latin American Spanish")), - PAIR(Language, ChineseSimplified, tr("Simplified Chinese")), - PAIR(Language, ChineseTraditional, tr("Traditional Chinese (正體中文)")), - PAIR(Language, PortugueseBrazilian, tr("Brazilian Portuguese (português do Brasil)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(Region, Japan, tr("Japan")), - PAIR(Region, Usa, tr("USA")), - PAIR(Region, Europe, tr("Europe")), - PAIR(Region, Australia, tr("Australia")), - PAIR(Region, China, tr("China")), - PAIR(Region, Korea, tr("Korea")), - PAIR(Region, Taiwan, tr("Taiwan")), - }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - {static_cast(Settings::TimeZone::Auto), - tr("Auto (%1)", "Auto select time zone") - .arg(QString::fromStdString( - Settings::GetTimeZoneString(Settings::TimeZone::Auto)))}, - {static_cast(Settings::TimeZone::Default), - tr("Default (%1)", "Default time zone") - .arg(QString::fromStdString(Common::TimeZone::GetDefaultTimeZone()))}, - PAIR(TimeZone, Cet, tr("CET")), - PAIR(TimeZone, Cst6Cdt, tr("CST6CDT")), - PAIR(TimeZone, Cuba, tr("Cuba")), - PAIR(TimeZone, Eet, tr("EET")), - PAIR(TimeZone, Egypt, tr("Egypt")), - PAIR(TimeZone, Eire, tr("Eire")), - PAIR(TimeZone, Est, tr("EST")), - PAIR(TimeZone, Est5Edt, tr("EST5EDT")), - PAIR(TimeZone, Gb, tr("GB")), - PAIR(TimeZone, GbEire, tr("GB-Eire")), - PAIR(TimeZone, Gmt, tr("GMT")), - PAIR(TimeZone, GmtPlusZero, tr("GMT+0")), - PAIR(TimeZone, GmtMinusZero, tr("GMT-0")), - PAIR(TimeZone, GmtZero, tr("GMT0")), - PAIR(TimeZone, Greenwich, tr("Greenwich")), - PAIR(TimeZone, Hongkong, tr("Hongkong")), - PAIR(TimeZone, Hst, tr("HST")), - PAIR(TimeZone, Iceland, tr("Iceland")), - PAIR(TimeZone, Iran, tr("Iran")), - PAIR(TimeZone, Israel, tr("Israel")), - PAIR(TimeZone, Jamaica, tr("Jamaica")), - PAIR(TimeZone, Japan, tr("Japan")), - PAIR(TimeZone, Kwajalein, tr("Kwajalein")), - PAIR(TimeZone, Libya, tr("Libya")), - PAIR(TimeZone, Met, tr("MET")), - PAIR(TimeZone, Mst, tr("MST")), - PAIR(TimeZone, Mst7Mdt, tr("MST7MDT")), - PAIR(TimeZone, Navajo, tr("Navajo")), - PAIR(TimeZone, Nz, tr("NZ")), - PAIR(TimeZone, NzChat, tr("NZ-CHAT")), - PAIR(TimeZone, Poland, tr("Poland")), - PAIR(TimeZone, Portugal, tr("Portugal")), - PAIR(TimeZone, Prc, tr("PRC")), - PAIR(TimeZone, Pst8Pdt, tr("PST8PDT")), - PAIR(TimeZone, Roc, tr("ROC")), - PAIR(TimeZone, Rok, tr("ROK")), - PAIR(TimeZone, Singapore, tr("Singapore")), - PAIR(TimeZone, Turkey, tr("Turkey")), - PAIR(TimeZone, Uct, tr("UCT")), - PAIR(TimeZone, Universal, tr("Universal")), - PAIR(TimeZone, Utc, tr("UTC")), - PAIR(TimeZone, WSu, tr("W-SU")), - PAIR(TimeZone, Wet, tr("WET")), - PAIR(TimeZone, Zulu, tr("Zulu")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(AudioMode, Mono, tr("Mono")), - PAIR(AudioMode, Stereo, tr("Stereo")), - PAIR(AudioMode, Surround, tr("Surround")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(MemoryLayout, Memory_4Gb, tr("4GB DRAM (Default)")), - PAIR(MemoryLayout, Memory_6Gb, tr("6GB DRAM (Unsafe)")), - PAIR(MemoryLayout, Memory_8Gb, tr("8GB DRAM")), - PAIR(MemoryLayout, Memory_10Gb, tr("10GB DRAM (Unsafe)")), - PAIR(MemoryLayout, Memory_12Gb, tr("12GB DRAM (Unsafe)")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(ConsoleMode, Docked, tr("Docked")), - PAIR(ConsoleMode, Handheld, tr("Handheld")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(CpuClock, Boost, tr("Boost (1700MHz)")), - PAIR(CpuClock, Fast, tr("Fast (2000MHz)")), - }}); - translations->insert( - {Settings::EnumMetadata::Index(), - { - PAIR(ConfirmStop, Ask_Always, tr("Always ask (Default)")), - PAIR(ConfirmStop, Ask_Based_On_Game, tr("Only if game specifies not to stop")), - PAIR(ConfirmStop, Ask_Never, tr("Never ask")), - }}); - translations->insert({Settings::EnumMetadata::Index(), - { - PAIR(GpuOverclock, Low, tr("Low (128)")), - PAIR(GpuOverclock, Medium, tr("Medium (256)")), - PAIR(GpuOverclock, High, tr("High (512)")), - }}); - -#undef PAIR -#undef CTX_PAIR - - return translations; -} -} // namespace ConfigurationShared diff --git a/src/eden/interface/shared_translation.h b/src/eden/interface/shared_translation.h deleted file mode 100644 index bfd508372b..0000000000 --- a/src/eden/interface/shared_translation.h +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include -#include -#include "common/common_types.h" -#include "common/settings.h" - -namespace ConfigurationShared { -using TranslationMap = std::map>; -using ComboboxTranslations = std::vector>; -using ComboboxTranslationMap = std::map; - -std::unique_ptr InitializeTranslations(QObject *parent); - -std::unique_ptr ComboboxEnumeration(QObject *parent); - -static const std::map anti_aliasing_texts_map = { - {Settings::AntiAliasing::None, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "None"))}, - {Settings::AntiAliasing::Fxaa, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "FXAA"))}, - {Settings::AntiAliasing::Smaa, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "SMAA"))}, -}; - -static const std::map scaling_filter_texts_map = { - {Settings::ScalingFilter::NearestNeighbor, - QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Nearest"))}, - {Settings::ScalingFilter::Bilinear, - QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Bilinear"))}, - {Settings::ScalingFilter::Bicubic, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Bicubic"))}, - {Settings::ScalingFilter::Gaussian, - QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Gaussian"))}, - {Settings::ScalingFilter::ScaleForce, - QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "ScaleForce"))}, - {Settings::ScalingFilter::Fsr, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "FSR"))}, -}; - -static const std::map use_docked_mode_texts_map = { - {Settings::ConsoleMode::Docked, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Docked"))}, - {Settings::ConsoleMode::Handheld, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Handheld"))}, -}; - -static const std::map gpu_accuracy_texts_map = { - {Settings::GpuAccuracy::Normal, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Normal"))}, - {Settings::GpuAccuracy::High, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "High"))}, - {Settings::GpuAccuracy::Extreme, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Extreme"))}, -}; - -static const std::map renderer_backend_texts_map = { - {Settings::RendererBackend::Vulkan, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Vulkan"))}, - {Settings::RendererBackend::OpenGL, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "OpenGL"))}, - {Settings::RendererBackend::Null, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "Null"))}, -}; - -static const std::map shader_backend_texts_map = { - {Settings::ShaderBackend::Glsl, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "GLSL"))}, - {Settings::ShaderBackend::Glasm, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "GLASM"))}, - {Settings::ShaderBackend::SpirV, QStringLiteral(QT_TRANSLATE_NOOP("GMainWindow", "SPIRV"))}, -}; - -} // namespace ConfigurationShared diff --git a/src/eden/interface/uisettings.cpp b/src/eden/interface/uisettings.cpp deleted file mode 100644 index f5203de421..0000000000 --- a/src/eden/interface/uisettings.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-FileCopyrightText: 2016 Citra Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "uisettings.h" -#include -#include "common/fs/fs.h" -#include "common/fs/path_util.h" - -#ifndef CANNOT_EXPLICITLY_INSTANTIATE -namespace Settings { -template class Setting; -template class Setting; -template class Setting; -template class Setting; -template class Setting; -template class Setting; -template class Setting; -} // namespace Settings -#endif - -namespace FS = Common::FS; - -namespace UISettings { - -const Themes themes{{ - {"Default", "default"}, - {"Default Colorful", "colorful"}, - {"Dark", "qdarkstyle"}, - {"Dark Colorful", "colorful_dark"}, - {"Midnight Blue", "qdarkstyle_midnight_blue"}, - {"Midnight Blue Colorful", "colorful_midnight_blue"}, -}}; - -bool IsDarkTheme() { - const auto& theme = UISettings::values.theme; - return theme == std::string("qdarkstyle") || theme == std::string("qdarkstyle_midnight_blue") || - theme == std::string("colorful_dark") || theme == std::string("colorful_midnight_blue"); -} - -Values values = {}; - -u32 CalculateWidth(u32 height, Settings::AspectRatio ratio) { - switch (ratio) { - case Settings::AspectRatio::R4_3: - return height * 4 / 3; - case Settings::AspectRatio::R21_9: - return height * 21 / 9; - case Settings::AspectRatio::R16_10: - return height * 16 / 10; - case Settings::AspectRatio::R16_9: - case Settings::AspectRatio::Stretch: - // TODO: Move this function wherever appropriate to implement Stretched aspect - break; - } - return height * 16 / 9; -} - -void SaveWindowState() { - const auto window_state_config_loc = - FS::PathToUTF8String(FS::GetEdenPath(FS::EdenPath::ConfigDir) / "window_state.ini"); - - void(FS::CreateParentDir(window_state_config_loc)); - QSettings config(QString::fromStdString(window_state_config_loc), QSettings::IniFormat); - - config.setValue(QStringLiteral("geometry"), values.geometry); - config.setValue(QStringLiteral("state"), values.state); - config.setValue(QStringLiteral("geometryRenderWindow"), values.renderwindow_geometry); - config.setValue(QStringLiteral("gameListHeaderState"), values.gamelist_header_state); - config.setValue(QStringLiteral("microProfileDialogGeometry"), values.microprofile_geometry); - - config.sync(); -} - -void RestoreWindowState(std::unique_ptr& qtConfig) { - const auto window_state_config_loc = - FS::PathToUTF8String(FS::GetEdenPath(FS::EdenPath::ConfigDir) / "window_state.ini"); - - // Migrate window state from old location - if (!FS::Exists(window_state_config_loc) && qtConfig->Exists("UI", "UILayout\\geometry")) { - const auto config_loc = - FS::PathToUTF8String(FS::GetEdenPath(FS::EdenPath::ConfigDir) / "qt-config.ini"); - QSettings config(QString::fromStdString(config_loc), QSettings::IniFormat); - - config.beginGroup(QStringLiteral("UI")); - config.beginGroup(QStringLiteral("UILayout")); - values.geometry = config.value(QStringLiteral("geometry")).toByteArray(); - values.state = config.value(QStringLiteral("state")).toByteArray(); - values.renderwindow_geometry = - config.value(QStringLiteral("geometryRenderWindow")).toByteArray(); - values.gamelist_header_state = - config.value(QStringLiteral("gameListHeaderState")).toByteArray(); - values.microprofile_geometry = - config.value(QStringLiteral("microProfileDialogGeometry")).toByteArray(); - config.endGroup(); - config.endGroup(); - return; - } - - void(FS::CreateParentDir(window_state_config_loc)); - const QSettings config(QString::fromStdString(window_state_config_loc), QSettings::IniFormat); - - values.geometry = config.value(QStringLiteral("geometry")).toByteArray(); - values.state = config.value(QStringLiteral("state")).toByteArray(); - values.renderwindow_geometry = - config.value(QStringLiteral("geometryRenderWindow")).toByteArray(); - values.gamelist_header_state = - config.value(QStringLiteral("gameListHeaderState")).toByteArray(); - values.microprofile_geometry = - config.value(QStringLiteral("microProfileDialogGeometry")).toByteArray(); -} - -} // namespace UISettings diff --git a/src/eden/interface/uisettings.h b/src/eden/interface/uisettings.h deleted file mode 100644 index aaedb99e8b..0000000000 --- a/src/eden/interface/uisettings.h +++ /dev/null @@ -1,288 +0,0 @@ -// SPDX-FileCopyrightText: 2016 Citra Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include -#include -#include -#include -#include -#include "common/common_types.h" -#include "common/settings.h" -#include "common/settings_enums.h" -#include "qt_config.h" -#include -#include -#include - -using Settings::Category; -using Settings::ConfirmStop; -using Settings::Setting; -using Settings::SwitchableSetting; - -#ifndef CANNOT_EXPLICITLY_INSTANTIATE -namespace Settings { -extern template class Setting; -extern template class Setting; -extern template class Setting; -extern template class Setting; -extern template class Setting; -extern template class Setting; -extern template class Setting; -} // namespace Settings -#endif - -namespace UISettings { - -bool IsDarkTheme(); - -struct ContextualShortcut { - std::string keyseq; - std::string controller_keyseq; - int context; - bool repeat; -}; - -struct Shortcut { - std::string name; - std::string group; - ContextualShortcut shortcut; -}; - -enum class Theme { - Default, - DefaultColorful, - Dark, - DarkColorful, - MidnightBlue, - MidnightBlueColorful, -}; - -enum class GameView { - Grid, - List, - Carousel, -}; - -static constexpr Theme default_theme{ -#ifdef _WIN32 - Theme::DarkColorful -#else - Theme::DefaultColorful -#endif -}; - -using Themes = std::array, 6>; -extern const Themes themes; - -struct GameDir { - std::string path; - bool deep_scan = false; - bool expanded = false; - bool operator==(const GameDir& rhs) const { - return path == rhs.path; - } - bool operator!=(const GameDir& rhs) const { - return !operator==(rhs); - } -}; - -struct Values { - Settings::Linkage linkage{1000}; - - QByteArray geometry; - QByteArray state; - - QByteArray renderwindow_geometry; - - QByteArray gamelist_header_state; - - QByteArray microprofile_geometry; - Setting microprofile_visible{linkage, false, "microProfileDialogVisible", - Category::UiLayout}; - - Setting single_window_mode{linkage, true, "singleWindowMode", Category::Ui}; - Setting fullscreen{linkage, false, "fullscreen", Category::Ui}; - Setting display_titlebar{linkage, true, "displayTitleBars", Category::Ui}; - Setting show_filter_bar{linkage, true, "showFilterBar", Category::Ui}; - Setting show_status_bar{linkage, true, "showStatusBar", Category::Ui}; - - SwitchableSetting confirm_before_stopping{linkage, - ConfirmStop::Ask_Always, - "confirmStop", - Category::UiGeneral, - Settings::Specialization::Default, - true, - true}; - - Setting first_start{linkage, true, "firstStart", Category::Ui}; - Setting pause_when_in_background{linkage, - false, - "pauseWhenInBackground", - Category::UiGeneral, - Settings::Specialization::Default, - true, - true}; - Setting mute_when_in_background{linkage, - false, - "muteWhenInBackground", - Category::UiAudio, - Settings::Specialization::Default, - true, - true}; - Setting hide_mouse{ - linkage, true, "hideInactiveMouse", Category::UiGeneral, Settings::Specialization::Default, - true, true}; - Setting controller_applet_disabled{linkage, false, "disableControllerApplet", - Category::UiGeneral}; - // Set when Vulkan is known to crash the application - bool has_broken_vulkan = false; - - Setting select_user_on_boot{linkage, - false, - "select_user_on_boot", - Category::UiGeneral, - Settings::Specialization::Default, - true, - true}; - Setting disable_web_applet{linkage, true, "disable_web_applet", Category::Ui}; - - // Discord RPC - Setting enable_discord_presence{linkage, false, "enable_discord_presence", Category::Ui}; - - // logging - Setting show_console{linkage, false, "showConsole", Category::Ui}; - - // Screenshots - Setting enable_screenshot_save_as{linkage, true, "enable_screenshot_save_as", - Category::Screenshots}; - Setting screenshot_height{linkage, 0, "screenshot_height", Category::Screenshots}; - - std::string roms_path; - std::string game_dir_deprecated; - bool game_dir_deprecated_deepscan; - QVector game_dirs; - QStringList recent_files; - Setting language{linkage, {}, "language", Category::Paths}; - - std::string theme; - - // Shortcut name - std::vector shortcuts; - - Setting callout_flags{linkage, 0, "calloutFlags", Category::Ui}; - - // multiplayer settings - Setting multiplayer_nickname{linkage, {}, "nickname", Category::Multiplayer}; - Setting multiplayer_filter_text{linkage, {}, "filter_text", Category::Multiplayer}; - Setting multiplayer_filter_games_owned{linkage, false, "filter_games_owned", - Category::Multiplayer}; - Setting multiplayer_filter_hide_empty{linkage, false, "filter_games_hide_empty", - Category::Multiplayer}; - Setting multiplayer_filter_hide_full{linkage, false, "filter_games_hide_full", - Category::Multiplayer}; - Setting multiplayer_ip{linkage, {}, "ip", Category::Multiplayer}; - Setting multiplayer_port{linkage, 24872, 0, - UINT16_MAX, "port", Category::Multiplayer}; - Setting multiplayer_room_nickname{ - linkage, {}, "room_nickname", Category::Multiplayer}; - Setting multiplayer_room_name{linkage, {}, "room_name", Category::Multiplayer}; - Setting multiplayer_max_player{linkage, 8, 0, 8, "max_player", Category::Multiplayer}; - Setting multiplayer_room_port{linkage, 24872, 0, - UINT16_MAX, "room_port", Category::Multiplayer}; - Setting multiplayer_host_type{linkage, 0, 0, 1, "host_type", Category::Multiplayer}; - Setting multiplayer_game_id{linkage, {}, "game_id", Category::Multiplayer}; - Setting multiplayer_room_description{ - linkage, {}, "room_description", Category::Multiplayer}; - std::pair, std::vector> multiplayer_ban_list; - - // Game List - // Setting show_add_ons{linkage, true, "show_add_ons", Category::UiGameList}; - // Setting game_icon_size{linkage, 64, "game_icon_size", Category::UiGameList}; - // Setting folder_icon_size{linkage, 48, "folder_icon_size", Category::UiGameList}; - // Setting row_1_text_id{linkage, 3, "row_1_text_id", Category::UiGameList}; - // Setting row_2_text_id{linkage, 2, "row_2_text_id", Category::UiGameList}; - // std::atomic_bool is_game_list_reload_pending{false}; - // Setting cache_game_list{linkage, true, "cache_game_list", Category::UiGameList}; - // Setting favorites_expanded{linkage, true, "favorites_expanded", Category::UiGameList}; - // QVector favorited_ids; - - Setting grid_columns{linkage, 4, 1, 8, "grid_columns", Category::UiGameList}; - - // Compatibility List - Setting show_compat{linkage, false, "show_compat", Category::UiGameList}; - - // Size & File Types Column - Setting show_size{linkage, true, "show_size", Category::UiGameList}; - Setting show_types{linkage, true, "show_types", Category::UiGameList}; - - // Play time - Setting show_play_time{linkage, true, "show_play_time", Category::UiGameList}; - - bool configuration_applied; - bool reset_to_defaults; - bool shortcut_already_warned{false}; -}; - -extern Values values; - -u32 CalculateWidth(u32 height, Settings::AspectRatio ratio); - -void SaveWindowState(); -void RestoreWindowState(std::unique_ptr& qtConfig); - -// This shouldn't have anything except static initializers (no functions). So -// QKeySequence(...).toString() is NOT ALLOWED HERE. -// This must be in alphabetical order according to action name as it must have the same order as -// UISetting::values.shortcuts, which is alphabetically ordered. -// clang-format off -const std::array default_hotkeys{{ - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Mute/Unmute")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+M"), std::string("Home+Dpad_Right"), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Volume Down")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("-"), std::string("Home+Dpad_Down"), Qt::ApplicationShortcut, true}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Audio Volume Up")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("="), std::string("Home+Dpad_Up"), Qt::ApplicationShortcut, true}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Capture Screenshot")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+P"), std::string("Screenshot"), Qt::WidgetWithChildrenShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Change Adapting Filter")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F8"), std::string("Home+L"), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Change Docked Mode")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F10"), std::string("Home+X"), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Change GPU Accuracy")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F9"), std::string("Home+R"), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Continue/Pause Emulation")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F4"), std::string("Home+Plus"), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Exit Fullscreen")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Esc"), std::string(""), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Exit eden")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+Q"), std::string("Home+Minus"), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Fullscreen")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F11"), std::string("Home+B"), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Load File")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+O"), std::string(""), Qt::WidgetWithChildrenShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Load/Remove Amiibo")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F2"), std::string("Home+A"), Qt::WidgetWithChildrenShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Multiplayer Browse Public Game Lobby")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+B"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Multiplayer Create Room")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+N"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Multiplayer Direct Connect to Room")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+C"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Multiplayer Leave Room")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+L"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Multiplayer Show Current Room")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+R"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Restart Emulation")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F6"), std::string("R+Plus+Minus"), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Stop Emulation")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("F5"), std::string("L+Plus+Minus"), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "TAS Record")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+F7"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "TAS Reset")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+F6"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "TAS Start/Stop")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+F5"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Toggle Filter Bar")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+F"), std::string(""), Qt::WindowShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Toggle Framerate Limit")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+U"), std::string("Home+Y"), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Toggle Mouse Panning")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+F9"), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Toggle Renderdoc Capture")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string(""), std::string(""), Qt::ApplicationShortcut, false}}, - {QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Toggle Status Bar")).toStdString(), QStringLiteral(QT_TRANSLATE_NOOP("Hotkeys", "Main Window")).toStdString(), {std::string("Ctrl+S"), std::string(""), Qt::WindowShortcut, false}}, -}}; -// clang-format on - -} // namespace UISettings - -Q_DECLARE_METATYPE(UISettings::GameDir*); - -// These metatype declarations cannot be in common/settings.h because core is devoid of QT -Q_DECLARE_METATYPE(Settings::CpuAccuracy); -Q_DECLARE_METATYPE(Settings::GpuAccuracy); -Q_DECLARE_METATYPE(Settings::FullscreenMode); -Q_DECLARE_METATYPE(Settings::NvdecEmulation); -Q_DECLARE_METATYPE(Settings::ResolutionSetup); -Q_DECLARE_METATYPE(Settings::ScalingFilter); -Q_DECLARE_METATYPE(Settings::AntiAliasing); -Q_DECLARE_METATYPE(Settings::RendererBackend); -Q_DECLARE_METATYPE(Settings::ShaderBackend); -Q_DECLARE_METATYPE(Settings::AstcRecompression); -Q_DECLARE_METATYPE(Settings::AstcDecodeMode); -Q_DECLARE_METATYPE(Settings::SpirvOptimizeMode); diff --git a/src/eden/qml/CMakeLists.txt b/src/eden/qml/CMakeLists.txt deleted file mode 100644 index 293061b88f..0000000000 --- a/src/eden/qml/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(config) -add_subdirectory(constants) -add_subdirectory(items) -add_subdirectory(util) - -add_subdirectory(main) diff --git a/src/qt_common/CMakeLists.txt b/src/qt_common/CMakeLists.txt index 615ec77d84..aebd11a52b 100644 --- a/src/qt_common/CMakeLists.txt +++ b/src/qt_common/CMakeLists.txt @@ -44,7 +44,6 @@ endif() add_subdirectory(externals) target_link_libraries(qt_common PRIVATE core Qt6::Core SimpleIni::SimpleIni QuaZip::QuaZip frozen::frozen) -target_link_libraries(qt_common PRIVATE Qt6::Core) if (NOT WIN32) target_include_directories(qt_common PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS}) diff --git a/src/qt_common/uisettings.h b/src/qt_common/uisettings.h index 4981d98dbf..b4e0c36dee 100644 --- a/src/qt_common/uisettings.h +++ b/src/qt_common/uisettings.h @@ -202,6 +202,8 @@ struct Values { Setting favorites_expanded{linkage, true, "favorites_expanded", Category::UiGameList}; QVector favorited_ids; + Setting grid_columns{linkage, 4, 1, 8, "grid_columns", Category::UiGameList}; + // Compatibility List Setting show_compat{linkage, false, "show_compat", Category::UiGameList};