Use link_count from children vocabulary and return the stored vocabulary if already...
[synfig.git] / synfig-core / src / synfig / valuenode_compare.cpp
index 68c3427..627d843 100644 (file)
@@ -54,6 +54,8 @@ using namespace synfig;
 ValueNode_Compare::ValueNode_Compare(const ValueBase &x):
        LinkableValueNode(x.get_type())
 {
+       Vocab ret(get_children_vocab());
+       set_children_vocab(ret);
        bool value(x.get(bool()));
 
        set_link("lhs",          ValueNode_Const::create(Real(0)));
@@ -195,3 +197,39 @@ ValueNode_Compare::check_type(ValueBase::Type type)
 {
        return type==ValueBase::TYPE_BOOL;
 }
+
+LinkableValueNode::Vocab
+ValueNode_Compare::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(_("The left side of the comparison"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"rhs")
+               .set_local_name(_("RHS"))
+               .set_description(_("The right side of the comparison"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"greater")
+               .set_local_name(_("Greater"))
+               .set_description(_("When checked, returns true if LHS > RHS"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"equal")
+               .set_local_name(_("Equal"))
+               .set_description(_("When checked, returns true if LHS = RHS"))
+       );
+
+       ret.push_back(ParamDesc(ValueBase(),"less")
+               .set_local_name(_("Less"))
+               .set_description(_("When checked, returns true if LHS < RHS"))
+       );
+
+       return ret;
+}