From 67de63bed6c54ee158380f683a65874fc0a993ff Mon Sep 17 00:00:00 2001 From: SSimco <37044560+SSimco@users.noreply.github.com> Date: Tue, 15 Jul 2025 05:28:41 +0300 Subject: [PATCH] UI+build: Isolate wxWidgets code from non-GUI code (#1633) --- .github/workflows/generate_pot.yml | 1 + src/CMakeLists.txt | 4 - src/Cafe/CMakeLists.txt | 4 - src/Cafe/CafeSystem.cpp | 11 +- src/Cafe/Filesystem/FST/KeyCache.cpp | 10 +- src/Cafe/GraphicPack/GraphicPack2.cpp | 2 +- src/Cafe/GraphicPack/GraphicPack2Patches.cpp | 15 +- src/Cafe/HW/Espresso/Debugger/Debugger.cpp | 29 +- src/Cafe/HW/Espresso/Debugger/Debugger.h | 63 ++++ src/Cafe/HW/Latte/Core/LatteOverlay.cpp | 10 +- .../HW/Latte/Core/LattePerformanceMonitor.cpp | 6 +- src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp | 12 +- src/Cafe/HW/Latte/Core/LatteShaderCache.cpp | 37 +- src/Cafe/HW/Latte/Core/LatteThread.cpp | 7 +- .../Latte/Renderer/OpenGL/OpenGLRenderer.cpp | 42 ++- .../HW/Latte/Renderer/OpenGL/OpenGLRenderer.h | 22 ++ src/Cafe/HW/Latte/Renderer/Renderer.cpp | 133 ++----- src/Cafe/HW/Latte/Renderer/Renderer.h | 9 +- .../Latte/Renderer/Vulkan/SwapchainInfoVk.cpp | 4 +- .../HW/Latte/Renderer/Vulkan/VsyncDriver.cpp | 10 +- .../Latte/Renderer/Vulkan/VulkanRenderer.cpp | 50 ++- .../HW/Latte/Renderer/Vulkan/VulkanRenderer.h | 7 +- src/Cafe/HW/MMU/MMU.cpp | 9 +- src/Cafe/IOSU/legacy/iosu_act.cpp | 1 - src/Cafe/OS/RPL/rpl.cpp | 6 +- src/Cafe/OS/libs/erreula/erreula.cpp | 2 - src/Cafe/OS/libs/nn_save/nn_save.cpp | 75 ---- src/Cafe/OS/libs/padscore/padscore.cpp | 4 +- src/Cafe/OS/libs/vpad/vpad.cpp | 4 +- src/Cemu/Logging/CemuLogging.cpp | 64 +++- src/Cemu/Logging/CemuLogging.h | 11 + .../Tools/DownloadManager/DownloadManager.cpp | 38 +- src/Common/precompiled.h | 41 ++ src/audio/CMakeLists.txt | 13 +- src/audio/DirectSoundAPI.cpp | 4 +- src/config/ActiveSettings.cpp | 8 - src/config/ActiveSettings.h | 1 - src/config/CMakeLists.txt | 7 +- src/config/CemuConfig.cpp | 185 +--------- src/config/CemuConfig.h | 149 ++------ src/config/LaunchSettings.cpp | 5 - src/config/NetworkSettings.h | 2 +- src/config/XMLConfig.h | 171 +++++++-- src/gui/CMakeLists.txt | 189 +--------- src/gui/LoggingWindow.h | 44 --- src/gui/canvas/OpenGLCanvas.h | 8 - src/gui/guiWrapper.cpp | 332 ----------------- src/gui/guiWrapper.h | 161 -------- src/gui/helpers/wxHelpers.cpp | 66 ---- src/gui/interface/WindowSystem.h | 126 +++++++ .../wxgui/AudioDebuggerWindow.cpp} | 4 +- .../wxgui/AudioDebuggerWindow.h} | 0 src/gui/wxgui/CMakeLists.txt | 189 ++++++++++ src/gui/{ => wxgui}/CemuApp.cpp | 50 ++- src/gui/{ => wxgui}/CemuApp.h | 0 src/gui/{ => wxgui}/CemuUpdateWindow.cpp | 5 +- src/gui/{ => wxgui}/CemuUpdateWindow.h | 0 src/gui/{ => wxgui}/ChecksumTool.cpp | 8 +- src/gui/{ => wxgui}/ChecksumTool.h | 2 +- .../DownloadGraphicPacksWindow.cpp | 4 +- .../{ => wxgui}/DownloadGraphicPacksWindow.h | 0 .../EmulatedUSBDeviceFrame.cpp | 10 +- .../EmulatedUSBDeviceFrame.h | 0 src/gui/{ => wxgui}/GameProfileWindow.cpp | 4 +- src/gui/{ => wxgui}/GameProfileWindow.h | 0 src/gui/{ => wxgui}/GameUpdateWindow.cpp | 8 +- src/gui/{ => wxgui}/GameUpdateWindow.h | 0 src/gui/{ => wxgui}/GeneralSettings2.cpp | 65 ++-- src/gui/{ => wxgui}/GeneralSettings2.h | 0 src/gui/{ => wxgui}/GettingStartedDialog.cpp | 22 +- src/gui/{ => wxgui}/GettingStartedDialog.h | 0 src/gui/{ => wxgui}/GraphicPacksWindow2.cpp | 10 +- src/gui/{ => wxgui}/GraphicPacksWindow2.h | 0 src/gui/{ => wxgui}/LoggingWindow.cpp | 28 +- src/gui/wxgui/LoggingWindow.h | 29 ++ src/gui/{ => wxgui}/MainWindow.cpp | 142 +++---- src/gui/{ => wxgui}/MainWindow.h | 9 +- src/gui/{ => wxgui}/MemorySearcherTool.cpp | 6 +- src/gui/{ => wxgui}/MemorySearcherTool.h | 2 +- src/gui/{ => wxgui}/PadViewFrame.cpp | 18 +- src/gui/{ => wxgui}/PadViewFrame.h | 0 src/gui/{ => wxgui}/TitleManager.cpp | 22 +- src/gui/{ => wxgui}/TitleManager.h | 0 src/gui/{ => wxgui}/canvas/IRenderCanvas.h | 0 src/gui/{ => wxgui}/canvas/OpenGLCanvas.cpp | 120 ++++-- src/gui/wxgui/canvas/OpenGLCanvas.h | 4 + src/gui/{ => wxgui}/canvas/VulkanCanvas.cpp | 11 +- src/gui/{ => wxgui}/canvas/VulkanCanvas.h | 2 +- src/gui/{ => wxgui}/components/TextList.cpp | 2 +- src/gui/{ => wxgui}/components/TextList.h | 0 .../components/wxDownloadManagerList.cpp | 12 +- .../components/wxDownloadManagerList.h | 2 +- src/gui/{ => wxgui}/components/wxGameList.cpp | 37 +- src/gui/{ => wxgui}/components/wxGameList.h | 0 .../{ => wxgui}/components/wxInputDraw.cpp | 2 +- src/gui/{ => wxgui}/components/wxInputDraw.h | 0 src/gui/{ => wxgui}/components/wxLogCtrl.cpp | 2 +- src/gui/{ => wxgui}/components/wxLogCtrl.h | 0 .../components/wxProgressDialogManager.h | 0 .../components/wxTitleManagerList.cpp | 14 +- .../components/wxTitleManagerList.h | 2 +- .../{ => wxgui}/debugger/BreakpointWindow.cpp | 9 +- .../{ => wxgui}/debugger/BreakpointWindow.h | 2 +- .../{ => wxgui}/debugger/DebuggerWindow2.cpp | 60 ++- .../{ => wxgui}/debugger/DebuggerWindow2.h | 15 +- src/gui/{ => wxgui}/debugger/DisasmCtrl.cpp | 7 +- src/gui/{ => wxgui}/debugger/DisasmCtrl.h | 2 +- src/gui/{ => wxgui}/debugger/DumpCtrl.cpp | 4 +- src/gui/{ => wxgui}/debugger/DumpCtrl.h | 2 +- src/gui/{ => wxgui}/debugger/DumpWindow.cpp | 8 +- src/gui/{ => wxgui}/debugger/DumpWindow.h | 2 +- src/gui/{ => wxgui}/debugger/ModuleWindow.cpp | 9 +- src/gui/{ => wxgui}/debugger/ModuleWindow.h | 0 src/gui/{ => wxgui}/debugger/RegisterCtrl.cpp | 6 +- src/gui/{ => wxgui}/debugger/RegisterCtrl.h | 2 +- .../{ => wxgui}/debugger/RegisterWindow.cpp | 6 +- src/gui/{ => wxgui}/debugger/RegisterWindow.h | 0 src/gui/{ => wxgui}/debugger/SymbolCtrl.cpp | 5 +- src/gui/{ => wxgui}/debugger/SymbolCtrl.h | 0 src/gui/{ => wxgui}/debugger/SymbolWindow.cpp | 7 +- src/gui/{ => wxgui}/debugger/SymbolWindow.h | 2 +- .../CreateAccount/wxCreateAccountDialog.cpp | 2 +- .../CreateAccount/wxCreateAccountDialog.h | 0 .../dialogs/SaveImport/SaveImportWindow.cpp | 2 +- .../dialogs/SaveImport/SaveImportWindow.h | 0 .../dialogs/SaveImport/SaveTransfer.cpp | 2 +- .../dialogs/SaveImport/SaveTransfer.h | 0 src/gui/{ => wxgui}/helpers/wxControlObject.h | 0 src/gui/{ => wxgui}/helpers/wxCustomData.h | 0 .../{ => wxgui}/helpers/wxCustomEvents.cpp | 2 +- src/gui/{ => wxgui}/helpers/wxCustomEvents.h | 0 src/gui/wxgui/helpers/wxHelpers.cpp | 116 ++++++ src/gui/{ => wxgui}/helpers/wxHelpers.h | 3 + src/gui/{ => wxgui}/helpers/wxLogEvent.h | 0 src/gui/{ => wxgui}/helpers/wxWayland.cpp | 2 +- src/gui/{ => wxgui}/helpers/wxWayland.h | 0 src/gui/{ => wxgui}/input/HotkeySettings.cpp | 113 +++++- src/gui/{ => wxgui}/input/HotkeySettings.h | 6 +- .../{ => wxgui}/input/InputAPIAddWindow.cpp | 6 +- src/gui/{ => wxgui}/input/InputAPIAddWindow.h | 2 +- src/gui/{ => wxgui}/input/InputSettings2.cpp | 24 +- src/gui/{ => wxgui}/input/InputSettings2.h | 0 src/gui/{ => wxgui}/input/PairingDialog.cpp | 2 +- src/gui/{ => wxgui}/input/PairingDialog.h | 0 .../panels/ClassicControllerInputPanel.cpp | 8 +- .../panels/ClassicControllerInputPanel.h | 2 +- .../{ => wxgui}/input/panels/InputPanel.cpp | 7 +- src/gui/{ => wxgui}/input/panels/InputPanel.h | 2 +- .../input/panels/ProControllerInputPanel.cpp | 6 +- .../input/panels/ProControllerInputPanel.h | 4 +- .../input/panels/VPADInputPanel.cpp | 8 +- .../{ => wxgui}/input/panels/VPADInputPanel.h | 2 +- .../input/panels/WiimoteInputPanel.cpp | 8 +- .../input/panels/WiimoteInputPanel.h | 2 +- .../settings/DefaultControllerSettings.cpp | 10 +- .../settings/DefaultControllerSettings.h | 0 .../settings/WiimoteControllerSettings.cpp | 10 +- .../settings/WiimoteControllerSettings.h | 0 .../DebugPPCThreadsWindow.cpp | 4 +- .../PPCThreadsViewer/DebugPPCThreadsWindow.h | 0 .../TextureRelationWindow.cpp | 2 +- .../TextureRelationWindow.h | 0 src/gui/wxgui/wxCemuConfig.cpp | 184 +++++++++ src/gui/wxgui/wxCemuConfig.h | 142 +++++++ src/gui/{ => wxgui}/wxHelper.h | 0 src/gui/wxgui/wxWindowSystem.cpp | 349 ++++++++++++++++++ src/gui/{ => wxgui}/wxcomponents/checked.xpm | 0 src/gui/{ => wxgui}/wxcomponents/checked2.xpm | 0 .../{ => wxgui}/wxcomponents/checked_d.xpm | 0 .../{ => wxgui}/wxcomponents/checked_dis.xpm | 0 .../{ => wxgui}/wxcomponents/checked_ld.xpm | 0 .../{ => wxgui}/wxcomponents/checked_mo.xpm | 0 .../wxcomponents/checkedlistctrl.cpp | 10 +- .../wxcomponents/checkedlistctrl.h | 0 .../{ => wxgui}/wxcomponents/checktree.cpp | 18 +- src/gui/{ => wxgui}/wxcomponents/checktree.h | 0 .../{ => wxgui}/wxcomponents/unchecked.xpm | 0 .../{ => wxgui}/wxcomponents/unchecked2.xpm | 0 .../{ => wxgui}/wxcomponents/unchecked_d.xpm | 0 .../wxcomponents/unchecked_dis.xpm | 0 .../{ => wxgui}/wxcomponents/unchecked_ld.xpm | 0 .../{ => wxgui}/wxcomponents/unchecked_mo.xpm | 0 src/gui/{ => wxgui}/wxgui.h | 0 src/imgui/imgui_extension.cpp | 8 +- src/input/CMakeLists.txt | 4 - src/input/api/Controller.cpp | 6 +- .../api/DirectInput/DirectInputController.cpp | 4 +- src/input/api/Keyboard/KeyboardController.cpp | 39 +- src/input/emulated/ClassicController.cpp | 28 +- src/input/emulated/ProController.cpp | 32 +- src/input/emulated/VPADController.cpp | 37 +- src/input/emulated/WPADController.h | 2 - src/input/emulated/WiimoteController.cpp | 19 +- src/main.cpp | 14 +- src/mainLLE.cpp | 6 +- src/util/CMakeLists.txt | 4 - src/util/helpers/helpers.cpp | 29 +- src/util/helpers/helpers.h | 2 - src/util/math/quaternion.h | 2 +- 199 files changed, 2414 insertions(+), 2091 deletions(-) delete mode 100644 src/gui/LoggingWindow.h delete mode 100644 src/gui/canvas/OpenGLCanvas.h delete mode 100644 src/gui/guiWrapper.cpp delete mode 100644 src/gui/guiWrapper.h delete mode 100644 src/gui/helpers/wxHelpers.cpp create mode 100644 src/gui/interface/WindowSystem.h rename src/{audio/audioDebuggerWindow.cpp => gui/wxgui/AudioDebuggerWindow.cpp} (99%) rename src/{audio/audioDebuggerWindow.h => gui/wxgui/AudioDebuggerWindow.h} (100%) create mode 100644 src/gui/wxgui/CMakeLists.txt rename src/gui/{ => wxgui}/CemuApp.cpp (94%) rename src/gui/{ => wxgui}/CemuApp.h (100%) rename src/gui/{ => wxgui}/CemuUpdateWindow.cpp (99%) rename src/gui/{ => wxgui}/CemuUpdateWindow.h (100%) rename src/gui/{ => wxgui}/ChecksumTool.cpp (99%) rename src/gui/{ => wxgui}/ChecksumTool.h (96%) rename src/gui/{ => wxgui}/DownloadGraphicPacksWindow.cpp (99%) rename src/gui/{ => wxgui}/DownloadGraphicPacksWindow.h (100%) rename src/gui/{ => wxgui}/EmulatedUSBDevices/EmulatedUSBDeviceFrame.cpp (99%) rename src/gui/{ => wxgui}/EmulatedUSBDevices/EmulatedUSBDeviceFrame.h (100%) rename src/gui/{ => wxgui}/GameProfileWindow.cpp (99%) rename src/gui/{ => wxgui}/GameProfileWindow.h (100%) rename src/gui/{ => wxgui}/GameUpdateWindow.cpp (98%) rename src/gui/{ => wxgui}/GameUpdateWindow.h (100%) rename src/gui/{ => wxgui}/GeneralSettings2.cpp (97%) rename src/gui/{ => wxgui}/GeneralSettings2.h (100%) rename src/gui/{ => wxgui}/GettingStartedDialog.cpp (95%) rename src/gui/{ => wxgui}/GettingStartedDialog.h (100%) rename src/gui/{ => wxgui}/GraphicPacksWindow2.cpp (99%) rename src/gui/{ => wxgui}/GraphicPacksWindow2.h (100%) rename src/gui/{ => wxgui}/LoggingWindow.cpp (85%) create mode 100644 src/gui/wxgui/LoggingWindow.h rename src/gui/{ => wxgui}/MainWindow.cpp (96%) rename src/gui/{ => wxgui}/MainWindow.h (97%) rename src/gui/{ => wxgui}/MemorySearcherTool.cpp (99%) rename src/gui/{ => wxgui}/MemorySearcherTool.h (99%) rename src/gui/{ => wxgui}/PadViewFrame.cpp (94%) rename src/gui/{ => wxgui}/PadViewFrame.h (100%) rename src/gui/{ => wxgui}/TitleManager.cpp (98%) rename src/gui/{ => wxgui}/TitleManager.h (100%) rename src/gui/{ => wxgui}/canvas/IRenderCanvas.h (100%) rename src/gui/{ => wxgui}/canvas/OpenGLCanvas.cpp (55%) create mode 100644 src/gui/wxgui/canvas/OpenGLCanvas.h rename src/gui/{ => wxgui}/canvas/VulkanCanvas.cpp (85%) rename src/gui/{ => wxgui}/canvas/VulkanCanvas.h (91%) rename src/gui/{ => wxgui}/components/TextList.cpp (99%) rename src/gui/{ => wxgui}/components/TextList.h (100%) rename src/gui/{ => wxgui}/components/wxDownloadManagerList.cpp (98%) rename src/gui/{ => wxgui}/components/wxDownloadManagerList.h (99%) rename src/gui/{ => wxgui}/components/wxGameList.cpp (98%) rename src/gui/{ => wxgui}/components/wxGameList.h (100%) rename src/gui/{ => wxgui}/components/wxInputDraw.cpp (98%) rename src/gui/{ => wxgui}/components/wxInputDraw.h (100%) rename src/gui/{ => wxgui}/components/wxLogCtrl.cpp (98%) rename src/gui/{ => wxgui}/components/wxLogCtrl.h (100%) rename src/gui/{ => wxgui}/components/wxProgressDialogManager.h (100%) rename src/gui/{ => wxgui}/components/wxTitleManagerList.cpp (99%) rename src/gui/{ => wxgui}/components/wxTitleManagerList.h (98%) rename src/gui/{ => wxgui}/debugger/BreakpointWindow.cpp (98%) rename src/gui/{ => wxgui}/debugger/BreakpointWindow.h (92%) rename src/gui/{ => wxgui}/debugger/DebuggerWindow2.cpp (94%) rename src/gui/{ => wxgui}/debugger/DebuggerWindow2.h (86%) rename src/gui/{ => wxgui}/debugger/DisasmCtrl.cpp (99%) rename src/gui/{ => wxgui}/debugger/DisasmCtrl.h (98%) rename src/gui/{ => wxgui}/debugger/DumpCtrl.cpp (99%) rename src/gui/{ => wxgui}/debugger/DumpCtrl.h (95%) rename src/gui/{ => wxgui}/debugger/DumpWindow.cpp (89%) rename src/gui/{ => wxgui}/debugger/DumpWindow.h (90%) rename src/gui/{ => wxgui}/debugger/ModuleWindow.cpp (95%) rename src/gui/{ => wxgui}/debugger/ModuleWindow.h (100%) rename src/gui/{ => wxgui}/debugger/RegisterCtrl.cpp (98%) rename src/gui/{ => wxgui}/debugger/RegisterCtrl.h (93%) rename src/gui/{ => wxgui}/debugger/RegisterWindow.cpp (99%) rename src/gui/{ => wxgui}/debugger/RegisterWindow.h (100%) rename src/gui/{ => wxgui}/debugger/SymbolCtrl.cpp (97%) rename src/gui/{ => wxgui}/debugger/SymbolCtrl.h (100%) rename src/gui/{ => wxgui}/debugger/SymbolWindow.cpp (91%) rename src/gui/{ => wxgui}/debugger/SymbolWindow.h (91%) rename src/gui/{ => wxgui}/dialogs/CreateAccount/wxCreateAccountDialog.cpp (98%) rename src/gui/{ => wxgui}/dialogs/CreateAccount/wxCreateAccountDialog.h (100%) rename src/gui/{ => wxgui}/dialogs/SaveImport/SaveImportWindow.cpp (99%) rename src/gui/{ => wxgui}/dialogs/SaveImport/SaveImportWindow.h (100%) rename src/gui/{ => wxgui}/dialogs/SaveImport/SaveTransfer.cpp (99%) rename src/gui/{ => wxgui}/dialogs/SaveImport/SaveTransfer.h (100%) rename src/gui/{ => wxgui}/helpers/wxControlObject.h (100%) rename src/gui/{ => wxgui}/helpers/wxCustomData.h (100%) rename src/gui/{ => wxgui}/helpers/wxCustomEvents.cpp (86%) rename src/gui/{ => wxgui}/helpers/wxCustomEvents.h (100%) create mode 100644 src/gui/wxgui/helpers/wxHelpers.cpp rename src/gui/{ => wxgui}/helpers/wxHelpers.h (95%) rename src/gui/{ => wxgui}/helpers/wxLogEvent.h (100%) rename src/gui/{ => wxgui}/helpers/wxWayland.cpp (95%) rename src/gui/{ => wxgui}/helpers/wxWayland.h (100%) rename src/gui/{ => wxgui}/input/HotkeySettings.cpp (79%) rename src/gui/{ => wxgui}/input/HotkeySettings.h (93%) rename src/gui/{ => wxgui}/input/InputAPIAddWindow.cpp (98%) rename src/gui/{ => wxgui}/input/InputAPIAddWindow.h (97%) rename src/gui/{ => wxgui}/input/InputSettings2.cpp (98%) rename src/gui/{ => wxgui}/input/InputSettings2.h (100%) rename src/gui/{ => wxgui}/input/PairingDialog.cpp (99%) rename src/gui/{ => wxgui}/input/PairingDialog.h (100%) rename src/gui/{ => wxgui}/input/panels/ClassicControllerInputPanel.cpp (96%) rename src/gui/{ => wxgui}/input/panels/ClassicControllerInputPanel.h (90%) rename src/gui/{ => wxgui}/input/panels/InputPanel.cpp (97%) rename src/gui/{ => wxgui}/input/panels/InputPanel.h (98%) rename src/gui/{ => wxgui}/input/panels/ProControllerInputPanel.cpp (97%) rename src/gui/{ => wxgui}/input/panels/ProControllerInputPanel.h (84%) rename src/gui/{ => wxgui}/input/panels/VPADInputPanel.cpp (97%) rename src/gui/{ => wxgui}/input/panels/VPADInputPanel.h (94%) rename src/gui/{ => wxgui}/input/panels/WiimoteInputPanel.cpp (98%) rename src/gui/{ => wxgui}/input/panels/WiimoteInputPanel.h (95%) rename src/gui/{ => wxgui}/input/settings/DefaultControllerSettings.cpp (98%) rename src/gui/{ => wxgui}/input/settings/DefaultControllerSettings.h (100%) rename src/gui/{ => wxgui}/input/settings/WiimoteControllerSettings.cpp (98%) rename src/gui/{ => wxgui}/input/settings/WiimoteControllerSettings.h (100%) rename src/gui/{ => wxgui}/windows/PPCThreadsViewer/DebugPPCThreadsWindow.cpp (99%) rename src/gui/{ => wxgui}/windows/PPCThreadsViewer/DebugPPCThreadsWindow.h (100%) rename src/gui/{ => wxgui}/windows/TextureRelationViewer/TextureRelationWindow.cpp (99%) rename src/gui/{ => wxgui}/windows/TextureRelationViewer/TextureRelationWindow.h (100%) create mode 100644 src/gui/wxgui/wxCemuConfig.cpp create mode 100644 src/gui/wxgui/wxCemuConfig.h rename src/gui/{ => wxgui}/wxHelper.h (100%) create mode 100644 src/gui/wxgui/wxWindowSystem.cpp rename src/gui/{ => wxgui}/wxcomponents/checked.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/checked2.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/checked_d.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/checked_dis.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/checked_ld.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/checked_mo.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/checkedlistctrl.cpp (98%) rename src/gui/{ => wxgui}/wxcomponents/checkedlistctrl.h (100%) rename src/gui/{ => wxgui}/wxcomponents/checktree.cpp (97%) rename src/gui/{ => wxgui}/wxcomponents/checktree.h (100%) rename src/gui/{ => wxgui}/wxcomponents/unchecked.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/unchecked2.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/unchecked_d.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/unchecked_dis.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/unchecked_ld.xpm (100%) rename src/gui/{ => wxgui}/wxcomponents/unchecked_mo.xpm (100%) rename src/gui/{ => wxgui}/wxgui.h (100%) diff --git a/.github/workflows/generate_pot.yml b/.github/workflows/generate_pot.yml index b057d441..bd42de46 100644 --- a/.github/workflows/generate_pot.yml +++ b/.github/workflows/generate_pot.yml @@ -31,6 +31,7 @@ jobs: find src -name *.cpp -o -name *.hpp -o -name *.h | xargs xgettext --from-code=utf-8 -w 100 --keyword="_" --keyword="wxTRANSLATE" --keyword="wxPLURAL:1,2" + --keyword="_tr" --keyword="TR_NOOP" --check=space-ellipsis --omit-header -o cemu.pot diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04b6dfdd..a5ab2154 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -150,7 +150,3 @@ if(UNIX AND NOT APPLE) # most likely not helpful in debugging problems with cemu code target_link_options(CemuBin PRIVATE "$<$:-Xlinker;--strip-debug>") endif() - -if (ENABLE_WXWIDGETS) - target_link_libraries(CemuBin PRIVATE wx::base wx::core) -endif() diff --git a/src/Cafe/CMakeLists.txt b/src/Cafe/CMakeLists.txt index 2900059b..1b0def84 100644 --- a/src/Cafe/CMakeLists.txt +++ b/src/Cafe/CMakeLists.txt @@ -597,10 +597,6 @@ else () target_link_libraries(CemuCafe PRIVATE libusb::libusb) endif () -if (ENABLE_WXWIDGETS) - target_link_libraries(CemuCafe PRIVATE wx::base wx::core) -endif() - if(WIN32) target_link_libraries(CemuCafe PRIVATE iphlpapi) endif() diff --git a/src/Cafe/CafeSystem.cpp b/src/Cafe/CafeSystem.cpp index d20ccd9d..0a145a94 100644 --- a/src/Cafe/CafeSystem.cpp +++ b/src/Cafe/CafeSystem.cpp @@ -1,5 +1,5 @@ #include "Cafe/OS/common/OSCommon.h" -#include "gui/wxgui.h" +#include "WindowSystem.h" #include "Cafe/OS/libs/gx2/GX2.h" #include "Cafe/GameProfile/GameProfile.h" #include "Cafe/HW/Espresso/Interpreter/PPCInterpreterInternal.h" @@ -65,9 +65,6 @@ // HW interfaces #include "Cafe/HW/SI/si.h" -// dependency to be removed -#include "gui/guiWrapper.h" - #include #if BOOST_OS_LINUX @@ -172,7 +169,7 @@ void LoadMainExecutable() applicationRPX = RPLLoader_LoadFromMemory(rpxData, rpxSize, (char*)_pathToExecutable.c_str()); if (!applicationRPX) { - wxMessageBox(_("Failed to run this title because the executable is damaged")); + WindowSystem::ShowErrorDialog(_tr("Failed to run this title because the executable is damaged")); cemuLog_createLogFile(false); cemuLog_waitForFlush(); exit(0); @@ -357,7 +354,7 @@ uint32 LoadSharedData() void cemu_initForGame() { - gui_updateWindowTitles(false, true, 0.0); + WindowSystem::UpdateWindowTitles(false, true, 0.0); // input manager apply game profile InputManager::instance().apply_game_profile(); // log info for launched title @@ -855,7 +852,7 @@ namespace CafeSystem PPCTimer_waitForInit(); // start system sSystemRunning = true; - gui_notifyGameLoaded(); + WindowSystem::NotifyGameLoaded(); std::thread t(_LaunchTitleThread); t.detach(); } diff --git a/src/Cafe/Filesystem/FST/KeyCache.cpp b/src/Cafe/Filesystem/FST/KeyCache.cpp index 29903e84..f85d2b54 100644 --- a/src/Cafe/Filesystem/FST/KeyCache.cpp +++ b/src/Cafe/Filesystem/FST/KeyCache.cpp @@ -1,7 +1,7 @@ -#include #include -#include +#include "Cemu/Logging/CemuLogging.h" +#include "WindowSystem.h" #include "config/ActiveSettings.h" #include "util/crypto/aes128.h" #include "Common/FileStream.h" @@ -75,7 +75,7 @@ void KeyCache_Prepare() } else { - wxMessageBox(_("Unable to create file keys.txt\nThis can happen if Cemu does not have write permission to its own directory, the disk is full or if anti-virus software is blocking Cemu."), _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + WindowSystem::ShowErrorDialog(_tr("Unable to create file keys.txt\nThis can happen if Cemu does not have write permission to its own directory, the disk is full or if anti-virus software is blocking Cemu."), _tr("Error"), WindowSystem::ErrorCategory::KEYS_TXT_CREATION); } mtxKeyCache.unlock(); return; @@ -108,8 +108,8 @@ void KeyCache_Prepare() continue; if( strishex(line) == false ) { - auto errorMsg = formatWxString(_("Error in keys.txt at line {}"), lineNumber); - wxMessageBox(errorMsg, _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + auto errorMsg = _tr("Error in keys.txt at line {}", lineNumber); + WindowSystem::ShowErrorDialog(errorMsg, WindowSystem::ErrorCategory::KEYS_TXT_CREATION); continue; } if(line.size() == 32 ) diff --git a/src/Cafe/GraphicPack/GraphicPack2.cpp b/src/Cafe/GraphicPack/GraphicPack2.cpp index 6ae05c5b..ab4dbd3a 100644 --- a/src/Cafe/GraphicPack/GraphicPack2.cpp +++ b/src/Cafe/GraphicPack/GraphicPack2.cpp @@ -85,7 +85,7 @@ bool GraphicPack2::LoadGraphicPack(const fs::path& rulesPath, IniParser& rules) auto gp = std::make_shared(rulesPath, rules); // check if enabled and preset set - const auto& config_entries = g_config.data().graphic_pack_entries; + const auto& config_entries = GetConfigHandle().data().graphic_pack_entries; // legacy absolute path checking for not breaking compatibility auto file = gp->GetRulesPath(); diff --git a/src/Cafe/GraphicPack/GraphicPack2Patches.cpp b/src/Cafe/GraphicPack/GraphicPack2Patches.cpp index 2c067484..d0d00bf2 100644 --- a/src/Cafe/GraphicPack/GraphicPack2Patches.cpp +++ b/src/Cafe/GraphicPack/GraphicPack2Patches.cpp @@ -1,13 +1,12 @@ #include "Cafe/GraphicPack/GraphicPack2.h" +#include "Cemu/Logging/CemuLogging.h" #include "Common/FileStream.h" +#include "WindowSystem.h" #include "util/helpers/StringParser.h" #include "Cemu/PPCAssembler/ppcAssembler.h" #include "Cafe/OS/RPL/rpl_structs.h" #include "boost/algorithm/string.hpp" -#include "gui/wxgui.h" // for wxMessageBox -#include "gui/helpers/wxHelpers.h" - // error handler void PatchErrorHandler::printError(class PatchGroup* patchGroup, sint32 lineNumber, std::string_view errorMsg) { @@ -40,13 +39,13 @@ void PatchErrorHandler::printError(class PatchGroup* patchGroup, sint32 lineNumb void PatchErrorHandler::showStageErrorMessageBox() { - wxString errorMsg; + std::string errorMsg; if (m_gp) { if (m_stage == STAGE::PARSER) - errorMsg.assign(formatWxString(_("Failed to load patches for graphic pack \'{}\'"), m_gp->GetName())); + errorMsg.assign(_tr("Failed to load patches for graphic pack \'{}\'", m_gp->GetName())); else - errorMsg.assign(formatWxString(_("Failed to apply patches for graphic pack \'{}\'"), m_gp->GetName())); + errorMsg.assign(_tr("Failed to apply patches for graphic pack \'{}\'", m_gp->GetName())); } else { @@ -55,7 +54,7 @@ void PatchErrorHandler::showStageErrorMessageBox() if (cemuLog_isLoggingEnabled(LogType::Patches)) { errorMsg.append("\n \n") - .append(_("Details:")) + .append(_tr("Details:")) .append("\n"); for (auto& itr : errorMessages) { @@ -64,7 +63,7 @@ void PatchErrorHandler::showStageErrorMessageBox() } } - wxMessageBox(errorMsg, _("Graphic pack error")); + WindowSystem::ShowErrorDialog(errorMsg, _tr("Graphic pack error"), WindowSystem::ErrorCategory::GRAPHIC_PACKS); } // loads Cemu-style patches (patch_.asm) diff --git a/src/Cafe/HW/Espresso/Debugger/Debugger.cpp b/src/Cafe/HW/Espresso/Debugger/Debugger.cpp index e84c9fda..fbfc94fe 100644 --- a/src/Cafe/HW/Espresso/Debugger/Debugger.cpp +++ b/src/Cafe/HW/Espresso/Debugger/Debugger.cpp @@ -1,19 +1,20 @@ -#include "gui/guiWrapper.h" +#include "Common/precompiled.h" #include "Debugger.h" #include "Cafe/OS/RPL/rpl_structs.h" #include "Cemu/PPCAssembler/ppcAssembler.h" #include "Cafe/HW/Espresso/Recompiler/PPCRecompiler.h" #include "Cemu/ExpressionParser/ExpressionParser.h" -#include "gui/debugger/DebuggerWindow2.h" - #include "Cafe/OS/libs/coreinit/coreinit.h" +#include "OS/RPL/rpl.h" #include "util/helpers/helpers.h" #if BOOST_OS_WINDOWS #include #endif +DebuggerDispatcher g_debuggerDispatcher; + debuggerState_t debuggerState{ }; DebuggerBreakpoint* debugger_getFirstBP(uint32 address) @@ -337,7 +338,7 @@ void debugger_toggleBreakpoint(uint32 address, bool state, DebuggerBreakpoint* b { bp->enabled = state; debugger_updateExecutionBreakpoint(address); - debuggerWindow_updateViewThreadsafe2(); + g_debuggerDispatcher.UpdateViewThreadsafe(); } else if (bpItr->isMemBP()) { @@ -359,7 +360,7 @@ void debugger_toggleBreakpoint(uint32 address, bool state, DebuggerBreakpoint* b debugger_updateMemoryBreakpoint(bpItr); else debugger_updateMemoryBreakpoint(nullptr); - debuggerWindow_updateViewThreadsafe2(); + g_debuggerDispatcher.UpdateViewThreadsafe(); } return; } @@ -496,7 +497,7 @@ void debugger_stepInto(PPCInterpreter_t* hCPU, bool updateDebuggerWindow = true) debugger_updateExecutionBreakpoint(initialIP); debuggerState.debugSession.instructionPointer = hCPU->instructionPointer; if(updateDebuggerWindow) - debuggerWindow_moveIP(); + g_debuggerDispatcher.MoveIP(); ppcRecompilerEnabled = isRecEnabled; } @@ -515,7 +516,7 @@ bool debugger_stepOver(PPCInterpreter_t* hCPU) // nothing to skip, use step-into debugger_stepInto(hCPU); debugger_updateExecutionBreakpoint(initialIP); - debuggerWindow_moveIP(); + g_debuggerDispatcher.MoveIP(); ppcRecompilerEnabled = isRecEnabled; return false; } @@ -523,7 +524,7 @@ bool debugger_stepOver(PPCInterpreter_t* hCPU) debugger_createCodeBreakpoint(initialIP + 4, DEBUGGER_BP_T_ONE_SHOT); // step over current instruction (to avoid breakpoint) debugger_stepInto(hCPU); - debuggerWindow_moveIP(); + g_debuggerDispatcher.MoveIP(); // restore breakpoints debugger_updateExecutionBreakpoint(initialIP); // run @@ -621,8 +622,8 @@ void debugger_enterTW(PPCInterpreter_t* hCPU) DebuggerBreakpoint* singleshotBP = debugger_getFirstBP(debuggerState.debugSession.instructionPointer, DEBUGGER_BP_T_ONE_SHOT); if (singleshotBP) debugger_deleteBreakpoint(singleshotBP); - debuggerWindow_notifyDebugBreakpointHit2(); - debuggerWindow_updateViewThreadsafe2(); + g_debuggerDispatcher.NotifyDebugBreakpointHit(); + g_debuggerDispatcher.UpdateViewThreadsafe(); // reset step control debuggerState.debugSession.stepInto = false; debuggerState.debugSession.stepOver = false; @@ -639,14 +640,14 @@ void debugger_enterTW(PPCInterpreter_t* hCPU) break; // if true is returned, continue with execution } debugger_createPPCStateSnapshot(hCPU); - debuggerWindow_updateViewThreadsafe2(); + g_debuggerDispatcher.UpdateViewThreadsafe(); debuggerState.debugSession.stepOver = false; } if (debuggerState.debugSession.stepInto) { debugger_stepInto(hCPU); debugger_createPPCStateSnapshot(hCPU); - debuggerWindow_updateViewThreadsafe2(); + g_debuggerDispatcher.UpdateViewThreadsafe(); debuggerState.debugSession.stepInto = false; continue; } @@ -663,8 +664,8 @@ void debugger_enterTW(PPCInterpreter_t* hCPU) debuggerState.debugSession.isTrapped = false; debuggerState.debugSession.hCPU = nullptr; - debuggerWindow_updateViewThreadsafe2(); - debuggerWindow_notifyRun(); + g_debuggerDispatcher.UpdateViewThreadsafe(); + g_debuggerDispatcher.NotifyRun(); } void debugger_shouldBreak(PPCInterpreter_t* hCPU) diff --git a/src/Cafe/HW/Espresso/Debugger/Debugger.h b/src/Cafe/HW/Espresso/Debugger/Debugger.h index c220eb8a..d385cadd 100644 --- a/src/Cafe/HW/Espresso/Debugger/Debugger.h +++ b/src/Cafe/HW/Espresso/Debugger/Debugger.h @@ -15,6 +15,69 @@ #define DEBUGGER_BP_T_GDBSTUB_TW 0x7C010008 #define DEBUGGER_BP_T_DEBUGGER_TW 0x7C020008 +class DebuggerCallbacks +{ + public: + virtual void UpdateViewThreadsafe() {} + virtual void NotifyDebugBreakpointHit() {} + virtual void NotifyRun() {} + virtual void MoveIP() {} + virtual void NotifyModuleLoaded(void* module) {} + virtual void NotifyModuleUnloaded(void* module) {} + virtual ~DebuggerCallbacks() = default; +}; + +class DebuggerDispatcher +{ + private: + static inline class DefaultDebuggerCallbacks : public DebuggerCallbacks + { + } s_defaultDebuggerCallbacks; + DebuggerCallbacks* m_callbacks = &s_defaultDebuggerCallbacks; + + public: + void SetDebuggerCallbacks(DebuggerCallbacks* debuggerCallbacks) + { + cemu_assert_debug(m_callbacks == &s_defaultDebuggerCallbacks); + m_callbacks = debuggerCallbacks; + } + + void ClearDebuggerCallbacks() + { + cemu_assert_debug(m_callbacks != &s_defaultDebuggerCallbacks); + m_callbacks = &s_defaultDebuggerCallbacks; + } + + void UpdateViewThreadsafe() + { + m_callbacks->UpdateViewThreadsafe(); + } + + void NotifyDebugBreakpointHit() + { + m_callbacks->NotifyDebugBreakpointHit(); + } + + void NotifyRun() + { + m_callbacks->NotifyRun(); + } + + void MoveIP() + { + m_callbacks->MoveIP(); + } + + void NotifyModuleLoaded(void* module) + { + m_callbacks->NotifyModuleLoaded(module); + } + + void NotifyModuleUnloaded(void* module) + { + m_callbacks->NotifyModuleUnloaded(module); + } +} extern g_debuggerDispatcher; struct DebuggerBreakpoint { diff --git a/src/Cafe/HW/Latte/Core/LatteOverlay.cpp b/src/Cafe/HW/Latte/Core/LatteOverlay.cpp index e6edb904..7499d743 100644 --- a/src/Cafe/HW/Latte/Core/LatteOverlay.cpp +++ b/src/Cafe/HW/Latte/Core/LatteOverlay.cpp @@ -1,6 +1,6 @@ #include "Cafe/HW/Latte/Core/LatteOverlay.h" #include "Cafe/HW/Latte/Core/LattePerformanceMonitor.h" -#include "gui/guiWrapper.h" +#include "WindowSystem.h" #include "config/CemuConfig.h" @@ -519,17 +519,17 @@ void LatteOverlay_render(bool pad_view) return; sint32 w = 0, h = 0; - if (pad_view && gui_isPadWindowOpen()) - gui_getPadWindowPhysSize(w, h); + if (pad_view && WindowSystem::IsPadWindowOpen()) + WindowSystem::GetPadWindowPhysSize(w, h); else - gui_getWindowPhysSize(w, h); + WindowSystem::GetWindowPhysSize(w, h); if (w == 0 || h == 0) return; const Vector2f window_size{ (float)w,(float)h }; - float fontDPIScale = !pad_view ? gui_getWindowDPIScale() : gui_getPadDPIScale(); + float fontDPIScale = !pad_view ? WindowSystem::GetWindowDPIScale() : WindowSystem::GetPadDPIScale(); float overlayFontSize = 14.0f * (float)config.overlay.text_scale / 100.0f * fontDPIScale; diff --git a/src/Cafe/HW/Latte/Core/LattePerformanceMonitor.cpp b/src/Cafe/HW/Latte/Core/LattePerformanceMonitor.cpp index 14dfe9a9..a3bcb63e 100644 --- a/src/Cafe/HW/Latte/Core/LattePerformanceMonitor.cpp +++ b/src/Cafe/HW/Latte/Core/LattePerformanceMonitor.cpp @@ -1,6 +1,6 @@ #include "Cafe/HW/Latte/Core/LattePerformanceMonitor.h" #include "Cafe/HW/Latte/Core/LatteOverlay.h" -#include "gui/guiWrapper.h" +#include "WindowSystem.h" performanceMonitor_t performanceMonitor{}; @@ -106,12 +106,12 @@ void LattePerformanceMonitor_frameEnd() if (isFirstUpdate) { LatteOverlay_updateStats(0.0, 0, 0); - gui_updateWindowTitles(false, false, 0.0); + WindowSystem::UpdateWindowTitles(false, false, 0.0); } else { LatteOverlay_updateStats(fps, drawCallCounter / elapsedFrames, fastDrawCallCounter / elapsedFrames); - gui_updateWindowTitles(false, false, fps); + WindowSystem::UpdateWindowTitles(false, false, fps); } } } diff --git a/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp b/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp index 2efef5bf..be9917e1 100644 --- a/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp +++ b/src/Cafe/HW/Latte/Core/LatteRenderTarget.cpp @@ -11,7 +11,7 @@ #include "Cafe/HW/Latte/Core/LattePerformanceMonitor.h" #include "Cafe/GraphicPack/GraphicPack2.h" #include "config/ActiveSettings.h" -#include "gui/guiWrapper.h" +#include "WindowSystem.h" #include "Cafe/OS/libs/erreula/erreula.h" #include "input/InputManager.h" #include "Cafe/OS/libs/swkbd/swkbd.h" @@ -838,10 +838,10 @@ sint32 _currentOutputImageHeight = 0; void LatteRenderTarget_getScreenImageArea(sint32* x, sint32* y, sint32* width, sint32* height, sint32* fullWidth, sint32* fullHeight, bool padView) { int w, h; - if(padView && gui_isPadWindowOpen()) - gui_getPadWindowPhysSize(w, h); + if(padView && WindowSystem::IsPadWindowOpen()) + WindowSystem::GetPadWindowPhysSize(w, h); else - gui_getWindowPhysSize(w, h); + WindowSystem::GetWindowPhysSize(w, h); sint32 scaledOutputX; sint32 scaledOutputY; @@ -999,8 +999,8 @@ void LatteRenderTarget_itHLECopyColorBufferToScanBuffer(MPTR colorBufferPtr, uin return {pressed && !toggle, pressed && toggle}; }; - const bool tabPressed = gui_isKeyDown(PlatformKeyCodes::TAB); - const bool ctrlPressed = gui_isKeyDown(PlatformKeyCodes::LCONTROL); + const bool tabPressed = WindowSystem::IsKeyDown(WindowSystem::PlatformKeyCodes::TAB); + const bool ctrlPressed = WindowSystem::IsKeyDown(WindowSystem::PlatformKeyCodes::LCONTROL); const auto [vpad0Active, vpad0Toggle] = getVPADScreenActive(0); const auto [vpad1Active, vpad1Toggle] = getVPADScreenActive(1); diff --git a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp index 86035973..737e9201 100644 --- a/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp +++ b/src/Cafe/HW/Latte/Core/LatteShaderCache.cpp @@ -6,7 +6,7 @@ #include "Cafe/HW/Latte/Core/FetchShader.h" #include "Cemu/FileCache/FileCache.h" #include "Cafe/GameProfile/GameProfile.h" -#include "gui/guiWrapper.h" +#include "WindowSystem.h" #include "Cafe/HW/Latte/Renderer/Renderer.h" #include "Cafe/HW/Latte/Renderer/OpenGL/RendererShaderGL.h" @@ -24,7 +24,6 @@ #include "Cafe/HW/Latte/Common/ShaderSerializer.h" #include "util/helpers/Serializer.h" -#include #include