25 #ifndef __SYNFIG_APP_INSTANCE_H
26 #define __SYNFIG_APP_INSTANCE_H
32 #include <synfig/canvas.h>
33 #include <synfig/string.h>
34 #include <synfig/filecontainertemporary.h>
35 #include <synfig/filesystemgroup.h>
38 #include <sigc++/signal.h>
39 #include <sigc++/object.h>
52 class CanvasInterface;
68 synfig::Layer::ConstHandle
layer;
76 using etl::shared_object::ref;
77 using etl::shared_object::unref;
94 etl::handle< synfig::FileSystemGroup > file_system_;
95 etl::handle< synfig::FileContainerTemporary > container_;
99 sigc::signal<void> signal_filename_changed_;
100 sigc::signal<void> signal_saved_;
101 etl::handle<SelectionManager> selection_manager_;
103 bool save_canvas_into_container_;
104 std::string save_canvas_reference_directory_;
105 std::string save_canvas_reference_local_directory_;
107 std::list< synfig::Layer::Handle > layers_to_save;
109 static bool save_canvas_callback(
void *instance_ptr, synfig::Layer::ConstHandle layer,
const std::string ¶m_name, std::string &filename);
111 bool import_external_canvas(
synfig::Canvas::Handle canvas, std::map<synfig::Canvas*, synfig::Canvas::Handle> &imported);
112 void import_external_canvases();
116 Instance(etl::handle<synfig::Canvas>, etl::handle< synfig::FileContainerTemporary > container);
126 for(std::list<synfig::Layer::Handle>::iterator i = layers_to_save.begin(); i != layers_to_save.end(); i++)
127 if (*i == layer)
return true;
133 for(std::list<synfig::Layer::Handle>::iterator i = layers_to_save.begin(); i != layers_to_save.end(); i++)
134 if (*i == layer) { layers_to_save.erase(i);
break; }
141 etl::handle< synfig::FileSystemGroup >
get_file_system()
const {
return file_system_; };
142 etl::handle< synfig::FileContainerTemporary >
get_container()
const {
return container_; };
143 void save_surface(
const synfig::Surface &surface,
const synfig::String &filename);
156 bool save_as(
const synfig::String &filename);
163 synfig::String &out_description,
164 synfig::String &out_filename,
165 synfig::String &out_filename_param);
182 static etl::handle<Instance>
create(etl::handle<synfig::Canvas> canvas, etl::handle< synfig::FileContainerTemporary > container);
185 etl::handle<Instance>
find_instance(etl::handle<synfig::Canvas> canvas);