[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ./ChangeLog server/Makefile.am server/act...
From: |
Michael Carlson |
Subject: |
[Gnash-commit] gnash ./ChangeLog server/Makefile.am server/act... |
Date: |
Mon, 23 Jan 2006 16:04:20 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Branch:
Changes by: Michael Carlson <address@hidden> 06/01/23 16:04:20
Modified files:
. : ChangeLog
server : Makefile.am action.cpp
Added files:
server : array.cpp array.h
Log message:
Move new array code into array.cpp, array.h
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.31&tr2=1.32&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Makefile.am.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/action.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/array.cpp?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/array.h?rev=1.1
Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.31 gnash/ChangeLog:1.32
--- gnash/ChangeLog:1.31 Mon Jan 23 15:32:07 2006
+++ gnash/ChangeLog Mon Jan 23 16:04:19 2006
@@ -1,5 +1,9 @@
2006-01-23 Michael Carlson <address@hidden>
+ * server/array.h: Move new array code into array.cpp, array.h
+ * server/array.cpp: Move new array code into array.cpp, array.h
+ * server/action.cpp: Move new array code into array.cpp, array.h
+ * server/Makefile.am: Move new array code into array.cpp, array.h
* server/font.cpp: Report an error and continue when we get two
of the same kerning pairs for a font, instead of crashing
Index: gnash/server/Makefile.am
diff -u gnash/server/Makefile.am:1.6 gnash/server/Makefile.am:1.7
--- gnash/server/Makefile.am:1.6 Mon Jan 23 05:30:57 2006
+++ gnash/server/Makefile.am Mon Jan 23 16:04:19 2006
@@ -62,10 +62,12 @@
styles.cpp \
tesselate.cpp \
text.cpp \
+ array.cpp \
types.cpp $(MP3_HANDLER)
noinst_HEADERS = \
action.h \
+ array.h \
button.h \
dlist.h \
font.h \
Index: gnash/server/action.cpp
diff -u gnash/server/action.cpp:1.2 gnash/server/action.cpp:1.3
--- gnash/server/action.cpp:1.2 Fri Jan 6 01:41:41 2006
+++ gnash/server/action.cpp Mon Jan 23 16:04:19 2006
@@ -17,6 +17,7 @@
#include "timers.h"
#include "textformat.h"
#include "sound.h"
+#include "array.h"
#ifdef HAVE_LIBXML
#include "xml.h"
@@ -195,39 +196,6 @@
return true;
}
-
- //
- // array object
- //
-
-
- struct as_array_object : public as_object
- {
-// @@ TODO
-// as_array_object()
-// {
-// this->set_member("length", &array_not_impl);
-// this->set_member("join", &array_not_impl);
-// this->set_member("concat", &array_not_impl);
-// this->set_member("slice", &array_not_impl);
-// this->set_member("push", &array_not_impl);
-// this->set_member("unshift", &array_not_impl);
-// this->set_member("pop", &array_not_impl);
-// this->set_member("shift", &array_not_impl);
-// this->set_member("splice", &array_not_impl);
-// this->set_member("sort", &array_not_impl);
-// this->set_member("sortOn", &array_not_impl);
-// this->set_member("reverse", &array_not_impl);
-// this->set_member("toString", &array_not_impl);
-// }
- };
-
- void array_not_impl(const fn_call& fn)
- {
- log_error("array methods not implemented yet\n");
- }
-
-
//
// as_as_function
//
@@ -1188,41 +1156,6 @@
fn.result->set_as_object_interface(new as_object);
}
- void as_global_array_ctor(const fn_call& fn)
- // Constructor for ActionScript class Array.
- {
- smart_ptr<as_array_object> ao = new as_array_object;
-
- if (fn.nargs == 0)
- {
- // Empty array.
- }
- else if (fn.nargs == 1
- && fn.arg(0).get_type() == as_value::NUMBER)
- {
- // Create an empty array with the given number of
undefined elements.
- //
- // @@ TODO set length property; no need to
- // actually create the elements now, since
- // they're undefined.
- }
- else
- {
- // Use the arguments as initializers.
- as_value index_number;
- for (int i = 0; i < fn.nargs; i++)
- {
- index_number.set_int(i);
- ao->set_member(index_number.to_string(),
fn.arg(i));
- }
-
- // @@ TODO set length property
- }
-
- fn.result->set_as_object_interface(ao.get_ptr());
- }
-
-
void as_global_assetpropflags(const fn_call& fn)
// ASSetPropFlags function
{
@@ -2215,32 +2148,30 @@
{
int array_size = (int)
env->pop().to_number();
- //log_msg("xxx init array: size = %d,
top of stack = %d\n",
- // // array_size,
env->get_top_index());//xxxxx
+ log_msg("xxx init array: size = %d, top
of stack = %d\n",
+ array_size,
env->get_top_index());//xxxxx
+
+ // Call the array constructor, to
create an empty array.
+ as_value result;
+ as_global_array_ctor(fn_call(&result,
NULL, env, 0, env->get_top_index()));
+
+ as_object_interface* ao =
result.to_object();
+ assert(ao);
+
+ // Fill the elements with the initial
values from the stack.
+ as_value index_number;
+ for (int i = 0; i < array_size; i++)
+ {
+ // @@ TODO a set_member that
takes an int or as_value?
+ index_number.set_int(i);
+
ao->set_member(index_number.to_string(), env->pop());
+ }
-// // Call the array constructor, to
create an empty array.
-// as_value result;
-// as_global_array_ctor(fn_call(&result,
NULL, env, 0, env->get_top_index()));
-
-// as_object_interface* ao =
result.to_object();
-// assert(ao);
-
-// // @@ TODO Set array size.
-// // ao->set_length(whatever); or
something
-
-// // Fill the elements with the initial
values from the stack.
-// as_value index_number;
-// for (int i = 0; i < array_size; i++)
-// {
-// // @@ TODO a set_member that
takes an int or as_value?
-// index_number.set_int(i);
-//
ao->set_member(index_number.to_string(), env->pop());
-// }
+ env->push(result);
-// env->push(result);
+ log_msg("xxx init array end: top of
stack = %d, trace(top(0)) =",
+ env->get_top_index());//xxxxxxx
-// //log_msg("xxx init array end: top of
stack = %d, trace(top(0)) =",
-// // env->get_top_index());//xxxxxxx
as_global_trace(fn_call(NULL, NULL,
env, 1, env->get_top_index())); //xxxx
break;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ./ChangeLog server/Makefile.am server/act...,
Michael Carlson <=