• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

MorphShape.h

Go to the documentation of this file.
00001 // MorphShape.h: the MorphShape DisplayObject implementation for Gnash.
00002 // 
00003 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00004 //   Foundation, Inc
00005 // 
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 3 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // This program 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 General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU General Public License
00017 // along with this program; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 
00020 #ifndef GNASH_MORPH_SHAPE_H
00021 #define GNASH_MORPH_SHAPE_H
00022 
00023 #include "smart_ptr.h" // GNASH_USE_GC
00024 #include "DisplayObject.h"
00025 #include "swf/DefineMorphShapeTag.h"
00026 #include <boost/intrusive_ptr.hpp>
00027 #include <cassert>
00028 
00029 namespace gnash {
00030     class Renderer;
00031 }
00032 
00033 namespace gnash {
00034 
00036 //
00040 //
00046 //
00049 class MorphShape : public DisplayObject
00050 {
00051 
00052 public:
00053 
00054     MorphShape(movie_root& mr, as_object* object,
00055             const SWF::DefineMorphShapeTag* def, DisplayObject* parent);
00056 
00057         virtual void display(Renderer& renderer);
00058 
00059     virtual SWFRect getBounds() const;
00060     
00061     virtual bool pointInShape(boost::int32_t  x, boost::int32_t  y) const;
00062  
00063     const SWF::ShapeRecord& shape() const {
00064         return _shape;
00065     }
00066 
00067 private:
00068     
00069     void morph();
00070 
00071     double currentRatio() const;
00072 
00073     const boost::intrusive_ptr<const SWF::DefineMorphShapeTag> _def;
00074         
00075     SWF::ShapeRecord _shape;
00076 
00077 };
00078 
00079 
00080 } // namespace gnash
00081 
00082 
00083 #endif 
00084 
00085 
00086 // Local Variables:
00087 // mode: C++
00088 // indent-tabs-mode: t
00089 // End:

Generated on Fri Mar 16 2012 15:46:11 for Gnash by  doxygen 1.7.1