X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode.cpp;h=d1e3256254bb4e82d8a1f94867094516787caae0;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=c9d697ba3bfcbb94020d894b9101323514f80f1d;hpb=ce1c5ee62fbcd94b09464d40a03e5c1f57787ba2;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode.cpp b/synfig-core/trunk/src/synfig/valuenode.cpp index c9d697b..d1e3256 100644 --- a/synfig-core/trunk/src/synfig/valuenode.cpp +++ b/synfig-core/trunk/src/synfig/valuenode.cpp @@ -7,6 +7,7 @@ ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** Copyright (c) 2007, 2008 Chris Moore +** Copyright (c) 2008 Carlos López ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -44,6 +45,7 @@ #include "valuenode_linear.h" #include "valuenode_composite.h" #include "valuenode_reference.h" +#include "valuenode_greyed.h" #include "valuenode_scale.h" #include "valuenode_blinecalctangent.h" #include "valuenode_blinecalcvertex.h" @@ -72,6 +74,23 @@ #include "valuenode_duplicate.h" #include "valuenode_integer.h" #include "valuenode_step.h" +#include "valuenode_vectorangle.h" +#include "valuenode_vectorlength.h" +#include "valuenode_vectorx.h" +#include "valuenode_vectory.h" +#include "valuenode_gradientcolor.h" +#include "valuenode_dotproduct.h" +#include "valuenode_timestring.h" +#include "valuenode_realstring.h" +#include "valuenode_join.h" +#include "valuenode_anglestring.h" +#include "valuenode_intstring.h" +#include "valuenode_log.h" +#include "valuenode_pow.h" +#include "valuenode_compare.h" +#include "valuenode_not.h" +#include "valuenode_and.h" +#include "valuenode_or.h" #include "layer.h" @@ -153,6 +172,26 @@ ValueNode::subsys_init() ADD_VALUENODE(ValueNode_Step, "step", _("Step"), RELEASE_VERSION_0_61_08); // SVN r1691 ADD_VALUENODE(ValueNode_BLineCalcWidth, "blinecalcwidth", _("BLine Width"), RELEASE_VERSION_0_61_08); // SVN r1694 + ADD_VALUENODE(ValueNode_VectorAngle, "vectorangle", _("Vector Angle"), RELEASE_VERSION_0_61_09); // SVN r1880 + ADD_VALUENODE(ValueNode_VectorLength, "vectorlength", _("Vector Length"), RELEASE_VERSION_0_61_09); // SVN r1881 + ADD_VALUENODE(ValueNode_VectorX, "vectorx", _("Vector X"), RELEASE_VERSION_0_61_09); // SVN r1882 + ADD_VALUENODE(ValueNode_VectorY, "vectory", _("Vector Y"), RELEASE_VERSION_0_61_09); // SVN r1882 + ADD_VALUENODE(ValueNode_GradientColor, "gradientcolor", _("Gradient Color"), RELEASE_VERSION_0_61_09); // SVN r1885 + ADD_VALUENODE(ValueNode_DotProduct, "dotproduct", _("Dot Product"), RELEASE_VERSION_0_61_09); // SVN r1891 + ADD_VALUENODE(ValueNode_TimeString, "timestring", _("Time String"), RELEASE_VERSION_0_61_09); // SVN r2000 + ADD_VALUENODE(ValueNode_RealString, "realstring", _("Real String"), RELEASE_VERSION_0_61_09); // SVN r2003 + ADD_VALUENODE(ValueNode_Join, "join", _("Joined List"), RELEASE_VERSION_0_61_09); // SVN r2007 + ADD_VALUENODE(ValueNode_AngleString, "anglestring", _("Angle String"), RELEASE_VERSION_0_61_09); // SVN r2010 + ADD_VALUENODE(ValueNode_IntString, "intstring", _("Int String"), RELEASE_VERSION_0_61_09); // SVN r2010 + ADD_VALUENODE(ValueNode_Logarithm, "logarithm", _("Logarithm"), RELEASE_VERSION_0_61_09); // SVN r2034 + + ADD_VALUENODE(ValueNode_Greyed, "greyed", _("Greyed"), RELEASE_VERSION_0_61_10); // SVN r2305 + ADD_VALUENODE(ValueNode_Pow, "power", _("Power"), RELEASE_VERSION_0_61_10); // SVN r2362 + ADD_VALUENODE(ValueNode_Compare, "compare", _("Compare"), RELEASE_VERSION_0_61_10); // SVN r2364 + ADD_VALUENODE(ValueNode_Not, "not", _("Not"), RELEASE_VERSION_0_61_10); // SVN r2364 + ADD_VALUENODE(ValueNode_And, "and", _("And"), RELEASE_VERSION_0_61_10); // SVN r2364 + ADD_VALUENODE(ValueNode_Or, "or", _("Or"), RELEASE_VERSION_0_61_10); // SVN r2364 + #undef ADD_VALUENODE #undef ADD_VALUENODE2 @@ -240,8 +279,23 @@ LinkableValueNode::set_link(int i,ValueNode::Handle x) if(set_link_vfunc(i,x)) { + // Fix 2412072: remove the previous link from the parent_set unless one of the other links is also + // using it when we convert a value to 'switch', both 'on' and 'off' are linked to the same valuenode + // if we then disconnect one of the two, the one we disconnect is set to be a new valuenode_const + // and the previously shared value is removed from the parent set even though the other is still + // using it if(previous) - remove_child(previous.get()); + { + int size = link_count(), index; + for (index=0; index < size; ++index) + { + if (i == index) continue; + if (get_link(index) == previous) + break; + } + if (index == size) + remove_child(previous.get()); + } add_child(x.get()); if(!x->is_exported() && get_parent_canvas())