Skip to content
Permalink
Browse files
Merge pull request #8638 from jordan-woyak/is-detectable-constify
InputCommon: Constify Device::Input::IsDetectable function.
  • Loading branch information
lioncash committed Feb 22, 2020
2 parents 2b6a1ee + da12f3e commit edad018
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
@@ -69,7 +69,7 @@ class KeyboardMouse : public Core::Device
{
}
std::string GetName() const override;
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
ControlState GetState() const override;

private:
@@ -70,7 +70,7 @@ class Device
public:
// Things like absolute axes/ absolute mouse position should override this to prevent
// undesirable behavior in our mapping logic.
virtual bool IsDetectable() { return true; }
virtual bool IsDetectable() const { return true; }

// Implementations should return a value from 0.0 to 1.0 across their normal range.
// One input should be provided for each "direction". (e.g. 2 for each axis)
@@ -87,14 +87,14 @@ class Device final : public Core::Device
{
public:
using AnalogInput::AnalogInput;
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
};

class MotionInput final : public AnalogInput<float>
{
public:
using AnalogInput::AnalogInput;
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
};

using AccelerometerInput = MotionInput;
@@ -121,7 +121,7 @@ class Device final : public Core::Device
}
}

bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }

private:
const BatteryState& m_battery;
@@ -36,7 +36,7 @@ class KeyboardAndMouse : public Core::Device
{
}
std::string GetName() const override;
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
ControlState GetState() const override;

private:
@@ -27,7 +27,7 @@ class Touchscreen : public Core::Device
{
public:
std::string GetName() const;
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
Axis(int pad_id, ButtonManager::ButtonType index, float neg = 1.0f)
: m_pad_id(pad_id), m_index(index), m_neg(neg)
{
@@ -48,7 +48,7 @@ class GenericInput : public Core::Device::Input
{
}

bool IsDetectable() override { return Detectable; }
bool IsDetectable() const override { return Detectable; }

std::string GetName() const override { return m_name; }

@@ -118,7 +118,7 @@ class Battery final : public Core::Device::Input
Battery(const ControlState* level) : m_level(*level) {}
std::string GetName() const override { return "Battery"; }
ControlState GetState() const override { return m_level; }
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }

private:
const ControlState& m_level;
@@ -63,7 +63,7 @@ class KeyboardMouse : public Core::Device
{
public:
std::string GetName() const override { return name; }
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
Cursor(u8 index, bool positive, const float* cursor);
ControlState GetState() const override;

@@ -78,7 +78,7 @@ class KeyboardMouse : public Core::Device
{
public:
std::string GetName() const override { return name; }
bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
Axis(u8 index, bool positive, const float* axis);
ControlState GetState() const override;

@@ -178,7 +178,7 @@ class MotionDataInput final : public AnalogInput
return std::string(motion_data_names[m_code]) + (m_range < 0 ? '-' : '+');
}

bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
};

class CursorInput final : public Axis
@@ -192,7 +192,7 @@ class CursorInput final : public Axis
return std::string("Cursor ") + char('X' + m_code) + (m_range < 0 ? '-' : '+');
}

bool IsDetectable() override { return false; }
bool IsDetectable() const override { return false; }
};

static std::thread s_hotplug_thread;

0 comments on commit edad018

Please sign in to comment.