OSDLMouseCursor.h

Go to the documentation of this file.
00001 #ifndef OSDL_MOUSE_CURSOR_H_
00002 #define OSDL_MOUSE_CURSOR_H_
00003 
00004 
00005 #include "OSDLVideoTypes.h"  // for VideoException
00006 
00007 #include "Ceylan.h"          // for inheritance
00008 
00009 
00010 #include <string>
00011 
00012 
00013 // Cursor may embed an SDL cursor :
00014 struct SDL_Cursor ;
00015 
00016 
00017 namespace OSDL
00018 {
00019 
00020     namespace Video
00021     {
00022         
00023         
00024         // Cursor shape may be a surface.
00025         class Surface ;
00026         
00027         
00028         namespace OpenGL
00029         {
00030         
00031             // Cursor shape may be a surface.
00032             class GLTexture ;
00033         
00034         }
00035         
00036         
00037         namespace TwoDimensional
00038         {
00039 
00040     
00041 
00046             class OSDL_DLL MouseCursorException : public VideoException
00047             {
00048                 public:
00049                 
00050                     MouseCursorException( const std::string & exception ) 
00051                         throw() ;
00052                         
00053                     virtual ~MouseCursorException() throw() ;
00054                     
00055             } ;
00056 
00057 
00058 
00059 
00094             class OSDL_DLL MouseCursor : public Ceylan::TextDisplayable
00095             {
00096             
00097                     
00098                 public:
00099                         
00100                     
00113                     enum CursorType 
00114                     {
00115                     
00116                         SystemCursor,
00117                         BlittedCursor,
00118                         TexturedCursor
00119                     
00120                     } ;
00121                         
00122                             
00151                     MouseCursor( 
00152                             Length width,
00153                             Length height,
00154                             const Ceylan::Uint8 & data,
00155                             const Ceylan::Uint8 & mask,
00156                             Coordinate hotSpotAbscissa,
00157                             Coordinate hotSpotOrdinate )
00158                         throw( MouseCursorException ) ;
00159                     
00160                     
00161                         
00181                     MouseCursor( const Surface & cursorSurface,
00182                             Coordinate hotSpotAbscissa,
00183                             Coordinate hotSpotOrdinate )
00184                         throw( MouseCursorException ) ;
00185                         
00186                     
00188                     virtual ~MouseCursor() throw() ;
00189                     
00190                     
00191                     
00198                     CursorType getType() const throw() ;
00199                     
00200                     
00213                     virtual const std::string toString( 
00214                             Ceylan::VerbosityLevels level = Ceylan::high ) 
00215                         const throw() ;
00216                 
00217                         
00218                             
00219                                             
00220                 protected:
00221                         
00222                         
00223                     
00224                     CursorType _type ;
00225                     
00226                     
00231                     SDL_Cursor * _systemCursor ;
00232                     
00233                                         
00234                     
00236                     Length _width ;
00237                     
00239                     Length _height ;
00240                     
00241                     
00242                     
00247                     Surface * _surface ;
00248                     
00249                     
00254                     OpenGL::GLTexture * _texture ;
00255                     
00256                     
00257                     
00259                     Coordinate _hotSpotAbscissa ;
00260                     
00262                     Coordinate _hotSpotOrdinate ;
00263                     
00264                     
00265                     
00266                 private:    
00267 
00268 
00277                     explicit MouseCursor( const MouseCursor & source ) throw() ;
00278             
00279             
00288                     MouseCursor & operator = ( const MouseCursor & source )
00289                         throw() ;
00290                     
00291                     
00292             } ;         
00293                                             
00294         }
00295     
00296     }
00297 
00298 }               
00299 
00300 
00301 #endif // OSDL_MOUSE_CURSOR_H_
00302 

Generated on Fri Mar 30 14:46:59 2007 for OSDL by  doxygen 1.5.1