00001 #if 0 // this file is not used
00002
00022
00023
00024
00025
00026 #ifndef __SYNFIG_NODEBASE_H
00027 #define __SYNFIG_NODEBASE_H
00028
00029
00030
00031 #include "protocol.h"
00032 #include "string.h"
00033 #include "guid.h"
00034 #include <sigc++/slot.h>
00035
00036
00037
00038 #define PX_DEFINE_DATA(name,type) \
00039 PX_DEFINE_FUNC_CONST0(get_##name, type) \
00040 PX_DEFINE_FUNC1(set_##name, void, type)
00041
00042 #define PX_DEFINE_FUNC0(name,ret) \
00043 sigc::slot< ret > _slot_##name; \
00044 ret name() { \
00045 return _slot_##name(); \
00046 }
00047
00048 #define PX_DEFINE_FUNC1(name,ret,type) \
00049 sigc::slot< ret, type > _slot_##name; \
00050 ret name(type v1) { \
00051 return _slot_##name(v1); \
00052 }
00053 #define PX_DEFINE_FUNC2(name,ret,type1,type2) \
00054 sigc::slot< ret, type1, type2 > _slot_##name; \
00055 ret name(type1 v1, type2 v2) { \
00056 return _slot_##name(v1,v2); \
00057 }
00058 #define PX_DEFINE_FUNC_CONST0(name,ret) \
00059 sigc::slot< ret > _slot_##name##_const; \
00060 ret name()const { \
00061 return _slot_##name##_const(); \
00062 }
00063
00064
00065
00066
00067
00068 namespace synfig {
00069 namespace Proto {
00070
00071 typedef int Query;
00072 typedef int NodeList;
00073
00074 class NodeBase : public Protocol
00075 {
00076 public:
00077
00078 PX_DEFINE_DATA(guid, GUID)
00079
00080 PX_DEFINE_FUNC2(func_test, float, int, int)
00081
00082 PX_DEFINE_DATA(id, String)
00083
00084 PX_DEFINE_DATA(root, NodeHandle)
00085
00086 PX_DEFINE_FUNC0(signal_changed, sigc::signal<void>)
00087 PX_DEFINE_FUNC0(signal_deleted, sigc::signal<void>)
00088
00089 PX_DEFINE_FUNC_CONST0(get_parents, NodeList)
00090 PX_DEFINE_FUNC_CONST0(get_children, NodeList)
00091
00092 PX_DEFINE_FUNC1(query_children, NodeList, Query)
00093
00094 };
00095
00096 };
00097 };
00098
00099
00100
00101 #endif
00102 #endif