[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo... |
Date: |
Fri, 14 Mar 2008 13:38:08 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/03/14 13:38:08
Modified files:
. : ChangeLog
server : movie_root.cpp movie_root.h
gui : gui.cpp
Log message:
* server/movie_root.{h,cpp}: add getMovieInfo() to fill the
info tree
with data. Added more data about movie stage and from public
methods
of gnash::character. This class will eventually get its own
tree
filler method.
* gui/gui.cpp: delegate some tree filling to movie_root.
The movie_root code shouldn't build if menus are disabled, and
shouldn't be
called either. The gui code could do the same to avoid using the tree
class
entirely when it can't be accessed anyway.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5911&r2=1.5912
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.168&r2=1.169
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.111&r2=1.112
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.141&r2=1.142
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5911
retrieving revision 1.5912
diff -u -b -r1.5911 -r1.5912
--- ChangeLog 14 Mar 2008 12:21:43 -0000 1.5911
+++ ChangeLog 14 Mar 2008 13:38:07 -0000 1.5912
@@ -1,3 +1,11 @@
+2008-03-14 Benjamin Wolsey <address@hidden>
+
+ * server/movie_root.{h,cpp}: add getMovieInfo() to fill the info tree
+ with data. Added more data about movie stage and from public methods
+ of gnash::character. This class will eventually get its own tree
+ filler method.
+ * gui/gui.cpp: delegate some tree filling to movie_root.
+
2008-03-14 Sandro Santilli <address@hidden>
* server/font.cpp (read_font_info): initialize the device font
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -b -r1.168 -r1.169
--- server/movie_root.cpp 14 Mar 2008 11:25:41 -0000 1.168
+++ server/movie_root.cpp 14 Mar 2008 13:38:08 -0000 1.169
@@ -44,6 +44,10 @@
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/bind.hpp>
+#ifdef USE_MENUS
+# include "tree.hh"
+#endif
+
//#define GNASH_DEBUG 1
//#define GNASH_DEBUG_LOADMOVIE_REQUESTS_PROCESSING 1
//#define GNASH_DEBUG_TIMERS_EXPIRATION 1
@@ -1891,5 +1895,95 @@
}
+#ifdef USE_MENUS
+void
+movie_root::getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator& it)
+{
+
+ const std::string yes = _("yes");
+ const std::string no = _("no");
+
+ tree<StringPair>::iterator localIter;
+
+ //
+ /// Stage
+ //
+ movie_definition* def0 = get_movie_definition();
+ assert(def0);
+
+ it = tr.insert(it, StringPair("Stage Properties", ""));
+
+ std::ostringstream os;
+ os << "SWF " << def0->get_version();
+ localIter = tr.append_child(it, StringPair("SWF version", os.str()));
+ localIter = tr.append_child(it, StringPair("URL", def0->get_url()));
+
+
+ /// Stage: real dimensions.
+ os.str("");
+ os << def0->get_width_pixels() <<
+ "x" << def0->get_height_pixels();
+ localIter = tr.append_child(it, StringPair("Real dimensions", os.str()));
+
+ /// Stage: rendered dimensions.
+ os.str("");
+ os << m_viewport_width << "x" << m_viewport_height;
+ localIter = tr.append_child(it, StringPair("Rendered dimensions",
os.str()));
+
+ /// Stage: pixel scale
+ os.str("");
+ os << m_pixel_scale;
+ localIter = tr.append_child(it, StringPair("Pixel scale", os.str()));
+
+ /// Stage: timer
+ os.str("");
+ os << m_timer;
+ localIter = tr.append_child(it, StringPair("Timer value", os.str()));
+
+ /// Stage: scaling allowed.
+ localIter = tr.append_child(it, StringPair("Scaling allowed",
+ _allowRescale ? yes : no));
+
+ // Stage: scripts state (enabled/disabled)
+ localIter = tr.append_child(it, StringPair("Scripts",
+ _disableScripts ? " disabled" : "enabled"));
+
+ /// Stage: number of live characters
+ os.str("");
+ os << _liveChars.size();
+ localIter = tr.append_child(it, StringPair(_("Live characters"),
os.str()));
+
+ /// Live characters tree
+ 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()));
+
+ os.str("");
+ os << (*i)->get_ratio();
+ tr.append_child(charIter, StringPair(_("Ratio"), os.str()));
+
+ os.str("");
+ os << (*i)->get_clip_depth();
+ 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));
+ }
+
+}
+#endif
+
} // namespace gnash
Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -b -r1.111 -r1.112
--- server/movie_root.h 10 Mar 2008 08:19:39 -0000 1.111
+++ server/movie_root.h 14 Mar 2008 13:38:08 -0000 1.112
@@ -79,6 +79,10 @@
#include "smart_ptr.h" // for memory management
#include "URL.h" // for loadMovie
+#ifdef USE_MENUS
+# include "tree.hh"
+#endif
+
#include <vector>
#include <list>
#include <set>
@@ -665,6 +669,11 @@
interfaceHandle = handler;
}
+#ifdef USE_MENUS
+ typedef std::pair<std::string, std::string> StringPair;
+ void getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator& it);
+#endif
+
private:
/// A load movie request
Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -b -r1.141 -r1.142
--- gui/gui.cpp 13 Mar 2008 14:05:44 -0000 1.141
+++ gui/gui.cpp 14 Mar 2008 13:38:08 -0000 1.142
@@ -880,6 +880,8 @@
{
std::auto_ptr<InfoTree> tr;
+#ifdef USE_MENUS // This could be further expanded to avoid tree entirely.
+
if ( ! VM::isInitialized() )
{
return tr;
@@ -892,8 +894,8 @@
// 2. "Stage" information
// 3. ...
- InfoTree::iterator_base topIter = tr->begin();
- InfoTree::iterator_base firstLevelIter;
+ InfoTree::iterator topIter = tr->begin();
+ InfoTree::iterator firstLevelIter;
VM& vm = VM::get();
@@ -905,41 +907,9 @@
os << "SWF " << vm.getSWFVersion();
topIter = tr->insert(topIter, StringPair("VM version", os.str()));
- //
- /// Stage
- //
+
movie_root& stage = vm.getRoot();
- boost::intrusive_ptr<movie_instance> level0 = stage.getRootMovie();
- movie_definition* def0 = level0->get_movie_definition();
- assert(def0);
-
- topIter = tr->insert(topIter, StringPair("Stage Properties", ""));
-
- os.str("");
- os << "SWF " << def0->get_version();
- firstLevelIter = tr->append_child(topIter, StringPair("SWF version",
os.str()));
- firstLevelIter = tr->append_child(topIter, StringPair("URL",
def0->get_url()));
-
-
- /// Stage: real dimensions.
- os.str("");
- os << def0->get_width_pixels() <<
- "x" << def0->get_height_pixels();
- firstLevelIter = tr->append_child(topIter, StringPair("Real dimensions",
os.str()));
-
- /// Stage: real dimensions.
- os.str("");
- os << stage.getWidth() <<
- "x" << stage.getHeight();
- firstLevelIter = tr->append_child(topIter, StringPair("Rendered
dimensions", os.str()));
-
- /// Stage: scaling allowed.
- firstLevelIter = tr->append_child(topIter, StringPair("Scaling allowed",
- stage.isRescalingAllowed() ? "yes" : "no"));
-
- // Stage: scripts state (enabled/disabled)
- firstLevelIter = tr->append_child(topIter, StringPair("Scripts",
- stage.scriptsDisabled() ? " disabled" : "enabled"));
+ stage.getMovieInfo(*tr, topIter);
//
/// Mouse entities
@@ -994,6 +964,8 @@
tr->sort(firstLevelIter.begin(), firstLevelIter.end());
+#endif
+
return tr;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/movie_root.cpp server/mo...,
Benjamin Wolsey <=