synfig-core  1.0.3
Classes | Namespaces | Macros
module.h File Reference

Base class for all libraries modules. More...

#include "general.h"
#include <ETL/handle>
#include <map>
#include "string.h"
#include "releases.h"
#include <utility>
#include "vector.h"
#include "color.h"
#include "layer.h"
#include "canvas.h"

Go to the source code of this file.

Classes

class  synfig::Module

Namespaces

namespace  synfig
 Where every function and class of the synfig library can be found.

Macros

#define MODULE_DESC_BEGIN(x)   struct x##_modclass : public synfig::Module { x##_modclass(synfig::ProgressCallback *callback=NULL);
 Marks the start of a module description.
#define MODULE_NAME(x)   virtual const char * Name() { return x; }
 Sets the localized name of the module.
#define MODULE_DESCRIPTION(x)   virtual const char * Desc() { return x; }
 Sets a localized description of the module.
#define MODULE_AUTHOR(x)   virtual const char * Author() { return x; }
 Sets the name of the module's author.
#define MODULE_VERSION(x)   virtual const char * Version() { return x; }
 Sets the version string for the module.
#define MODULE_COPYRIGHT(x)   virtual const char * Copyright() { return x; }
 Sets the copyright string for the module.
#define MODULE_CONSTRUCTOR(x)   bool constructor_(synfig::ProgressCallback *cb) { return x(cb); }
 Describes the module's construction function.
#define MODULE_DESTRUCTOR(x)   virtual void destructor_() { return x(); }
 Describes the module's destruction function.
#define MODULE_DESC_END   };
 Marks the end of a module description.
#define MODULE_INVENTORY_BEGIN(x)
 Marks the start of a module's inventory.
#define BEGIN_LAYERS   {
 Marks the start of the layers in the module's inventory.
#define LAYER(class)
 DEPRECATED - use INCLUDE_LAYER(class)
#define LAYER_ALIAS(class, alias)
 Register a Layer class in the book of layers with an alias.
#define END_LAYERS   }
 Marks the end of the layers in the module's inventory.
#define BEGIN_TARGETS   {
 Marks the start of the targets in the module's inventory.
#define TARGET(x)
#define TARGET_EXT(x, y)   synfig::Target::ext_book()[synfig::String(y)]=x::name__;
#define END_TARGETS   }
 Marks the end of the targets in the module's inventory.
#define BEGIN_IMPORTERS   {
 Marks the start of the importers in the module's inventory.
#define IMPORTER_EXT(x, y)   synfig::Importer::book()[synfig::String(y)]=synfig::Importer::BookEntry(x::create, x::supports_file_system_wrapper__);
 Register an Importer class in the book of importers by one file extension string.
#define IMPORTER(x)   IMPORTER_EXT(x,x::ext__)
 Register an Importer class in the book of importers by the default extension.
#define CAIROIMPORTER_EXT(x, y)   synfig::CairoImporter::book()[synfig::String(y)]=synfig::CairoImporter::BookEntry(x::create, x::supports_file_system_wrapper__);
 Register an Importer class in the book of importers by one file extension string.
#define CAIROIMPORTER(x)   CAIROIMPORTER_EXT(x,x::ext__)
 Register an CairoImporter class in the book of importers by the default extension.
#define END_IMPORTERS   }
 Marks the end of the importers in the module's inventory.
#define BEGIN_VALUENODES   { synfig::LinkableValueNode::Book &book(synfig::LinkableValueNode::book());
 Marks the start of the valuenodes in the module's inventory.
#define VALUENODE(class, name, local, version)
 Registers a valuenode that is defined in the module's inventory.
#define END_VALUENODES   }
 Marks the end of the valuenodes in the module's inventory.
#define MODULE_INVENTORY_END   }
 Marks the end of a module's inventory.

Detailed Description

Base class for all libraries modules.

$Id$

Macro Definition Documentation

#define MODULE_DESC_BEGIN (   x)    struct x##_modclass : public synfig::Module { x##_modclass(synfig::ProgressCallback *callback=NULL);

Marks the start of a module description.

#define MODULE_NAME (   x)    virtual const char * Name() { return x; }

Sets the localized name of the module.

#define MODULE_DESCRIPTION (   x)    virtual const char * Desc() { return x; }

Sets a localized description of the module.

#define MODULE_AUTHOR (   x)    virtual const char * Author() { return x; }

Sets the name of the module's author.

#define MODULE_VERSION (   x)    virtual const char * Version() { return x; }

Sets the version string for the module.

#define MODULE_COPYRIGHT (   x)    virtual const char * Copyright() { return x; }

Sets the copyright string for the module.

#define MODULE_CONSTRUCTOR (   x)    bool constructor_(synfig::ProgressCallback *cb) { return x(cb); }

Describes the module's construction function.

#define MODULE_DESTRUCTOR (   x)    virtual void destructor_() { return x(); }

Describes the module's destruction function.

#define MODULE_DESC_END   };

Marks the end of a module description.

#define MODULE_INVENTORY_BEGIN (   x)
Value:
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*/) {

Marks the start of a module's inventory.

#define BEGIN_LAYERS   {

Marks the start of the layers in the module's inventory.

#define LAYER (   class)
Value:
synfig::Layer::BookEntry(class::create, \
class::name__, \
dgettext("synfig", class::local_name__), \
class::category__, \
class::cvs_id__, \
class::version__));

DEPRECATED - use INCLUDE_LAYER(class)

Register a Layer class in the book of layers

#define LAYER_ALIAS (   class,
  alias 
)
Value:
synfig::Layer::BookEntry(class::create, \
alias, \
alias, \
class::cvs_id__, \
class::version__));

Register a Layer class in the book of layers with an alias.

#define END_LAYERS   }

Marks the end of the layers in the module's inventory.

#define BEGIN_TARGETS   {

Marks the start of the targets in the module's inventory.

#define TARGET (   x)
Value:
synfig::Target::book()[synfig::String(x::name__)].factory = \
reinterpret_cast<synfig::Target::Factory> (x::create); \
synfig::Target::book()[synfig::String(x::name__)].filename = \
synfig::String(x::ext__); \
synfig::Target::book()[synfig::String(x::name__)].target_param = \
#define TARGET_EXT (   x,
 
)    synfig::Target::ext_book()[synfig::String(y)]=x::name__;
#define END_TARGETS   }

Marks the end of the targets in the module's inventory.

#define BEGIN_IMPORTERS   {

Marks the start of the importers in the module's inventory.

#define IMPORTER_EXT (   x,
 
)    synfig::Importer::book()[synfig::String(y)]=synfig::Importer::BookEntry(x::create, x::supports_file_system_wrapper__);

Register an Importer class in the book of importers by one file extension string.

#define IMPORTER (   x)    IMPORTER_EXT(x,x::ext__)

Register an Importer class in the book of importers by the default extension.

#define CAIROIMPORTER_EXT (   x,
 
)    synfig::CairoImporter::book()[synfig::String(y)]=synfig::CairoImporter::BookEntry(x::create, x::supports_file_system_wrapper__);

Register an Importer class in the book of importers by one file extension string.

#define CAIROIMPORTER (   x)    CAIROIMPORTER_EXT(x,x::ext__)

Register an CairoImporter class in the book of importers by the default extension.

#define END_IMPORTERS   }

Marks the end of the importers in the module's inventory.

#define BEGIN_VALUENODES   { synfig::LinkableValueNode::Book &book(synfig::LinkableValueNode::book());

Marks the start of the valuenodes in the module's inventory.

#define VALUENODE (   class,
  name,
  local,
  version 
)
Value:
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;

Registers a valuenode that is defined in the module's inventory.

#define END_VALUENODES   }

Marks the end of the valuenodes in the module's inventory.

#define MODULE_INVENTORY_END   }

Marks the end of a module's inventory.