Gnash  0.8.11dev
DefineShapeTag.h
Go to the documentation of this file.
1 // shape.h -- Thatcher Ulrich <tu@tulrich.com> 2003
2 
3 // This source code has been donated to the Public Domain. Do
4 // whatever you want with it.
5 
6 // Quadratic bezier outline shapes, the basis for most SWF rendering.
7 
8 
9 #ifndef GNASH_SHAPE_CHARACTER_DEF_H
10 #define GNASH_SHAPE_CHARACTER_DEF_H
11 
12 #include "DefinitionTag.h" // for inheritance of DefineShapeTag
13 #include "SWF.h"
14 #include "ShapeRecord.h"
15 
16 namespace gnash {
17  class SWFStream;
18  class SWFCxForm;
19  class Shape;
20  class SWFMatrix;
21  class RunResources;
22  class Renderer;
23  class Transform;
24 }
25 
26 namespace gnash {
27 namespace SWF {
28 
33 {
34 public:
35 
36  static void loader(SWFStream& in, TagType tag, movie_definition& m,
37  const RunResources& r);
38 
39  // Display a Shape character.
40  void display(Renderer& renderer, const Transform& xform) const;
41 
42  // Create a Shape DisplayObject.
43  // Inherited from DefinitionTag, see dox there
45  DisplayObject* parent) const;
46 
48  const SWFRect& bounds() const { return _shape.getBounds(); }
49 
51  //
56  bool pointTestLocal(std::int32_t x, std::int32_t y,
57  const SWFMatrix& wm) const;
58 
59 private:
60 
62  const RunResources& r, std::uint16_t id);
63 
65  const ShapeRecord _shape;
66 
67 };
68 
69 } // namespace SWF
70 } // namespace gnash
71 
72 
73 #endif
74 
75 
76 // Local Variables:
77 // mode: C++
78 // c-basic-offset: 8
79 // tab-width: 8
80 // indent-tabs-mode: t
81 // End:
static void loader(SWFStream &in, TagType tag, movie_definition &m, const RunResources &r)
Definition: DefineShapeTag.cpp:45
Client program&#39;s interface to the definition of a movie or sprite.
Definition: movie_definition.h:95
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:168
bool pointTestLocal(std::int32_t x, std::int32_t y, const SWFMatrix &wm) const
Check if the given point is inside this shape.
Definition: DefineShapeTag.cpp:73
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:30
void display(Renderer &renderer, const Transform &xform) const
Definition: DefineShapeTag.cpp:89
Definition: SWFMatrix.h:53
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
Immutable data representing the definition of a movie display element.
Definition: DefinitionTag.h:47
Base class for render handlers.
Definition: Renderer.h:188
Definition: GnashKey.h:164
Represents the outline of one or more shapes, along with information on fill and line styles...
Definition: DefineShapeTag.h:32
DisplayObject * createDisplayObject(Global_as &gl, DisplayObject *parent) const
Create a DisplayObject with the given parent.
Definition: DefineShapeTag.cpp:67
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
std::int32_t x
Definition: BitmapData_as.cpp:434
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:49
const SWFRect & bounds() const
Get cached bounds of this shape.
Definition: DefineShapeTag.h:48
std::int32_t y
Definition: BitmapData_as.cpp:435
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
const SWFRect & getBounds() const
Definition: ShapeRecord.h:166
Definition: GnashKey.h:159
Holds information needed to draw a shape.
Definition: ShapeRecord.h:126
Definition: GnashKey.h:331
The Transform class expresses a stage in a cumulative transformation.
Definition: Transform.h:33
SWF stream wrapper class.
Definition: SWFStream.h:58