paint.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PAPYRUSPAINT_H
00021 #define PAPYRUSPAINT_H
00022
00023 #include <papyrus/renderable.h>
00024
00025 namespace Papyrus
00026 {
00027
00028
00029
00033 class Paint : public Renderable
00034 {
00035 protected:
00036 Paint ( const Glib::ustring& id, Cairo::RefPtr<Cairo::Pattern> pattern );
00037
00038 public:
00039 typedef PapyrusPointer<Paint> pointer;
00040
00041 static pointer create( );
00042
00043 static pointer create( const Glib::ustring& color_string );
00044
00045 static pointer create( Cairo::RefPtr<Cairo::Pattern> p );
00046
00047 static pointer create( const Glib::ustring& id, const Glib::ustring& color_string );
00048
00049 static pointer create( const Glib::ustring& id, Cairo::RefPtr<Cairo::Pattern> p );
00050
00051 ~Paint();
00052
00053 Paint& operator=( pointer other );
00054
00055 Paint& operator=( Cairo::RefPtr<Cairo::Pattern> p );
00056
00058 Paint& operator=( Cairo::RefPtr<Cairo::Context> c );
00059
00060 Paint& operator=( const Paint& other );
00061
00062 void set( pointer other );
00063
00064 void set( Cairo::RefPtr<Cairo::Pattern> p );
00065
00067 void set( Cairo::RefPtr<Cairo::Context> cairo );
00068
00069 Cairo::RefPtr<Cairo::Pattern> cairo_pattern() const;
00070
00071 operator Cairo::RefPtr<Cairo::Pattern>() const;
00072
00073 virtual void render ( Cairo::RefPtr< Cairo :: Context > cairo ) const;
00074
00075 protected:
00076 Cairo::RefPtr<Cairo::Pattern> m_pattern;
00077
00078 };
00079
00083 typedef std::map<Glib::ustring,Paint::pointer> PaintDictionary;
00084
00085 }
00086
00087 #endif