**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007, 2008 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
#include <ETL/handle>
#include <map>
#include "string.h"
+#include "releases.h"
#include <utility>
#include "vector.h"
#include "color.h"
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()
-//#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__));
+//! 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__), \
+ class::category__, \
+ 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 }
//! 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,version) \
+ book[name].factory=reinterpret_cast<synfig::LinkableValueNode::Factory>(&class::create); \
+ book[name].check_type=&class::check_type; \
+ book[name].local_name=local; \
+ book[name].release_version=version;
+
+//! 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 }
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<Module> Handle;
static bool subsys_init(const String &prefix);
static bool subsys_stop();
- static bool register_default_modules();
+ static void register_default_modules(ProgressCallback *cb=NULL);
static void Register(Handle mod);
static bool Register(const String &module_name, ProgressCallback *cb=NULL);