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;
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;
}

12
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<Flag> Flags;
CORRADE_ENUMSET_FRIEND_OPERATORS(Flags)
void handleCanvasResize(const EmscriptenUiEvent* event);

Loading…
Cancel
Save