gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11518: Sort flash.filters class out


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11518: Sort flash.filters class out to avoid static data and fix properties. None of
Date: Tue, 22 Sep 2009 11:44:25 +0200
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11518 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2009-09-22 11:44:25 +0200
message:
  Sort flash.filters class out to avoid static data and fix properties. None of
  it worked before, and none of it is implemented now, but it is at least tidy,
  correct, and more or less ready for an implementation.
  
  Passes in swfdec testsuite.
modified:
  libcore/BevelFilter.h
  libcore/BlurFilter.h
  libcore/DropShadowFilter.h
  libcore/GlowFilter.h
  libcore/GradientBevelFilter.h
  libcore/GradientGlowFilter.h
  libcore/asobj/flash/filters/BevelFilter_as.cpp
  libcore/asobj/flash/filters/BitmapFilter_as.cpp
  libcore/asobj/flash/filters/BitmapFilter_as.h
  libcore/asobj/flash/filters/BlurFilter_as.cpp
  libcore/asobj/flash/filters/BlurFilter_as.h
  libcore/asobj/flash/filters/ColorMatrixFilter_as.cpp
  libcore/asobj/flash/filters/ConvolutionFilter_as.cpp
  libcore/asobj/flash/filters/DropShadowFilter_as.cpp
  libcore/asobj/flash/filters/GlowFilter_as.cpp
  libcore/asobj/flash/filters/GradientBevelFilter_as.cpp
  libcore/asobj/flash/filters/GradientGlowFilter_as.cpp
  libcore/asobj/flash/filters/filters_pkg.cpp
  testsuite/swfdec/PASSING
=== modified file 'libcore/BevelFilter.h'
--- a/libcore/BevelFilter.h     2009-02-25 22:33:03 +0000
+++ b/libcore/BevelFilter.h     2009-09-22 06:50:47 +0000
@@ -58,7 +58,6 @@
         m_quality(quality), m_type(type), m_knockout(knockout)
     { return; }
 
-protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
     boost::uint32_t m_highlightColor; // Color of the highlight.

=== modified file 'libcore/BlurFilter.h'
--- a/libcore/BlurFilter.h      2009-02-25 22:33:03 +0000
+++ b/libcore/BlurFilter.h      2009-09-22 06:56:50 +0000
@@ -42,7 +42,6 @@
         m_blurX(blurX), m_blurY(blurY), m_quality(quality)
     { return; }
 
-protected:
     float m_blurX; // How much horizontal blur.
     float m_blurY; // How much vertical blur.
     boost::uint8_t m_quality; // How many passes to take.

=== modified file 'libcore/DropShadowFilter.h'
--- a/libcore/DropShadowFilter.h        2009-02-25 22:33:03 +0000
+++ b/libcore/DropShadowFilter.h        2009-09-22 07:07:30 +0000
@@ -49,7 +49,6 @@
         m_hideObject(hideObject)
     { return; }
 
-protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
     boost::uint32_t m_color; // RGB color.

=== modified file 'libcore/GlowFilter.h'
--- a/libcore/GlowFilter.h      2009-02-25 22:33:03 +0000
+++ b/libcore/GlowFilter.h      2009-09-22 07:35:58 +0000
@@ -48,7 +48,6 @@
         m_quality(quality), m_inner(inner), m_knockout(knockout)
     { return; }
 
-protected:
     boost::uint32_t m_color; // RGB color.
     boost::uint8_t m_alpha; // Alpha strength, as a percentage(?)
     float m_blurX; // horizontal blur

=== modified file 'libcore/GradientBevelFilter.h'
--- a/libcore/GradientBevelFilter.h     2009-02-25 22:33:03 +0000
+++ b/libcore/GradientBevelFilter.h     2009-09-22 07:43:10 +0000
@@ -60,7 +60,6 @@
         m_quality(quality), m_type(type), m_knockout(knockout)
     { return; }
 
-protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
     std::vector<boost::uint32_t> m_colors; // Colors of the gradients.

=== modified file 'libcore/GradientGlowFilter.h'
--- a/libcore/GradientGlowFilter.h      2009-02-25 22:33:03 +0000
+++ b/libcore/GradientGlowFilter.h      2009-09-22 07:19:19 +0000
@@ -60,7 +60,6 @@
         m_quality(quality), m_type(type), m_knockout(knockout)
     { return; }
 
-protected:
     float m_distance; // Distance of the filter in pixels.
     float m_angle; // Angle of the filter.
     std::vector<boost::uint32_t> m_colors; // Colors of the gradients.

=== modified file 'libcore/asobj/flash/filters/BevelFilter_as.cpp'
--- a/libcore/asobj/flash/filters/BevelFilter_as.cpp    2009-07-28 11:58:27 
+0000
+++ b/libcore/asobj/flash/filters/BevelFilter_as.cpp    2009-09-22 09:08:30 
+0000
@@ -20,116 +20,82 @@
 #include "BevelFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
-#include "flash/filters/BitmapFilter_as.h"
 #include "Global_as.h"
+#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class BevelFilter_as : public as_object, public BevelFilter
+namespace {
+    as_value bevelfilter_new(const fn_call& fn);
+    as_value bevelfilter_distance(const fn_call& fn);
+    as_value bevelfilter_angle(const fn_call& fn);
+    as_value bevelfilter_highlightColor(const fn_call& fn);
+    as_value bevelfilter_highlightAlpha(const fn_call& fn);
+    as_value bevelfilter_shadowColor(const fn_call& fn);
+    as_value bevelfilter_shadowAlpha(const fn_call& fn);
+    as_value bevelfilter_blurX(const fn_call& fn);
+    as_value bevelfilter_blurY(const fn_call& fn);
+    as_value bevelfilter_strength(const fn_call& fn);
+    as_value bevelfilter_quality(const fn_call& fn);
+    as_value bevelfilter_type(const fn_call& fn);
+    as_value bevelfilter_knockout(const fn_call& fn);
+
+    void attachBevelFilterInterface(as_object& o);
+}
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class BevelFilter_as : public Relay, public BevelFilter
 {
 public:
-    static as_value distance_gs(const fn_call& fn);
-    static as_value angle_gs(const fn_call& fn);
-    static as_value highlightColor_gs(const fn_call& fn);
-    static as_value highlightAlpha_gs(const fn_call& fn);
-    static as_value shadowColor_gs(const fn_call& fn);
-    static as_value shadowAlpha_gs(const fn_call& fn);
-    static as_value blurX_gs(const fn_call& fn);
-    static as_value blurY_gs(const fn_call& fn);
-    static as_value strength_gs(const fn_call& fn);
-    static as_value quality_gs(const fn_call& fn);
-    static as_value type_gs(const fn_call& fn);
-    static as_value knockout_gs(const fn_call& fn);
-    static as_value bitmap_clone(const fn_call& fn);
-
-    public: BevelFilter_as(as_object *obj)
-           :
-           as_object(obj)
-    {}
-    
-    static as_object* Interface();
-    static void attachInterface(as_object& o);
-    static void attachProperties(as_object& o);
-    static void registerCtor(as_object& where);
-    static as_value ctor(const fn_call& fn);
-private:
-    static boost::intrusive_ptr<as_object> s_interface;
-
+    BevelFilter_as() {}
 };
 
-
-boost::intrusive_ptr<as_object> BevelFilter_as::s_interface;
-
-as_object*
-BevelFilter_as::Interface() {
-    if (BevelFilter_as::s_interface == NULL) {
-        BevelFilter_as::s_interface = new as_object 
(getBitmapFilterInterface());
-        VM::get().addStatic(BevelFilter_as::s_interface.get());
-        BevelFilter_as::attachInterface(*BevelFilter_as::s_interface);
-    }
-    return BevelFilter_as::s_interface.get();
-}
-
-
+/// The prototype of flash.filters.BevelFilter is a new BitmapFilter.
 void
 bevelfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    boost::intrusive_ptr<as_object> cl;
-    if (cl != NULL) return;
-    Global_as* gl = getGlobal(where);
-    cl = gl->createClass(&BevelFilter_as::ctor, BevelFilter_as::Interface());
-    VM::get().addStatic(cl.get());
-    BevelFilter_as::attachInterface(*cl);
-    where.init_member(getName(uri) , cl.get(), as_object::DefaultFlags,
-            getNamespace(uri));
+    registerBitmapClass(where, bevelfilter_new, attachBevelFilterInterface,
+            uri);
 }
 
+namespace {
 
 void
-BevelFilter_as::attachInterface(as_object& o)
+attachBevelFilterInterface(as_object& o)
 {
-    Global_as* gl = getGlobal(o);
-    boost::intrusive_ptr<builtin_function> gs;
-
-    o.set_member(VM::get().getStringTable().find("clone"), 
gl->createFunction(bitmap_clone));
-
-}
-
-
-void
-BevelFilter_as::attachProperties(as_object& o) {
-    boost::intrusive_ptr<builtin_function> gs;
-    o.init_property("distance" , BevelFilter_as::distance_gs, 
-        BevelFilter_as::distance_gs);
-    o.init_property("angle" , BevelFilter_as::angle_gs, 
-        BevelFilter_as::angle_gs);
-    o.init_property("highlightColor" , BevelFilter_as::highlightColor_gs, 
-        BevelFilter_as::highlightColor_gs);
-    o.init_property("highlightAlpha" , BevelFilter_as::highlightAlpha_gs, 
-        BevelFilter_as::highlightAlpha_gs);
-    o.init_property("shadowColor" , BevelFilter_as::shadowColor_gs, 
-        BevelFilter_as::shadowColor_gs);
-    o.init_property("shadowAlpha" , BevelFilter_as::shadowAlpha_gs, 
-        BevelFilter_as::shadowAlpha_gs);
-    o.init_property("blurX" , BevelFilter_as::blurX_gs, 
-        BevelFilter_as::blurX_gs);
-    o.init_property("blurY" , BevelFilter_as::blurY_gs, 
-        BevelFilter_as::blurY_gs);
-    o.init_property("strength" , BevelFilter_as::strength_gs, 
-        BevelFilter_as::strength_gs);
-    o.init_property("quality" , BevelFilter_as::quality_gs, 
-        BevelFilter_as::quality_gs);
-    o.init_property("type" , BevelFilter_as::type_gs, 
-        BevelFilter_as::type_gs);
-    o.init_property("knockout" , BevelFilter_as::knockout_gs, 
-        BevelFilter_as::knockout_gs);
+    const int flags = PropFlags::onlySWF8Up;
+    o.init_property("distance", bevelfilter_distance, 
+        bevelfilter_distance, flags);
+    o.init_property("angle", bevelfilter_angle, 
+        bevelfilter_angle, flags);
+    o.init_property("highlightColor", bevelfilter_highlightColor, 
+        bevelfilter_highlightColor, flags);
+    o.init_property("highlightAlpha", bevelfilter_highlightAlpha, 
+        bevelfilter_highlightAlpha, flags);
+    o.init_property("shadowColor", bevelfilter_shadowColor, 
+        bevelfilter_shadowColor, flags);
+    o.init_property("shadowAlpha", bevelfilter_shadowAlpha, 
+        bevelfilter_shadowAlpha, flags);
+    o.init_property("blurX", bevelfilter_blurX, 
+        bevelfilter_blurX, flags);
+    o.init_property("blurY", bevelfilter_blurY, 
+        bevelfilter_blurY, flags);
+    o.init_property("strength", bevelfilter_strength, 
+        bevelfilter_strength, flags);
+    o.init_property("quality", bevelfilter_quality, 
+        bevelfilter_quality, flags);
+    o.init_property("type", bevelfilter_type, 
+        bevelfilter_type, flags);
+    o.init_property("knockout", bevelfilter_knockout, 
+        bevelfilter_knockout, flags);
 
 }
 
 as_value
-BevelFilter_as::distance_gs(const fn_call& fn)
+bevelfilter_distance(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_distance );
     }
