2018-09-20 08:28:05 +02:00
|
|
|
// Copyright 2018 Citra Emulator Project
|
2017-01-21 16:33:48 +01:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-12-06 05:26:29 +01:00
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
2017-01-21 16:33:48 +01:00
|
|
|
#include "core/frontend/input.h"
|
2018-09-20 08:28:05 +02:00
|
|
|
#include "input_common/main.h"
|
2017-01-21 16:33:48 +01:00
|
|
|
|
2017-12-06 05:26:29 +01:00
|
|
|
union SDL_Event;
|
2018-09-20 08:28:05 +02:00
|
|
|
|
2017-12-06 05:26:29 +01:00
|
|
|
namespace Common {
|
|
|
|
class ParamPackage;
|
2018-09-20 08:28:05 +02:00
|
|
|
} // namespace Common
|
|
|
|
|
|
|
|
namespace InputCommon::Polling {
|
2017-12-06 05:26:29 +01:00
|
|
|
class DevicePoller;
|
|
|
|
enum class DeviceType;
|
2018-09-20 08:28:05 +02:00
|
|
|
} // namespace InputCommon::Polling
|
2018-09-11 03:29:59 +02:00
|
|
|
|
2018-09-20 08:28:05 +02:00
|
|
|
namespace InputCommon::SDL {
|
2018-09-11 03:29:59 +02:00
|
|
|
|
2018-09-20 08:28:05 +02:00
|
|
|
class State {
|
|
|
|
public:
|
|
|
|
/// Unresisters SDL device factories and shut them down.
|
|
|
|
virtual ~State() = default;
|
2018-09-11 03:29:59 +02:00
|
|
|
|
2018-09-20 08:28:05 +02:00
|
|
|
virtual std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(
|
|
|
|
InputCommon::Polling::DeviceType type) = 0;
|
|
|
|
};
|
2017-12-06 05:26:29 +01:00
|
|
|
|
2018-09-20 08:28:05 +02:00
|
|
|
class NullState : public State {
|
|
|
|
public:
|
|
|
|
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> GetPollers(
|
|
|
|
InputCommon::Polling::DeviceType type) override {}
|
|
|
|
};
|
2017-12-06 05:26:29 +01:00
|
|
|
|
2018-09-20 08:28:05 +02:00
|
|
|
std::unique_ptr<State> Init();
|
2017-12-06 05:26:29 +01:00
|
|
|
|
2018-09-20 08:28:05 +02:00
|
|
|
} // namespace InputCommon::SDL
|