Browse Source

EmscriptenApplication: put internal flags to the source file.

Unnecessary inconsistency compared to all other app implementations.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
798929231b
  1. 11
      src/Magnum/Platform/EmscriptenApplication.cpp
  2. 12
      src/Magnum/Platform/EmscriptenApplication.h

11
src/Magnum/Platform/EmscriptenApplication.cpp

@ -59,6 +59,13 @@ namespace Magnum { namespace Platform {
using namespace Containers::Literals; using namespace Containers::Literals;
enum class EmscriptenApplication::Flag: UnsignedByte {
Redraw = 1 << 0,
TextInputActive = 1 << 1,
ExitRequested = 1 << 2,
LoopActive = 1 << 3
};
namespace { namespace {
typedef EmscriptenApplication::KeyEvent::Key Key; typedef EmscriptenApplication::KeyEvent::Key Key;
@ -675,6 +682,10 @@ EmscriptenApplication::Cursor EmscriptenApplication::cursor() {
return _cursor; return _cursor;
} }
bool EmscriptenApplication::isTextInputActive() const {
return !!(_flags & Flag::TextInputActive);
}
void EmscriptenApplication::startTextInput() { void EmscriptenApplication::startTextInput() {
_flags |= Flag::TextInputActive; _flags |= Flag::TextInputActive;
} }

12
src/Magnum/Platform/EmscriptenApplication.h

@ -840,9 +840,7 @@ class EmscriptenApplication {
* closing on-screen keyboard. * closing on-screen keyboard.
* @see @ref startTextInput(), @ref stopTextInput() * @see @ref startTextInput(), @ref stopTextInput()
*/ */
bool isTextInputActive() const { bool isTextInputActive() const;
return !!(_flags & Flag::TextInputActive);
}
/** /**
* @brief Start text input * @brief Start text input
@ -888,14 +886,8 @@ class EmscriptenApplication {
*/ */
private: private:
enum class Flag: UnsignedByte { enum class Flag: UnsignedByte;
Redraw = 1 << 0,
TextInputActive = 1 << 1,
ExitRequested = 1 << 2,
LoopActive = 1 << 3
};
typedef Containers::EnumSet<Flag> Flags; typedef Containers::EnumSet<Flag> Flags;
CORRADE_ENUMSET_FRIEND_OPERATORS(Flags) CORRADE_ENUMSET_FRIEND_OPERATORS(Flags)
void handleCanvasResize(const EmscriptenUiEvent* event); void handleCanvasResize(const EmscriptenUiEvent* event);

Loading…
Cancel
Save