]> git.tdb.fi Git - libs/gui.git/blob - source/input/linux/gamecontroller_platform.h
Close the game controller device when deleting the object
[libs/gui.git] / source / input / linux / gamecontroller_platform.h
1 #ifndef GAMECONTROLLER_PRIVATE_H_
2 #define GAMECONTROLLER_PRIVATE_H_
3
4 #include <msp/io/eventobject.h>
5 #include <msp/io/handle.h>
6
7 namespace Msp {
8 namespace Input {
9
10 class JsDevice: public IO::EventObject
11 {
12 private:
13         IO::Handle handle;
14
15 public:
16         JsDevice(const std::string &);
17         ~JsDevice();
18
19         std::string get_name() const;
20
21 protected:
22         virtual unsigned do_read(char *, unsigned);
23         virtual unsigned do_write(const char *, unsigned);
24
25 public:
26         virtual const IO::Handle &get_event_handle() { return handle; }
27 };
28
29
30 struct GameController::Private
31 {
32         JsDevice *dev;
33 };
34
35 } // namespace Input
36 } // namespace Msp
37
38 #endif