gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10375: Drop dump_character_tree in


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10375: Drop dump_character_tree in favour of using the swf InfoTree. This is
Date: Wed, 03 Dec 2008 09:22:34 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10375
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2008-12-03 09:22:34 +0100
message:
  Drop dump_character_tree in favour of using the swf InfoTree. This is
  now a slightly different display, but can be modified when required.
modified:
  gui/gui.cpp
  libcore/DisplayList.cpp
  libcore/DisplayList.h
  libcore/MovieClip.cpp
  libcore/MovieClip.h
  libcore/character.cpp
  libcore/character.h
  libcore/movie_root.cpp
  libcore/movie_root.h
=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp       2008-11-20 21:54:55 +0000
+++ b/gui/gui.cpp       2008-12-03 08:22:34 +0000
@@ -750,8 +750,18 @@
     // m_child_invalidated flag if at least one of it's childs has the
     // invalidated flag set.
     log_debug("DUMPING CHARACTER TREE"); 
-    m->dump_character_tree();
     
+    InfoTree tr;
+    InfoTree::iterator top = tr.begin();
+    _stage->getMovieInfo(tr, top);
+
+    for (InfoTree::iterator i = tr.begin(), e = tr.end();
+            i != e; ++i) {
+        std::cout << std::string(tr.depth(i) * 2, ' ') << i->first << ": " << 
+            i->second << std::endl;
+    }
+
+
     // less verbose, and often necessary: see the exact coordinates of the
     // invalidated bounds (mainly to see if it's NULL or something else).      
     std::cout << "Calculated changed ranges: " << changed_ranges << "\n";
@@ -1079,7 +1089,8 @@
     // 
     if ( ! _started )
     {
-        topIter = tr->insert(topIter, StringPair("Stage properties", "not 
constructed yet"));
+        topIter = tr->insert(topIter, StringPair("Stage properties", 
+                    "not constructed yet"));
         return tr;
     }
 

=== modified file 'libcore/DisplayList.cpp'
--- a/libcore/DisplayList.cpp   2008-11-26 13:59:04 +0000
+++ b/libcore/DisplayList.cpp   2008-12-03 08:22:34 +0000
@@ -866,25 +866,6 @@
 }
 
 
-void 
-DisplayList::dump_character_tree(const std::string prefix) const
-{
-  // print self:
-  //character::dump_character_tree(prefix);
-
-  // recursion:
-  for( const_iterator it = _charsByDepth.begin(),
-      endIt = _charsByDepth.end();
-    it != endIt; ++it)
-  {
-    const DisplayItem& dobj = *it;
-    
-    dobj->dump_character_tree(prefix+" "); 
-  }
-  
-
-}
-
 /// This method is not in the header in the hope DisplayItemDepthLess
 /// will be inlined by compiler
 

=== modified file 'libcore/DisplayList.h'
--- a/libcore/DisplayList.h     2008-11-26 13:59:04 +0000
+++ b/libcore/DisplayList.h     2008-12-03 08:22:34 +0000
@@ -323,9 +323,6 @@
   /// method with the same name of all childs. 
        void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);     
        
-       void dump_character_tree(const std::string prefix) const;
-       
-
        /// Return number of elements in the list
        size_t size() const
        { 

=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp     2008-12-02 11:45:42 +0000
+++ b/libcore/MovieClip.cpp     2008-12-03 08:22:34 +0000
@@ -2134,13 +2134,6 @@
 
 }
 
-void 
-MovieClip::dump_character_tree(const std::string prefix) const
-{
-    character::dump_character_tree(prefix);
-    m_display_list.dump_character_tree(prefix+" ");
-}
-
 
 /// register characters as key listeners if they have clip key events defined.
 /// Don't call twice for the same chracter.

=== modified file 'libcore/MovieClip.h'
--- a/libcore/MovieClip.h       2008-12-01 15:16:02 +0000
+++ b/libcore/MovieClip.h       2008-12-03 08:22:34 +0000
@@ -621,8 +621,6 @@
 
     void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
     
-    void dump_character_tree(const std::string prefix) const;
-            
     const DisplayList& getDisplayList() const {
             return m_display_list;
     }

=== modified file 'libcore/character.cpp'
--- a/libcore/character.cpp     2008-12-02 11:45:42 +0000
+++ b/libcore/character.cpp     2008-12-03 08:22:34 +0000
@@ -221,13 +221,6 @@
   } 
 }
 
