#include <vector>
#include <stdexcept>
#include <sigc++/signal.h>
+#include <msp/graphics/mspgui_api.h>
#include <msp/strings/lexicalcast.h>
namespace Msp {
namespace Input {
-class device_not_available: public std::runtime_error
+class MSPGUI_API device_not_available: public std::runtime_error
{
public:
device_not_available(const std::string &w): std::runtime_error(w) { }
- virtual ~device_not_available() throw() { }
};
Event handlers return a boolean indicating whether the event is considered
processed. If a handler returns true, no further handlers are invoked.
*/
-class Device
+class MSPGUI_API Device
{
protected:
struct EventAccumulator
sigc::signal<bool, unsigned, float, float>::accumulated<EventAccumulator> signal_axis_motion;
protected:
- DeviceType type;
+ DeviceType type = UNSPECIFIED;
std::string name;
std::vector<char> buttons;
std::vector<float> axes;
DeviceType get_type() const { return type; }
const std::string &get_name() const { return name; }
+ virtual Device *find_subdevice(DeviceType, unsigned = 0);
+ virtual Device *find_subdevice(const std::string &);
bool get_button_state(unsigned) const;
float get_axis_value(unsigned) const;
};
-void operator>>(const LexicalConverter &, DeviceType &);
-void operator<<(LexicalConverter &, DeviceType);
+MSPGUI_API void operator>>(const LexicalConverter &, DeviceType &);
+MSPGUI_API void operator<<(LexicalConverter &, DeviceType);
} // namespace Input
} // namespace Msp