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

WindowImplCocoa.hpp

00001 
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2009 Lucas Soltic (ceylow@gmail.com) and 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_WINDOWIMPLCOCOA_HPP
00026 #define SFML_WINDOWIMPLCOCOA_HPP
00027 
00029 // Headers
00031 #include <SFML/Window/Event.hpp>
00032 #include <SFML/Window/WindowImpl.hpp>
00033 #include <string>
00034 
00035 #ifdef __OBJC__
00036 #import <Cocoa/Cocoa.h>
00037 @class WindowWrapper;
00038 #endif
00039 
00040 namespace sf
00041 {
00042 namespace priv
00043 {
00044 
00048 class WindowImplCocoa : public WindowImpl
00049 {
00050 public :
00051 
00057     WindowImplCocoa();
00058 
00067     WindowImplCocoa(WindowHandle Handle, WindowSettings& params);
00068 
00078     WindowImplCocoa(VideoMode Mode, const std::string& Title, unsigned long WindowStyle, WindowSettings& params);
00079 
00084     ~WindowImplCocoa();
00085 
00092     static bool IsContextActive();
00093     
00097     void HandleNotifiedEvent(Event& eventRef);
00098     
00103     void HandleKeyDown(void *eventRef);
00104     void HandleKeyUp(void *eventRef);
00105     void HandleModifierKey(void *eventRef);
00106     void HandleMouseDown(void *eventRef);
00107     void HandleMouseUp(void *eventRef);
00108     void HandleMouseMove(void *eventRef);
00109     void HandleMouseWheel(void *eventRef);
00110     
00111 private :
00112 
00117     virtual void Display();
00118 
00123     virtual void ProcessEvents();
00124     
00129     virtual void SetActive(bool Active = true) const;
00130 
00135     virtual void UseVerticalSync(bool Enabled);
00136 
00141     virtual void ShowMouseCursor(bool Show);
00142 
00147     virtual void SetCursorPosition(unsigned int Left, unsigned int Top);
00148 
00153     virtual void SetPosition(int Left, int Top);
00154     
00159     virtual void SetSize(unsigned int Width, unsigned int Height);
00160     
00165     virtual void Show(bool State);
00166     
00171     virtual void EnableKeyRepeat(bool Enabled);
00172     
00177     virtual void SetIcon(unsigned int Width, unsigned int Height, const Uint8* Pixels);
00178     
00179     
00180     
00184     
00185     
00187     // Member data
00189     
00190 #ifdef __OBJC__
00191     WindowWrapper *myWrapper;
00192 #else
00193     void *myWrapper;
00194 #endif
00195     
00196     bool myUseKeyRepeat;
00197     bool myMouseIn;
00198     float myWheelStatus;
00199 };
00200 
00201 } // namespace priv
00202 
00203 } // namespace sf
00204 
00205 #endif // SFML_WINDOWIMPLCOCOA_HPP

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