Example #1
0
void print_child_canvases(const std::string& prefix,
						  const synfig::Canvas::Handle& canvas)
{
	const synfig::Canvas::Children& children(canvas->children());
	for (synfig::Canvas::Children::const_iterator child_canvas = children.begin();
		 child_canvas != children.end(); child_canvas++)
	{
		std::string new_prefix = prefix + ":" + (*child_canvas)->get_id();
		std::cout << new_prefix << std::endl;
		print_child_canvases(new_prefix, *child_canvas);
	}
}
Example #2
0
void
Instance::update_references_in_canvas(synfig::Canvas::Handle canvas)
{
	for(std::list<Canvas::Handle>::const_iterator i = canvas->children().begin(); i != canvas->children().end(); i++)
		update_references_in_canvas(*i);

	for(IndependentContext c = canvas->get_independent_context(); *c; c++)
	{
		for(FileReferenceList::iterator j = save_canvas_references_.begin(); j != save_canvas_references_.end();)
		{
			if (*c == j->layer)
			{
				ValueBase value;
				value.set(j->new_filename);
				(*c)->set_param(j->param_name, value);
				(*c)->changed();
				find_canvas_interface(get_canvas())->signal_layer_param_changed()(*c,j->param_name);
				j = save_canvas_references_.erase(j);
			}
			else j++;
		}
	}
}