From 5e677d2c4e2cafa973db8bd44010fc7f9deb9fc1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 11 Oct 2007 01:54:06 +0000 Subject: [PATCH] Add BEGIN_VALUENODES(), VALUENODE(), and END_VALUENODES() macros to allow modules to define new valuenode types. git-svn-id: http://svn.voria.com/code@907 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/module.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/synfig-core/trunk/src/synfig/module.h b/synfig-core/trunk/src/synfig/module.h index 071e8e7..c1126eb 100644 --- a/synfig-core/trunk/src/synfig/module.h +++ b/synfig-core/trunk/src/synfig/module.h @@ -99,7 +99,11 @@ //! 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(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 \ + (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__; @@ -116,6 +120,17 @@ //! 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(&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 } -- 2.7.4