X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Floadcanvas.h;h=888e1d70077a0e8fd3cb634f488ca20d9375e97e;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=465b879ef89fda6d5813cff2558111c803ec270e;hpb=37600b4b217caa5e316984ec0b035c5e8f9698af;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/loadcanvas.h b/synfig-core/trunk/src/synfig/loadcanvas.h index 465b879..888e1d7 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.h +++ b/synfig-core/trunk/src/synfig/loadcanvas.h @@ -6,7 +6,8 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2007 Chris Moore +** Copyright (c) 2007, 2008 Chris Moore +** Copyright (c) 2009 Carlos A. Sosa Navarro ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -73,6 +74,9 @@ private: String path; + String errors_text; + String warnings_text; + GUID guid_; /* @@ -113,13 +117,20 @@ public: const synfig::String& get_path()const { return path; } - //! \todo writeme - Canvas::Handle parse_from_file(const String &filename); + const synfig::String& get_errors_text()const { return errors_text; } + const synfig::String& get_warnings_text()const { return warnings_text; } + + static void register_canvas_in_map(Canvas::Handle canvas, String as); - Canvas::Handle parse_from_file_as(const String &filename,const String &as); +#ifdef _DEBUG + static void show_canvas_map(String file, int line, String text); +#endif // _DEBUG //! \todo writeme - Canvas::Handle parse_from_string(const String &data); + Canvas::Handle parse_from_file_as(const String &filename,const String &as,String &errors); + Canvas::Handle parse_as(xmlpp::Element* node,String &errors); + + static std::set loading_; private: @@ -161,7 +172,6 @@ private: etl::handle parse_animated(xmlpp::Element *node,Canvas::Handle canvas); etl::handle parse_subtract(xmlpp::Element *node,Canvas::Handle canvas); etl::handle parse_linkable_value_node(xmlpp::Element *node,Canvas::Handle canvas); - etl::handle parse_composite(xmlpp::Element *node,Canvas::Handle canvas); etl::handle parse_dynamic_list(xmlpp::Element *node,Canvas::Handle canvas); }; // END of CanvasParser @@ -170,11 +180,9 @@ private: //! Loads a canvas from \a filename /*! \return The Canvas's handle on success, an empty handle on failure */ -extern Canvas::Handle open_canvas(const String &filename); -extern Canvas::Handle open_canvas_as(const String &filename,const String &as); - -//! Retrieves a Canvas from a string in XML format -extern Canvas::Handle string_to_canvas(const String &data); +extern Canvas::Handle open_canvas(xmlpp::Element* node,String &errors,String &warnings); +extern Canvas::Handle open_canvas(const String &filename,String &errors,String &warnings); +extern Canvas::Handle open_canvas_as(const String &filename,const String &as,String &errors,String &warnings); std::map >& get_open_canvas_map();