From 93d2789f700a8b26b47661933029d95a238aacac Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Tue, 13 May 2014 16:18:14 +0200 Subject: [PATCH] Window focus: Added empty implementations for Android and iOS --- src/SFML/Window/Android/WindowImplAndroid.cpp | 15 +++++++++++++++ src/SFML/Window/Android/WindowImplAndroid.hpp | 15 +++++++++++++++ src/SFML/Window/iOS/WindowImplUIKit.hpp | 15 +++++++++++++++ src/SFML/Window/iOS/WindowImplUIKit.mm | 15 +++++++++++++++ 4 files changed, 60 insertions(+) diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 1b1a1a4ba..22cf60cab 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -181,6 +181,21 @@ void WindowImplAndroid::setKeyRepeatEnabled(bool enabled) } +//////////////////////////////////////////////////////////// +void WindowImplAndroid::requestFocus() +{ + // Not applicable +} + + +//////////////////////////////////////////////////////////// +bool WindowImplAndroid::hasFocus() const +{ + // Not applicable + return false; +} + + //////////////////////////////////////////////////////////// void WindowImplAndroid::forwardEvent(const Event& event) { diff --git a/src/SFML/Window/Android/WindowImplAndroid.hpp b/src/SFML/Window/Android/WindowImplAndroid.hpp index 7786248be..f5106e3ae 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.hpp +++ b/src/SFML/Window/Android/WindowImplAndroid.hpp @@ -154,6 +154,21 @@ public: //////////////////////////////////////////////////////////// virtual void setKeyRepeatEnabled(bool enabled); + //////////////////////////////////////////////////////////// + /// \brief Request the current window to be made the active + /// foreground window + /// + //////////////////////////////////////////////////////////// + virtual void requestFocus(); + + //////////////////////////////////////////////////////////// + /// \brief Check whether the window has the input focus + /// + /// \return True if window has focus, false otherwise + /// + //////////////////////////////////////////////////////////// + virtual bool hasFocus() const; + static void forwardEvent(const Event& event); static WindowImplAndroid* singleInstance; diff --git a/src/SFML/Window/iOS/WindowImplUIKit.hpp b/src/SFML/Window/iOS/WindowImplUIKit.hpp index 9f56fe906..61d082886 100644 --- a/src/SFML/Window/iOS/WindowImplUIKit.hpp +++ b/src/SFML/Window/iOS/WindowImplUIKit.hpp @@ -157,6 +157,21 @@ public: //////////////////////////////////////////////////////////// virtual void setKeyRepeatEnabled(bool enabled); + //////////////////////////////////////////////////////////// + /// \brief Request the current window to be made the active + /// foreground window + /// + //////////////////////////////////////////////////////////// + virtual void requestFocus(); + + //////////////////////////////////////////////////////////// + /// \brief Check whether the window has the input focus + /// + /// \return True if window has focus, false otherwise + /// + //////////////////////////////////////////////////////////// + virtual bool hasFocus() const; + public: using WindowImpl::pushEvent; diff --git a/src/SFML/Window/iOS/WindowImplUIKit.mm b/src/SFML/Window/iOS/WindowImplUIKit.mm index 12b91aa41..7ccf7b318 100644 --- a/src/SFML/Window/iOS/WindowImplUIKit.mm +++ b/src/SFML/Window/iOS/WindowImplUIKit.mm @@ -169,6 +169,21 @@ void WindowImplUIKit::setKeyRepeatEnabled(bool enabled) // Not applicable } + +//////////////////////////////////////////////////////////// +void WindowImplUIKit::requestFocus() +{ + // Not applicable +} + + +//////////////////////////////////////////////////////////// +bool WindowImplUIKit::hasFocus() const +{ + // Not applicable + return false; +} + //////////////////////////////////////////////////////////// SFView* WindowImplUIKit::getGlView() const