projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove .gitignore do nothing is ignored.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
synfig
/
valuenode_reference.cpp
diff --git
a/synfig-core/trunk/src/synfig/valuenode_reference.cpp
b/synfig-core/trunk/src/synfig/valuenode_reference.cpp
index
f2d0ace
..
a235f02
100644
(file)
--- a/
synfig-core/trunk/src/synfig/valuenode_reference.cpp
+++ b/
synfig-core/trunk/src/synfig/valuenode_reference.cpp
@@
-1,11
+1,12
@@
/* === S Y N F I G ========================================================= */
/*! \file valuenode_reference.cpp
/* === S Y N F I G ========================================================= */
/*! \file valuenode_reference.cpp
-** \brief
Template File
+** \brief
Implementation of the "Reference" valuenode conversion.
**
** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2008 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
@@
-78,20
+79,22
@@
ValueNode_Reference::~ValueNode_Reference()
}
bool
}
bool
-ValueNode_Reference::set_link_vfunc(int i,ValueNode::Handle
x
)
+ValueNode_Reference::set_link_vfunc(int i,ValueNode::Handle
value
)
{
{
- assert(i==0);
- if(x->get_type()!=get_type() && !PlaceholderValueNode::Handle::cast_dynamic(x))
- return false;
- link_=x;
- signal_child_changed()(i);signal_value_changed()();
- return true;
+ assert(i>=0 && i<link_count());
+
+ switch(i)
+ {
+ case 0: CHECK_TYPE_AND_SET_VALUE(link_, get_type());
+ }
+ return false;
}
ValueNode::LooseHandle
}
ValueNode::LooseHandle
-ValueNode_Reference::get_link_vfunc(int i)const
+ValueNode_Reference::get_link_vfunc(int i
__attribute__ ((unused))
)const
{
{
- assert(i==0);
+ assert(i>=0 && i<link_count());
+
return link_;
}
return link_;
}
@@
-104,14
+107,25
@@
ValueNode_Reference::link_count()const
String
ValueNode_Reference::link_local_name(int i)const
{
String
ValueNode_Reference::link_local_name(int i)const
{
- assert(i==0);
- return _("Link");
+ assert(i>=0 && i<link_count());
+
+ switch(i)
+ {
+ case 0: return _("Link");
+ }
+ return String();
}
String
ValueNode_Reference::link_name(int i)const
{
}
String
ValueNode_Reference::link_name(int i)const
{
- return "link";
+ assert(i>=0 && i<link_count());
+
+ switch(i)
+ {
+ case 0: return "link";
+ }
+ return String();
}
int
}
int
@@
-126,6
+140,9
@@
ValueNode_Reference::get_link_index_from_name(const String &name)const
ValueBase
ValueNode_Reference::operator()(Time t)const
{
ValueBase
ValueNode_Reference::operator()(Time t)const
{
+ if (getenv("SYNFIG_DEBUG_VALUENODE_OPERATORS"))
+ printf("%s:%d operator()\n", __FILE__, __LINE__);
+
return (*link_)(t);
}
return (*link_)(t);
}