rectangle.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 PAPYRUSRECTANGLE_H
00020 #define PAPYRUSRECTANGLE_H
00021 
00022 #include <papyrus/shape.h>
00023 
00044 namespace Papyrus {
00045 
00053   class Rectangle : public Shape {
00054     public:
00055       typedef PapyrusSmartPointer<Rectangle> pointer;
00056 
00057       Rectangle( double w = 0.0, double h = 0.0 );
00058 
00060       static Rectangle::pointer create( double w = 0.0, double h = 0.0 );
00061 
00062       ~Rectangle();
00063 
00065       double width();
00066 
00068       double height();
00069 
00071       void width_height( double& w, double& h );
00072 
00074       void set_width( double w );
00075 
00077       void set_height( double h );
00078 
00080       void set_width_height( double w, double h );
00081 
00086       void set_xywh( double x, double y, double w, double h );
00087 
00089       virtual void draw_shape( Cairo::RefPtr<Cairo::Context> cairo );
00090 
00092       sigc::signal<void> signal_size();
00093 
00094       PAPYRUS_CLASS_NAME("Rectangle");
00095 
00096       PAPYRUS_CLONE_METHOD( Rectangle );
00097 
00098   protected:
00099 
00100       double m_width;
00101 
00102       double m_height;
00103 
00104       virtual void need_redraw();
00105 
00106       sigc::signal<void> m_signal_size;
00107 
00108   };
00109 
00110 }
00111 
00112 #endif

Generated on Sun Jan 7 22:53:57 2007 by  doxygen 1.5.1