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: Mon, 05 May 2008 15:35:05 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/05/05 15:35:05

Modified files:
        .              : ChangeLog 
        server/asobj   : Global.cpp flash_pkg.cpp gen-asclass.pl 
        server/asobj/flash: display_pkg.cpp external_pkg.cpp 
                            filters_pkg.cpp geom_pkg.cpp net_pkg.cpp 
                            text_pkg.cpp 
        server/asobj/flash/display: BitmapData_as.cpp 
        server/asobj/flash/external: ExternalInterface_as.cpp 
        server/asobj/flash/filters: DisplacementMapFilter_as.cpp 
        server/asobj/flash/geom: ColorTransform_as.cpp Matrix_as.cpp 
                                 Point_as.cpp Rectangle_as.cpp 
                                 Transform_as.cpp 
        server/asobj/flash/net: FileReferenceList_as.cpp 
                                FileReference_as.cpp 
        server/asobj/flash/text: TextRenderer_as.cpp 

Log message:
        Load flash package on demand for swf8

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6505&r2=1.6506
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.123&r2=1.124
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash_pkg.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/gen-asclass.pl?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/display_pkg.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/external_pkg.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/filters_pkg.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/geom_pkg.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/net_pkg.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/text_pkg.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/display/BitmapData_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/external/ExternalInterface_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/filters/DisplacementMapFilter_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/geom/ColorTransform_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/geom/Matrix_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/geom/Point_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/geom/Rectangle_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/geom/Transform_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/net/FileReferenceList_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/net/FileReference_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/flash/text/TextRenderer_as.cpp?cvsroot=gnash&r1=1.2&r2=1.3

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6505
retrieving revision 1.6506
diff -u -b -r1.6505 -r1.6506
--- ChangeLog   5 May 2008 15:34:22 -0000       1.6505
+++ ChangeLog   5 May 2008 15:35:02 -0000       1.6506
@@ -1,3 +1,20 @@
+2008-05-05 Sandro Santilli <address@hidden>
+
+       * server/asobj/Global.cpp: call flash_package_init for SWF8 up.
+       * server/asobj/gen-asclass.pl: don't attach interface to class,
+         don't use statics for GcResources.
+       * server/asobj/: flash_pkg.cpp, flash/display_pkg.cpp,
+         flash/external_pkg.cpp, flash/filters_pkg.cpp,
+         flash/geom_pkg.cpp, flash/net_pkg.cpp,
+         flash/text_pkg.cpp, flash/display/BitmapData_as.cpp,
+         flash/external/ExternalInterface_as.cpp,
+         flash/filters/DisplacementMapFilter_as.cpp,
+         flash/geom/ColorTransform_as.cpp, flash/geom/Matrix_as.cpp,
+         flash/geom/Point_as.cpp, flash/geom/Rectangle_as.cpp,
+         flash/geom/Transform_as.cpp, flash/net/FileReferenceList_as.cpp,
+         flash/net/FileReference_as.cpp, flash/text/TextRenderer_as.cpp:
+         Load flash package and subpackages (objects) on demand.
+
 2008-05-05 Benjamin Wolsey <address@hidden>
 
        * testsuite/actionscript.all/LocalConnection.as: add more tests,

Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -b -r1.123 -r1.124
--- server/asobj/Global.cpp     5 May 2008 13:29:50 -0000       1.123
+++ server/asobj/Global.cpp     5 May 2008 15:35:03 -0000       1.124
@@ -67,6 +67,7 @@
 #include "ClassHierarchy.h"
 #include "namedStrings.h"
 #include "tu_math.h" // for isfinite replacement
+#include "flash_pkg.h"
 
 #include "fn_call.h"
 #include "sprite_instance.h"
