diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-07-13 02:54:47 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-07-13 02:54:47 +0000 |
commit | 306f779883d2f8b633c7f6794db70a188d1b8d0a (patch) | |
tree | f9573c35cbcbdc79218d55b6261c4f79bcf428ac | |
parent | 1fd08c0e863122a6fe1a186cd357bf4ab2274a1f (diff) |
updated PLUGIN.txt.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2184 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | PLUGIN.ja.txt | 16 | ||||
-rw-r--r-- | PLUGIN.txt | 102 |
2 files changed, 115 insertions, 3 deletions
diff --git a/PLUGIN.ja.txt b/PLUGIN.ja.txt index cb3c02d8..12ef5fc6 100644 --- a/PLUGIN.ja.txt +++ b/PLUGIN.ja.txt @@ -26,6 +26,7 @@ GObject のシグナル機構を利用して、特定のイベントが発生し プラグイン機構は libsylph/sylmain.[ch] と src/plugin.[ch] で実装されて います。 + プラグイン API ============== @@ -116,8 +117,17 @@ SylPluginInfo *plugin_info(void) gint plugin_interface_version(void) プラグイン API のインタフェースのバージョンを Sylpheed に返すための -関数です。プラグインでは通常 SYL_PLUGIN_INTERFACE_VERSION を返し、 -Sylpheed ではこれが Sylpheed 本体側の値と一致するかどうかチェックします。 +関数です。プラグインでは通常は定数 SYL_PLUGIN_INTERFACE_VERSION を返し、 +Sylpheed ではこの値を Sylpheed 本体側の値と比較し、互換性のあるバージョン +かどうかをチェックします。 Sylpheed 本体のプラグインインタフェースバージョン +はプラグインのプラグインインタフェースバージョン以上である必要があります。 +また、インタフェースバージョンのメジャーバージョンが異なる場合も互換性は +なくなります。 + +例1: Sylpheed のプラグインインタフェースバージョンが 0x0102 で + プラグインのプラグインインタフェースバージョンが 0x0100 の場合 OK +例2: Sylpheed のプラグインインタフェースバージョンが 0x0102 で + プラグインのプラグインインタフェースバージョンが 0x0103 の場合 NG ------------------------------------------------------------------------- @@ -155,7 +165,7 @@ FolderView でコンテキストメニューをポップアップしたときに * libsylph-0 -以下のシグナルは g_signal_connect() の第一引数に syl_app_get() で取得した +以下のシグナルは g_signal_connect() の第一引数に syl_app_get() で得られる GObject を渡して使用します。 例: @@ -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 + +------------------------------------------------------------------------- |