mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-11 22:37:57 -05:00
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:
@ -8,12 +8,14 @@
|
||||
#include <optional>
|
||||
#include <QDialog>
|
||||
|
||||
#include "core/settings.h"
|
||||
|
||||
class QCheckBox;
|
||||
class QPushButton;
|
||||
class QTimer;
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureMouseAdvanced;
|
||||
}
|
||||
@ -22,7 +24,7 @@ class ConfigureMouseAdvanced : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureMouseAdvanced(QWidget* parent);
|
||||
explicit ConfigureMouseAdvanced(QWidget* parent, InputCommon::InputSubsystem* input_subsystem_);
|
||||
~ConfigureMouseAdvanced() override;
|
||||
|
||||
void ApplyConfiguration();
|
||||
@ -57,6 +59,8 @@ private:
|
||||
|
||||
std::unique_ptr<Ui::ConfigureMouseAdvanced> ui;
|
||||
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
|
||||
/// This will be the the setting function when an input is awaiting configuration.
|
||||
std::optional<std::function<void(const Common::ParamPackage&)>> input_setter;
|
||||
|
||||
|
Reference in New Issue
Block a user