papyrus logo

scaler.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 PAPYRUSSCALER_H
00021 #define PAPYRUSSCALER_H
00022 
00023 #include <papyrus/affinecontroller.h>
00024 #include <papyrus/handlebox.h>
00025 
00026 namespace Papyrus
00027 {
00028 
00032   class Scaler : public AffineController
00033   {
00034     protected:
00035       
00036       Scaler ( const Glib::ustring& id, DrawableSet::pointer drawables, unsigned side = 0 );
00037 
00038     public:
00039       
00040       typedef PapyrusPointer<Scaler> pointer;
00041 
00042       static Scaler::pointer create ( unsigned side = TOP|RIGHT|BOTTOM|LEFT );
00043 
00044       static Scaler::pointer create ( const Glib::ustring& id, DrawableSet::pointer drawables, unsigned side = TOP|RIGHT|BOTTOM|LEFT );
00045 
00046       static Scaler::pointer create ( const Glib::ustring& id, unsigned side = TOP|RIGHT|BOTTOM|LEFT );
00047 
00048       static Scaler::pointer create ( DrawableSet::pointer drawables, unsigned side = TOP|RIGHT|BOTTOM|LEFT );
00049 
00050       virtual ~Scaler();
00051 
00052       unsigned sides();
00053 
00054       void set_sides ( unsigned sides );
00055 
00056       void enable_sides ( unsigned sides );
00057 
00058       void disable_sides ( unsigned sides );
00059 
00061 //     void grid( double& x, double& y );
00062 
00067 //     void set_grid( double x, double y );
00068 
00069 //     void set_grid_x( double x );
00070 
00071 //     void set_grid_y( double y );
00072 
00073     protected:
00074       double m_last_position[2], m_original_position[2];
00075       unsigned m_sides;
00076       double m_grid[2];
00077 
00078       virtual bool on_motion ( const Event::Motion& event );
00079       virtual bool on_button_press ( const Event::ButtonPress& event );
00080 
00081   };
00082 
00083 }
00084 
00085 #endif

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