Gnash  0.8.11dev
TypesParser.h
Go to the documentation of this file.
1 // TypesParser.h: read SWF types from a stream
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_TYPESPARSER_H
21 #define GNASH_TYPESPARSER_H
22 
23 #include <boost/optional.hpp>
24 
25 #include "SWF.h"
26 
27 namespace gnash {
28  class SWFStream;
29  class SWFMatrix;
30  class SWFRect;
31  class SWFCxForm;
32  class rgba;
33  class movie_definition;
34  class FillStyle;
35 }
36 
37 namespace gnash {
38 
40 SWFMatrix readSWFMatrix(SWFStream& in);
41 
43 rgba readRGBA(SWFStream& in);
44 
46 rgba readRGB(SWFStream& in);
47 
49 SWFRect readRect(SWFStream& in);
50 
52 typedef std::pair<FillStyle, boost::optional<FillStyle> > OptionalFillPair;
53 
55 //
58  bool readMorph);
59 
62 
65 
66 } // namespace gnash
67 
68 #endif
gnash::readSWFMatrix
SWFMatrix readSWFMatrix(SWFStream &in)
Read a SWFMatrix from input stream.
Definition: TypesParser.cpp:49
gnash::GradientFill::spreadMode
SpreadMode spreadMode
Definition: FillStyle.h:232
gnash::SWFCxForm::bb
std::int16_t bb
Definition: SWFCxForm.h:58
gnash::SWFCxForm::ba
std::int16_t ba
Definition: SWFCxForm.h:54
gnash::SWF::SpreadMode
SpreadMode
Definition: SWF.h:1537
gnash::GradientFill::RADIAL
@ RADIAL
Definition: FillStyle.h:162
gnash::SWFStream::ensureBits
void ensureBits(unsigned long needed)
Ensure the requested number of bits are available for a bitwise read in currently opened tag.
Definition: SWFStream.h:382
gnash::SWFStream::read_uint
unsigned read_uint(unsigned short bitcount)
Reads a bit-packed unsigned integer from the stream and returns it. The given bitcount determines the...
Definition: SWFStream.cpp:102
TypesParser.h
gnash::SolidFill
A SolidFill containing one color.
Definition: FillStyle.h:247
gnash::SWFStream::read_sint
int read_sint(unsigned short bitcount)
Reads a bit-packed little-endian signed integer from the stream. The given bitcount determines the nu...
Definition: SWFStream.cpp:191
gnash::log_swferror
void log_swferror(StringType msg, Args... args)
Definition: log.h:325
gnash::SWF::FILL_CLIPPED_BITMAP_HARD
@ FILL_CLIPPED_BITMAP_HARD
swf8 (alexis is wrong), non-smoothed / hard edges
Definition: SWF.h:1533
gnash::SWF::TagType
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
gnash::SWF::DEFINESHAPE
@ DEFINESHAPE
Definition: SWF.h:34
gnash::SWF::FillType
FillType
SWF fill style types. Symbolic names copied from Ming.
Definition: SWF.h:1521
gnash::key::i
@ i
Definition: GnashKey.h:155
gnash::GradientFill::REFLECT
@ REFLECT
Definition: FillStyle.h:168
gnash::rgba
A basic RGBA type.
Definition: RGBA.h:36
gnash::SWFMatrix::invert
SWFMatrix & invert()
Invert this SWFMatrix and return the result.
Definition: SWFMatrix.cpp:288
gnash::OptionalFillPair
std::pair< FillStyle, boost::optional< FillStyle > > OptionalFillPair
Either a single or a morph-pair FillStyle.
Definition: TypesParser.h:52
_
#define _(String)
Definition: log.h:44
gnash::SWF::FILL_TILED_BITMAP
@ FILL_TILED_BITMAP
Definition: SWF.h:1526
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::SWF::FILL_CLIPPED_BITMAP
@ FILL_CLIPPED_BITMAP
Definition: SWF.h:1527
gnash::key::g
@ g
Definition: GnashKey.h:153
gnash::key::m
@ m
Definition: GnashKey.h:159
gnash::SWF::FILL_FOCAL_GRADIENT
@ FILL_FOCAL_GRADIENT
Definition: SWF.h:1525
gnash::GradientFill::focalPoint
double focalPoint() const
Get the focal point of this GradientFill.
Definition: FillStyle.h:228
gnash::SWFCxForm
Color transformation record.
Definition: SWFCxForm.h:35
SWFRect.h
gnash::SWFCxForm::ab
std::int16_t ab
Definition: SWFCxForm.h:59
gnash::movie_definition
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
SWFCxForm.h
gnash::GradientFill::RGB
@ RGB
Definition: FillStyle.h:172
gnash::SWF::GRADIENT_SPREAD_REPEAT
@ GRADIENT_SPREAD_REPEAT
Definition: SWF.h:1540
IF_VERBOSE_MALFORMED_SWF
#define IF_VERBOSE_MALFORMED_SWF(x)
Definition: log.h:404
gnash::SWFRect
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:45
gnash::SWFCxForm::rb
std::int16_t rb
Definition: SWFCxForm.h:56
gnash::key::t
@ t
Definition: GnashKey.h:166
color
const VGfloat color[4]
Definition: testr_gtk.cpp:82
gnash::key::r
@ r
Definition: GnashKey.h:164
gnash::SWF::FILL_LINEAR_GRADIENT
@ FILL_LINEAR_GRADIENT
Definition: SWF.h:1523
gnash::SWF::FILL_TILED_BITMAP_HARD
@ FILL_TILED_BITMAP_HARD
swf8 (alexis is wrong), non-smoothed / hard edges
Definition: SWF.h:1530
gnash::key::a
@ a
Definition: GnashKey.h:147
gnash::SWFCxForm::gb
std::int16_t gb
Definition: SWFCxForm.h:57
gnash::GradientFill::PAD
@ PAD
Definition: FillStyle.h:166
gnash::SWF::GRADIENT_SPREAD_REFLECT
@ GRADIENT_SPREAD_REFLECT
Definition: SWF.h:1539
gnash::SWFStream::read_short_sfixed
float read_short_sfixed()
Read a 8.8 fixed point signed value.
Definition: SWFStream.cpp:235
gnash::SWF::FILL_RADIAL_GRADIENT
@ FILL_RADIAL_GRADIENT
Definition: SWF.h:1524
gnash::key::type
type
Definition: GnashKey.h:330
gnash::GradientFill
A GradientFill.
Definition: FillStyle.h:154
gnash::SWF::InterpolationMode
InterpolationMode
Definition: SWF.h:1544
gnash::GradientFill::REPEAT
@ REPEAT
Definition: FillStyle.h:167
gnash::SWF::DEFINESHAPE2
@ DEFINESHAPE2
Definition: SWF.h:54
gnash::GradientFill::setFocalPoint
void setFocalPoint(double d)
Set the focal point.
Definition: FillStyle.cpp:98
gnash::SWF::DEFINESHAPE4_
@ DEFINESHAPE4_
Definition: SWF.h:97
gnash::GradientFill::interpolation
InterpolationMode interpolation
Definition: FillStyle.h:233
RGBA.h
gnash::SWF::GRADIENT_INTERPOLATION_LINEAR
@ GRADIENT_INTERPOLATION_LINEAR
Definition: SWF.h:1546
gnash::ParserException
An SWF parsing exception.
Definition: GnashException.h:90
gnash::SWFCxForm::aa
std::int16_t aa
Definition: SWFCxForm.h:55
gnash::GradientFill::GradientRecords
std::vector< GradientRecord > GradientRecords
Definition: FillStyle.h:176
gnash::SWFMatrix
Definition: SWFMatrix.h:54
gnash::SWFCxForm::ra
std::int16_t ra
Definition: SWFCxForm.h:52
gnash::readCxFormRGBA
SWFCxForm readCxFormRGBA(SWFStream &in)
Read a CxForm with alpha from the input stream.
Definition: TypesParser.cpp:354
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::log_parse
void log_parse(StringType msg, Args... args)
Definition: log.h:313
log.h
gnash::readRGB
rgba readRGB(SWFStream &in)
Read an RGB rgba from input stream.
Definition: TypesParser.cpp:106
gnash::SWF::GRADIENT_INTERPOLATION_NORMAL
@ GRADIENT_INTERPOLATION_NORMAL
Definition: SWF.h:1545
gnash::SWF::DEFINESHAPE4
@ DEFINESHAPE4
Definition: SWF.h:110
SWF.h
gnash::GradientFill::LINEAR
@ LINEAR
Definition: FillStyle.h:161
gnash::SWFCxForm::ga
std::int16_t ga
Definition: SWFCxForm.h:53
gnash::SWF::DEFINESHAPE3
@ DEFINESHAPE3
Definition: SWF.h:62
gnash::readCxFormRGB
SWFCxForm readCxFormRGB(SWFStream &in)
Read a RGB CxForm from the input stream.
Definition: TypesParser.cpp:322
gnash::SWFStream::read_u8
std::uint8_t read_u8()
Read a aligned unsigned 8-bit value from the stream.
Definition: SWFStream.cpp:319
gnash::SWFStream::read_bit
bool read_bit()
Reads a single bit off the stream and returns it.
Definition: SWFStream.cpp:88
movie_definition.h
gnash::GradientFill::setRecords
void setRecords(const GradientRecords &recs)
Definition: FillStyle.h:198
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::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
GnashException.h
SWFStream.h
gnash::key::b
@ b
Definition: GnashKey.h:148
gnash::SWF::FILL_SOLID
@ FILL_SOLID
Definition: SWF.h:1522
gnash::GradientFill::LINEAR_RGB
@ LINEAR_RGB
Definition: FillStyle.h:173
SWFMatrix.h
gnash::SWF::GRADIENT_SPREAD_PAD
@ GRADIENT_SPREAD_PAD
Definition: SWF.h:1538
gnash::readRGBA
rgba readRGBA(SWFStream &in)
Read an RGBA rgba from input stream.
Definition: TypesParser.cpp:95
gnash::GradientFill::Type
Type
The type of GradientFill.
Definition: FillStyle.h:160