canvas.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018  ***************************************************************************/
00019 #ifndef PAPYRUSCANVAS_H
00020 #define PAPYRUSCANVAS_H
00021 
00022 #include <papyrus/group.h>
00023 
00024 #include <cairomm/cairomm.h>
00025 
00175 namespace Papyrus {
00176 
00180   class Canvas: public Group {
00181 
00182     public:
00183       typedef PapyrusSmartPointer<Canvas> pointer;
00184 
00185       Canvas(double w=0.0, double h=0.0);
00186 
00187       static Canvas::pointer create(double w=0.0, double h=0.0);
00188 
00189       virtual ~Canvas();
00190 
00191       double size_w();
00192 
00193       double size_h();
00194 
00195       void size( double& w, double& h );
00196 
00197       void set_size_w( double w );
00198 
00199       void set_size_h( double h );
00200 
00201       void set_size( double w, double h );
00202 
00203       sigc::signal<void> signal_size();
00204 
00205       void set_background( Cairo::RefPtr<Cairo::Pattern> background );
00206 
00207       Cairo::RefPtr<Cairo::Pattern> get_background();
00208 
00209       PAPYRUS_CLASS_NAME("Canvas");
00210 
00211       PAPYRUS_CLONE_METHOD( Canvas );
00212 
00213     protected:
00214       double m_width, m_height;
00215       Cairo::RefPtr<Cairo::Pattern> m_background;
00216       sigc::signal<void> m_signal_size;
00217 
00218       virtual void draw( Cairo::RefPtr<Cairo::Context> cairo );
00219 
00220   };
00221 
00222 }
00223 
00224 #endif

Generated on Sun Mar 11 10:01:27 2007 by  doxygen 1.5.1