1 /* === S Y N F I G ========================================================= */
2 /*! \file valuenode_reference.cpp
3 ** \brief Implementation of the "Reference" valuenode conversion.
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2008 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === H E A D E R S ======================================================= */
33 #include "valuenode_reference.h"
34 #include "valuenode_const.h"
39 /* === U S I N G =========================================================== */
43 using namespace synfig;
45 /* === M A C R O S ========================================================= */
47 /* === G L O B A L S ======================================================= */
49 /* === P R O C E D U R E S ================================================= */
51 /* === M E T H O D S ======================================================= */
53 ValueNode_Reference::ValueNode_Reference(const ValueBase::Type &x):
58 ValueNode_Reference::ValueNode_Reference(const ValueNode::Handle &x):
59 LinkableValueNode(x->get_type())
65 ValueNode_Reference::create(const ValueBase &x)
67 return new ValueNode_Reference(ValueNode_Const::create(x));
71 ValueNode_Reference::create_new()const
73 return new ValueNode_Reference(get_type());
76 ValueNode_Reference::~ValueNode_Reference()
82 ValueNode_Reference::set_link_vfunc(int i,ValueNode::Handle value)
84 assert(i>=0 && i<link_count());
88 case 0: CHECK_TYPE_AND_SET_VALUE(link_, get_type());
93 ValueNode::LooseHandle
94 ValueNode_Reference::get_link_vfunc(int i __attribute__ ((unused)))const
96 assert(i>=0 && i<link_count());
102 ValueNode_Reference::link_count()const
108 ValueNode_Reference::link_local_name(int i)const
110 assert(i>=0 && i<link_count());
114 case 0: return _("Link");
120 ValueNode_Reference::link_name(int i)const
122 assert(i>=0 && i<link_count());
126 case 0: return "link";
132 ValueNode_Reference::get_link_index_from_name(const String &name)const
137 throw Exception::BadLinkName(name);
141 ValueNode_Reference::operator()(Time t)const
148 ValueNode_Reference::get_name()const
154 ValueNode_Reference::get_local_name()const
156 return _("Reference");
160 ValueNode_Reference::check_type(ValueBase::Type type)