projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use LinkableValueNode members functions when possible in the derived valuenodes.
[synfig.git]
/
synfig-core
/
src
/
synfig
/
valuenode_intstring.cpp
diff --git
a/synfig-core/src/synfig/valuenode_intstring.cpp
b/synfig-core/src/synfig/valuenode_intstring.cpp
index
c7011d2
..
e9c86e7
100644
(file)
--- a/
synfig-core/src/synfig/valuenode_intstring.cpp
+++ b/
synfig-core/src/synfig/valuenode_intstring.cpp
@@
-54,6
+54,8
@@
using namespace synfig;
ValueNode_IntString::ValueNode_IntString(const ValueBase &value):
LinkableValueNode(value.get_type())
{
ValueNode_IntString::ValueNode_IntString(const ValueBase &value):
LinkableValueNode(value.get_type())
{
+ Vocab ret(get_children_vocab());
+ set_children_vocab(ret);
switch(value.get_type())
{
case ValueBase::TYPE_STRING:
switch(value.get_type())
{
case ValueBase::TYPE_STRING:
@@
-64,8
+66,6
@@
ValueNode_IntString::ValueNode_IntString(const ValueBase &value):
default:
throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
}
default:
throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
}
-
- DCAST_HACK_ENABLE();
}
LinkableValueNode*
}
LinkableValueNode*
@@
-150,53
+150,35
@@
ValueNode_IntString::get_link_vfunc(int i)const
return 0;
}
return 0;
}
-int
-ValueNode_IntString::
link_count()const
+bool
+ValueNode_IntString::
check_type(ValueBase::Type type)
{
{
- return 3;
+ return
+ type==ValueBase::TYPE_STRING;
}
}
-String
-ValueNode_IntString::
link_name(int i
)const
+LinkableValueNode::Vocab
+ValueNode_IntString::
get_children_vocab_vfunc(
)const
{
{
- assert(i>=0 && i<link_count());
+ if(children_vocab.size())
+ return children_vocab;
- switch(i)
- {
- case 0: return "int";
- case 1: return "width";
- case 2: return "zero_pad";
- }
- return String();
-}
-
-String
-ValueNode_IntString::link_local_name(int i)const
-{
- assert(i>=0 && i<link_count());
+ LinkableValueNode::Vocab ret;
- switch(i)
- {
- case 0: return _("Int");
- case 1: return _("Width");
- case 2: return _("Zero Padded");
- }
- return String();
-}
+ ret.push_back(ParamDesc(ValueBase(),"int")
+ .set_local_name(_("Int"))
+ .set_description(_("Value to convert to string"))
+ );
-int
-ValueNode_IntString::get_link_index_from_name(const String &name)const
-{
- if (name=="int") return 0;
- if (name=="width") return 1;
- if (name=="zero_pad") return 2;
+ ret.push_back(ParamDesc(ValueBase(),"width")
+ .set_local_name(_("Width"))
+ .set_description(_("Width of the string"))
+ );
- throw Exception::BadLinkName(name);
-}
+ ret.push_back(ParamDesc(ValueBase(),"zero_pad")
+ .set_local_name(_("Zero Padded"))
+ .set_description(_("When checked, the string is left filled with zeros to match the width"))
+ );
-bool
-ValueNode_IntString::check_type(ValueBase::Type type)
-{
- return
- type==ValueBase::TYPE_STRING;
+ return ret;
}
}