papyrus logo

color.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 PAPYRUSCOLOR_H
00021 #define PAPYRUSCOLOR_H
00022 
00023 #include <papyrus/paint.h>
00024 
00025 namespace Papyrus {
00026 
00032 class Color : public Paint
00033 {
00034   protected:
00035     Color ( const Glib::ustring& id, Cairo::RefPtr<Cairo::Pattern> pattern );
00036 
00037   public:
00038     PAPYRUS_RENDERABLE(Color);
00039 
00040     static pointer create( );
00041 
00042     static pointer create( const Glib::ustring& color_string );
00043 
00044     static pointer create( Cairo::RefPtr<Cairo::Pattern> p );
00045 
00046     static pointer create( const Glib::ustring& id, const Glib::ustring& color_string );
00047 
00048     static pointer create( const Glib::ustring& id, Cairo::RefPtr<Cairo::Pattern> p );
00049 
00050     ~Color();
00051 
00052     Color& operator=( pointer other );
00053 
00054     Color& operator=( Cairo::RefPtr<Cairo::Pattern> p );
00055 
00057     Color& operator=( Cairo::RefPtr<Cairo::Context> c );
00058 
00059     Color& operator=( const Color& other );
00060 
00061     void set( pointer other );
00062 
00063     void set( Cairo::RefPtr<Cairo::Pattern> p );
00064 
00066     void set( Cairo::RefPtr<Cairo::Context> cairo );
00067 
00068     Cairo::RefPtr<Cairo::Pattern> cairo_pattern() const;
00069 
00070     operator Cairo::RefPtr<Cairo::Pattern>() const;
00071 
00072     virtual void render ( Context& cairo ) const;
00073 
00074   protected:
00075     Cairo::RefPtr<Cairo::Pattern> m_pattern;
00076 
00077 };
00078 
00079 }
00080 
00081 #endif

Generated on Fri Apr 16 12:40:10 2010 for papyrus by doxygen 1.6.1