diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-07-12 19:12:24 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-07-12 19:12:24 +0800 |
commit | 61f1dcadb9567d95440a6b0f4ea0863401c2934e (patch) | |
tree | e4bf62176d2b66f1ab7e3d14c2279d173aaabcc1 /src/ephy-shell.c | |
parent | 50a00ee6f89a730e2f991dec4696d2d94b602456 (diff) | |
download | gsoc2013-epiphany-61f1dcadb9567d95440a6b0f4ea0863401c2934e.tar gsoc2013-epiphany-61f1dcadb9567d95440a6b0f4ea0863401c2934e.tar.gz gsoc2013-epiphany-61f1dcadb9567d95440a6b0f4ea0863401c2934e.tar.bz2 gsoc2013-epiphany-61f1dcadb9567d95440a6b0f4ea0863401c2934e.tar.lz gsoc2013-epiphany-61f1dcadb9567d95440a6b0f4ea0863401c2934e.tar.xz gsoc2013-epiphany-61f1dcadb9567d95440a6b0f4ea0863401c2934e.tar.zst gsoc2013-epiphany-61f1dcadb9567d95440a6b0f4ea0863401c2934e.zip |
Very simple plugin framework, unused for now. We will start making
2003-07-12 Marco Pesenti Gritti <marco@it.gnome.org>
* configure.in:
* plugins/.cvsignore:
* plugins/Makefile.am:
* plugins/sample/.cvsignore:
* plugins/sample/Makefile.am:
* plugins/sample/sample.c: (bmks_changed), (plugin_init),
(plugin_exit):
* src/Makefile.am:
* src/ephy-plugin.c: (ephy_plugin_get_type), (ephy_plugin_new),
(ephy_plugin_load), (ephy_plugin_unload), (ephy_plugin_class_init),
(ephy_plugin_init), (ephy_plugin_finalize):
* src/ephy-plugin.h:
* src/ephy-shell.c: (ephy_shell_load_plugins), (ephy_shell_init),
(ephy_shell_finalize):
Very simple plugin framework, unused for now.
We will start making something useful with it only post 1.0
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r-- | src/ephy-shell.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c index ab53ae065..3a0d43b0e 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -34,6 +34,7 @@ #include "ephy-bookmarks-editor.h" #include "ephy-history-window.h" #include "ephy-debug.h" +#include "ephy-plugin.h" #include "toolbar.h" #include <string.h> @@ -43,6 +44,7 @@ #include <gtk/gtksignal.h> #include <gtk/gtkmain.h> #include <gtk/gtkmessagedialog.h> +#include <dirent.h> #ifdef ENABLE_NAUTILUS_VIEW @@ -61,6 +63,7 @@ struct EphyShellPrivate EphyToolbarsModel *toolbars_model; GtkWidget *bme; GtkWidget *history_window; + GList *plugins; }; static void @@ -146,6 +149,39 @@ ephy_shell_new_window_cb (EphyEmbedShell *shell, } static void +ephy_shell_load_plugins (EphyShell *es) +{ + DIR *d; + struct dirent *e; + + d = opendir (PLUGINS_DIR); + + if (d == NULL) + { + return; + } + + while ((e = readdir (d)) != NULL) + { + char *plugin; + + plugin = g_strconcat (PLUGINS_DIR"/", e->d_name, NULL); + + if (g_str_has_suffix (plugin, ".so")) + { + EphyPlugin *obj; + + obj = ephy_plugin_new (plugin); + es->priv->plugins = g_list_append + (es->priv->plugins, obj); + } + + g_free (plugin); + } + closedir (d); +} + +static void ephy_shell_init (EphyShell *gs) { EphyEmbedSingle *single; @@ -157,6 +193,7 @@ ephy_shell_init (EphyShell *gs) gs->priv->bme = NULL; gs->priv->history_window = NULL; gs->priv->toolbars_model = NULL; + gs->priv->plugins = NULL; ephy_shell = gs; g_object_add_weak_pointer (G_OBJECT(ephy_shell), @@ -195,6 +232,8 @@ ephy_shell_init (EphyShell *gs) exit (0); } + + ephy_shell_load_plugins (gs); } static void @@ -211,6 +250,9 @@ ephy_shell_finalize (GObject *object) g_assert (ephy_shell == NULL); + g_list_foreach (gs->priv->plugins, (GFunc)g_type_module_unuse, NULL); + g_list_free (gs->priv->plugins); + LOG ("Unref toolbars model") if (gs->priv->toolbars_model) { |