@@ -186,6 +187,8 @@
     {
         case 9:
         case 8:
+               flash_package_init(*this);
+
         case 7:
         case 6:
 

Index: server/asobj/flash_pkg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash_pkg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash_pkg.cpp  5 May 2008 08:57:28 -0000       1.1
+++ server/asobj/flash_pkg.cpp  5 May 2008 15:35:03 -0000       1.2
@@ -31,10 +31,10 @@
 
 namespace gnash {
 
-void
-flash_package_init(as_object& global)
+static as_value
+get_flash_package(const fn_call& /*fn*/)
 {
-       assert(global.getVM().getSWFVersion() >= 8);
+       log_debug("Loading flash package");
 
        as_object* pkg = new as_object(getObjectInterface());
 
@@ -47,8 +47,16 @@
        flash_net_package_init(*pkg);
        flash_text_package_init(*pkg);
 
-       // TODO: use a destructive getter-setter
-       global.init_member("flash", pkg);
+       return pkg;
+}
+
+void
+flash_package_init(as_object& global)
+{
+       assert(global.getVM().getSWFVersion() >= 8);
+
+       string_table& st = global.getVM().getStringTable();
+       global.init_destructive_property(st.find("flash"), get_flash_package);
 }
 
 } // end of gnash namespace

Index: server/asobj/gen-asclass.pl
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/gen-asclass.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/asobj/gen-asclass.pl 5 May 2008 13:36:25 -0000       1.8
+++ server/asobj/gen-asclass.pl 5 May 2008 15:35:03 -0000       1.9
@@ -193,17 +193,20 @@
 {$registrations
 }
 
+static void
+attach$args{class}StaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 get$args{class}Interface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attach$args{class}Interface(*o);
-       }
        return o.get();
 }
 
@@ -240,22 +243,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void $args{lc}_class_init(as_object& global)
+// extern 
+void $args{lc}_class_init(as_object& where)
 {
-       // This is going to be the global $args{class} "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the $args{class} "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&$args{lc}_ctor, 
get$args{class}Interface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attach$args{class}Interface(*cl);
-       }
+       attach$args{class}StaticProperties(*cl);
 
        // Register _global.$args{class}
