rectangle.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PAPYRUSRECTANGLE_H
00021 #define PAPYRUSRECTANGLE_H
00022
00023 #include <papyrus/shape.h>
00024
00045 namespace Papyrus
00046 {
00047
00055 class Rectangle : public Shape
00056 {
00057 protected:
00058
00059 Rectangle ( const Glib::ustring& id,
00060 double x,
00061 double y,
00062 double w,
00063 double h,
00064 Fill::pointer fill,
00065 Stroke::pointer stroke
00066 );
00067
00068 Rectangle( const AttributeValueMap& avmap );
00069
00070 public:
00071 PAPYRUS_DRAWABLE(Rectangle);
00072
00073 static Rectangle::pointer create ( double x,
00074 double y,
00075 double w,
00076 double h,
00077 Fill::pointer fill = Fill::pointer(),
00078 Stroke::pointer stroke=Stroke::pointer() );
00079
00081 static Rectangle::pointer create ( double w=0.0,
00082 double h=0.0,
00083 Fill::pointer fill = Fill::pointer(),
00084 Stroke::pointer stroke=Stroke::pointer() );
00085
00086 static Rectangle::pointer create ( const Glib::ustring& id,
00087 double x,
00088 double y,
00089 double w,
00090 double h,
00091 Fill::pointer fill = Fill::pointer(),
00092 Stroke::pointer stroke=Stroke::pointer() );
00093
00094 static Rectangle::pointer create ( const Glib::ustring& id,
00095 double w,
00096 double h,
00097 Fill::pointer fill = Fill::pointer(),
00098 Stroke::pointer stroke=Stroke::pointer() );
00099
00100 static Rectangle::pointer create( const AttributeValueMap& avmap );
00101
00102 virtual ~Rectangle();
00103
00104 virtual void set( const AttributeValueMap& avmap );
00105
00107 double width();
00108
00110 double height();
00111
00113 void xywh ( double& x, double& y, double& w, double& h );
00114
00116 void set_width ( double w );
00117
00119 void set_height ( double h );
00120
00125 void set_xywh ( double x, double y, double w, double h );
00126
00127 void set_xywh ( const Region& r );
00128
00130 double corner_radius();
00131
00133 void set_corner_radius( double r );
00134
00142 void unset_corner_radius();
00143
00145 virtual void draw_shape ( Context& cairo ) const;
00146
00147 virtual Glib::ustring svg(unsigned depth=0);
00148
00150 sigc::signal<void> signal_size();
00151
00152 protected:
00153
00154 double m_width, m_height;
00155
00156 double m_corner_radius;
00157
00158 sigc::signal<void> m_signal_size;
00159
00161 virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const;
00162
00163 };
00164
00165 }
00166
00167 #endif