gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-222-g0432ac4
Date: Fri, 08 Apr 2011 19:56:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  0432ac4677f46aa7f9177f69d98044716b3951d5 (commit)
       via  693e85a6e71f952e328922520d15f72ba2ac8bcf (commit)
      from  212629c7f400e2c37d9cf918ec2f888b349364d0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=0432ac4677f46aa7f9177f69d98044716b3951d5


commit 0432ac4677f46aa7f9177f69d98044716b3951d5
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Apr 8 21:44:03 2011 +0200

    Add our own tests for _focusrect.

diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index cd4a410..031ff04 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -1424,7 +1424,7 @@ getFocusRect(DisplayObject& o)
     LOG_ONCE(log_unimpl("_focusrect"));
 
     const boost::tribool fr = o.focusRect();
-    if (indeterminate(fr)) {
+    if (boost::indeterminate(fr)) {
         as_value null;
         null.set_null();
         return as_value(null);
diff --git a/testsuite/actionscript.all/MovieClip.as 
b/testsuite/actionscript.all/MovieClip.as
index bf3994f..6b948f9 100644
--- a/testsuite/actionscript.all/MovieClip.as
+++ b/testsuite/actionscript.all/MovieClip.as
@@ -115,19 +115,19 @@ check(!MovieClip.prototype.hasOwnProperty("_global"));
 endOfTest = function() 
 {
 #if OUTPUT_VERSION <= 5
-       check_totals(347); // SWF5
+       check_totals(353); // SWF5
 #endif
 
 #if OUTPUT_VERSION == 6
-       check_totals(919); // SWF6
+       check_totals(925); // SWF6
 #endif
 
 #if OUTPUT_VERSION == 7
-       check_totals(952); // SWF7
+       check_totals(958); // SWF7
 #endif
 
 #if OUTPUT_VERSION >= 8
-       check_totals(1069); // SWF8+
+       check_totals(1075); // SWF8+
 #endif
 
        play();
@@ -363,6 +363,24 @@ else
 
 check(mc._focusrect != undefined);
 check_equals(mc._focusrect, true);
+mc._focusrect = false;
+check_equals(mc._focusrect, false);
+mc._focusrect = 8;
+check_equals(mc._focusrect, true);
+mc._focusrect = undefined;
+check_equals(mc._focusrect, true);
+mc._focusrect = null;
+check_equals(mc._focusrect, true);
+mc._focusrect = 0;
+check_equals(mc._focusrect, false);
+
+#if OUTPUT_VERSION == 5
+check_equals(typeof(mc._focusrect), "number");
+#else
+check_equals(typeof(mc._focusrect), "boolean");
+#endif
+
+
 check(mc._framesloaded != undefined);
 check(mc._height != undefined);
 check(mc._highquality != undefined);

http://git.savannah.gnu.org/cgit//commit/?id=693e85a6e71f952e328922520d15f72ba2ac8bcf


commit 693e85a6e71f952e328922520d15f72ba2ac8bcf
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Apr 8 21:23:58 2011 +0200

    Handle _focusrect property correctly.
    
    Drawing the rectangle still isn't implemented, but it is correct in
    ActionScript.

diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index 736691a..cd4a410 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -29,6 +29,7 @@
 #include <boost/algorithm/string/case_conv.hpp>
 #include <boost/assign/list_of.hpp>
 #include <boost/bind.hpp>
+#include <boost/logic/tribool.hpp>
 
 #include "movie_root.h"
 #include "MovieClip.h"
@@ -48,8 +49,7 @@
 
 #undef set_invalidated
 
-namespace gnash
-{
+namespace gnash {
 
 // Forward declarations.
 namespace {
@@ -95,6 +95,8 @@ DisplayObject::DisplayObject(movie_root& mr, as_object* 
object,
     _yscale(100),
     _rotation(0),
     _depth(0),
+    _focusRect(parent ? boost::tribool(boost::indeterminate) :
+                        boost::tribool(true)),
     _volume(100),
     _ratio(0),
     m_clip_depth(noClipDepthValue),
@@ -1417,16 +1419,36 @@ setWidth(DisplayObject& o, const as_value& val)
 }
 
 as_value
-getFocusRect(DisplayObject& /*o*/)
+getFocusRect(DisplayObject& o)
 {
     LOG_ONCE(log_unimpl("_focusrect"));
-    return as_value(true);
+
+    const boost::tribool fr = o.focusRect();
+    if (indeterminate(fr)) {
+        as_value null;
+        null.set_null();
+        return as_value(null);
+    }
+    const bool ret = static_cast<bool>(fr);
+    if (getSWFVersion(*getObject(&o)) == 5) {
+        return as_value(static_cast<double>(ret));
+    }
+    return as_value(ret);
 }
 
 void
-setFocusRect(DisplayObject& /*o*/, const as_value& /*val*/)
+setFocusRect(DisplayObject& o, const as_value& val)
 {
-    LOG_ONCE(log_unimpl("_focusrect setting"));
+    LOG_ONCE(log_unimpl("_focusrect"));
+
+    VM& vm = getVM(*getObject(&o));
+    if (!o.parent()) {
+        const double d = toNumber(val, vm);
+        if (isNaN(d)) return;
+        o.focusRect(d);
+        return;
+    }
+    o.focusRect(toBool(val, vm));
 }
 
 as_value
diff --git a/libcore/DisplayObject.h b/libcore/DisplayObject.h
index 8867774..b4fc6a1 100644
--- a/libcore/DisplayObject.h
+++ b/libcore/DisplayObject.h
@@ -30,6 +30,7 @@
 #include <cassert>
 #include <boost/cstdint.hpp> // For C99 int types
 #include <boost/noncopyable.hpp>
+#include <boost/logic/tribool.hpp>
 
 #include "ObjectURI.h" 
 #include "GC.h"
@@ -957,6 +958,14 @@ public:
     /// DisplayObjects should mark their own resources in this function.
     virtual void markOwnResources() const {}
 
+    boost::tribool focusRect() const {
+        return _focusRect;
+    }
+
+    void focusRect(boost::tribool focus) {
+        _focusRect = focus;
+    }
+
 protected:
     
     /// Render a dynamic mask for a specified DisplayObject
@@ -1053,6 +1062,8 @@ private:
     /// The depth of this DisplayObject.
     boost::int32_t _depth;
 
+    boost::tribool _focusRect;
+
     /// Volume control associated to this DisplayObject
     //
     /// This is used by Sound objects
diff --git a/testsuite/actionscript.all/TextField.as 
b/testsuite/actionscript.all/TextField.as
index 4d70d95..94bbfdd 100644
--- a/testsuite/actionscript.all/TextField.as
+++ b/testsuite/actionscript.all/TextField.as
@@ -619,8 +619,8 @@ check_equals(tf._framesloaded, undefined);
 // Check TextField._focusrect
 check(tf._focusrect !== 'null');
 check(tf._focusRect !== 'null');
-xcheck_equals(typeof(tf._focusrect), 'null');
-xcheck_equals(typeof(tf._focusRect), 'null');
+check_equals(typeof(tf._focusrect), 'null');
+check_equals(typeof(tf._focusRect), 'null');
 check(! tf.hasOwnProperty('_focusrect') ); 
 check(! tf.__proto__.hasOwnProperty('_focusrect') ); 
 

-----------------------------------------------------------------------

Summary of changes:
 libcore/DisplayObject.cpp               |   34 +++++++++++++++++++++++++-----
 libcore/DisplayObject.h                 |   11 ++++++++++
 testsuite/actionscript.all/MovieClip.as |   26 ++++++++++++++++++++---
 testsuite/actionscript.all/TextField.as |    4 +-
 4 files changed, 63 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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