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
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === H E A D E R S ======================================================= */
32 #include "valuenode_reference.h"
33 #include "valuenode_const.h"
38 /* === U S I N G =========================================================== */
42 using namespace synfig;
44 /* === M A C R O S ========================================================= */
46 /* === G L O B A L S ======================================================= */
48 /* === P R O C E D U R E S ================================================= */
50 /* === M E T H O D S ======================================================= */
52 ValueNode_Reference::ValueNode_Reference(const ValueBase::Type &x):
57 ValueNode_Reference::ValueNode_Reference(const ValueNode::Handle &x):
58 LinkableValueNode(x->get_type())
64 ValueNode_Reference::create(const ValueBase &x)
66 return new ValueNode_Reference(ValueNode_Const::create(x));
70 ValueNode_Reference::create_new()const
72 return new ValueNode_Reference(get_type());
75 ValueNode_Reference::~ValueNode_Reference()
81 ValueNode_Reference::set_link_vfunc(int i,ValueNode::Handle value)
83 assert(i>=0 && i<link_count());
87 case 0: CHECK_TYPE_AND_SET_VALUE(link_, get_type());
92 ValueNode::LooseHandle
93 ValueNode_Reference::get_link_vfunc(int i)const
95 assert(i>=0 && i<link_count());
101 ValueNode_Reference::link_count()const
107 ValueNode_Reference::link_local_name(int i)const
109 assert(i>=0 && i<link_count());
113 case 0: return _("Link");
119 ValueNode_Reference::link_name(int i)const
121 assert(i>=0 && i<link_count());
125 case 0: return "link";
131 ValueNode_Reference::get_link_index_from_name(const String &name)const
136 throw Exception::BadLinkName(name);
140 ValueNode_Reference::operator()(Time t)const
147 ValueNode_Reference::get_name()const
153 ValueNode_Reference::get_local_name()const
155 return _("Reference");
159 ValueNode_Reference::check_type(ValueBase::Type type)