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 ... [gnash


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/edit_text_character.cpp ... [gnash_0_8_3_branch]
Date: Sat, 17 May 2008 15:48:46 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         gnash_0_8_3_branch
Changes by:     Sandro Santilli <strk>  08/05/17 15:48:45

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

Log message:
        * server/namedStrings.{cpp,h}: add PROP_TEXT_HEIGHT.
        * server/edit_text_character.{cpp,h}: implement missing textHeight,
          turn textWidth into a proper property.
        * testsuite/actionscript.all/TextField.as: updated expected results.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.6573.2.21&r2=1.6573.2.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.182&r2=1.182.2.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.h?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.79&r2=1.79.2.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/namedStrings.cpp?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.18&r2=1.18.2.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/namedStrings.h?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.18&r2=1.18.2.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/TextField.as?cvsroot=gnash&only_with_tag=gnash_0_8_3_branch&r1=1.54&r2=1.54.2.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6573.2.21
retrieving revision 1.6573.2.22
diff -u -b -r1.6573.2.21 -r1.6573.2.22
--- ChangeLog   17 May 2008 09:36:57 -0000      1.6573.2.21
+++ ChangeLog   17 May 2008 15:48:35 -0000      1.6573.2.22
@@ -1,5 +1,12 @@
 2008-05-17 Sandro Santilli <address@hidden>
 
+       * server/namedStrings.{cpp,h}: add PROP_TEXT_HEIGHT.
+       * server/edit_text_character.{cpp,h}: implement missing textHeight,
+         turn textWidth into a proper property.
+       * testsuite/actionscript.all/TextField.as: updated expected results.
+
+2008-05-17 Sandro Santilli <address@hidden>
+
        * gui/Player.cpp (run): support relative urls in 'base' parameter,
          always resolve against baseurl given with -U or derived from -u
          or filename. Fixes bug #23260.

Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.182
retrieving revision 1.182.2.1
diff -u -b -r1.182 -r1.182.2.1
--- server/edit_text_character.cpp      6 May 2008 11:21:01 -0000       1.182
+++ server/edit_text_character.cpp      17 May 2008 15:48:38 -0000      
1.182.2.1
@@ -94,6 +94,8 @@
 static as_value textfield_html_getset(const fn_call& fn);
 static as_value textfield_selectable_getset(const fn_call& fn);
 static as_value textfield_length_getset(const fn_call& fn);
+static as_value textfield_textWidth_getset(const fn_call& fn);
+static as_value textfield_textHeight_getset(const fn_call& fn);
 
 
 //
@@ -365,6 +367,8 @@
        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);
        o.init_property(NSV::PROP_uYSCALE, character::yscale_getset, 
character::yscale_getset);
+       o.init_property(NSV::PROP_TEXT_WIDTH, textfield_textWidth_getset, 
textfield_textWidth_getset);
+       o.init_property(NSV::PROP_TEXT_HEIGHT, textfield_textHeight_getset, 
textfield_textHeight_getset);
 
 
        // SWF5 or higher (TODO: check textfields in SWF5 !!! we miss tests 
here !)
@@ -1151,18 +1155,6 @@
 #endif // GNASH_DEBUG_TEXTFIELDS
                return true;
        }
-       case NSV::PROP_TEXT_WIDTH:
-               //else if (name == "textWidth")
-       {
-               // Return the width, in pixels, of the text as laid out.
-               // (I.e. the actual text content, not our defined
-               // bounding box.)
-               //
-               // In local coords.  Verified against Macromedia Flash.
-               val->set_double(TWIPS_TO_PIXELS(m_text_bounding_box.width()));
-
-               return true;
-       }
        }       // end switch
 
        return get_member_default(name, val, nsname);
@@ -2280,6 +2272,56 @@
 }
 
 static as_value
