X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Factions%2Fblinepointtangentsplit.cpp;h=08b832d66ac92ebaafaa5232a356b3368ad9e7a8;hb=90a8e832d9ebf093fae1b01a07011d873c323dc5;hp=8a30cd5f2ed6b4e4cb987acc81dd5e759ef82f5d;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.cpp b/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.cpp index 8a30cd5..08b832d 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/blinepointtangentsplit.cpp @@ -2,19 +2,20 @@ /*! \file blinepointtangentsplit.cpp ** \brief Template File ** -** $Id: blinepointtangentsplit.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 */ /* ========================================================================= */ @@ -54,7 +55,7 @@ ACTION_SET_TASK(Action::BLinePointTangentSplit,"split"); ACTION_SET_CATEGORY(Action::BLinePointTangentSplit,Action::CATEGORY_VALUENODE); ACTION_SET_PRIORITY(Action::BLinePointTangentSplit,0); ACTION_SET_VERSION(Action::BLinePointTangentSplit,"0.0"); -ACTION_SET_CVS_ID(Action::BLinePointTangentSplit,"$Id: blinepointtangentsplit.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $"); +ACTION_SET_CVS_ID(Action::BLinePointTangentSplit,"$Id$"); /* === G L O B A L S ======================================================= */ @@ -72,7 +73,7 @@ Action::ParamVocab Action::BLinePointTangentSplit::get_param_vocab() { ParamVocab ret(Action::CanvasSpecific::get_param_vocab()); - + ret.push_back(ParamDesc("value_node",Param::TYPE_VALUENODE) .set_local_name(_("ValueNode of BLinePoint")) ); @@ -80,14 +81,14 @@ Action::BLinePointTangentSplit::get_param_vocab() ret.push_back(ParamDesc("time",Param::TYPE_TIME) .set_local_name(_("Time")) ); - + return ret; } bool -Action::BLinePointTangentSplit::is_canidate(const ParamList &x) +Action::BLinePointTangentSplit::is_candidate(const ParamList &x) { - if(canidate_check(get_param_vocab(),x)) + if(candidate_check(get_param_vocab(),x)) { ValueNode_Composite::Handle value_node; value_node=ValueNode_Composite::Handle::cast_dynamic(x.find("value_node")->second.get_value_node()); @@ -107,13 +108,13 @@ Action::BLinePointTangentSplit::set_param(const synfig::String& name, const Acti if(name=="value_node" && param.get_type()==Param::TYPE_VALUENODE) { value_node=value_node.cast_dynamic(param.get_value_node()); - + return (bool)(value_node); } if(name=="time" && param.get_type()==Param::TYPE_TIME) { time=param.get_time(); - + return true; } @@ -128,7 +129,7 @@ Action::BLinePointTangentSplit::is_ready()const if(time==(Time::begin()-1)) synfig::error("Missing time"); - + if(!value_node || time==(Time::begin()-1)) return false; return Action::CanvasSpecific::is_ready(); @@ -140,40 +141,40 @@ Action::BLinePointTangentSplit::prepare() clear(); Action::Handle action; - + { action=Action::create("value_desc_set"); if(!action) throw Error(_("Couldn't find action \"value_desc_set\"")); - + action->set_param("canvas",get_canvas()); action->set_param("canvas_interface",get_canvas_interface()); action->set_param("value_desc",ValueDesc(value_node,3)); action->set_param("time",time); action->set_param("new_value",synfig::ValueBase(true)); - + assert(action->is_ready()); if(!action->is_ready()) throw Error(Error::TYPE_NOTREADY); - + add_action(action); } { action=Action::create("value_desc_set"); if(!action) throw Error(_("Couldn't find action \"value_desc_set\"")); - + action->set_param("canvas",get_canvas()); action->set_param("canvas_interface",get_canvas_interface()); action->set_param("value_desc",ValueDesc(value_node,5)); action->set_param("time",time); action->set_param("new_value",(*value_node->get_link("t1"))(time)); - + assert(action->is_ready()); if(!action->is_ready()) throw Error(Error::TYPE_NOTREADY); - + add_action(action); } - + }