-void 
-character::dump_character_tree(const std::string prefix) const
-{
-  log_debug("%s%s<%p> I=%d,CI=%d", prefix, typeName(*this), this,
-    m_invalidated, m_child_invalidated);  
-}
-
 void
 character::extend_invalidated_bounds(const InvalidatedRanges& ranges)
 {
@@ -1292,33 +1285,38 @@
        os << get_depth();
        tr.append_child(it, StringPair(_("Depth"), os.str()));
 
-        /// Don't add if the character has no ratio value
-        if (get_ratio() >= 0)
-        {
-            os.str("");
-            os << get_ratio();
-               tr.append_child(it, StringPair(_("Ratio"), os.str()));
-           }       
+    /// Don't add if the character has no ratio value
+    if (get_ratio() >= 0)
+    {
+        os.str("");
+        os << get_ratio();
+        tr.append_child(it, StringPair(_("Ratio"), os.str()));
+    }      
 
-        /// Don't add if it's not a real clipping depth
-        if (int cd = get_clip_depth() != noClipDepthValue )
-        {
+    /// Don't add if it's not a real clipping depth
+    if (int cd = get_clip_depth() != noClipDepthValue )
+    {
                os.str("");
                if (cd == dynClipDepthValue) os << "Dynamic mask";
                else os << cd;
 
                tr.append_child(it, StringPair(_("Clipping depth"), os.str())); 
    
-        }
+    }
 
-        os.str("");
-        os << get_width() << "x" << get_height();
+    os.str("");
+    os << get_width() << "x" << get_height();
        tr.append_child(it, StringPair(_("Dimensions"), os.str()));     
 
        tr.append_child(it, StringPair(_("Dynamic"), isDynamic() ? yes : no));  
        tr.append_child(it, StringPair(_("Mask"), isMaskLayer() ? yes : no));   
    
        tr.append_child(it, StringPair(_("Destroyed"), isDestroyed() ? yes : 
no));
        tr.append_child(it, StringPair(_("Unloaded"), isUnloaded() ? yes : no));
-
+#ifndef NDEBUG
+    // This probably isn't interesting for non-developers
+    tr.append_child(it, StringPair(_("Invalidated"), m_invalidated ? yes : 
no));
+    tr.append_child(it, StringPair(_("Child invalidated"),
+                m_child_invalidated ? yes : no));
+#endif
        return it;
 }
 #endif

=== modified file 'libcore/character.h'
--- a/libcore/character.h       2008-12-02 11:45:42 +0000
+++ b/libcore/character.h       2008-12-03 08:22:34 +0000
@@ -1099,14 +1099,6 @@
   ///
   virtual void add_invalidated_bounds(InvalidatedRanges& ranges, bool force) = 
0;
 
-  /// Prints a human readable character tree to LOG_DEBUG for debugging 
purposes.
-  /// 
-  /// This is mainly intended to debug invalidated bounds issues as it shows
-  /// the status of the relevant flags. 'prefix' is prepended to each line
-  /// to achieve the tree structure.
-  ///
-  virtual void dump_character_tree(const std::string prefix) const;
-  
   /// Called instead of display() when the character is not visible on stage.
   /// Used to clear the invalidated flags.
   virtual void omit_display() { clear_invalidated(); }; 

=== modified file 'libcore/movie_root.cpp'
--- a/libcore/movie_root.cpp    2008-12-02 11:45:42 +0000
+++ b/libcore/movie_root.cpp    2008-12-03 08:22:34 +0000
@@ -1563,16 +1563,6 @@
        }
 }
 
-void 
-movie_root::dump_character_tree() const 
-{
-    // @@ deprecated
-  for (Levels::const_iterator i=_movies.begin(), e=_movies.end(); i!=e; ++i)
-       {
-         log_debug("--- movie at depth %d:", i->second->get_depth());
-               i->second->dump_character_tree("CTREE: ");
-       }
-}
 
 int
 movie_root::minPopulatedPriorityQueue() const
@@ -2382,9 +2372,6 @@
 movie_root::getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator it)
 {
 
-    const std::string yes = _("yes");
-    const std::string no = _("no");
-
     tree<StringPair>::iterator localIter;
 
     //
@@ -2431,9 +2418,19 @@
     // Stage: scripts state (enabled/disabled)
     localIter = tr.append_child(it, StringPair("Scripts",
                 _disableScripts ? " disabled" : "enabled"));
-                
+     
+    getCharacterTree(tr, it);    
+}
+
+void
+movie_root::getCharacterTree(tree<StringPair>& tr,
+        tree<StringPair>::iterator it)
+{
+
+    tree<StringPair>::iterator localIter;
+
     /// Stage: number of live characters
-    os.str("");
+    std::ostringstream os;
     os << _liveChars.size();
     localIter = tr.append_child(it, StringPair(_("Live characters"), 
os.str()));
 
@@ -2445,6 +2442,7 @@
        }
 
 }
+
 #endif
 
 void

=== modified file 'libcore/movie_root.h'
--- a/libcore/movie_root.h      2008-12-02 11:45:42 +0000
+++ b/libcore/movie_root.h      2008-12-03 08:22:34 +0000
@@ -447,8 +447,6 @@
     DSOEXPORT void add_invalidated_bounds(InvalidatedRanges& ranges,
             bool force);
     
-    void dump_character_tree() const;
-
     /// Return the topmost active entity under the pointer
     //
     /// This method returns cached info, with cache updated
@@ -797,6 +795,7 @@
 #ifdef USE_SWFTREE
     typedef std::pair<std::string, std::string> StringPair;
     void getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator it);
+    void getCharacterTree(tree<StringPair>& tr, tree<StringPair>::iterator it);
 #endif
 
        /// Get URL of the SWF movie used to initialize this VM


reply via email to

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