]> git.tdb.fi Git - libs/gui.git/commitdiff
Inherit input devices using Window::signal_input_event from sigc::trackable
authorMikko Rasa <tdb@tdb.fi>
Thu, 13 Nov 2014 20:41:09 +0000 (22:41 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 13 Nov 2014 20:42:03 +0000 (22:42 +0200)
source/input/hub.h
source/input/keyboard.h
source/input/mouse.h

index 8d41bcee41393bc0314825db0c44b1fc2b65fc61..31eeb94bf5dfb220c793d73d6cff533b345204e5 100644 (file)
@@ -2,6 +2,7 @@
 #define MSP_INPUT_INPUTHUB_H_
 
 #include <map>
+#include <sigc++/trackable.h>
 #include "device.h"
 
 namespace Msp {
@@ -11,7 +12,7 @@ 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 Hub: public Device, public sigc::trackable
 {
 protected:
        std::map<unsigned, Device *> devices;
index 8cd83f221c3cba317588ec35c4bf216cdb732cf9..15fe4f95cd814f7ef6c7034659c265f29ede18d9 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_INPUT_KEYBOARD_H_
 #define MSP_INPUT_KEYBOARD_H_
 
+#include <sigc++/trackable.h>
 #include <msp/graphics/window.h>
 #include <msp/stringcodec/ustring.h>
 #include "device.h"
@@ -12,7 +13,7 @@ namespace Input {
 Adapts key events from a window to the abstracted input framework.  Key codes
 are translated to platform-independent values.  See keys.h for a list.
 */
-class Keyboard: public Device
+class Keyboard: public Device, public sigc::trackable
 {
 public:
        sigc::signal<bool, StringCodec::unichar>::accumulated<EventAccumulator> signal_character;
index c85d8d2b22fb2be4eea1beb0fb9f945d619dbb47..622a783b9960efd31ff201641bd49ae2277eb681 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_INPUT_MOUSE_H_
 #define MSP_INPUT_MOUSE_H_
 
+#include <sigc++/trackable.h>
 #include <msp/graphics/window.h>
 #include "device.h"
 
@@ -13,7 +14,7 @@ uniform way.
 
 Note: Y axis grows upwards.
 */
-class Mouse: public Device
+class Mouse: public Device, public sigc::trackable
 {
 private:
        Graphics::Window &window;