boxed.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 PAPYRUSBOXED_H
00021 #define PAPYRUSBOXED_H
00022
00023 #include <papyrus/rectangle.h>
00024 #include <papyrus/drawablewatcher.h>
00025 #include <papyrus/drawablesinglecontainer.h>
00026
00045 namespace Papyrus
00046 {
00047
00051 class Boxed : public Drawable, public DrawableSingleContainer, public DrawableWatcher
00052 {
00053 protected:
00054
00055 Boxed ( const Glib::ustring& id, Fill::pointer fill = Fill::create( RGBA(1.0, 0.85, 1.0, 0.9)), Stroke::pointer stroke = Stroke::create( RGBA(1.0, 0.0, 1.0, 0.9) ) );
00056
00057 public:
00058 PAPYRUS_DRAWABLE(Boxed);
00059
00060 static const int DEFAULT_LEVEL;
00061
00062 static pointer create ( const Glib::ustring& id = Glib::ustring(),
00063 Fill::pointer fill = Fill::create( RGBA(1.0, 0.85, 1.0, 0.9) ),
00064 Stroke::pointer stroke = Stroke::create( RGBA(1.0, 0.0, 1.0, 0.9) ) );
00065
00066 virtual ~Boxed();
00067
00068 Rectangle::pointer box();
00069
00070 OverUnder box_position() const;
00071
00072 void set_box_position(OverUnder ou);
00073
00074 virtual void draw ( Context& cairo ) const;
00075
00076 protected:
00077 Rectangle::pointer m_box;
00078
00079 OverUnder m_box_position;
00080
00081 void on_child_added(Drawable::pointer added);
00082
00083 void on_child_removed(Drawable::pointer removed);
00084
00085 void on_cleared();
00086
00087 virtual void on_child_changed(Drawable::pointer changed);
00088
00093 virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const;
00094
00095 void on_watched_event ( Drawable::pointer watched );
00096 };
00097
00098 }
00099
00100 #endif