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       typedef PapyrusPointer<Boxed> pointer;
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 ( Cairo::RefPtr<Cairo::Context> cairo ) const;
00075 
00076       PAPYRUS_CLASS_NAME ( "Boxed" );
00077 
00078       PAPYRUS_CLONE_METHOD ( Boxed );
00079 
00080     protected:
00081       Rectangle::pointer m_box;
00082 
00083       OverUnder m_box_position;
00084 
00085       void on_child_added(Drawable::pointer added);
00086 
00087       void on_child_removed(Drawable::pointer removed);
00088 
00089       void on_cleared();
00090       
00091       virtual void on_child_changed(Drawable::pointer changed);
00092 
00097       virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const;
00098 
00099       void on_watched_event ( Drawable::pointer watched );
00100   };
00101 
00102 }
00103 
00104 #endif

Generated on Wed Mar 18 12:34:03 2009 for papyrus by doxygen 1.5.7.1