2018-09-20 06:28:05 +00:00
|
|
|
// Copyright 2018 Citra Emulator Project
|
2017-01-21 15:33:48 +00:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-12-06 04:26:29 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
2018-09-20 06:28:05 +00:00
|
|
|
#include "input_common/main.h"
|
2017-01-21 15:33:48 +00:00
|
|
|
|
2018-09-20 06:28:05 +00:00
|
|
|
namespace InputCommon::Polling {
|
2017-12-06 04:26:29 +00:00
|
|
|
class DevicePoller;
|
|
|
|
enum class DeviceType;
|
2018-09-20 06:28:05 +00:00
|
|
|
} // namespace InputCommon::Polling
|
2018-09-11 01:29:59 +00:00
|
|
|
|
2018-09-20 06:28:05 +00:00
|
|
|
namespace InputCommon::SDL {
|
2018-09-11 01:29:59 +00:00
|
|
|
|
2018-09-20 06:28:05 +00:00
|
|
|
class State {
|
|
|
|
public:
|
2019-03-18 15:26:13 +00:00
|
|
|
using Pollers = std::vector<std::unique_ptr<Polling::DevicePoller>>;
|
|
|
|
|
|
|
|
/// Unregisters SDL device factories and shut them down.
|
2018-09-20 06:28:05 +00:00
|
|
|
virtual ~State() = default;
|
2018-09-11 01:29:59 +00:00
|
|
|
|
2019-03-18 15:26:13 +00:00
|
|
|
virtual Pollers GetPollers(Polling::DeviceType type) = 0;
|
2018-09-20 06:28:05 +00:00
|
|
|
};
|
2017-12-06 04:26:29 +00:00
|
|
|
|
2018-09-20 06:28:05 +00:00
|
|
|
class NullState : public State {
|
|
|
|
public:
|
2019-03-18 15:32:49 +00:00
|
|
|
Pollers GetPollers(Polling::DeviceType type) override {
|
|
|
|
return {};
|
|
|
|
}
|
2018-09-20 06:28:05 +00:00
|
|
|
};
|
2017-12-06 04:26:29 +00:00
|
|
|
|
2018-09-20 06:28:05 +00:00
|
|
|
std::unique_ptr<State> Init();
|
2017-12-06 04:26:29 +00:00
|
|
|
|
2018-09-20 06:28:05 +00:00
|
|
|
} // namespace InputCommon::SDL
|