Use link_count from children vocabulary and return the stored vocabulary if already...
[synfig.git] / synfig-core / src / synfig / valuenode_subtract.cpp
index 3ba475e..34d9d56 100644 (file)
@@ -60,6 +60,8 @@ using namespace synfig;
 synfig::ValueNode_Subtract::ValueNode_Subtract(const ValueBase &value):
        LinkableValueNode(value.get_type())
 {
+       Vocab ret(get_children_vocab());
+       set_children_vocab(ret);
        set_link("scalar",ValueNode_Const::create(Real(1.0)));
        ValueBase::Type id(value.get_type());
 
@@ -101,8 +103,6 @@ synfig::ValueNode_Subtract::ValueNode_Subtract(const ValueBase &value):
        assert(ref_a->get_type()==id);
        assert(ref_b->get_type()==id);
        assert(get_type()==id);
-
-       DCAST_HACK_ENABLE();
 }
 
 LinkableValueNode*
@@ -247,3 +247,29 @@ ValueNode_Subtract::check_type(ValueBase::Type type)
                || type==ValueBase::TYPE_TIME
                || type==ValueBase::TYPE_VECTOR;
 }
+
+LinkableValueNode::Vocab
+ValueNode_Subtract::get_children_vocab_vfunc()const
+{
+       if(children_vocab.size())
+               return children_vocab;
+
+       LinkableValueNode::Vocab ret;
+
+       ret.push_back(ParamDesc(ValueBase(),"lhs")
+               .set_local_name(_("LHS"))
+               .set_description(_("Left Hand Side of the subtraction"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"rhs")
+               .set_local_name(_("RHS"))
+               .set_description(_("Right Hand Side of the subtraction"))
+       );
+
+               ret.push_back(ParamDesc(ValueBase(),"scalar")
+               .set_local_name(_("Scalar"))
+               .set_description(_("Value that multiplies the subtraction"))
+       );
+
+       return ret;
+}