Gnash  0.8.11dev
Public Member Functions | List of all members
gnash::sprite_definition Class Reference

Holds the immutable data for a sprite, as read from as SWF stream. @ should not derive from movie_definition, probably! More...

#include <sprite_definition.h>

Inheritance diagram for gnash::sprite_definition:
gnash::movie_definition gnash::SWF::DefinitionTag gnash::SWF::ControlTag gnash::ref_counted

Public Member Functions

 sprite_definition (movie_definition &m, SWFStream &in, const RunResources &runResources, std::uint16_t id)
 Read the sprite info from input stream. More...
 
 ~sprite_definition ()
 Destructor, releases playlist data. More...
 
virtual void incrementLoadedFrames ()
 
virtual size_t get_width_pixels () const
 Frame width in pixels. More...
 
virtual size_t get_height_pixels () const
 Frame height in pixels. More...
 
virtual size_t get_frame_count () const
 
virtual size_t get_bytes_total () const
 Return total bytes of the movie from which this sprite has been read. More...
 
virtual size_t get_bytes_loaded () const
 Return the number of bytes loaded from the stream of the the movie from which this sprite is being read. More...
 
virtual float get_frame_rate () const
 
const SWFRectget_frame_size () const
 Return size of frame, in TWIPS. More...
 
virtual size_t get_loading_frame () const
 Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded. More...
 
virtual int get_version () const
 
virtual void add_font (int, boost::intrusive_ptr< Font >)
 Overridden just for complaining about malformed SWF. More...
 
virtual Fontget_font (int id) const
 Delegate call to associated root movie. More...
 
virtual CachedBitmapgetBitmap (int id) const
 Delegate call to associated root movie. More...
 
virtual void addBitmap (int, boost::intrusive_ptr< CachedBitmap >)
 Overridden just for complaining about malformed SWF. More...
 
virtual sound_sampleget_sound_sample (int id) const
 Delegate call to associated root movie. More...
 
virtual void add_sound_sample (int id, sound_sample *sam)
 Overridden just for complaining about malformed SWF. More...
 
virtual void set_loading_sound_stream_id (int id)
 Set the currently being loaded sound stream. More...
 
virtual int get_loading_sound_stream_id () const
 Get the currently being loaded sound stream, if any. More...
 
virtual std::uint16_t exportID (const std::string &symbol) const
 Get the id that corresponds to a symbol. More...
 
virtual void registerExport (const std::string &s, std::uint16_t id)
 Register a symbol to refer to a character id. More...
 
virtual SWF::DefinitionTaggetDefinitionTag (std::uint16_t id) const
 Get a SWF::DefinitionTag from this Sprite's root movie CharacterDictionary. More...
 
virtual void addDisplayObject (std::uint16_t id, SWF::DefinitionTag *c)
 Delegate call to associated root movie. More...
 
virtual DisplayObjectcreateDisplayObject (Global_as &gl, DisplayObject *parent) const
 Create a DisplayObject with the given parent. More...
 
virtual void addControlTag (boost::intrusive_ptr< SWF::ControlTag > c)
 Add an ControlTag to this movie_definition's playlist. More...
 
- Public Member Functions inherited from gnash::movie_definition
virtual MoviecreateMovie (Global_as &, DisplayObject *=nullptr)
 Create a movie instance from a def. More...
 
virtual void importResources (boost::intrusive_ptr< movie_definition >, const Imports &)
 Import resources. More...
 
virtual void addDisplayObject (std::uint16_t, DefinitionTag *)
 Add a DefinitionTag with given ID to the CharactersDictionary. More...
 
virtual Fontget_font (const std::string &, bool, bool) const
 Find a font from the movie (not shared) lib. More...
 
virtual void set_jpeg_loader (std::unique_ptr< image::JpegInput >)
 
virtual image::JpegInputget_jpeg_loader () const
 Get the jpeg input loader, to load a DefineBits image (one without table info). More...
 
virtual void setAS3 ()
 Set whether the SWFMovie should use AVM2 or AVM1. More...
 
virtual bool isAS3 () const
 True if the SWFMovie should use AVM2. More...
 
virtual bool completeLoad ()
 
- Public Member Functions inherited from gnash::SWF::DefinitionTag
virtual ~DefinitionTag ()
 