-       global.init_member("$args{class}", cl.get());
+       where.init_member("$args{class}", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/display_pkg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/display_pkg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash/display_pkg.cpp  5 May 2008 08:57:29 -0000       1.1
+++ server/asobj/flash/display_pkg.cpp  5 May 2008 15:35:03 -0000       1.2
@@ -20,18 +20,30 @@
 #include "Object.h" // for getObjectInterface
 #include "as_object.h"
 
+#include "string_table.h"
+#include "VM.h"
+
 #include "flash/display/BitmapData_as.h"
 
 namespace gnash {
 
-void
-flash_display_package_init(as_object& where)
+static as_value
+get_flash_display_package(const fn_call& /*fn*/)
 {
+       log_debug("Loading flash.display package");
+
        as_object* pkg = new as_object(getObjectInterface());
 
        BitmapData_class_init(*pkg);
 
-       where.init_member("display", pkg);
+       return pkg;
+}
+
+void
+flash_display_package_init(as_object& where)
+{
+       string_table& st = where.getVM().getStringTable();
+       where.init_destructive_property(st.find("display"), 
get_flash_display_package);
 }
 
 

Index: server/asobj/flash/external_pkg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/external_pkg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash/external_pkg.cpp 5 May 2008 08:57:29 -0000       1.1
+++ server/asobj/flash/external_pkg.cpp 5 May 2008 15:35:03 -0000       1.2
@@ -20,18 +20,30 @@
 #include "Object.h" // for getObjectInterface
 #include "as_object.h"
 
+#include "string_table.h"
+#include "VM.h"
+
 #include "flash/external/ExternalInterface_as.h"
 
 namespace gnash {
 
-void
-flash_external_package_init(as_object& where)
+as_value
+get_flash_external_package(const fn_call& /*fn*/)
 {
+       log_debug("Loading flash.external package");
+
        as_object* pkg = new as_object(getObjectInterface());
 
        ExternalInterface_class_init(*pkg);
 
-       where.init_member("geom", pkg);
+       return pkg;
+}
+
+void
+flash_external_package_init(as_object& where)
+{
+       string_table& st = where.getVM().getStringTable();
+       where.init_destructive_property(st.find("external"), 
get_flash_external_package);
 }
 
 

Index: server/asobj/flash/filters_pkg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/filters_pkg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash/filters_pkg.cpp  5 May 2008 08:57:29 -0000       1.1
+++ server/asobj/flash/filters_pkg.cpp  5 May 2008 15:35:03 -0000       1.2
@@ -20,6 +20,9 @@
 #include "Object.h" // for getObjectInterface
 #include "as_object.h"
 
+#include "string_table.h"
+#include "VM.h"
+
 #include "flash/filters/BevelFilter_as.h"
 #include "flash/filters/BitmapFilter_as.h"
 #include "flash/filters/BlurFilter_as.h"
@@ -33,9 +36,11 @@
 
 namespace gnash {
 
-void
-flash_filters_package_init(as_object& where)
+as_value
+get_flash_filters_package(const fn_call& /*fn*/)
 {
+       log_debug("Loading flash.filters package");
+
        as_object* pkg = new as_object(getObjectInterface());
 
        BevelFilter_class_init(*pkg);
@@ -49,7 +54,14 @@
        GradientBevelFilter_class_init(*pkg);
        GradientGlowFilter_class_init(*pkg);
 
-       where.init_member("filters", pkg);
+       return pkg;
+}
+
+void
+flash_filters_package_init(as_object& where)
+{
+       string_table& st = where.getVM().getStringTable();
+       where.init_destructive_property(st.find("filters"), 
get_flash_filters_package);
 }
 
 

Index: server/asobj/flash/geom_pkg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/geom_pkg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash/geom_pkg.cpp     5 May 2008 08:57:29 -0000       1.1
+++ server/asobj/flash/geom_pkg.cpp     5 May 2008 15:35:03 -0000       1.2
@@ -20,6 +20,9 @@
 #include "Object.h" // for getObjectInterface
 #include "as_object.h"
 
+#include "string_table.h"
+#include "VM.h"
+
 #include "flash/geom/ColorTransform_as.h"
 #include "flash/geom/Matrix_as.h"
 #include "flash/geom/Point_as.h"
@@ -28,9 +31,11 @@
 
 namespace gnash {
 
-void
-flash_geom_package_init(as_object& where)
+as_value
+get_flash_geom_package(const fn_call& /*fn*/)
 {
+       log_debug("Loading flash.geom package");
+
        as_object* pkg = new as_object(getObjectInterface());
 
        ColorTransform_class_init(*pkg);
@@ -39,7 +44,14 @@
        Rectangle_class_init(*pkg);
        Transform_class_init(*pkg);
 
-       where.init_member("geom", pkg);
+       return pkg;
+}
+
+void
+flash_geom_package_init(as_object& where)
+{
+       string_table& st = where.getVM().getStringTable();
+       where.init_destructive_property(st.find("geom"), 
get_flash_geom_package);
 }
 
 

Index: server/asobj/flash/net_pkg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/net_pkg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash/net_pkg.cpp      5 May 2008 08:57:29 -0000       1.1
+++ server/asobj/flash/net_pkg.cpp      5 May 2008 15:35:03 -0000       1.2
@@ -20,20 +20,32 @@
 #include "Object.h" // for getObjectInterface
 #include "as_object.h"
 
+#include "string_table.h"
+#include "VM.h"
+
 #include "flash/net/FileReference_as.h"
 #include "flash/net/FileReferenceList_as.h"
 
 namespace gnash {
 
-void
-flash_net_package_init(as_object& where)
+as_value
+get_flash_net_package(const fn_call& /*fn*/)
 {
+       log_debug("Loading flash.net package");
+
        as_object* pkg = new as_object(getObjectInterface());
 
        FileReference_class_init(*pkg);
        FileReferenceList_class_init(*pkg);
 
-       where.init_member("geom", pkg);
+       return pkg;
+}
+
+void
+flash_net_package_init(as_object& where)
+{
+       string_table& st = where.getVM().getStringTable();
+       where.init_destructive_property(st.find("net"), get_flash_net_package);
 }
 
 

Index: server/asobj/flash/text_pkg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/text_pkg.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- server/asobj/flash/text_pkg.cpp     5 May 2008 08:57:29 -0000       1.1
+++ server/asobj/flash/text_pkg.cpp     5 May 2008 15:35:03 -0000       1.2
@@ -20,18 +20,30 @@
 #include "Object.h" // for getObjectInterface
 #include "as_object.h"
 
+#include "string_table.h"
+#include "VM.h"
+
 #include "flash/text/TextRenderer_as.h"
 
 namespace gnash {
 
-void
-flash_text_package_init(as_object& where)
+as_value
+get_flash_text_package(const fn_call& /*fn*/)
 {
+       log_debug("Loading flash.text package");
+
        as_object* pkg = new as_object(getObjectInterface());
 
        TextRenderer_class_init(*pkg);
 
-       where.init_member("geom", pkg);
+       return pkg;
+}
+
+void
+flash_text_package_init(as_object& where)
+{
+       string_table& st = where.getVM().getStringTable();
+       where.init_destructive_property(st.find("text"), 
get_flash_text_package);
 }
 
 

Index: server/asobj/flash/display/BitmapData_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/display/BitmapData_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/display/BitmapData_as.cpp        5 May 2008 13:36:25 
-0000       1.2
+++ server/asobj/flash/display/BitmapData_as.cpp        5 May 2008 15:35:04 
-0000       1.3
@@ -97,17 +97,20 @@
     o.init_property("width", BitmapData_width_getset, BitmapData_width_getset);
 }
 
+static void
+attachBitmapDataStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getBitmapDataInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachBitmapDataInterface(*o);
-       }
        return o.get();
 }
 
@@ -396,22 +399,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void BitmapData_class_init(as_object& global)
+// extern 
+void BitmapData_class_init(as_object& where)
 {
-       // This is going to be the global BitmapData "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the BitmapData "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&BitmapData_ctor, 
getBitmapDataInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachBitmapDataInterface(*cl);
-       }
+       attachBitmapDataStaticProperties(*cl);
 
        // Register _global.BitmapData
-       global.init_member("BitmapData", cl.get());
+       where.init_member("BitmapData", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/external/ExternalInterface_as.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/server/asobj/flash/external/ExternalInterface_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/external/ExternalInterface_as.cpp        5 May 2008 
13:36:25 -0000       1.2
+++ server/asobj/flash/external/ExternalInterface_as.cpp        5 May 2008 
15:35:04 -0000       1.3
@@ -47,17 +47,20 @@
     o.init_property("available", ExternalInterface_available_getset, 
ExternalInterface_available_getset);
 }
 
+static void
+attachExternalInterfaceStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getExternalInterfaceInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachExternalInterfaceInterface(*o);
-       }
        return o.get();
 }
 
@@ -121,22 +124,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void ExternalInterface_class_init(as_object& global)
+// extern 
+void ExternalInterface_class_init(as_object& where)
 {
-       // This is going to be the global ExternalInterface "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the ExternalInterface "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&ExternalInterface_ctor, 
getExternalInterfaceInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachExternalInterfaceInterface(*cl);
-       }
+       attachExternalInterfaceStaticProperties(*cl);
 
        // Register _global.ExternalInterface
-       global.init_member("ExternalInterface", cl.get());
+       where.init_member("ExternalInterface", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/filters/DisplacementMapFilter_as.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/server/asobj/flash/filters/DisplacementMapFilter_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/filters/DisplacementMapFilter_as.cpp     5 May 2008 
13:36:25 -0000       1.2
+++ server/asobj/flash/filters/DisplacementMapFilter_as.cpp     5 May 2008 
15:35:04 -0000       1.3
@@ -61,17 +61,20 @@
     o.init_property("scaleY", DisplacementMapFilter_scaleY_getset, 
DisplacementMapFilter_scaleY_getset);
 }
 
+static void
+attachDisplacementMapFilterStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getDisplacementMapFilterInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachDisplacementMapFilterInterface(*o);
-       }
        return o.get();
 }
 
