21 #ifndef GNASH_SPRITE_DEFINITION_H 22 #define GNASH_SPRITE_DEFINITION_H 24 #include <boost/intrusive_ptr.hpp> 125 virtual void add_font(
int , boost::intrusive_ptr<Font> )
145 virtual void addBitmap(
int , boost::intrusive_ptr<CachedBitmap> )
148 log_swferror(
_(
"add_bitmap_SWF::DefinitionTag appears in sprite tags"));
170 _loadingSoundStream =
id;
176 return _loadingSoundStream;
179 virtual std::uint16_t
exportID(
const std::string& symbol)
const {
180 return m_movie_def.
exportID(symbol);
213 m_playlist[m_loading_frame].push_back(c);
224 typedef std::map<size_t, PlayList> PlayListMap;
227 PlayListMap m_playlist;
230 typedef std::map<std::string, size_t, StringNoCaseLessThan> NamedFrameMap;
231 NamedFrameMap _namedFrames;
233 size_t m_frame_count;
236 size_t m_loading_frame;
239 virtual void add_frame_name(
const std::string&
name);
242 bool get_labeled_frame(
const std::string& label,
size_t& frame_number)
246 const PlayList* getPlaylist(
size_t frame_number)
const 252 PlayListMap::const_iterator it = m_playlist.find(frame_number);
253 if ( it == m_playlist.end() )
return nullptr;
254 else return &(it->second);
257 virtual const std::string& get_url()
const 266 virtual bool ensure_frame_loaded(
size_t framenum)
const 269 while ( m_loading_frame < framenum )
272 "loading of frame %d requested " 273 "(we are at %d/%d)"),
274 framenum, m_loading_frame, m_frame_count);
281 int _loadingSoundStream;
virtual Font * get_font(int) const
Return the font with given DisplayObject id.
Definition: movie_definition.h:253
virtual void registerExport(const std::string &, std::uint16_t)
Register a symbol to refer to a character id.
Definition: movie_definition.h:390
virtual CachedBitmap * getBitmap(int) const
Get a bitmap from the bitmap dictionary.
Definition: movie_definition.h:329
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 re...
Definition: sprite_definition.h:99
Client program'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
A Font resource.
Definition: Font.h:89
virtual void addDisplayObject(std::uint16_t id, SWF::DefinitionTag *c)
Delegate call to associated root movie.
Definition: sprite_definition.h:197
virtual void add_sound_sample(int, sound_sample *)
Add a sound sample DisplayObject in the dictionary, with the specified DisplayObject id...
Definition: movie_definition.h:362
Holds the immutable data for a sprite, as read from as SWF stream. @ should not derive from movie_def...
Definition: sprite_definition.h:49
virtual int get_loading_sound_stream_id() const
Get the currently being loaded sound stream, if any.
Definition: sprite_definition.h:174
~sprite_definition()
Destructor, releases playlist data.
Definition: sprite_definition.cpp:49
virtual const std::string & get_url() const =0
Return the URL of the SWF stream this definition has been read from.
virtual sound_sample * get_sound_sample(int id) const
Delegate call to associated root movie.
Definition: sprite_definition.h:153
virtual Font * get_font(int id) const
Delegate call to associated root movie.
Definition: sprite_definition.h:133
virtual int get_version() const =0
virtual size_t get_loading_frame() const
Returns 1 based index. Ex: if 1 then 1st frame as been fully loaded.
Definition: sprite_definition.h:117
virtual size_t get_height_pixels() const
Frame height in pixels.
Definition: sprite_definition.h:81
virtual size_t get_bytes_total() const =0
Get total number of bytes in (uncompressed for SWF) input stream.
virtual void set_loading_sound_stream_id(int id)
Set the currently being loaded sound stream.
Definition: sprite_definition.h:168
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 float get_frame_rate() const
Definition: sprite_definition.h:104
virtual void add_sound_sample(int id, sound_sample *sam)
Overridden just for complaining about malformed SWF.
Definition: sprite_definition.h:159
virtual CachedBitmap * getBitmap(int id) const
Delegate call to associated root movie.
Definition: sprite_definition.h:139
virtual SWF::DefinitionTag * getDefinitionTag(std::uint16_t id) const
Get a SWF::DefinitionTag from this Sprite's root movie CharacterDictionary.
Definition: sprite_definition.h:191
#define IF_VERBOSE_MALFORMED_SWF(x)
Definition: log.h:404
Definition: GnashKey.h:149
virtual int get_version() const
Definition: sprite_definition.h:119
virtual void addControlTag(boost::intrusive_ptr< SWF::ControlTag > c)
Add an ControlTag to this movie_definition's playlist.
Definition: sprite_definition.h:211
virtual float get_frame_rate() const =0
virtual void addDisplayObject(std::uint16_t, DefinitionTag *)
Add a DefinitionTag with given ID to the CharactersDictionary.
Definition: movie_definition.h:233
virtual std::uint16_t exportID(const std::string &) const
Get the id that corresponds to a symbol.
Definition: movie_definition.h:396
virtual DefinitionTag * getDefinitionTag(std::uint16_t) const
Get a DisplayObject from the dictionary.
Definition: movie_definition.h:196
const SWFRect & get_frame_size() const
Return size of frame, in TWIPS.
Definition: sprite_definition.h:109
#define _(String)
Definition: log.h:44
std::uint16_t id() const
The immutable id of the DefinitionTag.
Definition: DefinitionTag.h:76
virtual size_t get_width_pixels() const
Frame width in pixels.
Definition: sprite_definition.h:78
sprite_definition(movie_definition &m, SWFStream &in, const RunResources &runResources, std::uint16_t id)
Read the sprite info from input stream.
Definition: sprite_definition.cpp:110
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
std::vector< boost::intrusive_ptr< SWF::ControlTag > > PlayList
Definition: movie_definition.h:98
virtual void incrementLoadedFrames()
Definition: sprite_definition.h:73
virtual void addBitmap(int, boost::intrusive_ptr< CachedBitmap >)
Overridden just for complaining about malformed SWF.
Definition: sprite_definition.h:145
void log_swferror(StringType msg, Args... args)
Definition: log.h:325
virtual size_t get_bytes_total() const
Return total bytes of the movie from which this sprite has been read.
Definition: sprite_definition.h:90
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:49
virtual void add_font(int, boost::intrusive_ptr< Font >)
Overridden just for complaining about malformed SWF.
Definition: sprite_definition.h:125
virtual size_t get_bytes_loaded() const =0
virtual void registerExport(const std::string &s, std::uint16_t id)
Register a symbol to refer to a character id.
Definition: sprite_definition.h:183
virtual std::uint16_t exportID(const std::string &symbol) const
Get the id that corresponds to a symbol.
Definition: sprite_definition.h:179
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
virtual size_t get_frame_count() const
Definition: sprite_definition.h:84
Definition: GnashKey.h:159
Definition: GnashKey.h:165
An identifier for a sound sample managed by a sound_handler.
Definition: sound_definition.h:61
A CachedBitmap is created by the renderer in a format of its choosing.
Definition: CachedBitmap.h:37
void log_debug(StringType msg, Args... args)
Definition: log.h:301
std::string name
Definition: LocalConnection_as.cpp:149
SWF stream wrapper class.
Definition: SWFStream.h:58
virtual DisplayObject * createDisplayObject(Global_as &gl, DisplayObject *parent) const
Create a DisplayObject with the given parent.
Definition: sprite_definition.cpp:39
virtual sound_sample * get_sound_sample(int) const
Get the sound sample with given ID.
Definition: movie_definition.h:351