From 798929231bc23a6b64b640bccaa951a078bdcb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 16 Sep 2023 12:37:53 +0200 Subject: [PATCH] EmscriptenApplication: put internal flags to the source file. Unnecessary inconsistency compared to all other app implementations. --- src/Magnum/Platform/EmscriptenApplication.cpp | 11 +++++++++++ src/Magnum/Platform/EmscriptenApplication.h | 12 ++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Magnum/Platform/EmscriptenApplication.cpp b/src/Magnum/Platform/EmscriptenApplication.cpp index eb4927c08..f95fba8ab 100644 --- a/src/Magnum/Platform/EmscriptenApplication.cpp +++ b/src/Magnum/Platform/EmscriptenApplication.cpp @@ -59,6 +59,13 @@ namespace Magnum { namespace Platform { using namespace Containers::Literals; +enum class EmscriptenApplication::Flag: UnsignedByte { + Redraw = 1 << 0, + TextInputActive = 1 << 1, + ExitRequested = 1 << 2, + LoopActive = 1 << 3 +}; + namespace { typedef EmscriptenApplication::KeyEvent::Key Key; @@ -675,6 +682,10 @@ EmscriptenApplication::Cursor EmscriptenApplication::cursor() { return _cursor; } +bool EmscriptenApplication::isTextInputActive() const { + return !!(_flags & Flag::TextInputActive); +} + void EmscriptenApplication::startTextInput() { _flags |= Flag::TextInputActive; } diff --git a/src/Magnum/Platform/EmscriptenApplication.h b/src/Magnum/Platform/EmscriptenApplication.h index b91044565..4e4ff5c47 100644 --- a/src/Magnum/Platform/EmscriptenApplication.h +++ b/src/Magnum/Platform/EmscriptenApplication.h @@ -840,9 +840,7 @@ class EmscriptenApplication { * closing on-screen keyboard. * @see @ref startTextInput(), @ref stopTextInput() */ - bool isTextInputActive() const { - return !!(_flags & Flag::TextInputActive); - } + bool isTextInputActive() const; /** * @brief Start text input @@ -888,14 +886,8 @@ class EmscriptenApplication { */ private: - enum class Flag: UnsignedByte { - Redraw = 1 << 0, - TextInputActive = 1 << 1, - ExitRequested = 1 << 2, - LoopActive = 1 << 3 - }; + enum class Flag: UnsignedByte; typedef Containers::EnumSet Flags; - CORRADE_ENUMSET_FRIEND_OPERATORS(Flags) void handleCanvasResize(const EmscriptenUiEvent* event);