X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fhub.h;h=aadfcd7f5b0a87752b9e623d354f29bcf0403ec5;hb=b99a9eb342d0f6ba5509c6d9f8ab0b0b5d5d2979;hp=4385f27742e83588e59cf686b88a5dd653d33bdc;hpb=999ca92aa9ee10585c0b2094d84364159253982f;p=libs%2Fgui.git diff --git a/source/input/hub.h b/source/input/hub.h index 4385f27..aadfcd7 100644 --- a/source/input/hub.h +++ b/source/input/hub.h @@ -1,13 +1,9 @@ -/* $Id$ - -This file is part of libmspgbase -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#ifndef MSP_GBASE_INPUTHUB_H_ -#define MSP_GBASE_INPUTHUB_H_ +#ifndef MSP_INPUT_INPUTHUB_H_ +#define MSP_INPUT_INPUTHUB_H_ +#include +#include +#include #include "device.h" namespace Msp { @@ -17,7 +13,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 MSPGUI_API Hub: public Device, public sigc::trackable { protected: std::vector devices; @@ -25,16 +21,14 @@ protected: public: Hub(); - /** - Attaches an input device to the hub. - - @param dev Device to attach + /// Attaches an input device to the hub. + void attach(Device &dev); - @return Index of the device within the hub - */ - unsigned attach(Device &dev); + Device *find_subdevice(DeviceType, unsigned = 0) override; + Device *find_subdevice(const std::string &) override; - virtual std::string get_button_name(unsigned) const; + 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);