![]() |
![]() |
![]() |
[Insert name here] Reference Manual | ![]() |
---|---|---|---|---|
#define R_PLUGIN_TYPE RPluginPrivate; void (*RPluginInit) (RPlugin *plugin); RPluginAction; RPlugin; RPlugin* r_plugin_new (void); void r_plugin_free (RPlugin *plugin); gboolean r_plugin_load (RPlugin *plugin, const gchar *file); void r_plugin_set_obj (RPlugin *plugin, gpointer obj); gpointer r_plugin_get_obj (RPlugin *plugin); void r_plugin_add_action (RPlugin *plugin, RPluginAction *action); void r_plugin_add_filter (RPlugin *plugin, RFilter *filter); gpointer r_plugin_get_handle (RPlugin *plugin, gchar *name); GList* r_plugin_get_filters (RPlugin *plugin); gchar* r_plugin_get_name (RPlugin *plugin); gchar* r_plugin_get_info (RPlugin *plugin); gchar* r_plugin_get_file_name (RPlugin *plugin); gboolean r_plugin_is_configurable (RPlugin *plugin); void r_plugin_run_configure_gui (RPlugin *plugin);
typedef struct { gchar* name; gchar* handle; } RPluginAction;
RPluginAction is used to manage the action that a plugin can make
examples (from rubrica's plugin): action->name = g_strdup("read"); action->handle = (gpointer) r_rubrica_open_file;
gboolean r_plugin_load (RPlugin *plugin, const gchar *file);
load the plugin from the given file
void r_plugin_set_obj (RPlugin *plugin, gpointer obj);
use this function to set the real plugin. This function is called by the plugin (see rubrica, csv, vcard plugins source) during initialization. The obj is returned by a g_object_new call and is the object that makes work.
plugin : |
a RPlugin |
obj : |
a gpointer |
gpointer r_plugin_get_obj (RPlugin *plugin);
Get the real plugin (a gobject)
plugin : |
a RPlugin |
Returns : | a gpointer |
void r_plugin_add_action (RPlugin *plugin, RPluginAction *action);
add a RPluginAction to the plugin.
plugin : |
a RPlugin |
action : |
a RPluginAction |
void r_plugin_add_filter (RPlugin *plugin, RFilter *filter);
Add a RFilter to the plugin
gpointer r_plugin_get_handle (RPlugin *plugin, gchar *name);
Get the handle with the given name
GList* r_plugin_get_filters (RPlugin *plugin);
Get the plugin's file filters
gchar* r_plugin_get_name (RPlugin *plugin);
Get the plugin's name
plugin : |
a RPlugin |
Returns : | a gchar* |
gchar* r_plugin_get_info (RPlugin *plugin);
Get info about the plugin
plugin : |
a RPlugin |
Returns : | a gchar* |
gchar* r_plugin_get_file_name (RPlugin *plugin);
Get the plugin's file name
plugin : |
a RPlugin |
Returns : | a gchar* |
gboolean r_plugin_is_configurable (RPlugin *plugin);
Check if the plugin is configurable