27 #ifndef __SYNFIG_LAYER_H
28 #define __SYNFIG_LAYER_H
36 #include <sigc++/signal.h>
37 #include <sigc++/connection.h>
50 #define RENDER_TRANSFORMED_IF_NEED(file, line) \
51 if (!renddesc.get_transformation_matrix().is_identity()) \
52 return render_transformed(this, context, surface, quality, renddesc, cb, file, line);
57 #define SYNFIG_LAYER_MODULE_EXT \
59 static const char name__[], version__[], cvs_id__[], local_name__[], category__[]; \
60 static Layer *create();
63 #define SYNFIG_LAYER_SET_NAME(class,x) \
64 const char class::name__[]=x
67 #define SYNFIG_LAYER_SET_LOCAL_NAME(class,x) \
68 const char class::local_name__[]=x;
71 #define SYNFIG_LAYER_SET_CATEGORY(class,x) \
72 const char class::category__[]=x
75 #define SYNFIG_LAYER_SET_VERSION(class,x) \
76 const char class::version__[]=x
79 #define SYNFIG_LAYER_SET_CVS_ID(class,x) \
80 const char class::cvs_id__[]=x
83 #define SYNFIG_LAYER_INIT(class) \
84 synfig::Layer* class::create() \
90 #define IMPORT_VALUE(x) \
91 if (#x=="param_"+param && x.get_type()==value.get_type()) \
99 #define IMPORT_VALUE_PLUS_BEGIN(x) \
100 if (#x=="param_"+param && x.get_type()==value.get_type()) \
104 #define IMPORT_VALUE_PLUS_END \
108 #define IMPORT_VALUE_PLUS(x,y) \
109 IMPORT_VALUE_PLUS_BEGIN(x) \
111 IMPORT_VALUE_PLUS_END
114 #define EXPORT_VALUE(x) \
115 if (#x=="param_"+param) \
117 synfig::ValueBase ret; \
123 #define EXPORT_NAME() \
124 if (param=="Name" || param=="name" || param=="name__") \
126 else if (param=="local_name__") \
127 return dgettext("synfig",local_name__);
130 #define EXPORT_VERSION() \
131 if (param=="Version" || param=="version" || param=="version__") \
136 #define CATEGORY_DO_NOT_USE "Do Not Use"
139 #define SET_INTERPOLATION_DEFAULTS() \
141 Vocab vocab(get_param_vocab()); \
142 Vocab::const_iterator viter; \
143 for(viter=vocab.begin();viter!=vocab.end();viter++) \
145 ValueBase v=get_param(viter->get_name()); \
146 v.set_interpolation(viter->get_interpolation()); \
147 set_param(viter->get_name(), v); \
152 #define SET_STATIC_DEFAULTS() \
154 Vocab vocab(get_param_vocab()); \
155 Vocab::const_iterator viter; \
156 for(viter=vocab.begin();viter!=vocab.end();viter++) \
158 ValueBase v=get_param(viter->get_name()); \
159 v.set_static(viter->get_static()); \
160 set_param(viter->get_name(), v); \
172 typedef Vector
Point;
182 class ProgressCallback;
183 class IndependentContext;
230 local_name(local_name),
243 typedef std::map<String,BookEntry>
Book;
292 bool exclude_from_rendering_;
295 etl::loose_handle<Canvas> canvas_;
307 mutable Time dirty_time_;
316 sigc::connection parent_death_connect_;
325 sigc::signal<void> signal_status_changed_;
328 sigc::signal<void,String> signal_param_changed_;
331 sigc::signal<void> signal_description_changed_;
334 sigc::signal<void, int, etl::handle<Canvas> > signal_moved_;
336 sigc::signal<void, String> signal_added_to_group_;
338 sigc::signal<void, String> signal_removed_from_group_;
356 sigc::signal<void, int, etl::handle<Canvas> >&
signal_moved() {
return signal_moved_; }
444 void set_canvas(etl::loose_handle<Canvas> canvas);
582 virtual Handle clone(etl::loose_handle<Canvas> canvas,
const GUID& deriv_guid=
GUID())
const;