aboutsummaryrefslogtreecommitdiff
path: root/src/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugin.c')
-rw-r--r--src/plugin.c95
1 files changed, 94 insertions, 1 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 7a73b6bc..ea45a9ee 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -58,10 +58,14 @@ enum {
{ if (func_ptr) func_ptr(arg1, arg2, arg3); }
#define SAFE_CALL_ARG3_RET(func_ptr, arg1, arg2, arg3) \
(func_ptr ? func_ptr(arg1, arg2, arg3) : NULL)
+#define SAFE_CALL_ARG3_RET_VAL(func_ptr, arg1, arg2, arg3, retval) \
+ (func_ptr ? func_ptr(arg1, arg2, arg3) : retval)
#define SAFE_CALL_ARG4(func_ptr, arg1, arg2, arg3, arg4) \
{ if (func_ptr) func_ptr(arg1, arg2, arg3); }
#define SAFE_CALL_ARG4_RET(func_ptr, arg1, arg2, arg3, arg4) \
(func_ptr ? func_ptr(arg1, arg2, arg3, arg4) : NULL)
+#define SAFE_CALL_ARG4_RET_VAL(func_ptr, arg1, arg2, arg3, arg4, retval) \
+ (func_ptr ? func_ptr(arg1, arg2, arg3, arg4) : retval)
#define CALL_VOID_POINTER(getobj, sym) \
{ \
@@ -671,7 +675,7 @@ gpointer syl_plugin_summary_view_get(void)
return sym;
}
-void syl_plugin_sumary_select_by_msgnum(guint msgnum)
+void syl_plugin_summary_select_by_msgnum(guint msgnum)
{
void (*func)(gpointer, guint);
gpointer summary;
@@ -827,6 +831,48 @@ GSList *syl_plugin_summary_get_msg_list(void)
return NULL;
}
+void syl_plugin_summary_redisplay_msg(void)
+{
+ CALL_VOID_POINTER(syl_plugin_summary_view_get,
+ "summary_redisplay_msg");
+}
+
+void syl_plugin_summary_open_msg(void)
+{
+ CALL_VOID_POINTER(syl_plugin_summary_view_get,
+ "summary_open_msg");
+}
+
+void syl_plugin_summary_view_source(void)
+{
+ CALL_VOID_POINTER(syl_plugin_summary_view_get,
+ "summary_view_source");
+}
+
+void syl_plugin_summary_reedit(void)
+{
+ CALL_VOID_POINTER(syl_plugin_summary_view_get,
+ "summary_reedit");
+}
+
+void syl_plugin_summary_update_selected_rows(void)
+{
+ CALL_VOID_POINTER(syl_plugin_summary_view_get,
+ "summary_update_selected_rows");
+}
+
+void syl_plugin_summary_update_by_msgnum(guint msgnum)
+{
+ void (*func)(gpointer, guint);
+ gpointer summary;
+
+ summary = syl_plugin_summary_view_get();
+ if (summary) {
+ func = syl_plugin_lookup_symbol("summary_update_by_msgnum");
+ SAFE_CALL_ARG2(func, summary, msgnum);
+ }
+}
+
gpointer syl_plugin_messageview_create_with_new_window(void)
{
gpointer (*func)(void);
@@ -1035,3 +1081,50 @@ const gchar *syl_plugin_update_check_get_jump_url(void)
func = syl_plugin_lookup_symbol("update_check_get_jump_url");
return SAFE_CALL_RET(func);
}
+
+gint syl_plugin_alertpanel_full(const gchar *title, const gchar *message,
+ gint type, gint default_value,
+ gboolean can_disable,
+ const gchar *btn1_label,
+ const gchar *btn2_label,
+ const gchar *btn3_label)
+{
+ gint (*func)(const gchar *, const gchar *, gint, gint, gboolean,
+ const gchar *, const gchar *, const gchar *);
+
+ GETFUNC("alertpanel_full");
+ return func ? func(title, message, type, default_value, can_disable,
+ btn1_label, btn2_label, btn3_label) : -1;
+}
+
+gint syl_plugin_alertpanel(const gchar *title, const gchar *message,
+ const gchar *btn1_label,
+ const gchar *btn2_label,
+ const gchar *btn3_label)
+{
+ gint (*func)(const gchar *, const gchar *,
+ const gchar *, const gchar *, const gchar *);
+
+ GETFUNC("alertpanel");
+ return func ? func(title, message, btn1_label, btn2_label, btn3_label)
+ : -1;
+}
+
+void syl_plugin_alertpanel_message(const gchar *title, const gchar *message,
+ gint type)
+{
+ void (*func)(const gchar *, const gchar *, gint);
+
+ GETFUNC("alertpanel_message");
+ SAFE_CALL_ARG3(func, title, message, type);
+}
+
+gint syl_plugin_alertpanel_message_with_disable(const gchar *title,
+ const gchar *message,
+ gint type)
+{
+ gint (*func)(const gchar *, const gchar *, gint);
+
+ GETFUNC("alertpanel_message_with_disable");
+ return SAFE_CALL_ARG3_RET_VAL(func, title, message, type, 0);
+}