papyrus logo

boxed.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the papyrus library.                             *
00006  *                                                                         *
00007  *   papyrus is free software; you can redistribute it and/or modify       *
00008  *   it under the terms of the GNU Lesser General Public License           *
00009  *   version 3.0 as published by the Free Software Foundation.             *
00010  *                                                                         *
00011  *   papyrus is distributed in the hope that it will be useful,            *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Lesser General Public License version 3.0 for more details.       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with the papyrus library. If not, see                   *
00018  *   <http://www.gnu.org/licenses/>.                                       *
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

Generated on Fri Apr 16 12:40:10 2010 for papyrus by doxygen 1.6.1