gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/character.cpp server/cha...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/character.cpp server/cha...
Date: Thu, 20 Mar 2008 12:31:54 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/03/20 12:31:54

Modified files:
        .              : ChangeLog 
        server         : character.cpp character.h movie_root.cpp 
                         movie_root.h 

Log message:
        Delegate character info gathering to characters themselves
        (for Movie properties)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5984&r2=1.5985
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.83&r2=1.84
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.132&r2=1.133
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.171&r2=1.172
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.112&r2=1.113

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5984
retrieving revision 1.5985
diff -u -b -r1.5984 -r1.5985
--- ChangeLog   20 Mar 2008 01:05:50 -0000      1.5984
+++ ChangeLog   20 Mar 2008 12:31:53 -0000      1.5985
@@ -1,3 +1,9 @@
+2008-03-20 Sandro Santilli <address@hidden>
+
+       * server/character.{cpp,h}: add a virtual getMovieInfo.
+       * server/movie_root.{cpp,h}: delegate character info gathering
+         to the characters themselves. 
+
 2008-03-19  Rob Savoye  <address@hidden>
 
        * libbase/network.cpp: Close the listener file descript too before

Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- server/character.cpp        18 Mar 2008 11:26:54 -0000      1.83
+++ server/character.cpp        20 Mar 2008 12:31:53 -0000      1.84
@@ -993,6 +993,49 @@
   return gnash::render::bounds_in_clipping_area(mybounds);  
 }
 
+#ifdef USE_MENUS
+void
+character::getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator it)
+{
+       const std::string yes = _("yes");
+       const std::string no = _("no");
+
+       it = tr.append_child(it, StringPair(getTarget(), typeName(*this)));
+
+
+       std::ostringstream os;
+       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 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();
+       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));
+}
+#endif
+
 
 } // namespace gnash
 

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -b -r1.132 -r1.133
--- server/character.h  6 Mar 2008 05:22:53 -0000       1.132
+++ server/character.h  20 Mar 2008 12:31:54 -0000      1.133
@@ -34,6 +34,9 @@
 #include "log.h"
 #include "snappingrange.h"
 #include "Range2d.h"
+#ifdef USE_MENUS
+# include "tree.hh"
+#endif
 
 #include <map>
 #include <cstdarg>
@@ -66,6 +69,7 @@
        // action_buffer is externally owned
        typedef std::vector<const action_buffer*> BufferList;
        typedef std::map<event_id, BufferList> Events;
+       typedef std::pair<std::string, std::string> StringPair; // ifdef 
USE_MENU...
 
 private:
 
@@ -1142,6 +1146,19 @@
        /// for input textfields.
        ///
        virtual bool isSelectableTextField() const { return false; }
+
+#ifdef USE_MENUS
+       /// Append character info in the tree
+       //
+       /// @param tr
+       ///     The tree to append movie to
+       ///
+       /// @param it
+       ///     The iterator to append info to.
+       ///
+       virtual void getMovieInfo(tree<StringPair>& tr, 
tree<StringPair>::iterator it);
+#endif
+
 };
 
 
@@ -1152,6 +1169,7 @@
 #define set_invalidated() set_invalidated(__FILE__, __LINE__)
 #endif
 
+
 #endif // GNASH_CHARACTER_H
 
 

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -b -r1.171 -r1.172
--- server/movie_root.cpp       17 Mar 2008 16:21:02 -0000      1.171
+++ server/movie_root.cpp       20 Mar 2008 12:31:54 -0000      1.172
@@ -1907,7 +1907,7 @@
 
 #ifdef USE_MENUS
 void
-movie_root::getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator& it)
+movie_root::getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator it)
 {
 
     const std::string yes = _("yes");
@@ -1962,39 +1962,7 @@
        for (LiveChars::const_iterator i=_liveChars.begin(), e=_liveChars.end();
                                                                   i != e; ++i)
        {
-           tree<StringPair>::iterator charIter = tr.append_child(localIter,
-                           StringPair((*i)->getTarget(), typeName(*(*i))));
-
-        os.str("");
-        os << (*i)->get_depth();
-           tr.append_child(charIter, StringPair(_("Depth"), os.str()));
-
-        /// Don't add if the character has no ratio value
-        if ((*i)->get_ratio() >= 0)
-        {
-            os.str("");
-            os << (*i)->get_ratio();
-               tr.append_child(charIter, StringPair(_("Ratio"), os.str()));
-           }       
-
-        /// Don't add if it's not a real clipping depth
-        if (int cd = (*i)->get_clip_depth() != -1000000 )
-        {
-            os.str("");
-            if (cd == -2000000) os << "Dynamic mask";
-            else os << cd;
-
-               tr.append_child(charIter, StringPair(_("Clipping depth"), 
os.str()));       
-        }
-
-        os.str("");
-        os << (*i)->get_width() << "x" << (*i)->get_height();
-           tr.append_child(charIter, StringPair(_("Dimensions"), os.str()));   
-
-           tr.append_child(charIter, StringPair(_("Dynamic"), 
(*i)->isDynamic() ? yes : no));  
-           tr.append_child(charIter, StringPair(_("Mask"), (*i)->isMaskLayer() 
? yes : no));       
-           tr.append_child(charIter, StringPair(_("Destroyed"), 
(*i)->isDestroyed() ? yes : no));
-           tr.append_child(charIter, StringPair(_("Unloaded"), 
(*i)->isUnloaded() ? yes : no));
+           (*i)->getMovieInfo(tr, localIter);
     }
 
 }

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- server/movie_root.h 14 Mar 2008 13:38:08 -0000      1.112
+++ server/movie_root.h 20 Mar 2008 12:31:54 -0000      1.113
@@ -671,7 +671,7 @@
 
 #ifdef USE_MENUS
     typedef std::pair<std::string, std::string> StringPair;
-    void getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator& it);
+    void getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator it);
 #endif
 
 private:




reply via email to

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