Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

mousecursor_provider.h

Go to the documentation of this file.
00001 /*
00002         $Id: mousecursor_provider.h,v 1.1 2001/03/06 15:09:10 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00016 
00017 #ifndef header_mousecursor_provider
00018 #define header_mousecursor_provider
00019 
00020 class CL_SurfaceProvider;
00021 class CL_ResourceManager;
00022 
00023 class CL_MouseCursorProvider
00024 //: Mouse cursor image interface.
00025 // <p>The mouse cursor provider is an interface that describes how a mouse
00026 // cursor should animate, and which images it should use.</p>
00027 // <p>Use this class to create your cursor icon, and then use CL_MouseCursor
00028 // to make your cursor visible.</p>
00029 {
00030 public:
00031         static CL_MouseCursorProvider *create(
00032                 CL_SurfaceProvider *provider,
00033                 bool delete_provider=true,
00034                 bool animate=true,
00035                 const std::vector<int> *frame_delays=NULL);
00036         // <p>Creates a mouse cursor source, using a surface provider as the
00037         // image source.</p>
00038         // <p>If the surface provider contain subframes, those will be available
00039         // in the mouse cursor too. Furthermore, those frames can be used to
00040         // animate the cursor, if a list of millisec delays are passed as well.</p>
00048 
00049         static CL_MouseCursorProvider *load(
00050                 const char *resource_id,
00051                 CL_ResourceManager *manager);
00052         // <p>Creates a mouse provider, loaded from resources.</p>
00055 
00056         virtual ~CL_MouseCursorProvider() { ; }
00057 
00058         virtual CL_SurfaceProvider *get_surface_provider()=0;
00059         // Returns the surface provider associated with the mouse cursor.
00060         
00061         virtual bool is_animated()=0;
00062         // Returns true if the cursor is animated.
00063         
00064         virtual int get_frame_delay(unsigned int frame_number)=0;
00065         // Returns the millisec delay between 'frame_number' and the next one.
00066 };
00067 
00068 #endif

Generated at Wed Apr 4 19:54:02 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001