Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_07_rc3 / src / gtkmm / valuelink.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file valuelink.h
3 **      \brief ValueBase Link Header
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2004 Adrian Bentley
9 **
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.
14 **
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.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIG_VALUELINK_H
26 #define __SYNFIG_VALUELINK_H
27
28 /* === H E A D E R S ======================================================= */
29 #include <synfig/valuenode.h>
30
31 /* === M A C R O S ========================================================= */
32
33 /* === T Y P E D E F S ===================================================== */
34
35 /* === C L A S S E S & S T R U C T S ======================================= */
36
37 namespace studio {
38
39 /* NOTE: DO NOT USE THE INDEX BASED INTERFACE... THINGS WILL CHANGE
40 */
41 class ValueBaseLink : public synfig::LinkableValueNode
42 {
43         typedef std::vector<ValueNode::Handle> list_type;
44         list_type       list;
45
46 protected:
47         //stuff I don't want
48         virtual bool set_link_vfunc(int /*i*/,synfig::ValueNode::Handle /*x*/) {return false;}
49         virtual LinkableValueNode* create_new()const {return 0;}
50
51         //new stuff I need
52         list_type::const_iterator findlink(synfig::ValueNode::Handle x) const;
53         list_type::iterator findlink(synfig::ValueNode::Handle x);
54
55 public: //linkable interface
56
57         //stuff I do want
58         virtual synfig::ValueNode::LooseHandle get_link_vfunc(int i)const;
59         virtual int link_count()const;
60
61         //I have to support the thing because it's too much work otherwise
62         virtual synfig::String link_local_name(int i)const;
63         virtual synfig::String link_name(int i)const;
64
65 public:
66         ValueBaseLink();
67         virtual ~ValueBaseLink();
68
69         //don't want
70         virtual int get_link_index_from_name(const synfig::String &name)const;
71
72         //new add and subtract stuff
73         virtual void add(synfig::ValueNode::Handle v);
74         virtual void remove(synfig::ValueNode::Handle v);
75
76 };
77
78 }; // END of namespace studio
79
80 /* === E N D =============================================================== */
81
82 #endif