papyrus logo

paint.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2009 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the papyrus library.                             *
00006  *                                                                         *
00007  *   papyrus is free software; you can redistribute it and/or modify       *
00008  *   it under the terms of the GNU Lesser General Public License           *
00009  *   version 3.0 as published by the Free Software Foundation.             *
00010  *                                                                         *
00011  *   papyrus is distributed in the hope that it will be useful,            *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Lesser General Public License version 3.0 for more details.       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with the papyrus library. If not, see                   *
00018  *   <http://www.gnu.org/licenses/>.                                       *
00019  ***************************************************************************/
00020 #ifndef PAPYRUSPAINT_H
00021 #define PAPYRUSPAINT_H
00022 
00023 #include <papyrus/renderable.h>
00024 
00025 namespace Papyrus
00026 {
00027 
00028 //   typedef Cairo::RefPtr<Cairo::Pattern> Paint;
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

Generated on Wed Mar 18 12:34:04 2009 for papyrus by doxygen 1.5.7.1