diff options
Diffstat (limited to 'src/core/frontend/applets/controller.h')
| -rw-r--r-- | src/core/frontend/applets/controller.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/core/frontend/applets/controller.h b/src/core/frontend/applets/controller.h new file mode 100644 index 000000000..0908f2b69 --- /dev/null +++ b/src/core/frontend/applets/controller.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <functional> | ||
| 8 | |||
| 9 | #include "common/common_types.h" | ||
| 10 | |||
| 11 | namespace Core::Frontend { | ||
| 12 | |||
| 13 | using BorderColor = std::array<u8, 4>; | ||
| 14 | |||
| 15 | struct ControllerParameters { | ||
| 16 | s8 min_players{}; | ||
| 17 | s8 max_players{}; | ||
| 18 | bool keep_controllers_connected{}; | ||
| 19 | bool enable_single_mode{}; | ||
| 20 | bool enable_border_color{}; | ||
| 21 | std::vector<BorderColor> border_colors{}; | ||
| 22 | bool allow_pro_controller{}; | ||
| 23 | bool allow_handheld{}; | ||
| 24 | bool allow_dual_joycons{}; | ||
| 25 | bool allow_left_joycon{}; | ||
| 26 | bool allow_right_joycon{}; | ||
| 27 | }; | ||
| 28 | |||
| 29 | class ControllerApplet { | ||
| 30 | public: | ||
| 31 | virtual ~ControllerApplet(); | ||
| 32 | |||
| 33 | virtual void ReconfigureControllers(std::function<void()> callback, | ||
| 34 | ControllerParameters parameters) const = 0; | ||
| 35 | }; | ||
| 36 | |||
| 37 | class DefaultControllerApplet final : public ControllerApplet { | ||
| 38 | public: | ||
| 39 | ~DefaultControllerApplet() override; | ||
| 40 | |||
| 41 | void ReconfigureControllers(std::function<void()> callback, | ||
| 42 | ControllerParameters parameters) const override; | ||
| 43 | }; | ||
| 44 | |||
| 45 | } // namespace Core::Frontend | ||