@@ -140,21 +106,21 @@
 }
 
 as_value
-BevelFilter_as::angle_gs(const fn_call& fn)
+bevelfilter_angle(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_angle );
+        return as_value(ptr->m_angle);
     }
-    float sp_angle = fn.arg(0).to_number<float> ();
+    double sp_angle = fn.arg(0).to_number();
     ptr->m_angle = sp_angle;
     return as_value();
 }
 
 as_value
-BevelFilter_as::highlightColor_gs(const fn_call& fn)
+bevelfilter_highlightColor(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_highlightColor );
     }
@@ -164,9 +130,9 @@
 }
 
 as_value
-BevelFilter_as::highlightAlpha_gs(const fn_call& fn)
+bevelfilter_highlightAlpha(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_highlightAlpha );
     }
@@ -176,9 +142,9 @@
 }
 
 as_value
-BevelFilter_as::shadowColor_gs(const fn_call& fn)
+bevelfilter_shadowColor(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_shadowColor );
     }
@@ -188,9 +154,9 @@
 }
 
 as_value
-BevelFilter_as::shadowAlpha_gs(const fn_call& fn)
+bevelfilter_shadowAlpha(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_shadowAlpha );
     }
@@ -200,9 +166,9 @@
 }
 
 as_value
-BevelFilter_as::blurX_gs(const fn_call& fn)
+bevelfilter_blurX(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_blurX );
     }
@@ -212,9 +178,9 @@
 }
 
 as_value
-BevelFilter_as::blurY_gs(const fn_call& fn)
+bevelfilter_blurY(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
                return as_value(ptr->m_blurY );
     }
@@ -224,9 +190,9 @@
 }
 
 as_value
-BevelFilter_as::strength_gs(const fn_call& fn)
+bevelfilter_strength(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_strength );
     }
@@ -236,9 +202,9 @@
 }
 
 as_value
-BevelFilter_as::quality_gs(const fn_call& fn)
+bevelfilter_quality(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
                return as_value(ptr->m_quality );
     }
@@ -248,9 +214,9 @@
 }
 
 as_value
-BevelFilter_as::knockout_gs(const fn_call& fn)
+bevelfilter_knockout(const fn_call& fn)
 {
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
                return as_value(ptr->m_knockout );
     }
@@ -260,20 +226,9 @@
 }
 
 as_value
-BevelFilter_as::bitmap_clone(const fn_call& fn)
-{
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
-    boost::intrusive_ptr<BevelFilter_as> obj = new BevelFilter_as(*ptr);
-    boost::intrusive_ptr<as_object> r = obj;
-    r->set_prototype(ptr->get_prototype());
-    r->copyProperties(*ptr);
-    return as_value(r);
-}
-
-as_value
-BevelFilter_as::type_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<BevelFilter_as> ptr = 
ensureType<BevelFilter_as>(fn.this_ptr);
+bevelfilter_type(const fn_call& fn)
+{
+    BevelFilter_as* ptr = ensureNativeType<BevelFilter_as>(fn.this_ptr);
 
     if (fn.nargs == 0)
     {
@@ -315,13 +270,12 @@
 }
 
 as_value
-BevelFilter_as::ctor(const fn_call& )
+bevelfilter_new(const fn_call& fn)
 {
-    boost::intrusive_ptr<as_object> obj = new 
BevelFilter_as(BevelFilter_as::Interface());
-
-    BevelFilter_as::attachProperties(*obj);
-    return as_value(obj.get());
-
-}
-
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new BevelFilter_as);
+    return as_value();
+}
+
+}
 }

=== modified file 'libcore/asobj/flash/filters/BitmapFilter_as.cpp'
--- a/libcore/asobj/flash/filters/BitmapFilter_as.cpp   2009-08-26 14:29:24 
+0000
+++ b/libcore/asobj/flash/filters/BitmapFilter_as.cpp   2009-09-22 09:08:40 
+0000
@@ -28,20 +28,25 @@
 
 namespace {
     
-    as_value bitmapfilter_ctor(const fn_call& fn);
+    as_value bitmapfilter_new(const fn_call& fn);
     as_value bitmapfilter_clone(const fn_call& fn);
     as_value getBitmapFilterConstructor(const fn_call& fn);
     void attachBitmapFilterInterface(as_object& o);
 }
  
-// TODO: Use composition, not inheritance.
-class BitmapFilter_as : public as_object, public BitmapFilter
+/// This may need a reference to its owner as_object
+//
+/// TODO: is BitmapFilter GC collected?
+class BitmapFilter_as : public Relay
 {
 public:
-    BitmapFilter_as(as_object *obj)
-           :
-        as_object(obj)
+    BitmapFilter_as()
+        :
+        _filter(new BitmapFilter)
     {}
+
+private:
+    BitmapFilter* _filter;
 };
 
 
@@ -58,19 +63,43 @@
 registerBitmapFilterNative(as_object& global)
 {
     VM& vm = getVM(global);
+    vm.registerNative(bitmapfilter_new, 1112, 0);
     vm.registerNative(bitmapfilter_clone, 1112, 1);
 }
 
-as_object*
-getBitmapFilterInterface()
+void
+registerBitmapClass(as_object& where, Global_as::ASFunction ctor,
+        Properties p, const ObjectURI& uri)
 {
-    static as_object* o;
-    if (!o) {
-        o = new as_object(getObjectInterface());
-        VM::get().addStatic(o);
-        attachBitmapFilterInterface(*o);
+    Global_as* gl = getGlobal(where);
+
+    string_table& st = getStringTable(where);
+
+    // We should be looking for flash.filters.BitmapFilter, but as this
+    // triggers a lookup of the flash.filters package while we are creating
+    // it, so entering infinite recursion, we'll cheat and assume that
+    // the object 'where' is the filters package.
+    as_function* constructor =
+        where.getMember(st.find("BitmapFilter")).to_as_function();
+    
+    as_object* proto;
+    if (constructor) {
+        fn_call::Args args;
+        VM& vm = getVM(where);
+        proto = constructor->constructInstance(as_environment(vm), args).get();
     }
-    return o;
+    else proto = 0;
+
+    as_object* cl = gl->createClass(ctor, gl->createObject());
+    if (proto) p(*proto);
+
+    // The startup script overwrites the prototype assigned by ASconstructor,
+    // so the new prototype doesn't have a constructor property. We do the
+    // same here.
+    cl->set_member(NSV::PROP_PROTOTYPE, proto);
+    where.init_member(getName(uri) , cl, as_object::DefaultFlags,
+            getNamespace(uri));
+
 }
 
 namespace {
@@ -86,29 +115,34 @@
 as_value
 getBitmapFilterConstructor(const fn_call& fn)
 {
-    as_object* proto = getBitmapFilterInterface();
+    log_debug("Loading flash.filters.BitmapFilter class");
     Global_as* gl = getGlobal(fn);
-    return gl->createClass(&bitmapfilter_ctor, proto);
+    VM& vm = getVM(fn);
+    
+    as_object* proto = gl->createObject();
+    as_object* cl = vm.getNative(1112, 0);
+    cl->init_member(NSV::PROP_PROTOTYPE, proto);
+    proto->init_member(NSV::PROP_CONSTRUCTOR, cl);
+    
+    attachBitmapFilterInterface(*proto);
+    return cl;
 }
 
 as_value
-bitmapfilter_ctor(const fn_call& /*fn*/)
+bitmapfilter_new(const fn_call& fn)
 {
-    boost::intrusive_ptr<as_object> obj =
-        new BitmapFilter_as(getBitmapFilterInterface());
-    return as_value(obj);
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new BitmapFilter_as);
+    return as_value();
 }
 
+/// TODO: there are no tests for how this works, so it's not implemented.
 as_value
 bitmapfilter_clone(const fn_call& fn)
 {
-    boost::intrusive_ptr<BitmapFilter_as> to_copy = 
ensureType<BitmapFilter_as> (fn.this_ptr);
-    boost::intrusive_ptr<BitmapFilter_as> filter = new 
BitmapFilter_as(*to_copy);
-    filter->set_prototype(filter->get_prototype());
-    filter->copyProperties(*filter);
-    boost::intrusive_ptr<as_object> r = filter;
-
-    return as_value(r);
+    BitmapFilter_as* relay = ensureNativeType<BitmapFilter_as>(fn.this_ptr);
+    UNUSED(relay);
+    return as_value();
 }
 } // anonymous namespace
 } // gnash namespace

=== modified file 'libcore/asobj/flash/filters/BitmapFilter_as.h'
--- a/libcore/asobj/flash/filters/BitmapFilter_as.h     2009-08-26 14:29:24 
+0000
+++ b/libcore/asobj/flash/filters/BitmapFilter_as.h     2009-09-22 08:09:17 
+0000
@@ -23,6 +23,8 @@
 #include "gnashconfig.h"
 #endif
 
+#include "Global_as.h"
+
 namespace gnash {
 
 class as_object;
@@ -33,8 +35,8 @@
 
 void registerBitmapFilterNative(as_object& global);
 
-/// Get the interface, for inheritance.
-as_object *getBitmapFilterInterface();
+void registerBitmapClass(as_object& where, Global_as::ASFunction ctor,
+        Properties p, const ObjectURI& uri);
 
 } // end of gnash namespace
 

=== modified file 'libcore/asobj/flash/filters/BlurFilter_as.cpp'
--- a/libcore/asobj/flash/filters/BlurFilter_as.cpp     2009-07-28 11:58:27 
+0000
+++ b/libcore/asobj/flash/filters/BlurFilter_as.cpp     2009-09-22 09:08:52 
+0000
@@ -21,90 +21,49 @@
 #include "VM.h"
 #include "builtin_function.h"
 #include "Global_as.h"
-
 #include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class BlurFilter_as : public as_object, public BlurFilter
+namespace {
+    as_value blurfilter_new(const fn_call& fn);
+    as_value blurfilter_blurX(const fn_call& fn);
+    as_value blurfilter_blurY(const fn_call& fn);
+    as_value blurfilter_quality(const fn_call& fn);
+
+    void attachBlurFilterInterface(as_object& o);
+}
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class BlurFilter_as : public Relay, public BlurFilter
 {
 public:
-    static as_value blurX_gs(const fn_call& fn);
-    static as_value blurY_gs(const fn_call& fn);
-    static as_value quality_gs(const fn_call& fn);
-    static as_value bitmap_clone(const fn_call& fn);
-
-    BlurFilter_as(as_object *obj)
-           :
-        as_object(obj)
-    {
-    }
-    
-    static as_object* Interface();
-    static void attachInterface(as_object& o);
-    static void attachProperties(as_object& o);
-    static void registerCtor(as_object& where);
-    static as_value ctor(const fn_call& fn);
-private:
-    static boost::intrusive_ptr<as_object> s_interface;
-
+    BlurFilter_as() {}
 };
 
-
-boost::intrusive_ptr<as_object> BlurFilter_as::s_interface;
-
-as_object*
-BlurFilter_as::Interface() {
-    if (BlurFilter_as::s_interface == NULL) {
-        BlurFilter_as::s_interface = new as_object(getBitmapFilterInterface());
-        VM::get().addStatic(BlurFilter_as::s_interface.get());
-        BlurFilter_as::attachInterface(*BlurFilter_as::s_interface);
-    }
-    return BlurFilter_as::s_interface.get();
-}
-
 void
 blurfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    static boost::intrusive_ptr<as_object> cl;
-    if (!cl) return;
-
-    Global_as* gl = getGlobal(where);
-    cl = gl->createClass(&BlurFilter_as::ctor, BlurFilter_as::Interface());
-    BlurFilter_as::attachInterface(*cl);
-
-    where.init_member(getName(uri), cl.get(), as_object::DefaultFlags,
-            getNamespace(uri));
-}
-
-
-void
-BlurFilter_as::attachInterface(as_object& o) {
-    Global_as* gl = getGlobal(o);
-    boost::intrusive_ptr<builtin_function> gs;
-
-    o.set_member(VM::get().getStringTable().find("clone"), 
gl->createFunction(bitmap_clone));
-
-}
-
-void
-BlurFilter_as::attachProperties(as_object& o)
+    registerBitmapClass(where, blurfilter_new, attachBlurFilterInterface,
+            uri);
+}
+
+namespace {
+
+void
+attachBlurFilterInterface(as_object& o)
 {
-    boost::intrusive_ptr<builtin_function> gs;
-    o.init_property("blurX" , BlurFilter_as::blurX_gs, 
-        BlurFilter_as::blurX_gs);
-    o.init_property("blurY" , BlurFilter_as::blurY_gs, 
-        BlurFilter_as::blurY_gs);
-    o.init_property("quality" , BlurFilter_as::quality_gs, 
-        BlurFilter_as::quality_gs);
-
+    const int flags = PropFlags::onlySWF8Up;
+    o.init_property("blurX", blurfilter_blurX, blurfilter_blurX, flags);
+    o.init_property("blurY", blurfilter_blurY, blurfilter_blurY, flags);
+    o.init_property("quality", blurfilter_quality, blurfilter_quality, flags);
 }
 
 as_value
-BlurFilter_as::blurX_gs(const fn_call& fn)
+blurfilter_blurX(const fn_call& fn)
 {
-    
-    boost::intrusive_ptr<BlurFilter_as> ptr = 
ensureType<BlurFilter_as>(fn.this_ptr);
+    BlurFilter_as* ptr = ensureNativeType<BlurFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_blurX );
     }
@@ -114,11 +73,11 @@
 }
 
 as_value
-BlurFilter_as::blurY_gs(const fn_call& fn)
+blurfilter_blurY(const fn_call& fn)
 {
-       boost::intrusive_ptr<BlurFilter_as> ptr = 
ensureType<BlurFilter_as>(fn.this_ptr);
+    BlurFilter_as* ptr = ensureNativeType<BlurFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_blurY );
+               return as_value(ptr->m_blurY );
     }
     float sp_blurY = fn.arg(0).to_number<float> ();
     ptr->m_blurY = sp_blurY;
@@ -126,11 +85,11 @@
 }
 
 as_value
-BlurFilter_as::quality_gs(const fn_call& fn)
+blurfilter_quality(const fn_call& fn)
 {
-       boost::intrusive_ptr<BlurFilter_as> ptr = 
ensureType<BlurFilter_as>(fn.this_ptr);
+    BlurFilter_as* ptr = ensureNativeType<BlurFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_quality );
+               return as_value(ptr->m_quality );
     }
     boost::uint8_t sp_quality = fn.arg(0).to_number<boost::uint8_t> ();
     ptr->m_quality = sp_quality;
@@ -138,24 +97,13 @@
 }
 
 as_value
-BlurFilter_as::bitmap_clone(const fn_call& fn)
-{
-       boost::intrusive_ptr<BlurFilter_as> ptr = 
ensureType<BlurFilter_as>(fn.this_ptr);
-    boost::intrusive_ptr<BlurFilter_as> obj = new BlurFilter_as(*ptr);
-    boost::intrusive_ptr<as_object> r = obj;
-    r->set_prototype(ptr->get_prototype());
-    r->copyProperties(*ptr);
-    return as_value(r);
-}
-
-as_value
-BlurFilter_as::ctor(const fn_call& )
-{
-    boost::intrusive_ptr<as_object> obj = new 
BlurFilter_as(BlurFilter_as::Interface());
-
-    BlurFilter_as::attachProperties(*obj);
-    return as_value(obj);
-
-}
-
-}
+blurfilter_new(const fn_call& fn)
+{
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new BlurFilter_as);
+    return as_value();
+}
+
+}
+}
+

=== modified file 'libcore/asobj/flash/filters/BlurFilter_as.h'
--- a/libcore/asobj/flash/filters/BlurFilter_as.h       2009-07-28 11:58:27 
+0000
+++ b/libcore/asobj/flash/filters/BlurFilter_as.h       2009-09-22 07:56:56 
+0000
@@ -16,8 +16,8 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-#ifndef __GNASH_ASOBJ_BLURFILTER_H__
-#define __GNASH_ASOBJ_BLURFILTER_H__
+#ifndef GNASH_ASOBJ_BLURFILTER_H
+#define GNASH_ASOBJ_BLURFILTER_H
 
 namespace gnash {
 

=== modified file 'libcore/asobj/flash/filters/ColorMatrixFilter_as.cpp'
--- a/libcore/asobj/flash/filters/ColorMatrixFilter_as.cpp      2009-07-28 
11:58:27 +0000
+++ b/libcore/asobj/flash/filters/ColorMatrixFilter_as.cpp      2009-09-22 
09:09:10 +0000
@@ -25,98 +25,55 @@
 
 namespace gnash {
 
-class ColorMatrixFilter_as : public as_object, public ColorMatrixFilter
+namespace {
+    as_value colormatrixfilter_new(const fn_call& fn);
+    as_value colormatrixfilter_matrix(const fn_call& fn);
+
+    void attachColorMatrixFilterInterface(as_object& o);
+}
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class ColorMatrixFilter_as : public Relay, public ColorMatrixFilter
 {
 public:
-    static as_value matrix_gs(const fn_call& fn);
-    static as_value bitmap_clone(const fn_call& fn);
-
-    ColorMatrixFilter_as(as_object *obj)
-        :
-        as_object(obj)
-    {}
-    static as_object* Interface();
-    static void attachInterface(as_object& o);
-    static void attachProperties(as_object& o);
-    static as_value ctor(const fn_call& fn);
-private:
-    static boost::intrusive_ptr<as_object> s_interface;
-
+    ColorMatrixFilter_as() {}
 };
 
-
-boost::intrusive_ptr<as_object> ColorMatrixFilter_as::s_interface;
-
-as_object* ColorMatrixFilter_as::Interface() {
-    if (ColorMatrixFilter_as::s_interface == NULL) {
-        ColorMatrixFilter_as::s_interface = new as_object 
(getBitmapFilterInterface());
-        VM::get().addStatic(ColorMatrixFilter_as::s_interface.get());
-        
ColorMatrixFilter_as::attachInterface(*ColorMatrixFilter_as::s_interface);
-    }
-    return ColorMatrixFilter_as::s_interface.get();
-}
-
+/// The prototype of flash.filters.ColorMatrixFilter is a new BitmapFilter.
 void
 colormatrixfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    static boost::intrusive_ptr<as_object> cl;
-    if (!cl) return;
-
-    Global_as* gl = getGlobal(where);
-    cl = gl->createClass(&ColorMatrixFilter_as::ctor, 
ColorMatrixFilter_as::Interface());
-    ColorMatrixFilter_as::attachInterface(*cl);
-
-    where.init_member(getName(uri), cl.get(), as_object::DefaultFlags,
-            getNamespace(uri));
-
-}
-
-
-void
-ColorMatrixFilter_as::attachInterface(as_object& o)
-{
-    Global_as* gl = getGlobal(o);
-       boost::intrusive_ptr<builtin_function> gs;
-
-    o.set_member(VM::get().getStringTable().find("clone"), 
gl->createFunction(bitmap_clone));
-
-}
-
-void
-ColorMatrixFilter_as::attachProperties(as_object& o)
-{
-       boost::intrusive_ptr<builtin_function> gs;
-
-    o.init_property("matrix" , ColorMatrixFilter_as::matrix_gs, 
-        ColorMatrixFilter_as::matrix_gs);
-}
-
-as_value
-ColorMatrixFilter_as::matrix_gs(const fn_call& fn)
-{
-       boost::intrusive_ptr<ColorMatrixFilter_as> ptr = 
ensureType<ColorMatrixFilter_as>(fn.this_ptr);
-    return as_value();
-}
-
-as_value
-ColorMatrixFilter_as::bitmap_clone(const fn_call& fn)
-{
-       boost::intrusive_ptr<ColorMatrixFilter_as> ptr = 
ensureType<ColorMatrixFilter_as>(fn.this_ptr);
-    boost::intrusive_ptr<ColorMatrixFilter_as> obj = new 
ColorMatrixFilter_as(*ptr);
-    boost::intrusive_ptr<as_object> r = obj;
-    r->set_prototype(ptr->get_prototype());
-    r->copyProperties(*ptr);
-    return as_value(r);
-}
-
-as_value
-ColorMatrixFilter_as::ctor(const fn_call& )
-{
-    boost::intrusive_ptr<as_object> obj = new 
ColorMatrixFilter_as(ColorMatrixFilter_as::Interface());
-
-    ColorMatrixFilter_as::attachProperties(*obj);
-    return as_value(obj.get());
-
-}
-
-}
+    registerBitmapClass(where, colormatrixfilter_new,
+            attachColorMatrixFilterInterface, uri);
+}
+
+namespace {
+
+void
+attachColorMatrixFilterInterface(as_object& o)
+{
+    const int flags = PropFlags::onlySWF8Up;
+    o.init_property("matrix", colormatrixfilter_matrix, 
+        colormatrixfilter_matrix, flags);
+}
+
+as_value
+colormatrixfilter_matrix(const fn_call& fn)
+{
+    ColorMatrixFilter_as* ptr = 
ensureNativeType<ColorMatrixFilter_as>(fn.this_ptr);
+    UNUSED(ptr);
+    return as_value();
+}
+
+as_value
+colormatrixfilter_new(const fn_call& fn)
+{
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new ColorMatrixFilter_as);
+    return as_value();
+}
+
+}
+}
+

=== modified file 'libcore/asobj/flash/filters/ConvolutionFilter_as.cpp'
--- a/libcore/asobj/flash/filters/ConvolutionFilter_as.cpp      2009-07-28 
11:58:27 +0000
+++ b/libcore/asobj/flash/filters/ConvolutionFilter_as.cpp      2009-09-22 
08:09:17 +0000
@@ -20,17 +20,14 @@
 #include "ConvolutionFilter.h"
 #include "VM.h"
 #include "Global_as.h"
+#include "BitmapFilter_as.h"
 #include "builtin_function.h"
 #include "Object.h"
-#include "BitmapFilter_as.h"
 
 namespace gnash {
 
 namespace {
-    
-    as_value convolutionfilter_ctor(const fn_call& fn);
-    as_value convolutionfilter_clone(const fn_call& fn);
-    as_value getConvolutionFilterConstructor(const fn_call& fn);
+    as_value convolutionfilter_new(const fn_call& fn);
     as_value convolutionfilter_matrixX(const fn_call& fn);
     as_value convolutionfilter_matrixY(const fn_call& fn);
     as_value convolutionfilter_matrix(const fn_call& fn);
@@ -43,38 +40,21 @@
 
     void attachConvolutionFilterInterface(as_object& o);
 }
- 
-// TODO: Use composition, not inheritance.
-class ConvolutionFilter_as : public as_object, public ConvolutionFilter
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class ConvolutionFilter_as : public Relay, public ConvolutionFilter
 {
 public:
-    ConvolutionFilter_as(as_object *obj)
-        :
-        as_object(obj)
-    {}
-
+    ConvolutionFilter_as() {}
 };
 
-
+/// The prototype of flash.filters.ConvolutionFilter is a new BitmapFilter.
 void
 convolutionfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    // TODO: this may not be correct, but it should be enumerable.
-    const int flags = 0;
-    where.init_destructive_property(getName(uri),
-            getConvolutionFilterConstructor, flags, getNamespace(uri));
-}
-
-as_object*
-getConvolutionFilterInterface()
-{
-    static as_object* o;
-    if (!o) {
-        o = new as_object(getBitmapFilterInterface());
-        VM::get().addStatic(o);
-        attachConvolutionFilterInterface(*o);
-    }
-    return o;
+    registerBitmapClass(where, convolutionfilter_new,
+            attachConvolutionFilterInterface, uri);
 }
 
 namespace {
@@ -104,27 +84,9 @@
 }
 
 as_value
-getConvolutionFilterConstructor(const fn_call& fn)
-{
-    Global_as* gl = getGlobal(fn);
-    return gl->createClass(&convolutionfilter_ctor,
-            getConvolutionFilterInterface());
-}
-
-as_value
-convolutionfilter_ctor(const fn_call& /*fn*/)
-{
-    boost::intrusive_ptr<as_object> obj =
-        new ConvolutionFilter_as(getConvolutionFilterInterface());
-    return as_value(obj);
-}
-
-as_value
 convolutionfilter_matrixX(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -133,8 +95,7 @@
 as_value
 convolutionfilter_matrixY(const fn_call& fn)
 {
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -143,9 +104,7 @@
 as_value
 convolutionfilter_divisor(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -154,9 +113,7 @@
 as_value
 convolutionfilter_bias(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -165,9 +122,7 @@
 as_value
 convolutionfilter_preserveAlpha(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -176,9 +131,7 @@
 as_value
 convolutionfilter_clamp(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -187,9 +140,7 @@
 as_value
 convolutionfilter_color(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -198,9 +149,7 @@
 as_value
 convolutionfilter_alpha(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
@@ -209,13 +158,20 @@
 as_value
 convolutionfilter_matrix(const fn_call& fn)
 {
-    // TODO: check whether this is necessary (probably is).
-    boost::intrusive_ptr<ConvolutionFilter_as> ptr =
-        ensureType<ConvolutionFilter_as>(fn.this_ptr);
+    ConvolutionFilter_as* ptr = 
ensureNativeType<ConvolutionFilter_as>(fn.this_ptr);
     UNUSED(ptr);
     log_unimpl(__PRETTY_FUNCTION__);
     return as_value();
 }
 
+as_value
+convolutionfilter_new(const fn_call& fn)
+{
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new ConvolutionFilter_as);
+    return as_value();
+}
+
+
 } // anonymous namespace
 } // namespace gnash

=== modified file 'libcore/asobj/flash/filters/DropShadowFilter_as.cpp'
--- a/libcore/asobj/flash/filters/DropShadowFilter_as.cpp       2009-07-28 
11:58:27 +0000
+++ b/libcore/asobj/flash/filters/DropShadowFilter_as.cpp       2009-09-22 
09:09:19 +0000
@@ -20,165 +20,128 @@
 #include "DropShadowFilter.h"
 #include "VM.h"
 #include "Global_as.h"
+#include "BitmapFilter_as.h"
 #include "builtin_function.h"
-#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class DropShadowFilter_as : public as_object, public DropShadowFilter
+namespace {
+    as_value dropshadowfilter_new(const fn_call& fn);
+    as_value dropshadowfilter_distance(const fn_call& fn);
+    as_value dropshadowfilter_alpha(const fn_call& fn);
+    as_value dropshadowfilter_color(const fn_call& fn);
+    as_value dropshadowfilter_angle(const fn_call& fn);
+    as_value dropshadowfilter_blurX(const fn_call& fn);
+    as_value dropshadowfilter_blurY(const fn_call& fn);
+    as_value dropshadowfilter_strength(const fn_call& fn);
+    as_value dropshadowfilter_quality(const fn_call& fn);
+    as_value dropshadowfilter_knockout(const fn_call& fn);
+    as_value dropshadowfilter_hideObject(const fn_call& fn);
+    as_value dropshadowfilter_inner(const fn_call& fn);
+
+    void attachDropShadowFilterInterface(as_object& o);
+}
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class DropShadowFilter_as : public Relay, public DropShadowFilter
 {
 public:
-    static as_value distance_gs(const fn_call& fn);
-    static as_value angle_gs(const fn_call& fn);
-    static as_value color_gs(const fn_call& fn);
-    static as_value alpha_gs(const fn_call& fn);
-    static as_value blurX_gs(const fn_call& fn);
-    static as_value blurY_gs(const fn_call& fn);
-    static as_value strength_gs(const fn_call& fn);
-    static as_value quality_gs(const fn_call& fn);
-    static as_value inner_gs(const fn_call& fn);
-    static as_value knockout_gs(const fn_call& fn);
-    static as_value hideObject_gs(const fn_call& fn);
-    static as_value bitmap_clone(const fn_call& fn);
-
-
-    DropShadowFilter_as(as_object *obj)
-        :
-        as_object(obj)
-    {}
-    
-    static as_object* Interface();
-    static void attachInterface(as_object& o);
-    static void attachProperties(as_object& o);
-    static void registerCtor(as_object& where);
-    static as_value ctor(const fn_call& fn);
-    
-private:
-    static boost::intrusive_ptr<as_object> s_interface;
-
+    DropShadowFilter_as() {}
 };
 
-
-boost::intrusive_ptr<as_object> DropShadowFilter_as::s_interface;
-
-
-as_object*
-DropShadowFilter_as::Interface() {
-    if (DropShadowFilter_as::s_interface == NULL) {
-        DropShadowFilter_as::s_interface = new as_object 
(getBitmapFilterInterface());
-    VM::get().addStatic(DropShadowFilter_as::s_interface.get());
-    DropShadowFilter_as::attachInterface(*DropShadowFilter_as::s_interface);
-    }
-    return DropShadowFilter_as::s_interface.get();
-}
-
+/// The prototype of flash.filters.DropShadowFilter is a new BitmapFilter.
 void
 dropshadowfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    boost:: intrusive_ptr<as_object> cl;
-    if (cl != NULL) return;
-    Global_as* gl = getGlobal(where);
-    cl = gl->createClass(&DropShadowFilter_as::ctor, 
DropShadowFilter_as::Interface());
-    VM::get().addStatic(cl.get());
-    DropShadowFilter_as::attachInterface(*cl);
-    where.init_member(getName(uri), cl.get(),
-            as_object::DefaultFlags, getNamespace(uri));
-}
-
-
-void DropShadowFilter_as::attachInterface(as_object& o) {
-    Global_as* gl = getGlobal(o);
-    boost::intrusive_ptr<builtin_function> gs;
-
-    o.set_member(VM::get().getStringTable().find("clone"), 
gl->createFunction(bitmap_clone));
-
-}
+    registerBitmapClass(where, dropshadowfilter_new,
+            attachDropShadowFilterInterface, uri);
+}
+
+namespace {
 
 void
-DropShadowFilter_as::attachProperties(as_object& o)
+attachDropShadowFilterInterface(as_object& o)
 {
-    boost::intrusive_ptr<builtin_function> gs;
-    o.init_property("distance" , DropShadowFilter_as::distance_gs, 
-        DropShadowFilter_as::distance_gs);
-    o.init_property("angle" , DropShadowFilter_as::angle_gs, 
-        DropShadowFilter_as::angle_gs);
-    o.init_property("color" , DropShadowFilter_as::color_gs, 
-        DropShadowFilter_as::color_gs);
-    o.init_property("alpha" , DropShadowFilter_as::alpha_gs, 
-        DropShadowFilter_as::alpha_gs);
-    o.init_property("blurX" , DropShadowFilter_as::blurX_gs, 
-        DropShadowFilter_as::blurX_gs);
-    o.init_property("blurY" , DropShadowFilter_as::blurY_gs, 
-        DropShadowFilter_as::blurY_gs);
-    o.init_property("strength" , DropShadowFilter_as::strength_gs, 
-        DropShadowFilter_as::strength_gs);
-    o.init_property("quality" , DropShadowFilter_as::quality_gs, 
-        DropShadowFilter_as::quality_gs);
-    o.init_property("inner" , DropShadowFilter_as::inner_gs, 
-        DropShadowFilter_as::inner_gs);
-    o.init_property("knockout" , DropShadowFilter_as::knockout_gs, 
-        DropShadowFilter_as::knockout_gs);
-    o.init_property("hideObject" , DropShadowFilter_as::hideObject_gs, 
-        DropShadowFilter_as::hideObject_gs);
+    const int flags = PropFlags::onlySWF8Up;
+    o.init_property("color", dropshadowfilter_color, 
+        dropshadowfilter_color, flags);
+    o.init_property("alpha", dropshadowfilter_alpha, 
+        dropshadowfilter_alpha, flags);
+    o.init_property("inner", dropshadowfilter_inner, 
+        dropshadowfilter_inner, flags);
+    o.init_property("hideObject", dropshadowfilter_hideObject, 
+        dropshadowfilter_hideObject, flags);
+    o.init_property("distance", dropshadowfilter_distance, 
+        dropshadowfilter_distance, flags);
+    o.init_property("angle", dropshadowfilter_angle, 
+        dropshadowfilter_angle, flags);
+    o.init_property("blurX", dropshadowfilter_blurX, 
+        dropshadowfilter_blurX, flags);
+    o.init_property("blurY", dropshadowfilter_blurY, 
+        dropshadowfilter_blurY, flags);
+    o.init_property("strength", dropshadowfilter_strength, 
+        dropshadowfilter_strength, flags);
+    o.init_property("quality", dropshadowfilter_quality, 
+        dropshadowfilter_quality, flags);
+    o.init_property("knockout", dropshadowfilter_knockout, 
+        dropshadowfilter_knockout, flags);
 
 }
 
 as_value
-DropShadowFilter_as::distance_gs(const fn_call& fn)
+dropshadowfilter_distance(const fn_call& fn)
 {
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_distance );
     }
-    float sp_distance = fn.arg(0).to_number<float> ();
+    
+    float sp_distance = fn.arg(0).to_number();
     ptr->m_distance = sp_distance;
     return as_value();
 }
 
-
-as_value
-DropShadowFilter_as::angle_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
-    if (fn.nargs == 0) {
-        return as_value(ptr->m_angle );
-    }
-    float sp_angle = fn.arg(0).to_number<float> ();
-    ptr->m_angle = sp_angle;
-    return as_value();
-}
-
-
-as_value
-DropShadowFilter_as::color_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
-    if (fn.nargs == 0) {
-        return as_value(ptr->m_color );
-    }
-    boost::uint32_t sp_color = fn.arg(0).to_number<boost::uint32_t> ();
+as_value
+dropshadowfilter_color(const fn_call& fn)
+{
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
+        return as_value(ptr->m_color);
+    }
+    double sp_color = fn.arg(0).to_number();
     ptr->m_color = sp_color;
     return as_value();
 }
 
-
 as_value
-DropShadowFilter_as::alpha_gs(const fn_call& fn)
+dropshadowfilter_alpha(const fn_call& fn)
 {
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_alpha );
+        return as_value(ptr->m_alpha);
     }
-    boost::uint8_t sp_alpha = fn.arg(0).to_number<boost::uint8_t> ();
+    double sp_alpha = fn.arg(0).to_number();
     ptr->m_alpha = sp_alpha;
     return as_value();
 }
 
+as_value
+dropshadowfilter_angle(const fn_call& fn)
+{
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
+        return as_value(ptr->m_angle);
+    }
+    double sp_angle = fn.arg(0).to_number();
+    ptr->m_angle = sp_angle;
+    return as_value();
+}
 
 as_value
-DropShadowFilter_as::blurX_gs(const fn_call& fn)
+dropshadowfilter_blurX(const fn_call& fn)
 {
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_blurX );
     }
@@ -187,24 +150,22 @@
     return as_value();
 }
 
-
 as_value
-DropShadowFilter_as::blurY_gs(const fn_call& fn)
+dropshadowfilter_blurY(const fn_call& fn)
 {
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_blurY );
+               return as_value(ptr->m_blurY );
     }
     float sp_blurY = fn.arg(0).to_number<float> ();
     ptr->m_blurY = sp_blurY;
     return as_value();
 }
 
-
 as_value
-DropShadowFilter_as::strength_gs(const fn_call& fn)
+dropshadowfilter_strength(const fn_call& fn)
 {
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_strength );
     }
@@ -213,24 +174,34 @@
     return as_value();
 }
 
-
 as_value
-DropShadowFilter_as::quality_gs(const fn_call& fn)
+dropshadowfilter_quality(const fn_call& fn)
 {
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_quality );
+               return as_value(ptr->m_quality );
     }
     boost::uint8_t sp_quality = fn.arg(0).to_number<boost::uint8_t> ();
     ptr->m_quality = sp_quality;
     return as_value();
 }
 
+as_value
+dropshadowfilter_knockout(const fn_call& fn)
+{
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
+               return as_value(ptr->m_knockout );
+    }
+    bool sp_knockout = fn.arg(0).to_bool ();
+    ptr->m_knockout = sp_knockout;
+    return as_value();
+}
 
 as_value
-DropShadowFilter_as::inner_gs(const fn_call& fn)
+dropshadowfilter_inner(const fn_call& fn)
 {
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_inner );
     }
@@ -241,22 +212,9 @@
 
 
 as_value
-DropShadowFilter_as::knockout_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
-    if (fn.nargs == 0) {
-        return as_value(ptr->m_knockout );
-    }
-    bool sp_knockout = fn.arg(0).to_bool ();
-    ptr->m_knockout = sp_knockout;
-    return as_value();
-}
-
-
-as_value
-DropShadowFilter_as::hideObject_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
+dropshadowfilter_hideObject(const fn_call& fn)
+{
+    DropShadowFilter_as* ptr = 
ensureNativeType<DropShadowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_hideObject );
     }
@@ -266,26 +224,14 @@
 }
 
 as_value
-DropShadowFilter_as::bitmap_clone(const fn_call& fn)
-{
-    boost::intrusive_ptr<DropShadowFilter_as> ptr = 
ensureType<DropShadowFilter_as>(fn.this_ptr);
-    boost::intrusive_ptr<DropShadowFilter_as> obj = new 
DropShadowFilter_as(*ptr);
-    boost::intrusive_ptr<as_object> r = obj;
-    r->set_prototype(ptr->get_prototype());
-    r->copyProperties(*ptr);
-    return as_value(r);
- }
-
-as_value
-DropShadowFilter_as::ctor(const fn_call& )
-{
-    boost::intrusive_ptr<as_object> obj = new 
DropShadowFilter_as(DropShadowFilter_as::Interface());
-
-    DropShadowFilter_as::attachProperties(*obj);
-
-
-    return as_value(obj.get());
-
-}
-
-}
+dropshadowfilter_new(const fn_call& fn)
+{
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new DropShadowFilter_as);
+    return as_value();
+}
+
+}
+}
+
+

=== modified file 'libcore/asobj/flash/filters/GlowFilter_as.cpp'
--- a/libcore/asobj/flash/filters/GlowFilter_as.cpp     2009-07-28 11:58:27 
+0000
+++ b/libcore/asobj/flash/filters/GlowFilter_as.cpp     2009-09-22 09:09:28 
+0000
@@ -25,133 +25,101 @@
 
 namespace gnash {
 
-class GlowFilter_as : public as_object, public GlowFilter
+namespace {
+    as_value glowfilter_new(const fn_call& fn);
+    as_value glowfilter_color(const fn_call& fn);
+    as_value glowfilter_alpha(const fn_call& fn);
+    as_value glowfilter_inner(const fn_call& fn);
+    as_value glowfilter_blurX(const fn_call& fn);
+    as_value glowfilter_blurY(const fn_call& fn);
+    as_value glowfilter_strength(const fn_call& fn);
+    as_value glowfilter_quality(const fn_call& fn);
+    as_value glowfilter_knockout(const fn_call& fn);
+
+    void attachGlowFilterInterface(as_object& o);
+}
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class GlowFilter_as : public Relay, public GlowFilter
 {
 public:
-    static as_value color_gs(const fn_call& fn);
-
-    static as_value alpha_gs(const fn_call& fn);
-
-    static as_value blurX_gs(const fn_call& fn);
-
-    static as_value blurY_gs(const fn_call& fn);
-
-    static as_value strength_gs(const fn_call& fn);
-
-    static as_value quality_gs(const fn_call& fn);
-
-    static as_value inner_gs(const fn_call& fn);
-
-    static as_value knockout_gs(const fn_call& fn);
-
-
-    static as_value bitmap_clone(const fn_call& fn);
-
-    GlowFilter_as(as_object *obj)
-        :
-        as_object(obj)
-    {}
-    
-    static as_object* Interface();
-    static void attachInterface(as_object& o);
-    static void attachProperties(as_object& o);
-    static void registerCtor(as_object& where);
-    static as_value ctor(const fn_call& fn);
-private:
-    static boost::intrusive_ptr<as_object> s_interface;
-
+    GlowFilter_as() {}
 };
 
-
-boost::intrusive_ptr<as_object> GlowFilter_as::s_interface;
-
-as_object*
-GlowFilter_as::Interface() {
-    if (GlowFilter_as::s_interface == NULL) {
-        GlowFilter_as::s_interface = new as_object 
(getBitmapFilterInterface());
-        VM::get().addStatic(GlowFilter_as::s_interface.get());
-        GlowFilter_as::attachInterface(*GlowFilter_as::s_interface);
-    }
-    return GlowFilter_as::s_interface.get();
-}
-
+/// The prototype of flash.filters.GlowFilter is a new BitmapFilter.
 void
 glowfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    boost::intrusive_ptr<as_object> cl;
-    if (cl != NULL) return;
-    Global_as* gl = getGlobal(where);
-    cl = gl->createClass(&GlowFilter_as::ctor, GlowFilter_as::Interface());
-    VM::get().addStatic(cl.get());
-    GlowFilter_as::attachInterface(*cl);
-    where.init_member(getName(uri), cl.get(),
-                   as_object::DefaultFlags, getNamespace(uri));
-}
-
-
-void
-GlowFilter_as::attachInterface(as_object& o) {
-    Global_as* gl = getGlobal(o);
-    boost::intrusive_ptr<builtin_function> gs;
-    o.set_member(VM::get().getStringTable().find("clone"), 
gl->createFunction(bitmap_clone));
-
-}
-
-void
-GlowFilter_as::attachProperties(as_object& o) {
-    boost::intrusive_ptr<builtin_function> gs;
-
-    o.init_property("color" , GlowFilter_as::color_gs, 
-        GlowFilter_as::color_gs);
-
-    o.init_property("alpha" , GlowFilter_as::alpha_gs, 
-        GlowFilter_as::alpha_gs);
-
-    o.init_property("blurX" , GlowFilter_as::blurX_gs, 
-        GlowFilter_as::blurX_gs);
-
-    o.init_property("blurY" , GlowFilter_as::blurY_gs, 
-        GlowFilter_as::blurY_gs);
-
-    o.init_property("strength" , GlowFilter_as::strength_gs, 
-        GlowFilter_as::strength_gs);
-
-    o.init_property("quality" , GlowFilter_as::quality_gs, 
-        GlowFilter_as::quality_gs);
-
-    o.init_property("inner" , GlowFilter_as::inner_gs, 
-        GlowFilter_as::inner_gs);
-
-    o.init_property("knockout" , GlowFilter_as::knockout_gs, 
-        GlowFilter_as::knockout_gs);
-
-}
-
-as_value GlowFilter_as::color_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
+    registerBitmapClass(where, glowfilter_new, attachGlowFilterInterface,
+            uri);
+}
+
+namespace {
+
+void
+attachGlowFilterInterface(as_object& o)
+{
+    const int flags = PropFlags::onlySWF8Up;
+    o.init_property("color", glowfilter_color, 
+        glowfilter_color, flags);
+    o.init_property("alpha", glowfilter_alpha, 
+        glowfilter_alpha, flags);
+    o.init_property("inner", glowfilter_inner, 
+        glowfilter_inner, flags);
+    o.init_property("blurX", glowfilter_blurX, 
+        glowfilter_blurX, flags);
+    o.init_property("blurY", glowfilter_blurY, 
+        glowfilter_blurY, flags);
+    o.init_property("strength", glowfilter_strength, 
+        glowfilter_strength, flags);
+    o.init_property("quality", glowfilter_quality, 
+        glowfilter_quality, flags);
+    o.init_property("knockout", glowfilter_knockout, 
+        glowfilter_knockout, flags);
+
+}
+
+as_value
+glowfilter_inner(const fn_call& fn)
+{
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
+        return as_value(ptr->m_inner );
+    }
+    boost::uint32_t sp_inner = fn.arg(0).to_number<boost::uint32_t> ();
+    ptr->m_inner = sp_inner;
+    return as_value();
+}
+
+as_value
+glowfilter_color(const fn_call& fn)
+{
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_color );
     }
-    boost::uint32_t sp_color = fn.arg(0).to_number<boost::uint32_t> ();
+    float sp_color = fn.arg(0).to_number<float> ();
     ptr->m_color = sp_color;
     return as_value();
 }
+
 as_value
-GlowFilter_as::alpha_gs(const fn_call& fn)
+glowfilter_alpha(const fn_call& fn)
 {
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_alpha );
     }
-    boost::uint8_t sp_alpha = fn.arg(0).to_number<boost::uint8_t> ();
+    float sp_alpha = fn.arg(0).to_number<float> ();
     ptr->m_alpha = sp_alpha;
     return as_value();
 }
+
 as_value
-GlowFilter_as::blurX_gs(const fn_call& fn)
+glowfilter_blurX(const fn_call& fn)
 {
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_blurX );
     }
@@ -159,21 +127,23 @@
     ptr->m_blurX = sp_blurX;
     return as_value();
 }
+
 as_value
-GlowFilter_as::blurY_gs(const fn_call& fn)
+glowfilter_blurY(const fn_call& fn)
 {
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_blurY );
+               return as_value(ptr->m_blurY );
     }
     float sp_blurY = fn.arg(0).to_number<float> ();
     ptr->m_blurY = sp_blurY;
     return as_value();
 }
+
 as_value
-GlowFilter_as::strength_gs(const fn_call& fn)
+glowfilter_strength(const fn_call& fn)
 {
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_strength );
     }
@@ -181,60 +151,39 @@
     ptr->m_strength = sp_strength;
     return as_value();
 }
+
 as_value
