Added Unicode window title support.

- Changed SFML API to receive an sf::String as the window title instead
  of a std::string (in Window::Window and Window::setTitle).
- Changed RenderWindow and WindowImpl APIs accordingly.
- Changed WindowImplWin32 to use a Unicode window title only if the
  target OS supports it.
- Changed WindowImplCocoa to always use Unicode window titles and added
  a utility function to Window/OSX/cpp_objc_conversion.mm.
- Changed WindowImplX11 to set the Unicode window title as part of the
  _NET_WM_NAME specification, which sadly is not part of the official X
  standard, but the closest anything can get. Still set regular ASCII
  title as fallback.
This commit is contained in:
Shiz 2013-02-11 19:21:51 +01:00
parent 9cf259c365
commit 6bc077688e
14 changed files with 71 additions and 38 deletions

View file

@ -73,7 +73,7 @@ public :
/// \param settings Additional settings for the underlying OpenGL context
///
////////////////////////////////////////////////////////////
RenderWindow(VideoMode mode, const std::string& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings());
RenderWindow(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings());
////////////////////////////////////////////////////////////
/// \brief Construct the window from an existing control

View file

@ -37,7 +37,7 @@
#include <SFML/System/Clock.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/System/NonCopyable.hpp>
#include <string>
#include <SFML/System/String.hpp>
namespace sf
@ -86,7 +86,7 @@ public :
/// \param settings Additional settings for the underlying OpenGL context
///
////////////////////////////////////////////////////////////
Window(VideoMode mode, const std::string& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings());
Window(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings());
////////////////////////////////////////////////////////////
/// \brief Construct the window from an existing control
@ -125,7 +125,7 @@ public :
/// \param settings Additional settings for the underlying OpenGL context
///
////////////////////////////////////////////////////////////
void create(VideoMode mode, const std::string& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings());
void create(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings());
////////////////////////////////////////////////////////////
/// \brief Create (or recreate) the window from an existing control
@ -284,7 +284,7 @@ public :
/// \see setIcon
///
////////////////////////////////////////////////////////////
void setTitle(const std::string& title);
void setTitle(const String& title);
////////////////////////////////////////////////////////////
/// \brief Change the window's icon