00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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 protected:
00055
00056 Rectangle( double w,
00057 double h,
00058 Cairo::RefPtr<Cairo::Pattern> fill
00059 );
00060
00061 Rectangle( double w,
00062 double h,
00063 Cairo::RefPtr<Cairo::Pattern> fill,
00064 const LineStyle& outline
00065 );
00066
00067 public:
00068 typedef PapyrusSmartPointer<Rectangle> pointer;
00069
00071 static Rectangle::pointer create( double w = 0.0,
00072 double h = 0.0,
00073 Cairo::RefPtr<Cairo::Pattern> fill = Cairo::RefPtr<Cairo::Pattern>()
00074 );
00075
00077 static Rectangle::pointer create( double w,
00078 double h,
00079 Cairo::RefPtr<Cairo::Pattern> fill,
00080 const LineStyle& outline
00081 );
00082
00083 ~Rectangle();
00084
00086 double width();
00087
00089 double height();
00090
00092 void width_height( double& w, double& h );
00093
00095 void set_width( double w );
00096
00098 void set_height( double h );
00099
00101 void set_width_height( double w, double h );
00102
00107 void set_xywh( double x, double y, double w, double h );
00108
00110 virtual void draw_shape( Cairo::RefPtr<Cairo::Context> cairo );
00111
00113 sigc::signal<void> signal_size();
00114
00115 PAPYRUS_CLASS_NAME("Rectangle");
00116
00117 PAPYRUS_CLONE_METHOD( Rectangle );
00118
00119 protected:
00120
00121 double m_width;
00122
00123 double m_height;
00124
00125 virtual void need_redraw();
00126
00127 sigc::signal<void> m_signal_size;
00128
00129 };
00130
00131 }
00132
00133 #endif