mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00
Reformat all the things. Have fun with merge conflicts.
This commit is contained in:
@ -17,26 +17,26 @@
|
||||
|
||||
// enable disable sources
|
||||
#ifdef _WIN32
|
||||
#define CIFACE_USE_XINPUT
|
||||
#define CIFACE_USE_DINPUT
|
||||
#define CIFACE_USE_XINPUT
|
||||
#define CIFACE_USE_DINPUT
|
||||
#endif
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#define CIFACE_USE_XLIB
|
||||
#if defined(HAVE_X11_XINPUT2) && HAVE_X11_XINPUT2
|
||||
#define CIFACE_USE_X11_XINPUT2
|
||||
#endif
|
||||
#define CIFACE_USE_XLIB
|
||||
#if defined(HAVE_X11_XINPUT2) && HAVE_X11_XINPUT2
|
||||
#define CIFACE_USE_X11_XINPUT2
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__APPLE__)
|
||||
#define CIFACE_USE_OSX
|
||||
#define CIFACE_USE_OSX
|
||||
#endif
|
||||
#if defined(HAVE_SDL) && HAVE_SDL
|
||||
#define CIFACE_USE_SDL
|
||||
#define CIFACE_USE_SDL
|
||||
#endif
|
||||
#if defined(HAVE_LIBEVDEV) && defined(HAVE_LIBUDEV)
|
||||
#define CIFACE_USE_EVDEV
|
||||
#define CIFACE_USE_EVDEV
|
||||
#endif
|
||||
#if defined(USE_PIPES)
|
||||
#define CIFACE_USE_PIPES
|
||||
#define CIFACE_USE_PIPES
|
||||
#endif
|
||||
|
||||
//
|
||||
@ -48,86 +48,87 @@
|
||||
class ControllerInterface : public ciface::Core::DeviceContainer
|
||||
{
|
||||
public:
|
||||
//
|
||||
// ControlReference
|
||||
//
|
||||
// These are what you create to actually use the inputs, InputReference or OutputReference.
|
||||
//
|
||||
// After being bound to devices and controls with ControllerInterface::UpdateReference,
|
||||
// each one can link to multiple devices and controls
|
||||
// when you change a ControlReference's expression,
|
||||
// you must use ControllerInterface::UpdateReference on it to rebind controls
|
||||
//
|
||||
class ControlReference
|
||||
{
|
||||
friend class ControllerInterface;
|
||||
|
||||
//
|
||||
// ControlReference
|
||||
//
|
||||
// These are what you create to actually use the inputs, InputReference or OutputReference.
|
||||
//
|
||||
// After being bound to devices and controls with ControllerInterface::UpdateReference,
|
||||
// each one can link to multiple devices and controls
|
||||
// when you change a ControlReference's expression,
|
||||
// you must use ControllerInterface::UpdateReference on it to rebind controls
|
||||
//
|
||||
class ControlReference
|
||||
{
|
||||
friend class ControllerInterface;
|
||||
public:
|
||||
virtual ControlState State(const ControlState state = 0) = 0;
|
||||
virtual ciface::Core::Device::Control* Detect(const unsigned int ms, ciface::Core::Device* const device) = 0;
|
||||
public:
|
||||
virtual ControlState State(const ControlState state = 0) = 0;
|
||||
virtual ciface::Core::Device::Control* Detect(const unsigned int ms,
|
||||
ciface::Core::Device* const device) = 0;
|
||||
|
||||
ControlState range;
|
||||
std::string expression;
|
||||
const bool is_input;
|
||||
ciface::ExpressionParser::ExpressionParseStatus parse_error;
|
||||
ControlState range;
|
||||
std::string expression;
|
||||
const bool is_input;
|
||||
ciface::ExpressionParser::ExpressionParseStatus parse_error;
|
||||
|
||||
virtual ~ControlReference()
|
||||
{
|
||||
delete parsed_expression;
|
||||
}
|
||||
virtual ~ControlReference() { delete parsed_expression; }
|
||||
int BoundCount()
|
||||
{
|
||||
if (parsed_expression)
|
||||
return parsed_expression->num_controls;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int BoundCount()
|
||||
{
|
||||
if (parsed_expression)
|
||||
return parsed_expression->num_controls;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
protected:
|
||||
ControlReference(const bool _is_input)
|
||||
: range(1), is_input(_is_input), parsed_expression(nullptr)
|
||||
{
|
||||
}
|
||||
ciface::ExpressionParser::Expression* parsed_expression;
|
||||
};
|
||||
|
||||
protected:
|
||||
ControlReference(const bool _is_input) : range(1), is_input(_is_input), parsed_expression(nullptr) {}
|
||||
ciface::ExpressionParser::Expression *parsed_expression;
|
||||
};
|
||||
//
|
||||
// InputReference
|
||||
//
|
||||
// Control reference for inputs
|
||||
//
|
||||
class InputReference : public ControlReference
|
||||
{
|
||||
public:
|
||||
InputReference() : ControlReference(true) {}
|
||||
ControlState State(const ControlState state) override;
|
||||
ciface::Core::Device::Control* Detect(const unsigned int ms,
|
||||
ciface::Core::Device* const device) override;
|
||||
};
|
||||
|
||||
//
|
||||
// InputReference
|
||||
//
|
||||
// Control reference for inputs
|
||||
//
|
||||
class InputReference : public ControlReference
|
||||
{
|
||||
public:
|
||||
InputReference() : ControlReference(true) {}
|
||||
ControlState State(const ControlState state) override;
|
||||
ciface::Core::Device::Control* Detect(const unsigned int ms, ciface::Core::Device* const device) override;
|
||||
};
|
||||
//
|
||||
// OutputReference
|
||||
//
|
||||
// Control reference for outputs
|
||||
//
|
||||
class OutputReference : public ControlReference
|
||||
{
|
||||
public:
|
||||
OutputReference() : ControlReference(false) {}
|
||||
ControlState State(const ControlState state) override;
|
||||
ciface::Core::Device::Control* Detect(const unsigned int ms,
|
||||
ciface::Core::Device* const device) override;
|
||||
};
|
||||
|
||||
//
|
||||
// OutputReference
|
||||
//
|
||||
// Control reference for outputs
|
||||
//
|
||||
class OutputReference : public ControlReference
|
||||
{
|
||||
public:
|
||||
OutputReference() : ControlReference(false) {}
|
||||
ControlState State(const ControlState state) override;
|
||||
ciface::Core::Device::Control* Detect(const unsigned int ms, ciface::Core::Device* const device) override;
|
||||
};
|
||||
|
||||
ControllerInterface() : m_is_init(false), m_hwnd(nullptr) {}
|
||||
|
||||
void Initialize(void* const hwnd);
|
||||
void Reinitialize();
|
||||
void Shutdown();
|
||||
bool IsInit() const { return m_is_init; }
|
||||
|
||||
void UpdateReference(ControlReference* control, const ciface::Core::DeviceQualifier& default_device) const;
|
||||
void UpdateInput();
|
||||
ControllerInterface() : m_is_init(false), m_hwnd(nullptr) {}
|
||||
void Initialize(void* const hwnd);
|
||||
void Reinitialize();
|
||||
void Shutdown();
|
||||
bool IsInit() const { return m_is_init; }
|
||||
void UpdateReference(ControlReference* control,
|
||||
const ciface::Core::DeviceQualifier& default_device) const;
|
||||
void UpdateInput();
|
||||
|
||||
private:
|
||||
bool m_is_init;
|
||||
void* m_hwnd;
|
||||
bool m_is_init;
|
||||
void* m_hwnd;
|
||||
};
|
||||
|
||||
extern ControllerInterface g_controller_interface;
|
||||
|
Reference in New Issue
Block a user