Add BEGIN_VALUENODES(), VALUENODE(), and END_VALUENODES() macros to allow modules...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 11 Oct 2007 01:54:06 +0000 (01:54 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 11 Oct 2007 01:54:06 +0000 (01:54 +0000)
git-svn-id: http://svn.voria.com/code@907 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/module.h

index 071e8e7..c1126eb 100644 (file)
 //! Marks the start of the targets in the module's inventory
 #define BEGIN_TARGETS {
 
-#define TARGET(x) synfig::Target::book()[synfig::String(x::name__)]=std::pair<synfig::Target::Factory,synfig::String>(x::create,synfig::String(x::ext__));synfig::Target::ext_book()[synfig::String(x::ext__)]=x::name__;
+#define TARGET(x)                                                                                                                                                              \
+       synfig::Target::book()[synfig::String(x::name__)]=                                                                                      \
+               std::pair<synfig::Target::Factory,synfig::String>                                                                               \
+                       (x::create,synfig::String(x::ext__));                                                                                           \
+       synfig::Target::ext_book()[synfig::String(x::ext__)]=x::name__;
 
 #define TARGET_EXT(x,y) synfig::Target::ext_book()[synfig::String(y)]=x::name__;
 
 //! Marks the end of the importers in the module's inventory
 #define END_IMPORTERS }
 
+//! Marks the start of the valuenodes in the module's inventory
+#define BEGIN_VALUENODES { synfig::LinkableValueNode::Book &book(synfig::LinkableValueNode::book());
+
+#define VALUENODE(class,name,local)                                                                                                                            \
+       book[name].factory=reinterpret_cast<synfig::LinkableValueNode::Factory>(&class::create);        \
+       book[name].check_type=&class::check_type;                                                                                                       \
+       book[name].local_name=local;
+
+//! Marks the end of the valuenodes in the module's inventory
+#define END_VALUENODES }
+
 //! Marks the end of a module's inventory
 #define MODULE_INVENTORY_END   }