-/* === S I N F G =========================================================== */
-/*! \file value_node.cpp
+/* === S Y N F I G ========================================================= */
+/*! \file valuenode.cpp
** \brief Template File
**
-** $Id: valuenode.cpp,v 1.1.1.1 2005/01/04 01:23:15 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
*/
/* ========================================================================= */
/* === H E A D E R S ======================================================= */
-#define SINFG_NO_ANGLE
+#define SYNFIG_NO_ANGLE
//#define HAS_HASH_MAP 1
using namespace std;
using namespace etl;
-using namespace sinfg;
+using namespace synfig;
/* === M A C R O S ========================================================= */
ValueNode::LooseHandle
-sinfg::find_value_node(const GUID& guid)
+synfig::find_value_node(const GUID& guid)
{
return guid_cast<ValueNode>(guid);
}
ADD_VALUENODE2(ValueNode_DynamicList,"dynamic_list");
ADD_VALUENODE(ValueNode_GradientRotate,"gradient_rotate");
ADD_VALUENODE(ValueNode_Sine,"sine");
-
+
#undef ADD_VALUENODE
return true;
}
/* if(global_value_node_map.size() || value_node_count)
{
if(value_node_count)
- sinfg::error("%d ValueNodes haven't been destroyed yet!",value_node_count);
+ synfig::error("%d ValueNodes haven't been destroyed yet!",value_node_count);
if(global_value_node_map.size()!=value_node_count)
- sinfg::error("value node count mismatch! map.size()!=value_node_count (%d!=%d)",global_value_node_map.size(),value_node_count);
-
- GlobalValueNodeMap::iterator iter;
+ synfig::error("value node count mismatch! map.size()!=value_node_count (%d!=%d)",global_value_node_map.size(),value_node_count);
+
+ GlobalValueNodeMap::iterator iter;
for(iter=global_value_node_map.begin();iter!=global_value_node_map.end();++iter)
{
if(!iter->second->is_exported())
- sinfg::info("%s: count:%d name:%s type:%s",
+ synfig::info("%s: count:%d name:%s type:%s",
iter->first.get_string().c_str(),
iter->second->count(),
iter->second->get_name().c_str(),
ValueBase::type_name(iter->second->get_type()).c_str()
);
else
- sinfg::info("%s: id:%s count:%d name:%s type:%s",
+ synfig::info("%s: id:%s count:%d name:%s type:%s",
iter->first.get_string().c_str(),
iter->second->get_id().c_str(),
iter->second->count(),
LinkableValueNode::set_link(int i,ValueNode::Handle x)
{
ValueNode::Handle previous(get_link(i));
-
+
if(set_link_vfunc(i,x))
{
if(previous)
remove_child(previous.get());
add_child(x.get());
-
+
if(!x->is_exported() && get_parent_canvas())
{
x->set_parent_canvas(get_parent_canvas());
ValueNode::~ValueNode()
{
value_node_count--;
-
+
begin_delete();
//DEBUGPOINT();
get_parent_canvas()->signal_value_node_changed()(this);
else if(get_root_canvas() && get_parent_canvas())
get_root_canvas()->signal_value_node_changed()(this);
-
+
Node::on_changed();
}
{
if(x.get()==this)
return 0;
-
+
while(parent_set.size())
{
(*parent_set.begin())->add_child(x.get());
{
if(id.empty())
throw Exception::IDNotFound("Empty ID");
-
+
ValueNode::Handle value_node;
-
+
try
{
value_node=find(id);
return false;
}
catch(Exception::IDNotFound)
- {
+ {
push_back(value_node);
return true;
}
-
+
return false;
}
int i;
LinkableValueNode *ret=create_new();
ret->set_guid(get_guid()^deriv_guid);
-
+
for(i=0;i<link_count();i++)
{
ValueNode::Handle link=get_link_vfunc(i);
{
assert(is_exported());
assert(canvas_);
-
+
if(x.get()==canvas_.get())
return get_id();
-
+
return canvas_->_get_relative_id(x)+':'+get_id();
}
void LinkableValueNode::get_times_vfunc(Node::time_set &set) const
{
ValueNode::LooseHandle h;
-
+
int size = link_count();
-
+
//just add it to the set...
for(int i=0; i < size; ++i)
{