From fbc9277b12dd4e0eb32d4198ccfd437b92eba6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 7 Dec 2013 20:34:03 +0100 Subject: [PATCH] Platform: publicly document copy/move inability of Event classes. We need to create one instance, send it to subclasses and then check its state, thus we expect that the user always operatres with the original instance. --- src/Platform/AbstractXApplication.h | 18 ++++++++++++------ src/Platform/GlutApplication.h | 17 ++++++++++++----- src/Platform/NaClApplication.h | 17 ++++++++++++----- src/Platform/Sdl2Application.h | 17 ++++++++++++----- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/Platform/AbstractXApplication.h b/src/Platform/AbstractXApplication.h index 549a01738..9d0bb7f29 100644 --- a/src/Platform/AbstractXApplication.h +++ b/src/Platform/AbstractXApplication.h @@ -238,12 +238,6 @@ class AbstractXApplication::Configuration { @ref mouseMoveEvent() */ class AbstractXApplication::InputEvent { - InputEvent(const InputEvent&) = delete; - InputEvent(InputEvent&&) = delete; - InputEvent& operator=(const InputEvent&) = delete; - InputEvent& operator=(InputEvent&&) = delete; - - public: public: /** * @brief %Modifier @@ -311,6 +305,18 @@ class AbstractXApplication::InputEvent { */ typedef Containers::EnumSet Buttons; + /** @brief Copying is not allowed */ + InputEvent(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent(InputEvent&&) = delete; + + /** @brief Copying is not allowed */ + InputEvent& operator=(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent& operator=(InputEvent&&) = delete; + /** @copydoc Sdl2Application::InputEvent::setAccepted() */ void setAccepted(bool accepted = true) { _accepted = accepted; } diff --git a/src/Platform/GlutApplication.h b/src/Platform/GlutApplication.h index f292cceee..97452a23b 100644 --- a/src/Platform/GlutApplication.h +++ b/src/Platform/GlutApplication.h @@ -309,12 +309,19 @@ class GlutApplication::Configuration { @ref mousePressEvent(), @ref mouseReleaseEvent(), @ref mouseMoveEvent() */ class GlutApplication::InputEvent { - InputEvent(const InputEvent&) = delete; - InputEvent(InputEvent&&) = delete; - InputEvent& operator=(const InputEvent&) = delete; - InputEvent& operator=(InputEvent&&) = delete; - public: + /** @brief Copying is not allowed */ + InputEvent(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent(InputEvent&&) = delete; + + /** @brief Copying is not allowed */ + InputEvent& operator=(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent& operator=(InputEvent&&) = delete; + /** @copydoc Sdl2Application::InputEvent::setAccepted() */ void setAccepted(bool accepted = true) { _accepted = accepted; } diff --git a/src/Platform/NaClApplication.h b/src/Platform/NaClApplication.h index 28dbd438c..2e48bfc2e 100644 --- a/src/Platform/NaClApplication.h +++ b/src/Platform/NaClApplication.h @@ -377,11 +377,6 @@ propagated to the browser. @ref mouseMoveEvent() */ class NaClApplication::InputEvent { - InputEvent(const InputEvent&) = delete; - InputEvent(InputEvent&&) = delete; - InputEvent& operator=(const InputEvent&) = delete; - InputEvent& operator=(InputEvent&&) = delete; - public: /** * @brief %Modifier @@ -450,6 +445,18 @@ class NaClApplication::InputEvent { */ typedef Containers::EnumSet Buttons; + /** @brief Copying is not allowed */ + InputEvent(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent(InputEvent&&) = delete; + + /** @brief Copying is not allowed */ + InputEvent& operator=(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent& operator=(InputEvent&&) = delete; + /** @brief Modifiers */ constexpr Modifiers modifiers() const { return _modifiers; } diff --git a/src/Platform/Sdl2Application.h b/src/Platform/Sdl2Application.h index 8458fec55..d13a98dc4 100644 --- a/src/Platform/Sdl2Application.h +++ b/src/Platform/Sdl2Application.h @@ -454,11 +454,6 @@ CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::Flags) @ref mouseMoveEvent() */ class Sdl2Application::InputEvent { - InputEvent(const InputEvent&) = delete; - InputEvent(InputEvent&&) = delete; - InputEvent& operator=(const InputEvent&) = delete; - InputEvent& operator=(InputEvent&&) = delete; - public: /** * @brief %Modifier @@ -484,6 +479,18 @@ class Sdl2Application::InputEvent { */ typedef Containers::EnumSet Modifiers; + /** @brief Copying is not allowed */ + InputEvent(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent(InputEvent&&) = delete; + + /** @brief Copying is not allowed */ + InputEvent& operator=(const InputEvent&) = delete; + + /** @brief Moving is not allowed */ + InputEvent& operator=(InputEvent&&) = delete; + /** * @brief Set event as accepted *