moreupdates
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_subtract.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file valuenode_subtract.h
3 **      \brief Template Header
4 **
5 **      $Id: valuenode_subtract.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SYNFIG_VALUENODE_SUBTRACT_H
25 #define __SYNFIG_VALUENODE_SUBTRACT_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include "valuenode.h"
30
31 /* === M A C R O S ========================================================= */
32
33 /* === C L A S S E S & S T R U C T S ======================================= */
34
35 namespace synfig {
36
37 struct ValueNode_Subtract : public LinkableValueNode
38 {
39         typedef etl::handle<ValueNode_Subtract> Handle;
40         typedef etl::handle<const ValueNode_Subtract> ConstHandle;
41         
42 protected:
43
44         ValueNode_Subtract();
45
46 private:
47
48         ValueNode::RHandle ref_a;
49         ValueNode::RHandle ref_b;
50         ValueNode::RHandle scalar;
51
52 public:
53
54         virtual ~ValueNode_Subtract();
55
56 //      static Handle create(ValueBase::Type id=ValueBase::TYPE_NIL);
57
58         //! Sets the left-hand-side value_node
59         bool set_lhs(ValueNode::Handle a);
60
61         //! Gets the left-hand-side value_node
62         ValueNode::Handle get_lhs()const { return ref_a; }
63
64         //! Sets the right-hand-side value_node
65         bool set_rhs(ValueNode::Handle b);
66
67         //! Gets the right-hand-side value_node
68         ValueNode::Handle get_rhs()const { return ref_b; }
69
70         //! Sets the scalar value_node
71         bool set_scalar(ValueNode::Handle x);
72
73         //! Gets the scalar value_node
74         ValueNode::Handle get_scalar()const { return scalar; }
75
76         void set_scalar(Real x);
77
78         virtual bool set_link_vfunc(int i,ValueNode::Handle x);
79
80         virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
81
82         virtual int link_count()const;
83
84         virtual String link_local_name(int i)const;
85         virtual String link_name(int i)const;
86         virtual int get_link_index_from_name(const String &name)const;
87
88         virtual ValueBase operator()(Time t)const;
89
90         virtual String get_name()const;
91         virtual String get_local_name()const;
92
93 //      static bool check_type(const ValueBase::Type &type);
94
95         LinkableValueNode* create_new()const;
96
97 public:
98         using synfig::LinkableValueNode::get_link_vfunc;
99         using synfig::LinkableValueNode::set_link_vfunc;
100         static bool check_type(ValueBase::Type type);
101         static ValueNode_Subtract* create(const ValueBase &x=ValueBase());
102 }; // END of class ValueNode_Subtract
103
104 }; // END of namespace synfig
105
106 /* === E N D =============================================================== */
107
108 #endif