#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "device/gamepad/gamepad_pad_state_provider.h"
#include <cmath>
#include <memory>
#include <optional>
#include "device/gamepad/gamepad_data_fetcher.h"
#include "device/gamepad/gamepad_provider.h"
#include "device/gamepad/public/cpp/gamepads.h"
namespace device {
namespace {
const float kMinAxisResetValue = …;
}
PadState::PadState() = default;
PadState::~PadState() = default;
GamepadPadStateProvider::GamepadPadStateProvider() { … }
GamepadPadStateProvider::~GamepadPadStateProvider() = default;
PadState* GamepadPadStateProvider::GetPadState(GamepadSource source,
int source_id,
bool new_gamepad_recognized) { … }
PadState* GamepadPadStateProvider::GetConnectedPadState(uint32_t pad_index) { … }
void GamepadPadStateProvider::ClearPadState(PadState& state) { … }
void GamepadPadStateProvider::InitializeDataFetcher(
GamepadDataFetcher* fetcher) { … }
void GamepadPadStateProvider::MapAndSanitizeGamepadData(PadState* pad_state,
Gamepad* pad,
bool sanitize) { … }
}