gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ./ChangeLog server/Movie.cpp server/Movie.h


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ./ChangeLog server/Movie.cpp server/Movie.h
Date: Sat, 22 Apr 2006 19:22:00 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Bastiaan Jacques <address@hidden>       06/04/22 19:22:00

Modified files:
        .              : ChangeLog 
        server         : Movie.cpp Movie.h 

Log message:
        * server/Movie.h: Make the import_info struct a proper class.
        * server/Movie.cpp: Adjust the users of import_info to match
        changes to Movie.h

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.221&tr2=1.222&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.cpp.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.h.diff?tr1=1.10&tr2=1.11&r1=text&r2=text

Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.221 gnash/ChangeLog:1.222
--- gnash/ChangeLog:1.221       Sat Apr 22 00:32:44 2006
+++ gnash/ChangeLog     Sat Apr 22 19:22:00 2006
@@ -1,3 +1,9 @@
+2006-04-22  Bastiaan Jacques  <address@hidden>
+
+       * server/Movie.h: Make the import_info struct a proper class.
+       * server/Movie.cpp: Adjust the users of import_info to match
+       changes to Movie.h
+       
 2006-04-21  Rob Savoye  <address@hidden>
 
        * packaging/redhat/gnash.spec: Install the dir file so the rpm
Index: gnash/server/Movie.cpp
diff -u gnash/server/Movie.cpp:1.13 gnash/server/Movie.cpp:1.14
--- gnash/server/Movie.cpp:1.13 Mon Apr 10 20:21:39 2006
+++ gnash/server/Movie.cpp      Sat Apr 22 19:22:00 2006
@@ -154,7 +154,7 @@
 {
     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 @@
     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 @@
     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<resource> res = 
def->get_exported_resource(inf.m_symbol);
+                    smart_ptr<resource> 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: gnash/server/Movie.h
diff -u gnash/server/Movie.h:1.10 gnash/server/Movie.h:1.11
--- gnash/server/Movie.h:1.10   Mon Apr 10 20:21:39 2006
+++ gnash/server/Movie.h        Sat Apr 22 19:22:00 2006
@@ -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 @@
        //
        // 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 @@
 
            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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]