27 #ifndef __SYNFIG_VALUENODE_H
28 #define __SYNFIG_VALUENODE_H
37 #include <ETL/stringf>
40 #include <sigc++/signal.h>
52 #define VALUENODE_CHECK_TYPE(type) \
54 if (get_type() == type_nil) { \
55 warning("%s:%d get_type() IS nil sometimes!", \
56 __FILE__, __LINE__); \
59 if (get_type() != type_nil && \
60 !(ValueBase::can_copy(value->get_type(), type)) && \
61 !PlaceholderValueNode::Handle::cast_dynamic(value)) { \
62 error(_("%s:%d wrong type for %s: need %s but got %s"), \
64 link_local_name(i).c_str(), \
65 type.description.local_name.c_str(), \
66 value->get_type().description.local_name.c_str() ); \
70 #define VALUENODE_SET_VALUE(variable) \
72 signal_child_changed()(i); \
73 signal_value_changed()(); \
76 #define CHECK_TYPE_AND_SET_VALUE(variable, type) \
77 VALUENODE_CHECK_TYPE(type) \
78 VALUENODE_SET_VALUE(variable)
87 class LinkableValueNode;
132 etl::loose_handle<Canvas> canvas_;
134 etl::loose_handle<Canvas> root_canvas_;
143 sigc::signal<void> signal_value_changed_;
146 sigc::signal<void,int*> signal_children_reordered_;
149 sigc::signal<void,int> signal_child_changed_;
152 sigc::signal<void,int> signal_child_removed_;
155 sigc::signal<void,int> signal_child_inserted_;
158 sigc::signal<void> signal_id_changed_;
260 int replace(etl::handle<ValueNode> x);
285 typedef etl::handle<PlaceholderValueNode>
Handle;
288 typedef etl::rhandle<PlaceholderValueNode>
RHandle;
326 typedef etl::handle<LinkableValueNode>
Handle;
332 typedef etl::rhandle<LinkableValueNode>
RHandle;
362 typedef std::map<String,BookEntry>
Book;
461 int placeholder_count_;