/*! \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
*/
/* ========================================================================= */
#include "action.h"
#include "canvasinterface.h"
+#include "general.h"
+
#endif
using namespace std;
/* === 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()));
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;
}
}
Param::Param(const etl::handle<synfigapp::CanvasInterface>& x):
-
+
type_(TYPE_CANVASINTERFACE)
{
_ParamCounter::counter++;
/*
Param::Param(synfigapp::CanvasInterface* x):
-
+
type_(TYPE_CANVASINTERFACE)
{
_ParamCounter::counter++;
*/
Param::Param(const etl::loose_handle<synfigapp::CanvasInterface>& x):
-
+
type_(TYPE_CANVASINTERFACE)
{
_ParamCounter::counter++;
data.canvas_interface.get()=x;
}
-Param::Param(const synfig::Canvas::Handle& x):
+Param::Param(const synfig::Canvas::Handle& x):
type_(TYPE_CANVAS)
{
_ParamCounter::counter++;
data.canvas.get()=x;
}
-Param::Param(const synfig::Canvas::LooseHandle& x):
+Param::Param(const synfig::Canvas::LooseHandle& x):
type_(TYPE_CANVAS)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::Layer::Handle& x):
-
+
type_(TYPE_LAYER)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::Layer::LooseHandle& x):
-
+
type_(TYPE_LAYER)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::ValueNode::Handle& x):
-
+
type_(TYPE_VALUENODE)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::ValueNode::LooseHandle& x):
-
+
type_(TYPE_VALUENODE)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::ValueBase& x):
-
+
type_(TYPE_VALUE)
{
_ParamCounter::counter++;
data.value.get()=x;
}
-Param::Param(const synfig::RendDesc& x):
+Param::Param(const synfig::RendDesc& x):
type_(TYPE_RENDDESC)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::Activepoint& x):
-
+
type_(TYPE_ACTIVEPOINT)
{
_ParamCounter::counter++;
data.activepoint.get()=x;
}
-Param::Param(const synfig::Waypoint& x):
+Param::Param(const synfig::Waypoint& x):
type_(TYPE_WAYPOINT)
{
_ParamCounter::counter++;
data.waypoint.get()=x;
}
-Param::Param(const synfig::Waypoint::Model& x):
+Param::Param(const synfig::Waypoint::Model& x):
type_(TYPE_WAYPOINTMODEL)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::Keyframe& x):
-
+
type_(TYPE_KEYFRAME)
{
_ParamCounter::counter++;
}
Param::Param(const synfigapp::ValueDesc& x):
-
+
type_(TYPE_VALUEDESC)
{
_ParamCounter::counter++;
}
Param::Param(const synfig::Real& x):
-
+
type_(TYPE_REAL)
{
_ParamCounter::counter++;
}
Param::Param(const bool& x):
-
+
type_(TYPE_BOOL)
{
_ParamCounter::counter++;
{
clear();
type_=rhs.type_;
-
+
switch(type_)
{
case TYPE_ACTIVEPOINT: