1 // Shape.h: Shape DisplayObject implementation for Gnash.
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include "DisplayObject.h"
24 #include "DefineShapeTag.h"
25 #include "DynamicShape.h"
27 #include <boost/intrusive_ptr.hpp>
32 /// For DisplayObjects that don't store unusual state in their instances.
34 /// A Shape may be either statically constructed during parsing or,
35 /// in AS3, dynamically constructed. A SWF-parsed Shape has an immutable
36 /// SWF::DefinitionTag. A dynamic Shape object has a DynamicShape.
37 class Shape
: public DisplayObject
40 Shape(movie_root
& mr
, as_object
* object
, const SWF::DefineShapeTag
* def
,
41 DisplayObject
* parent
)
43 DisplayObject(mr
, object
, parent
),
49 virtual void display(Renderer
& renderer
, const Transform
& xform
);
51 virtual SWFRect
getBounds() const {
52 return _def
->bounds();
55 virtual bool pointInShape(std::int32_t x
, std::int32_t y
) const;
59 const boost::intrusive_ptr
<const SWF::DefineShapeTag
> _def
;
72 // indent-tabs-mode: t