X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fmodule.h;h=6aab53aaa7a9d204ed12d97b4f055e04093f9662;hb=64591d2bbceaf68a64008a0044e2fef3454e44ac;hp=44872c2a65ff57aca3e162b391ec702266bdee28;hpb=70bcefce2ab011a11014f36fc129b473cc0bc61e;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/module.h b/synfig-core/trunk/src/synfig/module.h index 44872c2..6aab53a 100644 --- a/synfig-core/trunk/src/synfig/module.h +++ b/synfig-core/trunk/src/synfig/module.h @@ -2,7 +2,7 @@ /*! \file synfig/module.h ** \brief writeme ** -** $Id: module.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley @@ -75,23 +75,23 @@ synfig::Module* _##x##_LTX_new_instance(synfig::ProgressCallback *cb) \ { if(SYNFIG_CHECK_VERSION()){x##_modclass *mod=new x##_modclass(cb); mod->constructor_(cb); return mod; }\ if(cb)cb->error(#x": Unable to load module due to version mismatch."); return NULL; } \ - }; x##_modclass::x##_modclass(synfig::ProgressCallback *cb) { + }; x##_modclass::x##_modclass(synfig::ProgressCallback */*cb*/) { #else //! Marks the start of a module's inventory #define MODULE_INVENTORY_BEGIN(x) extern "C" { \ synfig::Module* x##_LTX_new_instance(synfig::ProgressCallback *cb) \ { if(SYNFIG_CHECK_VERSION()){x##_modclass *mod=new x##_modclass(cb); mod->constructor_(cb); return mod; }\ if(cb)cb->error(#x": Unable to load module due to version mismatch."); return NULL; } \ - }; x##_modclass::x##_modclass(synfig::ProgressCallback *cb) { + }; x##_modclass::x##_modclass(synfig::ProgressCallback */*cb*/) { #endif //! Marks the start of the layers in the module's inventory #define BEGIN_LAYERS { -//! DEPRECATED - use @INCLUDE_LAYER() +//! DEPRECATED - use #INCLUDE_LAYER(class) +#define LAYER(class) synfig::Layer::register_in_book(synfig::Layer::BookEntry(class::create,class::name__,dgettext("synfig",class::local_name__),dgettext("synfig",class::category__),class::cvs_id__,class::version__)); //#define LAYER(x) synfig::Layer::book()[synfig::String(x::name__)]=x::create; -#define LAYER(class) synfig::Layer::register_in_book(synfig::Layer::BookEntry(class::create,class::name__,class::local_name__,class::category__,class::cvs_id__,class::version__)); -#define LAYER_ALIAS(class,alias) synfig::Layer::register_in_book(synfig::Layer::BookEntry(class::create,alias,alias,_("Do Not Use"),class::cvs_id__,class::version__)); +#define LAYER_ALIAS(class,alias) synfig::Layer::register_in_book(synfig::Layer::BookEntry(class::create,alias,alias,CATEGORY_DO_NOT_USE,class::cvs_id__,class::version__)); //! Marks the end of the layers in the module's inventory #define END_LAYERS } @@ -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 } @@ -133,7 +148,7 @@ class ProgressCallback; class Module : public etl::shared_object { public: - bool constructor_(synfig::ProgressCallback *cb) { return true; } + bool constructor_(synfig::ProgressCallback */*cb*/) { return true; } virtual void destructor_() { } typedef etl::handle Handle;