X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Floadcanvas.h;h=bf5f053aa7bbb7534e7929b6ea6ffbf5dd8950b7;hb=47a979c060132d120dbc8160aa9ae2e8c9d900c0;hp=892354d521f09b5e2b8514a407bd53170fbc980b;hpb=1e261b79ef18e523df74584b6c9499baf92d5e9b;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/loadcanvas.h b/synfig-core/trunk/src/synfig/loadcanvas.h index 892354d..bf5f053 100644 --- a/synfig-core/trunk/src/synfig/loadcanvas.h +++ b/synfig-core/trunk/src/synfig/loadcanvas.h @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -35,11 +36,7 @@ #include "valuenode_subtract.h" #include "valuenode_animated.h" #include "valuenode_composite.h" -#include "valuenode_const.h" -#include "valuenode_linear.h" #include "valuenode_dynamiclist.h" -#include "valuenode_reference.h" -#include "valuenode_timedswap.h" #include "keyframe.h" #include "guid.h" @@ -76,6 +73,9 @@ private: String path; + String errors_text; + String warnings_text; + GUID guid_; /* @@ -116,13 +116,15 @@ 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; } - Canvas::Handle parse_from_file_as(const String &filename,const String &as); + static void register_canvas_in_map(Canvas::Handle canvas, String as); //! \todo writeme - Canvas::Handle parse_from_string(const String &data); + Canvas::Handle parse_from_file_as(const String &filename,const String &as,String &errors); + + static std::set loading_; private: @@ -144,18 +146,18 @@ private: // ValueBase Parsing Functions - Real parse_real(xmlpp::Element *node,Canvas::Handle canvas); + Real parse_real(xmlpp::Element *node); Time parse_time(xmlpp::Element *node,Canvas::Handle canvas); - int parse_integer(xmlpp::Element *node,Canvas::Handle canvas); - Vector parse_vector(xmlpp::Element *node,Canvas::Handle canvas); - Color parse_color(xmlpp::Element *node,Canvas::Handle canvas); - Angle parse_angle(xmlpp::Element *node,Canvas::Handle canvas); - String parse_string(xmlpp::Element *node,Canvas::Handle canvas); - bool parse_bool(xmlpp::Element *node,Canvas::Handle canvas); - Segment parse_segment(xmlpp::Element *node,Canvas::Handle canvas); + int parse_integer(xmlpp::Element *node); + Vector parse_vector(xmlpp::Element *node); + Color parse_color(xmlpp::Element *node); + Angle parse_angle(xmlpp::Element *node); + String parse_string(xmlpp::Element *node); + bool parse_bool(xmlpp::Element *node); + Segment parse_segment(xmlpp::Element *node); ValueBase parse_list(xmlpp::Element *node,Canvas::Handle canvas); - Gradient parse_gradient(xmlpp::Element *node,Canvas::Handle canvas); - BLinePoint parse_bline_point(xmlpp::Element *node,Canvas::Handle canvas); + Gradient parse_gradient(xmlpp::Element *node); + BLinePoint parse_bline_point(xmlpp::Element *node); Keyframe parse_keyframe(xmlpp::Element *node,Canvas::Handle canvas); @@ -164,7 +166,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 @@ -173,11 +174,8 @@ 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(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();