gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_prop_flags.h server/a...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/as_prop_flags.h server/a...
Date: Wed, 02 Apr 2008 15:50:51 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/02 15:50:51

Modified files:
        .              : ChangeLog 
        server         : as_prop_flags.h 
        server/asobj   : Sound.cpp 
        testsuite/swfdec: PASSING 

Log message:
        * server/as_prop_flags.h: add SWF9 visibility flag.
        * server/asobj/Sound.cpp: get closer to swfdec reported properties
          set, stubbing missing methods, correctly setting flags.
        * testsuite/swfdec/PASSING: sound-properties-9.swf passes, 5 to 8
          still not (due to a weird value of a weird member).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6163&r2=1.6164
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_prop_flags.h?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Sound.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.118&r2=1.119

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6163
retrieving revision 1.6164
diff -u -b -r1.6163 -r1.6164
--- ChangeLog   2 Apr 2008 12:24:17 -0000       1.6163
+++ ChangeLog   2 Apr 2008 15:50:50 -0000       1.6164
@@ -1,9 +1,17 @@
+2008-04-02 Sandro Santilli <address@hidden>
+
+       * server/as_prop_flags.h: add SWF9 visibility flag.
+       * server/asobj/Sound.cpp: get closer to swfdec reported properties
+         set, stubbing missing methods, correctly setting flags.
+       * testsuite/swfdec/PASSING: sound-properties-9.swf passes, 5 to 8
+         still not (due to a weird value of a weird member).
+
 2008-04-02 Udo Giacomozzi <address@hidden>
 
        * backend/render_handler_agg.cpp: Only swap pixel format bits on big
          endian hosts for 24 and 32 bpp modes (see bug #22799)
          
-2008-04-01 Sandro Santilli <address@hidden>
+2008-04-02 Sandro Santilli <address@hidden>
 
        * testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp: 
          the testcase has 11 tests now.
@@ -13,7 +21,7 @@
          Number.prototype in swf5 are fixed now.
        * testsuite/swfdec/PASSING: number.swf succeeds.
 
-2008-04-01 Sandro Santilli <address@hidden>
+2008-04-02 Sandro Santilli <address@hidden>
 
        * testsuite/actionscript.all/Number.as: more tests on Number.prototype
          (weird results)
@@ -21,37 +29,37 @@
          is supposed to work _only_ for the number object.
        * testsuite/actionscript.all/Boolean.as: !"true" succeeds.
 
-2008-04-01 Benjamin Wolsey <address@hidden>
+2008-04-02 Benjamin Wolsey <address@hidden>
 
        * server/as_value.cpp: use stringstream instead of strtod to avoid
          different locales changing the result (SWF4 only).
        * testsuite/misc-swfc.all: tests passing.
 
-2008-04-01 Sandro Santilli <address@hidden>
+2008-04-02 Sandro Santilli <address@hidden>
 
        * testsuite/misc-swfc.all/swf4opcode.sc: make swf4 dejagnu interface
          behave as the usual one (more info).
 
-2008-04-01 Sandro Santilli <address@hidden>
+2008-04-02 Sandro Santilli <address@hidden>
 
        * server/as_value.cpp (to_bool_v5, to_bool_v6): "true" and "false"
          have no special meaning !
        * testsuite/actionscript.all/ops.as: pass !"true" is false in swf<7.
        * testsuite/misc-swfc.all/swf4opcode.sc: pass !"true".
 
-2008-04-01 Sandro Santilli <address@hidden>
+2008-04-02 Sandro Santilli <address@hidden>
 
        * testsuite/misc-swfc.all/swf4opcode.sc: test ACTION_LOGICALNOT, gnash
          fails a "true" and a "_root" in swf4.
        * testsuite/actionscript.all/ops.as: test ACTION_LOGICALNOT, gnash
          fails a "true" in swf5.
 
-2008-04-01 Benjamin Wolsey <address@hidden>
+2008-04-02 Benjamin Wolsey <address@hidden>
 
        * testsuite/misc-swfc.all/swf4opcode.sc: was just about to add exponent
          tests. Here are some more. Also test for decimal separator.
 
-2008-04-01 Sandro Santilli <address@hidden>
+2008-04-02 Sandro Santilli <address@hidden>
 
        * testsuite/misc-swfc.all/swf4opcode.sc: check that scientific
          notation still works in swf4.

Index: server/as_prop_flags.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_prop_flags.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/as_prop_flags.h      31 Mar 2008 16:26:51 -0000      1.14
+++ server/as_prop_flags.h      2 Apr 2008 15:50:51 -0000       1.15
@@ -60,7 +60,10 @@
                onlySWF7Up      = 1 << 10, // 1024
 
                /// Only visible by VM initialized for version 8 or higher 
-               onlySWF8Up      = 1 << 12 // 4096
+               onlySWF8Up      = 1 << 12, // 4096
+
+               /// Only visible by VM initialized for version 9 or higher 
+               onlySWF9Up      = 1 << 13 // 8192
 
        };
 
