PluginSpec
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
* Sylpheed Plug-in Specification (version 3.1.0) [#z1777b...
#contents
* Overview of plug-in system [#i2204ab3]
The following is the architecture of plugin system of Syl...
+----------+ +----------------------+ +-----------+
| Sylpheed |----| libsylpheed-plugin-0 |--+--| Plug-in A |
+----------+ +----------------------+ | +-----------+
Sylpheed Plug-in interface | Plug-in DLL
library +--+
| +------------+ | | +-----------+
+--------| libsylph-0 |---------+ +--| Plug-in B |
+------------+ +-----------+
LibSylph mail library
Sylpheed loads the plug-in DLLs installed in the plug-in ...
startup.
A plug-in can only access the functions of Sylpheed throu...
with libsylpheed-plugin-0 and libsylph-0 library.
There are two kinds of plug-in API. One is called directl...
another one utilizes the signal mechanism of GObject and ...
functions on specific events.
The plug-in system is implemented in libsylph/sylmain.[ch...
src/plugin.[ch].
Though functions of Sylpheed which can be called by plug-...
* Plug-in API [#af671778]
** Functions used by Sylpheed [#eb623a92]
---------------------------------------------------------...
void syl_plugin_signal_connect (const gchar *name, GCal...
gpointer data);
Connects to signals available with SylPlugin object (obta...
The specification of callback functions that receive sign...
that of normal GObject.
Refer to the signals list for available signals.
---------------------------------------------------------...
void syl_plugin_signal_disconnect(gpointer func, gpointe...
Disconnects signals connected by syl_plugin_signal_connec...
---------------------------------------------------------...
void syl_plugin_signal_emit(const gchar *name, ...);
Emits SylPlugin object signals.
---------------------------------------------------------...
gint syl_plugin_init_lib (void);
Initializes the libsylpheed-plugin-0 library.
---------------------------------------------------------...
gint syl_plugin_load (const gchar *file);
Loads plug-in DLL files into memory.
---------------------------------------------------------...
gint syl_plugin_load_all (const gchar *dir);
Loads plug-in DLL files in the specified directory into m...
---------------------------------------------------------...
void syl_plugin_unload_all (void);
Unloads all loaded plug-ins.
---------------------------------------------------------...
GSList *syl_plugin_get_module_list (void);
Obtains the list of plug-ins loaded into memory.
It returns the list of pointers to GModule struct.
The list is obtained by the library internally, so it mus...
---------------------------------------------------------...
SylPluginInfo *syl_plugin_get_info (GModule *module);
Obtains plug-in information. The information is returned ...
struct.
---------------------------------------------------------...
gboolean syl_plugin_check_version (GModule *module);
Compares plug-in interface versions and checks if the plu...
Returns TRUE if the version matches, FALSE otherwise.
---------------------------------------------------------...
gint syl_plugin_add_symbol (const gchar *na...
Registers symbol name and pointer value related to it to ...
---------------------------------------------------------...
gpointer syl_plugin_lookup_symbol (const gchar *na...
Searches symbol registered by syl_plugin_add_symbol() and...
pointer value.
---------------------------------------------------------...
** Functions which must be implemented by plug-ins [#kfc9...
---------------------------------------------------------...
void plugin_load(void)
Called from Sylpheed on plug-in load.
Do initialization of plug-in etc. here.
---------------------------------------------------------...
void plugin_unload(void)
Called from Sylpheed on plug-in unload.
Do finalization of plug-in etc. here.
---------------------------------------------------------...
SylPluginInfo *plugin_info(void)
Fuction to return struct which stores plug-in information...
It normally returns pointer to static struct.
---------------------------------------------------------...
gint plugin_interface_version(void)
Function to return plug-in API interface version to Sylph...
A plug-in normally returns constant value SYL_PLUGIN_INTE...
Sylpheed compares this value with its own value and check...
compatible. Sylpheed's plug-in interface version must be ...
than the plug-in's plug-in interface verson. If the major...
interface version differ, they are treated as incompatible.
Ex.1: Sylpheed plug-in interface version: 0x0102
A plug-in plug-in interface version: 0x0100: OK
Ex.2: Sylpheed plug-in interface version: 0x0102
A plug-in plug-in interface version: 0x0103: NG
---------------------------------------------------------...
** Functions used by plug-ins [#ve94a893]
Refer to src/plugin.h and libsylph/*.h for the functions ...
** Signals list [#ed039690]
*** libsylpheed-plugin-0 [#nd2defea]
Call syl_plugin_signal_connect() to use the following sig...
Example:
syl_plugin_signal_connect("plugin-load", G_CALLBACK(pl...
---------------------------------------------------------...
void (* plugin_load) (GObject *obj, GModule *module);
Emitted on plug-in loading by syl_plugin_load().
---------------------------------------------------------...
void (* plugin_unload) (GObject *obj, GModule *module);
Emitted on plug-in unloading by syl_plugin_unload_all().
---------------------------------------------------------...
void (* folderview_menu_popup) (GObject *obj, gpointer ...
Emitted on popup of the context menu of FolderView.
---------------------------------------------------------...
void (* summaryview_menu_popup) (GObject *obj, gpointer...
Emitted on popup of the context menu of SummaryView.
---------------------------------------------------------...
void (* compose_created) (GObject *obj, gpointer ...
Emitted on the creation of message compose window.
Retrieved 'compose' pointer will be used with syl_plugin_...
---------------------------------------------------------...
void (* compose_destroy) (GObject *obj, gpointer ...
Emitted just before the destruction of message compose wi...
---------------------------------------------------------...
void (* textview_menu_popup) (GObject *obj,
GtkMenu *menu,
GtkTextView *textview,
const gchar *uri,
const gchar *selected_t...
MsgInfo *msginfo);
Emitted on popup of the context menu of TextView.
You can add any menu items to the passed GtkMenu.
The menu object will be created on open and destroyed on ...
must be added each time.
menu: context menu object
textview: GtkTextView object
uri: URI string if the menu popups on an URI
selected_text: string if a string is selected on the tex...
msginfo: the MsgInfo message object displayed in the tex...
---------------------------------------------------------...
*** libsylph-0 [#c87a8d0e]
The following signals can be used by passing GObject obta...
syl_app_get() to the first argument of g_signal_connect().
Example:
void init_done_cb(GObject *obj, gpointer data)
{
...
}
g_signal_connect(syl_app_get(), "init-done", G_CALLB...
data);
---------------------------------------------------------...
void (* init_done) (GObject *obj)
Emitted when the initialization of application completes.
---------------------------------------------------------...
void (* app_exit) (GObject *obj)
Emitted when application exits.
---------------------------------------------------------...
void (* app_force_exit) (GObject *obj)
Emitted when application is forced to exit (no confirmati...
(ex: sylpheed --exit)
---------------------------------------------------------...
void (* add_msg) (GObject *obj, FolderItem *item, const ...
Emitted when a message (number num) is added into folder ...
---------------------------------------------------------...
void (* remove_msg) (GObject *obj, FolderItem *item, con...
guint num)
Emitted when a message (number num) is removed from folde...
---------------------------------------------------------...
void (* remove_all_msg) (GObject *obj, FolderItem *item)
Emitted when all messages are removed from folder item.
---------------------------------------------------------...
void (* remove_folder) (GObject *obj, FolderItem *item)
Emitted when folder item is removed.
---------------------------------------------------------...
void (* move_folder) (GObject *obj, FolderItem *item, co...
const gchar *new_id)
Emitted when folder item is moved (renamed) from old_id t...
old_id and new_id are folder identifier strings.
---------------------------------------------------------...
void (* folderlist_updated) (GObject *obj)
Emitted when folder information is modified and folderlis...
contains folder list, is updated.
---------------------------------------------------------...
void (* account_updated) (GObject *obj)
Emitted on the update of account information.
It will not be emitted if it is locked by account_update_...
---------------------------------------------------------...
* Building plug-in [#y881c98e]
The following procedure is required to build a plug-in:
- Include the header files of GTK+, libsylph, libsylpheed...
- Link against the libraries
- Create shared library (DLL)
The include files of Sylpheed are installed under /usr/lo...
Using the included test.c as an example, the following co...
(Linux)
$ gcc `pkg-config --cflags gtk+-2.0` -I/usr/local/includ...
$ gcc -shared test.o `pkg-config --libs gtk+-2.0` -L/usr...
$ sudo cp test.so /usr/local/lib/sylpheed/plugins/
(Windows (MinGW))
$ gcc `pkg-config --cflags gtk+-2.0` -I$HOME/dist/includ...
$ gcc -shared test.o `pkg-config --libs gtk+-2.0` -L$HOM...
$ cp test.dll $HOME/dist/lib/sylpheed/plugins/
To automate the procedure, create configure.ac and Makefi...
* Sample plug-in [#kc5ca5d5]
There is a sample plug-in at plugin/test. This plug-in wi...
with 'make install'. It is required to enter the director...
run 'make install-plugin'.
The 'test' plug-in has the basic structure of Sylpheed pl...
following process:
- Output string "test plug-in loaded!" to stdout on load
- Get folder list and output to stdout
- Get Sylpheed version string and output to stdout
- Get the main window and put it in front
- Add 'Plugin test' menu item on the 'Tools' menu
- When 'Plugin test' menu is selected, a window with a bu...
- Capture the following events and show messages: applica...
*** test.c [#uec434f3]
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mai...
* Copyright (C) 1999-2010 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute i...
* it under the terms of the GNU General Public License ...
* the Free Software Foundation; either version 2 of the...
* (at your option) any later version.
*
* This program is distributed in the hope that it will ...
* but WITHOUT ANY WARRANTY; without even the implied wa...
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ...
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Pu...
* along with this program; if not, write to the Free So...
* Foundation, Inc., 59 Temple Place - Suite 330, Boston...
*/
#include <glib.h>
#include <gtk/gtk.h>
#include "sylmain.h"
#include "plugin.h"
#include "test.h" /* test.h is empty */
#include "folder.h"
static SylPluginInfo info = {
"Test Plugin",
"1.0.0",
"Hiroyuki Yamamoto",
"Test plug-in for Sylpheed plug-in system"
};
static void init_done_cb(GObject *obj, gpointer data);
static void app_exit_cb(GObject *obj, gpointer data);
static void menu_popup_cb(GObject *obj, GtkItemFactory *...
gpointer data);
static void compose_created_cb(GObject *obj, gpointer co...
static void compose_destroy_cb(GObject *obj, gpointer co...
static void create_window(void);
void plugin_load(void)
{
GList *list, *cur;
const gchar *ver;
gpointer mainwin;
g_print("test plug-in loaded!\n");
list = folder_get_list();
g_print("folder list = %p\n", list);
for (cur = list; cur != NULL; cur = cur->next) {
Folder *folder = FOLDER(cur->data);
gchar *id = folder_get_identifier(folder);
g_print("folder id = %s\n", id);
}
ver = syl_plugin_get_prog_version();
g_print("program ver: %s\n", ver);
mainwin = syl_plugin_main_window_get();
g_print("mainwin: %p\n", mainwin);
syl_plugin_main_window_popup(mainwin);
syl_plugin_add_menuitem("/Tools", NULL, NULL, NUL...
syl_plugin_add_menuitem("/Tools", "Plugin test", ...
g_signal_connect(syl_app_get(), "init-done", G_CA...
NULL);
g_signal_connect(syl_app_get(), "app-exit", G_CAL...
NULL);
syl_plugin_signal_connect("folderview-menu-popup",
G_CALLBACK(menu_popup_c...
syl_plugin_signal_connect("compose-created",
G_CALLBACK(compose_crea...
syl_plugin_signal_connect("compose-destroy",
G_CALLBACK(compose_dest...
g_print("test plug-in loading done\n");
}
void plugin_unload(void)
{
g_print("test plug-in unloaded!\n");
}
SylPluginInfo *plugin_info(void)
{
return &info;
}
gint plugin_interface_version(void)
{
return SYL_PLUGIN_INTERFACE_VERSION;
}
static void init_done_cb(GObject *obj, gpointer data)
{
g_print("test: %p: app init done\n", obj);
}
static void app_exit_cb(GObject *obj, gpointer data)
{
g_print("test: %p: app will exit\n", obj);
}
static void menu_popup_cb(GObject *obj, GtkItemFactory *...
gpointer data)
{
g_print("test: %p: folderview menu popup\n", obj);
}
static void compose_created_cb(GObject *obj, gpointer co...
{
gchar *text;
g_print("test: %p: compose created (%p)\n", obj, ...
text = syl_plugin_compose_entry_get_text(compose,...
g_print("test: compose To: %s\n", text);
g_free(text);
#if 0
syl_plugin_compose_entry_set(compose, "test-plugi...
syl_plugin_compose_entry_append(compose, "second@...
#endif
}
static void compose_destroy_cb(GObject *obj, gpointer co...
{
g_print("test: %p: compose will be destroyed (%p)...
}
static void button_clicked(GtkWidget *widget, gpointer d...
{
g_print("button_clicked\n");
/* syl_plugin_app_will_exit(TRUE); */
}
static void create_window(void)
{
GtkWidget *window;
GtkWidget *button;
g_print("creating window\n");
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
button = gtk_button_new_with_label("Click this bu...
gtk_window_set_default_size(GTK_WINDOW(window), 4...
gtk_container_add(GTK_CONTAINER(window), button);
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(button_clicked), NULL);
gtk_widget_show_all(window);
}
* About license [#da33eebf]
It is required that a plug-in DLL dynamically loaded by S...
GPL-compatible license (ex. modified BSD license) based o...
because the license of Sylpheed itself is GPL.
If you want to apply non-GPL license like proprietary lic...
you must make the module an independent executable file, ...
inter-process communication with a DLL.
終了行:
* Sylpheed Plug-in Specification (version 3.1.0) [#z1777b...
#contents
* Overview of plug-in system [#i2204ab3]
The following is the architecture of plugin system of Syl...
+----------+ +----------------------+ +-----------+
| Sylpheed |----| libsylpheed-plugin-0 |--+--| Plug-in A |
+----------+ +----------------------+ | +-----------+
Sylpheed Plug-in interface | Plug-in DLL
library +--+
| +------------+ | | +-----------+
+--------| libsylph-0 |---------+ +--| Plug-in B |
+------------+ +-----------+
LibSylph mail library
Sylpheed loads the plug-in DLLs installed in the plug-in ...
startup.
A plug-in can only access the functions of Sylpheed throu...
with libsylpheed-plugin-0 and libsylph-0 library.
There are two kinds of plug-in API. One is called directl...
another one utilizes the signal mechanism of GObject and ...
functions on specific events.
The plug-in system is implemented in libsylph/sylmain.[ch...
src/plugin.[ch].
Though functions of Sylpheed which can be called by plug-...
* Plug-in API [#af671778]
** Functions used by Sylpheed [#eb623a92]
---------------------------------------------------------...
void syl_plugin_signal_connect (const gchar *name, GCal...
gpointer data);
Connects to signals available with SylPlugin object (obta...
The specification of callback functions that receive sign...
that of normal GObject.
Refer to the signals list for available signals.
---------------------------------------------------------...
void syl_plugin_signal_disconnect(gpointer func, gpointe...
Disconnects signals connected by syl_plugin_signal_connec...
---------------------------------------------------------...
void syl_plugin_signal_emit(const gchar *name, ...);
Emits SylPlugin object signals.
---------------------------------------------------------...
gint syl_plugin_init_lib (void);
Initializes the libsylpheed-plugin-0 library.
---------------------------------------------------------...
gint syl_plugin_load (const gchar *file);
Loads plug-in DLL files into memory.
---------------------------------------------------------...
gint syl_plugin_load_all (const gchar *dir);
Loads plug-in DLL files in the specified directory into m...
---------------------------------------------------------...
void syl_plugin_unload_all (void);
Unloads all loaded plug-ins.
---------------------------------------------------------...
GSList *syl_plugin_get_module_list (void);
Obtains the list of plug-ins loaded into memory.
It returns the list of pointers to GModule struct.
The list is obtained by the library internally, so it mus...
---------------------------------------------------------...
SylPluginInfo *syl_plugin_get_info (GModule *module);
Obtains plug-in information. The information is returned ...
struct.
---------------------------------------------------------...
gboolean syl_plugin_check_version (GModule *module);
Compares plug-in interface versions and checks if the plu...
Returns TRUE if the version matches, FALSE otherwise.
---------------------------------------------------------...
gint syl_plugin_add_symbol (const gchar *na...
Registers symbol name and pointer value related to it to ...
---------------------------------------------------------...
gpointer syl_plugin_lookup_symbol (const gchar *na...
Searches symbol registered by syl_plugin_add_symbol() and...
pointer value.
---------------------------------------------------------...
** Functions which must be implemented by plug-ins [#kfc9...
---------------------------------------------------------...
void plugin_load(void)
Called from Sylpheed on plug-in load.
Do initialization of plug-in etc. here.
---------------------------------------------------------...
void plugin_unload(void)
Called from Sylpheed on plug-in unload.
Do finalization of plug-in etc. here.
---------------------------------------------------------...
SylPluginInfo *plugin_info(void)
Fuction to return struct which stores plug-in information...
It normally returns pointer to static struct.
---------------------------------------------------------...
gint plugin_interface_version(void)
Function to return plug-in API interface version to Sylph...
A plug-in normally returns constant value SYL_PLUGIN_INTE...
Sylpheed compares this value with its own value and check...
compatible. Sylpheed's plug-in interface version must be ...
than the plug-in's plug-in interface verson. If the major...
interface version differ, they are treated as incompatible.
Ex.1: Sylpheed plug-in interface version: 0x0102
A plug-in plug-in interface version: 0x0100: OK
Ex.2: Sylpheed plug-in interface version: 0x0102
A plug-in plug-in interface version: 0x0103: NG
---------------------------------------------------------...
** Functions used by plug-ins [#ve94a893]
Refer to src/plugin.h and libsylph/*.h for the functions ...
** Signals list [#ed039690]
*** libsylpheed-plugin-0 [#nd2defea]
Call syl_plugin_signal_connect() to use the following sig...
Example:
syl_plugin_signal_connect("plugin-load", G_CALLBACK(pl...
---------------------------------------------------------...
void (* plugin_load) (GObject *obj, GModule *module);
Emitted on plug-in loading by syl_plugin_load().
---------------------------------------------------------...
void (* plugin_unload) (GObject *obj, GModule *module);
Emitted on plug-in unloading by syl_plugin_unload_all().
---------------------------------------------------------...
void (* folderview_menu_popup) (GObject *obj, gpointer ...
Emitted on popup of the context menu of FolderView.
---------------------------------------------------------...
void (* summaryview_menu_popup) (GObject *obj, gpointer...
Emitted on popup of the context menu of SummaryView.
---------------------------------------------------------...
void (* compose_created) (GObject *obj, gpointer ...
Emitted on the creation of message compose window.
Retrieved 'compose' pointer will be used with syl_plugin_...
---------------------------------------------------------...
void (* compose_destroy) (GObject *obj, gpointer ...
Emitted just before the destruction of message compose wi...
---------------------------------------------------------...
void (* textview_menu_popup) (GObject *obj,
GtkMenu *menu,
GtkTextView *textview,
const gchar *uri,
const gchar *selected_t...
MsgInfo *msginfo);
Emitted on popup of the context menu of TextView.
You can add any menu items to the passed GtkMenu.
The menu object will be created on open and destroyed on ...
must be added each time.
menu: context menu object
textview: GtkTextView object
uri: URI string if the menu popups on an URI
selected_text: string if a string is selected on the tex...
msginfo: the MsgInfo message object displayed in the tex...
---------------------------------------------------------...
*** libsylph-0 [#c87a8d0e]
The following signals can be used by passing GObject obta...
syl_app_get() to the first argument of g_signal_connect().
Example:
void init_done_cb(GObject *obj, gpointer data)
{
...
}
g_signal_connect(syl_app_get(), "init-done", G_CALLB...
data);
---------------------------------------------------------...
void (* init_done) (GObject *obj)
Emitted when the initialization of application completes.
---------------------------------------------------------...
void (* app_exit) (GObject *obj)
Emitted when application exits.
---------------------------------------------------------...
void (* app_force_exit) (GObject *obj)
Emitted when application is forced to exit (no confirmati...
(ex: sylpheed --exit)
---------------------------------------------------------...
void (* add_msg) (GObject *obj, FolderItem *item, const ...
Emitted when a message (number num) is added into folder ...
---------------------------------------------------------...
void (* remove_msg) (GObject *obj, FolderItem *item, con...
guint num)
Emitted when a message (number num) is removed from folde...
---------------------------------------------------------...
void (* remove_all_msg) (GObject *obj, FolderItem *item)
Emitted when all messages are removed from folder item.
---------------------------------------------------------...
void (* remove_folder) (GObject *obj, FolderItem *item)
Emitted when folder item is removed.
---------------------------------------------------------...
void (* move_folder) (GObject *obj, FolderItem *item, co...
const gchar *new_id)
Emitted when folder item is moved (renamed) from old_id t...
old_id and new_id are folder identifier strings.
---------------------------------------------------------...
void (* folderlist_updated) (GObject *obj)
Emitted when folder information is modified and folderlis...
contains folder list, is updated.
---------------------------------------------------------...
void (* account_updated) (GObject *obj)
Emitted on the update of account information.
It will not be emitted if it is locked by account_update_...
---------------------------------------------------------...
* Building plug-in [#y881c98e]
The following procedure is required to build a plug-in:
- Include the header files of GTK+, libsylph, libsylpheed...
- Link against the libraries
- Create shared library (DLL)
The include files of Sylpheed are installed under /usr/lo...
Using the included test.c as an example, the following co...
(Linux)
$ gcc `pkg-config --cflags gtk+-2.0` -I/usr/local/includ...
$ gcc -shared test.o `pkg-config --libs gtk+-2.0` -L/usr...
$ sudo cp test.so /usr/local/lib/sylpheed/plugins/
(Windows (MinGW))
$ gcc `pkg-config --cflags gtk+-2.0` -I$HOME/dist/includ...
$ gcc -shared test.o `pkg-config --libs gtk+-2.0` -L$HOM...
$ cp test.dll $HOME/dist/lib/sylpheed/plugins/
To automate the procedure, create configure.ac and Makefi...
* Sample plug-in [#kc5ca5d5]
There is a sample plug-in at plugin/test. This plug-in wi...
with 'make install'. It is required to enter the director...
run 'make install-plugin'.
The 'test' plug-in has the basic structure of Sylpheed pl...
following process:
- Output string "test plug-in loaded!" to stdout on load
- Get folder list and output to stdout
- Get Sylpheed version string and output to stdout
- Get the main window and put it in front
- Add 'Plugin test' menu item on the 'Tools' menu
- When 'Plugin test' menu is selected, a window with a bu...
- Capture the following events and show messages: applica...
*** test.c [#uec434f3]
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mai...
* Copyright (C) 1999-2010 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute i...
* it under the terms of the GNU General Public License ...
* the Free Software Foundation; either version 2 of the...
* (at your option) any later version.
*
* This program is distributed in the hope that it will ...
* but WITHOUT ANY WARRANTY; without even the implied wa...
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ...
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Pu...
* along with this program; if not, write to the Free So...
* Foundation, Inc., 59 Temple Place - Suite 330, Boston...
*/
#include <glib.h>
#include <gtk/gtk.h>
#include "sylmain.h"
#include "plugin.h"
#include "test.h" /* test.h is empty */
#include "folder.h"
static SylPluginInfo info = {
"Test Plugin",
"1.0.0",
"Hiroyuki Yamamoto",
"Test plug-in for Sylpheed plug-in system"
};
static void init_done_cb(GObject *obj, gpointer data);
static void app_exit_cb(GObject *obj, gpointer data);
static void menu_popup_cb(GObject *obj, GtkItemFactory *...
gpointer data);
static void compose_created_cb(GObject *obj, gpointer co...
static void compose_destroy_cb(GObject *obj, gpointer co...
static void create_window(void);
void plugin_load(void)
{
GList *list, *cur;
const gchar *ver;
gpointer mainwin;
g_print("test plug-in loaded!\n");
list = folder_get_list();
g_print("folder list = %p\n", list);
for (cur = list; cur != NULL; cur = cur->next) {
Folder *folder = FOLDER(cur->data);
gchar *id = folder_get_identifier(folder);
g_print("folder id = %s\n", id);
}
ver = syl_plugin_get_prog_version();
g_print("program ver: %s\n", ver);
mainwin = syl_plugin_main_window_get();
g_print("mainwin: %p\n", mainwin);
syl_plugin_main_window_popup(mainwin);
syl_plugin_add_menuitem("/Tools", NULL, NULL, NUL...
syl_plugin_add_menuitem("/Tools", "Plugin test", ...
g_signal_connect(syl_app_get(), "init-done", G_CA...
NULL);
g_signal_connect(syl_app_get(), "app-exit", G_CAL...
NULL);
syl_plugin_signal_connect("folderview-menu-popup",
G_CALLBACK(menu_popup_c...
syl_plugin_signal_connect("compose-created",
G_CALLBACK(compose_crea...
syl_plugin_signal_connect("compose-destroy",
G_CALLBACK(compose_dest...
g_print("test plug-in loading done\n");
}
void plugin_unload(void)
{
g_print("test plug-in unloaded!\n");
}
SylPluginInfo *plugin_info(void)
{
return &info;
}
gint plugin_interface_version(void)
{
return SYL_PLUGIN_INTERFACE_VERSION;
}
static void init_done_cb(GObject *obj, gpointer data)
{
g_print("test: %p: app init done\n", obj);
}
static void app_exit_cb(GObject *obj, gpointer data)
{
g_print("test: %p: app will exit\n", obj);
}
static void menu_popup_cb(GObject *obj, GtkItemFactory *...
gpointer data)
{
g_print("test: %p: folderview menu popup\n", obj);
}
static void compose_created_cb(GObject *obj, gpointer co...
{
gchar *text;
g_print("test: %p: compose created (%p)\n", obj, ...
text = syl_plugin_compose_entry_get_text(compose,...
g_print("test: compose To: %s\n", text);
g_free(text);
#if 0
syl_plugin_compose_entry_set(compose, "test-plugi...
syl_plugin_compose_entry_append(compose, "second@...
#endif
}
static void compose_destroy_cb(GObject *obj, gpointer co...
{
g_print("test: %p: compose will be destroyed (%p)...
}
static void button_clicked(GtkWidget *widget, gpointer d...
{
g_print("button_clicked\n");
/* syl_plugin_app_will_exit(TRUE); */
}
static void create_window(void)
{
GtkWidget *window;
GtkWidget *button;
g_print("creating window\n");
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
button = gtk_button_new_with_label("Click this bu...
gtk_window_set_default_size(GTK_WINDOW(window), 4...
gtk_container_add(GTK_CONTAINER(window), button);
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(button_clicked), NULL);
gtk_widget_show_all(window);
}
* About license [#da33eebf]
It is required that a plug-in DLL dynamically loaded by S...
GPL-compatible license (ex. modified BSD license) based o...
because the license of Sylpheed itself is GPL.
If you want to apply non-GPL license like proprietary lic...
you must make the module an independent executable file, ...
inter-process communication with a DLL.
ページ名: