Gnash  0.8.11dev
DefineMorphShapeTag.h
Go to the documentation of this file.
1 // DefineMorphShapeTag.h: Load and parse morphing shapes, for Gnash.
2 //
3 // Copyright (C) 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 // Based on the public domain work of Mike Shaver <shaver@off.net> 2003,
21 // Vitalij Alexeev <tishka92@mail.ru> 2004.
22 
23 #ifndef GNASH_SWF_MORPH_SHAPE_H
24 #define GNASH_SWF_MORPH_SHAPE_H
25 
26 #include "SWF.h"
27 #include "ShapeRecord.h"
28 #include "DefinitionTag.h"
29 
30 // Forward declarations.
31 namespace gnash {
32  class movie_definition;
33  class SWFStream;
34  class RunResources;
35  class MorphShape;
36  class Renderer;
37  class Transform;
38 }
39 
40 namespace gnash {
41 namespace SWF {
42 
44 //
46 {
47 public:
48 
49  static void loader(SWFStream& in, TagType tag, movie_definition& m,
50  const RunResources& r);
51 
52  virtual ~DefineMorphShapeTag() {}
53 
55  DisplayObject* parent) const;
56 
57  void display(Renderer& renderer, const ShapeRecord& shape,
58  const Transform& base) const;
59 
60  const ShapeRecord& shape1() const {
61  return _shape1;
62  }
63 
64  const ShapeRecord& shape2() const {
65  return _shape2;
66  }
67 
68 private:
69 
71  const RunResources& r, std::uint16_t id);
72 
74  //
90  void read(SWFStream& in, SWF::TagType tag, movie_definition& m,
91  const RunResources& r);
92 
93  ShapeRecord _shape1;
94  ShapeRecord _shape2;
95 
96  SWFRect _bounds;
97 
98 };
99 
100 } // namespace SWF
101 } // namespace gnash
102 
103 
104 #endif
105 
106 // Local Variables:
107 // mode: C++
108 // c-basic-offset: 8
109 // tab-width: 8
110 // indent-tabs-mode: t
111 // End:
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
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:30
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
virtual ~DefineMorphShapeTag()
Definition: DefineMorphShapeTag.h:52
const ShapeRecord & shape2() const
Definition: DefineMorphShapeTag.h:64
Base class for render handlers.
Definition: Renderer.h:188
Definition: GnashKey.h:164
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:49
const ShapeRecord & shape1() const
Definition: DefineMorphShapeTag.h:60
static void loader(SWFStream &in, TagType tag, movie_definition &m, const RunResources &r)
Definition: DefineMorphShapeTag.cpp:46
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
virtual DisplayObject * createDisplayObject(Global_as &gl, DisplayObject *parent) const
Create a DisplayObject with the given parent.
Definition: DefineMorphShapeTag.cpp:69
Definition: GnashKey.h:159
void display(Renderer &renderer, const ShapeRecord &shape, const Transform &base) const
Definition: DefineMorphShapeTag.cpp:76
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
DefineMorphShape tag.
Definition: DefineMorphShapeTag.h:45
SWF stream wrapper class.
Definition: SWFStream.h:58