-GlowFilter_as::quality_gs(const fn_call& fn)
+glowfilter_quality(const fn_call& fn)
 {
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_quality );
+               return as_value(ptr->m_quality );
     }
     boost::uint8_t sp_quality = fn.arg(0).to_number<boost::uint8_t> ();
     ptr->m_quality = sp_quality;
     return as_value();
 }
-as_value
-GlowFilter_as::inner_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
-    if (fn.nargs == 0) {
-        return as_value(ptr->m_inner );
-    }
-    bool sp_inner = fn.arg(0).to_bool ();
-    ptr->m_inner = sp_inner;
-    return as_value();
-}
-as_value
-GlowFilter_as::knockout_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
-    if (fn.nargs == 0) {
-        return as_value(ptr->m_knockout );
+
+as_value
+glowfilter_knockout(const fn_call& fn)
+{
+    GlowFilter_as* ptr = ensureNativeType<GlowFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
+               return as_value(ptr->m_knockout );
     }
     bool sp_knockout = fn.arg(0).to_bool ();
     ptr->m_knockout = sp_knockout;
     return as_value();
- }
-
-as_value GlowFilter_as::bitmap_clone(const fn_call& fn)
-{
-    boost::intrusive_ptr<GlowFilter_as> ptr = 
ensureType<GlowFilter_as>(fn.this_ptr);
-    boost::intrusive_ptr<GlowFilter_as> obj = new GlowFilter_as(*ptr);
-    boost::intrusive_ptr<as_object> r = obj;
-    r->set_prototype(ptr->get_prototype());
-    r->copyProperties(*ptr);
-    return as_value(r);
- }
+}
 
 as_value
-GlowFilter_as::ctor(const fn_call& )
+glowfilter_new(const fn_call& fn)
 {
-    boost::intrusive_ptr<as_object> obj = new 
GlowFilter_as(GlowFilter_as::Interface());
-
-    GlowFilter_as::attachProperties(*obj);
-
-
-    return as_value(obj.get());
-
-}
-
-}
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new GlowFilter_as);
+    return as_value();
+}
+
+}
+}
+

=== modified file 'libcore/asobj/flash/filters/GradientBevelFilter_as.cpp'
--- a/libcore/asobj/flash/filters/GradientBevelFilter_as.cpp    2009-07-28 
11:58:27 +0000
+++ b/libcore/asobj/flash/filters/GradientBevelFilter_as.cpp    2009-09-22 
09:09:43 +0000
@@ -20,166 +20,129 @@
 #include "GradientBevelFilter.h"
 #include "VM.h"
 #include "builtin_function.h"
+#include "Global_as.h"
 #include "BitmapFilter_as.h"
-#include "Global_as.h"
 
 namespace gnash {
 
-class GradientBevelFilter_as : public as_object, public GradientBevelFilter
+namespace {
+    as_value gradientbevelfilter_new(const fn_call& fn);
+    as_value gradientbevelfilter_distance(const fn_call& fn);
+    as_value gradientbevelfilter_angle(const fn_call& fn);
+    as_value gradientbevelfilter_alphas(const fn_call& fn);
+    as_value gradientbevelfilter_colors(const fn_call& fn);
+    as_value gradientbevelfilter_ratios(const fn_call& fn);
+    as_value gradientbevelfilter_blurX(const fn_call& fn);
+    as_value gradientbevelfilter_blurY(const fn_call& fn);
+    as_value gradientbevelfilter_strength(const fn_call& fn);
+    as_value gradientbevelfilter_quality(const fn_call& fn);
+    as_value gradientbevelfilter_type(const fn_call& fn);
+    as_value gradientbevelfilter_knockout(const fn_call& fn);
+
+    void attachGradientBevelFilterInterface(as_object& o);
+}
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class GradientBevelFilter_as : public Relay, public GradientBevelFilter
 {
 public:
-    static as_value distance_gs(const fn_call& fn);
-    static as_value angle_gs(const fn_call& fn);
-    static as_value colors_gs(const fn_call& fn);
-    static as_value alphas_gs(const fn_call& fn);
-    static as_value ratios_gs(const fn_call& fn);
-    static as_value blurX_gs(const fn_call& fn);
-    static as_value blurY_gs(const fn_call& fn);
-    static as_value strength_gs(const fn_call& fn);
-    static as_value quality_gs(const fn_call& fn);
-    static as_value type_gs(const fn_call& fn);
-    static as_value knockout_gs(const fn_call& fn);
-    static as_value bitmap_clone(const fn_call& fn);
-
-
-    GradientBevelFilter_as(as_object *obj)
-        :
-        as_object(obj)
-    {}
-    
-    static as_object* Interface();
-    static void attachInterface(as_object& o);
-    static void attachProperties(as_object& o);
-    static as_value ctor(const fn_call& fn);
-private:
-    static boost::intrusive_ptr<as_object> s_interface;
-
+    GradientBevelFilter_as() {}
 };
 
-
-boost::intrusive_ptr<as_object> GradientBevelFilter_as::s_interface;
-
-as_object*
-GradientBevelFilter_as::Interface() {
-    if (GradientBevelFilter_as::s_interface == NULL) {
-        GradientBevelFilter_as::s_interface = new as_object 
(getBitmapFilterInterface());
-        VM::get().addStatic(GradientBevelFilter_as::s_interface.get());
-        
GradientBevelFilter_as::attachInterface(*GradientBevelFilter_as::s_interface);
-    }
-
-    return GradientBevelFilter_as::s_interface.get();
-}
-
+/// The prototype of flash.filters.GradientBevelFilter is a new BitmapFilter.
 void
 gradientbevelfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    boost::intrusive_ptr<as_object> cl;
-    if (cl != NULL) return;
-    Global_as* gl = getGlobal(where);
-    cl = gl->createClass(&GradientBevelFilter_as::ctor, 
GradientBevelFilter_as::Interface());
-    VM::get().addStatic(cl.get());
-    GradientBevelFilter_as::attachInterface(*cl);
-    where.init_member(getName(uri), cl.get(), as_object::DefaultFlags,
-            getNamespace(uri));
+    registerBitmapClass(where, gradientbevelfilter_new,
+            attachGradientBevelFilterInterface, uri);
 }
 
+namespace {
 
 void
-GradientBevelFilter_as::attachInterface(as_object& o)
+attachGradientBevelFilterInterface(as_object& o)
 {
-    Global_as* gl = getGlobal(o);
-    boost::intrusive_ptr<builtin_function> gs;
-
-    o.set_member(VM::get().getStringTable().find("clone"), 
gl->createFunction(bitmap_clone));
-
-}
-
-
-void
-GradientBevelFilter_as::attachProperties(as_object& o) {
-    o.init_property("distance" , GradientBevelFilter_as::distance_gs, 
-        GradientBevelFilter_as::distance_gs);
-
-    o.init_property("angle" , GradientBevelFilter_as::angle_gs, 
-        GradientBevelFilter_as::angle_gs);
-    o.init_property("colors" , GradientBevelFilter_as::colors_gs, 
-        GradientBevelFilter_as::colors_gs);
-
-    o.init_property("ratios" , GradientBevelFilter_as::ratios_gs, 
-        GradientBevelFilter_as::ratios_gs);
-
-    o.init_property("blurX" , GradientBevelFilter_as::blurX_gs, 
-        GradientBevelFilter_as::blurX_gs);
-    o.init_property("blurY" , GradientBevelFilter_as::blurY_gs, 
-        GradientBevelFilter_as::blurY_gs);
-
-    o.init_property("strength" , GradientBevelFilter_as::strength_gs, 
-        GradientBevelFilter_as::strength_gs);
-
-    o.init_property("quality" , GradientBevelFilter_as::quality_gs, 
-        GradientBevelFilter_as::quality_gs);
-
-    o.init_property("type" , GradientBevelFilter_as::type_gs, 
-        GradientBevelFilter_as::type_gs);
-    o.init_property("knockout" , GradientBevelFilter_as::knockout_gs, 
-        GradientBevelFilter_as::knockout_gs);
+    const int flags = PropFlags::onlySWF8Up;
+    o.init_property("distance", gradientbevelfilter_distance, 
+        gradientbevelfilter_distance, flags);
+    o.init_property("angle", gradientbevelfilter_angle, 
+        gradientbevelfilter_angle, flags);
+    o.init_property("alphas", gradientbevelfilter_alphas, 
+        gradientbevelfilter_alphas, flags);
+    o.init_property("colors", gradientbevelfilter_colors, 
+        gradientbevelfilter_colors, flags);
+    o.init_property("ratios", gradientbevelfilter_ratios, 
+        gradientbevelfilter_ratios, flags);
+    o.init_property("blurX", gradientbevelfilter_blurX, 
+        gradientbevelfilter_blurX, flags);
+    o.init_property("blurY", gradientbevelfilter_blurY, 
+        gradientbevelfilter_blurY, flags);
+    o.init_property("strength", gradientbevelfilter_strength, 
+        gradientbevelfilter_strength, flags);
+    o.init_property("quality", gradientbevelfilter_quality, 
+        gradientbevelfilter_quality, flags);
+    o.init_property("type", gradientbevelfilter_type, 
+        gradientbevelfilter_type, flags);
+    o.init_property("knockout", gradientbevelfilter_knockout, 
+        gradientbevelfilter_knockout, flags);
 
 }
 
 as_value
-GradientBevelFilter_as::distance_gs(const fn_call& fn)
+gradientbevelfilter_distance(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
- if (fn.nargs == 0) {
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
         return as_value(ptr->m_distance );
     }
-    float sp_distance = fn.arg(0).to_number<float> ();
+    
+    float sp_distance = fn.arg(0).to_number();
     ptr->m_distance = sp_distance;
     return as_value();
 }
 
 as_value
-GradientBevelFilter_as::angle_gs(const fn_call& fn)
+gradientbevelfilter_angle(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
- if (fn.nargs == 0) {
-        return as_value(ptr->m_angle );
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
+        return as_value(ptr->m_angle);
     }
-    float sp_angle = fn.arg(0).to_number<float> ();
+    double sp_angle = fn.arg(0).to_number();
     ptr->m_angle = sp_angle;
     return as_value();
 }
 
-
-as_value
-GradientBevelFilter_as::colors_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
-    return as_value();
-}
-
-
-as_value
-GradientBevelFilter_as::alphas_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
-    return as_value();
-}
-
-
-as_value
-GradientBevelFilter_as::ratios_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
-    return as_value();
-}
-
-
-as_value
-GradientBevelFilter_as::blurX_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
- if (fn.nargs == 0) {
+as_value
+gradientbevelfilter_alphas(const fn_call& fn)
+{
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
+    UNUSED(ptr);
+    return as_value();
+}
+
+as_value
+gradientbevelfilter_colors(const fn_call& fn)
+{
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
+    UNUSED(ptr);
+    return as_value();
+}
+
+as_value
+gradientbevelfilter_ratios(const fn_call& fn)
+{
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
+    UNUSED(ptr);
+    return as_value();
+}
+
+as_value
+gradientbevelfilter_blurX(const fn_call& fn)
+{
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
         return as_value(ptr->m_blurX );
     }
     float sp_blurX = fn.arg(0).to_number<float> ();
@@ -187,24 +150,22 @@
     return as_value();
 }
 
-
 as_value
-GradientBevelFilter_as::blurY_gs(const fn_call& fn)
+gradientbevelfilter_blurY(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
- if (fn.nargs == 0) {
-        return as_value(ptr->m_blurY );
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
+    if (fn.nargs == 0) {
+               return as_value(ptr->m_blurY );
     }
     float sp_blurY = fn.arg(0).to_number<float> ();
     ptr->m_blurY = sp_blurY;
     return as_value();
 }
 
-
 as_value
-GradientBevelFilter_as::strength_gs(const fn_call& fn)
+gradientbevelfilter_strength(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
         return as_value(ptr->m_strength );
     }
@@ -214,23 +175,23 @@
 }
 
 as_value
