gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/sprite_instance.cpp serv...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/sprite_instance.cpp serv...
Date: Wed, 28 Mar 2007 08:40:44 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/03/28 08:40:44

Modified files:
        .              : ChangeLog 
        server         : sprite_instance.cpp sprite_instance.h 
        gui            : Player.cpp 

Log message:
                * server/sprite_instance.{cpp,h}: add setVariables()
                  method taking a std::map.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2694&r2=1.2695
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.203&r2=1.204
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.79&r2=1.80
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.44&r2=1.45

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2694
retrieving revision 1.2695
diff -u -b -r1.2694 -r1.2695
--- ChangeLog   28 Mar 2007 08:32:26 -0000      1.2694
+++ ChangeLog   28 Mar 2007 08:40:44 -0000      1.2695
@@ -1,5 +1,7 @@
 2007-03-28 Sandro Santilli <address@hidden>
 
+       * server/sprite_instance.{cpp,h}: add setVariables()
+         method taking a std::map.
        * gui/Player.cpp (run): parse URL query string
          after parsing FlashVars, for proper handling precedence.
          NOTE that this won't work when load starts from an internal

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -b -r1.203 -r1.204
--- server/sprite_instance.cpp  27 Mar 2007 15:02:06 -0000      1.203
+++ server/sprite_instance.cpp  28 Mar 2007 08:40:44 -0000      1.204
@@ -2562,13 +2562,13 @@
 {
        if (path_to_var == NULL)
        {
-               log_error("NULL path_to_var passed to set_variable()\n");
+               log_error("NULL path_to_var passed to set_variable()");
                return;
        }
        if (new_value == NULL)
        {
                log_error("NULL passed to set_variable('%s',"
-                       " NULL)\n", path_to_var);
+                       " NULL)", path_to_var);
                return;
        }
 
@@ -3917,6 +3917,7 @@
        {
                const string& name = it->first;
                const string& val = it->second;
+               log_msg("Setting variable '%s' to value '%s'", name.c_str(), 
val.c_str());
                set_variable(name.c_str(), val.c_str()); // should it be 
set_member ?
        }
 }
@@ -3940,4 +3941,16 @@
        }
 }
 
+void
+sprite_instance::setVariables(VariableMap& vars)
+{
+       for (VariableMap::const_iterator it=vars.begin(), itEnd=vars.end();
+               it != itEnd; ++it)
+       {
+               const string& name = it->first;
+               const string& val = it->second;
+               set_variable(name.c_str(), val.c_str());
+       }
+}
+
 } // namespace gnash

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -r1.79 -r1.80
--- server/sprite_instance.h    27 Mar 2007 15:02:06 -0000      1.79
+++ server/sprite_instance.h    28 Mar 2007 08:40:44 -0000      1.80
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: sprite_instance.h,v 1.79 2007/03/27 15:02:06 strk Exp $ */
+/* $Id: sprite_instance.h,v 1.80 2007/03/28 08:40:44 strk Exp $ */
 
 // Stateful live Sprite instance
 
@@ -684,6 +684,11 @@
 
        bool isUnloaded() { return _unloaded; }
 
+       typedef std::map<std::string, std::string> VariableMap;
+
+       /// Set all variables in the given map with their corresponding values
+       void setVariables(VariableMap& vars);
+
 private:
 
        /// Queue event handler(s), if any.

Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- gui/Player.cpp      28 Mar 2007 08:32:26 -0000      1.44
+++ gui/Player.cpp      28 Mar 2007 08:40:44 -0000      1.45
@@ -84,18 +84,12 @@
        gnash::sprite_instance* si = m.get_root_movie();
        assert(si);
 
-       typedef map<string, string> maptype;
+       typedef sprite_instance::VariableMap maptype;
 
        maptype vars;
        URL::parse_querystring(varstr, vars);
 
-       for (maptype::const_iterator it=vars.begin(), itEnd=vars.end();
-               it != itEnd; ++it)
-       {
-               const string& name = it->first;
-               const string& val = it->second;
-               si->set_variable(name.c_str(), val.c_str());
-       }
+       si->setVariables(vars);
 }
 
 Player::Player()




reply via email to

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