1 // Copyright 2018 Citra 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 <memory>
8 #include <vector>
9 #include "core/frontend/input.h"
10 #include "input_common/main.h"
11 
12 union SDL_Event;
13 
14 namespace Common {
15 class ParamPackage;
16 } // namespace Common
17 
18 namespace InputCommon::Polling {
19 class DevicePoller;
20 enum class DeviceType;
21 } // namespace InputCommon::Polling
22 
23 namespace InputCommon::SDL {
24 
25 class State {
26 public:
27     using Pollers = std::vector<std::unique_ptr<Polling::DevicePoller>>;
28 
29     /// Unregisters SDL device factories and shut them down.
30     virtual ~State() = default;
31 
32     virtual Pollers GetPollers(Polling::DeviceType type) = 0;
33 };
34 
35 class NullState : public State {
36 public:
GetPollers(Polling::DeviceType type)37     Pollers GetPollers(Polling::DeviceType type) override {
38         return {};
39     }
40 };
41 
42 std::unique_ptr<State> Init();
43 
44 } // namespace InputCommon::SDL
45