[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_object.cpp server/as_...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_object.cpp server/as_... |
Date: |
Tue, 24 Jul 2007 13:08:56 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/07/24 13:08:56
Modified files:
. : ChangeLog
server : as_object.cpp as_object.h sprite_instance.cpp
sprite_instance.h
testsuite/actionscript.all: enumerate.as
Log message:
* server/as_object.{cpp,h}: Add a virtual
enumerateNonProperties,
called by enumerateProperties, to allow for enumeration of
non-proper
properties (in particular sprite childs).
* server/sprite_instance.{cpp,h}: Implement
enumerateNonProperties to
enumerate child characters.
* testsuite/actionscript.all/enumerate.as: don't expect
failures while
enumerating childs.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3802&r2=1.3803
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.cpp?cvsroot=gnash&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.h?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.300&r2=1.301
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.126&r2=1.127
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/enumerate.as?cvsroot=gnash&r1=1.5&r2=1.6
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3802
retrieving revision 1.3803
diff -u -b -r1.3802 -r1.3803
--- ChangeLog 24 Jul 2007 11:09:06 -0000 1.3802
+++ ChangeLog 24 Jul 2007 13:08:55 -0000 1.3803
@@ -1,5 +1,15 @@
2007-07-24 Tomas Groth Christensen <address@hidden>
+ * server/as_object.{cpp,h}: Add a virtual enumerateNonProperties,
+ called by enumerateProperties, to allow for enumeration of non-proper
+ properties (in particular sprite childs).
+ * server/sprite_instance.{cpp,h}: Implement enumerateNonProperties to
+ enumerate child characters.
+ * testsuite/actionscript.all/enumerate.as: don't expect failures while
+ enumerating childs.
+
+2007-07-24 Tomas Groth Christensen <address@hidden>
+
* server/parser/video_stream_def.cpp: Convert width and height to
the correct format before using them. Fixes bug #20526 and #20440.
Index: server/as_object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- server/as_object.cpp 1 Jul 2007 10:54:20 -0000 1.55
+++ server/as_object.cpp 24 Jul 2007 13:08:55 -0000 1.56
@@ -490,6 +490,8 @@
{
assert( env.top(0).is_null() );
+ enumerateNonProperties(env);
+
// this set will keep track of visited objects,
// to avoid infinite loops
std::set<const as_object*> visited;
Index: server/as_object.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- server/as_object.h 18 Jul 2007 00:07:31 -0000 1.61
+++ server/as_object.h 24 Jul 2007 13:08:56 -0000 1.62
@@ -389,6 +389,18 @@
///
void enumerateProperties(as_environment& env) const;
+ /// Enumerate any non-proper properties
+ //
+ /// This function is called by enumerateProperties(as_environment&)
+ /// to allow for enumeration of properties that are not "proper"
+ /// (not contained in the as_object PropertyList).
+ ///
+ /// The default implementation adds nothing
+ ///
+ virtual void enumerateNonProperties(as_environment&) const
+ {
+ }
+
/// \brief
/// Enumerate all non-hidden properties inserting
/// their name/value pair to the given map.
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.300
retrieving revision 1.301
diff -u -b -r1.300 -r1.301
--- server/sprite_instance.cpp 19 Jul 2007 15:08:38 -0000 1.300
+++ server/sprite_instance.cpp 24 Jul 2007 13:08:56 -0000 1.301
@@ -3984,6 +3984,29 @@
return enabled.to_bool();
}
+class EnumerateVisitor {
+
+ as_environment& _env;
+
+public:
+ EnumerateVisitor(as_environment& env)
+ :
+ _env(env)
+ {}
+
+ void operator() (character* ch)
+ {
+ _env.push(ch->get_name());
+ }
+};
+
+void
+sprite_instance::enumerateNonProperties(as_environment& env) const
+{
+ EnumerateVisitor visitor(env);
+ m_display_list.visitAll(visitor);
+}
+
#ifdef GNASH_USE_GC
struct ReachableMarker {
void operator() (character *ch)
Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -b -r1.126 -r1.127
--- server/sprite_instance.h 1 Jul 2007 10:54:24 -0000 1.126
+++ server/sprite_instance.h 24 Jul 2007 13:08:56 -0000 1.127
@@ -762,6 +762,12 @@
/// Set all variables in the given map with their corresponding values
DSOEXPORT void setVariables(VariableMap& vars);
+ /// Enumerate child characters
+ //
+ /// See as_object::enumerateNonProperties(as_environment&) for more
info.
+ ///
+ virtual void enumerateNonProperties(as_environment&) const;
+
private:
/// \brief
Index: testsuite/actionscript.all/enumerate.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/enumerate.as,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- testsuite/actionscript.all/enumerate.as 1 Jul 2007 10:54:42 -0000
1.5
+++ testsuite/actionscript.all/enumerate.as 24 Jul 2007 13:08:56 -0000
1.6
@@ -49,12 +49,12 @@
}
// Test what we got in the above step. Tests show that characters were also
got enumerated!
- xcheck_equals(typeof(recorder['mc0']), 'movieclip');
- xcheck_equals(typeof(recorder['mc1']), 'movieclip');
- xcheck_equals(typeof(recorder['mc2']), 'movieclip');
- xcheck_equals(typeof(recorder['mc3']), 'movieclip');
- xcheck_equals(typeof(recorder['mc4']), 'movieclip');
- xcheck_equals(typeof(recorder['mc5']), 'movieclip');
+ check_equals(typeof(recorder['mc0']), 'movieclip');
+ check_equals(typeof(recorder['mc1']), 'movieclip');
+ check_equals(typeof(recorder['mc2']), 'movieclip');
+ check_equals(typeof(recorder['mc3']), 'movieclip');
+ check_equals(typeof(recorder['mc4']), 'movieclip');
+ check_equals(typeof(recorder['mc5']), 'movieclip');
check_equals(_root.hasOwnProperty('mc0'), false);
check_equals(_root.hasOwnProperty('mc1'), false);
check_equals(_root.hasOwnProperty('mc2'), false);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/as_object.cpp server/as_...,
Sandro Santilli <=