gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ...
Date: Tue, 08 Apr 2008 20:23:37 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/08 20:23:36

Modified files:
        .              : ChangeLog 
        server         : edit_text_character.cpp 
        testsuite/actionscript.all: TextField.as 

Log message:
                * server/edit_text_character.cpp (attachTextFieldInterface):
                  add support for _parent, _{x,y}mouse and _{x,y}scale using
                  native getter-setter in the prototype.
                * testsuite/actionscript.all/TextField.as: sane tests pass,
                  insane fail.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6219&r2=1.6220
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.162&r2=1.163
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/TextField.as?cvsroot=gnash&r1=1.49&r2=1.50

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6219
retrieving revision 1.6220
diff -u -b -r1.6219 -r1.6220
--- ChangeLog   8 Apr 2008 18:56:44 -0000       1.6219
+++ ChangeLog   8 Apr 2008 20:23:33 -0000       1.6220
@@ -1,5 +1,13 @@
 2008-04-08 Sandro Santilli <address@hidden>
 
+       * server/edit_text_character.cpp (attachTextFieldInterface):
+         add support for _parent, _{x,y}mouse and _{x,y}scale using
+         native getter-setter in the prototype.
+       * testsuite/actionscript.all/TextField.as: sane tests pass,
+         insane fail.
+
+2008-04-08 Sandro Santilli <address@hidden>
+
        * testsuite/actionscript.all/TextField.as: test _parent. 
          textfields need some love...
        * testsuite/swfdec/REALTIME: run netstream-dimensions.swf in

Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -b -r1.162 -r1.163
--- server/edit_text_character.cpp      4 Apr 2008 15:02:00 -0000       1.162
+++ server/edit_text_character.cpp      8 Apr 2008 20:23:34 -0000       1.163
@@ -265,12 +265,37 @@
 static void
 attachTextFieldInterface(as_object& o)
 {
+       boost::intrusive_ptr<builtin_function> getset;
+
        int target_version = o.getVM().getSWFVersion();
 
        // TextField is an AsBroadcaster
         AsBroadcaster::initialize(o);
 
-       // SWF5 or higher
+       int propFlags = as_prop_flags::dontDelete
+               |as_prop_flags::dontEnum
+               |as_prop_flags::readOnly
+               |as_prop_flags::isProtected;
+
+       // Parent seems to not be a normal property
+       getset = new builtin_function(&character::parent_getset, NULL);
+       o.init_property(NSV::PROP_uPARENT, *getset, *getset);
+
+       // Target seems to not be a normal property
+       getset = new builtin_function(&character::target_getset, NULL);
+       o.init_property(NSV::PROP_uTARGET, *getset, *getset);
+
+       // _name should be a property of the instance, not the prototype
+       getset = new builtin_function(&character::name_getset, NULL);
+       o.init_property(NSV::PROP_uNAME, *getset, *getset);
+
+       o.init_property(NSV::PROP_uXMOUSE, character::xmouse_get, 
character::xmouse_get, propFlags);
+       o.init_property(NSV::PROP_uYMOUSE, character::ymouse_get, 
character::ymouse_get, propFlags);
+       o.init_property(NSV::PROP_uXSCALE, character::xscale_getset, 
character::xscale_getset, propFlags);
+       o.init_property(NSV::PROP_uYSCALE, character::yscale_getset, 
character::yscale_getset, propFlags);
+
+
+       // SWF5 or higher (TODO: check textfields in SWF5 !!! we miss tests 
here !)
        if ( target_version  < 6 ) return;
 
        // SWF6 or higher
@@ -291,7 +316,6 @@
        // The following properties should only be attached to the prototype
        // on first textfield creation. We won't get to that detail of 
compatibility,
        // seeming not important
-       boost::intrusive_ptr<builtin_function> getset;
        getset = new builtin_function(textfield_background_getset);
        o.init_property("background", *getset, *getset);
        getset = new builtin_function(textfield_backgroundColor_getset);
@@ -315,14 +339,6 @@
        getset = new builtin_function(textfield_selectable_getset);
        o.init_property("selectable", *getset, *getset);
 
-       // Target seems to not be a normal property
-       getset = new builtin_function(&character::target_getset, NULL);
-       o.init_property("_target", *getset, *getset);
-
-       // _name should be a property of the instance, not the prototype
-       getset = new builtin_function(&character::name_getset, NULL);
-       o.init_property("_name", *getset, *getset);
-
 
        if ( target_version  < 7 ) return;
 
@@ -1069,6 +1085,7 @@
        }       // end switch
 
        return get_member_default(name, val, nsname);
+       
 }
        
 

