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