Gnash
0.8.10
|
00001 // MorphShape.h: the MorphShape DisplayObject implementation for Gnash. 00002 // 00003 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 00004 // Free Software 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 "DisplayObject.h" 00024 #include "swf/DefineMorphShapeTag.h" 00025 #include <boost/intrusive_ptr.hpp> 00026 #include <cassert> 00027 00028 namespace gnash { 00029 class Renderer; 00030 } 00031 00032 namespace gnash { 00033 00035 // 00039 // 00045 // 00048 class MorphShape : public DisplayObject 00049 { 00050 00051 public: 00052 00053 MorphShape(movie_root& mr, as_object* object, 00054 const SWF::DefineMorphShapeTag* def, DisplayObject* parent); 00055 00056 virtual void display(Renderer& renderer, const Transform& xform); 00057 00058 virtual SWFRect getBounds() const; 00059 00060 virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const; 00061 00062 const SWF::ShapeRecord& shape() const { 00063 return _shape; 00064 } 00065 00066 private: 00067 00068 void morph(); 00069 00070 double currentRatio() const; 00071 00072 const boost::intrusive_ptr<const SWF::DefineMorphShapeTag> _def; 00073 00074 SWF::ShapeRecord _shape; 00075 00076 }; 00077 00078 00079 } // namespace gnash 00080 00081 00082 #endif 00083 00084 00085 // Local Variables: 00086 // mode: C++ 00087 // indent-tabs-mode: t 00088 // End: