From 306f779883d2f8b633c7f6794db70a188d1b8d0a Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 13 Jul 2009 02:54:47 +0000 Subject: updated PLUGIN.txt. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2184 ee746299-78ed-0310-b773-934348b2243d --- PLUGIN.txt | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) (limited to 'PLUGIN.txt') diff --git a/PLUGIN.txt b/PLUGIN.txt index 60afa93c..73716651 100644 --- a/PLUGIN.txt +++ b/PLUGIN.txt @@ -18,3 +18,105 @@ startup. Plug-in can only access the functions of Sylpheed through the APIs provided with libsylpheed-plugin-0 and libsylph-0 library. + +There are two kinds of plug-in API. One is called directly from plug-ins, +another one utilizes the signal mechanism of GObject and calls the callback +functions on specific events. + +The plug-in system is implemented in libsylph/sylmain.[ch] and +src/plugin.[ch]. + +Plug-in API +=========== + +Used by Sylpheed +---------------- + +------------------------------------------------------------------------- +void syl_plugin_signal_connect (const gchar *name, GCallback callback, + gpointer data); + +------------------------------------------------------------------------- +void syl_plugin_signal_disconnect(gpointer func, gpointer data); + +------------------------------------------------------------------------- +void syl_plugin_signal_emit(const gchar *name, ...); + +------------------------------------------------------------------------- +gint syl_plugin_init_lib (void); + +------------------------------------------------------------------------- +gint syl_plugin_load (const gchar *file); + +------------------------------------------------------------------------- +gint syl_plugin_load_all (const gchar *dir); + +------------------------------------------------------------------------- +void syl_plugin_unload_all (void); + +------------------------------------------------------------------------- +GSList *syl_plugin_get_module_list (void); + +------------------------------------------------------------------------- +SylPluginInfo *syl_plugin_get_info (GModule *module); + +------------------------------------------------------------------------- +gboolean syl_plugin_check_version (GModule *module); + +------------------------------------------------------------------------- +gint syl_plugin_add_symbol (const gchar *name, gpointer sym); + +------------------------------------------------------------------------- +gpointer syl_plugin_lookup_symbol (const gchar *name); + +------------------------------------------------------------------------- + + +Functions which must be implemented by plug-ins +----------------------------------------------- + +------------------------------------------------------------------------- +void plugin_load(void) + +------------------------------------------------------------------------- +void plugin_unload(void) + +------------------------------------------------------------------------- +SylPluginInfo *plugin_info(void) + +------------------------------------------------------------------------- +gint plugin_interface_version(void) + +------------------------------------------------------------------------- + + +Functions used by plug-ins +-------------------------- + +Refer to plugin.h for the functions list. + + +Signals list +------------ + +* libsylpheed-plugin-0 + +Call syl_plugin_signal_connect() to use the following signals. + +Example: + syl_plugin_signal_connect("plugin-load", G_CALLBACK(plugin_load_cb), data); + +------------------------------------------------------------------------- +void (* plugin_load) (GObject *obj, GModule *module); + +------------------------------------------------------------------------- +void (* plugin_unload) (GObject *obj, GModule *module); + +------------------------------------------------------------------------- +void (* folderview_menu_popup) (GObject *obj, gpointer ifactory); + +------------------------------------------------------------------------- + +* libsylph-0 + +------------------------------------------------------------------------- -- cgit v1.2.3