Browse Source

Platform: SDL2 text editing *is* available in Emscripten.

pull/157/head
Vladimír Vondruš 10 years ago
parent
commit
a22f955582
  1. 3
      src/Magnum/Platform/Sdl2Application.cpp
  2. 11
      src/Magnum/Platform/Sdl2Application.h

3
src/Magnum/Platform/Sdl2Application.cpp

@ -476,11 +476,8 @@ void Sdl2Application::keyReleaseEvent(KeyEvent&) {}
void Sdl2Application::mousePressEvent(MouseEvent&) {} void Sdl2Application::mousePressEvent(MouseEvent&) {}
void Sdl2Application::mouseReleaseEvent(MouseEvent&) {} void Sdl2Application::mouseReleaseEvent(MouseEvent&) {}
void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {} void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {}
#ifndef CORRADE_TARGET_EMSCRIPTEN
void Sdl2Application::textInputEvent(TextInputEvent&) {} void Sdl2Application::textInputEvent(TextInputEvent&) {}
void Sdl2Application::textEditingEvent(TextEditingEvent&) {} void Sdl2Application::textEditingEvent(TextEditingEvent&) {}
#endif
Sdl2Application::Configuration::Configuration(): Sdl2Application::Configuration::Configuration():
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS)

11
src/Magnum/Platform/Sdl2Application.h

@ -331,10 +331,8 @@ class Sdl2Application {
class KeyEvent; class KeyEvent;
class MouseEvent; class MouseEvent;
class MouseMoveEvent; class MouseMoveEvent;
#ifndef CORRADE_TARGET_EMSCRIPTEN
class TextInputEvent; class TextInputEvent;
class TextEditingEvent; class TextEditingEvent;
#endif
/** /**
* @brief Default constructor * @brief Default constructor
@ -585,7 +583,6 @@ class Sdl2Application {
/*@}*/ /*@}*/
#ifndef CORRADE_TARGET_EMSCRIPTEN
/** @{ @name Text input handling */ /** @{ @name Text input handling */
public: public:
/** /**
@ -593,7 +590,6 @@ class Sdl2Application {
* *
* If text input is active, text input events go to @ref textInputEvent() * If text input is active, text input events go to @ref textInputEvent()
* and @ref textEditingEvent(). * and @ref textEditingEvent().
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @see @ref startTextInput(), @ref stopTextInput() * @see @ref startTextInput(), @ref stopTextInput()
*/ */
bool isTextInputActive() { return SDL_IsTextInputActive(); } bool isTextInputActive() { return SDL_IsTextInputActive(); }
@ -603,7 +599,6 @@ class Sdl2Application {
* *
* Starts text input that will go to @ref textInputEvent() and * Starts text input that will go to @ref textInputEvent() and
* @ref textEditingEvent(). * @ref textEditingEvent().
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @see @ref stopTextInput(), @ref isTextInputActive(), * @see @ref stopTextInput(), @ref isTextInputActive(),
* @ref setTextInputRect() * @ref setTextInputRect()
*/ */
@ -612,7 +607,6 @@ class Sdl2Application {
/** /**
* @brief Stop text input * @brief Stop text input
* *
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @see @ref startTextInput(), @ref isTextInputActive(), @ref textInputEvent() * @see @ref startTextInput(), @ref isTextInputActive(), @ref textInputEvent()
* @ref textEditingEvent() * @ref textEditingEvent()
*/ */
@ -647,7 +641,6 @@ class Sdl2Application {
virtual void textEditingEvent(TextEditingEvent& event); virtual void textEditingEvent(TextEditingEvent& event);
/*@}*/ /*@}*/
#endif
private: private:
enum class Flag: UnsignedByte { enum class Flag: UnsignedByte {
@ -1217,11 +1210,9 @@ class Sdl2Application::MouseMoveEvent: public Sdl2Application::InputEvent {
Modifiers _modifiers; Modifiers _modifiers;
}; };
#ifndef CORRADE_TARGET_EMSCRIPTEN
/** /**
@brief Text input event @brief Text input event
@note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
@see @ref TextEditingEvent, @ref textInputEvent() @see @ref TextEditingEvent, @ref textInputEvent()
*/ */
class Sdl2Application::TextInputEvent { class Sdl2Application::TextInputEvent {
@ -1266,7 +1257,6 @@ class Sdl2Application::TextInputEvent {
/** /**
@brief Text editing event @brief Text editing event
@note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
@see @ref textEditingEvent() @see @ref textEditingEvent()
*/ */
class Sdl2Application::TextEditingEvent { class Sdl2Application::TextEditingEvent {
@ -1314,7 +1304,6 @@ class Sdl2Application::TextEditingEvent {
Int _start, _length; Int _start, _length;
bool _accepted; bool _accepted;
}; };
#endif
/** @hideinitializer /** @hideinitializer
@brief Entry point for SDL2-based applications @brief Entry point for SDL2-based applications

Loading…
Cancel
Save