1 /* === S Y N F I G ========================================================= */
3 ** \brief Template Header
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
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.
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.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_NODEBASE_H
26 #define __SYNFIG_NODEBASE_H
28 /* === H E A D E R S ======================================================= */
33 #include <sigc++/slot.h>
35 /* === M A C R O S ========================================================= */
37 #define PX_DEFINE_DATA(name,type) \
38 PX_DEFINE_FUNC_CONST0(get_##name, type) \
39 PX_DEFINE_FUNC1(set_##name, void, type)
41 #define PX_DEFINE_FUNC0(name,ret) \
42 sigc::slot< ret > _slot_##name; \
44 return _slot_##name(); \
47 #define PX_DEFINE_FUNC1(name,ret,type) \
48 sigc::slot< ret, type > _slot_##name; \
50 return _slot_##name(v1); \
52 #define PX_DEFINE_FUNC2(name,ret,type1,type2) \
53 sigc::slot< ret, type1, type2 > _slot_##name; \
54 ret name(type1 v1, type2 v2) { \
55 return _slot_##name(v1,v2); \
57 #define PX_DEFINE_FUNC_CONST0(name,ret) \
58 sigc::slot< ret > _slot_##name##_const; \
60 return _slot_##name##_const(); \
63 /* === T Y P E D E F S ===================================================== */
65 /* === C L A S S E S & S T R U C T S ======================================= */
73 class NodeBase : public Protocol
77 PX_DEFINE_DATA(guid, GUID)
79 PX_DEFINE_FUNC2(func_test, float, int, int)
81 PX_DEFINE_DATA(id, String)
83 PX_DEFINE_DATA(root, NodeHandle)
85 PX_DEFINE_FUNC0(signal_changed, sigc::signal<void>)
86 PX_DEFINE_FUNC0(signal_deleted, sigc::signal<void>)
88 PX_DEFINE_FUNC_CONST0(get_parents, const NodeList)
89 PX_DEFINE_FUNC_CONST0(get_children, const NodeList)
91 PX_DEFINE_FUNC1(query_children, NodeList, Query)
93 }; // END of class Proto::NodeBase
95 }; // END of namespace Proto
96 }; // END of namespace synfig
98 /* === E N D =============================================================== */