Revision 2184 PLUGIN.txt
| PLUGIN.txt (revision 2184) | ||
|---|---|---|
| 18 | 18 |
|
| 19 | 19 |
Plug-in can only access the functions of Sylpheed through the APIs provided |
| 20 | 20 |
with libsylpheed-plugin-0 and libsylph-0 library. |
| 21 |
|
|
| 22 |
There are two kinds of plug-in API. One is called directly from plug-ins, |
|
| 23 |
another one utilizes the signal mechanism of GObject and calls the callback |
|
| 24 |
functions on specific events. |
|
| 25 |
|
|
| 26 |
The plug-in system is implemented in libsylph/sylmain.[ch] and |
|
| 27 |
src/plugin.[ch]. |
|
| 28 |
|
|
| 29 |
Plug-in API |
|
| 30 |
=========== |
|
| 31 |
|
|
| 32 |
Used by Sylpheed |
|
| 33 |
---------------- |
|
| 34 |
|
|
| 35 |
------------------------------------------------------------------------- |
|
| 36 |
void syl_plugin_signal_connect (const gchar *name, GCallback callback, |
|
| 37 |
gpointer data); |
|
| 38 |
|
|
| 39 |
------------------------------------------------------------------------- |
|
| 40 |
void syl_plugin_signal_disconnect(gpointer func, gpointer data); |
|
| 41 |
|
|
| 42 |
------------------------------------------------------------------------- |
|
| 43 |
void syl_plugin_signal_emit(const gchar *name, ...); |
|
| 44 |
|
|
| 45 |
------------------------------------------------------------------------- |
|
| 46 |
gint syl_plugin_init_lib (void); |
|
| 47 |
|
|
| 48 |
------------------------------------------------------------------------- |
|
| 49 |
gint syl_plugin_load (const gchar *file); |
|
| 50 |
|
|
| 51 |
------------------------------------------------------------------------- |
|
| 52 |
gint syl_plugin_load_all (const gchar *dir); |
|
| 53 |
|
|
| 54 |
------------------------------------------------------------------------- |
|
| 55 |
void syl_plugin_unload_all (void); |
|
| 56 |
|
|
| 57 |
------------------------------------------------------------------------- |
|
| 58 |
GSList *syl_plugin_get_module_list (void); |
|
| 59 |
|
|
| 60 |
------------------------------------------------------------------------- |
|
| 61 |
SylPluginInfo *syl_plugin_get_info (GModule *module); |
|
| 62 |
|
|
| 63 |
------------------------------------------------------------------------- |
|
| 64 |
gboolean syl_plugin_check_version (GModule *module); |
|
| 65 |
|
|
| 66 |
------------------------------------------------------------------------- |
|
| 67 |
gint syl_plugin_add_symbol (const gchar *name, gpointer sym); |
|
| 68 |
|
|
| 69 |
------------------------------------------------------------------------- |
|
| 70 |
gpointer syl_plugin_lookup_symbol (const gchar *name); |
|
| 71 |
|
|
| 72 |
------------------------------------------------------------------------- |
|
| 73 |
|
|
| 74 |
|
|
| 75 |
Functions which must be implemented by plug-ins |
|
| 76 |
----------------------------------------------- |
|
| 77 |
|
|
| 78 |
------------------------------------------------------------------------- |
|
| 79 |
void plugin_load(void) |
|
| 80 |
|
|
| 81 |
------------------------------------------------------------------------- |
|
| 82 |
void plugin_unload(void) |
|
| 83 |
|
|
| 84 |
------------------------------------------------------------------------- |
|
| 85 |
SylPluginInfo *plugin_info(void) |
|
| 86 |
|
|
| 87 |
------------------------------------------------------------------------- |
|
| 88 |
gint plugin_interface_version(void) |
|
| 89 |
|
|
| 90 |
------------------------------------------------------------------------- |
|
| 91 |
|
|
| 92 |
|
|
| 93 |
Functions used by plug-ins |
|
| 94 |
-------------------------- |
|
| 95 |
|
|
| 96 |
Refer to plugin.h for the functions list. |
|
| 97 |
|
|
| 98 |
|
|
| 99 |
Signals list |
|
| 100 |
------------ |
|
| 101 |
|
|
| 102 |
* libsylpheed-plugin-0 |
|
| 103 |
|
|
| 104 |
Call syl_plugin_signal_connect() to use the following signals. |
|
| 105 |
|
|
| 106 |
Example: |
|
| 107 |
syl_plugin_signal_connect("plugin-load", G_CALLBACK(plugin_load_cb), data);
|
|
| 108 |
|
|
| 109 |
------------------------------------------------------------------------- |
|
| 110 |
void (* plugin_load) (GObject *obj, GModule *module); |
|
| 111 |
|
|
| 112 |
------------------------------------------------------------------------- |
|
| 113 |
void (* plugin_unload) (GObject *obj, GModule *module); |
|
| 114 |
|
|
| 115 |
------------------------------------------------------------------------- |
|
| 116 |
void (* folderview_menu_popup) (GObject *obj, gpointer ifactory); |
|
| 117 |
|
|
| 118 |
------------------------------------------------------------------------- |
|
| 119 |
|
|
| 120 |
* libsylph-0 |
|
| 121 |
|
|
| 122 |
------------------------------------------------------------------------- |
|
Also available in: Unified diff