@@ -198,22 +201,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void DisplacementMapFilter_class_init(as_object& global)
+// extern 
+void DisplacementMapFilter_class_init(as_object& where)
 {
-       // This is going to be the global DisplacementMapFilter 
"class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the DisplacementMapFilter "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&DisplacementMapFilter_ctor, 
getDisplacementMapFilterInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachDisplacementMapFilterInterface(*cl);
-       }
+       attachDisplacementMapFilterStaticProperties(*cl);
 
        // Register _global.DisplacementMapFilter
-       global.init_member("DisplacementMapFilter", cl.get());
+       where.init_member("DisplacementMapFilter", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/geom/ColorTransform_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/geom/ColorTransform_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/geom/ColorTransform_as.cpp       5 May 2008 13:36:25 
-0000       1.2
+++ server/asobj/flash/geom/ColorTransform_as.cpp       5 May 2008 15:35:04 
-0000       1.3
@@ -63,17 +63,20 @@
     o.init_property("rgb", ColorTransform_rgb_getset, 
ColorTransform_rgb_getset);
 }
 
+static void
+attachColorTransformStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getColorTransformInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachColorTransformInterface(*o);
-       }
        return o.get();
 }
 
@@ -209,22 +212,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void ColorTransform_class_init(as_object& global)
+// extern 
+void ColorTransform_class_init(as_object& where)
 {
-       // This is going to be the global ColorTransform "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the ColorTransform "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&ColorTransform_ctor, 
getColorTransformInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachColorTransformInterface(*cl);
-       }
+       attachColorTransformStaticProperties(*cl);
 
        // Register _global.ColorTransform