@@ -145,6 +148,7 @@
                if ( _flags & ignoreSWF6 && swfVersion == 6 ) return false;
                if ( _flags & onlySWF7Up && swfVersion  < 7 ) return false;
                if ( _flags & onlySWF8Up && swfVersion < 8 ) return false;
+               if ( _flags & onlySWF9Up && swfVersion < 9 ) return false;
                return true;
        }
 

Index: server/asobj/Sound.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Sound.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/asobj/Sound.cpp      6 Mar 2008 15:29:57 -0000       1.29
+++ server/asobj/Sound.cpp      2 Apr 2008 15:50:51 -0000       1.30
@@ -43,6 +43,7 @@
 
 #include <string>
 
+#define ONCE(x) { static bool warned=false; if (!warned) { warned=true; x; } }
 
 namespace gnash {
 
@@ -51,14 +52,18 @@
 static as_value sound_getbytesloaded(const fn_call& fn);
 static as_value sound_getbytestotal(const fn_call& fn);
 static as_value sound_getpan(const fn_call& fn);
+static as_value sound_setpan(const fn_call& fn);
+static as_value sound_getDuration(const fn_call& fn);
+static as_value sound_setDuration(const fn_call& fn);
 static as_value sound_gettransform(const fn_call& fn);
+static as_value sound_getPosition(const fn_call& fn);
 static as_value sound_getvolume(const fn_call& fn);
 static as_value sound_loadsound(const fn_call& fn);
-static as_value sound_setpan(const fn_call& fn);
 static as_value sound_settransform(const fn_call& fn);
 static as_value sound_setvolume(const fn_call& fn);
 static as_value sound_start(const fn_call& fn);
 static as_value sound_stop(const fn_call& fn);
+static as_value checkPolicyFile_getset(const fn_call& fn);
 static as_object* getSoundInterface();
 
 Sound::Sound()         :
@@ -379,48 +384,56 @@
 as_value
 sound_getbytesloaded(const fn_call& /*fn*/)
 {
-       static bool warned = false;
-       if ( ! warned )
-       {
-               log_unimpl (__FUNCTION__);
-               warned = true;
-       }
+       ONCE( log_unimpl ("Sound.getBytesLoaded()") );
        return as_value();
 }
 
 as_value
 sound_getbytestotal(const fn_call& /*fn*/)
 {
-       static bool warned = false;
-       if ( ! warned )
-       {
-               log_unimpl (__FUNCTION__);
-               warned = true;
-       }
+       ONCE( log_unimpl ("Sound.getBytesTotal()") );
        return as_value();
 }
 
 as_value
 sound_getpan(const fn_call& /*fn*/)
 {
-       static bool warned = false;
-       if ( ! warned )
-       {
-               log_unimpl (__FUNCTION__);
-               warned = true;
-       }
+       ONCE( log_unimpl ("Sound.getDuration()") );
+       return as_value();
+}
+
+as_value
+sound_getDuration(const fn_call& /*fn*/)
+{
+       ONCE( log_unimpl ("Sound.getDuration()") );
+       return as_value();
+}
+
+as_value
+sound_setDuration(const fn_call& /*fn*/)
+{
+       ONCE( log_unimpl ("Sound.setDuration()") );
+       return as_value();
+}
+
+as_value
+sound_getPosition(const fn_call& /*fn*/)
+{
+       ONCE( log_unimpl ("Sound.getPosition()") );
+       return as_value();
+}
+
+as_value
+sound_setPosition(const fn_call& /*fn*/)
+{
+       ONCE( log_unimpl ("Sound.setPosition()") );
        return as_value();
 }
 
 as_value
 sound_gettransform(const fn_call& /*fn*/)
 {
-       static bool warned = false;
-       if ( ! warned )
-       {
-               log_unimpl (__FUNCTION__);
-               warned = true;
-       }
+       ONCE( log_unimpl ("Sound.getTransform()") );
        return as_value();
 }
 
@@ -455,24 +468,14 @@
 as_value
 sound_setpan(const fn_call& /*fn*/)
 {
-       static bool warned = false;
-       if ( ! warned )
-       {
-               log_unimpl (__FUNCTION__);
-               warned = true;
-       }
+       ONCE( log_unimpl ("Sound.setPan()") );
        return as_value();
 }
 
 as_value
 sound_settransform(const fn_call& /*fn*/)
 {
-       static bool warned = false;
-       if ( ! warned )
-       {
-               log_unimpl (__FUNCTION__);
-               warned = true;
-       }
+       ONCE( log_unimpl ("Sound.setTransform()") );
        return as_value();
 }
 
@@ -502,14 +505,22 @@
 }
 
 as_value
-sound_ID3(const fn_call& /*fn*/)
+checkPolicyFile_getset(const fn_call& /*fn*/)
 {
-       static bool warned = false;
-       if ( ! warned )
-       {
-               log_unimpl (__FUNCTION__);
-               warned = true;
-       }
+       ONCE( log_unimpl ("Sound.checkPolicyFile") );
+       return as_value();
+}
+
+as_value
+sound_areSoundsInaccessible(const fn_call& /*fn*/)
+{
+       // TODO: I guess this would have to do with premissions (crossdomain 
stuff)
+       // more then capability.
+       // See http://www.actionscript.org/forums/showthread.php3?t=160028
+       // 
+       // naive test shows this always being undefined..
+       //
+       ONCE( log_unimpl ("Sound.areSoundsInaccessible()") );
        return as_value();
 }
 
@@ -525,18 +536,30 @@
 attachSoundInterface(as_object& o)
 {
 
-       o.init_member("attachSound", new builtin_function(sound_attachsound));
-       o.init_member("getBytesLoaded", new 
builtin_function(sound_getbytesloaded));
-       o.init_member("getBytesTotal", new 
builtin_function(sound_getbytestotal));
-       o.init_member("getPan", new builtin_function(sound_getpan));
-       o.init_member("getTransform", new builtin_function(sound_gettransform));
-       o.init_member("getVolume", new builtin_function(sound_getvolume));
-       o.init_member("loadSound", new builtin_function(sound_loadsound));
-       o.init_member("setPan", new builtin_function(sound_setpan));
-       o.init_member("setTransform", new builtin_function(sound_settransform));
-       o.init_member("setVolume", new builtin_function(sound_setvolume));
-       o.init_member("start", new builtin_function(sound_start));
-       o.init_member("stop", new builtin_function(sound_stop));
+       int fl_hpc = 
as_prop_flags::dontEnum|as_prop_flags::dontDelete|as_prop_flags::readOnly;
+
+       o.init_member("attachSound", new builtin_function(sound_attachsound), 
fl_hpc);
+       o.init_member("getDuration", new builtin_function(sound_getDuration), 
fl_hpc);
+       o.init_member("setDuration", new builtin_function(sound_setDuration), 
fl_hpc);
+       o.init_member("getPan", new builtin_function(sound_getpan), fl_hpc);
+       o.init_member("setPan", new builtin_function(sound_setpan), fl_hpc);
+       o.init_member("loadSound", new builtin_function(sound_loadsound), 
fl_hpc);
+       o.init_member("start", new builtin_function(sound_start), fl_hpc);
+       o.init_member("stop", new builtin_function(sound_stop), fl_hpc);
+       o.init_member("getPosition", new builtin_function(sound_getPosition), 
fl_hpc);
+       o.init_member("setPosition", new builtin_function(sound_setPosition), 
fl_hpc);
+       o.init_member("getTransform", new builtin_function(sound_gettransform), 
fl_hpc);
+       o.init_member("setTransform", new builtin_function(sound_settransform), 
fl_hpc);
+       o.init_member("getVolume", new builtin_function(sound_getvolume), 
fl_hpc);
+       o.init_member("setVolume", new builtin_function(sound_setvolume), 
fl_hpc);
+
+       int fl_hpcn6 = fl_hpc|as_prop_flags::onlySWF6Up;
+
+       o.init_member("getBytesLoaded", new 
builtin_function(sound_getbytesloaded), fl_hpcn6);
+       o.init_member("getBytesTotal", new 
builtin_function(sound_getbytestotal), fl_hpcn6);
+
+       int fl_hpcn9 = 
as_prop_flags::dontEnum|as_prop_flags::dontDelete|as_prop_flags::readOnly|as_prop_flags::onlySWF9Up;
+       o.init_member("areSoundsInaccessible", new 
builtin_function(sound_areSoundsInaccessible), fl_hpcn9);
 
        // Properties
 
@@ -545,8 +568,13 @@
        gettersetter = &sound_duration;
        o.init_readonly_property("duration", *gettersetter);
 
-       gettersetter = &sound_ID3;
-       o.init_property("ID3", *gettersetter, *gettersetter);
+       //there's no such thing as an ID3 member (swfdec shows)
+       //gettersetter = &sound_ID3;
+       //o.init_property("ID3", *gettersetter, *gettersetter);
+
+       gettersetter = &checkPolicyFile_getset;
+       int fl_hp = as_prop_flags::dontEnum|as_prop_flags::dontDelete;
+       o.init_property("checkPolicyFile", *gettersetter, *gettersetter, fl_hp);
 
        gettersetter = &sound_position;
        o.init_readonly_property("position", *gettersetter);
@@ -562,6 +590,9 @@
        {
                o = new as_object(getObjectInterface());
                attachSoundInterface(*o);
+
+               // TODO: make this an additional second arg to 
as_object(__proto__) ctor !
+               o->set_member_flags(NSV::PROP_uuPROTOuu, 
as_prop_flags::readOnly, 0);
        }
 
        return o.get();
@@ -576,10 +607,9 @@
 
        if ( cl == NULL )
        {
-               cl=new builtin_function(&sound_new, getSoundInterface());
-               // replicate all interface to class, to be able to access
-               // all methods as static functions
-               attachSoundInterface(*cl);
+               as_object* iface = getSoundInterface();
+               cl=new builtin_function(&sound_new, iface);
+               iface->set_member_flags(NSV::PROP_CONSTRUCTOR, 
as_prop_flags::readOnly);
                     
        }
 

Index: testsuite/swfdec/PASSING
===================================================================
RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -b -r1.118 -r1.119
--- testsuite/swfdec/PASSING    2 Apr 2008 10:55:32 -0000       1.118
+++ testsuite/swfdec/PASSING    2 Apr 2008 15:50:51 -0000       1.119
@@ -677,6 +677,7 @@
 shift-5.swf:2abb590ff9d66b6b38056bd051b33a37
 shift-6.swf:a1f04fa0397da15c63e045c660133601
 shift-7.swf:b40c81bf068a75553414fcd597497363
+sound-properties-9.swf:de5a86bf41bfedbd3502e2e32dcbb10c
 stack-overflow-5.swf:8a5c121b108caf5a866f6ed23149f7aa
 stack-overflow-6.swf:b2ce1f0c07f3237911ae393b031f1ed7
 stack-overflow-7.swf:0a9241b806dd05aaee6d388c0d966a61




reply via email to

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