Index: testsuite/actionscript.all/TextField.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/TextField.as,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- testsuite/actionscript.all/TextField.as     8 Apr 2008 19:02:37 -0000       
1.49
+++ testsuite/actionscript.all/TextField.as     8 Apr 2008 20:23:35 -0000       
1.50
@@ -20,7 +20,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: TextField.as,v 1.49 2008/04/08 19:02:37 strk Exp $";
+rcsid="$Id: TextField.as,v 1.50 2008/04/08 20:23:35 strk Exp $";
 #include "check.as"
 
 #if OUTPUT_VERSION > 5
@@ -383,18 +383,20 @@
 // Check TextField._parent
 //-------------------------------------------------------------------------
 
-xcheck_equals(typeof(tf._parent), 'movieclip');
+check_equals(typeof(tf._parent), 'movieclip');
 check(!tf.hasOwnProperty('_parent'));
-check(!tf.__proto__.hasOwnProperty('_parent'));
-xcheck_equals(tf._parent, _root);
+xcheck(!tf.__proto__.hasOwnProperty('_parent'));
+check_equals(tf._parent, _root);
 bk = tf._parent;
 tf._parent = 23;
-check_equals(tf._parent, 23); // can be overridden !
+xcheck_equals(tf._parent, 23); // can be overridden !
 check_equals(tf._target, "/tf"); // but won't change _target
 r = delete tf._parent;
-check(r);
+xcheck(r);
+r = delete tf._parent;
+check(!r);
 TextField.prototype._parent = "from proto";
-xcheck_equals(tf._parent, _root); // still unchanged
+check_equals(tf._parent, _root); // still unchanged
 delete TextField.prototype._parent;
 tf._parent = bk;
 
@@ -700,22 +702,22 @@
 // Check TextField._xmouse
 //-------------------------------------------------------------------------
 
-xcheck_equals(typeof(tf._xmouse), 'number');
+check_equals(typeof(tf._xmouse), 'number');
 check( ! tf.hasOwnProperty('_xmouse') );
-check( ! tf.__proto__.hasOwnProperty('_xmouse') );
+xcheck( ! tf.__proto__.hasOwnProperty('_xmouse') );
 currXmouse = tf._xmouse; // unsafe, if user moves the mouse while running the 
test
 tf._xmouse = "a string";
-xcheck_equals(typeof(tf._xmouse), 'number');
-xcheck_equals(tf._xmouse, currXmouse); // possibly unsafe, if user moves the 
mouse while running the test
+check_equals(typeof(tf._xmouse), 'number');
+check_equals(tf._xmouse, currXmouse); // possibly unsafe, if user moves the 
mouse while running the test
 
 //-------------------------------------------------------------------------
 // Check TextField._xscale
 //-------------------------------------------------------------------------
 
-xcheck_equals(typeof(tf._xscale), 'number');
+check_equals(typeof(tf._xscale), 'number');
 check( ! tf.hasOwnProperty('_xscale') );
-check( ! tf.__proto__.hasOwnProperty('_xscale') );
-xcheck_equals(tf._xscale, 100); 
+xcheck( ! tf.__proto__.hasOwnProperty('_xscale') );
+check_equals(tf._xscale, 100); 
 // check how .textWidth and ._width change when changing _xscale
 currTextWidth = tf.textWidth;
 currWidth = tf._width;
@@ -740,22 +742,22 @@
 // Check TextField._ymouse
 //-------------------------------------------------------------------------
 
-xcheck_equals(typeof(tf._ymouse), 'number');
+check_equals(typeof(tf._ymouse), 'number');
 check( ! tf.hasOwnProperty('_ymouse') );
-check( ! tf.__proto__.hasOwnProperty('_ymouse') );
+xcheck( ! tf.__proto__.hasOwnProperty('_ymouse') );
 currYmouse = tf._ymouse;
 tf._ymouse = "a string";
-xcheck_equals(typeof(tf._ymouse), 'number');
-xcheck_equals(tf._ymouse, currYmouse); // possibly unsafe, if user moves the 
mouse while running the test
+check_equals(typeof(tf._ymouse), 'number');
+check_equals(tf._ymouse, currYmouse); // possibly unsafe, if user moves the 
mouse while running the test
 
 //-------------------------------------------------------------------------
 // Check TextField._yscale
 //-------------------------------------------------------------------------
 
-xcheck_equals(typeof(tf._yscale), 'number');
+check_equals(typeof(tf._yscale), 'number');
 check( ! tf.hasOwnProperty('_yscale') );
-check( ! tf.__proto__.hasOwnProperty('_yscale') );
-xcheck_equals(tf._yscale, 100); 
+xcheck( ! tf.__proto__.hasOwnProperty('_yscale') );
+check_equals(tf._yscale, 100); 
 // check how .textHeight and ._height change based on _yscale
 currTextHeight = tf.textHeight;
 currHeight = tf._height;
@@ -845,9 +847,9 @@
 
 
 #if OUTPUT_VERSION < 8
- check_totals(396);
-#else
  check_totals(397);
+#else
+ check_totals(398);
 #endif
 
 #else // OUTPUT_VERSION <= 5




reply via email to

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