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
00029 #ifndef _GG_Cursor_h_
00030 #define _GG_Cursor_h_
00031
00032 #include <GG/PtRect.h>
00033
00034 #include <boost/shared_ptr.hpp>
00035
00036
00037 namespace GG {
00038
00039 class Texture;
00040
00043 class GG_API Cursor
00044 {
00045 public:
00047 Cursor();
00048 virtual ~Cursor();
00049
00050
00052
00054 virtual void Render(const Pt& pt) = 0;
00056
00057 private:
00058 friend class boost::serialization::access;
00059 template <class Archive>
00060 void serialize(Archive& ar, const unsigned int version);
00061 };
00062
00065 class GG_API TextureCursor :
00066 public Cursor
00067 {
00068 public:
00070
00072 TextureCursor(const boost::shared_ptr<Texture>& texture, const Pt& hotspot = Pt());
00074
00076 virtual void Render(const Pt& pt);
00078
00079 private:
00080 boost::shared_ptr<Texture> m_texture;
00081 Pt m_hotspot;
00082
00083 friend class boost::serialization::access;
00084 template <class Archive>
00085 void serialize(Archive& ar, const unsigned int version);
00086 };
00087
00088 }
00089
00090
00091 template <class Archive>
00092 void GG::Cursor::serialize(Archive& ar, const unsigned int version)
00093 {}
00094
00095 template <class Archive>
00096 void GG::TextureCursor::serialize(Archive& ar, const unsigned int version)
00097 {
00098 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Cursor)
00099 & m_texture
00100 & m_hotspot;
00101 }
00102
00103 #endif // _GG_Cursor_h_