more updates
[synfig.git] / synfig-core / trunk / src / synfig / activepoint.h
1 /* === S I N F 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 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 __SINFG_ACTIVEPOINT_H
25 #define __SINFG_ACTIVEPOINT_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include "time.h"
30 #include "uniqueid.h"
31 #include <ETL/handle>
32
33 /* === M A C R O S ========================================================= */
34
35 /* === T Y P E D E F S ===================================================== */
36
37 /* === C L A S S E S & S T R U C T S ======================================= */
38
39 namespace sinfg {
40 class GUID;
41 class ValueNode;
42         
43 struct Activepoint : public UniqueID
44 {
45 private:
46         etl::loose_handle<ValueNode> parent_;
47         int index;
48         
49 public:
50         //! Time of the activepoint
51         Time time;
52         
53         //! Priority
54         int priority;
55
56         //! Does this activepoint turn the entry on, or off?
57         bool state;
58                 
59         bool operator<(const Activepoint& rhs) { return time<rhs.time; }
60         bool operator<(const Time& rhs) { return time<rhs; }
61         
62         Activepoint(const Time &time, const bool &state, int p=0): time(time), priority(p),state(state) { }
63         Activepoint() { }
64         
65         const Time& get_time()const { return time; }
66         void set_time(const Time& x) { time=x; }
67
68         bool get_state()const { return state; }
69         void set_state(bool x) { state=x; }
70
71         int get_priority()const { return priority; }
72         void set_priority(int x) { priority=x; }
73
74         const etl::loose_handle<ValueNode> &get_parent_value_node()const { return parent_; }
75         void set_parent_value_node(const etl::loose_handle<ValueNode> &x) { parent_=x; }        
76         
77         int get_parent_index()const { return index; }
78         void set_parent_index(int x) { index=x; }
79         
80         GUID get_guid()const;
81 }; // END of struct ValueNode_BLine::Activepoint
82
83 }; // END of namespace sinfg
84
85 /* === E N D =============================================================== */
86
87 #endif