X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Faction_param.cpp;h=3e45ce26477e4d53f161cfa94567f09a9a835473;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=3d385876ca0d123a990a5c58a67def7a91e2513d;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/action_param.cpp b/synfig-studio/trunk/src/synfigapp/action_param.cpp index 3d38587..3e45ce2 100644 --- a/synfig-studio/trunk/src/synfigapp/action_param.cpp +++ b/synfig-studio/trunk/src/synfigapp/action_param.cpp @@ -2,19 +2,20 @@ /*! \file action_param.cpp ** \brief Template File ** -** $Id: action_param.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 */ /* ========================================================================= */ @@ -32,6 +33,8 @@ #include "action.h" #include "canvasinterface.h" +#include "general.h" + #endif using namespace std; @@ -43,10 +46,10 @@ using namespace Action; /* === P R O C E D U R E S ================================================= */ bool -Action::canidate_check(const ParamVocab& param_vocab, const ParamList& param_list) +Action::candidate_check(const ParamVocab& param_vocab, const ParamList& param_list) { ParamVocab::const_iterator iter; - + for(iter=param_vocab.begin();iter!=param_vocab.end();++iter) { int n(param_list.count(iter->get_name())); @@ -59,14 +62,14 @@ Action::canidate_check(const ParamVocab& param_vocab, const ParamList& param_lis if(iter->get_user_supplied() || iter->get_optional()) continue; - + if(n==0) return false; if(n==1 && iter->get_requires_multiple()) return false; if(n>1 && !iter->get_supports_multiple()) return false; - + if(iter->get_type()!=param_list.find(iter->get_name())->second.get_type()) return false; } @@ -171,7 +174,7 @@ Param::Param(const Param &rhs): } Param::Param(const etl::handle& x): - + type_(TYPE_CANVASINTERFACE) { _ParamCounter::counter++; @@ -181,7 +184,7 @@ Param::Param(const etl::handle& x): /* Param::Param(synfigapp::CanvasInterface* x): - + type_(TYPE_CANVASINTERFACE) { _ParamCounter::counter++; @@ -191,7 +194,7 @@ Param::Param(synfigapp::CanvasInterface* x): */ Param::Param(const etl::loose_handle& x): - + type_(TYPE_CANVASINTERFACE) { _ParamCounter::counter++; @@ -199,7 +202,7 @@ Param::Param(const etl::loose_handle& x): data.canvas_interface.get()=x; } -Param::Param(const synfig::Canvas::Handle& x): +Param::Param(const synfig::Canvas::Handle& x): type_(TYPE_CANVAS) { _ParamCounter::counter++; @@ -207,7 +210,7 @@ Param::Param(const synfig::Canvas::Handle& x): data.canvas.get()=x; } -Param::Param(const synfig::Canvas::LooseHandle& x): +Param::Param(const synfig::Canvas::LooseHandle& x): type_(TYPE_CANVAS) { _ParamCounter::counter++; @@ -216,7 +219,7 @@ Param::Param(const synfig::Canvas::LooseHandle& x): } Param::Param(const synfig::Layer::Handle& x): - + type_(TYPE_LAYER) { _ParamCounter::counter++; @@ -225,7 +228,7 @@ Param::Param(const synfig::Layer::Handle& x): } Param::Param(const synfig::Layer::LooseHandle& x): - + type_(TYPE_LAYER) { _ParamCounter::counter++; @@ -234,7 +237,7 @@ Param::Param(const synfig::Layer::LooseHandle& x): } Param::Param(const synfig::ValueNode::Handle& x): - + type_(TYPE_VALUENODE) { _ParamCounter::counter++; @@ -243,7 +246,7 @@ Param::Param(const synfig::ValueNode::Handle& x): } Param::Param(const synfig::ValueNode::LooseHandle& x): - + type_(TYPE_VALUENODE) { _ParamCounter::counter++; @@ -252,7 +255,7 @@ Param::Param(const synfig::ValueNode::LooseHandle& x): } Param::Param(const synfig::ValueBase& x): - + type_(TYPE_VALUE) { _ParamCounter::counter++; @@ -260,7 +263,7 @@ Param::Param(const synfig::ValueBase& x): data.value.get()=x; } -Param::Param(const synfig::RendDesc& x): +Param::Param(const synfig::RendDesc& x): type_(TYPE_RENDDESC) { _ParamCounter::counter++; @@ -277,7 +280,7 @@ Param::Param(const synfig::Time& x): } Param::Param(const synfig::Activepoint& x): - + type_(TYPE_ACTIVEPOINT) { _ParamCounter::counter++; @@ -285,7 +288,7 @@ Param::Param(const synfig::Activepoint& x): data.activepoint.get()=x; } -Param::Param(const synfig::Waypoint& x): +Param::Param(const synfig::Waypoint& x): type_(TYPE_WAYPOINT) { _ParamCounter::counter++; @@ -293,7 +296,7 @@ Param::Param(const synfig::Waypoint& x): data.waypoint.get()=x; } -Param::Param(const synfig::Waypoint::Model& x): +Param::Param(const synfig::Waypoint::Model& x): type_(TYPE_WAYPOINTMODEL) { _ParamCounter::counter++; @@ -318,7 +321,7 @@ Param::Param(const char * x): } Param::Param(const synfig::Keyframe& x): - + type_(TYPE_KEYFRAME) { _ParamCounter::counter++; @@ -327,7 +330,7 @@ Param::Param(const synfig::Keyframe& x): } Param::Param(const synfigapp::ValueDesc& x): - + type_(TYPE_VALUEDESC) { _ParamCounter::counter++; @@ -350,7 +353,7 @@ Param::Param(const EditMode& x): } Param::Param(const synfig::Real& x): - + type_(TYPE_REAL) { _ParamCounter::counter++; @@ -358,7 +361,7 @@ Param::Param(const synfig::Real& x): } Param::Param(const bool& x): - + type_(TYPE_BOOL) { _ParamCounter::counter++; @@ -376,7 +379,7 @@ Param::operator=(const Param& rhs) { clear(); type_=rhs.type_; - + switch(type_) { case TYPE_ACTIVEPOINT: