gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9778: Simplify as_object interface.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9778: Simplify as_object interface.
Date: Thu, 18 Sep 2008 13:41:27 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9778
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2008-09-18 13:41:27 +0200
message:
  Simplify as_object interface.
modified:
  extensions/mysql/mysql_table.cpp
  libcore/array.cpp
  libcore/as_object.cpp
  libcore/as_object.h
  libcore/asobj/XML_as.cpp
  libcore/asobj/xmlnode.h
  libcore/button_character_instance.cpp
  libcore/edit_text_character.cpp
  libcore/sprite_instance.cpp
    ------------------------------------------------------------
    revno: 9774.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Thu 2008-09-18 11:59:32 +0200
    message:
      Call the base class get_member directly when that's what's wanted. Saves
      an unnecessary extra function in as_object.
    modified:
      extensions/mysql/mysql_table.cpp
      libcore/array.cpp
      libcore/as_object.cpp
      libcore/as_object.h
      libcore/asobj/XML_as.cpp
      libcore/asobj/xmlnode.h
      libcore/button_character_instance.cpp
      libcore/edit_text_character.cpp
      libcore/sprite_instance.cpp
=== modified file 'extensions/mysql/mysql_table.cpp'
--- a/extensions/mysql/mysql_table.cpp  2008-09-09 04:07:37 +0000
+++ b/extensions/mysql/mysql_table.cpp  2008-09-18 09:59:32 +0000
@@ -111,7 +111,7 @@
        bool    table::get_member(const std::string& name, as_value* val)
        {
                // check table methods
-               if ( get_member_default(name, val) == false )
+               if ( as_object::get_member(name, val) == false )
                {
                        // hack
                        int idx = strtoul(name.c_str(), NULL, 0);

=== modified file 'libcore/array.cpp'
--- a/libcore/array.cpp 2008-09-17 13:12:23 +0000
+++ b/libcore/array.cpp 2008-09-18 09:59:32 +0000
@@ -778,7 +778,7 @@
         }
     }
 
-    return get_member_default(name, val, nsname);
+    return as_object::get_member(name, val, nsname);
 }
 
 bool

=== modified file 'libcore/as_object.cpp'
--- a/libcore/as_object.cpp     2008-09-17 07:27:11 +0000
+++ b/libcore/as_object.cpp     2008-09-18 09:59:32 +0000
@@ -300,9 +300,9 @@
        }
 }
 
-/*protected*/
+
 bool
-as_object::get_member_default(string_table::key name, as_value* val,
+as_object::get_member(string_table::key name, as_value* val,
        string_table::key nsname)
 {
        assert(val);
@@ -329,6 +329,7 @@
        }
 }
 
+
 Property*
 as_object::getByIndex(int index)
 {

=== modified file 'libcore/as_object.h'
--- a/libcore/as_object.h       2008-09-16 11:00:50 +0000
+++ b/libcore/as_object.h       2008-09-18 09:59:32 +0000
@@ -665,10 +665,7 @@
        /// @return true of the named property was found, false otherwise.
        ///
        virtual bool get_member(string_table::key name, as_value* val,
-               string_table::key nsname = 0)
-       {
-               return get_member_default(name, val, nsname);
-       }
+               string_table::key nsname = 0);
 
        /// Resolve the given relative path component
        //
@@ -1065,30 +1062,6 @@
        ///
        virtual void enumerateNonProperties(as_environment&) const {}
 
-       /// Get a property value by name
-       //
-       /// This is the default implementation, taking care of
-       /// the inheritance chain and getter/setter functions.
-       ///
-        /// The derived class should not override this method,
-        /// but instead implement its own gettersetter properties.
-       ///
-       /// NOTE that this method is non-const becase a property
-       ///      could also be a getter/setter and we can't promise
-       ///      that the 'getter' won't change this object trough
-       ///      use of the 'this' reference.
-       ///
-       /// @param name
-       ///     Name of the property. Must be all lowercase
-       ///     if the current VM is initialized for a  target
-       ///     up to SWF6.
-       ///
-       /// @param val
-       ///     The as_value to store a found variable's value in.
-       ///
-       bool get_member_default(string_table::key name, as_value* val, 
-               string_table::key nsname);
-
        /// Set a member value
        //
        /// This is the default implementation, taking care of

=== modified file 'libcore/asobj/XML_as.cpp'
--- a/libcore/asobj/XML_as.cpp  2008-09-18 08:40:46 +0000
+++ b/libcore/asobj/XML_as.cpp  2008-09-18 09:59:32 +0000
@@ -138,7 +138,7 @@
                 return true;
         }
 
-        return get_member_default(name, val, nsname);
+        return as_object::get_member(name, val, nsname);
 }
 
 bool

=== modified file 'libcore/asobj/xmlnode.h'
--- a/libcore/asobj/xmlnode.h   2008-08-25 07:26:39 +0000
+++ b/libcore/asobj/xmlnode.h   2008-09-18 09:59:32 +0000
@@ -45,7 +45,7 @@
 //
 /// This is the base class for the XML ActionScript class
 ///
-class XMLNode : public gnash::as_object
+class XMLNode : public as_object
 {
 public:
 

=== modified file 'libcore/button_character_instance.cpp'
--- a/libcore/button_character_instance.cpp     2008-09-17 07:43:20 +0000
+++ b/libcore/button_character_instance.cpp     2008-09-18 09:59:32 +0000
@@ -1067,7 +1067,7 @@
 
   // TOCHECK : Try object members, BEFORE display list items
   //
-  if (get_member_default(name_key, val, nsname))
+  if (as_object::get_member(name_key, val, nsname))
   {
 
 // ... trying to be useful to Flash coders ...

=== modified file 'libcore/edit_text_character.cpp'
--- a/libcore/edit_text_character.cpp   2008-09-18 08:40:46 +0000
+++ b/libcore/edit_text_character.cpp   2008-09-18 09:59:32 +0000
@@ -1120,7 +1120,7 @@
        }
        }       // end switch
 
-       return get_member_default(name, val, nsname);
+       return as_object::get_member(name, val, nsname);
        
 }
        

=== modified file 'libcore/sprite_instance.cpp'
--- a/libcore/sprite_instance.cpp       2008-09-18 08:34:47 +0000
+++ b/libcore/sprite_instance.cpp       2008-09-18 09:59:32 +0000
@@ -2951,14 +2951,13 @@
 
   // See if it's a member
 
-  // NOTE: direct use of get_member_default avoids
+  // NOTE: direct use of the base class's get_member avoids
   //       triggering a call to sprite_instance::get_member
   //       which would scan the child characters again
   //       w/out a need for it
-  //return as_object::get_path_element(key);
 
   as_value tmp;
-  if ( ! get_member_default(key, &tmp, 0) )
+  if ( !as_object::get_member(key, &tmp, 0) )
   {
     return NULL;
   }


reply via email to

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