loader

loader

Synopsis

GObject *           mcp_plugin_ref_nth_object           (guint n);
#define             MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL
void                mcp_set_debug                       (gboolean debug);
void                mcp_add_object                      (gpointer object);
void                mcp_read_dir                        (const gchar *path);
const GList *       mcp_list_objects                    (void);

Description

Details

mcp_plugin_ref_nth_object ()

GObject *           mcp_plugin_ref_nth_object           (guint n);

Implemented by each plugin (not implemented in this library!) as a hook point; it will be called repeatedly with an increasing argument, and must return a GObject reference each time, until it returns NULL.

As currently implemented, these objects are never unreferenced.

n :

object number, starting from 0

Returns :

a new reference to a GObject, or NULL if n is at least the number of objects supported by this plugin

MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL

#define MCP_PLUGIN_REF_NTH_OBJECT_SYMBOL "mcp_plugin_ref_nth_object"


mcp_set_debug ()

void                mcp_set_debug                       (gboolean debug);

debug :


mcp_add_object ()

void                mcp_add_object                      (gpointer object);

As currently implemented, these objects are never unreferenced.

Add an object to the list of plugin objects.

object :

an object implementing one or more plugin interfaces

mcp_read_dir ()

void                mcp_read_dir                        (const gchar *path);

Read plugins from the given path. Any file with suffix G_MODULE_SUFFIX is considered as a potential plugin, and loaded; if it contains the symbol mcp_plugin_ref_nth_object(), it's made resident, then that symbol is called as a function.

path :

full path to a plugins directory

mcp_list_objects ()

const GList *       mcp_list_objects                    (void);

Return a list of objects that might implement plugin interfaces.

Returns :

a constant list of plugin objects