gnash-commit
[Top][All Lists]
Advanced

[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: Thu, 18 Jan 2007 16:28:10 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/01/18 16:28:10

Modified files:
        .              : ChangeLog 
        server/asobj   : Global.cpp xml.cpp xml.h 

Log message:
                * server/asobj/: Global.cpp, xml.{cpp,h}: second pass of new 
layout
                  port: use xml_class_init and hide method functions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2134&r2=1.2135
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xml.cpp?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/xml.h?cvsroot=gnash&r1=1.3&r2=1.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2134
retrieving revision 1.2135
diff -u -b -r1.2134 -r1.2135
--- ChangeLog   18 Jan 2007 16:11:27 -0000      1.2134
+++ ChangeLog   18 Jan 2007 16:28:10 -0000      1.2135
@@ -1,5 +1,10 @@
 2007-01-18 Sandro Santilli <address@hidden>
 
+       * server/asobj/: Global.cpp, xml.{cpp,h}: second pass of new layout
+         port: use xml_class_init and hide method functions.
+
+2007-01-18 Sandro Santilli <address@hidden>
+
        * server/asobj/xml.{cpp,h}: first pass of new layout port.
        * testsuite/actionscript.all/XML.as: first unexpected success.
 

Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/asobj/Global.cpp     18 Jan 2007 13:43:06 -0000      1.31
+++ server/asobj/Global.cpp     18 Jan 2007 16:28:10 -0000      1.32
@@ -18,7 +18,7 @@
 
 // Implementation of the Global ActionScript Object
 
-/* $Id: Global.cpp,v 1.31 2007/01/18 13:43:06 strk Exp $ */
+/* $Id: Global.cpp,v 1.32 2007/01/18 16:28:10 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -456,7 +456,7 @@
        color_class_init(*this);
        selection_class_init(*this); // Selection
        set_member("Sound", as_value(sound_new));
-       set_member("XML", as_value(xml_new));
+       xml_class_init(*this);
        xmlnode_class_init(*this);
        set_member("XMLSocket", as_value(xmlsocket_new));
        set_member("Date", as_value(date_new));

Index: server/asobj/xml.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xml.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/asobj/xml.cpp        18 Jan 2007 16:11:27 -0000      1.8
+++ server/asobj/xml.cpp        18 Jan 2007 16:28:10 -0000      1.9
@@ -14,31 +14,31 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: xml.cpp,v 1.8 2007/01/18 16:11:27 strk Exp $ */
+/* $Id: xml.cpp,v 1.9 2007/01/18 16:28:10 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string>
-#include <vector>
-
 #include "log.h"
 #include "tu_config.h"
 #include "as_function.h" // for as_function
 #include "fn_call.h"
 
-
-#include <unistd.h>
 #include "xmlattrs.h"
 #include "xmlnode.h"
 #include "xml.h"
+#include "builtin_function.h"
+
 #include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <libxml/xmlreader.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string>
+#include <vector>
 
 using namespace std;
 
@@ -48,6 +48,34 @@
 
 static as_object* getXMLInterface();
   
+DSOEXPORT void xml_new(const fn_call& fn);
+static void xml_load(const fn_call& fn);
+static void xml_set_current(const fn_call& fn);
+
+static void xml_addrequestheader(const fn_call& fn);
+static void xml_appendchild(const fn_call& fn);
+static void xml_clonenode(const fn_call& fn);
+static void xml_createelement(const fn_call& fn);
+static void xml_createtextnode(const fn_call& fn);
+static void xml_getbytesloaded(const fn_call& fn);
+static void xml_getbytestotal(const fn_call& fn);
+static void xml_haschildnodes(const fn_call& fn);
+static void xml_insertbefore(const fn_call& fn);
+static void xml_parsexml(const fn_call& fn);
+static void xml_removenode(const fn_call& fn);
+static void xml_send(const fn_call& fn);
+static void xml_sendandload(const fn_call& fn);
+static void xml_tostring(const fn_call& fn);
+
+// These are the event handlers called for this object
+static void xml_onload(const fn_call& fn);
+static void xml_ondata(const fn_call& fn);
+static void xml_loaded(const fn_call& fn);
+
+// Properties
+static void xml_nodename(const fn_call& fn);
+static void xml_nodevalue(const fn_call& fn);
+  
 XML::XML() 
        :
        as_object(getXMLInterface()),
@@ -1346,6 +1374,25 @@
     return (x + (4 - x % 4));
 }
 
+// extern (used by Global.cpp)
+void xml_class_init(as_object& global)
+{
+       // This is going to be the global XML "class"/"function"
+       static boost::intrusive_ptr<builtin_function> cl;
+
+       if ( cl == NULL )
+       {
+               cl=new builtin_function(&xml_new, getXMLInterface());
+               // replicate all interface to class, to be able to access
+               // all methods as static functions
+               attachXMLInterface(*cl);
+                    
+       }
+
+       // Register _global.String
+       global.set_member("XML", cl.get());
+
+}
 
 } // end of gnash namespace
 

Index: server/asobj/xml.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/xml.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/asobj/xml.h  18 Jan 2007 16:11:27 -0000      1.3
+++ server/asobj/xml.h  18 Jan 2007 16:28:10 -0000      1.4
@@ -203,34 +203,11 @@
 };
 
 
-DSOEXPORT void xml_load(const fn_call& fn);
-DSOEXPORT void xml_set_current(const fn_call& fn);
-DSOEXPORT void xml_new(const fn_call& fn);
-
-DSOEXPORT void xml_addrequestheader(const fn_call& fn);
-DSOEXPORT void xml_appendchild(const fn_call& fn);
-DSOEXPORT void xml_clonenode(const fn_call& fn);
-DSOEXPORT void xml_createelement(const fn_call& fn);
-DSOEXPORT void xml_createtextnode(const fn_call& fn);
-DSOEXPORT void xml_getbytesloaded(const fn_call& fn);
-DSOEXPORT void xml_getbytestotal(const fn_call& fn);
-DSOEXPORT void xml_haschildnodes(const fn_call& fn);
-DSOEXPORT void xml_insertbefore(const fn_call& fn);
-DSOEXPORT void xml_parsexml(const fn_call& fn);
-DSOEXPORT void xml_removenode(const fn_call& fn);
-DSOEXPORT void xml_send(const fn_call& fn);
-DSOEXPORT void xml_sendandload(const fn_call& fn);
-DSOEXPORT void xml_tostring(const fn_call& fn);
-
-// These are the event handlers called for this object
-DSOEXPORT void xml_onload(const fn_call& fn);
-DSOEXPORT void xml_ondata(const fn_call& fn);
-DSOEXPORT void xml_loaded(const fn_call& fn);
-
-// Properties
-DSOEXPORT void xml_nodename(const fn_call& fn);
-DSOEXPORT void xml_nodevalue(const fn_call& fn);
+DSOEXPORT void xml_class_init(as_object& global);
 
+// Exporting this is a temporary hack for not changing xmlsocket.cpp now
+// (xmlsocket_xml_new calls xml_new)
+DSOEXPORT void xml_new(const fn_call& fn);
 
 DSOEXPORT int memadjust(int x);
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]