OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sdlcursormanager.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_SDLUTIL_SDLCURSORMANAGER_H
2 #define OPENMW_COMPONENTS_SDLUTIL_SDLCURSORMANAGER_H
3 
4 #include <map>
5 #include <string>
6 
7 #include <SDL_types.h>
8 
9 struct SDL_Cursor;
10 struct SDL_Surface;
11 
12 namespace osg
13 {
14  class Image;
15 }
16 
17 namespace SDLUtil
18 {
20  {
21  public:
23  virtual ~SDLCursorManager();
24 
26  virtual void setEnabled(bool enabled);
27 
30  virtual void cursorChanged(const std::string &name);
31 
32  virtual void createCursor(const std::string &name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y);
33 
34  private:
35  void _createCursorFromResource(const std::string &name, int rotDegrees, osg::Image* image, Uint8 hotspot_x, Uint8 hotspot_y);
36  void _putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
37 
38  void _setGUICursor(const std::string& name);
39 
40  typedef std::map<std::string, SDL_Cursor*> CursorMap;
42 
43  std::string mCurrentCursor;
44  bool mEnabled;
46  };
47 }
48 
49 #endif
virtual ~SDLCursorManager()
Definition: sdlcursormanager.cpp:163
Definition: sdlcursormanager.hpp:19
CursorMap mCursorMap
Definition: sdlcursormanager.hpp:41
void _setGUICursor(const std::string &name)
Definition: sdlcursormanager.cpp:209
virtual void createCursor(const std::string &name, int rotDegrees, osg::Image *image, Uint8 hotspot_x, Uint8 hotspot_y)
Definition: sdlcursormanager.cpp:214
virtual void setEnabled(bool enabled)
sets whether to actively manage cursors or not
Definition: sdlcursormanager.cpp:176
bool mEnabled
Definition: sdlcursormanager.hpp:44
std::map< std::string, SDL_Cursor * > CursorMap
Definition: sdlcursormanager.hpp:40
void _createCursorFromResource(const std::string &name, int rotDegrees, osg::Image *image, Uint8 hotspot_x, Uint8 hotspot_y)
Definition: sdlcursormanager.cpp:219
bool mInitialized
Definition: sdlcursormanager.hpp:45
std::string mCurrentCursor
Definition: sdlcursormanager.hpp:43
void _putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel)
SDLCursorManager()
Definition: sdlcursormanager.cpp:157
virtual void cursorChanged(const std::string &name)
Tell the manager that the cursor has changed, giving the name of the cursor we changed to ("arrow"...
Definition: sdlcursormanager.cpp:196
const char * name
Definition: crashcatcher.cpp:59