aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-01-21 06:08:37 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-01-21 06:08:37 +0000
commit441b184056b95fcf0ce22a1f61c7e8ce779949cc (patch)
tree5aafb212cfe30532551871503d8fca9054b14502 /plugin
parent596eb7f3b00034bbc0a8b1001c2ca6c8743312d0 (diff)
added new plug-in APIs for compose window.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2436 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'plugin')
-rw-r--r--plugin/test/test.c58
1 files changed, 52 insertions, 6 deletions
diff --git a/plugin/test/test.c b/plugin/test/test.c
index 3de6ee62..3526e960 100644
--- a/plugin/test/test.c
+++ b/plugin/test/test.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2010 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
#include <glib.h>
#include <gtk/gtk.h>
+#include "sylmain.h"
#include "plugin.h"
#include "test.h"
#include "folder.h"
@@ -31,6 +32,13 @@ static SylPluginInfo info = {
"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 *ifactory,
+ gpointer data);
+static void compose_created_cb(GObject *obj, gpointer compose);
+static void compose_destroy_cb(GObject *obj, gpointer compose);
+
static void create_window(void);
void plugin_load(void)
@@ -40,16 +48,17 @@ void plugin_load(void)
gpointer mainwin;
g_print("test plug-in loaded!\n");
+
list = folder_get_list();
- g_print("list = %p\n", 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("id = %s\n", id);
+ g_print("folder id = %s\n", id);
}
ver = syl_plugin_get_prog_version();
- g_print("ver: %s\n", ver);
+ g_print("program ver: %s\n", ver);
mainwin = syl_plugin_main_window_get();
g_print("mainwin: %p\n", mainwin);
@@ -58,6 +67,17 @@ void plugin_load(void)
syl_plugin_add_menuitem("/Tools", NULL, NULL, NULL);
syl_plugin_add_menuitem("/Tools", "Plugin test", create_window, NULL);
+ g_signal_connect(syl_app_get(), "init-done", G_CALLBACK(init_done_cb),
+ NULL);
+ g_signal_connect(syl_app_get(), "app-exit", G_CALLBACK(app_exit_cb),
+ NULL);
+ syl_plugin_signal_connect("folderview-menu-popup",
+ G_CALLBACK(menu_popup_cb), NULL);
+ syl_plugin_signal_connect("compose-created",
+ G_CALLBACK(compose_created_cb), NULL);
+ syl_plugin_signal_connect("compose-destroy",
+ G_CALLBACK(compose_destroy_cb), NULL);
+
g_print("test plug-in loading done\n");
}
@@ -76,10 +96,36 @@ 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 *ifactory,
+ gpointer data)
+{
+ g_print("test: %p: folderview menu popup\n", obj);
+}
+
+static void compose_created_cb(GObject *obj, gpointer compose)
+{
+ g_print("test: %p: compose created (%p)\n", obj, compose);
+}
+
+static void compose_destroy_cb(GObject *obj, gpointer compose)
+{
+ g_print("test: %p: compose will be destroyed (%p)\n", obj, compose);
+}
+
static void button_clicked(GtkWidget *widget, gpointer data)
{
g_print("button_clicked\n");
- syl_plugin_app_will_exit(TRUE);
+ /* syl_plugin_app_will_exit(TRUE); */
}
static void create_window(void)
@@ -90,7 +136,7 @@ static void create_window(void)
g_print("creating window\n");
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- button = gtk_button_new_with_label("Click this to quit");
+ button = gtk_button_new_with_label("Click this button");
gtk_window_set_default_size(GTK_WINDOW(window), 400, 200);
gtk_container_add(GTK_CONTAINER(window), button);
g_signal_connect(G_OBJECT(button), "clicked",