diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-03-26 10:26:16 +0100 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-04-15 07:53:17 +0200 |
commit | 4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40 (patch) | |
tree | 40afabaffab15c22457bc9aed2e465a73be4e24b | |
parent | input_interpreter: Fix button hold being interpreted incorrectly on init (diff) | |
download | yuzu-4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40.tar yuzu-4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40.tar.gz yuzu-4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40.tar.bz2 yuzu-4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40.tar.lz yuzu-4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40.tar.xz yuzu-4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40.tar.zst yuzu-4a5f9f5a6d3bfd8796f52d6c778a8abb3922ff40.zip |
-rw-r--r-- | src/yuzu/main.cpp | 58 | ||||
-rw-r--r-- | src/yuzu/main.h | 16 |
2 files changed, 65 insertions, 9 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e9d6e7421..422b3cff6 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -227,6 +227,8 @@ GMainWindow::GMainWindow() SetDiscordEnabled(UISettings::values.enable_discord_presence); discord_rpc->Update(); + RegisterMetaTypes(); + InitializeWidgets(); InitializeDebugWidgets(); InitializeRecentFileMenuActions(); @@ -375,6 +377,55 @@ GMainWindow::~GMainWindow() { delete render_window; } +void GMainWindow::RegisterMetaTypes() { + // Register integral and floating point types + qRegisterMetaType<u8>("u8"); + qRegisterMetaType<u16>("u16"); + qRegisterMetaType<u32>("u32"); + qRegisterMetaType<u64>("u64"); + qRegisterMetaType<u128>("u128"); + qRegisterMetaType<s8>("s8"); + qRegisterMetaType<s16>("s16"); + qRegisterMetaType<s32>("s32"); + qRegisterMetaType<s64>("s64"); + qRegisterMetaType<f32>("f32"); + qRegisterMetaType<f64>("f64"); + + // Register string types + qRegisterMetaType<std::string>("std::string"); + qRegisterMetaType<std::wstring>("std::wstring"); + qRegisterMetaType<std::u8string>("std::u8string"); + qRegisterMetaType<std::u16string>("std::u16string"); + qRegisterMetaType<std::u32string>("std::u32string"); + qRegisterMetaType<std::string_view>("std::string_view"); + qRegisterMetaType<std::wstring_view>("std::wstring_view"); + qRegisterMetaType<std::u8string_view>("std::u8string_view"); + qRegisterMetaType<std::u16string_view>("std::u16string_view"); + qRegisterMetaType<std::u32string_view>("std::u32string_view"); + + // Register applet types + + // Controller Applet + qRegisterMetaType<Core::Frontend::ControllerParameters>("Core::Frontend::ControllerParameters"); + + // Software Keyboard Applet + qRegisterMetaType<Core::Frontend::KeyboardInitializeParameters>( + "Core::Frontend::KeyboardInitializeParameters"); + qRegisterMetaType<Core::Frontend::InlineAppearParameters>( + "Core::Frontend::InlineAppearParameters"); + qRegisterMetaType<Core::Frontend::InlineTextParameters>("Core::Frontend::InlineTextParameters"); + qRegisterMetaType<Service::AM::Applets::SwkbdResult>("Service::AM::Applets::SwkbdResult"); + qRegisterMetaType<Service::AM::Applets::SwkbdTextCheckResult>( + "Service::AM::Applets::SwkbdTextCheckResult"); + qRegisterMetaType<Service::AM::Applets::SwkbdReplyType>("Service::AM::Applets::SwkbdReplyType"); + + // Web Browser Applet + qRegisterMetaType<Service::AM::Applets::WebExitReason>("Service::AM::Applets::WebExitReason"); + + // Register loader types + qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus"); +} + void GMainWindow::ControllerSelectorReconfigureControllers( const Core::Frontend::ControllerParameters& parameters) { QtControllerSelectorDialog dialog(this, parameters, input_subsystem.get()); @@ -2166,13 +2217,6 @@ void GMainWindow::OnStartGame() { emu_thread->SetRunning(true); - qRegisterMetaType<Core::Frontend::ControllerParameters>("Core::Frontend::ControllerParameters"); - qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus"); - qRegisterMetaType<std::string>("std::string"); - qRegisterMetaType<std::optional<std::u16string>>("std::optional<std::u16string>"); - qRegisterMetaType<std::string_view>("std::string_view"); - qRegisterMetaType<Service::AM::Applets::WebExitReason>("Service::AM::Applets::WebExitReason"); - connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError); ui.action_Start->setEnabled(false); diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 6429549ae..d8849f85b 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -37,9 +37,13 @@ enum class GameListRemoveTarget; enum class InstalledEntryType; class GameListPlaceholder; +class QtSoftwareKeyboardDialog; + namespace Core::Frontend { struct ControllerParameters; -struct SoftwareKeyboardParameters; +struct InlineAppearParameters; +struct InlineTextParameters; +struct KeyboardInitializeParameters; } // namespace Core::Frontend namespace DiscordRPC { @@ -57,8 +61,11 @@ class InputSubsystem; } namespace Service::AM::Applets { +enum class SwkbdResult : u32; +enum class SwkbdTextCheckResult : u32; +enum class SwkbdReplyType : u32; enum class WebExitReason : u32; -} +} // namespace Service::AM::Applets enum class EmulatedDirectoryTarget { NAND, @@ -143,6 +150,8 @@ public slots: void OnAppFocusStateChanged(Qt::ApplicationState state); private: + void RegisterMetaTypes(); + void InitializeWidgets(); void InitializeDebugWidgets(); void InitializeRecentFileMenuActions(); @@ -329,6 +338,9 @@ private: // Disables the web applet for the rest of the emulated session bool disable_web_applet{}; + // Applets + QtSoftwareKeyboardDialog* software_keyboard = nullptr; + protected: void dropEvent(QDropEvent* event) override; void dragEnterEvent(QDragEnterEvent* event) override; |