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:
gnash::SWF::ShapeRecord::pointTest
bool pointTest(std::int32_t x, std::int32_t y, const SWFMatrix &wm) const
Definition: ShapeRecord.h:183
Shape.h
gnash::Shape
For DisplayObjects that don't store unusual state in their instances.
Definition: Shape.h:38
gnash::SWF::DefineShapeTag::bounds
const SWFRect & bounds() const
Get cached bounds of this shape.
Definition: DefineShapeTag.h:48
ShapeRecord.h
gnash::SWF::TagType
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
gnash::SWF::DefineShapeTag::createDisplayObject
DisplayObject * createDisplayObject(Global_as &gl, DisplayObject *parent) const
Create a DisplayObject with the given parent.
Definition: DefineShapeTag.cpp:67
gnash::SWF::DEFINESHAPE
@ DEFINESHAPE
Definition: SWF.h:34
gnash::SWF::DefinitionTag
Immutable data representing the definition of a movie display element.
Definition: DefinitionTag.h:48
y
std::int32_t y
Definition: BitmapData_as.cpp:435
_
#define _(String)
Definition: log.h:44
Renderer.h
Transform.h
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::SWF::ShapeRecord::getBounds
const SWFRect & getBounds() const
Definition: ShapeRecord.h:166
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::key::m
@ m
Definition: GnashKey.h:159
Global_as.h
gnash::movie_definition
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
gnash::SWFRect
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
gnash::key::r
@ r
Definition: GnashKey.h:164
gnash::SWF::DefineShapeTag::pointTestLocal
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
gnash::SWF::DefineShapeTag::loader
static void loader(SWFStream &in, TagType tag, movie_definition &m, const RunResources &r)
Definition: DefineShapeTag.cpp:45
gnash::SWF::DEFINESHAPE2
@ DEFINESHAPE2
Definition: SWF.h:54
gnash::SWF::DEFINESHAPE4_
@ DEFINESHAPE4_
Definition: SWF.h:97
MovieClip.h
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::SWFMatrix
Definition: SWFMatrix.h:54
DefineShapeTag.h
IF_VERBOSE_PARSE
#define IF_VERBOSE_PARSE(x)
Definition: log.h:378
gnash::log_parse
void log_parse(StringType msg, Args... args)
Definition: log.h:313
log.h
gnash::getRoot
movie_root & getRoot(const as_environment &env)
Definition: as_environment.cpp:645
gnash::Renderer::drawShape
virtual void drawShape(const SWF::ShapeRecord &shape, const Transform &xform)=0
DefinitionTag.h
gnash::SWF::DEFINESHAPE4
@ DEFINESHAPE4
Definition: SWF.h:110
SWF.h
gnash::Global_as
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:50
gnash::SWFStream::read_u16
std::uint16_t read_u16()
Read a aligned unsigned 16-bit value from the stream.
Definition: SWFStream.cpp:332
RunResources.h
gnash::SWF::DEFINESHAPE3
@ DEFINESHAPE3
Definition: SWF.h:62
gnash::SWF::DefineShapeTag::display
void display(Renderer &renderer, const Transform &xform) const
Definition: DefineShapeTag.cpp:89
gnash::DisplayObject
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
gnash::SWF::ShapeRecord
Holds information needed to draw a shape.
Definition: ShapeRecord.h:127
gnash::SWFStream
SWF stream wrapper class.
Definition: SWFStream.h:59
gnash::Transform
The Transform class expresses a stage in a cumulative transformation.
Definition: Transform.h:34
gnash::SWFStream::ensureBytes
void ensureBytes(unsigned long needed)
Ensure the requested number of bytes are available for an aligned read in the currently opened tag.
Definition: SWFStream.cpp:50
gnash::key::SWF
@ SWF
Definition: GnashKey.h:331
x
std::int32_t x
Definition: BitmapData_as.cpp:434
SWFStream.h
gnash::SWF::DefineShapeTag
Represents the outline of one or more shapes, along with information on fill and line styles.
Definition: DefineShapeTag.h:33