From: dooglus Date: Sat, 22 Nov 2008 15:42:23 +0000 (+0000) Subject: Add function Canvas::register_external_canvas() to allow us to register that a file... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=71d498a6e0600d4a46b5416cfc765342f869cd34;p=synfig.git Add function Canvas::register_external_canvas() to allow us to register that a file references a canvas in an external file. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2255 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/canvas.cpp b/synfig-core/trunk/src/synfig/canvas.cpp index 60f4be9..2e0144b 100644 --- a/synfig-core/trunk/src/synfig/canvas.cpp +++ b/synfig-core/trunk/src/synfig/canvas.cpp @@ -1385,3 +1385,10 @@ Canvas::rename_group(const String&old_name,const String&new_name) (*iter)->add_to_group(new_name); } } + +void +Canvas::register_external_canvas(String file_name, Handle canvas) +{ + if(!is_absolute_path(file_name)) file_name = get_file_path()+ETL_DIRECTORY_SEPARATOR+file_name; + externals_[file_name] = canvas; +} diff --git a/synfig-core/trunk/src/synfig/canvas.h b/synfig-core/trunk/src/synfig/canvas.h index 7f22ce5..088c2e8 100644 --- a/synfig-core/trunk/src/synfig/canvas.h +++ b/synfig-core/trunk/src/synfig/canvas.h @@ -541,6 +541,8 @@ public: Handle clone(const GUID& deriv_guid=GUID())const; + void register_external_canvas(String file, Handle canvas); + private: void add_group_pair(String group, etl::handle layer); void remove_group_pair(String group, etl::handle layer);