SFML logo
  • Main Page
  • Namespaces
  • Classes
  • Files
  • File List

WindowImplWin32.hpp

00001 
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024 
00025 #ifndef SFML_WINDOWIMPLWIN32_HPP
00026 #define SFML_WINDOWIMPLWIN32_HPP
00027 
00029 // Headers
00031 #include <SFML/Window/Event.hpp>
00032 #include <SFML/Window/WindowImpl.hpp>
00033 #include <windows.h>
00034 #include <string>
00035 
00036 
00037 namespace sf
00038 {
00039 namespace priv
00040 {
00045 class WindowImplWin32 : public WindowImpl
00046 {
00047 public :
00048 
00055     WindowImplWin32(WindowHandle handle);
00056 
00065     WindowImplWin32(VideoMode mode, const std::string& title, unsigned long style);
00066 
00071     ~WindowImplWin32();
00072 
00073 private :
00074 
00081     virtual WindowHandle GetHandle() const;
00082 
00089     virtual void ProcessEvents(bool block);
00090 
00097     virtual void ShowMouseCursor(bool show);
00098 
00106     virtual void SetCursorPosition(unsigned int left, unsigned int top);
00107 
00115     virtual void SetPosition(int left, int top);
00116 
00124     virtual void SetSize(unsigned int width, unsigned int height);
00125 
00132     virtual void Show(bool show);
00133 
00140     virtual void EnableKeyRepeat(bool enabled);
00141 
00150     virtual void SetIcon(unsigned int width, unsigned int height, const Uint8* pixels);
00151 
00156     void RegisterWindowClass();
00157 
00164     void SwitchToFullscreen(const VideoMode& mode);
00165 
00170     void Cleanup();
00171 
00180     void ProcessEvent(UINT message, WPARAM wParam, LPARAM lParam);
00181 
00191     static Key::Code VirtualKeyCodeToSF(WPARAM key, LPARAM flags);
00192 
00202     static bool HasUnicodeSupport();
00203 
00215     static LRESULT CALLBACK GlobalOnEvent(HWND handle, UINT message, WPARAM wParam, LPARAM lParam);
00216 
00218     // Member data
00220     HWND    myHandle;           
00221     long    myCallback;         
00222     HCURSOR myCursor;           
00223     HICON   myIcon;             
00224     bool    myKeyRepeatEnabled; 
00225     bool    myIsCursorIn;       
00226 };
00227 
00228 } // namespace priv
00229 
00230 } // namespace sf
00231 
00232 #endif // SFML_WINDOWIMPLWIN32_HPP

 ::  Copyright © 2007-2008 Laurent Gomila, all rights reserved  ::  Documentation generated by doxygen 1.5.2  ::