00001 /*************************************************************************** 00002 * Copyright (C) 2007 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 PAPYRUSREFERENCE_H 00021 #define PAPYRUSREFERENCE_H 00022 00023 #include <papyrus/drawable.h> 00024 00025 namespace Papyrus 00026 { 00027 00047 class Reference : public Drawable 00048 { 00049 protected: 00050 Reference ( const Glib::ustring& id, Drawable::pointer ref ); 00051 00052 public: 00053 PAPYRUS_DRAWABLE(Reference); 00054 00056 static pointer create ( Drawable::pointer ref = Drawable::pointer() ); 00057 00062 static pointer create ( const Glib::ustring& id, Drawable::pointer ref = Drawable::pointer() ); 00063 00065 ~Reference(); 00066 00068 virtual void draw ( Context& cairo ) const; 00069 00074 Drawable::pointer referenced(); 00075 00080 void set_referenced ( Drawable::pointer d ); 00081 00085 void clear_referenced( ); 00086 00088 virtual Matrix global_matrix() const; 00089 00090 virtual Glib::ustring svg(unsigned depth=0); 00091 00092 protected: 00094 Drawable::pointer m_referenced; 00095 00097 virtual Matrix calculate_composed_matrix() const; 00098 00099 virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const; 00100 00105 sigc::connection m_connection_referenced_composed_matrix_invalidated; 00106 00107 }; 00108 00109 } 00110 00111 #endif