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:
TypesParser.h
MorphShape.h
ShapeRecord.h
gnash::SWF::ShapeRecord::read
void read(SWFStream &in, SWF::TagType tag, movie_definition &m, const RunResources &r)
Parse path data from a SWFStream.
Definition: ShapeRecord.cpp:225
gnash::SWF::TagType
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
gnash::SWF::DefinitionTag
Immutable data representing the definition of a movie display element.
Definition: DefinitionTag.h:48
gnash::key::i
@ i
Definition: GnashKey.h:155
DefineMorphShapeTag.h
gnash::SWF::Subshape::addFillStyle
void addFillStyle(const FillStyle &fs)
Definition: ShapeRecord.cpp:96
gnash::OptionalFillPair
std::pair< FillStyle, boost::optional< FillStyle > > OptionalFillPair
Either a single or a morph-pair FillStyle.
Definition: TypesParser.h:52
gnash::SWF::DefineMorphShapeTag
DefineMorphShape tag.
Definition: DefineMorphShapeTag.h:46
Renderer.h
gnash::SWF::ShapeRecord::subshapes
const Subshapes & subshapes() const
Definition: ShapeRecord.h:158
gnash::SWFStream::read_variable_count
unsigned read_variable_count()
Read a length in a byte or three.
Definition: SWFStream.h:244
Transform.h
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::movie_definition::addDisplayObject
virtual void addDisplayObject(std::uint16_t, DefinitionTag *)
Add a DefinitionTag with given ID to the CharactersDictionary.
Definition: movie_definition.h:233
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::SWF::DefineMorphShapeTag::~DefineMorphShapeTag
virtual ~DefineMorphShapeTag()
Definition: DefineMorphShapeTag.h:52
gnash::key::m
@ m
Definition: GnashKey.h:159
gnash::SWF::DEFINEMORPHSHAPE2
@ DEFINEMORPHSHAPE2
Definition: SWF.h:111
Global_as.h
gnash::SWF::Subshape
Definition: ShapeRecord.h:41
UNUSED
#define UNUSED(x)
Definition: utility.h:113
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::DEFINEMORPHSHAPE
@ DEFINEMORPHSHAPE
Definition: SWF.h:76
gnash::SWF::DefineMorphShapeTag::shape2
const ShapeRecord & shape2() const
Definition: DefineMorphShapeTag.h:64
gnash::SWFStream::read_u32
std::uint32_t read_u32()
Read a aligned unsigned 32-bit value from the stream.
Definition: SWFStream.cpp:361
gnash::SWF::ShapeRecord::addSubshape
void addSubshape(const Subshape &subshape)
Definition: ShapeRecord.h:162
MovieClip.h
GnashNumeric.h
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::SWF::DefineMorphShapeTag::shape1
const ShapeRecord & shape1() const
Definition: DefineMorphShapeTag.h:60
IF_VERBOSE_PARSE
#define IF_VERBOSE_PARSE(x)
Definition: log.h:378
gnash::readFills
OptionalFillPair readFills(SWFStream &in, SWF::TagType t, movie_definition &md, bool readMorph)
Read FillStyles from a stream.
Definition: TypesParser.cpp:161
gnash::SWF::DefineMorphShapeTag::createDisplayObject
virtual DisplayObject * createDisplayObject(Global_as &gl, DisplayObject *parent) const
Create a DisplayObject with the given parent.
Definition: DefineMorphShapeTag.cpp:69
gnash::log_parse
void log_parse(StringType msg, Args... args)
Definition: log.h:313
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
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::DefineMorphShapeTag::display
void display(Renderer &renderer, const ShapeRecord &shape, const Transform &base) const
Definition: DefineMorphShapeTag.cpp:76
gnash::SWFStream::read_u8
std::uint8_t read_u8()
Read a aligned unsigned 8-bit value from the stream.
Definition: SWFStream.cpp:319
gnash::SWF::DefineMorphShapeTag::loader
static void loader(SWFStream &in, TagType tag, movie_definition &m, const RunResources &r)
Definition: DefineMorphShapeTag.cpp:46
movie_definition.h
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::MorphShape
A DisplayObject that tweens between two shapes.
Definition: MorphShape.h:49
gnash::SWFStream
SWF stream wrapper class.
Definition: SWFStream.h:59
FillStyle.h
gnash::readRect
SWFRect readRect(SWFStream &in)
Read a bit-packed rectangle from an SWF stream.
Definition: TypesParser.cpp:130
gnash::SWFStream::align
void align()
Consume all bits of current byte.
Definition: SWFStream.h:135
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
gnash::SWF::Subshape::addLineStyle
void addLineStyle(const LineStyle &ls)
Definition: ShapeRecord.h:86
SWFStream.h
gnash::SWF::ShapeRecord::setBounds
void setBounds(const SWFRect &bounds)
Definition: ShapeRecord.h:179
gnash::SWF::DEFINEMORPHSHAPE2_
@ DEFINEMORPHSHAPE2_
Definition: SWF.h:98