From cbbe2cb3b468a8bdf8225657fb7d522e133ee24c Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 11 Jun 2010 07:36:14 +0000 Subject: added plug-in APIs for folder view. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2569 ee746299-78ed-0310-b773-934348b2243d --- src/main.c | 125 +++++++++++++++++++++++++++++-------------------------------- 1 file changed, 59 insertions(+), 66 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 086a7bc2..f0604674 100644 --- a/src/main.c +++ b/src/main.c @@ -1103,6 +1103,8 @@ static void register_system_events(void) } #endif +#define ADD_SYM(sym) syl_plugin_add_symbol(#sym, sym) + static void plugin_init(void) { MainWindow *mainwin; @@ -1117,29 +1119,31 @@ static void plugin_init(void) return; } - syl_plugin_add_symbol("prog_version", prog_version); - syl_plugin_add_symbol("main_window_lock", main_window_lock); - syl_plugin_add_symbol("main_window_unlock", main_window_unlock); - syl_plugin_add_symbol("main_window_get", main_window_get); - syl_plugin_add_symbol("main_window_popup", main_window_popup); - syl_plugin_add_symbol("app_will_exit", app_will_exit); + ADD_SYM(prog_version); + ADD_SYM(app_will_exit); + + ADD_SYM(main_window_lock); + ADD_SYM(main_window_unlock); + ADD_SYM(main_window_get); + ADD_SYM(main_window_popup); + syl_plugin_add_symbol("main_window_menu_factory", mainwin->menu_factory); syl_plugin_add_symbol("main_window_statusbar", mainwin->statusbar); - syl_plugin_add_symbol("folderview", mainwin->folderview); - syl_plugin_add_symbol("folderview_get_selected_item", - folderview_get_selected_item); - syl_plugin_add_symbol("folderview_check_new", folderview_check_new); - syl_plugin_add_symbol("folderview_check_new_item", - folderview_check_new_item); - syl_plugin_add_symbol("folderview_check_new_all", - folderview_check_new_all); - syl_plugin_add_symbol("folderview_update_item", folderview_update_item); - syl_plugin_add_symbol("folderview_update_item_foreach", - folderview_update_item_foreach); - syl_plugin_add_symbol("folderview_update_all_updated", - folderview_update_all_updated); + ADD_SYM(folderview_get); + ADD_SYM(folderview_add_sub_widget); + ADD_SYM(folderview_select); + ADD_SYM(folderview_unselect); + ADD_SYM(folderview_select_next_unread); + ADD_SYM(folderview_get_selected_item); + ADD_SYM(folderview_check_new); + ADD_SYM(folderview_check_new_item); + ADD_SYM(folderview_check_new_all); + ADD_SYM(folderview_update_item); + ADD_SYM(folderview_update_item_foreach); + ADD_SYM(folderview_update_all_updated); + ADD_SYM(folderview_check_new_selected); syl_plugin_add_symbol("folderview_mail_popup_factory", mainwin->folderview->mail_factory); @@ -1149,55 +1153,44 @@ static void plugin_init(void) mainwin->folderview->news_factory); syl_plugin_add_symbol("summaryview", mainwin->summaryview); - syl_plugin_add_symbol("summary_select_by_msgnum", - 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); - syl_plugin_add_symbol("messageview_show", messageview_show); - - syl_plugin_add_symbol("compose_new", compose_new); - syl_plugin_add_symbol("compose_entry_set", compose_entry_set); - syl_plugin_add_symbol("compose_entry_append", compose_entry_append); - syl_plugin_add_symbol("compose_entry_get_text", compose_entry_get_text); - syl_plugin_add_symbol("compose_lock", compose_lock); - syl_plugin_add_symbol("compose_unlock", compose_unlock); - - syl_plugin_add_symbol("foldersel_folder_sel", - foldersel_folder_sel); - syl_plugin_add_symbol("foldersel_folder_sel_full", - foldersel_folder_sel_full); - syl_plugin_add_symbol("input_dialog", input_dialog); - syl_plugin_add_symbol("input_dialog_with_invisible", - input_dialog_with_invisible); - - syl_plugin_add_symbol("manage_window_set_transient", - manage_window_set_transient); - syl_plugin_add_symbol("manage_window_signals_connect", - manage_window_signals_connect); - syl_plugin_add_symbol("manage_window_get_focus_window", - manage_window_get_focus_window); - - syl_plugin_add_symbol("inc_mail", inc_mail); - syl_plugin_add_symbol("inc_is_active", inc_is_active); - syl_plugin_add_symbol("inc_lock", inc_lock); - syl_plugin_add_symbol("inc_unlock", inc_unlock); + + ADD_SYM(summary_select_by_msgnum); + ADD_SYM(summary_select_by_msginfo); + ADD_SYM(summary_lock); + ADD_SYM(summary_unlock); + ADD_SYM(summary_is_locked); + + ADD_SYM(messageview_create_with_new_window); + ADD_SYM(messageview_show); + + ADD_SYM(compose_new); + ADD_SYM(compose_entry_set); + ADD_SYM(compose_entry_append); + ADD_SYM(compose_entry_get_text); + ADD_SYM(compose_lock); + ADD_SYM(compose_unlock); + + ADD_SYM(foldersel_folder_sel); + ADD_SYM(foldersel_folder_sel_full); + + ADD_SYM(input_dialog); + ADD_SYM(input_dialog_with_invisible); + + ADD_SYM(manage_window_set_transient); + ADD_SYM(manage_window_signals_connect); + ADD_SYM(manage_window_get_focus_window); + + ADD_SYM(inc_mail); + ADD_SYM(inc_is_active); + ADD_SYM(inc_lock); + ADD_SYM(inc_unlock); #if USE_UPDATE_CHECK - syl_plugin_add_symbol("update_check", update_check); - syl_plugin_add_symbol("update_check_set_check_url", - update_check_set_check_url); - syl_plugin_add_symbol("update_check_get_check_url", - update_check_get_check_url); - syl_plugin_add_symbol("update_check_set_jump_url", - update_check_set_jump_url); - syl_plugin_add_symbol("update_check_get_jump_url", - update_check_get_jump_url); + ADD_SYM(update_check); + ADD_SYM(update_check_set_check_url); + ADD_SYM(update_check_get_check_url); + ADD_SYM(update_check_set_jump_url); + ADD_SYM(update_check_get_jump_url); #endif syl_plugin_signal_connect("plugin-load", G_CALLBACK(load_cb), NULL); -- cgit v1.2.3