diff options
| author | 2018-11-27 05:02:12 -0500 | |
|---|---|---|
| committer | 2018-11-27 05:02:15 -0500 | |
| commit | d67e88e59c1a2f1ac8099e5c5684de2dcaf583eb (patch) | |
| tree | 256a08680512725bb2b9cdea85a046a1acb3ba92 /src | |
| parent | yuzu/configure_input: Remove unnecessary includes (diff) | |
| download | yuzu-d67e88e59c1a2f1ac8099e5c5684de2dcaf583eb.tar.gz yuzu-d67e88e59c1a2f1ac8099e5c5684de2dcaf583eb.tar.xz yuzu-d67e88e59c1a2f1ac8099e5c5684de2dcaf583eb.zip | |
yuzu/configure_input*: Move data members after function declarations
The common pattern is to put the data members after the function
interface where applicable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.h | 49 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_mouse_advanced.h | 34 |
2 files changed, 42 insertions, 41 deletions
diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index b0e5550c5..937f77998 100644 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h | |||
| @@ -9,9 +9,10 @@ | |||
| 9 | #include <memory> | 9 | #include <memory> |
| 10 | #include <optional> | 10 | #include <optional> |
| 11 | #include <string> | 11 | #include <string> |
| 12 | #include <unordered_map> | 12 | |
| 13 | #include <QDialog> | 13 | #include <QDialog> |
| 14 | #include <QKeyEvent> | 14 | #include <QKeyEvent> |
| 15 | |||
| 15 | #include "common/param_package.h" | 16 | #include "common/param_package.h" |
| 16 | #include "core/settings.h" | 17 | #include "core/settings.h" |
| 17 | #include "input_common/main.h" | 18 | #include "input_common/main.h" |
| @@ -36,6 +37,29 @@ public: | |||
| 36 | void applyConfiguration(); | 37 | void applyConfiguration(); |
| 37 | 38 | ||
| 38 | private: | 39 | private: |
| 40 | void OnControllerButtonClick(int i); | ||
| 41 | |||
| 42 | /// Load configuration settings. | ||
| 43 | void loadConfiguration(); | ||
| 44 | /// Restore all buttons to their default values. | ||
| 45 | void restoreDefaults(); | ||
| 46 | /// Clear all input configuration | ||
| 47 | void ClearAll(); | ||
| 48 | |||
| 49 | /// Update UI to reflect current configuration. | ||
| 50 | void updateButtonLabels(); | ||
| 51 | |||
| 52 | /// Called when the button was pressed. | ||
| 53 | void handleClick(QPushButton* button, | ||
| 54 | std::function<void(const Common::ParamPackage&)> new_input_setter, | ||
| 55 | InputCommon::Polling::DeviceType type); | ||
| 56 | |||
| 57 | /// Finish polling and configure input using the input_setter | ||
| 58 | void setPollingResult(const Common::ParamPackage& params, bool abort); | ||
| 59 | |||
| 60 | /// Handle key press events. | ||
| 61 | void keyPressEvent(QKeyEvent* event) override; | ||
| 62 | |||
| 39 | std::unique_ptr<Ui::ConfigureInputPlayer> ui; | 63 | std::unique_ptr<Ui::ConfigureInputPlayer> ui; |
| 40 | 64 | ||
| 41 | u8 player_index; | 65 | u8 player_index; |
| @@ -77,27 +101,4 @@ private: | |||
| 77 | 101 | ||
| 78 | std::array<QPushButton*, 4> controller_color_buttons; | 102 | std::array<QPushButton*, 4> controller_color_buttons; |
| 79 | std::array<QColor, 4> controller_colors; | 103 | std::array<QColor, 4> controller_colors; |
| 80 | |||
| 81 | void OnControllerButtonClick(int i); | ||
| 82 | |||
| 83 | /// Load configuration settings. | ||
| 84 | void loadConfiguration(); | ||
| 85 | /// Restore all buttons to their default values. | ||
| 86 | void restoreDefaults(); | ||
| 87 | /// Clear all input configuration | ||
| 88 | void ClearAll(); | ||
| 89 | |||
| 90 | /// Update UI to reflect current configuration. | ||
| 91 | void updateButtonLabels(); | ||
| 92 | |||
| 93 | /// Called when the button was pressed. | ||
| 94 | void handleClick(QPushButton* button, | ||
| 95 | std::function<void(const Common::ParamPackage&)> new_input_setter, | ||
| 96 | InputCommon::Polling::DeviceType type); | ||
| 97 | |||
| 98 | /// Finish polling and configure input using the input_setter | ||
| 99 | void setPollingResult(const Common::ParamPackage& params, bool abort); | ||
| 100 | |||
| 101 | /// Handle key press events. | ||
| 102 | void keyPressEvent(QKeyEvent* event) override; | ||
| 103 | }; | 104 | }; |
diff --git a/src/yuzu/configuration/configure_mouse_advanced.h b/src/yuzu/configuration/configure_mouse_advanced.h index 057b3aa72..e04da4bf2 100644 --- a/src/yuzu/configuration/configure_mouse_advanced.h +++ b/src/yuzu/configuration/configure_mouse_advanced.h | |||
| @@ -28,23 +28,6 @@ public: | |||
| 28 | void applyConfiguration(); | 28 | void applyConfiguration(); |
| 29 | 29 | ||
| 30 | private: | 30 | private: |
| 31 | std::unique_ptr<Ui::ConfigureMouseAdvanced> ui; | ||
| 32 | |||
| 33 | /// This will be the the setting function when an input is awaiting configuration. | ||
| 34 | std::optional<std::function<void(const Common::ParamPackage&)>> input_setter; | ||
| 35 | |||
| 36 | std::array<QPushButton*, Settings::NativeMouseButton::NumMouseButtons> button_map; | ||
| 37 | std::array<Common::ParamPackage, Settings::NativeMouseButton::NumMouseButtons> buttons_param; | ||
| 38 | |||
| 39 | std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers; | ||
| 40 | |||
| 41 | std::unique_ptr<QTimer> timeout_timer; | ||
| 42 | std::unique_ptr<QTimer> poll_timer; | ||
| 43 | |||
| 44 | /// A flag to indicate if keyboard keys are okay when configuring an input. If this is false, | ||
| 45 | /// keyboard events are ignored. | ||
| 46 | bool want_keyboard_keys = false; | ||
| 47 | |||
| 48 | /// Load configuration settings. | 31 | /// Load configuration settings. |
| 49 | void loadConfiguration(); | 32 | void loadConfiguration(); |
| 50 | /// Restore all buttons to their default values. | 33 | /// Restore all buttons to their default values. |
| @@ -65,4 +48,21 @@ private: | |||
| 65 | 48 | ||
| 66 | /// Handle key press events. | 49 | /// Handle key press events. |
| 67 | void keyPressEvent(QKeyEvent* event) override; | 50 | void keyPressEvent(QKeyEvent* event) override; |
| 51 | |||
| 52 | std::unique_ptr<Ui::ConfigureMouseAdvanced> ui; | ||
| 53 | |||
| 54 | /// This will be the the setting function when an input is awaiting configuration. | ||
| 55 | std::optional<std::function<void(const Common::ParamPackage&)>> input_setter; | ||
| 56 | |||
| 57 | std::array<QPushButton*, Settings::NativeMouseButton::NumMouseButtons> button_map; | ||
| 58 | std::array<Common::ParamPackage, Settings::NativeMouseButton::NumMouseButtons> buttons_param; | ||
| 59 | |||
| 60 | std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers; | ||
| 61 | |||
| 62 | std::unique_ptr<QTimer> timeout_timer; | ||
| 63 | std::unique_ptr<QTimer> poll_timer; | ||
| 64 | |||
| 65 | /// A flag to indicate if keyboard keys are okay when configuring an input. If this is false, | ||
| 66 | /// keyboard events are ignored. | ||
| 67 | bool want_keyboard_keys = false; | ||
| 68 | }; | 68 | }; |