Public Member Functions | Protected Member Functions

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:
Inheritance graph
[legend]
Collaboration diagram for gnash::sprite_definition:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 sprite_definition (movie_definition &m, SWFStream &in, const RunResources &runResources, boost::uint16_t id)
 Read the sprite info from input stream.
 ~sprite_definition ()
 Destructor, releases playlist data.
void registerClass (as_function *the_class)
 Register a class to this definition.
as_functiongetRegisteredClass () const
 Get the Class registered to this definition.
virtual void incrementLoadedFrames ()
virtual size_t get_width_pixels () const
 Frame width in pixels.
virtual size_t get_height_pixels () const
 Frame height in pixels.
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.
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.
virtual float get_frame_rate () const
const SWFRectget_frame_size () const
 Return size of frame, in TWIPS.
virtual size_t get_loading_frame () const
 Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded.
virtual int get_version () const
virtual void add_font (int, Font *)
 Overridden just for complaining about malformed SWF.
virtual Fontget_font (int id) const
 Delegate call to associated root movie.
virtual CachedBitmapgetBitmap (int id) const
 Delegate call to associated root movie.
virtual void addBitmap (int, boost::intrusive_ptr< CachedBitmap >)
 Overridden just for complaining about malformed SWF.
virtual sound_sampleget_sound_sample (int id) const
 Delegate call to associated root movie.
virtual void add_sound_sample (int id, sound_sample *sam)
 Overridden just for complaining about malformed SWF.
virtual void set_loading_sound_stream_id (int id)
 Set the currently being loaded sound stream.
virtual int get_loading_sound_stream_id () const
 Get the currently being loaded sound stream, if any.
virtual boost::uint16_t exportID (const std::string &symbol) const
 Get the id that corresponds to a symbol.
virtual void registerExport (const std::string &s, boost::uint16_t id)
 Register a symbol to refer to a character id.
virtual SWF::DefinitionTaggetDefinitionTag (boost::uint16_t id) const
 Get a SWF::DefinitionTag from this Sprite's root movie CharacterDictionary.
virtual void addDisplayObject (boost::uint16_t id, SWF::DefinitionTag *c)
 Delegate call to associated root movie.
virtual DisplayObjectcreateDisplayObject (Global_as &gl, DisplayObject *parent) const
 Create a DisplayObject with the given parent.
virtual void addControlTag (SWF::ControlTag *c)
 Add an ControlTag to this movie_definition's playlist.

Protected Member Functions

void markReachableResources () const
 Mark reachable resources of a sprite_definition.

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

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

Read the sprite info from input stream.

A sprite definition consists of a series control tags.

Parameters:
m the Top-Level movie_definition this sprite is read from (not a sprite_definition!)
in The stream associated with the sprite. It is assumed to be already positioned right before the frame count
gnash::sprite_definition::~sprite_definition (  ) 

Destructor, releases playlist data.


Member Function Documentation

virtual void gnash::sprite_definition::add_font ( int  ,
Font  
) [inline, virtual]

Overridden just for complaining about malformed SWF.

Reimplemented from gnash::movie_definition.

References _, and IF_VERBOSE_MALFORMED_SWF.

virtual void gnash::sprite_definition::add_sound_sample ( int  id,
sound_sample sam 
) [inline, virtual]

Overridden just for complaining about malformed SWF.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::add_sound_sample().

virtual void gnash::sprite_definition::addBitmap ( int  ,
boost::intrusive_ptr< CachedBitmap  
) [inline, virtual]

Overridden just for complaining about malformed SWF.

Reimplemented from gnash::movie_definition.

References _, and IF_VERBOSE_MALFORMED_SWF.

virtual void gnash::sprite_definition::addControlTag ( SWF::ControlTag  )  [inline, virtual]

Add an ControlTag to this movie_definition's playlist.

The default implementation is a no-op.

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

TODO: take an auto_ptr. NOTE: the default implementation just let the ControlTag leak.

Reimplemented from gnash::movie_definition.

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

virtual void gnash::sprite_definition::addDisplayObject ( boost::uint16_t  id,
SWF::DefinitionTag c 
) [inline, virtual]

Delegate call to associated root movie.

References gnash::movie_definition::addDisplayObject().

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:
gl The 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.

virtual boost::uint16_t gnash::sprite_definition::exportID ( const std::string &   )  const [inline, virtual]

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().

virtual size_t gnash::sprite_definition::get_bytes_loaded (  )  const [inline, virtual]

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().

virtual size_t gnash::sprite_definition::get_bytes_total (  )  const [inline, virtual]

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

Implements gnash::movie_definition.

References gnash::movie_definition::get_bytes_total().

virtual Font* gnash::sprite_definition::get_font ( int  id  )  const [inline, virtual]

Delegate call to associated root movie.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::get_font().

virtual size_t gnash::sprite_definition::get_frame_count (  )  const [inline, virtual]
virtual float gnash::sprite_definition::get_frame_rate (  )  const [inline, virtual]
const SWFRect& gnash::sprite_definition::get_frame_size (  )  const [inline, virtual]

Return size of frame, in TWIPS.

Implements gnash::movie_definition.

virtual size_t gnash::sprite_definition::get_height_pixels (  )  const [inline, virtual]

Frame height in pixels.

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

Implements gnash::movie_definition.

virtual size_t gnash::sprite_definition::get_loading_frame (  )  const [inline, virtual]

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

Implements gnash::movie_definition.

virtual int gnash::sprite_definition::get_loading_sound_stream_id (  )  const [inline, virtual]

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.

virtual sound_sample* gnash::sprite_definition::get_sound_sample ( int  id  )  const [inline, virtual]

Delegate call to associated root movie.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::get_sound_sample().

virtual int gnash::sprite_definition::get_version (  )  const [inline, virtual]
virtual size_t gnash::sprite_definition::get_width_pixels (  )  const [inline, virtual]

Frame width in pixels.

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

Implements gnash::movie_definition.

virtual CachedBitmap* gnash::sprite_definition::getBitmap ( int  id  )  const [inline, virtual]

Delegate call to associated root movie.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::getBitmap().

virtual SWF::DefinitionTag* gnash::sprite_definition::getDefinitionTag ( boost::uint16_t  id  )  const [inline, virtual]

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

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::getDefinitionTag().

as_function* gnash::sprite_definition::getRegisteredClass (  )  const [inline]

Get the Class registered to this definition.

virtual void gnash::sprite_definition::incrementLoadedFrames (  )  [inline, virtual]

Reimplemented from gnash::movie_definition.

void gnash::sprite_definition::markReachableResources (  )  const [protected]

Mark reachable resources of a sprite_definition.

Reachable resources are:

  • registered class (registeredClass)
void gnash::sprite_definition::registerClass ( as_function the_class  ) 

Register a class to this definition.

New instances of this symbol will get the given class interface.

Parameters:
the_class The class constructor to associate with new instances of this DisplayObject. If NULL new instances will get the MovieClip interface.
virtual void gnash::sprite_definition::registerExport ( const std::string &  ,
boost::uint16_t   
) [inline, virtual]

Register a symbol to refer to a character id.

The default implementation does nothing.

Reimplemented from gnash::movie_definition.

References gnash::movie_definition::registerExport().

virtual void gnash::sprite_definition::set_loading_sound_stream_id ( int   )  [inline, virtual]

Set the currently being loaded sound stream.

The default implementation is a no-op

Reimplemented from gnash::movie_definition.


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