diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-10-13 08:54:31 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-10-13 08:54:31 +0000 |
commit | eb03d22324fbf818eae312e82ffe8e2b63fda8ae (patch) | |
tree | 080ac8ac724bfb3321a389e16c40159c04a195ec /src | |
parent | 996fee475e501a991ff04548abf1d9a5ff311d89 (diff) |
added new plug-in APIs.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2283 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/plugin.c | 40 | ||||
-rw-r--r-- | src/plugin.h | 4 |
3 files changed, 47 insertions, 0 deletions
@@ -1096,6 +1096,9 @@ static void plugin_init(void) summary_select_by_msgnum); syl_plugin_add_symbol("summary_select_by_msginfo", summary_select_by_msginfo); + syl_plugin_add_symbol("summary_lock", summary_lock); + syl_plugin_add_symbol("summary_unlock", summary_unlock); + syl_plugin_add_symbol("summary_is_locked", summary_is_locked); syl_plugin_add_symbol("messageview_create_with_new_window", messageview_create_with_new_window); diff --git a/src/plugin.c b/src/plugin.c index d934101b..16f9e0ef 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -39,6 +39,8 @@ enum { #define SAFE_CALL_ARG1(func_ptr, arg1) { if (func_ptr) func_ptr(arg1); } #define SAFE_CALL_ARG1_RET(func_ptr, arg1) \ (func_ptr ? func_ptr(arg1) : NULL) +#define SAFE_CALL_ARG1_RET_VAL(func_ptr, arg1, retval) \ + (func_ptr ? func_ptr(arg1) : retval) #define SAFE_CALL_ARG2(func_ptr, arg1, arg2) \ { if (func_ptr) func_ptr(arg1, arg2); } #define SAFE_CALL_ARG2_RET(func_ptr, arg1, arg2) \ @@ -551,6 +553,44 @@ void syl_plugin_open_message(const gchar *folder_id, guint msgnum) } } +void syl_plugin_summary_lock(void) +{ + void (*func)(gpointer); + gpointer summary; + + summary = syl_plugin_summary_view_get(); + if (summary) { + func = syl_plugin_lookup_symbol("summary_lock"); + SAFE_CALL_ARG1(func, summary); + } +} + +void syl_plugin_summary_unlock(void) +{ + void (*func)(gpointer); + gpointer summary; + + summary = syl_plugin_summary_view_get(); + if (summary) { + func = syl_plugin_lookup_symbol("summary_unlock"); + SAFE_CALL_ARG1(func, summary); + } +} + +gboolean syl_plugin_summary_is_locked(void) +{ + gboolean (*func)(gpointer); + gpointer summary; + + summary = syl_plugin_summary_view_get(); + if (summary) { + func = syl_plugin_lookup_symbol("summary_is_locked"); + return SAFE_CALL_ARG1_RET_VAL(func, summary, FALSE); + } + + return FALSE; +} + gpointer syl_plugin_messageview_create_with_new_window(void) { gpointer (*func)(void); diff --git a/src/plugin.h b/src/plugin.h index 177a8463..238bab87 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -144,6 +144,10 @@ gboolean syl_plugin_summary_select_by_msginfo (MsgInfo *msginfo); void syl_plugin_open_message (const gchar *folder_id, guint msgnum); +void syl_plugin_summary_lock (void); +void syl_plugin_summary_unlock (void); +gboolean syl_plugin_summary_is_locked (void); + /* MessageView */ gpointer syl_plugin_messageview_create_with_new_window (void); |