+textfield_textHeight_getset(const fn_call& fn)
+{
+       boost::intrusive_ptr<edit_text_character> ptr = 
ensureType<edit_text_character>(fn.this_ptr);
+
+       if ( fn.nargs == 0 ) // getter
+       {
+               // Return the height, in pixels, of the text as laid out.
+               // (I.e. the actual text content, not our defined
+               // bounding box.)
+               //
+               // In local coords.  Verified against Macromedia Flash.
+               return 
as_value(TWIPS_TO_PIXELS(ptr->getTextBoundingBox().height()));
+
+       }
+       else // setter
+       {
+               IF_VERBOSE_ASCODING_ERRORS(
+               log_aserror(_("Attempt to set read-only %s property of 
TextField %s"), "textHeight", ptr->getTarget());
+               );
+       }
+
+       return as_value();
+}
+
+static as_value
+textfield_textWidth_getset(const fn_call& fn)
+{
+       boost::intrusive_ptr<edit_text_character> ptr = 
ensureType<edit_text_character>(fn.this_ptr);
+
+       if ( fn.nargs == 0 ) // getter
+       {
+               // Return the width, in pixels, of the text as laid out.
+               // (I.e. the actual text content, not our defined
+               // bounding box.)
+               //
+               // In local coords.  Verified against Macromedia Flash.
+               return 
as_value(TWIPS_TO_PIXELS(ptr->getTextBoundingBox().width()));
+
+       }
+       else // setter
+       {
+               IF_VERBOSE_ASCODING_ERRORS(
+               log_aserror(_("Attempt to set read-only %s property of 
TextField %s"), "textWidth", ptr->getTarget());
+               );
+       }
+
+       return as_value();
+}
+
+static as_value
 textfield_autoSize_getset(const fn_call& fn)
 {
        boost::intrusive_ptr<edit_text_character> ptr = 
ensureType<edit_text_character>(fn.this_ptr);

Index: server/edit_text_character.h
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.h,v
retrieving revision 1.79
retrieving revision 1.79.2.1
diff -u -b -r1.79 -r1.79.2.1
--- server/edit_text_character.h        28 Apr 2008 09:40:21 -0000      1.79
+++ server/edit_text_character.h        17 May 2008 15:48:39 -0000      1.79.2.1
@@ -392,6 +392,11 @@
 
        void setUnderlined(bool v);
 
+       const geometry::Range2d<float>& getTextBoundingBox() const
+       {
+               return m_text_bounding_box;
+       }
+
 private:
 
        /// Set our text to the given string.

Index: server/namedStrings.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/namedStrings.cpp,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -b -r1.18 -r1.18.2.1
--- server/namedStrings.cpp     6 May 2008 11:16:25 -0000       1.18
+++ server/namedStrings.cpp     17 May 2008 15:48:40 -0000      1.18.2.1
@@ -119,6 +119,7 @@
        string_table::svt( "text", NSV::PROP_TEXT ),
        string_table::svt( "textColor", NSV::PROP_TEXT_COLOR ),
        string_table::svt( "textWidth", NSV::PROP_TEXT_WIDTH ),
+       string_table::svt( "textHeight", NSV::PROP_TEXT_HEIGHT ),
        string_table::svt( "toString", NSV::PROP_TO_STRING ),
        string_table::svt( "_totalframes", NSV::PROP_uTOTALFRAMES ),
        string_table::svt( "underline", NSV::PROP_UNDERLINE ),

Index: server/namedStrings.h
===================================================================
RCS file: /sources/gnash/gnash/server/namedStrings.h,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -b -r1.18 -r1.18.2.1
--- server/namedStrings.h       6 May 2008 11:16:26 -0000       1.18
+++ server/namedStrings.h       17 May 2008 15:48:42 -0000      1.18.2.1
@@ -138,6 +138,7 @@
                PROP_TEXT,
                PROP_TEXT_COLOR,
                PROP_TEXT_WIDTH,
+               PROP_TEXT_HEIGHT,
                PROP_TO_STRING,
                PROP_uTOTALFRAMES,
                PROP_UNDERLINE,

Index: testsuite/actionscript.all/TextField.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/TextField.as,v
retrieving revision 1.54
retrieving revision 1.54.2.1
diff -u -b -r1.54 -r1.54.2.1
--- testsuite/actionscript.all/TextField.as     29 Apr 2008 17:22:43 -0000      
1.54
+++ testsuite/actionscript.all/TextField.as     17 May 2008 15:48:44 -0000      
1.54.2.1
@@ -20,7 +20,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: TextField.as,v 1.54 2008/04/29 17:22:43 strk Exp $";
+rcsid="$Id: TextField.as,v 1.54.2.1 2008/05/17 15:48:44 strk Exp $";
 #include "check.as"
 
 #if OUTPUT_VERSION > 5
@@ -69,8 +69,8 @@
 xcheck( !TextField.prototype.hasOwnProperty('selectable') );
 check( !TextField.prototype.hasOwnProperty('text') );
 xcheck( !TextField.prototype.hasOwnProperty('textColor') );
-check( !TextField.prototype.hasOwnProperty('textHeight') );
-check( !TextField.prototype.hasOwnProperty('textWidth') );
+xcheck( !TextField.prototype.hasOwnProperty('textHeight') ); // should be 
available on first instantiation
+xcheck( !TextField.prototype.hasOwnProperty('textWidth') ); // should be 
available on first instantiation
 xcheck( !TextField.prototype.hasOwnProperty('type') ); // should be available 
on first instantiation
 xcheck( !TextField.prototype.hasOwnProperty('variable') );
 xcheck( !TextField.prototype.hasOwnProperty('wordWrap') );
@@ -144,8 +144,8 @@
 check( TextField.prototype.hasOwnProperty('selectable') );
 xcheck( TextField.prototype.hasOwnProperty('text') );
 check( TextField.prototype.hasOwnProperty('textColor') );
-xcheck( TextField.prototype.hasOwnProperty('textHeight') );
-xcheck( TextField.prototype.hasOwnProperty('textWidth') );
+check( TextField.prototype.hasOwnProperty('textHeight') );
+check( TextField.prototype.hasOwnProperty('textWidth') );
 check( TextField.prototype.hasOwnProperty('type') );
 check( TextField.prototype.hasOwnProperty('variable') );
 check( TextField.prototype.hasOwnProperty('wordWrap') );
@@ -531,11 +531,11 @@
 
 // Check TextField.textHeight (height of the bounding box)
 
-xcheck_equals(typeof(tf.textHeight), 'number');
+check_equals(typeof(tf.textHeight), 'number');
 check( ! tf.hasOwnProperty('textHeight') ); 
 currentHeight = tf.textHeight; // WARNING: this might depend on the default 
font height
 tf.textHeight = 1000;
-xcheck_equals(tf.textHeight, currentHeight); // was read-only (I think)
+check_equals(tf.textHeight, currentHeight); // was read-only (I think)
 
 // Check TextField.textWidth (width of the bounding box)
 




reply via email to

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