[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10930: Stub top-level Namespace cla
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10930: Stub top-level Namespace class. |
Date: |
Wed, 27 May 2009 15:38:07 +0200 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 10930
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-05-27 15:38:07 +0200
message:
Stub top-level Namespace class.
added:
libcore/asobj/Namespace_as.cpp
libcore/asobj/Namespace_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Error_as.h
libcore/asobj/Makefile.am
libcore/namedStrings.cpp
libcore/namedStrings.h
libcore/parser/abc_block.cpp
------------------------------------------------------------
revno: 10927.1.8
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Wed 2009-05-27 14:45:32 +0200
message:
Abc version is not an error.
modified:
libcore/parser/abc_block.cpp
------------------------------------------------------------
revno: 10927.1.9
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Wed 2009-05-27 15:02:02 +0200
message:
Add top-level Namespace class.
added:
libcore/asobj/Namespace_as.cpp
libcore/asobj/Namespace_as.h
modified:
libcore/asobj/ClassHierarchy.cpp
libcore/asobj/Error_as.h
libcore/asobj/Makefile.am
libcore/namedStrings.cpp
libcore/namedStrings.h
=== modified file 'libcore/asobj/ClassHierarchy.cpp'
--- a/libcore/asobj/ClassHierarchy.cpp 2009-05-26 14:42:44 +0000
+++ b/libcore/asobj/ClassHierarchy.cpp 2009-05-27 13:02:02 +0000
@@ -40,6 +40,7 @@
#include "Number_as.h"
#include "Object.h"
#include "Math_as.h"
+#include "Namespace_as.h"
#include "flash/ui/Mouse_as.h"
#include "MovieClipLoader.h"
#include "movie_definition.h"
@@ -343,7 +344,9 @@
NSV::NS_FLASH_ACCESSIBILITY, 5 },
{ int_class_init, NSV::CLASS_INT, NSV::CLASS_OBJECT, NS_GLOBAL, 9 },
{ textfieldautosize_class_init, NSV::CLASS_TEXTFIELDAUTOSIZE,
- NSV::CLASS_OBJECT, NS_GLOBAL, 9 }
+ NSV::CLASS_OBJECT, NS_GLOBAL, 9 },
+ { namespace_class_init, NSV::CLASS_NAMESPACE, NSV::CLASS_OBJECT,
+ NS_GLOBAL, 9 }
// { function_name, name key, super name key, lowest version },
// These classes are all implicitly constructed; that is, it is not necessary
for
=== modified file 'libcore/asobj/Error_as.h'
--- a/libcore/asobj/Error_as.h 2009-02-25 22:33:03 +0000
+++ b/libcore/asobj/Error_as.h 2009-05-27 13:02:02 +0000
@@ -24,8 +24,6 @@
#include "gnashconfig.h"
#endif
-//#include <smart_ptr.h> // for intrusive_ptr and GC stuff
-
namespace gnash {
class as_object;
@@ -33,10 +31,6 @@
/// 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
=== modified file 'libcore/asobj/Makefile.am'
--- a/libcore/asobj/Makefile.am 2009-05-26 14:42:44 +0000
+++ b/libcore/asobj/Makefile.am 2009-05-27 13:02:02 +0000
@@ -76,6 +76,7 @@
PlayHead.cpp \
Selection_as.cpp \
SharedObject_as.cpp\
+ Namespace_as.cpp \
Sound_as.cpp \
Stage_as.cpp \
System_as.cpp \
@@ -124,6 +125,7 @@
XMLSocket_as.h \
XMLNode_as.h \
LoadableObject.h \
+ Namespace_as.h \
Object.h
EXTENSIONS_API = \
=== added file 'libcore/asobj/Namespace_as.cpp'
--- a/libcore/asobj/Namespace_as.cpp 1970-01-01 00:00:00 +0000
+++ b/libcore/asobj/Namespace_as.cpp 2009-05-27 13:02:02 +0000
@@ -0,0 +1,120 @@
+// Namespace_as.cpp: ActionScript Namespace class, for Gnash.
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 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 "Namespace_as.h"
+#include "as_object.h"
+#include "log.h"
+#include "fn_call.h"
+#include "smart_ptr.h" // for boost intrusive_ptr
+#include "builtin_function.h"
+#include "GnashException.h"
+#include "Object.h"
+#include "VM.h"
+
+#include <sstream>
+
+namespace gnash {
+
+namespace {
+ as_value namespace_ctor(const fn_call& fn);
+ as_value namespace_uri(const fn_call& fn);
+ as_value namespace_prefix(const fn_call& fn);
+
+ as_object* getNamespaceInterface();
+ void attachNamespaceInterface(as_object& o);
+}
+
+
+class Namespace_as: public as_object
+{
+
+public:
+
+ Namespace_as()
+ :
+ as_object(getNamespaceInterface())
+ {}
+
+};
+
+
+// extern
+void
+namespace_class_init(as_object& where)
+{
+ boost::intrusive_ptr<builtin_function> cl;
+ cl = new builtin_function(&namespace_ctor, getNamespaceInterface());
+
+ where.init_member("Namespace", cl.get());
+}
+
+
+namespace {
+
+as_object*
+getNamespaceInterface()
+{
+ static boost::intrusive_ptr<as_object> o;
+
+ if (!o) {
+ o = new as_object(getObjectInterface());
+ VM::get().addStatic(o.get());
+ attachNamespaceInterface(*o);
+ }
+
+ return o.get();
+}
+
+
+void
+attachNamespaceInterface(as_object& o)
+{
+ // TODO: prop flags
+ o.init_property("prefix", namespace_prefix, namespace_prefix);
+ o.init_property("uri", namespace_uri, namespace_uri);
+}
+
+as_value
+namespace_prefix(const fn_call& /*fn*/)
+{
+ log_unimpl("Namespace.prefix");
+ return as_value();
+}
+
+as_value
+namespace_uri(const fn_call& /*fn*/)
+{
+ log_unimpl("Namespace.uri");
+ return as_value();
+}
+
+as_value
+namespace_ctor(const fn_call& /*fn*/)
+{
+ log_unimpl("Namespace");
+ boost::intrusive_ptr<as_object> ns = new Namespace_as;
+ return as_value(ns.get());
+}
+
+} // anonymous namespace
+} // gnash namespace
=== added file 'libcore/asobj/Namespace_as.h'
--- a/libcore/asobj/Namespace_as.h 1970-01-01 00:00:00 +0000
+++ b/libcore/asobj/Namespace_as.h 2009-05-27 13:02:02 +0000
@@ -0,0 +1,36 @@
+// Error_as.h: ActionScript "Error" class, for Gnash.
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 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_NAMESPACE_H
+#define GNASH_ASOBJ_NAMESPACE_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+namespace gnash {
+
+class as_object;
+
+/// Initialize the global Error class
+void namespace_class_init(as_object& global);
+
+} // gnash namespace
+
+#endif
=== modified file 'libcore/namedStrings.cpp'
--- a/libcore/namedStrings.cpp 2009-05-25 20:29:04 +0000
+++ b/libcore/namedStrings.cpp 2009-05-27 13:02:02 +0000
@@ -190,6 +190,7 @@
string_table::svt( "LoadVars", NSV::CLASS_LOAD_VARS ),
string_table::svt( "LocalConnection", NSV::CLASS_LOCALCONNECTION ),
string_table::svt( "CustomActions", NSV::CLASS_CUSTOM_ACTIONS ),
+ string_table::svt( "Namespace", NSV::CLASS_NAMESPACE ),
string_table::svt( "NetConnection", NSV::CLASS_NET_CONNECTION ),
string_table::svt( "NetStream", NSV::CLASS_NET_STREAM ),
string_table::svt( "ContextMenu", NSV::CLASS_CONTEXTMENU ),
=== modified file 'libcore/namedStrings.h'
--- a/libcore/namedStrings.h 2009-05-25 20:29:04 +0000
+++ b/libcore/namedStrings.h 2009-05-27 13:02:02 +0000
@@ -74,6 +74,7 @@
CLASS_MOUSE,
CLASS_MOVIE_CLIP,
CLASS_MOVIE_CLIP_LOADER,
+ CLASS_NAMESPACE,
CLASS_NET_CONNECTION,
CLASS_NET_STREAM,
CLASS_NUMBER,
=== modified file 'libcore/parser/abc_block.cpp'
--- a/libcore/parser/abc_block.cpp 2009-05-14 12:54:04 +0000
+++ b/libcore/parser/abc_block.cpp 2009-05-27 12:45:32 +0000
@@ -428,7 +428,7 @@
{
// Minor version, major version.
mVersion = (mS->read_u16()) | (mS->read_u16() << 16);
- log_error(_("Abc Version: %d.%d"), (mVersion & 0xFFFF0000) >> 16,
+ log_debug(_("Abc Version: %d.%d"), (mVersion & 0xFFFF0000) >> 16,
(mVersion & 0x0000FFFF));
return true;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10930: Stub top-level Namespace class.,
Benjamin Wolsey <=