visu_plugins

visu_plugins — Introduces the basic handling of plug-ins.

Synopsis

                    VisuPlugin;
void                (*VisuPluginFreeFunc)               (void);
const gchar *       (*VisuPluginInfoFunc)               (void);
gboolean            (*VisuPluginInitFunc)               (void);
const gchar *       visu_plugin_getAuthors              (VisuPlugin *plug);
const gchar *       visu_plugin_getDescription          (VisuPlugin *plug);
const gchar *       visu_plugin_getIconPath             (VisuPlugin *plug);
const gchar *       visu_plugin_getName                 (VisuPlugin *plug);
void                visu_plugin_initGtk                 (VisuPlugin *plug);
void                visu_plugins_free                   ();
GList *             visu_plugins_getListLoaded          ();
void                visu_plugins_init                   ();

Description

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

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 VisuPlugin;

Short way to address _VisuPlugin objects.


VisuPluginFreeFunc ()

void                (*VisuPluginFreeFunc)               (void);

This kind of method may exist in all plugins with the name '{module_name}Free'. It is called by V_Sim when it stops.

Since 3.7


VisuPluginInfoFunc ()

const gchar *       (*VisuPluginInfoFunc)               (void);

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.

VisuPluginInitFunc ()

gboolean            (*VisuPluginInitFunc)               (void);

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.

visu_plugin_getAuthors ()

const gchar *       visu_plugin_getAuthors              (VisuPlugin *plug);

Return a string with the list of authors.

plug :

a VisuPlugin object.

Returns :

a private string.

Since 3.6


visu_plugin_getDescription ()

const gchar *       visu_plugin_getDescription          (VisuPlugin *plug);

Return a string with the description of the plugin.

plug :

a VisuPlugin object.

Returns :

a private string.

Since 3.6


visu_plugin_getIconPath ()

const gchar *       visu_plugin_getIconPath             (VisuPlugin *plug);

Return a string with the path to find an icon representing the plugin.

plug :

a VisuPlugin object.

Returns :

a private string.

Since 3.6


visu_plugin_getName ()

const gchar *       visu_plugin_getName                 (VisuPlugin *plug);

Return a string with the name.

plug :

a VisuPlugin object.

Returns :

a private string.

Since 3.6


visu_plugin_initGtk ()

void                visu_plugin_initGtk                 (VisuPlugin *plug);

Run the initGtk() method of the plugin, if it exists.

plug :

a VisuPlugin object.

Since 3.6


visu_plugins_free ()

void                visu_plugins_free                   ();

Finalise the part of V_Sim related to plug-ins. Should not be called (called once by V_Sim on stopping only).

Since 3.7


visu_plugins_getListLoaded ()

GList *             visu_plugins_getListLoaded          ();

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. [element-type VisuPlugin][transfer none]

visu_plugins_init ()

void                visu_plugins_init                   ();

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.