00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024
00025 #ifndef SFML_WINDOWIMPL_HPP
00026 #define SFML_WINDOWIMPL_HPP
00027
00029
00031 #include <SFML/Config.hpp>
00032 #include <SFML/System/NonCopyable.hpp>
00033 #include <SFML/Window/VideoMode.hpp>
00034 #include <SFML/Window/WindowHandle.hpp>
00035 #include <set>
00036 #include <string>
00037
00038
00039 namespace sf
00040 {
00041 class Event;
00042 class WindowListener;
00043
00044 namespace priv
00045 {
00049 class WindowImpl : NonCopyable
00050 {
00051 public :
00052
00057 enum Style
00058 {
00059 Resizable,
00060 Fixed,
00061 Fullscreen
00062 };
00063
00070 static WindowImpl* New();
00071
00083 static WindowImpl* New(VideoMode Mode, const std::string& Title, unsigned long WindowStyle, int AntialiasingLevel);
00084
00094 static WindowImpl* New(WindowHandle Handle, int AntialiasingLevel = 0);
00095
00096 public :
00097
00102 virtual ~WindowImpl();
00103
00110 void AddListener(WindowListener* Listener);
00111
00118 void RemoveListener(WindowListener* Listener);
00119
00126 unsigned int GetWidth() const;
00127
00134 unsigned int GetHeight() const;
00135
00142 unsigned int GetDepthBits() const;
00143
00150 unsigned int GetStencilBits() const;
00151
00156 void SetCurrent() const;
00157
00162 virtual void Display() = 0;
00163
00168 virtual void ProcessEvents() = 0;
00169
00176 virtual void UseVerticalSync(bool Enabled) = 0;
00177
00184 virtual void ShowMouseCursor(bool Show) = 0;
00185
00193 virtual void SetPosition(int Left, int Top) = 0;
00194
00195 protected :
00196
00201 WindowImpl();
00202
00209 void SendEvent(const Event& EventToSend);
00210
00212
00214 unsigned int myWidth;
00215 unsigned int myHeight;
00216 unsigned int myDepthBits;
00217 unsigned int myStencilBits;
00218
00219 private :
00220
00225 virtual void MakeCurrent() const = 0;
00226
00228
00230 static const WindowImpl* ourCurrent;
00231
00233
00235 std::set<WindowListener*> myListeners;
00236 };
00237
00238 }
00239
00240 }
00241
00242
00243 #endif // SFML_WINDOWIMPL_HPP