[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, master, updated. 0eaf1672515f7027166f
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] [SCM] Gnash branch, master, updated. 0eaf1672515f7027166faae4bc60565ec9190515 |
Date: |
Tue, 19 Oct 2010 12:11:48 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".
The branch, master has been updated
via 0eaf1672515f7027166faae4bc60565ec9190515 (commit)
via 5a74b09f2f7fc146acc023ee808ead69634d3467 (commit)
via 89dd731591995e946c847986b4118cc2fdeab7b7 (commit)
via 25004f742b2f0295f4f8486976ec88fa5224bbe4 (commit)
via 438b9192de9addb3d9d31c2ddc12019c008d0baa (commit)
via abb3bc4a007995b73873f076b1e479b334089b0a (commit)
from 9dbb1413bb3b8a43675f9a7906e61d95552082c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=0eaf1672515f7027166faae4bc60565ec9190515
commit 0eaf1672515f7027166faae4bc60565ec9190515
Author: Benjamin Wolsey <address@hidden>
Date: Tue Oct 19 13:34:35 2010 +0200
Minor cleanups.
diff --git a/gui/gtk/gtk.cpp b/gui/gtk/gtk.cpp
index 9b589dc..fde9fa7 100644
--- a/gui/gtk/gtk.cpp
+++ b/gui/gtk/gtk.cpp
@@ -792,8 +792,7 @@ GtkGui::makeTreeModel(std::auto_ptr<movie_root::InfoTree>
treepointer)
};
GtkTreeStore *model = gtk_tree_store_new (NUM_COLUMNS,
- G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_STRING, G_TYPE_STRING);
GtkTreeIter iter;
GtkTreeIter child_iter;
@@ -803,8 +802,9 @@ GtkGui::makeTreeModel(std::auto_ptr<movie_root::InfoTree>
treepointer)
int depth = 0;
assert(info.depth(info.begin()) == 0); // seems assumed in the code below
- for (movie_root::InfoTree::iterator i = info.begin(), e = info.end();
i!=e; ++i)
- {
+ for (movie_root::InfoTree::iterator i = info.begin(), e = info.end();
+ i != e; ++i) {
+
const movie_root::InfoTree::value_type& p = *i;
std::ostringstream os;
@@ -819,22 +819,23 @@ GtkGui::makeTreeModel(std::auto_ptr<movie_root::InfoTree>
treepointer)
}
if (newdepth < depth) {
- int gap = depth-newdepth;
+ int gap = depth - newdepth;
depth = newdepth;
while (gap--) {
- gtk_tree_model_iter_parent (GTK_TREE_MODEL(model),
&parent_iter, &iter);
+ gtk_tree_model_iter_parent(GTK_TREE_MODEL(model),
+ &parent_iter, &iter);
iter = parent_iter;
}
}
//Read in data from present node
- if (depth == 0) gtk_tree_store_append (model, &child_iter, NULL);
- else gtk_tree_store_append (model, &child_iter, &iter);
+ if (depth == 0) gtk_tree_store_append(model, &child_iter, NULL);
+ else gtk_tree_store_append(model, &child_iter, &iter);
- gtk_tree_store_set (model, &child_iter,
- STRING1_COLUMN, p.first.c_str(), // "Variable"
- STRING2_COLUMN, p.second.c_str(), // "Value"
- -1);
+ gtk_tree_store_set(model, &child_iter,
+ STRING1_COLUMN, p.first.c_str(), // "Variable"
+ STRING2_COLUMN, p.second.c_str(), // "Value"
+ -1);
}
@@ -1714,8 +1715,8 @@ GtkGui::showPropertiesDialog()
gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(treeview), TRUE);
gint coloffset;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
+ GtkCellRenderer* renderer;
+ GtkTreeViewColumn* column;
// Add columns:
http://git.savannah.gnu.org/cgit//commit/?id=5a74b09f2f7fc146acc023ee808ead69634d3467
commit 5a74b09f2f7fc146acc023ee808ead69634d3467
Author: Benjamin Wolsey <address@hidden>
Date: Tue Oct 19 13:19:20 2010 +0200
Split long lines.
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 8492846..564b7c8 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -1144,7 +1144,8 @@ Gui::getMovieInfo() const
<< " - depth:" << ch->get_depth()
<< " - useHandCursor:" << ch->allowHandCursor()
<< ")";
- firstLevelIter = tr->append_child(topIter, std::make_pair("Active
entity under mouse pointer", ss.str()));
+ firstLevelIter = tr->append_child(topIter,
+ std::make_pair("Active entity under mouse pointer", ss.str()));
}
ch = stage.getEntityUnderPointer();
@@ -1153,7 +1154,8 @@ Gui::getMovieInfo() const
ss << ch->getTarget() << " (" + typeName(*ch)
<< " - depth:" << ch->get_depth()
<< ")";
- firstLevelIter = tr->append_child(topIter, std::make_pair("Topmost
entity under mouse pointer", ss.str()));
+ firstLevelIter = tr->append_child(topIter,
+ std::make_pair("Topmost entity under mouse pointer", ss.str()));
}
ch = stage.getDraggingCharacter();
@@ -1161,7 +1163,8 @@ Gui::getMovieInfo() const
std::stringstream ss;
ss << ch->getTarget() << " (" + typeName(*ch)
<< " - depth:" << ch->get_depth() << ")";
- firstLevelIter = tr->append_child(topIter, std::make_pair("Dragging
character: ", ss.str()));
+ firstLevelIter = tr->append_child(topIter,
+ std::make_pair("Dragging character: ", ss.str()));
}
//
http://git.savannah.gnu.org/cgit//commit/?id=89dd731591995e946c847986b4118cc2fdeab7b7
commit 89dd731591995e946c847986b4118cc2fdeab7b7
Author: Benjamin Wolsey <address@hidden>
Date: Tue Oct 19 13:17:38 2010 +0200
Clean up headers.
diff --git a/gui/gtk/gtk.cpp b/gui/gtk/gtk.cpp
index fa9408e..9b589dc 100644
--- a/gui/gtk/gtk.cpp
+++ b/gui/gtk/gtk.cpp
@@ -22,58 +22,39 @@
#include "gnashconfig.h"
#endif
-#include "log.h"
-
-#include "gui.h"
-#include "rc.h"
#include "gtksup.h"
-#include "sound_handler.h"
-#include "Renderer.h"
-#include "RunResources.h"
-#include "VM.h"
-#include "gnash.h" // Quality
#include <iostream>
-
+#include <string>
+#include <utility>
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkkeysyms.h>
#ifdef HAVE_VA_VA_H
-#include <va/va.h>
-#include "vaapi_utils.h"
+# include <va/va.h>
+# include "vaapi_utils.h"
#endif
#ifdef HAVE_VA_VA_X11_H
-#include <va/va_x11.h>
+# include <va/va_x11.h>
#endif
-
#ifdef HAVE_X11
-#include <X11/keysym.h>
-#include <gdk/gdkx.h>
-#include <X11/Xlib.h>
-#include <X11/extensions/Xv.h>
-#include <X11/extensions/Xvlib.h>
+# include <X11/keysym.h>
+# include <gdk/gdkx.h>
+# include <X11/Xlib.h>
+# include <X11/extensions/Xv.h>
+# include <X11/extensions/Xvlib.h>
#endif
-#include <gtk/gtk.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkkeysyms.h>
-#include <string>
-
+#include "log.h"
+#include "gui.h"
+#include "rc.h"
+#include "sound_handler.h"
+#include "Renderer.h"
+#include "RunResources.h"
+#include "VM.h"
+#include "gnash.h" // Quality
#include "gtk_canvas.h"
-#ifdef HAVE_FFMPEG_AVCODEC_H
-extern "C" {
-# include "ffmpeg/avcodec.h" // Only for the version number
-}
-#endif
-
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
-extern "C" {
-# include "libavcodec/avcodec.h" // Only for the version number
-}
-#endif
-
-#ifdef HAVE_GST_GST_H
-# include "gst/gstversion.h" // Only for the version number
-#endif
-
#ifdef HAVE_VA_VA_H
extern VAStatus va_getDriverName(VADisplay dpy, char **driver_name);
#endif
diff --git a/gui/gtk/gtksup.h b/gui/gtk/gtksup.h
index ff47f1d..5f30229 100644
--- a/gui/gtk/gtksup.h
+++ b/gui/gtk/gtksup.h
@@ -27,6 +27,7 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
+#include "gui.h"
#include "gtk_glue.h"
namespace gnash {
@@ -145,7 +146,7 @@ private:
#ifdef USE_SWFTREE
// Create a tree model for displaying movie info
- GtkTreeModel* makeTreeModel (std::auto_ptr<movie_root::InfoTree>
treepointer);
+ GtkTreeModel* makeTreeModel(std::auto_ptr<movie_root::InfoTree> tree);
#endif
void stopHook();
diff --git a/libbase/GC.cpp b/libbase/GC.cpp
index c394411..9e32a9e 100644
--- a/libbase/GC.cpp
+++ b/libbase/GC.cpp
@@ -132,7 +132,7 @@ GC::countCollectables(CollectablesCount& count) const
{
for (ResList::const_iterator i = _resList.begin(), e = _resList.end();
i!=e; ++i) {
- count[typeName(**i)]++;
+ ++count[typeName(**i)];
}
}
diff --git a/libcore/Button.cpp b/libcore/Button.cpp
index 8456e7f..abbfaaa 100644
--- a/libcore/Button.cpp
+++ b/libcore/Button.cpp
@@ -25,6 +25,7 @@
#include "Button.h"
#include <boost/bind.hpp>
+#include <utility>
#include "smart_ptr.h" // GNASH_USE_GC
#include "DefineButtonTag.h"
diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index 468a86b..c519e0a 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -27,6 +27,7 @@
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/bind.hpp>
+#include <utility>
#include "smart_ptr.h" // GNASH_USE_GC
#include "movie_root.h"
diff --git a/libcore/DisplayObjectContainer.cpp
b/libcore/DisplayObjectContainer.cpp
index be44a0a..9dbcd88 100644
--- a/libcore/DisplayObjectContainer.cpp
+++ b/libcore/DisplayObjectContainer.cpp
@@ -22,8 +22,11 @@
# include "gnashconfig.h" // GNASH_USE_GC, USE_SWFTREE
#endif
-#include "DisplayList.h" // DisplayList
#include "DisplayObjectContainer.h"
+
+#include <utility>
+
+#include "DisplayList.h" // DisplayList
#include "InteractiveObject.h"
#include "log.h"
#include "dsodefs.h" // for DSOEXPORT
http://git.savannah.gnu.org/cgit//commit/?id=25004f742b2f0295f4f8486976ec88fa5224bbe4
commit 25004f742b2f0295f4f8486976ec88fa5224bbe4
Merge: 9dbb141 438b919
Author: Benjamin Wolsey <address@hidden>
Date: Tue Oct 19 13:04:39 2010 +0200
Merge branch 'working'
http://git.savannah.gnu.org/cgit//commit/?id=438b9192de9addb3d9d31c2ddc12019c008d0baa
commit 438b9192de9addb3d9d31c2ddc12019c008d0baa
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 15 13:04:44 2010 +0200
Improve InfoTree code.
diff --git a/gui/gtk/gtk.cpp b/gui/gtk/gtk.cpp
index d067480..fa9408e 100644
--- a/gui/gtk/gtk.cpp
+++ b/gui/gtk/gtk.cpp
@@ -798,10 +798,10 @@ GtkGui::createWindow(const char *title, int width, int
height,
// This creates a GtkTree model for displaying movie info.
GtkTreeModel*
-GtkGui::makeTreeModel (std::auto_ptr<InfoTree> treepointer)
+GtkGui::makeTreeModel(std::auto_ptr<movie_root::InfoTree> treepointer)
{
- InfoTree& info = *treepointer;
+ const movie_root::InfoTree& info = *treepointer;
enum
{
@@ -822,9 +822,9 @@ GtkGui::makeTreeModel (std::auto_ptr<InfoTree> treepointer)
int depth = 0;
assert(info.depth(info.begin()) == 0); // seems assumed in the code below
- for (InfoTree::iterator i=info.begin(), e=info.end(); i!=e; ++i)
+ for (movie_root::InfoTree::iterator i = info.begin(), e = info.end();
i!=e; ++i)
{
- StringPair& p = *i;
+ const movie_root::InfoTree::value_type& p = *i;
std::ostringstream os;
os << info.depth(i);
@@ -840,11 +840,10 @@ GtkGui::makeTreeModel (std::auto_ptr<InfoTree>
treepointer)
if (newdepth < depth) {
int gap = depth-newdepth;
depth = newdepth;
- while(gap--)
- {
+ while (gap--) {
gtk_tree_model_iter_parent (GTK_TREE_MODEL(model),
&parent_iter, &iter);
iter = parent_iter;
- }
+ }
}
//Read in data from present node
@@ -1700,7 +1699,7 @@ GtkGui::showPropertiesDialog()
#ifdef USE_SWFTREE
- std::auto_ptr<InfoTree> infoptr = getMovieInfo();
+ std::auto_ptr<movie_root::InfoTree> infoptr = getMovieInfo();
GtkWidget *scrollwindow1 = gtk_scrolled_window_new(0, 0);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwindow1),
@@ -1809,7 +1808,8 @@ GtkGui::showAboutDialog()
NULL
};
- std::string comments = _("Gnash is the GNU SWF Player based on GameSWF.");
+ std::string comments =
+ _("Gnash is the GNU SWF Player based on GameSWF.");
media::MediaHandler* m = _runResources.mediaHandler();
diff --git a/gui/gtk/gtksup.h b/gui/gtk/gtksup.h
index bb230e5..ff47f1d 100644
--- a/gui/gtk/gtksup.h
+++ b/gui/gtk/gtksup.h
@@ -145,7 +145,7 @@ private:
#ifdef USE_SWFTREE
// Create a tree model for displaying movie info
- GtkTreeModel* makeTreeModel (std::auto_ptr<InfoTree> treepointer);
+ GtkTreeModel* makeTreeModel (std::auto_ptr<movie_root::InfoTree>
treepointer);
#endif
void stopHook();
diff --git a/gui/gui.cpp b/gui/gui.cpp
index bdfd0cf..8492846 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -1089,24 +1089,24 @@ Gui::setInvalidatedRegions(const InvalidatedRanges&
ranges)
#ifdef USE_SWFTREE
-std::auto_ptr<Gui::InfoTree>
+std::auto_ptr<movie_root::InfoTree>
Gui::getMovieInfo() const
{
- std::auto_ptr<InfoTree> tr;
+ std::auto_ptr<movie_root::InfoTree> tr;
if (!_stage) {
return tr;
}
- tr.reset(new InfoTree());
+ tr.reset(new movie_root::InfoTree());
// Top nodes for the tree:
// 1. VM information
// 2. "Stage" information
// 3. ...
- InfoTree::iterator topIter = tr->begin();
- InfoTree::iterator firstLevelIter;
+ movie_root::InfoTree::iterator topIter = tr->begin();
+ movie_root::InfoTree::iterator firstLevelIter;
VM& vm = _stage->getVM();
@@ -1116,14 +1116,14 @@ Gui::getMovieInfo() const
/// VM top level
//
os << "SWF " << vm.getSWFVersion();
- topIter = tr->insert(topIter, StringPair("VM version", os.str()));
+ topIter = tr->insert(topIter, std::make_pair("VM version", os.str()));
// This short-cut is to avoid a bug in movie_root's getMovieInfo,
// which relies on the availability of a _rootMovie for doing
// it's work, while we don't set it if we didn't start..
//
if (! _started) {
- topIter = tr->insert(topIter, StringPair("Stage properties",
+ topIter = tr->insert(topIter, std::make_pair("Stage properties",
"not constructed yet"));
return tr;
}
@@ -1134,7 +1134,7 @@ Gui::getMovieInfo() const
//
/// Mouse entities
//
- topIter = tr->insert(topIter, StringPair("Mouse Entities", ""));
+ topIter = tr->insert(topIter, std::make_pair("Mouse Entities", ""));
const DisplayObject* ch;
ch = stage.getActiveEntityUnderPointer();
@@ -1144,7 +1144,7 @@ Gui::getMovieInfo() const
<< " - depth:" << ch->get_depth()
<< " - useHandCursor:" << ch->allowHandCursor()
<< ")";
- firstLevelIter = tr->append_child(topIter, StringPair("Active entity
under mouse pointer", ss.str()));
+ firstLevelIter = tr->append_child(topIter, std::make_pair("Active
entity under mouse pointer", ss.str()));
}
ch = stage.getEntityUnderPointer();
@@ -1153,7 +1153,7 @@ Gui::getMovieInfo() const
ss << ch->getTarget() << " (" + typeName(*ch)
<< " - depth:" << ch->get_depth()
<< ")";
- firstLevelIter = tr->append_child(topIter, StringPair("Topmost entity
under mouse pointer", ss.str()));
+ firstLevelIter = tr->append_child(topIter, std::make_pair("Topmost
entity under mouse pointer", ss.str()));
}
ch = stage.getDraggingCharacter();
@@ -1161,13 +1161,13 @@ Gui::getMovieInfo() const
std::stringstream ss;
ss << ch->getTarget() << " (" + typeName(*ch)
<< " - depth:" << ch->get_depth() << ")";
- firstLevelIter = tr->append_child(topIter, StringPair("Dragging
character: ", ss.str()));
+ firstLevelIter = tr->append_child(topIter, std::make_pair("Dragging
character: ", ss.str()));
}
//
/// GC row
//
- topIter = tr->insert(topIter, StringPair("GC Statistics", ""));
+ topIter = tr->insert(topIter, std::make_pair("GC Statistics", ""));
GC::CollectablesCount cc;
_stage->gc().countCollectables(cc);
@@ -1177,7 +1177,7 @@ Gui::getMovieInfo() const
std::ostringstream ss;
ss << i->second;
firstLevelIter = tr->append_child(topIter,
- StringPair(lbl + typ, ss.str()));
+ std::make_pair(lbl + typ, ss.str()));
}
tr->sort(firstLevelIter.begin(), firstLevelIter.end());
diff --git a/gui/gui.h b/gui/gui.h
index 690715b..0bb84ef 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -446,15 +446,8 @@ public:
#ifdef USE_SWFTREE
- // TODO: use a tree-like structure (tree.hh?)
- typedef std::pair<std::string, std::string> StringPair;
- typedef tree<StringPair> InfoTree;
-
- /// \brief
- /// Return a tree containing informations about the movie
- /// currently being played (or NULL, if the VM isn't initialized yet)
- ///
- std::auto_ptr<InfoTree> getMovieInfo() const;
+ /// Return a tree containing information about the movie playing.
+ std::auto_ptr<movie_root::InfoTree> getMovieInfo() const;
#endif
typedef std::map<std::string, std::string> VariableMap;
diff --git a/gui/kde/Kde4Gui.cpp b/gui/kde/Kde4Gui.cpp
index 4078a8a..71bcc82 100644
--- a/gui/kde/Kde4Gui.cpp
+++ b/gui/kde/Kde4Gui.cpp
@@ -466,8 +466,8 @@ Kde4Gui::showProperties()
SIGNAL(clicked()), SLOT(close()));
#ifdef USE_SWFTREE
- std::auto_ptr<InfoTree> infoptr = getMovieInfo();
- InfoTree& info = *infoptr;
+ std::auto_ptr<movie_root::InfoTree> infoptr = getMovieInfo();
+ const movie_root::InfoTree& info = *infoptr;
QTreeWidget *tree = new QTreeWidget();
tree->setColumnCount(2);
@@ -480,8 +480,10 @@ Kde4Gui::showProperties()
int prevDepth = 0;
QStack<QTreeWidgetItem*> stack;
- for (InfoTree::iterator i=info.begin(), e=info.end(); i!=e; ++i) {
- StringPair& p = *i;
+ for (movie_root::InfoTree::iterator i = info.begin(), e = info.end();
+ i != e; ++i) {
+
+ const movie_root::InfoTree::value_type& p = *i;
QStringList cols;
cols.append(p.first.c_str());
diff --git a/libcore/Button.cpp b/libcore/Button.cpp
index 36b6ff3..8456e7f 100644
--- a/libcore/Button.cpp
+++ b/libcore/Button.cpp
@@ -961,11 +961,11 @@ Button::getMovieInfo(InfoTree& tr, InfoTree::iterator it)
os << actChars.size() << " active DisplayObjects for state " <<
mouseStateName(_mouseState);
InfoTree::iterator localIter = tr.append_child(selfIt,
- StringPair(_("Button state"), os.str()));
+ std::make_pair(_("Button state"), os.str()));
os.str("");
os << std::boolalpha << isEnabled();
- localIter = tr.append_child(selfIt, StringPair(_("Enabled"), os.str()));
+ localIter = tr.append_child(selfIt, std::make_pair(_("Enabled"),
os.str()));
std::for_each(actChars.begin(), actChars.end(),
boost::bind(&DisplayObject::getMovieInfo, _1, tr, localIter));
diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index f03c7da..a236d63 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -826,46 +826,48 @@ DisplayObject::getMovieInfo(InfoTree& tr,
InfoTree::iterator it)
const std::string yes = _("yes");
const std::string no = _("no");
- it = tr.append_child(it, StringPair(getTarget(), typeName(*this)));
+ it = tr.append_child(it, std::make_pair(getTarget(), typeName(*this)));
std::ostringstream os;
os << get_depth();
- tr.append_child(it, StringPair(_("Depth"), os.str()));
+ tr.append_child(it, std::make_pair(_("Depth"), os.str()));
/// Don't add if the DisplayObject has no ratio value
if (get_ratio() >= 0)
{
os.str("");
os << get_ratio();
- tr.append_child(it, StringPair(_("Ratio"), os.str()));
+ tr.append_child(it, std::make_pair(_("Ratio"), os.str()));
}
/// Don't add if it's not a real clipping depth
- if (int cd = get_clip_depth() != noClipDepthValue)
- {
+ const int cd = get_clip_depth();
+ if (cd != noClipDepthValue) {
os.str("");
if (_maskee) os << "Dynamic mask";
else os << cd;
- tr.append_child(it, StringPair(_("Clipping depth"), os.str()));
+ tr.append_child(it, std::make_pair(_("Clipping depth"),
os.str()));
}
os.str("");
os << getBounds().width() << "x" << getBounds().height();
- tr.append_child(it, StringPair(_("Dimensions"), os.str()));
+ tr.append_child(it, std::make_pair(_("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"), unloaded() ? yes : no));
+ tr.append_child(it, std::make_pair(_("Dynamic"), isDynamic() ? yes :
no));
+ tr.append_child(it, std::make_pair(_("Mask"), isMaskLayer() ? yes :
no));
+ tr.append_child(it, std::make_pair(_("Destroyed"),
+ isDestroyed() ? yes : no));
+ tr.append_child(it, std::make_pair(_("Unloaded"), unloaded() ? yes :
no));
os.str("");
os << _blendMode;
- tr.append_child(it, StringPair(_("Blend mode"), os.str()));
+ tr.append_child(it, std::make_pair(_("Blend mode"), os.str()));
#ifndef NDEBUG
// This probably isn't interesting for non-developers
- tr.append_child(it, StringPair(_("Invalidated"), _invalidated ? yes : no));
- tr.append_child(it, StringPair(_("Child invalidated"),
+ tr.append_child(it, std::make_pair(_("Invalidated"),
+ _invalidated ? yes : no));
+ tr.append_child(it, std::make_pair(_("Child invalidated"),
_child_invalidated ? yes : no));
#endif
return it;
diff --git a/libcore/DisplayObject.h b/libcore/DisplayObject.h
index 254d850..aa5b9e1 100644
--- a/libcore/DisplayObject.h
+++ b/libcore/DisplayObject.h
@@ -865,8 +865,7 @@ public:
bool DSOEXPORT allowHandCursor() const;
#ifdef USE_SWFTREE
- typedef std::pair<std::string, std::string> StringPair;
- typedef tree<StringPair> InfoTree;
+ typedef tree<std::pair<std::string, std::string> > InfoTree;
/// Append DisplayObject info in the tree
//
/// @param tr
@@ -876,8 +875,6 @@ public:
/// The iterator to append info to.
///
/// @return iterator the appended subtree
- ///
- // TODO: use a typedef for tree<StringPair> ?
virtual InfoTree::iterator getMovieInfo(InfoTree& tr,
InfoTree::iterator it);
#endif
diff --git a/libcore/DisplayObjectContainer.cpp
b/libcore/DisplayObjectContainer.cpp
index 6b58bbe..be44a0a 100644
--- a/libcore/DisplayObjectContainer.cpp
+++ b/libcore/DisplayObjectContainer.cpp
@@ -114,9 +114,7 @@ DisplayObjectContainer::getMovieInfo(InfoTree& tr,
InfoTree::iterator it)
std::ostringstream os;
os << _displayList.size();
InfoTree::iterator localIter = tr.append_child(selfIt,
- StringPair(_("Children"), os.str()));
- //localIter = tr.append_child(localIter, StringPair("child1", "fake"));
- //localIter = tr.append_child(localIter, StringPair("child2", "fake"));
+ std::make_pair(_("Children"), os.str()));
MovieInfoVisitor v(tr, localIter);
_displayList.visitAll(v);
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index d64c525..2c0d9e5 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -153,7 +153,6 @@ movie_root::movie_root(const movie_definition& def,
_quality(QUALITY_HIGH),
_alignMode(0),
_allowScriptAccess(SCRIPT_ACCESS_SAME_DOMAIN),
- _marshallExceptions(false),
_showMenu(true),
_scaleMode(SCALEMODE_SHOWALL),
_displayState(DISPLAYSTATE_NORMAL),
@@ -978,8 +977,7 @@ movie_root::display()
frame_size.get_x_min(), frame_size.get_x_max(),
frame_size.get_y_min(), frame_size.get_y_max());
- for (Levels::iterator i=_movies.begin(), e=_movies.end(); i!=e; ++i)
- {
+ for (Levels::iterator i=_movies.begin(), e=_movies.end(); i!=e; ++i) {
MovieClip* movie = i->second;
movie->clear_invalidated();
@@ -2215,74 +2213,65 @@ movie_root::setScriptLimits(boost::uint16_t recursion,
boost::uint16_t timeout)
#ifdef USE_SWFTREE
void
-movie_root::getMovieInfo(tree<StringPair>& tr, tree<StringPair>::iterator it)
+movie_root::getMovieInfo(InfoTree& tr, InfoTree::iterator it)
{
- tree<StringPair>::iterator localIter;
-
- //
- /// Stage
- //
+ // Stage
const movie_definition* def = _rootMovie->definition();
assert(def);
- it = tr.insert(it, StringPair("Stage Properties", ""));
+ it = tr.insert(it, std::make_pair("Stage Properties", ""));
- localIter = tr.append_child(it, StringPair("Root VM version",
+ InfoTree::iterator localIter = tr.append_child(it,
+ std::make_pair("Root VM version",
def->isAS3() ? "AVM2 (unsupported)" : "AVM1"));
std::ostringstream os;
os << "SWF " << def->get_version();
- localIter = tr.append_child(it, StringPair("Root SWF version", os.str()));
- localIter = tr.append_child(it, StringPair("URL", def->get_url()));
+ localIter = tr.append_child(it, std::make_pair("Root SWF version",
+ os.str()));
+ localIter = tr.append_child(it, std::make_pair("URL", def->get_url()));
// TODO: format this better?
- localIter = tr.append_child(it, StringPair("Descriptive metadata",
+ localIter = tr.append_child(it, std::make_pair("Descriptive metadata",
def->getDescriptiveMetadata()));
/// Stage: real dimensions.
os.str("");
os << def->get_width_pixels() <<
"x" << def->get_height_pixels();
- localIter = tr.append_child(it, StringPair("Real dimensions", os.str()));
+ localIter = tr.append_child(it, std::make_pair("Real dimensions",
+ os.str()));
/// Stage: rendered dimensions.
os.str("");
os << _stageWidth << "x" << _stageHeight;
- localIter = tr.append_child(it, StringPair("Rendered dimensions",
os.str()));
-
-#if 0
- /// Stage: scaling allowed.
- localIter = tr.append_child(it, StringPair("Scaling allowed",
- _allowRescale ? yes : no));
-
- // TODO: add _scaleMode, _valign and _haling info
-#endif
+ localIter = tr.append_child(it, std::make_pair("Rendered dimensions",
+ os.str()));
// Stage: scripts state (enabled/disabled)
- localIter = tr.append_child(it, StringPair("Scripts",
+ localIter = tr.append_child(it, std::make_pair("Scripts",
_disableScripts ? " disabled" : "enabled"));
getCharacterTree(tr, it);
}
void
-movie_root::getCharacterTree(tree<StringPair>& tr,
- tree<StringPair>::iterator it)
+movie_root::getCharacterTree(InfoTree& tr, InfoTree::iterator it)
{
- tree<StringPair>::iterator localIter;
+ InfoTree::iterator localIter;
- /// Stage: number of live DisplayObjects
+ /// Stage: number of live MovieClips.
std::ostringstream os;
os << _liveChars.size();
- localIter = tr.append_child(it, StringPair(_("Live DisplayObjects"),
+ localIter = tr.append_child(it, std::make_pair(_("Live MovieClips"),
os.str()));
- /// Live DisplayObjects tree
- for (LiveChars::const_iterator i = _liveChars.begin(), e =
_liveChars.end();
+ /// DisplayObject tree
+ for (Levels::const_iterator i = _movies.begin(), e = _movies.end();
i != e; ++i) {
- (*i)->getMovieInfo(tr, localIter);
+ i->second->getMovieInfo(tr, localIter);
}
}
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index d7d4041..d30ff34 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -564,11 +564,6 @@ public:
/// current gui
void setShowMenuState(bool state);
- // This is a flag that specifies whether exceptions in ActionScript
- // should be propogated to JavaScript in the browser.
- void setMarshallExceptions(bool x) { _marshallExceptions = x; };
- bool getMarshallExceptions() { return _marshallExceptions; };
-
/// Sets the Stage object's align mode.
void setStageScaleMode(ScaleMode sm);
@@ -856,9 +851,9 @@ public:
}
#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);
+ typedef tree<std::pair<std::string, std::string> > InfoTree;
+ void getMovieInfo(InfoTree& tr, InfoTree::iterator it);
+ void getCharacterTree(InfoTree& tr, InfoTree::iterator it);
#endif
const RunResources& runResources() const { return _runResources; }
@@ -1123,7 +1118,6 @@ private:
std::bitset<4u> _alignMode;
AllowScriptAccessMode _allowScriptAccess;
- bool _marshallExceptions;
/// Whether to show the menu or not.
bool _showMenu;
http://git.savannah.gnu.org/cgit//commit/?id=abb3bc4a007995b73873f076b1e479b334089b0a
commit abb3bc4a007995b73873f076b1e479b334089b0a
Author: Benjamin Wolsey <address@hidden>
Date: Fri Oct 15 12:58:00 2010 +0200
Cleanup includes, temporaries, and constness.
diff --git a/libbase/GC.cpp b/libbase/GC.cpp
index 7eeafdf..c394411 100644
--- a/libbase/GC.cpp
+++ b/libbase/GC.cpp
@@ -18,13 +18,16 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "GC.h"
+
+#include <cstdlib>
+
#include "utility.h" // for typeName()
+#include "GnashAlgorithm.h"
#ifdef GNASH_GC_DEBUG
-#include "log.h"
+# include "log.h"
#endif
-#include <cstdlib>
namespace gnash {
@@ -41,10 +44,9 @@ GC::GC(GcRoot& root)
#ifdef GNASH_GC_DEBUG
log_debug(_("GC %p created"), (void*)this);
#endif
- char *gcgap = std::getenv("GNASH_GC_TRIGGER_THRESHOLD");
- if (gcgap)
- {
- unsigned int gap = std::strtoul(gcgap, NULL, 0);
+ char* gcgap = std::getenv("GNASH_GC_TRIGGER_THRESHOLD");
+ if (gcgap) {
+ const size_t gap = std::strtoul(gcgap, NULL, 0);
_maxNewCollectablesCount = gap;
}
}
@@ -54,9 +56,8 @@ GC::~GC()
#ifdef GNASH_GC_DEBUG
log_debug(_("GC deleted, deleting all managed resources - collector run %d
times"), _collectorRuns);
#endif
-
- for (ResList::iterator i=_resList.begin(), e=_resList.end(); i!=e; ++i)
- {
+ for (ResList::const_iterator i = _resList.begin(), e = _resList.end();
+ i != e; ++i) {
delete *i;
}
}
@@ -64,17 +65,17 @@ GC::~GC()
size_t
GC::cleanUnreachable()
{
- size_t deleted = 0;
#if (GNASH_GC_DEBUG > 1)
log_debug(_("GC: sweep scan started"));
#endif
- for (ResList::iterator i=_resList.begin(), e=_resList.end(); i!=e; )
- {
+ size_t deleted = 0;
+
+ for (ResList::iterator i = _resList.begin(), e = _resList.end(); i != e;) {
const GcResource* res = *i;
- if ( ! res->isReachable() )
- {
+ if (!res->isReachable()) {
+
#if GNASH_GC_DEBUG > 1
log_debug(_("GC: recycling object %p (%s)"), res, typeName(*res));
#endif
@@ -82,8 +83,7 @@ GC::cleanUnreachable()
delete res;
i = _resList.erase(i); // _resListSize updated at end of loop
}
- else
- {
+ else {
res->clearReachable();
++i;
}
@@ -96,7 +96,6 @@ GC::cleanUnreachable()
deleted, _resListSize);
#endif
-
return deleted;
}
@@ -112,7 +111,10 @@ GC::runCycle()
#endif
#ifdef GNASH_GC_DEBUG
- log_debug(_("GC: collection cycle started - %d/%d new resources allocated
since last run (from %d to %d)"), _resListSize-_lastResCount,
_maxNewCollectablesCount, _lastResCount, _resListSize);
+ log_debug(_("GC: collection cycle started - %d/%d new resources "
+ "allocated since last run (from %d to %d)"),
+ _resListSize - _lastResCount, _maxNewCollectablesCount,
+ _lastResCount, _resListSize);
#endif // GNASH_GC_DEBUG
// Mark all resources as reachable
@@ -123,18 +125,14 @@ GC::runCycle()
_lastResCount = _resListSize;
- //assert(_lastResCount == _resList.size()); // O(n)...
-
}
void
GC::countCollectables(CollectablesCount& count) const
{
- for (ResList::const_iterator i=_resList.begin(), e=_resList.end(); i!=e;
++i)
- {
- const GcResource* res = *i;
- std::string type = typeName(*res);
- count[type]++;
+ for (ResList::const_iterator i = _resList.begin(), e = _resList.end();
+ i!=e; ++i) {
+ count[typeName(**i)]++;
}
}
diff --git a/libbase/GC.h b/libbase/GC.h
index 6f6d6bf..ece2438 100644
--- a/libbase/GC.h
+++ b/libbase/GC.h
@@ -20,12 +20,6 @@
#ifndef GNASH_GC_H
#define GNASH_GC_H
-#include <list>
-#include <map>
-#include <string>
-
-#include "dsodefs.h"
-
// Define the following macro to enable GC verbosity
// Verbosity levels:
// 1 - print stats about how many resources are registered and how many
@@ -35,15 +29,18 @@
//
//#define GNASH_GC_DEBUG 1
+#include <list>
+#include <map>
+#include <string>
+#include <cassert>
+
+#include "dsodefs.h"
#ifdef GNASH_GC_DEBUG
# include "log.h"
# include "utility.h"
-# include <typeinfo>
#endif
-#include <cassert>
-
-
+// Forward declarations.
namespace gnash {
class GC;
}
@@ -66,7 +63,7 @@ public:
///
/// Use setReachable() on the resources stored in this
/// container.
- virtual void markReachableResources() const=0;
+ virtual void markReachableResources() const = 0;
virtual ~GcRoot() {}
};
@@ -76,7 +73,6 @@ public:
/// Instances of this class can be managed by a GC object.
class GcResource
{
-
public:
friend class GC;
@@ -93,8 +89,7 @@ public:
//
/// If the object wasn't reachable before, this call triggers
/// scan of all contained objects too.
- void setReachable() const
- {
+ void setReachable() const {
if (_reachable) {
@@ -138,8 +133,7 @@ protected:
///
/// The default implementation doesn't mark anything.
///
- virtual void markReachableResources() const
- {
+ virtual void markReachableResources() const {
assert(_reachable);
#if GNASH_GC_DEBUG > 1
log_debug(_("Class %s didn't override the markReachableResources() "
@@ -152,9 +146,7 @@ protected:
/// This is protected to allow subclassing, but ideally it
/// sould be private, so only the GC is allowed to delete us.
///
- virtual ~GcResource()
- {
- }
+ virtual ~GcResource() {}
private:
@@ -199,8 +191,8 @@ public:
/// The item to be managed by this collector.
/// Can't be NULL. The caller gives up ownerhip
/// of it, which will only be deleted by this GC.
- void addCollectable(const GcResource* item)
- {
+ void addCollectable(const GcResource* item) {
+
#ifndef NDEBUG
assert(item);
assert(!item->isReachable());
@@ -215,8 +207,8 @@ public:
}
/// Run the collector, if worth it
- void fuzzyCollect()
- {
+ void fuzzyCollect() {
+
// Heuristic to decide wheter or not to run the collection cycle
//
//
@@ -273,11 +265,10 @@ public:
private:
/// List of collectables
- typedef std::list<const GcResource *> ResList;
+ typedef std::list<const GcResource*> ResList;
/// Mark all reachable resources
- void markReachable()
- {
+ void markReachable() {
#if GNASH_GC_DEBUG > 2
log_debug(_("GC %p: MARK SCAN"), (void*)this);
#endif
-----------------------------------------------------------------------
Summary of changes:
gui/gtk/gtk.cpp | 106 +++++++++++++++---------------------
gui/gtk/gtksup.h | 3 +-
gui/gui.cpp | 29 ++++++-----
gui/gui.h | 11 +---
gui/kde/Kde4Gui.cpp | 10 ++--
libbase/GC.cpp | 48 ++++++++---------
libbase/GC.h | 43 ++++++---------
libcore/Button.cpp | 5 +-
libcore/DisplayObject.cpp | 31 ++++++-----
libcore/DisplayObject.h | 5 +--
libcore/DisplayObjectContainer.cpp | 9 ++--
libcore/movie_root.cpp | 54 ++++++++-----------
libcore/movie_root.h | 6 +-
13 files changed, 161 insertions(+), 199 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, master, updated. 0eaf1672515f7027166faae4bc60565ec9190515,
Benjamin Wolsey <=