From 9e1b0af25907f7a8b960aa5c1e7d931691f40196 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 27 Aug 2020 15:16:47 -0400 Subject: input_common: Eliminate most global state Abstracts most of the input mechanisms under an InputSubsystem class that is managed by the frontends, eliminating any static constructors and destructors. This gets rid of global accessor functions and also allows the frontends to have a more fine-grained control over the lifecycle of the input subsystem. This also makes it explicit which interfaces rely on the input subsystem instead of making it opaque in the interface functions. All that remains to migrate over is the factories, which can be done in a separate change. --- src/yuzu/main.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/yuzu/main.h') diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 01f9131e5..957f20fa8 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -40,12 +40,20 @@ namespace Core::Frontend { struct SoftwareKeyboardParameters; } // namespace Core::Frontend +namespace DiscordRPC { +class DiscordInterface; +} + namespace FileSys { class ContentProvider; class ManualContentProvider; class VfsFilesystem; } // namespace FileSys +namespace InputCommon { +class InputSubsystem; +} + enum class EmulatedDirectoryTarget { NAND, SDMC, @@ -62,10 +70,6 @@ enum class ReinitializeKeyBehavior { Warning, }; -namespace DiscordRPC { -class DiscordInterface; -} - class GMainWindow : public QMainWindow { Q_OBJECT @@ -86,8 +90,6 @@ public: GMainWindow(); ~GMainWindow() override; - std::unique_ptr discord_rpc; - bool DropAction(QDropEvent* event); void AcceptDropEvent(QDropEvent* event); @@ -255,6 +257,9 @@ private: Ui::MainWindow ui; + std::unique_ptr discord_rpc; + std::unique_ptr input_subsystem; + GRenderWindow* render_window; GameList* game_list; LoadingScreen* loading_screen; -- cgit v1.2.3