-       global.init_member("ColorTransform", cl.get());
+       where.init_member("ColorTransform", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/geom/Matrix_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/geom/Matrix_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/geom/Matrix_as.cpp       5 May 2008 13:36:26 -0000       
1.2
+++ server/asobj/flash/geom/Matrix_as.cpp       5 May 2008 15:35:04 -0000       
1.3
@@ -77,17 +77,20 @@
     o.init_property("ty", Matrix_ty_getset, Matrix_ty_getset);
 }
 
+static void
+attachMatrixStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getMatrixInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachMatrixInterface(*o);
-       }
        return o.get();
 }
 
@@ -286,22 +289,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void Matrix_class_init(as_object& global)
+// extern 
+void Matrix_class_init(as_object& where)
 {
-       // This is going to be the global Matrix "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the Matrix "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&Matrix_ctor, getMatrixInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachMatrixInterface(*cl);
-       }
+       attachMatrixStaticProperties(*cl);
 
        // Register _global.Matrix
-       global.init_member("Matrix", cl.get());
+       where.init_member("Matrix", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/geom/Point_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/geom/Point_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/geom/Point_as.cpp        5 May 2008 13:36:26 -0000       
1.2
+++ server/asobj/flash/geom/Point_as.cpp        5 May 2008 15:35:04 -0000       
1.3
@@ -67,17 +67,20 @@
     o.init_property("y", Point_y_getset, Point_y_getset);
 }
 
+static void
+attachPointStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getPointInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachPointInterface(*o);
-       }
        return o.get();
 }
 
@@ -231,22 +234,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void Point_class_init(as_object& global)
+// extern 
+void Point_class_init(as_object& where)
 {
-       // This is going to be the global Point "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the Point "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&Point_ctor, getPointInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachPointInterface(*cl);
-       }
+       attachPointStaticProperties(*cl);
 
        // Register _global.Point
-       global.init_member("Point", cl.get());
+       where.init_member("Point", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/geom/Rectangle_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/geom/Rectangle_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/geom/Rectangle_as.cpp    5 May 2008 13:36:26 -0000       
1.2
+++ server/asobj/flash/geom/Rectangle_as.cpp    5 May 2008 15:35:04 -0000       
1.3
@@ -93,17 +93,20 @@
     o.init_property("y", Rectangle_y_getset, Rectangle_y_getset);
 }
 
+static void
+attachRectangleStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getRectangleInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachRectangleInterface(*o);
-       }
        return o.get();
 }
 
@@ -374,22 +377,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void Rectangle_class_init(as_object& global)
+// extern 
+void Rectangle_class_init(as_object& where)
 {
-       // This is going to be the global Rectangle "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the Rectangle "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&Rectangle_ctor, 
getRectangleInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachRectangleInterface(*cl);
-       }
+       attachRectangleStaticProperties(*cl);
 
        // Register _global.Rectangle
-       global.init_member("Rectangle", cl.get());
+       where.init_member("Rectangle", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/geom/Transform_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/geom/Transform_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/geom/Transform_as.cpp    5 May 2008 13:36:26 -0000       
1.2
+++ server/asobj/flash/geom/Transform_as.cpp    5 May 2008 15:35:04 -0000       
1.3
@@ -51,17 +51,20 @@
     o.init_property("pixelBounds", Transform_pixelBounds_getset, 
Transform_pixelBounds_getset);
 }
 
+static void
+attachTransformStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getTransformInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachTransformInterface(*o);
-       }
        return o.get();
 }
 
@@ -143,22 +146,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void Transform_class_init(as_object& global)
+// extern 
+void Transform_class_init(as_object& where)
 {
-       // This is going to be the global Transform "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the Transform "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&Transform_ctor, 
getTransformInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachTransformInterface(*cl);
-       }
+       attachTransformStaticProperties(*cl);
 
        // Register _global.Transform
