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.
This commit is contained in:
Lioncash
2020-08-27 15:16:47 -04:00
parent 3db9a25977
commit 9e1b0af259
25 changed files with 397 additions and 243 deletions

View File

@ -23,6 +23,10 @@ class QKeyEvent;
class QTouchEvent;
class QStringList;
namespace InputCommon {
class InputSubsystem;
}
namespace VideoCore {
enum class LoadCallbackStage;
}
@ -121,7 +125,8 @@ class GRenderWindow : public QWidget, public Core::Frontend::EmuWindow {
Q_OBJECT
public:
GRenderWindow(GMainWindow* parent, EmuThread* emu_thread);
explicit GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
InputCommon::InputSubsystem* input_subsystem_);
~GRenderWindow() override;
// EmuWindow implementation.
@ -183,6 +188,7 @@ private:
QStringList GetUnsupportedGLExtensions() const;
EmuThread* emu_thread;
InputCommon::InputSubsystem* input_subsystem;
// Main context that will be shared with all other contexts that are requested.
// If this is used in a shared context setting, then this should not be used directly, but