Define CanvasParser::show_canvas_map() when _DEBUG is defined.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 25 Nov 2008 01:21:58 +0000 (01:21 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 25 Nov 2008 01:21:58 +0000 (01:21 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2267 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/loadcanvas.cpp
synfig-core/trunk/src/synfig/loadcanvas.h

index 28dff3e..40260b7 100644 (file)
@@ -2128,6 +2128,24 @@ CanvasParser::register_canvas_in_map(Canvas::Handle canvas, String as)
        canvas->signal_file_name_changed().connect(sigc::bind(sigc::ptr_fun(_canvas_file_name_changed),canvas.get()));
 }
 
+#ifdef _DEBUG
+void
+CanvasParser::show_canvas_map(String file, int line, String text)
+{
+       return;
+       printf("  .-----\n  |  %s:%d %s\n", file.c_str(), line, text.c_str());
+       std::map<synfig::String, etl::loose_handle<Canvas> > canvas_map(synfig::get_open_canvas_map());
+       std::map<synfig::String, etl::loose_handle<Canvas> >::iterator iter;
+       for (iter = canvas_map.begin(); iter != canvas_map.end(); iter++)
+       {
+               synfig::String first(iter->first);
+               etl::loose_handle<Canvas> second(iter->second);
+               printf("  |    %40s : %lx (%d)\n", first.c_str(), ulong(&*second), second->count());
+       }
+       printf("  `-----\n\n");
+}
+#endif // _DEBUG
+
 Canvas::Handle
 CanvasParser::parse_from_file_as(const String &file_,const String &as_,String &errors)
 {
index bf5f053..dc665c2 100644 (file)
@@ -121,6 +121,10 @@ public:
 
        static void register_canvas_in_map(Canvas::Handle canvas, String as);
 
+#ifdef _DEBUG
+       static void show_canvas_map(String file, int line, String text);
+#endif // _DEBUG
+
        //! \todo writeme
        Canvas::Handle parse_from_file_as(const String &filename,const String &as,String &errors);