diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-06-17 01:42:14 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2009-06-17 01:42:14 +0000 |
commit | 0951fc45bce0c64e1124edb1bbd02e762b11463f (patch) | |
tree | 14eb9272b4ec05718171e76a9c7c9588397cfb06 | |
parent | a59340f334c6baba99236e61ab0d50058629d1e0 (diff) |
added plugin API.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2168 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/libsylpheed-plugin-0.def | 2 | ||||
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/plugin.c | 15 | ||||
-rw-r--r-- | src/plugin.h | 4 |
5 files changed, 26 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2009-06-17 + + * src/plugin.[ch] + src/main.c + src/libsylpheed-plugin-0.def: made syl_plugin_lookup_symbol() + public. Added syl_plugin_main_window_get_statusbar(). + 2009-06-12 * plugin/test/Makefile.am: do not install automatically (added make diff --git a/src/libsylpheed-plugin-0.def b/src/libsylpheed-plugin-0.def index af7f91cd..24fbfea6 100644 --- a/src/libsylpheed-plugin-0.def +++ b/src/libsylpheed-plugin-0.def @@ -39,3 +39,5 @@ EXPORTS syl_plugin_menu_set_sensitive_all @ 37
syl_plugin_menu_set_active @ 38
syl_plugin_manage_window_get_focus_window @ 39
+ syl_plugin_main_window_get_statusbar @ 40
+ syl_plugin_lookup_symbol @ 41
@@ -1023,6 +1023,7 @@ static void plugin_init(void) syl_plugin_add_symbol("app_will_exit", app_will_exit); 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", diff --git a/src/plugin.c b/src/plugin.c index 062200ff..69270ecf 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -34,8 +34,6 @@ enum { LAST_SIGNAL }; -#define syl_plugin_lookup_symbol(name) g_hash_table_lookup(sym_table, name) - #define SAFE_CALL(func_ptr) { if (func_ptr) func_ptr(); } #define SAFE_CALL_RET(func_ptr) (func_ptr ? func_ptr() : NULL) #define SAFE_CALL_ARG1(func_ptr, arg1) { if (func_ptr) func_ptr(arg1); } @@ -312,6 +310,11 @@ gint syl_plugin_add_symbol(const gchar *name, gpointer sym) return 0; } +gpointer syl_plugin_lookup_symbol(const gchar *name) +{ + return g_hash_table_lookup(sym_table, name); +} + const gchar *syl_plugin_get_prog_version(void) { gpointer sym; @@ -336,6 +339,14 @@ void syl_plugin_main_window_popup(gpointer mainwin) SAFE_CALL_ARG1(func, mainwin); } +GtkWidget *syl_plugin_main_window_get_statusbar(void) +{ + gpointer widget; + + widget = syl_plugin_lookup_symbol("main_window_statusbar"); + return GTK_WIDGET(widget); +} + void syl_plugin_app_will_exit(gboolean force) { void (*func)(gboolean); diff --git a/src/plugin.h b/src/plugin.h index 6a120731..177a8463 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -93,7 +93,8 @@ GSList *syl_plugin_get_module_list (void); SylPluginInfo *syl_plugin_get_info (GModule *module); gboolean syl_plugin_check_version (GModule *module); -gint syl_plugin_add_symbol (const gchar *name, gpointer sym); +gint syl_plugin_add_symbol (const gchar *name, gpointer sym); +gpointer syl_plugin_lookup_symbol (const gchar *name); /* Interfaces which should be implemented by plug-ins void plugin_load(void); @@ -108,6 +109,7 @@ const gchar *syl_plugin_get_prog_version (void); gpointer syl_plugin_main_window_get (void); void syl_plugin_main_window_popup (gpointer mainwin); +GtkWidget *syl_plugin_main_window_get_statusbar (void); void syl_plugin_app_will_exit (gboolean force); |