Gnash  0.8.11dev
Shape.h
Go to the documentation of this file.
1 // Shape.h: Shape DisplayObject implementation for Gnash.
2 //
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc
5 //
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.
10 //
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.
15 //
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
19 
20 #ifndef GNASH_SHAPE_H
21 #define GNASH_SHAPE_H
22 
23 #include "DisplayObject.h"
24 #include "DefineShapeTag.h"
25 #include "DynamicShape.h"
26 
27 #include <boost/intrusive_ptr.hpp>
28 #include <cassert>
29 
30 namespace gnash {
31 
33 //
37 class Shape : public DisplayObject
38 {
39 public:
40  Shape(movie_root& mr, as_object* object, const SWF::DefineShapeTag* def,
42  :
44  _def(def)
45  {
46  assert(_def);
47  }
48 
49  virtual void display(Renderer& renderer, const Transform& xform);
50 
51  virtual SWFRect getBounds() const {
52  return _def->bounds();
53  }
54 
55  virtual bool pointInShape(std::int32_t x, std::int32_t y) const;
56 
57 private:
58 
59  const boost::intrusive_ptr<const SWF::DefineShapeTag> _def;
60 
61 };
62 
63 
64 } // namespace gnash
65 
66 
67 #endif
68 
69 
70 // Local Variables:
71 // mode: C++
72 // indent-tabs-mode: t
73 // End:
Shape.h
gnash::Shape
For DisplayObjects that don't store unusual state in their instances.
Definition: Shape.h:38
DynamicShape.h
gnash::as_object
The base class for all ActionScript objects.
Definition: as_object.h:162
y
std::int32_t y
Definition: BitmapData_as.cpp:435
gnash::Shape::Shape
Shape(movie_root &mr, as_object *object, const SWF::DefineShapeTag *def, DisplayObject *parent)
Definition: Shape.h:40
gnash::SWFMatrix::invert
SWFMatrix & invert()
Invert this SWFMatrix and return the result.
Definition: SWFMatrix.cpp:288
gnash::DisplayObject::object
as_object * object() const
Definition: DisplayObject.h:931
Transform.h
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::getWorldMatrix
SWFMatrix getWorldMatrix(const DisplayObject &d, bool includeRoot=true)
Get concatenated SWFMatrix (all ancestor transforms and our SWFMatrix)
Definition: DisplayObject.h:1131
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::DisplayObject::transform
const Transform & transform() const
Definition: DisplayObject.h:292
gnash::Shape::getBounds
virtual SWFRect getBounds() const
Definition: Shape.h:51
gnash::SWFRect
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
gnash::geometry::Point2d::x
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
gnash::SWFMatrix::transform
void transform(geometry::Point2d &p) const
Transform a given point by our SWFMatrix.
Definition: SWFMatrix.cpp:99
gnash::Shape::display
virtual void display(Renderer &renderer, const Transform &xform)
Render the DisplayObject.
Definition: Shape.cpp:49
gnash::SWFMatrix
Definition: SWFMatrix.h:54
gnash::geometry::Point2d
2D Point class
Definition: Point2d.h:39
DefineShapeTag.h
DisplayObject.h
gnash::DisplayObject::clear_invalidated
void clear_invalidated()
Definition: DisplayObject.h:720
gnash::DisplayObject::parent
DisplayObject * parent() const
Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent.
Definition: DisplayObject.h:252
gnash::movie_root
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:151
gnash::Shape::pointInShape
virtual bool pointInShape(std::int32_t x, std::int32_t y) const
Return true if the given point falls in this DisplayObject's shape.
Definition: Shape.cpp:27
gnash::geometry::Point2d::y
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
gnash::DisplayObject
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
gnash::Transform
The Transform class expresses a stage in a cumulative transformation.
Definition: Transform.h:34
x
std::int32_t x
Definition: BitmapData_as.cpp:434
gnash::SWF::DefineShapeTag
Represents the outline of one or more shapes, along with information on fill and line styles.
Definition: DefineShapeTag.h:33