Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-core / tags / 0.61.09 / src / synfig / activepoint.h
1 #include <stdio.h>
2 /* === S Y N F I G ========================================================= */
3 /*!     \file activepoint.h
4 **      \brief Template Header
5 **
6 **      $Id$
7 **
8 **      \legal
9 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 **      Copyright (c) 2007 Chris Moore
11 **
12 **      This package is free software; you can redistribute it and/or
13 **      modify it under the terms of the GNU General Public License as
14 **      published by the Free Software Foundation; either version 2 of
15 **      the License, or (at your option) any later version.
16 **
17 **      This package is distributed in the hope that it will be useful,
18 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
19 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 **      General Public License for more details.
21 **      \endlegal
22 */
23 /* ========================================================================= */
24
25 /* === S T A R T =========================================================== */
26
27 #ifndef __SYNFIG_ACTIVEPOINT_H
28 #define __SYNFIG_ACTIVEPOINT_H
29
30 /* === H E A D E R S ======================================================= */
31
32 #include "time.h"
33 #include "uniqueid.h"
34 #include <ETL/handle>
35
36 /* === M A C R O S ========================================================= */
37
38 /* === T Y P E D E F S ===================================================== */
39
40 /* === C L A S S E S & S T R U C T S ======================================= */
41
42 namespace synfig {
43 class GUID;
44 class ValueNode;
45
46 struct Activepoint : public UniqueID
47 {
48 private:
49         etl::loose_handle<ValueNode> parent_;
50         int index;
51
52 public:
53         //! Time of the activepoint
54         Time time;
55
56         //! Priority
57         int priority;
58
59         //! Does this activepoint turn the entry on, or off?
60         bool state;
61
62         bool operator<(const Activepoint& rhs) { return time<rhs.time; }
63         bool operator<(const Time& rhs) { return time<rhs; }
64
65         Activepoint(const Time &time, const bool &state, int p=0): time(time), priority(p),state(state) { }
66         //! \todo Should priority be initialized here, or elsewhere?  This avoids a valgrind warning for now.
67         Activepoint(): priority(0) { }
68
69         const Time& get_time()const { return time; }
70         void set_time(const Time& x) { time=x; }
71
72         bool get_state()const { return state; }
73         void set_state(bool x) { state=x; }
74
75         int get_priority()const { return priority; }
76         void set_priority(int x) { priority=x; }
77
78         const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
79         void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }
80
81         int get_parent_index()const { return index; }
82         void set_parent_index(int x) { index=x; }
83
84         GUID get_guid()const;
85 }; // END of struct ValueNode_BLine::Activepoint
86
87 }; // END of namespace synfig
88
89 /* === E N D =============================================================== */
90
91 #endif