|  |  |  | Pigment 0.3 Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
#include <pgm/pgm.h> #define PGM_PLUGIN_PATH_NAME gboolean (*PgmPluginInitFunc) (GTypeModule *module); gboolean (*PgmPluginShutdownFunc) (GTypeModule *module); PgmViewport * (*PgmPluginCreateFunc) (void); PgmPluginDesc; #define PGM_PLUGIN_DEFINE (init,shutdown,create,name,version,description,license,origin,author)
Various structs and macros used by Pigment for plugins handling.
Last reviewed on 2007-04-12 (0.1.5)
#define PGM_PLUGIN_PATH_NAME "PGM_PLUGIN_PATH"
The name of the plugin path environment variable name.
gboolean (*PgmPluginInitFunc) (GTypeModule *module);
A plugin should provide a pointer to a function of this type in the PgmPluginDesc struct. This function will be called to initialize the plugin.
| 
 | the GTypeModule to use in the init func to register your types
(with g_type_module_register_type()or PGM_DEFINE_DYNAMIC_TYPE or
PGM_DEFINE_DYNAMIC_TYPE_EXTENDED. | 
| Returns : | TRUEif the initialization successes,FALSEotherwise. | 
gboolean (*PgmPluginShutdownFunc) (GTypeModule *module);
A plugin should provide a pointer to a function of this type in the PgmPluginDesc struct. This function will be called to shutdown the plugin.
| 
 | the GTypeModule that was passed to the PgmPluginInitFunc function. | 
| Returns : | TRUEif the deinitialization successes,FALSEotherwise. | 
PgmViewport * (*PgmPluginCreateFunc) (void);
A plugin should provide a pointer to a function of this prototype in the
PgmPluginDesc struct. This function will be called by the user to create
the PgmViewport.
| Returns : | a new PgmViewport. | 
typedef struct {
  PgmPluginInitFunc      init;
  PgmPluginShutdownFunc  shutdown;
  PgmPluginCreateFunc    create;
  gchar                 *name;
  gchar                 *version;
  gchar                 *description;
  gchar                 *license;
  gchar                 *origin;
  gchar                 *author;
} PgmPluginDesc;
Pigment Plugin description structure.
| PgmPluginInitFunc  | the plugin initialization function pointer. | 
| PgmPluginShutdownFunc  | the plugin shutdown function pointer. | 
| PgmPluginCreateFunc  | the plugin create function pointer (returning a PgmViewport). | 
| gchar * | the plugin name. | 
| gchar * | the version string of Pigment that plugin was compiled for. | 
| gchar * | the plugin description. | 
| gchar * | the plugin license. | 
| gchar * | the plugin origin URL. | 
| gchar * | the plugin author. | 
#define PGM_PLUGIN_DEFINE(init,shutdown,create,name,version,description,license,origin,author)
Utility macro to create a PgmPluginDesc plugin description structure. This is the entry point for every Pigment plugin and it is highly recommended to use this macro to avoid common mistakes maxking entry point unusable.
| 
 | the plugin initialization function pointer. | 
| 
 | the plugin shutdown function pointer. | 
| 
 | the plugin creation function pointer (returning a PgmViewport). | 
| 
 | the plugin name. | 
| 
 | the version string of Pigment that plugin was compiled for. | 
| 
 | the plugin description. | 
| 
 | the plugin license. | 
| 
 | the plugin origin URL. | 
| 
 | the plugin author. |