aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-06-08 04:46:06 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-06-08 04:46:06 +0000
commit1795b4e93920d0ab38ecc8011c8c0756e18df8dd (patch)
treeba56908426869e44d89b63e326a8a745b1f9cadd
parent68b391b5c17420988118f2152d90832472bbfc0b (diff)
added a new plug-in API: 'messagev-ew-show'.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2887 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog7
-rw-r--r--plugin/test/test.c12
-rw-r--r--src/messageview.c6
-rw-r--r--src/plugin-marshal.list1
-rw-r--r--src/plugin.c13
-rw-r--r--src/plugin.h5
6 files changed, 43 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 847513f8..b9b8e7b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2011-06-08
+ * src/messageview.c
+ src/plugin.[ch]
+ src/plugin-marshal.list
+ plugin/test/test.c: added a new plug-in API: "messageview-show".
+
+2011-06-08
+
* src/compose.c
src/plugin.[ch]
src/plugin-marshal.list
diff --git a/plugin/test/test.c b/plugin/test/test.c
index 99fbecd4..4160da2f 100644
--- a/plugin/test/test.c
+++ b/plugin/test/test.c
@@ -54,6 +54,8 @@ static void compose_destroy_cb(GObject *obj, gpointer compose);
static gboolean compose_send_cb(GObject *obj, gpointer compose,
gint compose_mode, gint send_mode,
const gchar *msg_file, GSList *to_list);
+static void messageview_show_cb(GObject *obj, gpointer msgview,
+ MsgInfo *msginfo, gboolean all_headers);
static void create_window(void);
static void create_folderview_sub_widget(void);
@@ -105,6 +107,8 @@ void plugin_load(void)
G_CALLBACK(compose_destroy_cb), NULL);
syl_plugin_signal_connect("compose-send",
G_CALLBACK(compose_send_cb), NULL);
+ syl_plugin_signal_connect("messageview-show",
+ G_CALLBACK(messageview_show_cb), NULL);
syl_plugin_add_factory_item("<SummaryView>", "/---", NULL, NULL);
syl_plugin_add_factory_item("<SummaryView>", "/Test Plug-in menu",
@@ -235,6 +239,14 @@ static gboolean compose_send_cb(GObject *obj, gpointer compose,
return TRUE; /* return FALSE to cancel sending */
}
+static void messageview_show_cb(GObject *obj, gpointer msgview,
+ MsgInfo *msginfo, gboolean all_headers)
+{
+ g_print("test: %p: messageview_show (%p), all_headers: %d: %s\n",
+ obj, msgview, all_headers,
+ msginfo && msginfo->subject ? msginfo->subject : "");
+}
+
static void button_clicked(GtkWidget *widget, gpointer data)
{
g_print("button_clicked\n");
diff --git a/src/messageview.c b/src/messageview.c
index fb312338..6e02d7c8 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2008 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2011 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
@@ -63,6 +63,7 @@
#include "gtkutils.h"
#include "utils.h"
#include "rfc2015.h"
+#include "plugin.h"
static GList *messageview_list = NULL;
@@ -533,6 +534,9 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
if (messageview->new_window)
messageview_set_menu_state(messageview);
+ syl_plugin_signal_emit("messageview-show", messageview, msginfo,
+ all_headers);
+
g_free(file);
return 0;
diff --git a/src/plugin-marshal.list b/src/plugin-marshal.list
index 2f6032ae..07b7f3de 100644
--- a/src/plugin-marshal.list
+++ b/src/plugin-marshal.list
@@ -1,3 +1,4 @@
VOID:POINTER
VOID:POINTER,POINTER,STRING,STRING,POINTER
BOOLEAN:POINTER,INT,INT,STRING,POINTER
+VOID:POINTER,POINTER,BOOLEAN
diff --git a/src/plugin.c b/src/plugin.c
index 9e152cd1..666a4fb2 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -37,6 +37,7 @@ enum {
COMPOSE_DESTROY,
TEXTVIEW_MENU_POPUP,
COMPOSE_SEND,
+ MESSAGEVIEW_SHOW,
LAST_SIGNAL
};
@@ -187,6 +188,18 @@ static void syl_plugin_class_init(SylPluginClass *klass)
G_TYPE_INT,
G_TYPE_STRING,
G_TYPE_POINTER);
+ plugin_signals[MESSAGEVIEW_SHOW] =
+ g_signal_new("messageview-show",
+ G_TYPE_FROM_CLASS(gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET(SylPluginClass, messageview_show),
+ NULL, NULL,
+ syl_plugin_marshal_VOID__POINTER_POINTER_BOOLEAN,
+ G_TYPE_NONE,
+ 3,
+ G_TYPE_POINTER,
+ G_TYPE_POINTER,
+ G_TYPE_BOOLEAN);
}
void syl_plugin_signal_connect(const gchar *name, GCallback callback,
diff --git a/src/plugin.h b/src/plugin.h
index 65497882..f966fd69 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -78,6 +78,11 @@ struct _SylPluginClass
gint send_mode,
const gchar *msg_file,
GSList *to_list);
+
+ void (* messageview_show) (GObject *obj,
+ gpointer msgview,
+ MsgInfo *msginfo,
+ gboolean all_headers);
};
struct _SylPluginInfo