]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/hub.h
Add decorations for things which should be exported from the library
[libs/gui.git] / source / input / hub.h
index 8d41bcee41393bc0314825db0c44b1fc2b65fc61..aadfcd7f5b0a87752b9e623d354f29bcf0403ec5 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef MSP_INPUT_INPUTHUB_H_
 #define MSP_INPUT_INPUTHUB_H_
 
-#include <map>
+#include <vector>
+#include <sigc++/trackable.h>
+#include <msp/graphics/mspgui_api.h>
 #include "device.h"
 
 namespace Msp {
@@ -11,10 +13,10 @@ namespace Input {
 The Hub device collects events from multiple input devices and presents an
 aggregate of them.  Button and axis numbers are mapped to unique values.
 */
-class Hub: public Device
+class MSPGUI_API Hub: public Device, public sigc::trackable
 {
 protected:
-       std::map<unsigned, Device *> devices;
+       std::vector<Device *> devices;
 
 public:
        Hub();
@@ -22,8 +24,11 @@ public:
        /// Attaches an input device to the hub.
        void attach(Device &dev);
 
-       virtual std::string get_button_name(unsigned) const;
-       virtual std::string get_axis_name(unsigned) const;
+       Device *find_subdevice(DeviceType, unsigned = 0) override;
+       Device *find_subdevice(const std::string &) override;
+
+       std::string get_button_name(unsigned) const override;
+       std::string get_axis_name(unsigned) const override;
 protected:
        void button_press(unsigned, unsigned);
        void button_release(unsigned, unsigned);