**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
ACTION_SET_TASK(Action::LayerLower,"lower");
ACTION_SET_CATEGORY(Action::LayerLower,Action::CATEGORY_LAYER);
ACTION_SET_PRIORITY(Action::LayerLower,10);
ACTION_SET_VERSION(Action::LayerLower,"0.0");
ACTION_SET_TASK(Action::LayerLower,"lower");
ACTION_SET_CATEGORY(Action::LayerLower,Action::CATEGORY_LAYER);
ACTION_SET_PRIORITY(Action::LayerLower,10);
ACTION_SET_VERSION(Action::LayerLower,"0.0");
ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
.set_local_name(_("Layer"))
.set_desc(_("Layer to be lowered"))
.set_supports_multiple()
);
ret.push_back(ParamDesc("layer",Param::TYPE_LAYER)
.set_local_name(_("Layer"))
.set_desc(_("Layer to be lowered"))
.set_supports_multiple()
);
Layer::Handle layer(x.find("layer")->second.get_layer());
//synfig::info("layer->get_depth()= %d ; layer->get_canvas()->size()=%d ;",layer->get_depth(),layer->get_canvas()->size());
if(layer->get_depth()+1>=layer->get_canvas()->size())
Layer::Handle layer(x.find("layer")->second.get_layer());
//synfig::info("layer->get_depth()= %d ; layer->get_canvas()->size()=%d ;",layer->get_depth(),layer->get_canvas()->size());
if(layer->get_depth()+1>=layer->get_canvas()->size())
// Find the iterator for the layer
Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
// Find the iterator for the layer
Canvas::iterator iter=find(subcanvas->begin(),subcanvas->end(),layer);
// If we couldn't find the layer in the canvas, then bail
if(*iter!=layer)
throw Error(_("This layer doesn't exist anymore."));
// If we couldn't find the layer in the canvas, then bail
if(*iter!=layer)
throw Error(_("This layer doesn't exist anymore."));
// If the subcanvas isn't the same as the canvas,
// then it had better be an inline canvas. If not,
// bail
//if(get_canvas()!=subcanvas && !subcanvas->is_inline())
// throw Error(_("This layer doesn't belong to this canvas anymore"));
// If the subcanvas isn't the same as the canvas,
// then it had better be an inline canvas. If not,
// bail
//if(get_canvas()!=subcanvas && !subcanvas->is_inline())
// throw Error(_("This layer doesn't belong to this canvas anymore"));
layer_move->set_param("canvas",get_canvas());
layer_move->set_param("canvas_interface",get_canvas_interface());
layer_move->set_param("layer",layer);
layer_move->set_param("new_index",new_index);
layer_move->set_param("canvas",get_canvas());
layer_move->set_param("canvas_interface",get_canvas_interface());
layer_move->set_param("layer",layer);
layer_move->set_param("new_index",new_index);