-       global.init_member("Transform", cl.get());
+       where.init_member("Transform", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/net/FileReferenceList_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/net/FileReferenceList_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/net/FileReferenceList_as.cpp     5 May 2008 13:36:26 
-0000       1.2
+++ server/asobj/flash/net/FileReferenceList_as.cpp     5 May 2008 15:35:04 
-0000       1.3
@@ -49,17 +49,20 @@
     o.init_property("fileList", FileReferenceList_fileList_getset, 
FileReferenceList_fileList_getset);
 }
 
+static void
+attachFileReferenceListStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getFileReferenceListInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachFileReferenceListInterface(*o);
-       }
        return o.get();
 }
 
@@ -132,22 +135,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void FileReferenceList_class_init(as_object& global)
+// extern 
+void FileReferenceList_class_init(as_object& where)
 {
-       // This is going to be the global FileReferenceList "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the FileReferenceList "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&FileReferenceList_ctor, 
getFileReferenceListInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachFileReferenceListInterface(*cl);
-       }
+       attachFileReferenceListStaticProperties(*cl);
 
        // Register _global.FileReferenceList
-       global.init_member("FileReferenceList", cl.get());
+       where.init_member("FileReferenceList", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/net/FileReference_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/net/FileReference_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/net/FileReference_as.cpp 5 May 2008 13:36:26 -0000       
1.2
+++ server/asobj/flash/net/FileReference_as.cpp 5 May 2008 15:35:04 -0000       
1.3
@@ -65,17 +65,20 @@
     o.init_property("type", FileReference_type_getset, 
FileReference_type_getset);
 }
 
+static void
+attachFileReferenceStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getFileReferenceInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachFileReferenceInterface(*o);
-       }
        return o.get();
 }
 
@@ -220,22 +223,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void FileReference_class_init(as_object& global)
+// extern 
+void FileReference_class_init(as_object& where)
 {
-       // This is going to be the global FileReference "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the FileReference "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&FileReference_ctor, 
getFileReferenceInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachFileReferenceInterface(*cl);
-       }
+       attachFileReferenceStaticProperties(*cl);
 
        // Register _global.FileReference
-       global.init_member("FileReference", cl.get());
+       where.init_member("FileReference", cl.get());
 }
 
 } // end of gnash namespace

Index: server/asobj/flash/text/TextRenderer_as.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/flash/text/TextRenderer_as.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/asobj/flash/text/TextRenderer_as.cpp 5 May 2008 13:36:26 -0000       
1.2
+++ server/asobj/flash/text/TextRenderer_as.cpp 5 May 2008 15:35:04 -0000       
1.3
@@ -45,17 +45,20 @@
     o.init_property("maxLevel", TextRenderer_maxLevel_getset, 
TextRenderer_maxLevel_getset);
 }
 
+static void
+attachTextRendererStaticProperties(as_object& o)
+{
+       // TODO: add static properties here
+}
+
 static as_object*
 getTextRendererInterface()
 {
-       static boost::intrusive_ptr<as_object> o;
-       if ( ! o )
-       {
+       boost::intrusive_ptr<as_object> o;
                // TODO: check if this class should inherit from Object
                //       or from a different class
                o = new as_object(getObjectInterface());
                attachTextRendererInterface(*o);
-       }
        return o.get();
 }
 
@@ -110,22 +113,17 @@
        return as_value(obj.get()); // will keep alive
 }
 
-// extern (used by Global.cpp)
-void TextRenderer_class_init(as_object& global)
+// extern 
+void TextRenderer_class_init(as_object& where)
 {
-       // This is going to be the global TextRenderer "class"/"function"
-       static boost::intrusive_ptr<builtin_function> cl;
-
-       if ( cl == NULL )
-       {
+       // This is going to be the TextRenderer "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<builtin_function> cl;
                cl=new builtin_function(&TextRenderer_ctor, 
getTextRendererInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachTextRendererInterface(*cl);
-       }
+       attachTextRendererStaticProperties(*cl);
 
        // Register _global.TextRenderer
-       global.init_member("TextRenderer", cl.get());
+       where.init_member("TextRenderer", cl.get());
 }
 
 } // end of gnash namespace




reply via email to

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