Index: Movie.cpp =================================================================== RCS file: /sources/gnash/gnash/server/Movie.cpp,v retrieving revision 1.13 diff -p -u -r1.13 Movie.cpp --- Movie.cpp 10 Apr 2006 20:21:39 -0000 1.13 +++ Movie.cpp 22 Apr 2006 16:27:31 -0000 @@ -154,7 +154,7 @@ bool movie_def_impl::in_import_table(int { for (int i = 0, n = m_imports.size(); i < n; i++) { - if (m_imports[i].m_character_id == character_id) + if (m_imports[i].get_character_id() == character_id) { return true; } @@ -169,11 +169,13 @@ void movie_def_impl::visit_imported_movi for (int i = 0, n = m_imports.size(); i < n; i++) { import_info& inf = m_imports[i]; - if (visited.find(inf.m_source_url) == visited.end()) + if (visited.find(inf.get_source_url()) == visited.end()) { // Call back the visitor. - visitor->visit(inf.m_source_url.c_str()); - visited[inf.m_source_url] = true; + tu_string tmp = inf.get_source_url(); + + visitor->visit(tmp.c_str()); + visited[tmp] = true; } } } @@ -190,33 +192,33 @@ void movie_def_impl::resolve_import(cons for (int i = m_imports.size() - 1; i >= 0; i--) { const import_info& inf = m_imports[i]; - if (inf.m_source_url == source_url) + if (inf.get_source_url() == source_url) { // Do the import. - smart_ptr res = def->get_exported_resource(inf.m_symbol); + smart_ptr res = def->get_exported_resource(inf.get_symbol()); bool imported = true; if (res == NULL) { log_error("import error: resource '%s' is not exported from movie '%s'\n", - inf.m_symbol.c_str(), source_url); + inf.get_symbol().c_str(), source_url); } else if (font* f = res->cast_to_font()) { // Add this shared font to our fonts. - add_font(inf.m_character_id, f); + add_font(inf.get_character_id(), f); imported = true; } else if (character_def* ch = res->cast_to_character_def()) { // Add this character to our characters. - add_character(inf.m_character_id, ch); + add_character(inf.get_character_id(), ch); imported = true; } else { log_error("import error: resource '%s' from movie '%s' has unknown type\n", - inf.m_symbol.c_str(), source_url); + inf.get_symbol().c_str(), source_url); } if (imported) Index: Movie.h =================================================================== RCS file: /sources/gnash/gnash/server/Movie.h,v retrieving revision 1.10 diff -p -u -r1.10 Movie.h --- Movie.h 10 Apr 2006 20:21:39 -0000 1.10 +++ Movie.h 22 Apr 2006 16:27:31 -0000 @@ -70,7 +70,7 @@ namespace gnash { // Forward declarations - struct import_info; + class import_info; struct movie_def_impl; struct movie_root; struct import_visitor; // in gnash.h @@ -78,12 +78,9 @@ namespace gnash // // Helper for movie_def_impl // - struct import_info + class import_info { - tu_string m_source_url; - int m_character_id; - tu_string m_symbol; - + public: import_info() : m_character_id(-1) @@ -92,11 +89,25 @@ namespace gnash import_info(const char* source, int id, const char* symbol) : - m_source_url(source), m_character_id(id), + m_source_url(source), m_symbol(symbol) { } + + const int& get_character_id() const { return m_character_id; } + const tu_string& get_source_url() const { return m_source_url; } + const tu_string& get_symbol() const { return m_symbol; } +#if 0 + /* These are unused currently. */ + void set_source_url(const tu_string url) {m_source_url = url; } + void set_character_id(const int id) {m_character_id = id; } + void set_symbol(const tu_string sbl) {m_symbol = sbl; } +#endif + private: + int m_character_id; + tu_string m_source_url; + tu_string m_symbol; }; /// Client program's interface to the definition of a movie