-GradientBevelFilter_as::quality_gs(const fn_call& fn)
+gradientbevelfilter_quality(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_quality );
+               return as_value(ptr->m_quality );
     }
     boost::uint8_t sp_quality = fn.arg(0).to_number<boost::uint8_t> ();
-     ptr->m_quality = sp_quality;
+    ptr->m_quality = sp_quality;
     return as_value();
 }
 
 as_value
-GradientBevelFilter_as::knockout_gs(const fn_call& fn)
+gradientbevelfilter_knockout(const fn_call& fn)
 {
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-        return as_value(ptr->m_knockout );
+               return as_value(ptr->m_knockout );
     }
     bool sp_knockout = fn.arg(0).to_bool ();
     ptr->m_knockout = sp_knockout;
@@ -238,20 +199,9 @@
 }
 
 as_value
-GradientBevelFilter_as::bitmap_clone(const fn_call& fn)
-{
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
-    boost::intrusive_ptr<GradientBevelFilter_as> obj = new 
GradientBevelFilter_as(*ptr);
-    boost::intrusive_ptr<as_object> r = obj;
-    r->set_prototype(ptr->get_prototype());
-    r->copyProperties(*ptr);
-    return as_value(r);
-}
-
-as_value
-GradientBevelFilter_as::type_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GradientBevelFilter_as> ptr = 
ensureType<GradientBevelFilter_as>(fn.this_ptr);
+gradientbevelfilter_type(const fn_call& fn)
+{
+    GradientBevelFilter_as* ptr = 
ensureNativeType<GradientBevelFilter_as>(fn.this_ptr);
 
     if (fn.nargs == 0)
     {
@@ -259,15 +209,18 @@
         {
             case GradientBevelFilter::FULL_BEVEL:
                 return as_value("full");
+
                 break;
 
             default:
             case GradientBevelFilter::INNER_BEVEL:
                 return as_value("inner");
+
                 break;
 
             case GradientBevelFilter::OUTER_BEVEL:
                 return as_value("outer");
+
                 break;
 
         }
@@ -290,13 +243,13 @@
 }
 
 as_value
-GradientBevelFilter_as::ctor(const fn_call& )
+gradientbevelfilter_new(const fn_call& fn)
 {
-    boost::intrusive_ptr<as_object> obj = new 
GradientBevelFilter_as(GradientBevelFilter_as::Interface());
-
-    GradientBevelFilter_as::attachProperties(*obj);
-    return as_value(obj.get());
-
-}
-
-}
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new GradientBevelFilter_as);
+    return as_value();
+}
+
+}
+}
+

=== modified file 'libcore/asobj/flash/filters/GradientGlowFilter_as.cpp'
--- a/libcore/asobj/flash/filters/GradientGlowFilter_as.cpp     2009-07-28 
11:58:27 +0000
+++ b/libcore/asobj/flash/filters/GradientGlowFilter_as.cpp     2009-09-22 
09:09:48 +0000
@@ -20,179 +20,142 @@
 #include "GradientGlowFilter.h"
 #include "VM.h"
 #include "Global_as.h"
+#include "BitmapFilter_as.h"
 #include "builtin_function.h"
-#include "BitmapFilter_as.h"
 
 namespace gnash {
 
-class GradientGlowFilter_as : public as_object, public GradientGlowFilter
+namespace {
+    as_value gradientglowfilter_new(const fn_call& fn);
+    as_value gradientglowfilter_distance(const fn_call& fn);
+    as_value gradientglowfilter_angle(const fn_call& fn);
+    as_value gradientglowfilter_colors(const fn_call& fn);
+    as_value gradientglowfilter_alphas(const fn_call& fn);
+    as_value gradientglowfilter_ratios(const fn_call& fn);
+    as_value gradientglowfilter_shadowAlpha(const fn_call& fn);
+    as_value gradientglowfilter_blurX(const fn_call& fn);
+    as_value gradientglowfilter_blurY(const fn_call& fn);
+    as_value gradientglowfilter_strength(const fn_call& fn);
+    as_value gradientglowfilter_quality(const fn_call& fn);
+    as_value gradientglowfilter_type(const fn_call& fn);
+    as_value gradientglowfilter_knockout(const fn_call& fn);
+
+    void attachGradientGlowFilterInterface(as_object& o);
+}
+
+/// TODO: should this inherit from BitmapFilter_as (relay)? This might
+/// make cloning easier, but needs some testing first.
+class GradientGlowFilter_as : public Relay, public GradientGlowFilter
 {
 public:
-    static as_value distance_gs(const fn_call& fn);
-    static as_value angle_gs(const fn_call& fn);
-    static as_value colors_gs(const fn_call& fn);
-    static as_value alphas_gs(const fn_call& fn);
-    static as_value ratios_gs(const fn_call& fn);
-    static as_value blurX_gs(const fn_call& fn);
-    static as_value blurY_gs(const fn_call& fn);
-    static as_value strength_gs(const fn_call& fn);
-    static as_value quality_gs(const fn_call& fn);
-    static as_value type_gs(const fn_call& fn);
-    static as_value knockout_gs(const fn_call& fn);
-    static as_value bitmap_clone(const fn_call& fn);
-
-    GradientGlowFilter_as(as_object *obj)
-        :
-        as_object(obj)
-    {}
-    
-    static as_object* Interface();
-    static void attachInterface(as_object& o);
-    static void attachProperties(as_object& o);
-    static as_value ctor(const fn_call& fn);
- 
-private:
-    static boost::intrusive_ptr<as_object> s_interface;
-
+    GradientGlowFilter_as() {}
 };
 
-
-boost::intrusive_ptr<as_object> GradientGlowFilter_as::s_interface;
-
-
-as_object*
-GradientGlowFilter_as::Interface()
-{
-    if (GradientGlowFilter_as::s_interface == NULL) {
-        GradientGlowFilter_as::s_interface = new as_object 
(getBitmapFilterInterface());
-        VM::get().addStatic(GradientGlowFilter_as::s_interface.get());
-        
GradientGlowFilter_as::attachInterface(*GradientGlowFilter_as::s_interface);
-    }
-    return GradientGlowFilter_as::s_interface.get();
-}
-
+/// The prototype of flash.filters.GradientGlowFilter is a new BitmapFilter.
 void
 gradientglowfilter_class_init(as_object& where, const ObjectURI& uri)
 {
-    boost::intrusive_ptr<as_object> cl;
-    if (cl != NULL) return;
-    Global_as* gl = getGlobal(where);
-    cl = gl->createClass(&GradientGlowFilter_as::ctor, 
GradientGlowFilter_as::Interface());
-    VM::get().addStatic(cl.get());
-    GradientGlowFilter_as::attachInterface(*cl);
-    where.init_member(getName(uri), cl.get(), as_object::DefaultFlags,
-            getNamespace(uri));
-}
-
-
-void
-GradientGlowFilter_as::attachInterface(as_object& o)
-{
-    Global_as* gl = getGlobal(o);
-       boost::intrusive_ptr<builtin_function> gs;
-
-    o.set_member(VM::get().getStringTable().find("clone"), 
gl->createFunction(bitmap_clone));
-
-}
-
-
-void
-GradientGlowFilter_as::attachProperties(as_object& o)
-{
-       boost::intrusive_ptr<builtin_function> gs;
-
-    o.init_property("distance" , GradientGlowFilter_as::distance_gs, 
-        GradientGlowFilter_as::distance_gs);
-    o.init_property("angle" , GradientGlowFilter_as::angle_gs, 
-        GradientGlowFilter_as::angle_gs);
-
-    o.init_property("alphas" , GradientGlowFilter_as::alphas_gs, 
-        GradientGlowFilter_as::alphas_gs);
-
-    o.init_property("ratios" , GradientGlowFilter_as::ratios_gs, 
-        GradientGlowFilter_as::ratios_gs);
-    o.init_property("blurX" , GradientGlowFilter_as::blurX_gs, 
-        GradientGlowFilter_as::blurX_gs);
-
-    o.init_property("blurY" , GradientGlowFilter_as::blurY_gs, 
-        GradientGlowFilter_as::blurY_gs);
-
-    o.init_property("strength" , GradientGlowFilter_as::strength_gs, 
-        GradientGlowFilter_as::strength_gs);
-
-    o.init_property("quality" , GradientGlowFilter_as::quality_gs, 
-        GradientGlowFilter_as::quality_gs);
-    o.init_property("type" , GradientGlowFilter_as::type_gs, 
-        GradientGlowFilter_as::type_gs);
-
-    o.init_property("knockout" , GradientGlowFilter_as::knockout_gs, 
-        GradientGlowFilter_as::knockout_gs);
+    registerBitmapClass(where, gradientglowfilter_new,
+            attachGradientGlowFilterInterface, uri);
+}
+
+namespace {
+
+void
+attachGradientGlowFilterInterface(as_object& o)
+{
+    const int flags = PropFlags::onlySWF8Up;
+    o.init_property("distance", gradientglowfilter_distance, 
+        gradientglowfilter_distance, flags);
+    o.init_property("angle", gradientglowfilter_angle, 
+        gradientglowfilter_angle, flags);
+    o.init_property("colors", gradientglowfilter_colors, 
+        gradientglowfilter_colors, flags);
+    o.init_property("alphas", gradientglowfilter_alphas, 
+        gradientglowfilter_alphas, flags);
+    o.init_property("ratios", gradientglowfilter_ratios, 
+        gradientglowfilter_ratios, flags);
+    o.init_property("blurX", gradientglowfilter_blurX, 
+        gradientglowfilter_blurX, flags);
+    o.init_property("blurY", gradientglowfilter_blurY, 
+        gradientglowfilter_blurY, flags);
+    o.init_property("strength", gradientglowfilter_strength, 
+        gradientglowfilter_strength, flags);
+    o.init_property("quality", gradientglowfilter_quality, 
+        gradientglowfilter_quality, flags);
+    o.init_property("type", gradientglowfilter_type, 
+        gradientglowfilter_type, flags);
+    o.init_property("knockout", gradientglowfilter_knockout, 
+        gradientglowfilter_knockout, flags);
 
 }
 
 as_value
-GradientGlowFilter_as::distance_gs(const fn_call& fn)
+gradientglowfilter_distance(const fn_call& fn)
 {
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-               return as_value(ptr->m_distance );
+        return as_value(ptr->m_distance );
     }
-    float sp_distance = fn.arg(0).to_number<float> ();
+    
+    float sp_distance = fn.arg(0).to_number();
     ptr->m_distance = sp_distance;
     return as_value();
 }
 
 as_value
-GradientGlowFilter_as::angle_gs(const fn_call& fn)
+gradientglowfilter_angle(const fn_call& fn)
 {
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-               return as_value(ptr->m_angle );
+        return as_value(ptr->m_angle);
     }
-    float sp_angle = fn.arg(0).to_number<float> ();
+    double sp_angle = fn.arg(0).to_number();
     ptr->m_angle = sp_angle;
     return as_value();
 }
 
 as_value
