**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-** Copyright (c) 2007 Chris Moore
+** Copyright (c) 2007, 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
/* === M A C R O S ========================================================= */
ACTION_INIT_NO_GET_LOCAL_NAME(Action::ValueDescSet);
-ACTION_SET_NAME(Action::ValueDescSet,"value_desc_set");
+ACTION_SET_NAME(Action::ValueDescSet,"ValueDescSet");
ACTION_SET_LOCAL_NAME(Action::ValueDescSet,N_("Set ValueDesc"));
ACTION_SET_TASK(Action::ValueDescSet,"set");
ACTION_SET_CATEGORY(Action::ValueDescSet,Action::CATEGORY_VALUEDESC);
synfig::String
Action::ValueDescSet::get_local_name()const
{
- String name("ValueDesc");
-
- if(!value_desc)
- {
- }
- else if(value_desc.parent_is_layer_param())
- name = strprintf(_("'%s' -> %s"),
- value_desc.get_layer()->get_non_empty_description().c_str(),
- value_desc.get_param_name().c_str());
- else if(value_desc.parent_is_value_node())
- {
- synfig::LinkableValueNode::Handle value_node(synfig::LinkableValueNode::Handle::cast_reinterpret(value_desc.get_parent_value_node()));
- synfig::Node* node;
- for(node=value_node.get();!node->parent_set.empty() && !dynamic_cast<Layer*>(node);node=*node->parent_set.begin());
- Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
- if(parent_layer)
- name = strprintf(_("'%s' => %s"),
- parent_layer->get_non_empty_description().c_str(),
- value_node->link_local_name(value_desc.get_index()).c_str());
- else
- name = value_node->link_local_name(value_desc.get_index());
- }
-
- return strprintf(_("Set %s"), name.c_str());
+ return strprintf(_("Set %s"),
+ value_desc
+ ? value_desc.get_description().c_str()
+ : _("ValueDesc"));
}
Action::ParamVocab
(value_desc.get_index()==4 || value_desc.get_index()==5) &&
(*value_desc.get_parent_value_node())(time).get(BLinePoint()).get_split_tangent_flag()==false)
{
- printf("a tangent got changed - #%d\n", value_desc.get_index()-3);
-
{
ValueNode_Composite::Handle parent_value_node;
parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
Vector t1((*parent_value_node->get_link("t1"))(time));
Vector t2((*parent_value_node->get_link("t2"))(time));
- printf("current values are: t1(%.2f, %2.f) t2(%.2f, %.2f)\n", t1[0], t1[1], t2[0], t2[1]);
}
if (value_desc.get_index()==4) {
- printf("copying change to tangent 2\n");
ValueNode_Composite::Handle parent_value_node;
parent_value_node=parent_value_node.cast_dynamic(value_desc.get_parent_value_node());
assert(parent_value_node);
- Action::Handle action(Action::create("value_desc_set"));
+ Action::Handle action(Action::create("ValueDescSet"));
if(!action)
- throw Error(_("Unable to find action value_desc_set (bug)"));
+ throw Error(_("Unable to find action ValueDescSet (bug)"));
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
{
ValueDesc reference_value_desc(ValueNode_Reference::Handle::cast_dynamic(value_desc.get_value_node()),0);
- Action::Handle action(Action::create("value_desc_set"));
+ Action::Handle action(Action::create("ValueDescSet"));
if(!action)
- throw Error(_("Unable to find action value_desc_set (bug)"));
+ throw Error(_("Unable to find action ValueDescSet (bug)"));
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
{
ValueDesc component_value_desc(ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()),i);
- Action::Handle action(Action::create("value_desc_set"));
+ Action::Handle action(Action::create("ValueDescSet"));
if(!action)
- throw Error(_("Unable to find action value_desc_set (bug)"));
+ throw Error(_("Unable to find action ValueDescSet (bug)"));
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
{
ValueDesc component_value_desc(ValueNode_RadialComposite::Handle::cast_dynamic(value_desc.get_value_node()),i);
- Action::Handle action(Action::create("value_desc_set"));
+ Action::Handle action(Action::create("ValueDescSet"));
if(!action)
- throw Error(_("Unable to find action value_desc_set (bug)"));
+ throw Error(_("Unable to find action ValueDescSet (bug)"));
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
{
// we are splitting tangents
- Action::Handle action(Action::create("value_desc_set"));
+ Action::Handle action(Action::create("ValueDescSet"));
if(!action)
- throw Error(_("Unable to find action value_desc_set (bug)"));
+ throw Error(_("Unable to find action ValueDescSet (bug)"));
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
(Vector)((*parent_value_node->get_link("t2"))(time))) / 2);
{
- Action::Handle action(Action::create("value_desc_set"));
+ Action::Handle action(Action::create("ValueDescSet"));
if(!action)
- throw Error(_("Unable to find action value_desc_set (bug)"));
+ throw Error(_("Unable to find action ValueDescSet (bug)"));
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
}
{
- Action::Handle action(Action::create("value_desc_set"));
+ Action::Handle action(Action::create("ValueDescSet"));
if(!action)
- throw Error(_("Unable to find action value_desc_set (bug)"));
+ throw Error(_("Unable to find action ValueDescSet (bug)"));
action->set_param("canvas",get_canvas());
action->set_param("canvas_interface",get_canvas_interface());
}
else
{
- action=Action::create("value_node_replace");
+ action=Action::create("ValueNodeReplace");
action->set_param("dest",value_desc.get_value_node());
action->set_param("src",ValueNode::Handle(value_node));
}