00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OSDL_MOUSE_CURSOR_H_
00028 #define OSDL_MOUSE_CURSOR_H_
00029
00030
00031 #include "OSDLVideoTypes.h"
00032
00033 #include "Ceylan.h"
00034
00035
00036 #include <string>
00037
00038
00039
00040
00041 #if ! defined(OSDL_USES_SDL) || OSDL_USES_SDL
00042
00043
00044 struct SDL_Cursor ;
00045
00046 #endif // ! defined(OSDL_USES_SDL) || OSDL_USES_SDL
00047
00048
00049
00050
00051 namespace OSDL
00052 {
00053
00054
00055
00056 namespace Video
00057 {
00058
00059
00060
00061 #if ! defined(OSDL_USES_SDL) || OSDL_USES_SDL
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00073 typedef SDL_Cursor LowLevelCursor ;
00074
00075 #else // OSDL_USES_SDL
00076
00077 struct LowLevelCursor {} ;
00078
00079 #endif // OSDL_USES_SDL
00080
00081
00082
00083
00084 class Surface ;
00085
00086
00087
00088 namespace OpenGL
00089 {
00090
00091
00092 class GLTexture ;
00093
00094 }
00095
00096
00097
00098
00099 namespace TwoDimensional
00100 {
00101
00102
00103
00108 class OSDL_DLL MouseCursorException: public VideoException
00109 {
00110 public:
00111
00112 MouseCursorException( const std::string & exception ) ;
00113
00114 virtual ~MouseCursorException() throw() ;
00115
00116 } ;
00117
00118
00119
00120
00155 class OSDL_DLL MouseCursor: public Ceylan::TextDisplayable
00156 {
00157
00158
00159
00160 public:
00161
00162
00163
00176 enum CursorType
00177 {
00178
00179 SystemCursor,
00180 BlittedCursor,
00181 TexturedCursor
00182
00183 } ;
00184
00185
00186
00215 MouseCursor(
00216 Length width,
00217 Length height,
00218 const Ceylan::Uint8 & data,
00219 const Ceylan::Uint8 & mask,
00220 Coordinate hotSpotAbscissa,
00221 Coordinate hotSpotOrdinate ) ;
00222
00223
00224
00244 MouseCursor(
00245 const Surface & cursorSurface,
00246 Coordinate hotSpotAbscissa,
00247 Coordinate hotSpotOrdinate ) ;
00248
00249
00250
00252 virtual ~MouseCursor() throw() ;
00253
00254
00255
00256
00263 CursorType getType() const ;
00264
00265
00266
00279 virtual const std::string toString(
00280 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00281
00282
00283
00284
00285 protected:
00286
00287
00288
00290 CursorType _type ;
00291
00292
00293
00298 LowLevelCursor * _systemCursor ;
00299
00300
00301
00302
00304 Length _width ;
00305
00306
00308 Length _height ;
00309
00310
00311
00316 Surface * _surface ;
00317
00318
00319
00324 OpenGL::GLTexture * _texture ;
00325
00326
00327
00328
00330 Coordinate _hotSpotAbscissa ;
00331
00332
00334 Coordinate _hotSpotOrdinate ;
00335
00336
00337
00338
00339 private:
00340
00341
00342
00351 explicit MouseCursor( const MouseCursor & source ) ;
00352
00353
00354
00363 MouseCursor & operator = ( const MouseCursor & source ) ;
00364
00365
00366 } ;
00367
00368
00369 }
00370
00371 }
00372
00373 }
00374
00375
00376
00377 #endif // OSDL_MOUSE_CURSOR_H_
00378