source: synfigstudio/trunk/fuentes/src/gui/valuelink.h @ 481

Last change on this file since 481 was 481, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 2.5 KB
Line 
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
37namespace studio {
38
39/* NOTE: DO NOT USE THE INDEX BASED INTERFACE... THINGS WILL CHANGE
40*/
41class ValueBaseLink : public synfig::LinkableValueNode
42{
43        typedef std::vector<ValueNode::Handle> list_type;
44        list_type       list;
45
46protected:
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
55public: //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
65public:
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
Note: See TracBrowser for help on using the repository browser.