virtual DSOTEXPORT void executeState (MovieClip *m, DisplayList &) const
 Executing a DefinitionTag adds its id to list of known characters. More...
 
std::uint16_t id () const
 The immutable id of the DefinitionTag. More...
 
- Public Member Functions inherited from gnash::SWF::ControlTag
virtual ~ControlTag ()
 
virtual void executeActions (MovieClip *, DisplayList &) const
 Execute Action tags. More...
 
- Public Member Functions inherited from gnash::ref_counted
 ref_counted ()
 
 ref_counted (const ref_counted &)
 
void add_ref () const
 
void drop_ref () const
 
long get_ref_count () const
 

Additional Inherited Members

- Public Types inherited from gnash::movie_definition
typedef std::vector< boost::intrusive_ptr< SWF::ControlTag > > PlayList
 
typedef std::pair< int, std::string > ImportSpec
 
typedef std::vector< ImportSpecImports
 
- Public Types inherited from gnash::SWF::ControlTag
enum  Type { TAG_ACTION = 1 << 0, TAG_DLIST = 1 << 1 }
 Type of ControlTag. More...
 
- Protected Member Functions inherited from gnash::movie_definition
 movie_definition (std::uint16_t id=0)
 
virtual ~movie_definition ()
 
- Protected Member Functions inherited from gnash::SWF::DefinitionTag
 DefinitionTag (std::uint16_t id)
 
- Protected Member Functions inherited from gnash::ref_counted
virtual ~ref_counted ()
 

Detailed Description

Holds the immutable data for a sprite, as read from as SWF stream. @ should not derive from movie_definition, probably!

Constructor & Destructor Documentation

§ sprite_definition()

gnash::sprite_definition::sprite_definition ( movie_definition m,
SWFStream in,
const RunResources runResources,
std::uint16_t  id 
)

Read the sprite info from input stream.

A sprite definition consists of a series control tags.

Parameters
mthe Top-Level movie_definition this sprite is read from (not a sprite_definition!)
inThe stream associated with the sprite. It is assumed to be already positioned right before the frame count

§ ~sprite_definition()

gnash::sprite_definition::~sprite_definition ( )

Member Function Documentation

§ add_font()

virtual void gnash::sprite_definition::add_font ( int  ,
boost::intrusive_ptr< Font  
)
inlinevirtual

Overridden just for complaining about malformed SWF.

Reimplemented from gnash::movie_definition.

References _, IF_VERBOSE_MALFORMED_SWF, and gnash::log_swferror().

§ add_sound_sample()

virtual void gnash::sprite_definition::add_sound_sample ( int  id,
sound_sample sam 
)
inlinevirtual

Overridden just for complaining about malformed SWF.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::add_sound_sample().

§ addBitmap()

virtual void gnash::sprite_definition::addBitmap ( int  ,
boost::intrusive_ptr< CachedBitmap  
)
inlinevirtual

Overridden just for complaining about malformed SWF.

Reimplemented from gnash::movie_definition.

References _, IF_VERBOSE_MALFORMED_SWF, and gnash::log_swferror().

§ addControlTag()

virtual void gnash::sprite_definition::addControlTag ( boost::intrusive_ptr< SWF::ControlTag )
inlinevirtual

Add an ControlTag to this movie_definition's playlist.

The default implementation is a no-op.

Parameters
tagThe tag to add in the list of executable tags for the frame currently being loaded. Ownership is transferred to the SWFMovieDefinition.

Reimplemented from gnash::movie_definition.

References _, gnash::movie_definition::get_url(), gnash::log_debug(), and name.

Referenced by gnash::SWF::SymbolClassTag::loader().

§ addDisplayObject()

virtual void gnash::sprite_definition::addDisplayObject ( std::uint16_t  id,
SWF::DefinitionTag c 
)
inlinevirtual

Delegate call to associated root movie.

References gnash::movie_definition::addDisplayObject(), and createDisplayObject().

§ createDisplayObject()

DisplayObject * gnash::sprite_definition::createDisplayObject ( Global_as gl,
DisplayObject parent 
) const
virtual

Create a DisplayObject with the given parent.

This function will determine the correct prototype and associated object using the passed global.

