tiling.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 PAPYRUSTILING_H
00021 #define PAPYRUSTILING_H
00022
00023 #include <papyrus/enums.h>
00024 #include <papyrus/drawable.h>
00025 #include <papyrus/fill.h>
00026 #include <papyrus/rgba.h>
00027 #include <papyrus/stroke.h>
00028
00029 namespace Papyrus
00030 {
00031
00035 class Tiling : public Drawable
00036 {
00037 protected:
00038
00039 Tiling ( const Glib::ustring& id, unsigned rows, unsigned columns, double side_length );
00040
00041 public:
00042 PAPYRUS_RENDERABLE(Tiling);
00043
00044 virtual ~Tiling();
00045
00046 unsigned rows() const;
00047
00048 void set_rows( unsigned r );
00049
00050 unsigned columns() const;
00051
00052 void set_columns( unsigned c );
00053
00059 void set_columns_rows( unsigned c, unsigned r );
00060
00061 double side_length() const;
00062
00063 void set_side_length( double l );
00064
00070 Fill::pointer fill(unsigned column, unsigned row);
00071
00073 void set_fill ( Fill::pointer fill, unsigned column, unsigned row );
00074
00079 void set_fill ( Paint::pointer paint, unsigned column, unsigned row );
00080
00085 void set_fill ( Cairo::RefPtr<Cairo::Pattern> pattern, unsigned column, unsigned row );
00086
00091 void set_fill( const RGBA& color, unsigned column, unsigned row );
00092
00097 void set_fill( const Glib::ustring& fill, unsigned column, unsigned row );
00098
00106 void set_fill_paint( const Glib::ustring& paint_name, unsigned column, unsigned row );
00107
00109 Fill::pointer fill();
00110
00112 void set_fill ( Fill::pointer fill );
00113
00118 void set_fill ( Paint::pointer paint );
00119
00124 void set_fill ( Cairo::RefPtr<Cairo::Pattern> pattern );
00125
00130 void set_fill( const RGBA& color );
00131
00136 void set_fill( const Glib::ustring& fill );
00137
00145 void set_fill_paint( const Glib::ustring& paint_name );
00146
00148 Stroke::pointer stroke();
00149
00153 void set_stroke ( Stroke::pointer stroke );
00154
00159 void set_stroke ( Paint::pointer paint );
00160
00165 void set_stroke ( Cairo::RefPtr<Cairo::Pattern> pattern );
00166
00171 void set_stroke ( const RGBA& color );
00172
00177 void set_stroke ( const Glib::ustring& stroke );
00178
00186 void set_stroke_paint( const Glib::ustring& paint_name );
00187
00188 protected:
00189 unsigned m_rows;
00190 unsigned m_columns;
00191 double m_side_length;
00192
00193 Fill::pointer** m_fill;
00194
00195 sigc::connection** m_fill_changed_connection;
00196
00197 Fill::pointer m_default_fill;
00198 Stroke::pointer m_stroke;
00199
00200
00201 sigc::connection m_default_fill_changed_connection;
00202 sigc::connection m_stroke_changed_connection;
00203
00204 virtual void on_default_fill_changed();
00205
00206 virtual void on_fill_changed(unsigned column, unsigned row);
00207
00208 virtual void on_stroke_changed();
00209
00210 virtual void shape_changed ( );
00211
00212 virtual void update_centroid_x() = 0;
00213
00214 virtual void update_centroid_y() = 0;
00215
00216 virtual void update_centroid() = 0;
00217
00218 };
00219
00220 }
00221
00222 #endif