-GradientGlowFilter_as::colors_gs(const fn_call& fn)
-{
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
-    return as_value();
-}
-
-
-as_value
-GradientGlowFilter_as::alphas_gs(const fn_call& fn)
-{
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
-    return as_value();
-}
-
-as_value
-GradientGlowFilter_as::ratios_gs(const fn_call& fn)
-{
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
-    return as_value();
-}
-
-as_value
-GradientGlowFilter_as::blurX_gs(const fn_call& fn)
-{
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+gradientglowfilter_colors(const fn_call& fn)
+{
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
+
+    UNUSED(ptr);
+    return as_value();
+}
+
+as_value
+gradientglowfilter_alphas(const fn_call& fn)
+{
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
+    UNUSED(ptr);
+    return as_value();
+}
+
+as_value
+gradientglowfilter_ratios(const fn_call& fn)
+{
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
+    UNUSED(ptr);
+    return as_value();
+}
+
+as_value
+gradientglowfilter_blurX(const fn_call& fn)
+{
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-               return as_value(ptr->m_blurX );
+        return as_value(ptr->m_blurX );
     }
     float sp_blurX = fn.arg(0).to_number<float> ();
     ptr->m_blurX = sp_blurX;
     return as_value();
 }
 
-
 as_value
-GradientGlowFilter_as::blurY_gs(const fn_call& fn)
+gradientglowfilter_blurY(const fn_call& fn)
 {
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
                return as_value(ptr->m_blurY );
     }
@@ -202,11 +165,11 @@
 }
 
 as_value
-GradientGlowFilter_as::strength_gs(const fn_call& fn)
+gradientglowfilter_strength(const fn_call& fn)
 {
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
-               return as_value(ptr->m_strength );
+        return as_value(ptr->m_strength );
     }
     float sp_strength = fn.arg(0).to_number<float> ();
     ptr->m_strength = sp_strength;
@@ -214,9 +177,9 @@
 }
 
 as_value
-GradientGlowFilter_as::quality_gs(const fn_call& fn)
+gradientglowfilter_quality(const fn_call& fn)
 {
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
                return as_value(ptr->m_quality );
     }
@@ -226,9 +189,9 @@
 }
 
 as_value
-GradientGlowFilter_as::knockout_gs(const fn_call& fn)
+gradientglowfilter_knockout(const fn_call& fn)
 {
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
     if (fn.nargs == 0) {
                return as_value(ptr->m_knockout );
     }
@@ -238,20 +201,9 @@
 }
 
 as_value
-GradientGlowFilter_as::bitmap_clone(const fn_call& fn)
-{
-       boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
-    boost::intrusive_ptr<GradientGlowFilter_as> obj = new 
GradientGlowFilter_as(*ptr);
-    boost::intrusive_ptr<as_object> r = obj;
-    r->set_prototype(ptr->get_prototype());
-    r->copyProperties(*ptr);
-    return as_value(r);
-}
-
-as_value
-GradientGlowFilter_as::type_gs(const fn_call& fn)
-{
-    boost::intrusive_ptr<GradientGlowFilter_as> ptr = 
ensureType<GradientGlowFilter_as>(fn.this_ptr);
+gradientglowfilter_type(const fn_call& fn)
+{
+    GradientGlowFilter_as* ptr = 
ensureNativeType<GradientGlowFilter_as>(fn.this_ptr);
 
     if (fn.nargs == 0)
     {
@@ -259,15 +211,18 @@
         {
             case GradientGlowFilter::FULL_GLOW:
                 return as_value("full");
+
                 break;
 
             default:
             case GradientGlowFilter::INNER_GLOW:
                 return as_value("inner");
+
                 break;
 
             case GradientGlowFilter::OUTER_GLOW:
                 return as_value("outer");
+
                 break;
 
         }
@@ -290,13 +245,13 @@
 }
 
 as_value
-GradientGlowFilter_as::ctor(const fn_call& )
+gradientglowfilter_new(const fn_call& fn)
 {
-    boost::intrusive_ptr<as_object> obj = new 
GradientGlowFilter_as(GradientGlowFilter_as::Interface());
-
-    GradientGlowFilter_as::attachProperties(*obj);
-    return as_value(obj.get());
-
-}
-
-}
+    boost::intrusive_ptr<as_object> obj = ensureType<as_object>(fn.this_ptr);
+    obj->setRelay(new GradientGlowFilter_as);
+    return as_value();
+}
+
+}
+}
+

=== modified file 'libcore/asobj/flash/filters/filters_pkg.cpp'
--- a/libcore/asobj/flash/filters/filters_pkg.cpp       2009-07-16 10:07:08 
+0000
+++ b/libcore/asobj/flash/filters/filters_pkg.cpp       2009-09-22 08:31:25 
+0000
@@ -44,15 +44,16 @@
 {
 
     log_debug("Loading flash.filters package");
-    as_object *pkg = new as_object(getObjectInterface());
+    Global_as* gl = getGlobal(fn);
+    as_object* pkg = gl->createObject();
 
     string_table& st = getStringTable(fn);
     const string_table::key global = 0;
 
+    bitmapfilter_class_init(*pkg,
+            ObjectURI(st.find("BitmapFilter"), global));
     bevelfilter_class_init(*pkg,
             ObjectURI(st.find("BevelFilter"), global));
-    bitmapfilter_class_init(*pkg,
-            ObjectURI(st.find("BitmapFilter"), global));
     blurfilter_class_init(*pkg,
             ObjectURI(st.find("BlurFilter"), global));
     colormatrixfilter_class_init(*pkg,

=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING  2009-08-27 12:10:16 +0000
+++ b/testsuite/swfdec/PASSING  2009-09-22 09:19:00 +0000
@@ -117,6 +117,8 @@
 beginFill-values-8.swf:6413d81730e062f9ded5052440cb3144
 bevel-filter-properties-5.swf:019bb55478951055973b5f953b2e82ef
 bevel-filter-properties-5.swf:0ec31af3035594a9cbcb1ba8a645ad4c
+bevel-filter-properties-7.swf:ad15fef8887d813c6d450559eb6f697d
+bevel-filter-properties-8.swf:2180c600eaf3513bf4d5b7abce1d7a83
 bitmapdata-getters-5.swf:b32dce961f672c8c7ae32d5cee3d8f45
 bitmapdata-getters-6.swf:305acbd129fc45f26837dec9f24720ca
 bitmapdata-getters-7.swf:93e7771bb9f3ad11318b18c136555649
@@ -134,6 +136,8 @@
 BlurFilter-construct-7.swf:c38a6f916e3bc1a0141c9c78d23e0aa0
 blur-filter-properties-5.swf:4c29ecc04df379ced45039fdbb79eb9c
 blur-filter-properties-5.swf:f2e1d9ccc47765bd6c88095b19974c7b
+blur-filter-properties-7.swf:b6873d493b6eed04fc626a0d6fa16c2a
+blur-filter-properties-8.swf:4f3ccb90f6b6cee360432cfd8c9f7488
 boolean-6.swf:5bd542a9133a3abd9a2c7bcd960e816b
 boolean-7.swf:4124413f55f405ad865a05403bc24662
 boolean-8.swf:c3c872988d25c8e49c11e5e337ea1e69
@@ -181,6 +185,8 @@
 color-getters.swf:4cee4418f75171e7bf423759a468b36b
 color-matrix-filter-properties-5.swf:2349ffbd77298b0dea59d6ed618c382b
 color-matrix-filter-properties-5.swf:cc51e1cb7864d648f958ffef649d5464
+color-matrix-filter-properties-7.swf:584a31bbd059b354169fc47fce089b55
+color-matrix-filter-properties-8.swf:16258fad9126858838fcb66acd619382
 color-new.swf:b19cf3d46f416b919eb312da473b6756
 color-setRGB.swf:0841414e9ac7d2f9b57e40aec3d2f44f
 color-setTransform-empty.swf:2a72a5273ab8713ee289ff1726b0959c
@@ -237,6 +243,8 @@
 conversion-functions-8.swf:4a68346aaa982e32b2882a49e34faa07
 convolution-filter-properties-5.swf:96e15de475e31c328e201c152ffd2f42
 convolution-filter-properties-5.swf:db6e2ddcbee195363a53c276bfc460d7
+convolution-filter-properties-7.swf:76115d033238f862563eb53d646a6d6c
+convolution-filter-properties-8.swf:4dbd723608f87a7fc4437429be5a97d7
 countdown.swf:db94f8e7bb5a46cbf210c94a19fa068d
 crash-0.5.2-cvs-return-from-block-5.swf:4aab3181976e557d6e0457ff7e0a6403
 crash-0.5.2-cvs-return-from-block-6.swf:c1c585c3c888f13d69f9646c0f2fb928
@@ -415,6 +423,8 @@
 double.swf:8b18d5d6a4168afe60c583c27e704b7d
 drop-shadow-filter-properties-5.swf:68ec26c24ecb04174a484d810dab523f
 drop-shadow-filter-properties-5.swf:827a880fc55b1afb96515f0d64a064b6
+drop-shadow-filter-properties-7.swf:3b02293df6f980aff90968423cba04e5
+drop-shadow-filter-properties-8.swf:6796725f3b3e10e7702ed4d773281cf6
 duplicateMovieClip-events-5.swf:503662305ff666f692c310f307947134
 duplicateMovieClip-events-6.swf:2f262bee780053fc72e8a8440bb38d6e
 duplicateMovieClip-events-7.swf:69aee6d163d81eb06dc13f1c4c527c3a
@@ -558,6 +568,8 @@
 global-variable-properties-8.swf:79a56139ee730d611953dcf941209610
 glow-filter-properties-5.swf:10d87d4cbd9c1f4c41a817f67cf3f530
 glow-filter-properties-5.swf:b3d05908aaa98c7115ec1727d695a16a
+glow-filter-properties-7.swf:9123eda3b74587369d299c25dc688f6c
+glow-filter-properties-8.swf:81e69a2fae2de611a20d1f8ffee08247
 goto1.swf:6f35a27cb3aee7f282eccb3b16290c70
 goto2.swf:f845271dd90a84b3919ca9000d66cd25
 goto3.swf:c9db121dc7744f6f76d4b6f6cdb9847f
@@ -568,8 +580,12 @@
 gotolabel.swf:0b25cdd19455cac05676955bbb14e445
 gradient-bevel-filter-properties-5.swf:4e4322654b7b7368fdc5499cff81654f
 gradient-bevel-filter-properties-5.swf:b0d435175adc96e6300b4a522aae7d47
+gradient-bevel-filter-properties-7.swf:3de225638ab3d71320c2cdc51a073fba
+gradient-bevel-filter-properties-8.swf:96f6869c5f34d8e7740c2e9c8ff572f2
 gradient-glow-filter-properties-5.swf:719ca44e28c6f4fd8ca97ed2c1386fdd
 gradient-glow-filter-properties-5.swf:dd43dd6eb377ad30efd52286f1ce0b1b
+gradient-glow-filter-properties-7.swf:df4ee4cb483420ee262338efac0ccdaa
+gradient-glow-filter-properties-8.swf:9fa97b59fcb7d52aad3f3f51e5ccaa0d
 height1.swf:245da260d32dbc48a5f38566ee70171b
 height3.swf:2b7547493377ae1c0163c8273a4073f7
 height4.swf:8d36c180d196b49608f996db21a421bc
@@ -1289,6 +1305,7 @@
 Transform-matrix-7.swf:c4110453b8151dd87efff882e5b312ca
 transform-properties-5.swf:9332e41f53db6ec456387efffd9e12a7
 transform-properties-5.swf:b0386824584340e1d0a80f986ce779b9
+transform-properties-6.swf:482c65962803ec5b48558f9f31585360
 transform-properties-7.swf:3b06ecd463038959132e9cae56e58b3b
 transform-properties-8.swf:47331702f04553a41f57842ebfd081f8
 transform.swf:5c8533f9168ca3e92d000ce1693ed5ef


reply via email to

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