]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/linux/gamecontroller_platform.h
Use nullptr in place of 0 or NULL
[libs/gui.git] / source / input / linux / gamecontroller_platform.h
index 61bcdb5d67e90eda4e6d1bfe4bb2c7a9040ea815..224450e0cccf6aec8421770c7eb41f1329a737f8 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef GAMECONTROLLER_PRIVATE_H_
-#define GAMECONTROLLER_PRIVATE_H_
+#ifndef MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
+#define MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
 
 #include <msp/io/eventobject.h>
 #include <msp/io/handle.h>
@@ -14,21 +14,28 @@ private:
 
 public:
        JsDevice(const std::string &);
+       ~JsDevice();
 
        std::string get_name() const;
 
+       void set_block(bool) override { }
+       void set_inherit(bool) override { }
+
 protected:
-       virtual unsigned do_read(char *, unsigned);
-       virtual unsigned do_write(const char *, unsigned);
+       std::size_t do_read(char *, std::size_t) override;
+       std::size_t do_write(const char *, std::size_t) override;
 
 public:
-       virtual const IO::Handle &get_event_handle() { return handle; }
+       const IO::Handle &get_handle(IO::Mode) override { return handle; }
+       const IO::Handle &get_event_handle() override { return handle; }
 };
 
 
 struct GameController::Private
 {
-       JsDevice *dev;
+       JsDevice *dev = nullptr;
+
+       static std::vector<std::string> detected_controllers;
 };
 
 } // namespace Input