[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_value.h server/button...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_value.h server/button... |
Date: |
Tue, 29 Jan 2008 12:31:11 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/01/29 12:31:10
Modified files:
. : ChangeLog
server : as_value.h button_character_instance.cpp
character.cpp movie_root.cpp movie_root.h
sprite_instance.cpp
server/vm : ASHandlers.cpp
testsuite/actionscript.all: case.as
Log message:
Make PROPNAME a no-op, so that property are now effectively stored
with the case specified by user.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5515&r2=1.5516
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.h?cvsroot=gnash&r1=1.82&r2=1.83
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.78&r2=1.79
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.76&r2=1.77
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.154&r2=1.155
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.460&r2=1.461
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.185&r2=1.186
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/case.as?cvsroot=gnash&r1=1.14&r2=1.15
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5515
retrieving revision 1.5516
diff -u -b -r1.5515 -r1.5516
--- ChangeLog 29 Jan 2008 07:13:23 -0000 1.5515
+++ ChangeLog 29 Jan 2008 12:31:09 -0000 1.5516
@@ -1,3 +1,15 @@
+2008-01-29 Sandro Santilli <address@hidden>
+
+ * server/as_value.h: make PROPNAME a noop
+ * server/movie_root.{cpp,h}: provide a isLevelTarget
+ method to take care of case-insensitively matching
+ a path element with "_level" in SWF<7.
+ * server/button_character_instance.cpp,
+ server/character.cpp, server/sprite_instance.cpp,
+ server/vm/ASHandlers.cpp: update "_level" handling.
+ * testsuite/actionscript.all/case.as: success in property
+ names.
+
2008-01-29 Chad Musick <address@hidden>
* libbase/string_table.h,cpp: Change string_table to be case
Index: server/as_value.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- server/as_value.h 21 Jan 2008 20:55:49 -0000 1.82
+++ server/as_value.h 29 Jan 2008 12:31:09 -0000 1.83
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: as_value.h,v 1.82 2008/01/21 20:55:49 rsavoye Exp $ */
+/* $Id: as_value.h,v 1.83 2008/01/29 12:31:09 strk Exp $ */
#ifndef GNASH_AS_VALUE_H
#define GNASH_AS_VALUE_H
@@ -84,7 +84,8 @@
/// The methods will convert the name to lowercase if the current VM target
/// is SWF6 or lower
///
-#define PROPNAME(x) ( VM::get().getSWFVersion() < 7 ?
boost::to_lower_copy(std::string(x)) : (x) )
+//#define PROPNAME(x) ( VM::get().getSWFVersion() < 7 ?
boost::to_lower_copy(std::string(x)) : (x) )
+#define PROPNAME(x) ( x )
/// These are the primitive types, see the ECMAScript reference.
enum primitive_types
Index: server/button_character_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- server/button_character_instance.cpp 21 Jan 2008 20:55:49 -0000
1.78
+++ server/button_character_instance.cpp 29 Jan 2008 12:31:09 -0000
1.79
@@ -899,10 +899,11 @@
const std::string& name = _vm.getStringTable().value(name_key);
- if (name.compare(0, 6, "_level") == 0 &&
name.find_first_not_of("0123456789", 7) == std::string::npos )
+ movie_root& mr = _vm.getRoot();
+ unsigned int levelno;
+ if ( mr.isLevelTarget(name, levelno) )
{
- unsigned int levelno = atoi(name.c_str()+6); // getting 0 here for
"_level" is intentional
- movie_instance* mo = _vm.getRoot().getLevel(levelno).get();
+ movie_instance* mo = mr.getLevel(levelno).get();
if ( mo )
{
val->set_as_object(mo);
Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -b -r1.76 -r1.77
--- server/character.cpp 21 Jan 2008 20:55:49 -0000 1.76
+++ server/character.cpp 29 Jan 2008 12:31:10 -0000 1.77
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: character.cpp,v 1.76 2008/01/21 20:55:49 rsavoye Exp $ */
+/* $Id: character.cpp,v 1.77 2008/01/29 12:31:10 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
@@ -30,6 +30,7 @@
#include "fn_call.h" // for shared ActionScript getter-setters
#include "GnashException.h" // for shared ActionScript getter-setters
(ensure_character)
#include "ExecutableCode.h"
+#include "namedStrings.h"
#include <boost/algorithm/string/case_conv.hpp>
@@ -90,12 +91,15 @@
as_object*
character::get_path_element_character(string_table::key key)
{
- std::string name = _vm.getStringTable().value(key);
- if (name == "." || name == "this")
+ if (key == NSV::PROP_uROOT)
{
- return this;
+ // get_root() will handle _lockroot
+ return get_root();
}
- else if (name == ".." || name == "_parent")
+
+ const std::string& name = _vm.getStringTable().value(key);
+
+ if (name == ".." || key == NSV::PROP_uPARENT )
{
// Never NULL
character* parent = get_parent();
@@ -113,15 +117,23 @@
}
return parent;
}
- else if (name == "_root")
+
+ // TODO: is it correct to check for _level here ?
+ // would it be valid at all if not the very first element
+ // in a path ?
+ unsigned int levelno;
+ if ( _vm.getRoot().isLevelTarget(name, levelno) )
{
- // get_root() will handle _lockroot
- return get_root();
+ return _vm.getRoot().getLevel(levelno).get();
}
- else if (name.compare(0, 6, "_level") == 0 &&
name.find_first_not_of("0123456789", 7) == std::string::npos )
+
+
+ std::string namei = name;
+ if ( _vm.getSWFVersion() < 7 ) boost::to_lower(namei);
+
+ if (name == "." || namei == "this")
{
- unsigned int levelno = atoi(name.c_str()+6);
- return _vm.getRoot().getLevel(levelno).get();
+ return this;
}
return NULL;
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -b -r1.154 -r1.155
--- server/movie_root.cpp 25 Jan 2008 11:33:36 -0000 1.154
+++ server/movie_root.cpp 29 Jan 2008 12:31:10 -0000 1.155
@@ -1802,5 +1802,23 @@
}
}
+bool
+movie_root::isLevelTarget(const std::string& name, unsigned int& levelno)
+{
+ if ( VM::get().getSWFVersion() > 6 )
+ {
+ if ( name.compare(0, 6, "_level") ) return false;
+ }
+ else
+ {
+ if ( strncasecmp(name.c_str(), "_level", 6) ) return false;
+ }
+
+ if ( name.find_first_not_of("0123456789", 7) != std::string::npos ) return
false;
+ levelno = atoi(name.c_str()+6); // getting 0 here for "_level" is intentional
+ return true;
+
+}
+
} // namespace gnash
Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- server/movie_root.h 25 Jan 2008 11:33:36 -0000 1.105
+++ server/movie_root.h 29 Jan 2008 12:31:10 -0000 1.106
@@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: movie_root.h,v 1.105 2008/01/25 11:33:36 strk Exp $ */
+/* $Id: movie_root.h,v 1.106 2008/01/29 12:31:10 strk Exp $ */
/// \page events_handling Handling of user events
///
@@ -624,6 +624,17 @@
///
void loadMovie(const URL& url, const std::string& target, LoadMethod
method=NONE);
+ /// Return true if the given string can be interpreted as a _level name
+ //
+ /// @param name
+ /// The target string.
+ /// Will be considered case-insensitive if VM version is < 7.
+ ///
+ /// @param levelno
+ /// Output parameter, will be set to the level number, if true is
returned
+ ///
+ bool isLevelTarget(const std::string& name, unsigned int& levelno);
+
private:
/// A load movie request
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.460
retrieving revision 1.461
diff -u -b -r1.460 -r1.461
--- server/sprite_instance.cpp 25 Jan 2008 21:11:18 -0000 1.460
+++ server/sprite_instance.cpp 29 Jan 2008 12:31:10 -0000 1.461
@@ -2177,9 +2177,10 @@
const std::string& name = _vm.getStringTable().value(name_key);
- if (name.compare(0, 6, "_level") == 0 &&
name.find_first_not_of("0123456789", 7) == string::npos )
+ movie_root& mr = _vm.getRoot();
+ unsigned int levelno;
+ if ( mr.isLevelTarget(name, levelno) )
{
- unsigned int levelno = atoi(name.c_str()+6); // getting 0 here for
"_level" is intentional
movie_instance* mo = _vm.getRoot().getLevel(levelno).get();
if ( mo )
{
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -b -r1.185 -r1.186
--- server/vm/ASHandlers.cpp 28 Jan 2008 12:26:47 -0000 1.185
+++ server/vm/ASHandlers.cpp 29 Jan 2008 12:31:10 -0000 1.186
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: ASHandlers.cpp,v 1.185 2008/01/28 12:26:47 bwy Exp $ */
+/* $Id: ASHandlers.cpp,v 1.186 2008/01/29 12:31:10 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
@@ -2188,6 +2188,8 @@
return;
}
+ movie_root& mr = VM::get().getRoot();
+
if ( loadTargetFlag )
{
// TODO: always pass directly to movie_root::loadMovie ?
@@ -2203,15 +2205,14 @@
if ( ! target_ch )
{
- std::string s = PROPNAME(target_string);
- if ( s.compare(0, 6, "_level") == 0 &&
s.find_first_not_of("0123456789", 7) == string::npos )
+ unsigned int levelno;
+ if ( mr.isLevelTarget(target_string, levelno) )
{
- unsigned int levelno =
atoi(target_string.c_str()+6);
log_debug(_("Testing _level loading (level
%u)"), levelno);
#ifdef QUEUE_MOVIE_LOADS
- VM::get().getRoot().loadMovie(url, s); // TODO:
add third argument for the method
+ mr.loadMovie(url, target_string); // TODO: add
third argument for the method
#else
- VM::get().getRoot().loadLevel(levelno, url);
+ mr.loadLevel(levelno, url);
#endif
return;
}
@@ -2251,15 +2252,14 @@
sendVarsMethod);
}
- std::string s = PROPNAME(target_string);
- if ( s.compare(0, 6, "_level") == 0 &&
s.find_first_not_of("0123456789", 7) == string::npos )
+ unsigned int levelno;
+ if ( mr.isLevelTarget(target_string, levelno) )
{
- unsigned int levelno = atoi(target_string.c_str()+6);
log_debug(_("Testing _level loading (level %u)"), levelno);
#ifdef QUEUE_MOVIE_LOADS
- VM::get().getRoot().loadMovie(url, s); // TODO: add third
argument for the method
+ mr.loadMovie(url, target_string); // TODO: add third argument
for the method
#else
- VM::get().getRoot().loadLevel(levelno, url);
+ mr.loadLevel(levelno, url);
#endif
return;
}
Index: testsuite/actionscript.all/case.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/case.as,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- testsuite/actionscript.all/case.as 17 Dec 2007 11:09:16 -0000 1.14
+++ testsuite/actionscript.all/case.as 29 Jan 2008 12:31:10 -0000 1.15
@@ -22,7 +22,7 @@
* Test case sensitivity
*/
-rcsid="$Id: case.as,v 1.14 2007/12/17 11:09:16 strk Exp $";
+rcsid="$Id: case.as,v 1.15 2008/01/29 12:31:10 strk Exp $";
#include "check.as"
@@ -208,11 +208,7 @@
}
propRecorder.sort(1); //caseinsensitive sort
check_equals(propRecorder.length, 2);
-#if OUTPUT_VERSION < 7
- xcheck_equals(propRecorder[0], 'A')
-#else
- check_equals(propRecorder[0], 'A')
-#endif
+check_equals(propRecorder[0], 'A')
check_equals(propRecorder[1], 'b')
propRecorder = new Array();
@@ -224,7 +220,7 @@
propRecorder.sort(1); //caseinsensitive sort
#if OUTPUT_VERSION < 7
check_equals(propRecorder.length, 2);
- xcheck_equals(propRecorder[0], 'A')
+ check_equals(propRecorder[0], 'A')
check_equals(propRecorder[1], 'b')
#else
check_equals(propRecorder.length, 3);
@@ -242,7 +238,7 @@
propRecorder.sort(1); //caseinsensitive sort
#if OUTPUT_VERSION < 7
check_equals(propRecorder.length, 2);
- xcheck_equals(propRecorder[0], 'A')
+ check_equals(propRecorder[0], 'A')
check_equals(propRecorder[1], 'b')
#else
check_equals(propRecorder.length, 4);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/as_value.h server/button...,
Sandro Santilli <=