[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/ClassHierarchy.cpp...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/ClassHierarchy.cpp... |
Date: |
Tue, 17 Jun 2008 07:18:49 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/06/17 07:18:48
Modified files:
. : ChangeLog
server/asobj : ClassHierarchy.cpp Global.cpp Makefile.am
Added files:
server/asobj : Error_as.cpp Error_as.h
Removed files:
server/asobj : Error.cpp Error.h
Log message:
* server/asobj/Error_as.{cpp,h}: regenerate unimplemented Error
class.
* server/asobj/ClassHierarchy.cpp: Error also works in SWF6.
Update includes.
* server/asobj/Global.cpp: update include (it's not necessary at
all now, but may be if Error is an ASnative function).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6950&r2=1.6951
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/ClassHierarchy.cpp?cvsroot=gnash&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.132&r2=1.133
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Makefile.am?cvsroot=gnash&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Error_as.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Error_as.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Error.cpp?cvsroot=gnash&r1=1.12&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Error.h?cvsroot=gnash&r1=1.9&r2=0
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6950
retrieving revision 1.6951
diff -u -b -r1.6950 -r1.6951
--- ChangeLog 17 Jun 2008 06:19:06 -0000 1.6950
+++ ChangeLog 17 Jun 2008 07:18:46 -0000 1.6951
@@ -1,5 +1,14 @@
2008-06-17 Benjamin Wolsey <address@hidden>
+ * server/asobj/Error_as.{cpp,h}: regenerate unimplemented Error
+ class.
+ * server/asobj/ClassHierarchy.cpp: Error also works in SWF6.
+ Update includes.
+ * server/asobj/Global.cpp: update include (it's not necessary at
+ all now, but may be if Error is an ASnative function).
+
+2008-06-17 Benjamin Wolsey <address@hidden>
+
* gui/kde.cpp: PIXELS_TO_TWIPS is now in utility.h.
2008-06-17 Benjamin Wolsey <address@hidden>
Index: server/asobj/ClassHierarchy.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/ClassHierarchy.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- server/asobj/ClassHierarchy.cpp 25 May 2008 10:05:22 -0000 1.18
+++ server/asobj/ClassHierarchy.cpp 17 Jun 2008 07:18:47 -0000 1.19
@@ -29,7 +29,7 @@
#include "ContextMenu.h"
#include "CustomActions.h"
#include "Date.h"
-#include "Error.h"
+#include "Error_as.h"
#include "Global.h"
#include "gstring.h"
#include "Key.h"
@@ -289,7 +289,7 @@
{ netstream_class_init, NSV::CLASS_NET_STREAM, NSV::CLASS_OBJECT,
NSV::NS_FLASH_NET, 6 },
{ contextmenu_class_init, NSV::CLASS_CONTEXT_MENU, NSV::CLASS_OBJECT,
NSV::NS_FLASH_UI, 7 },
{ moviecliploader_class_init, NSV::CLASS_MOVIE_CLIP_LOADER,
NSV::CLASS_OBJECT, NS_GLOBAL, 7 },
- { error_class_init, NSV::CLASS_ERROR, NSV::CLASS_OBJECT, NS_GLOBAL, 7 },
+ { Error_class_init, NSV::CLASS_ERROR, NSV::CLASS_OBJECT, NS_GLOBAL, 6 },
};
void
Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -b -r1.132 -r1.133
--- server/asobj/Global.cpp 29 May 2008 18:10:52 -0000 1.132
+++ server/asobj/Global.cpp 17 Jun 2008 07:18:48 -0000 1.133
@@ -34,7 +34,7 @@
#include "ContextMenu.h"
#include "CustomActions.h"
#include "Date.h"
-#include "Error.h"
+#include "Error_as.h"
#include "Global.h"
#include "gstring.h"
#include "Key.h"
Index: server/asobj/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Makefile.am,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- server/asobj/Makefile.am 9 Jun 2008 20:53:51 -0000 1.55
+++ server/asobj/Makefile.am 17 Jun 2008 07:18:48 -0000 1.56
@@ -50,7 +50,7 @@
ContextMenu.cpp \
CustomActions.cpp\
Date.cpp \
- Error.cpp \
+ Error_as.cpp \
Global.cpp \
Key.cpp \
LoadVars.cpp \
@@ -113,7 +113,7 @@
ContextMenu.h \
CustomActions.h \
Date.h \
- Error.h \
+ Error_as.h \
GMath.h \
Global.h\
Key.h \
Index: server/asobj/Error_as.cpp
===================================================================
RCS file: server/asobj/Error_as.cpp
diff -N server/asobj/Error_as.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/asobj/Error_as.cpp 17 Jun 2008 07:18:48 -0000 1.1
@@ -0,0 +1,141 @@
+// Error_as.cpp: ActionScript "Error" class, for Gnash.
+//
+// Copyright (C) 2005, 2006, 2007, 2008 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 3 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
+//
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "Error_as.h"
+#include "as_object.h" // for inheritance
+#include "log.h"
+#include "fn_call.h"
+#include "smart_ptr.h" // for boost intrusive_ptr
+#include "builtin_function.h" // need builtin_function
+#include "GnashException.h" // for ActionException
+#include "Object.h" // for AS inheritance
+#include "VM.h" // for addStatics
+
+#include <sstream>
+
+namespace gnash {
+
+static as_value Error_message_getset(const fn_call& fn);
+static as_value Error_name_getset(const fn_call& fn);
+
+
+as_value Error_ctor(const fn_call& fn);
+
+static void
+attachErrorInterface(as_object& o)
+{
+ o.init_property("message", Error_message_getset, Error_message_getset);
+ o.init_property("name", Error_name_getset, Error_name_getset);
+}
+
+static void
+attachErrorStaticProperties(as_object& o)
+{
+
+}
+
+static as_object*
+getErrorInterface()
+{
+ static boost::intrusive_ptr<as_object> o;
+
+ if ( ! o )
+ {
+ // TODO: check if this class should inherit from Object
+ // or from a different class
+ o = new as_object(getObjectInterface());
+ VM::get().addStatic(o.get());
+
+ attachErrorInterface(*o);
+
+ }
+
+ return o.get();
+}
+
+class Error_as: public as_object
+{
+
+public:
+
+ Error_as()
+ :
+ as_object(getErrorInterface())
+ {}
+
+ // override from as_object ?
+ //std::string get_text_value() const { return "Error"; }
+
+ // override from as_object ?
+ //double get_numeric_value() const { return 0; }
+};
+
+static as_value
+Error_message_getset(const fn_call& fn)
+{
+ boost::intrusive_ptr<Error_as> ptr = ensureType<Error_as>(fn.this_ptr);
+ UNUSED(ptr);
+ LOG_ONCE( log_unimpl (__FUNCTION__) );
+ return as_value();
+}
+
+static as_value
+Error_name_getset(const fn_call& fn)
+{
+ boost::intrusive_ptr<Error_as> ptr = ensureType<Error_as>(fn.this_ptr);
+ UNUSED(ptr);
+ LOG_ONCE( log_unimpl (__FUNCTION__) );
+ return as_value();
+}
+
+
+
+as_value
+Error_ctor(const fn_call& fn)
+{
+ boost::intrusive_ptr<as_object> obj = new Error_as;
+
+ if ( fn.nargs )
+ {
+ std::stringstream ss;
+ fn.dump_args(ss);
+ LOG_ONCE( log_unimpl("Error(%s): %s", ss.str(), _("arguments
discarded")) );
+ }
+
+ return as_value(obj.get()); // will keep alive
+}
+
+// extern
+void Error_class_init(as_object& where)
+{
+ // This is going to be the Error "class"/"function"
+ // in the 'where' package
+ boost::intrusive_ptr<builtin_function> cl;
+ cl = new builtin_function(&Error_ctor, getErrorInterface());
+ attachErrorStaticProperties(*cl);
+
+ // Register _global.Error
+ where.init_member("Error", cl.get());
+}
+
+} // end of gnash namespace
Index: server/asobj/Error_as.h
===================================================================
RCS file: server/asobj/Error_as.h
diff -N server/asobj/Error_as.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/asobj/Error_as.h 17 Jun 2008 07:18:48 -0000 1.1
@@ -0,0 +1,42 @@
+// Error_as.h: ActionScript "Error" class, for Gnash.
+//
+// Copyright (C) 2005, 2006, 2007, 2008 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 3 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
+//
+
+#ifndef GNASH_ASOBJ_ERROR_H
+#define GNASH_ASOBJ_ERROR_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+//#include <smart_ptr.h> // for intrusive_ptr and GC stuff
+
+namespace gnash {
+
+class as_object;
+
+/// Initialize the global Error class
+void Error_class_init(as_object& global);
+
+/// Return a Error instance (in case the core lib needs it)
+//boost::intrusive_ptr<as_object> init_Error_instance();
+
+} // end of gnash namespace
+
+// GNASH_ASOBJ_ERROR_H
+#endif
Index: server/asobj/Error.cpp
===================================================================
RCS file: server/asobj/Error.cpp
diff -N server/asobj/Error.cpp
--- server/asobj/Error.cpp 21 Jan 2008 20:55:55 -0000 1.12
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,109 +0,0 @@
-// Error.cpp: ActionScript "Error" class, for Gnash.
-//
-// Copyright (C) 2005, 2006, 2007, 2008 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 3 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
-//
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include "Error.h"
-#include "as_object.h" // for inheritance
-#include "log.h"
-#include "fn_call.h"
-#include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "Object.h" // for getObjectInterface
-
-namespace gnash {
-
-as_value error_tostring(const fn_call& fn);
-as_value error_ctor(const fn_call& fn);
-
-static void
-attachErrorInterface(as_object& o)
-{
- // is this really needed ? shouldn't toString be
- // derived from Object inheritance ?
- o.init_member("toString", new builtin_function(error_tostring));
-}
-
-static as_object*
-getErrorInterface()
-{
- static boost::intrusive_ptr<as_object> o;
- if ( ! o )
- {
- o = new as_object(getObjectInterface());
- attachErrorInterface(*o);
- }
- return o.get();
-}
-
-class error_as_object: public as_object
-{
-
-public:
-
- error_as_object()
- :
- as_object(getErrorInterface())
- {}
-
- // override from as_object ?
- //std::string get_text_value() const { return "Error"; }
-
- // override from as_object ?
- //double get_numeric_value() const { return 0; }
-};
-
-as_value error_tostring(const fn_call& /*fn*/) {
- log_unimpl (__FUNCTION__);
- return as_value();
-}
-
-as_value
-error_ctor(const fn_call& /* fn */)
-{
- boost::intrusive_ptr<as_object> obj = new error_as_object;
-
- return as_value(obj.get()); // will keep alive
-}
-
-// extern (used by Global.cpp)
-void error_class_init(as_object& global)
-{
- // This is going to be the global Error "class"/"function"
- static boost::intrusive_ptr<builtin_function> cl;
-
- if ( cl == NULL )
- {
- cl=new builtin_function(&error_ctor, getErrorInterface());
- // replicate all interface to class, to be able to access
- // all methods as static functions
- attachErrorInterface(*cl);
-
- }
-
- // Register _global.Error
- global.init_member("Error", cl.get());
-
-}
-
-
-} // end of gnash namespace
-
Index: server/asobj/Error.h
===================================================================
RCS file: server/asobj/Error.h
diff -N server/asobj/Error.h
--- server/asobj/Error.h 26 Mar 2008 21:34:21 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,38 +0,0 @@
-//
-// Copyright (C) 2005, 2006, 2007, 2008 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 3 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
-//
-
-#ifndef __GNASH_ASOBJ_ERROR_H__
-#define __GNASH_ASOBJ_ERROR_H__
-
-#include <memory> // for auto_ptr
-
-namespace gnash {
-
-class as_object;
-
-/// Initialize the global Error class
-void error_class_init(as_object& global);
-
-/// Return a Error instance (in case the core lib needs it)
-//std::auto_ptr<as_object> init_error_instance();
-
-} // end of gnash namespace
-
-// __GNASH_ASOBJ_ERROR_H__
-#endif
-
- [Gnash-commit] gnash ChangeLog server/asobj/ClassHierarchy.cpp...,
Benjamin Wolsey <=