Parameters
glThe global object used to set prototype and associated object. Calling this function creates a new DisplayObject from the DefinitionTag and adds it as a child of the specified parent DisplayObject.

Implements gnash::SWF::DefinitionTag.

References gnash::NSV::CLASS_MOVIE_CLIP, gnash::DisplayObject::get_root(), and gnash::getObjectWithPrototype().

Referenced by addDisplayObject().

§ exportID()

virtual std::uint16_t gnash::sprite_definition::exportID ( const std::string &  ) const
inlinevirtual

Get the id that corresponds to a symbol.

Returns
The id corresponding to the passed symbol. The default implementation returns 0, as it has no export table.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::exportID().

§ get_bytes_loaded()

virtual size_t gnash::sprite_definition::get_bytes_loaded ( ) const
inlinevirtual

Return the number of bytes loaded from the stream of the the movie from which this sprite is being read.

Implements gnash::movie_definition.

References gnash::movie_definition::get_bytes_loaded().

§ get_bytes_total()

virtual size_t gnash::sprite_definition::get_bytes_total ( ) const
inlinevirtual

Return total bytes of the movie from which this sprite has been read.

Implements gnash::movie_definition.

References gnash::movie_definition::get_bytes_total().

§ get_font()

virtual Font* gnash::sprite_definition::get_font ( int  id) const
inlinevirtual

Delegate call to associated root movie.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::get_font().

§ get_frame_count()

virtual size_t gnash::sprite_definition::get_frame_count ( ) const
inlinevirtual

§ get_frame_rate()

virtual float gnash::sprite_definition::get_frame_rate ( ) const
inlinevirtual

§ get_frame_size()

const SWFRect& gnash::sprite_definition::get_frame_size ( ) const
inlinevirtual

Return size of frame, in TWIPS.

Implements gnash::movie_definition.

§ get_height_pixels()

virtual size_t gnash::sprite_definition::get_height_pixels ( ) const
inlinevirtual

Frame height in pixels.

The frame size is in twips and may be rounded up.

Implements gnash::movie_definition.

§ get_loading_frame()

virtual size_t gnash::sprite_definition::get_loading_frame ( ) const
inlinevirtual

Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded.

Implements gnash::movie_definition.

§ get_loading_sound_stream_id()

virtual int gnash::sprite_definition::get_loading_sound_stream_id ( ) const
inlinevirtual

Get the currently being loaded sound stream, if any.

See also
set_loading_sound_stream_id

The default implementation returns -1

Returns
-1 if no sound stream is being currently loading

Reimplemented from gnash::movie_definition.

§ get_sound_sample()

virtual sound_sample* gnash::sprite_definition::get_sound_sample ( int  id) const
inlinevirtual

Delegate call to associated root movie.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::get_sound_sample().

§ get_version()

virtual int gnash::sprite_definition::get_version ( ) const
inlinevirtual

§ get_width_pixels()

virtual size_t gnash::sprite_definition::get_width_pixels ( ) const
inlinevirtual

Frame width in pixels.

The frame size is in twips and may be rounded up.

Implements gnash::movie_definition.

§ getBitmap()

virtual CachedBitmap* gnash::sprite_definition::getBitmap ( int  id) const
inlinevirtual

Delegate call to associated root movie.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::getBitmap().

§ getDefinitionTag()

virtual SWF::DefinitionTag* gnash::sprite_definition::getDefinitionTag ( std::uint16_t  id) const
inlinevirtual

Get a SWF::DefinitionTag from this Sprite's root movie CharacterDictionary.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::getDefinitionTag().

§ incrementLoadedFrames()

virtual void gnash::sprite_definition::incrementLoadedFrames ( )
inlinevirtual

Reimplemented from gnash::movie_definition.

§ registerExport()

virtual void gnash::sprite_definition::registerExport ( const std::string &  ,
std::uint16_t   
)
inlinevirtual

Register a symbol to refer to a character id.

The default implementation does nothing.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::registerExport().

§ set_loading_sound_stream_id()

virtual void gnash::sprite_definition::set_loading_sound_stream_id ( int  )
inlinevirtual

Set the currently being loaded sound stream.

The default implementation is a no-op

Reimplemented from gnash::movie_definition.

References gnash::SWF::DefinitionTag::id().


The documentation for this class was generated from the following files: