## visu_plugins

visu_plugins — Introduces the basic handling of plug-ins.

## Synopsis

    typedef             VisuPlugin;
    gboolean            (*pluginsInitFunc)                  ();
    const gchar*        (*pluginsDescriptionFunc)           ();
    const gchar*        (*pluginsAuthorsFunc)               ();
    const gchar*        (*pluginsIconFunc)                  ();

    GList*              visuPluginsGet_listLoaded           ();

    void                visuPluginsInit                     ();

## Description

Plug-ins are made of shared library presenting some common routines. These routines are of kind:

- `pluginsInitFunc()`, such a routine is called at V_Sim startup. It should initialise all things required by the module. For instance, if the module is used to add a load method for atomic rendering, it should call `renderingAtomicAdd_loadMethod()` to declare itself to V_Sim.

- `pluginsDescriptionFunc()`, is used to get a short description of the plug-in.

- `pluginsAuthorsFunc()`, gives a list of authors for the plug-in.

- `pluginsIconFunc()`, returns a path where a small icon representing the plug-in can be found.

All these routines must be named using the name of the module. When the module is loaded into memory, V_Sim will try to find these methods and will store them into the VisuPlugin structure for future calls.

At the present time, only the Unix version is functional. Moreover, currently, no stable API is available from the main program. This should be corrected quickly.

## Details

### VisuPlugin

    typedef struct VisuPlugin_struct VisuPlugin;

Short way to address VisuPlugin_struct objects.

### pluginsInitFunc ()

    gboolean            (*pluginsInitFunc)                  ();

This kind of method should exist in all plugins with the name '{module_name}Init'. It is called by V_Sim when the module is loaded.

Returns : | TRUE if it loads correctly.

### pluginsDescriptionFunc ()

    const gchar*        (*pluginsDescriptionFunc)           ();

This kind of method should exist in all plugins it give a description of what the plugin does. It must be named '{module_name}Get_description'.

Returns : | a string in UTF-8 owned by the plugin.

### pluginsAuthorsFunc ()

    const gchar*        (*pluginsAuthorsFunc)               ();

This kind of method should exist in all plugins it give the list of the authors. It must be named '{module_name}Get_authors'.

Returns : | a string in UTF-8 owned by the plugin.

### pluginsIconFunc ()

    const gchar*        (*pluginsIconFunc)                  ();

This kind of method is not mandatory and it returns the path to a loadable icon of 32x32 to illustrate the plug-in.

Returns : | a path owned by the plug-in.

### visuPluginsGet_listLoaded ()

    GList*              visuPluginsGet_listLoaded           ();

On startup, plugins are loaded according to a list present in the configuration file. It is possible to access the list of all loaded plugins with this method.

Returns : | a GList owned by V_Sim of VisuPlugin objects.

### visuPluginsInit ()

    void                visuPluginsInit                     ();

Initialise this part of code. Should not be called (called once by V_Sim on startup only). It try to load all plugins found in the installation directory and in the user directory.