Add function Canvas::register_external_canvas() to allow us to register that a file...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 22 Nov 2008 15:42:23 +0000 (15:42 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 22 Nov 2008 15:42:23 +0000 (15:42 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2255 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index 60f4be9..2e0144b 100644 (file)
@@ -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;
+}
index 7f22ce5..088c2e8 100644 (file)
@@ -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> layer);
        void remove_group_pair(String group, etl::handle<Layer> layer);