]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/touchscreen.h
Use constexpr instead of enum to define "typeless" constants
[libs/gui.git] / source / input / touchscreen.h
index 363111cd3ea18e5936590c12bb3b20099103c96d..d366a28f9f2c33c05f04369eb0601af1d34159a8 100644 (file)
@@ -11,10 +11,7 @@ namespace Input {
 class Touchscreen: public Device, public sigc::trackable
 {
 private:
-       enum
-       {
-               UNUSED = static_cast<unsigned>(-1)
-       };
+       static constexpr unsigned UNUSED = static_cast<unsigned>(-1);
 
        Graphics::Window &window;
        std::vector<unsigned> active_points;
@@ -23,8 +20,12 @@ public:
        Touchscreen(Graphics::Window &);
        ~Touchscreen();
 
-       virtual std::string get_button_name(unsigned) const;
-       virtual std::string get_axis_name(unsigned) const;
+       static bool is_available();
+
+       Graphics::Window &get_window() const { return window; }
+
+       std::string get_button_name(unsigned) const override;
+       std::string get_axis_name(unsigned) const override;
 private:
        void input_event(const Graphics::Window::Event &);