Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-core / tags / synfig_0_61_04 / synfig-core / src / synfig / activepoint.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file activepoint.h
3 **      \brief Template Header
4 **
5 **      $Id: activepoint.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., 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_ACTIVEPOINT_H
26 #define __SYNFIG_ACTIVEPOINT_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include "time.h"
31 #include "uniqueid.h"
32 #include <ETL/handle>
33
34 /* === M A C R O S ========================================================= */
35
36 /* === T Y P E D E F S ===================================================== */
37
38 /* === C L A S S E S & S T R U C T S ======================================= */
39
40 namespace synfig {
41 class GUID;
42 class ValueNode;
43         
44 struct Activepoint : public UniqueID
45 {
46 private:
47         etl::loose_handle<ValueNode> parent_;
48         int index;
49         
50 public:
51         //! Time of the activepoint
52         Time time;
53         
54         //! Priority
55         int priority;
56
57         //! Does this activepoint turn the entry on, or off?
58         bool state;
59                 
60         bool operator<(const Activepoint& rhs) { return time<rhs.time; }
61         bool operator<(const Time& rhs) { return time<rhs; }
62         
63         Activepoint(const Time &time, const bool &state, int p=0): time(time), priority(p),state(state) { }
64         Activepoint() { }
65         
66         const Time& get_time()const { return time; }
67         void set_time(const Time& x) { time=x; }
68
69         bool get_state()const { return state; }
70         void set_state(bool x) { state=x; }
71
72         int get_priority()const { return priority; }
73         void set_priority(int x) { priority=x; }
74
75         const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
76         void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }        
77         
78         int get_parent_index()const { return index; }
79         void set_parent_index(int x) { index=x; }
80         
81         GUID get_guid()const;
82 }; // END of struct ValueNode_BLine::Activepoint
83
84 }; // END of namespace synfig
85
86 /* === E N D =============================================================== */
87
88 #endif