X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Flayerremove.cpp;h=f62a7bf114efcd8d1e5c155af116e2821787d841;hb=775a724d35b7d03f323b0a8b05c94aec0881ea46;hp=4fd7b0f78f0bce9130e4e6d5693885d4e59e36c0;hpb=dee84efa006428fdfbf0e84b66ee94eb23113ad9;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp index 4fd7b0f..f62a7bf 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp @@ -1,8 +1,8 @@ /* === S Y N F I G ========================================================= */ -/*! \file action_layerremove.cpp +/*! \file layerremove.cpp ** \brief Template File ** -** $Id: layerremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley @@ -49,7 +49,7 @@ ACTION_SET_TASK(Action::LayerRemove,"remove"); ACTION_SET_CATEGORY(Action::LayerRemove,Action::CATEGORY_LAYER); ACTION_SET_PRIORITY(Action::LayerRemove,0); ACTION_SET_VERSION(Action::LayerRemove,"0.0"); -ACTION_SET_CVS_ID(Action::LayerRemove,"$Id: layerremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $"); +ACTION_SET_CVS_ID(Action::LayerRemove,"$Id$"); /* === G L O B A L S ======================================================= */ @@ -65,13 +65,13 @@ Action::ParamVocab Action::LayerRemove::get_param_vocab() { ParamVocab ret(Action::CanvasSpecific::get_param_vocab()); - + ret.push_back(ParamDesc("layer",Param::TYPE_LAYER) .set_local_name(_("Layer")) .set_desc(_("Layer to be deleted")) .set_supports_multiple() ); - + return ret; } @@ -89,7 +89,7 @@ Action::LayerRemove::set_param(const synfig::String& name, const Action::Param & std::pair layer_pair; layer_pair.first=param.get_layer(); layer_list.push_back(layer_pair); - + return true; } @@ -116,7 +116,7 @@ Action::LayerRemove::perform() // Find the iterator for the layer Canvas::iterator iter2=find(subcanvas->begin(),subcanvas->end(),layer); - + // If we couldn't find the layer in the canvas, then bail if(*iter2!=layer) { @@ -124,7 +124,7 @@ Action::LayerRemove::perform() ** before we go throwing shit around */ 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 @@ -134,18 +134,18 @@ Action::LayerRemove::perform() ** before we go throwing shit around */ throw Error(_("This layer doesn't belong to this canvas anymore")); } - + set_canvas(subcanvas); - + // Calculate the depth that the layer was at (For the undo) iter->second=layer->get_depth(); - + // Mark ourselves as dirty if necessary set_dirty(layer->active()); - + // Remove the layer from the canvas subcanvas->erase(iter2); - + // Signal that a layer has been removed if(get_canvas_interface()) get_canvas_interface()->signal_layer_removed()(layer); @@ -157,23 +157,23 @@ Action::LayerRemove::undo() { std::list >::reverse_iterator iter; for(iter=layer_list.rbegin();iter!=layer_list.rend();++iter) - { + { Layer::Handle layer(iter->first); int& depth(iter->second); - + // Set the layer's canvas layer->set_canvas(get_canvas()); - + // Make sure that the depth is valid if(get_canvas()->size()size(); - + // Mark ourselves as dirty if necessary set_dirty(layer->active()); - + // Insert the layer into the canvas at the desired depth - get_canvas()->insert(get_canvas()->begin()+depth,layer); - + get_canvas()->insert(get_canvas()->begin()+depth,layer); + // Signal that a layer has been inserted if(get_canvas_interface()) get_canvas_interface()->signal_layer_inserted()(layer,depth);