[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: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/Global.cpp server/... |
Date: |
Thu, 17 Apr 2008 08:14:19 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/04/17 08:14:19
Modified files:
. : ChangeLog
server/asobj : Global.cpp System.cpp System.h
Log message:
* server/asobj/System.{h,cpp}: allow registering ASnative
functions,
add notes for unimplemented ASnatives.
* server/asobj/Global.cpp: register System ASnative functions at
startup.
* server/character.h: use std::floor instead of rint and cast
to int.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6310&r2=1.6311
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/System.cpp?cvsroot=gnash&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/System.h?cvsroot=gnash&r1=1.14&r2=1.15
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6310
retrieving revision 1.6311
diff -u -b -r1.6310 -r1.6311
--- ChangeLog 17 Apr 2008 08:13:02 -0000 1.6310
+++ ChangeLog 17 Apr 2008 08:14:17 -0000 1.6311
@@ -1,3 +1,12 @@
+2008-04-17 Benjamin Wolsey <address@hidden>
+
+ * server/asobj/System.{h,cpp}: allow registering ASnative functions,
+ add notes for unimplemented ASnatives.
+ * server/asobj/Global.cpp: register System ASnative functions at
+ startup.
+ * server/character.h: use std::floor instead of rint and cast
+ to int.
+
2008-04-17 Sandro Santilli <address@hidden>
* server/asobj/xml.cpp: handle BOM in XML input.
@@ -12,6 +21,7 @@
* server/asobj/LoadVars.cpp: delegate BOM handling to the new
specialized utf8:: interface.
+>>>>>>> 1.6310
2008-04-16 Sandro Santilli <address@hidden>
* testsuite/actionscript.all/LoadVars.as: check that getBytesLoaded()
Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- server/asobj/Global.cpp 16 Apr 2008 11:54:46 -0000 1.115
+++ server/asobj/Global.cpp 17 Apr 2008 08:14:18 -0000 1.116
@@ -591,6 +591,9 @@
// functions *must* be registered before this.
registerMathNative(*this);
+ // TODO: When should these be registered?
+ registerSystemNative(*this);
+
vm.registerNative(as_global_trace, 100, 4);
init_member("trace", vm.getNative(100, 4));
Index: server/asobj/System.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/System.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- server/asobj/System.cpp 15 Apr 2008 07:52:43 -0000 1.30
+++ server/asobj/System.cpp 17 Apr 2008 08:14:18 -0000 1.31
@@ -42,14 +42,34 @@
static as_value system_exactsettings(const fn_call& fn);
static as_value system_usecodepage(const fn_call& fn);
+void registerSystemNative(as_object& global)
+{
+ VM& vm = global.getVM();
+
+ vm.registerNative(system_security_allowdomain, 12, 0);
+ vm.registerNative(system_showsettings, 2107, 0);
+
+ // From http://osflash.org/flashcoders/undocumented/asnative
+
+ // Run once in startup script then deleted...
+ // System.Capabilities.Query 11, 0
+
+ // System.Product.isRunning 2201, 0
+ // System.Product.isInstalled 2201, 1
+ // System.Product.launch 2201, 2
+ // System.Product.download 2201, 3
+}
+
static as_object*
-getSystemSecurityInterface()
+getSystemSecurityInterface(as_object& o)
{
+ VM& vm = o.getVM();
+
static boost::intrusive_ptr<as_object> proto;
if ( proto == NULL )
{
proto = new as_object(getObjectInterface());
- proto->init_member("allowDomain", new
builtin_function(system_security_allowdomain));
+ proto->init_member("allowDomain", vm.getNative(12, 0));
// TODO: only available when SWF >= 7
proto->init_member("allowInsecureDomain", new
builtin_function(system_security_allowinsecuredomain));
@@ -250,13 +270,14 @@
static void
attachSystemInterface(as_object& proto)
{
+ VM& vm = proto.getVM();
+
// Initialize Function prototype
- proto.init_member("security", getSystemSecurityInterface());
+ proto.init_member("security", getSystemSecurityInterface(proto));
proto.init_member("capabilities", getSystemCapabilitiesInterface());
proto.init_member("setClipboard", new
builtin_function(system_setclipboard));
- proto.init_member("showSettings", new
builtin_function(system_showsettings));
+ proto.init_member("showSettings", vm.getNative(2107, 0));
- VM& vm = proto.getVM();
const int version = vm.getSWFVersion();
as_c_function_ptr gettersetter;
Index: server/asobj/System.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/System.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/asobj/System.h 15 Apr 2008 07:52:43 -0000 1.14
+++ server/asobj/System.h 17 Apr 2008 08:14:18 -0000 1.15
@@ -23,8 +23,9 @@
namespace gnash {
-// System isn't a proper class, so doesn't need a constructor.
+void registerSystemNative(as_object& global);
+// System isn't a proper class, so doesn't need a constructor.
void system_class_init(as_object& global);
} // end of gnash namespace