[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/Global.cpp server/...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/Global.cpp server/... |
Date: |
Tue, 24 Oct 2006 14:36:26 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/10/24 14:36:26
Modified files:
. : ChangeLog
server/asobj : Global.cpp Makefile.am
Added files:
server/asobj : Object.cpp Object.h
Log message:
* server/asobj/: Global.cpp, Makefile.am, Object.{cpp,h}: added Object
class.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1383&r2=1.1384
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Makefile.am?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Object.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Object.h?cvsroot=gnash&rev=1.1
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1383
retrieving revision 1.1384
diff -u -b -r1.1383 -r1.1384
--- ChangeLog 24 Oct 2006 13:19:35 -0000 1.1383
+++ ChangeLog 24 Oct 2006 14:36:25 -0000 1.1384
@@ -1,5 +1,10 @@
2006-10-25 Sandro Santilli <address@hidden>
+ * server/asobj/: Global.cpp, Makefile.am, Object.{cpp,h}:
+ added Object class.
+
+2006-10-25 Sandro Santilli <address@hidden>
+
* testsuite/samples/samples.exp: dejagnu driver for
tests in sample dir (actually a copy of ming.exp)
* configure.ac, testsuite/Makefile.am,
Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/asobj/Global.cpp 23 Oct 2006 07:41:51 -0000 1.14
+++ server/asobj/Global.cpp 24 Oct 2006 14:36:25 -0000 1.15
@@ -18,7 +18,7 @@
// Implementation of the Global ActionScript Object
-/* $Id: Global.cpp,v 1.14 2006/10/23 07:41:51 strk Exp $ */
+/* $Id: Global.cpp,v 1.15 2006/10/24 14:36:25 strk Exp $ */
#include "as_object.h"
#include "array.h"
@@ -37,6 +37,7 @@
#include "LocalConnection.h"
#include "Microphone.h"
#include "Number.h"
+#include "Object.h"
#include "GMath.h"
#include "Mouse.h"
#include "MovieClipLoader.h"
@@ -104,35 +105,6 @@
static void
-as_global_object_ctor(const fn_call& fn)
- // Constructor for ActionScript class Object.
-{
- if ( fn.nargs == 1 ) // copy constructor
- {
- // just copy the reference
- //
- // WARNING: it is likely that fn.result and fn.arg(0)
- // are the same location... so we might skip
- // the set_as_object() call as a whole.
- fn.result->set_as_object(fn.arg(0).to_object());
- return;
- }
-
- as_object* new_obj;
- if ( fn.nargs == 0 )
- {
- new_obj = new as_object();
- }
- else
- {
- dbglogfile << "Too many args to Object constructor" << endl;
- new_obj = new as_object();
- }
-
- fn.result->set_as_object(new_obj);
-}
-
-static void
as_global_isnan(const fn_call& fn)
{
assert(fn.nargs == 1);
@@ -425,7 +397,6 @@
as_object()
{
set_member("trace", as_value(as_global_trace));
- set_member("Object", as_value(as_global_object_ctor));
set_member("Sound", as_value(sound_new));
set_member("TextFormat", as_value(textformat_new));
@@ -471,6 +442,7 @@
// isFinite
set_member("isFinite", as_global_isfinite);
+ object_class_init(*this);
number_class_init(*this);
string_class_init(*this);
array_class_init(*this);
Index: server/asobj/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/asobj/Makefile.am 23 Oct 2006 07:41:51 -0000 1.11
+++ server/asobj/Makefile.am 24 Oct 2006 14:36:25 -0000 1.12
@@ -36,7 +36,7 @@
#
#
-# $Id: Makefile.am,v 1.11 2006/10/23 07:41:51 strk Exp $
+# $Id: Makefile.am,v 1.12 2006/10/24 14:36:25 strk Exp $
AUTOMAKE_OPTIONS =
@@ -86,6 +86,7 @@
NetConnection.cpp\
NetStream.cpp \
Number.cpp \
+ Object.cpp \
Selection.cpp \
SharedObject.cpp\
ASSound.cpp \
@@ -116,6 +117,7 @@
NetConnection.h \
NetStream.h \
Number.h \
+ Object.h \
Selection.h \
SharedObject.h \
Stage.h \
Index: server/asobj/Object.cpp
===================================================================
RCS file: server/asobj/Object.cpp
diff -N server/asobj/Object.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/asobj/Object.cpp 24 Oct 2006 14:36:25 -0000 1.1
@@ -0,0 +1,140 @@
+//
+// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+// Linking Gnash statically or dynamically with other modules is making a
+// combined work based on Gnash. Thus, the terms and conditions of the GNU
+// General Public License cover the whole combination.
+//
+// As a special exception, the copyright holders of Gnash give you
+// permission to combine Gnash with free software programs or libraries
+// that are released under the GNU LGPL and with code included in any
+// release of Talkback distributed by the Mozilla Foundation. You may
+// copy and distribute such a system following the terms of the GNU GPL
+// for all but the LGPL-covered parts and Talkback, and following the
+// LGPL for the LGPL-covered parts.
+//
+// Note that people who make modified versions of Gnash are not obligated
+// to grant this special exception for their modified versions; it is their
+// choice whether to do so. The GNU General Public License gives permission
+// to release a modified version without this exception; this exception
+// also makes it possible to release a modified version which carries
+// forward this exception.
+//
+//
+//
+
+/* $Id: Object.cpp,v 1.1 2006/10/24 14:36:25 strk Exp $ */
+
+// Implementation of ActionScript Object class.
+
+#include "tu_config.h"
+#include "Object.h"
+//#include "smart_ptr.h"
+#include "fn_call.h"
+#include "as_object.h" // for inheritance
+#include "builtin_function.h" // need builtin_function
+
+#include "log.h"
+
+#include <sstream>
+
+namespace gnash {
+
+// Forward declarations
+
+static void
+attachObjectInterface(as_object& /*o*/)
+{
+ // FIXME: add Object interface here:
+}
+
+static as_object*
+getObjectInterface()
+{
+ static as_object* o=NULL;
+ if ( o == NULL )
+ {
+ o = new as_object();
+ attachObjectInterface(*o);
+ }
+ return o;
+}
+
+// FIXME: add some useful methods :)
+class object_as_object : public as_object
+{
+
+public:
+
+ object_as_object()
+ :
+ as_object(getObjectInterface())
+ {
+ }
+
+};
+
+static void
+object_ctor(const fn_call& fn)
+ // Constructor for ActionScript class Object.
+{
+ if ( fn.nargs == 1 ) // copy constructor
+ {
+ // just copy the reference
+ //
+ // WARNING: it is likely that fn.result and fn.arg(0)
+ // are the same location... so we might skip
+ // the set_as_object() call as a whole.
+ fn.result->set_as_object(fn.arg(0).to_object());
+ return;
+ }
+
+ as_object* new_obj;
+ if ( fn.nargs == 0 )
+ {
+ new_obj = new as_object();
+ }
+ else
+ {
+ log_error("Too many args to Object constructor");
+ new_obj = new as_object();
+ }
+
+ fn.result->set_as_object(new_obj);
+}
+
+
+// extern (used by Global.cpp)
+void object_class_init(as_object& global)
+{
+ // This is going to be the global Object "class"/"function"
+ static builtin_function* cl=NULL;
+
+ if ( cl == NULL )
+ {
+ cl=new builtin_function(&object_ctor, getObjectInterface());
+ // replicate all interface to class, to be able to access
+ // all methods as static functions
+ attachObjectInterface(*cl);
+
+ }
+
+ // Register _global.Object
+ global.set_member("Object", cl);
+
+}
+
+} // namespace gnash
Index: server/asobj/Object.h
===================================================================
RCS file: server/asobj/Object.h
diff -N server/asobj/Object.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/asobj/Object.h 24 Oct 2006 14:36:25 -0000 1.1
@@ -0,0 +1,53 @@
+//
+// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+// Linking Gnash statically or dynamically with other modules is making a
+// combined work based on Gnash. Thus, the terms and conditions of the GNU
+// General Public License cover the whole combination.
+//
+// As a special exception, the copyright holders of Gnash give you
+// permission to combine Gnash with free software programs or libraries
+// that are released under the GNU LGPL and with code included in any
+// release of Talkback distributed by the Mozilla Foundation. You may
+// copy and distribute such a system following the terms of the GNU GPL
+// for all but the LGPL-covered parts and Talkback, and following the
+// LGPL for the LGPL-covered parts.
+//
+// Note that people who make modified versions of Gnash are not obligated
+// to grant this special exception for their modified versions; it is their
+// choice whether to do so. The GNU General Public License gives permission
+// to release a modified version without this exception; this exception
+// also makes it possible to release a modified version which carries
+// forward this exception.
+//
+//
+//
+
+// Implementation for ActionScript Number object.
+
+#ifndef GNASH_OBJECT_H
+#define GNASH_OBJECT_H
+
+namespace gnash {
+
+class as_object;
+
+/// Initialize the global Number class
+void object_class_init(as_object& global);
+
+}
+
+#endif // GNASH_OBJECT_H