Go to the documentation of this file.
19 #ifndef GNASH_SWF_IMPORTASSETSTAG_H
20 #define GNASH_SWF_IMPORTASSETSTAG_H
42 typedef std::pair<int, std::string>
Import;
61 Movie* mov =
m->get_root();
62 for (
const Import&
import : _imports) {
78 std::string source_url;
82 URL abs_url(source_url,
r.streamProvider().baseURL());
84 unsigned char import_version = 0;
94 const std::uint16_t count = in.
read_u16();
97 log_parse(
_(
" import: version = %u, source_url = %s (%s), "
98 "count = %d"), import_version, abs_url.str(), source_url,
103 boost::intrusive_ptr<movie_definition> source_movie;
114 log_error(
_(
"can't import movie from url %s"), abs_url.str());
120 if (source_movie == &
m) {
129 for (
size_t i = 0;
i < count; ++
i)
132 const std::uint16_t
id = in.
read_u16();
137 std::string symbolName;
140 log_parse(
_(
" import: id = %d, name = %s"),
id, symbolName);
142 _imports.push_back(std::make_pair(
id, symbolName));
145 m.importResources(source_movie, _imports);
static DSOEXPORT boost::intrusive_ptr< movie_definition > makeMovie(const URL &url, const RunResources &runResources, const char *real_url=nullptr, bool startLoaderThread=true, const std::string *postdata=nullptr)
Create a gnash::movie_definition from the given URL.
Definition: MovieFactory.cpp:109
Control tags are swf tags that control the operation of the movie.
Definition: ControlTag.h:44
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
Definition: ImportAssetsTag.h:39
void log_swferror(StringType msg, Args... args)
Definition: log.h:325
Top-level gnash exception.
Definition: GnashException.h:31
static void loader(SWFStream &in, TagType tag, movie_definition &m, const RunResources &r)
Definition: ImportAssetsTag.h:45
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
@ IMPORTASSETS
Definition: SWF.h:87
std::vector< Import > Imports
Definition: ImportAssetsTag.h:43
@ i
Definition: GnashKey.h:155
virtual void executeState(MovieClip *m, DisplayList &) const
Execute an ImportAssetsTag.
Definition: ImportAssetsTag.h:60
#define _(String)
Definition: log.h:44
void read_string(std::string &to)
Reads a null-terminated string from the given file and assigns it to the given std::string,...
Definition: SWFStream.cpp:395
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
@ m
Definition: GnashKey.h:159
A MovieClip is a container for DisplayObjects.
Definition: MovieClip.h:84
#define UNUSED(x)
Definition: utility.h:113
virtual void addCharacter(std::uint16_t)
Add a character to the list of known characters.
Definition: Movie.h:97
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
void log_error(StringType msg, Args... args)
Definition: log.h:283
#define IF_VERBOSE_MALFORMED_SWF(x)
Definition: log.h:404
A list of on-stage DisplayObjects, ordered by depth.
Definition: DisplayList.h:65
@ t
Definition: GnashKey.h:166
@ r
Definition: GnashKey.h:164
@ p
Definition: GnashKey.h:162
@ IMPORTASSETS2
Definition: SWF.h:101
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
A top-level, standalone Movie that can be loaded and played.
Definition: Movie.h:47
#define IF_VERBOSE_PARSE(x)
Definition: log.h:378
void log_parse(StringType msg, Args... args)
Definition: log.h:313
std::uint16_t read_u16()
Read a aligned unsigned 16-bit value from the stream.
Definition: SWFStream.cpp:332
SWF stream wrapper class.
Definition: SWFStream.h:59
Uniform Resource Locator.
Definition: URL.h:35
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
@ SWF
Definition: GnashKey.h:331
@ e
Definition: GnashKey.h:151
std::pair< int, std::string > Import
Definition: ImportAssetsTag.h:42