From 86a4f7f8b74d0fcdf6c7ce47202c3ce4bc261400 Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 25 Nov 2008 01:21:58 +0000 Subject: [PATCH] Define CanvasParser::show_canvas_map() when _DEBUG is defined. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2267 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/loadcanvas.cpp | 18 ++++++++++++++++++ synfig-core/trunk/src/synfig/loadcanvas.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/synfig-core/trunk/src/synfig/loadcanvas.cpp b/synfig-core/trunk/src/synfig/loadcanvas.cpp index 28dff3e..40260b7 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.cpp +++ b/synfig-core/trunk/src/synfig/loadcanvas.cpp @@ -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 > canvas_map(synfig::get_open_canvas_map()); + std::map >::iterator iter; + for (iter = canvas_map.begin(); iter != canvas_map.end(); iter++) + { + synfig::String first(iter->first); + etl::loose_handle 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) { diff --git a/synfig-core/trunk/src/synfig/loadcanvas.h b/synfig-core/trunk/src/synfig/loadcanvas.h index bf5f053..dc665c2 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.h +++ b/synfig-core/trunk/src/synfig/loadcanvas.h @@ -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); -- 2.7.4