gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11549: Clean up.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11549: Clean up.
Date: Tue, 06 Oct 2009 17:17:16 +0200
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11549 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2009-10-06 17:17:16 +0200
message:
  Clean up.
  
  Remove on_event from as_object as it's never used.
modified:
  libcore/Button.cpp
  libcore/DisplayObject.cpp
  libcore/Video.cpp
  libcore/as_object.cpp
  libcore/as_object.h
  testsuite/actionscript.all/MovieClip.as
  testsuite/actionscript.all/TextField.as
  testsuite/actionscript.all/case.as
=== modified file 'libcore/Button.cpp'
--- a/libcore/Button.cpp        2009-10-01 13:19:43 +0000
+++ b/libcore/Button.cpp        2009-10-04 09:07:01 +0000
@@ -252,12 +252,6 @@
     return (!ch || (!includeUnloaded && ch->unloaded()));
 }
 
-void
-attachButtonProperties(as_object& o)
-{
-    attachDisplayObjectProperties(o);
-}
-
 static void
 attachButtonInterface(as_object& o)
 {
@@ -280,9 +274,6 @@
 
     set_prototype(getButtonInterface());
 
-    // TODO: should be done in a creation function.
-    attachButtonProperties(*this);
-
     // check up presence Key events
     if (_def->hasKeyPressHandler()) {
         getRoot(*this).add_key_listener(this);

=== modified file 'libcore/DisplayObject.cpp'
--- a/libcore/DisplayObject.cpp 2009-10-01 13:19:43 +0000
+++ b/libcore/DisplayObject.cpp 2009-10-04 09:38:44 +0000
@@ -52,7 +52,7 @@
 // Forward declarations.
 namespace {
     /// Match blend modes.
-    typedef std::map<MovieClip::BlendMode, std::string> BlendModeMap;
+    typedef std::map<DisplayObject::BlendMode, std::string> BlendModeMap;
     const BlendModeMap& getBlendModeMap();
     bool blendModeMatches(const BlendModeMap::value_type& val,
             const std::string& mode);
@@ -280,7 +280,7 @@
 }
 
 void
-attachDisplayObjectProperties(as_object& o)
+attachDisplayObjectProperties(as_object& /*o*/)
 {
 }
 
@@ -936,7 +936,10 @@
 
     const Getters& getters = displayObjectGetters();
 
-    // The magic properties are case insensitive in all versions!
+    // TODO: _root and _global also seem to be magic properties, but are
+    // case sensitive in version 7 and above
+
+    // These magic properties are case insensitive in all versions!
     string_table& st = getStringTable(obj);
     const std::string& propname = st.value(key);
     const string_table::key noCaseKey = 
st.find(boost::to_lower_copy(propname));
@@ -958,7 +961,12 @@
 
     const Setters& setters = displayObjectSetters();
 
-    // The magic properties are case insensitive in all versions!
+    // TODO: _root and _global also seem to be magic properties, but are
+    // case sensitive in version 7 and above. They are tested to exist for
+    // TextField, MovieClip, and Button but do not belong to the
+    // inheritance chain.
+
+    // These magic properties are case insensitive in all versions!
     string_table& st = getStringTable(obj);
     const std::string& propname = st.value(key);
     const string_table::key noCaseKey = 
st.find(boost::to_lower_copy(propname));

=== modified file 'libcore/Video.cpp'
--- a/libcore/Video.cpp 2009-10-01 13:19:43 +0000
+++ b/libcore/Video.cpp 2009-10-04 09:05:59 +0000
@@ -43,7 +43,6 @@
     as_object* getVideoInterface(as_object& where);
     void attachPrototypeProperties(as_object& o);
     void attachVideoInterface(as_object& o);
-    void attachVideoProperties(as_object& o);
     as_value video_ctor(const fn_call& fn);
     as_value video_attach(const fn_call& fn);
     as_value video_clear(const fn_call& fn);
@@ -73,7 +72,6 @@
        {
         // TODO: this should happen using the native creation function
         // once Video is a Relay.
-               attachVideoProperties(*this);
                initializeDecoder();
         
         attachPrototypeProperties(*get_prototype());
@@ -384,12 +382,6 @@
     proto.init_property("width", &video_width, &video_width, flags);
 }
 
-void
-attachVideoProperties(as_object& o)
-{
-    attachDisplayObjectProperties(o);
-}
-
 as_value
 video_attach(const fn_call& fn)
 {

=== modified file 'libcore/as_object.cpp'
--- a/libcore/as_object.cpp     2009-09-30 15:20:47 +0000
+++ b/libcore/as_object.cpp     2009-10-04 08:14:49 +0000
@@ -1128,20 +1128,6 @@
        return tmp.to_object(*getGlobal(*this));
 }
 
-bool
-as_object::on_event(const event_id& id )
-{
-       as_value event_handler;
-
-       if (get_member(id.functionKey(), &event_handler) )
-       {
-               call_method0(event_handler, as_environment(_vm), this);
-               return true;
-       }
-
-       return false;
-}
-
 as_value
 as_object::getMember(string_table::key name, string_table::key nsname)
 {

=== modified file 'libcore/as_object.h'
--- a/libcore/as_object.h       2009-09-30 15:20:47 +0000
+++ b/libcore/as_object.h       2009-10-04 08:14:49 +0000
@@ -277,9 +277,6 @@
     virtual bool set_member(string_table::key key, const as_value& val,
         string_table::key nsname = 0, bool ifFound=false);
 
-
-    virtual bool on_event(const event_id& id );
-
     /// Reserve a slot
     ///
     /// Reserves a slot for a property to follow.

=== modified file 'testsuite/actionscript.all/MovieClip.as'
--- a/testsuite/actionscript.all/MovieClip.as   2009-10-04 08:14:18 +0000
+++ b/testsuite/actionscript.all/MovieClip.as   2009-10-04 09:23:36 +0000
@@ -106,25 +106,27 @@
 check(!MovieClip.prototype.hasOwnProperty("_y"));
 check(!MovieClip.prototype.hasOwnProperty("_ymouse"));
 check(!MovieClip.prototype.hasOwnProperty("_yscale"));
+check(!MovieClip.prototype.hasOwnProperty("_root"));
+check(!MovieClip.prototype.hasOwnProperty("_global"));
 
 
 // To be called at end of test
 endOfTest = function() 
 {
 #if OUTPUT_VERSION <= 5
-       check_totals(346); // SWF5
+       check_totals(338); // SWF5
 #endif
 
 #if OUTPUT_VERSION == 6
-       check_totals(911); // SWF6
+       check_totals(903); // SWF6
 #endif
 
 #if OUTPUT_VERSION == 7
-       check_totals(928); // SWF7
+       check_totals(920); // SWF7
 #endif
 
 #if OUTPUT_VERSION >= 8
-       check_totals(1018); // SWF8+
+       check_totals(1010); // SWF8+
 #endif
 
        play();
@@ -2357,21 +2359,5 @@
 check_equals(o.meth("post"), 2);
 check_equals(o.meth(), 0);
 
-// Case sensitivity
-
-// Note: we have changed the _x gettersetter for _level0. This means that
-// _x and _X are not the same.
-
-check_equals(_level1._x, _level1._X);
-check_equals(_level1._y, _level1._Y);
-check_equals(_level1._width, _level1._wIDth);
-check_equals(_level1._height, _level1._HEIGHT);
-check_equals(_level1._xmouse, _level1._XmousE);
-check_equals(_level1._ymouse, _level1._yMouse);
-check_equals(_level1._soundbuftime, _level1._soundBufTIME);
-check_equals(_level1._focusrect, _level1._FOCUSRECT);
-check_equals(_level1._quality, _level1._QUALITY);
-check_equals(_level1._highquality, _level1._highQUALITY);
-
 
 //endOfTest();

=== modified file 'testsuite/actionscript.all/TextField.as'
--- a/testsuite/actionscript.all/TextField.as   2009-10-01 10:02:31 +0000
+++ b/testsuite/actionscript.all/TextField.as   2009-10-04 09:36:21 +0000
@@ -432,6 +432,21 @@
 // TODO: see effects of unloading the textfield ?
 
 //-------------------------------------------------------------------------
+// Check TextField._root and _global
+//-------------------------------------------------------------------------
+
+xcheck(tf._root);
+xcheck_equals(_root, _root.tf._root);
+
+xcheck(tf._global);
+xcheck_equals(_global, _root.tf._global);
+
+#if OUTPUT_VERSION > 6
+xcheck(tf._root != tf._ROOT);
+xcheck(tf._root != tf._GLOBAL);
+#endif 
+
+//-------------------------------------------------------------------------
 // Check TextField._parent
 //-------------------------------------------------------------------------
 
@@ -1117,11 +1132,11 @@
 //------------------------------------------------------------
 
 #if OUTPUT_VERSION == 6
-     check_totals(492);
+     check_totals(496);
 #elif OUTPUT_VERSION == 7
- check_totals(495);
+ check_totals(501);
 #elif OUTPUT_VERSION == 8
- check_totals(496);
+ check_totals(502);
 #endif
 
 #endif

=== modified file 'testsuite/actionscript.all/case.as'
--- a/testsuite/actionscript.all/case.as        2009-02-25 22:33:03 +0000
+++ b/testsuite/actionscript.all/case.as        2009-10-04 09:23:36 +0000
@@ -321,13 +321,27 @@
 
 #endif
 
+// Case sensitivity
+// These DisplayObject properties are case-insensitive in all versions
+
+check_equals(_root._x, _root._X);
+check_equals(_root._y, _root._Y);
+check_equals(_root._width, _root._wIDth);
+check_equals(_root._height, _root._HEIGHT);
+check_equals(_root._xmouse, _root._XmousE);
+check_equals(_root._ymouse, _root._yMouse);
+check_equals(_root._soundbuftime, _root._soundBufTIME);
+check_equals(_root._focusrect, _root._FOCUSRECT);
+check_equals(_root._quality, _root._QUALITY);
+check_equals(_root._highquality, _root._highQUALITY);
+
 
 #if OUTPUT_VERSION <= 5
- check_totals(23);
+ check_totals(33);
 #endif
 #if OUTPUT_VERSION == 6
- check_totals(52);
+ check_totals(62);
 #endif
 #if OUTPUT_VERSION >= 7
- check_totals(46);
+ check_totals(56);
 #endif


reply via email to

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