papyrus logo

handlebox.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 PAPYRUSHANDLEBOX_H
00021 #define PAPYRUSHANDLEBOX_H
00022 
00023 #include <papyrus/boxed.h>
00024 
00025 namespace Papyrus
00026 {
00027 
00031   class Handlebox : public Boxed
00032   {
00033     protected:
00034 
00035       Handlebox ( const Glib::ustring& id, Handles handles );
00036 
00037     public:
00038       PAPYRUS_DRAWABLE(Handlebox);
00039 
00040       static pointer create ( Handles handles=CORNER_HANDLES );
00041 
00042       static pointer create ( const Glib::ustring& id, Handles handles=CORNER_HANDLES );
00043 
00044       virtual ~Handlebox();
00045 
00046       void set_handle_shape ( Position p, Drawable::pointer shape, bool activate=true );
00047 
00048       void set_handle_shape ( Handles h, Drawable::pointer shape, bool activate=true );
00049 
00050       Drawable::pointer get_handle_shape ( Position p );
00051 
00052       void activate_handle ( Position p, bool activate=true );
00053 
00054       void activate_handle ( Handles h, bool activate=true );
00055 
00056       void deactivate_handle ( Position p );
00057 
00058       void deactivate_handle ( Handles h );
00059 
00060       bool is_active ( Position p );
00061 
00062       bool is_active ( Handles h );
00063 
00064       int inside_handle ( double x, double y );
00065 
00066     protected:
00067       Drawable::pointer m_handle_shape[ 8 ];
00068       bool m_handle_active[8];
00069       bool m_initializing;
00070 
00075       virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const;
00076 
00077       virtual void position_handle ( Drawable::pointer, double x, double y );
00078 
00079       virtual void on_child_added ( Drawable::pointer child );
00080 
00081       virtual void on_child_removed ( Drawable::pointer child );
00082 
00083   };
00084 
00085 }
00086 
00087 #endif

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