X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Flayerduplicate.cpp;h=ff5726efab24cb800eefce9132153dd009e92e21;hb=3d5774e06918f597c71486e3efc3edc712e809a8;hp=502d901b56d4723d408df6b25b35874761af39a1;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.cpp index 502d901..ff5726e 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/layerduplicate.cpp @@ -2,19 +2,20 @@ /*! \file layerduplicate.cpp ** \brief Template File ** -** $Id: layerduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -49,7 +50,7 @@ ACTION_SET_TASK(Action::LayerDuplicate,"duplicate"); ACTION_SET_CATEGORY(Action::LayerDuplicate,Action::CATEGORY_LAYER); ACTION_SET_PRIORITY(Action::LayerDuplicate,0); ACTION_SET_VERSION(Action::LayerDuplicate,"0.0"); -ACTION_SET_CVS_ID(Action::LayerDuplicate,"$Id: layerduplicate.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $"); +ACTION_SET_CVS_ID(Action::LayerDuplicate,"$Id$"); /* === G L O B A L S ======================================================= */ @@ -65,20 +66,20 @@ Action::ParamVocab Action::LayerDuplicate::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 duplicated")) .set_supports_multiple() ); - + return ret; } bool -Action::LayerDuplicate::is_canidate(const ParamList &x) +Action::LayerDuplicate::is_candidate(const ParamList &x) { - return canidate_check(get_param_vocab(),x); + return candidate_check(get_param_vocab(),x); } bool @@ -87,7 +88,7 @@ Action::LayerDuplicate::set_param(const synfig::String& name, const Action::Para if(name=="layer" && param.get_type()==Param::TYPE_LAYER) { layers.push_back(param.get_layer()); - + return true; } @@ -107,47 +108,47 @@ Action::LayerDuplicate::prepare() { if(!first_time()) return; - + std::list::const_iterator iter; - + for(iter=layers.begin();iter!=layers.end();++iter) { Layer::Handle layer(*iter); - + Canvas::Handle subcanvas(layer->get_canvas()); - + // 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 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::Handle new_layer(layer->clone(guid)); - + { Action::Handle action(Action::create("layer_move")); - + action->set_param("canvas",subcanvas); action->set_param("canvas_interface",get_canvas_interface()); action->set_param("layer",new_layer); action->set_param("new_index",layers.front()->get_depth()); - + add_action_front(action); } { Action::Handle action(Action::create("layer_add")); - + action->set_param("canvas",subcanvas); action->set_param("canvas_interface",get_canvas_interface()); action->set_param("new",new_layer); - + add_action_front(action); } }