Remove spaces and tabs at end of lines.
[synfig.git] / synfig-core / trunk / src / synfig / nodebase.h
1 #if 0                                                   // this file is not used
2 /* === S Y N F I G ========================================================= */
3 /*!     \file nodebase.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_NODEBASE_H
27 #define __SYNFIG_NODEBASE_H
28
29 /* === H E A D E R S ======================================================= */
30
31 #include "protocol.h"
32 #include "string.h"
33 #include "guid.h"
34 #include <sigc++/slot.h>
35
36 /* === M A C R O S ========================================================= */
37
38 #define PX_DEFINE_DATA(name,type) \
39     PX_DEFINE_FUNC_CONST0(get_##name, type) \
40     PX_DEFINE_FUNC1(set_##name, void, type)
41
42 #define PX_DEFINE_FUNC0(name,ret) \
43         sigc::slot< ret > _slot_##name; \
44         ret name() { \
45                 return _slot_##name(); \
46         }
47
48 #define PX_DEFINE_FUNC1(name,ret,type) \
49         sigc::slot< ret, type > _slot_##name; \
50         ret name(type v1) { \
51                 return _slot_##name(v1); \
52         }
53 #define PX_DEFINE_FUNC2(name,ret,type1,type2) \
54         sigc::slot< ret, type1, type2 > _slot_##name; \
55         ret name(type1 v1, type2 v2) { \
56                 return _slot_##name(v1,v2); \
57         }
58 #define PX_DEFINE_FUNC_CONST0(name,ret) \
59         sigc::slot< ret > _slot_##name##_const; \
60         ret name()const { \
61                 return _slot_##name##_const(); \
62         }
63
64 /* === T Y P E D E F S ===================================================== */
65
66 /* === C L A S S E S & S T R U C T S ======================================= */
67
68 namespace synfig {
69 namespace Proto {
70
71 typedef int Query;
72 typedef int NodeList;
73
74 class NodeBase : public Protocol
75 {
76 public:
77
78         PX_DEFINE_DATA(guid, GUID)
79
80         PX_DEFINE_FUNC2(func_test, float, int, int)
81
82         PX_DEFINE_DATA(id, String)
83
84         PX_DEFINE_DATA(root, NodeHandle)
85
86         PX_DEFINE_FUNC0(signal_changed, sigc::signal<void>)
87         PX_DEFINE_FUNC0(signal_deleted, sigc::signal<void>)
88
89         PX_DEFINE_FUNC_CONST0(get_parents, NodeList)
90         PX_DEFINE_FUNC_CONST0(get_children, NodeList)
91
92         PX_DEFINE_FUNC1(query_children, NodeList, Query)
93
94 }; // END of class Proto::NodeBase
95
96 }; // END of namespace Proto
97 }; // END of namespace synfig
98
99 /* === E N D =============================================================== */
100
101 #endif
102 #endif