aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac20
-rw-r--r--data/Makefile.am4
-rw-r--r--data/epiphany.convert1
-rw-r--r--data/epiphany.m475
-rw-r--r--data/epiphany.pc.in1
-rw-r--r--data/org.gnome.epiphany.gschema.xml5
-rw-r--r--doc/reference/Makefile.am1
-rw-r--r--lib/Makefile.am5
-rw-r--r--lib/ephy-module.c222
-rw-r--r--lib/ephy-module.h52
-rw-r--r--lib/ephy-prefs.h1
-rw-r--r--lib/ephy-shlib-loader.c245
-rw-r--r--lib/ephy-shlib-loader.h60
-rw-r--r--m4/introspection.m494
-rw-r--r--src/Makefile.am114
-rw-r--r--src/ephy-extension.c91
-rw-r--r--src/ephy-extension.h79
-rw-r--r--src/ephy-extensions-manager.c1159
-rw-r--r--src/ephy-extensions-manager.h92
-rw-r--r--src/ephy-main.c8
-rw-r--r--src/ephy-session.c1
-rw-r--r--src/ephy-shell.c64
-rw-r--r--src/ephy-shell.h2
-rw-r--r--src/ephy-window.c21
-rw-r--r--src/epiphany.h.in2
-rw-r--r--src/resources/epiphany-ui.xml1
26 files changed, 15 insertions, 2405 deletions
diff --git a/configure.ac b/configure.ac
index fd54c0e88..dd3d8261a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,23 +158,6 @@ AC_TYPE_SIZE_T
AC_CHECK_HEADERS([X11/XF86keysym.h])
-EPIPHANY_FEATURES=
-
-# *********************
-# GObject Introspection
-# *********************
-
-GOBJECT_INTROSPECTION_CHECK([0.9.5])
-
-if test "$with_webkit2" = "no"; then
- if test "$found_introspection" = "yes"; then
- EPIPHANY_FEATURES="$EPIPHANY_FEATURES introspection"
- AC_DEFINE([ENABLE_INTROSPECTION], [1], [Define to enable introspection support])
- fi
-else
- found_introspection=no
-fi
-
# ***
# NSS
# ***
@@ -193,8 +176,6 @@ fi
AM_CONDITIONAL([ENABLE_NSS],[test "$enable_nss" = "yes"])
-AC_SUBST([EPIPHANY_FEATURES])
-
# *******************************
# Add warning flags
# *******************************
@@ -309,7 +290,6 @@ Epiphany was configured with the following options:
Build tests : $enable_tests
Code coverage : $enable_code_coverage
- GObject introspection : $found_introspection
NSS support : $enable_nss
WebKit2 : $with_webkit2
"
diff --git a/data/Makefile.am b/data/Makefile.am
index 7b7b89c8c..1d0ea3851 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -25,9 +25,6 @@ aboutdialog_DATA = about.ini
mimepermissiondir = $(pkgdatadir)
mimepermission_DATA = mime-types-permissions.xml
-m4datadir = $(datadir)/aclocal
-m4data_DATA = epiphany.m4
-
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = epiphany-$(EPIPHANY_API_VERSION).pc
@@ -70,7 +67,6 @@ EXTRA_DIST = \
$(pkgconfig_DATA) \
$(xsl_DATA) \
$(service_DATA) \
- $(m4data_DATA) \
$(default_bookmarks_in_files) \
$(gsettings_SCHEMAS) \
$(convert_DATA) \
diff --git a/data/epiphany.convert b/data/epiphany.convert
index 5ec75185a..66b37aff8 100644
--- a/data/epiphany.convert
+++ b/data/epiphany.convert
@@ -9,7 +9,6 @@ keyword-search-url = /apps/epiphany/general/url_search
managed-network = /apps/epiphany/general/managed_network
enable-smooth-scrolling = /apps/epiphany/web/smooth_scroll
enable-caret-browsing = /apps/epiphany/web/browse_with_caret
-enabled-extensions = /apps/epiphany/general/active_extensions
[org.gnome.Epiphany.ui]
always-show-tabs-bar = /apps/epiphany/general/always_show_tabs_bar
diff --git a/data/epiphany.m4 b/data/epiphany.m4
deleted file mode 100644
index d912a0e62..000000000
--- a/data/epiphany.m4
+++ /dev/null
@@ -1,75 +0,0 @@
-## epiphany.m4 - Macros for building epiphany extensions. -*-Shell-script-*-
-## Copyright © Crispin Flowerday <crispin@gnome.org>
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-##
-## As a special exception to the GNU General Public License, if you
-## distribute this file as part of a program that contains a
-## configuration script generated by Autoconf, you may include it under
-## the same distribution terms that you use for the rest of that program.
-
-
-# Usage:
-# EPIPHANY_EXTENSION_INIT(ephy-api-version, [minimum-ephy-version])
-#
-# Side effects:
-# EPIPHANY_EXTENSIONS_DIR is set to the directory to install extensions in
-# EPIPHANY_EXTENSION_RULE can be used to translate .ephy-extension files
-AC_DEFUN([EPIPHANY_EXTENSION_INIT],
-[
-dnl Check we have an api-version
-ifelse([$1], [], [AC_MSG_ERROR([Required Epiphany API version not supplied])], [])
-
-_epiphany_api_version=$1
-
-AC_MSG_CHECKING([whether epiphany-$_epiphany_api_version is available])
-PKG_CHECK_EXISTS([epiphany-$_epiphany_api_version], [result=yes],[result=no])
-AC_MSG_RESULT([$result])
-
-if test $result = "no" ; then
- AC_MSG_ERROR([Epiphany API version $_epiphany_api_version is required
-
-This API version is used in the $_epiphany_api_version stable series, and
-the preceeding development series. Please ensure you have the appropriate
-Epiphany version installed.])
-fi
-
-dnl Check the minimum version
-ifelse([$2], [], [],
-[
- AC_MSG_CHECKING([whether minimum epiphany version $2 is available])
- PKG_CHECK_EXISTS([epiphany-$_epiphany_api_version >= $2], [result=yes], [result=no])
- AC_MSG_RESULT([$result])
-
- if test $result = "no" ; then
- AC_MSG_ERROR([The minimum epiphany version supported by this application is $2.
-
-Please upgrade to at least $2. If you have compiled a later version it is
-possible pkg-config isn't finding it, in which case set the PKG_CONFIG_PATH
-environment variable.])
- fi
-])
-
-dnl set the EPIPHANY_EXTENSIONS_DIR variable
-EPIPHANY_EXTENSIONS_DIR="`$PKG_CONFIG --variable=extensionsdir epiphany-$_epiphany_api_version`"
-AC_SUBST([EPIPHANY_EXTENSIONS_DIR])
-
-dnl Add a rule that auto-translates the .ephy-extension files
-dnl (like the INTLTOOL_XML_RULE does for xml files)
-EPIPHANY_EXTENSION_RULE='%.ephy-extension: %.ephy-extension.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
-
-AC_SUBST(EPIPHANY_EXTENSION_RULE)
-
-])
diff --git a/data/epiphany.pc.in b/data/epiphany.pc.in
index 5a27ef0a4..5dedeabe2 100644
--- a/data/epiphany.pc.in
+++ b/data/epiphany.pc.in
@@ -2,7 +2,6 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@/epiphany/@EPIPHANY_MAJOR@
-extensionsdir=@libdir@/@PACKAGE@/@EPIPHANY_API_VERSION@/extensions
loaderdir=@libdir@/@PACKAGE@/@EPIPHANY_MAJOR@/loaders
datarootdir=@datarootdir@
datadir=@datadir@
diff --git a/data/org.gnome.epiphany.gschema.xml b/data/org.gnome.epiphany.gschema.xml
index f97681e40..c94df5fd1 100644
--- a/data/org.gnome.epiphany.gschema.xml
+++ b/data/org.gnome.epiphany.gschema.xml
@@ -50,11 +50,6 @@
<default>false</default>
<summary>Enable smooth scrolling</summary>
</key>
- <key type="as" name="enabled-extensions">
- <default>['extensions-manager-ui' ]</default>
- <summary>Active extensions</summary>
- <description>Lists the active extensions.</description>
- </key>
<key type="b" name="internal-view-source">
<default>true</default>
<summary>Don't use an external application to view page source.</summary>
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 0af97d78f..04b1aba07 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -66,7 +66,6 @@ IGNORE_HFILES = \
ephy-completion-model.h \
ephy-encoding-dialog.h \
ephy-encoding-menu.h \
- ephy-extension.h \
ephy-favicon-action.h \
ephy-favorites-menu.h \
ephy-history-window.h \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 62508b194..5992bf5f3 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -14,13 +14,11 @@ NOINST_H_FILES = \
ephy-file-helpers.h \
ephy-gui.h \
ephy-langs.h \
- ephy-module.h \
ephy-node-filter.h \
ephy-node-common.h \
ephy-object-helpers.h \
ephy-prefs.h \
ephy-profile-utils.h \
- ephy-shlib-loader.h \
ephy-signal-accumulator.h \
ephy-smaps.h \
ephy-sqlite.h \
@@ -53,7 +51,6 @@ libephymisc_la_SOURCES = \
ephy-gui.c \
ephy-langs.c \
ephy-loader.c \
- ephy-module.c \
ephy-node.c \
ephy-node.h \
ephy-node-filter.c \
@@ -64,7 +61,6 @@ libephymisc_la_SOURCES = \
ephy-profile-utils.c \
ephy-profile-utils.h \
ephy-settings.c \
- ephy-shlib-loader.c \
ephy-signal-accumulator.c \
ephy-smaps.c \
ephy-snapshot-service.c \
@@ -88,7 +84,6 @@ libephymisc_la_CPPFLAGS = \
-DSHARE_DIR=\"$(pkgdatadir)\" \
-DTOP_SRC_DATADIR=\"$(top_srcdir)/data\" \
-DABS_TOP_BUILD_DIR=\"$(abs_top_builddir)\" \
- -DEXTENSIONS_DIR=\""$(pkglibdir)/$(EPIPHANY_API_VERSION)/extensions"\" \
$(AM_CPPFLAGS)
libephymisc_la_CFLAGS = \
diff --git a/lib/ephy-module.c b/lib/ephy-module.c
deleted file mode 100644
index 08c0f86a1..000000000
--- a/lib/ephy-module.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003, 2004 Christian Persch
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-
-#include "ephy-module.h"
-#include "ephy-file-helpers.h"
-#include "ephy-debug.h"
-
-#include <gmodule.h>
-
-typedef struct _EphyModuleClass EphyModuleClass;
-
-struct _EphyModuleClass
-{
- GTypeModuleClass parent_class;
-};
-
-struct _EphyModule
-{
- GTypeModule parent_instance;
-
- GModule *library;
-
- char *path;
- GType type;
- guint resident : 1;
-};
-
-typedef GType (*EphyModuleRegisterFunc) (GTypeModule *);
-
-static void ephy_module_init (EphyModule *action);
-static void ephy_module_class_init (EphyModuleClass *class);
-
-G_DEFINE_TYPE (EphyModule, ephy_module, G_TYPE_TYPE_MODULE)
-
-static gboolean
-ephy_module_load (GTypeModule *gmodule)
-{
- EphyModule *module = EPHY_MODULE (gmodule);
- EphyModuleRegisterFunc register_func;
- gboolean is_absolute;
- GModuleFlags flags = G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY;
-
- LOG ("Loading %s", module->path);
-
- /* In debug builds, we bind immediately so we can find missing
- * symbols in extensions on load; otherwise we bind lazily
- */
-#ifdef GNOME_ENABLE_DEBUG
- flags &= ~G_MODULE_BIND_LAZY;
-#endif
-
- is_absolute = g_path_is_absolute (module->path);
-
- if (module->library == NULL && ! is_absolute)
- {
- char *path = g_build_filename (EXTENSIONS_DIR, module->path, NULL);
-
- module->library = g_module_open (path, flags);
-
- g_free (path);
- }
-
- if (module->library == NULL && ! is_absolute)
- {
- char *path = g_build_filename (ephy_dot_dir(), "extensions", module->path, NULL);
-
- module->library = g_module_open (path, flags);
-
- g_free (path);
- }
-
- if (module->library == NULL)
- {
- module->library = g_module_open (module->path, flags);
- }
-
- if (module->library == NULL)
- {
- g_warning ("%s", g_module_error());
-
- return FALSE;
- }
-
- /* extract symbols from the lib */
- if (!g_module_symbol (module->library, "register_module",
- (void *) &register_func))
- {
- g_warning ("%s", g_module_error());
- g_module_close (module->library);
-
- return FALSE;
- }
-
- /* symbol can still be NULL even though g_module_symbol returned TRUE */
- if (!register_func)
- {
- g_warning ("Symbol 'register_module' is NULL!");
- g_module_close (module->library);
-
- return FALSE;
- }
-
- module->type = register_func (gmodule);
-
- if (module->type == 0)
- {
- g_warning ("Failed to register the GType(s)!");
- g_module_close (module->library);
-
- return FALSE;
- }
-
- if (module->resident)
- {
- g_module_make_resident (module->library);
- }
-
- return TRUE;
-}
-
-static void
-ephy_module_unload (GTypeModule *gmodule)
-{
- EphyModule *module = EPHY_MODULE (gmodule);
-
- LOG ("Unloading %s", module->path);
-
- g_module_close (module->library);
-
- module->library = NULL;
- module->type = 0;
-}
-
-const char *
-ephy_module_get_path (EphyModule *module)
-{
- g_return_val_if_fail (EPHY_IS_MODULE (module), NULL);
-
- return module->path;
-}
-
-GObject *
-ephy_module_new_object (EphyModule *module)
-{
- LOG ("Creating object of type %s", g_type_name (module->type));
-
- if (module->type == 0)
- {
- return NULL;
- }
-
- return g_object_new (module->type, NULL);
-}
-
-static void
-ephy_module_init (EphyModule *module)
-{
- LOG ("EphyModule %p initialising", module);
-}
-
-static void
-ephy_module_finalize (GObject *object)
-{
- EphyModule *module = EPHY_MODULE (object);
-
- LOG ("EphyModule %p finalising", module);
-
- g_free (module->path);
-
- G_OBJECT_CLASS (ephy_module_parent_class)->finalize (object);
-}
-
-static void
-ephy_module_class_init (EphyModuleClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
- GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (class);
-
- object_class->finalize = ephy_module_finalize;
-
- module_class->load = ephy_module_load;
- module_class->unload = ephy_module_unload;
-}
-
-EphyModule *
-ephy_module_new (const char *path,
- gboolean resident)
-{
- EphyModule *result;
-
- if (path == NULL || path[0] == '\0')
- {
- return NULL;
- }
-
- result = g_object_new (EPHY_TYPE_MODULE, NULL);
-
- g_type_module_set_name (G_TYPE_MODULE (result), path);
- result->path = g_strdup (path);
- result->resident = resident != FALSE;
-
- return result;
-}
diff --git a/lib/ephy-module.h b/lib/ephy-module.h
deleted file mode 100644
index b4e0006ac..000000000
--- a/lib/ephy-module.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003, 2004 Christian Persch
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION)
-#error "Only <epiphany/epiphany.h> can be included directly."
-#endif
-
-#ifndef EPHY_MODULE_H
-#define EPHY_MODULE_H
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_MODULE (ephy_module_get_type ())
-#define EPHY_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_MODULE, EphyModule))
-#define EPHY_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_MODULE, EphyModuleClass))
-#define EPHY_IS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_MODULE))
-#define EPHY_IS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EPHY_TYPE_MODULE))
-#define EPHY_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_MODULE, EphyModuleClass))
-
-typedef struct _EphyModule EphyModule;
-
-GType ephy_module_get_type (void);
-
-EphyModule *ephy_module_new (const char *path,
- gboolean resident);
-
-const char *ephy_module_get_path (EphyModule *module);
-
-GObject *ephy_module_new_object (EphyModule *module);
-
-G_END_DECLS
-
-#endif
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index ccc7238d8..b95458310 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -122,7 +122,6 @@ typedef enum
#define EPHY_PREFS_MANAGED_NETWORK "managed-network"
#define EPHY_PREFS_ENABLE_SMOOTH_SCROLLING "enable-smooth-scrolling"
#define EPHY_PREFS_ENABLE_CARET_BROWSING "enable-caret-browsing"
-#define EPHY_PREFS_ENABLED_EXTENSIONS "enabled-extensions"
#define EPHY_PREFS_INTERNAL_VIEW_SOURCE "internal-view-source"
#define EPHY_PREFS_RESTORE_SESSION_POLICY "restore-session-policy"
diff --git a/lib/ephy-shlib-loader.c b/lib/ephy-shlib-loader.c
deleted file mode 100644
index 2ae2b1d4e..000000000
--- a/lib/ephy-shlib-loader.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003, 2004 Christian Persch
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-
-#include "ephy-shlib-loader.h"
-#include "ephy-loader.h"
-#include "ephy-module.h"
-#include "ephy-debug.h"
-
-#include <string.h>
-
-#define DATA_KEY "EphyShlibLoader::LoaderData"
-
-typedef struct
-{
- EphyModule *module;
- GObject *object;
-} LoaderData;
-
-#define EPHY_SHLIB_LOADER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SHLIB_LOADER, EphyShlibLoaderPrivate))
-
-struct _EphyShlibLoaderPrivate
-{
- GSList *data;
-};
-
-static void ephy_shlib_loader_class_init (EphyShlibLoaderClass *klass);
-static void ephy_shlib_loader_iface_init (EphyLoaderIface *iface);
-static void ephy_shlib_loader_init (EphyShlibLoader *loader);
-
-static GObjectClass *parent_class = NULL;
-
-GType
-ephy_shlib_loader_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo our_info =
- {
- sizeof (EphyShlibLoaderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) ephy_shlib_loader_class_init,
- NULL,
- NULL, /* class_data */
- sizeof (EphyShlibLoader),
- 0, /* n_preallocs */
- (GInstanceInitFunc) ephy_shlib_loader_init
- };
-
- const GInterfaceInfo loader_info =
- {
- (GInterfaceInitFunc) ephy_shlib_loader_iface_init,
- NULL,
- NULL
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "EphyShlibLoader",
- &our_info, 0);
-
- g_type_add_interface_static (type,
- EPHY_TYPE_LOADER,
- &loader_info);
- }
-
- return type;
-}
-
-static void
-free_loader_data (LoaderData *data)
-{
- g_return_if_fail (data != NULL);
-
- /* data->module must NOT be unreffed! */
-
- if (data->object != NULL)
- {
- g_object_unref (data->object);
- }
-
- g_free (data);
-}
-
-static void
-ephy_shlib_loader_init (EphyShlibLoader *loader)
-{
- loader->priv = EPHY_SHLIB_LOADER_GET_PRIVATE (loader);
-
- LOG ("EphyShlibLoader initialising");
-}
-
-static void
-ephy_shlib_loader_finalize (GObject *object)
-{
- EphyShlibLoader *loader = EPHY_SHLIB_LOADER (object);
-
- LOG ("EphyShlibLoader finalising");
-
- g_slist_foreach (loader->priv->data, (GFunc) free_loader_data, NULL);
- g_slist_free (loader->priv->data);
-
- parent_class->finalize (object);
-}
-
-static int
-find_library (const LoaderData *data,
- const char *library)
-{
- return strcmp (ephy_module_get_path (data->module), library);
-}
-
-static int
-find_object (const LoaderData *data,
- const GObject *object)
-{
- return data->object != object;
-}
-
-static GObject *
-impl_get_object (EphyLoader *eloader,
- GKeyFile *keyfile)
-{
- EphyShlibLoader *loader = EPHY_SHLIB_LOADER (eloader);
- GSList *l;
- LoaderData *data = NULL;
- char *library;
- gboolean resident;
-
- g_return_val_if_fail (keyfile != NULL, NULL);
-
- library = g_key_file_get_string (keyfile, "Loader", "Library", NULL);
- if (library == NULL)
- {
- g_warning ("NULL library name!\n");
- return NULL;
- }
-
- resident = g_key_file_get_boolean (keyfile, "Loader", "Resident", NULL);
-
- l = g_slist_find_custom (loader->priv->data, library,
- (GCompareFunc) find_library);
-
- if (l != NULL)
- {
- data = l->data;
- g_return_val_if_fail (data != NULL, NULL);
-
- if (data->object != NULL)
- {
- g_free (library);
- return g_object_ref (data->object);
- }
- }
- else
- {
- data = g_new0 (LoaderData, 1);
- loader->priv->data = g_slist_prepend (loader->priv->data, data);
- }
-
- if (data->module == NULL)
- {
- data->module = ephy_module_new (library, resident);
- }
-
- g_return_val_if_fail (data->object == NULL, data->object);
-
- if (g_type_module_use (G_TYPE_MODULE (data->module)) == FALSE)
- {
- g_free (library);
- g_warning ("Could not load extension file at %s\n",
- ephy_module_get_path (data->module));
- return NULL;
- }
-
- data->object = ephy_module_new_object (data->module);
-
- g_type_module_unuse (G_TYPE_MODULE (data->module));
-
- if (data->object != NULL)
- {
- g_object_set_data (G_OBJECT (data->object), DATA_KEY, data);
- }
-
- g_free (library);
-
- return data->object;
-}
-
-static void
-impl_release_object (EphyLoader *eloader,
- GObject *object)
-{
- EphyShlibLoader *loader = EPHY_SHLIB_LOADER (eloader);
- GSList *l;
- LoaderData *data;
-
- l = g_slist_find_custom (loader->priv->data, object,
- (GCompareFunc) find_object);
- g_return_if_fail (l != NULL);
- data = l->data;
-
- g_object_unref (data->object);
- data->object = NULL;
-}
-
-static void
-ephy_shlib_loader_iface_init (EphyLoaderIface *iface)
-{
- iface->type = "shlib";
- iface->get_object = impl_get_object;
- iface->release_object = impl_release_object;
-}
-
-static void
-ephy_shlib_loader_class_init (EphyShlibLoaderClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = ephy_shlib_loader_finalize;
-
- g_type_class_add_private (object_class, sizeof (EphyShlibLoaderPrivate));
-}
diff --git a/lib/ephy-shlib-loader.h b/lib/ephy-shlib-loader.h
deleted file mode 100644
index 50f4404e5..000000000
--- a/lib/ephy-shlib-loader.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003, 2004 Christian Persch
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION)
-#error "Only <epiphany/epiphany.h> can be included directly."
-#endif
-
-#ifndef EPHY_SHLIB_LOADER_H
-#define EPHY_SHLIB_LOADER_H
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_SHLIB_LOADER (ephy_shlib_loader_get_type ())
-#define EPHY_SHLIB_LOADER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_SHLIB_LOADER, EphyShlibLoader))
-#define EPHY_SHLIB_LOADER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_SHLIB_LOADER, EphyShlibLoaderClass))
-#define EPHY_IS_SHLIB_LOADER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_SHLIB_LOADER))
-#define EPHY_IS_SHLIB_LOADER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_SHLIB_LOADER))
-#define EPHY_SHLIB_LOADER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_SHLIB_LOADER, EphyShlibLoaderClass))
-
-typedef struct _EphyShlibLoader EphyShlibLoader;
-typedef struct _EphyShlibLoaderPrivate EphyShlibLoaderPrivate;
-typedef struct _EphyShlibLoaderClass EphyShlibLoaderClass;
-
-struct _EphyShlibLoaderClass
-{
- GObjectClass parent_class;
-};
-
-struct _EphyShlibLoader
-{
- GObject parent_instance;
-
- /*< private >*/
- EphyShlibLoaderPrivate *priv;
-};
-
-GType ephy_shlib_loader_get_type (void);
-
-G_END_DECLS
-
-#endif
diff --git a/m4/introspection.m4 b/m4/introspection.m4
deleted file mode 100644
index 589721c5a..000000000
--- a/m4/introspection.m4
+++ /dev/null
@@ -1,94 +0,0 @@
-dnl -*- mode: autoconf -*-
-dnl Copyright 2009 Johan Dahlin
-dnl
-dnl This file is free software; the author(s) gives unlimited
-dnl permission to copy and/or distribute it, with or without
-dnl modifications, as long as this notice is preserved.
-dnl
-
-# serial 1
-
-m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
-[
- AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
- AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
- AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
-
- dnl enable/disable introspection
- m4_if([$2], [require],
- [dnl
- enable_introspection=yes
- ],[dnl
- AC_ARG_ENABLE(introspection,
- AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
- [Enable introspection for this build]),,
- [enable_introspection=auto])
- ])dnl
-
- AC_MSG_CHECKING([for gobject-introspection])
-
- dnl presence/version checking
- AS_CASE([$enable_introspection],
- [no], [dnl
- found_introspection="no (disabled, use --enable-introspection to enable)"
- ],dnl
- [yes],[dnl
- PKG_CHECK_EXISTS([gobject-introspection-1.0],,
- AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
- found_introspection=yes,
- AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
- ],dnl
- [auto],[dnl
- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
- ],dnl
- [dnl
- AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
- ])dnl
-
- AC_MSG_RESULT([$found_introspection])
-
- INTROSPECTION_SCANNER=
- INTROSPECTION_COMPILER=
- INTROSPECTION_GENERATE=
- INTROSPECTION_GIRDIR=
- INTROSPECTION_TYPELIBDIR=
- if test "x$found_introspection" = "xyes"; then
- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
- INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
- INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
- INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
- INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
- fi
- AC_SUBST(INTROSPECTION_SCANNER)
- AC_SUBST(INTROSPECTION_COMPILER)
- AC_SUBST(INTROSPECTION_GENERATE)
- AC_SUBST(INTROSPECTION_GIRDIR)
- AC_SUBST(INTROSPECTION_TYPELIBDIR)
- AC_SUBST(INTROSPECTION_CFLAGS)
- AC_SUBST(INTROSPECTION_LIBS)
- AC_SUBST(INTROSPECTION_MAKEFILE)
-
- AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
-])
-
-
-dnl Usage:
-dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
-
-AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
-[
- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
-])
-
-dnl Usage:
-dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
-
-
-AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
-[
- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
-])
diff --git a/src/Makefile.am b/src/Makefile.am
index ada8e4716..b4618f7e5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,8 +40,6 @@ NOINST_H_FILES = \
window-commands.h
INST_H_FILES = \
- ephy-extension.h \
- ephy-extensions-manager.h \
ephy-link.h \
ephy-notebook.h \
ephy-session.h \
@@ -57,8 +55,6 @@ libephymain_la_SOURCES = \
ephy-combined-stop-reload-action.c \
ephy-encoding-dialog.c \
ephy-encoding-menu.c \
- ephy-extension.c \
- ephy-extensions-manager.c \
ephy-find-toolbar.c \
ephy-home-action.c \
ephy-history-window.c \
@@ -95,7 +91,6 @@ libephymain_la_CPPFLAGS = \
-I$(top_srcdir)/lib/history \
-I$(top_srcdir)/lib/widgets \
-I$(top_srcdir)/src/bookmarks \
- -DEXTENSIONS_DIR=\""$(pkglibdir)/$(EPIPHANY_API_VERSION)/extensions"\" \
-DLOADER_DIR=\""$(pkglibdir)/$(EPIPHANY_MAJOR)/loaders"\" \
-DDATADIR=\""$(pkgdatadir)"\" \
-DGNOMELOCALEDIR=\"$(datadir)/locale\" \
@@ -172,13 +167,6 @@ epiphany_LDADD = \
$(CODE_COVERAGE_LDFLAGS) \
$(LIBINTL)
-if !WITH_WEBKIT2
-if HAVE_INTROSPECTION
-epiphany_CFLAGS += $(INTROSPECTION_CFLAGS)
-epiphany_LDADD += $(INTROSPECTION_LIBS)
-endif
-endif
-
TYPES_SOURCE = \
ephy-type-builtins.c \
ephy-type-builtins.h
@@ -232,105 +220,3 @@ stamp-ephy-type-builtins.h: Makefile $(INST_H_FILES) $(NOINST_H_FILES)
CLEANFILES = $(stamp_files) $(BUILT_SOURCES)
DISTCLEANFILES = $(stamp_files) $(BUILT_SOURCES)
MAINTAINERCLEANFILES = $(stamp_files) $(BUILT_SOURCES)
-
-if !WITH_WEBKIT2
-if HAVE_INTROSPECTION
-EPHY_GIR_H_FILES = \
- $(top_srcdir)/embed/ephy-download.h \
- $(top_srcdir)/embed/ephy-embed.h \
- $(top_srcdir)/embed/ephy-embed-container.h \
- $(top_srcdir)/embed/ephy-embed-event.h \
- $(top_srcdir)/embed/ephy-embed-shell.h \
- $(top_srcdir)/embed/ephy-embed-single.h \
- $(top_srcdir)/embed/ephy-overview.h \
- $(top_srcdir)/embed/ephy-permission-manager.h \
- $(top_srcdir)/embed/ephy-web-view.h \
- $(top_srcdir)/lib/ephy-dialog.h \
- $(top_srcdir)/lib/ephy-node-db.h \
- $(top_srcdir)/lib/ephy-node.h \
- $(top_srcdir)/lib/ephy-state.h \
- $(top_srcdir)/lib/widgets/ephy-download-widget.h \
- $(top_srcdir)/lib/widgets/ephy-frecent-store.h \
- $(top_srcdir)/lib/widgets/ephy-search-entry.h \
- $(top_srcdir)/src/bookmarks/ephy-bookmarks.h \
- $(top_srcdir)/src/ephy-extension.h \
- $(top_srcdir)/src/ephy-extensions-manager.h \
- $(top_srcdir)/src/ephy-find-toolbar.h \
- $(top_srcdir)/src/ephy-link-action.h \
- $(top_srcdir)/src/ephy-link.h \
- $(top_srcdir)/src/ephy-location-controller.h \
- $(top_srcdir)/src/ephy-notebook.h \
- $(top_srcdir)/src/ephy-session.h \
- $(top_srcdir)/src/ephy-shell.h \
- $(top_srcdir)/src/ephy-window.h \
- $(NULL)
-
-EPHY_GIR_C_FILES = \
- $(top_srcdir)/embed/ephy-download.c \
- $(top_srcdir)/embed/ephy-embed.c \
- $(top_srcdir)/embed/ephy-embed-container.c \
- $(top_srcdir)/embed/ephy-embed-event.c \
- $(top_srcdir)/embed/ephy-embed-shell.c \
- $(top_srcdir)/embed/ephy-embed-single.c \
- $(top_srcdir)/embed/ephy-overview.c \
- $(top_srcdir)/embed/ephy-permission-manager.c \
- $(top_srcdir)/embed/ephy-web-view.c \
- $(top_srcdir)/lib/ephy-dialog.c \
- $(top_srcdir)/lib/ephy-node-db.c \
- $(top_srcdir)/lib/ephy-node.c \
- $(top_srcdir)/lib/ephy-state.c \
- $(top_srcdir)/lib/widgets/ephy-download-widget.c \
- $(top_srcdir)/lib/widgets/ephy-frecent-store.c \
- $(top_srcdir)/lib/widgets/ephy-search-entry.c \
- $(top_srcdir)/src/bookmarks/ephy-bookmarks.c \
- $(top_srcdir)/src/ephy-extension.c \
- $(top_srcdir)/src/ephy-extensions-manager.c \
- $(top_srcdir)/src/ephy-find-toolbar.c \
- $(top_srcdir)/src/ephy-link-action.c \
- $(top_srcdir)/src/ephy-link.c \
- $(top_srcdir)/src/ephy-location-controller.c \
- $(top_srcdir)/src/ephy-notebook.c \
- $(top_srcdir)/src/ephy-session.c \
- $(top_srcdir)/src/ephy-shell.c \
- $(top_srcdir)/src/ephy-window.c \
- $(NULL)
-
-Epiphany-$(EPIPHANY_API_VERSION).gir: $(INTROSPECTION_SCANNER) $(EPHY_GIR_H_FILES) \
- $(EPHY_GIR_C_FILES) epiphany
- $(AM_V_GEN) PKG_CONFIG_PATH=$(top_builddir)/data:$$PKG_CONFIG_PATH \
- $(INTROSPECTION_SCANNER) -v --warn-all \
- --identifier-prefix=Ephy \
- --symbol-prefix=ephy \
- --namespace=Epiphany \
- --nsversion=$(EPIPHANY_API_VERSION) \
- --add-include-path=. \
- --add-include-path=$(srcdir) \
- --include=Gtk-3.0 \
- --include=libxml2-2.0 \
- --include=WebKit-3.0 \
- --program=./epiphany \
- --output=$@ \
- --pkg=epiphany-$(EPIPHANY_API_VERSION) \
- -DEPIPHANY_COMPILATION \
- -I$(top_srcdir)/embed \
- -I$(top_srcdir)/lib \
- -I$(top_srcdir)/lib/egg \
- -I$(top_srcdir)/lib/widgets \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/src/bookmarks \
- $(EPHY_GIR_H_FILES) \
- $(EPHY_GIR_C_FILES)
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = Epiphany-$(EPIPHANY_API_VERSION).gir
-
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = Epiphany-$(EPIPHANY_API_VERSION).typelib
-
-Epiphany-$(EPIPHANY_API_VERSION).typelib: Epiphany-$(EPIPHANY_API_VERSION).gir $(INTROSPECTION_COMPILER)
- $(AM_V_GEN) $(INTROSPECTION_COMPILER) Epiphany-$(EPIPHANY_API_VERSION).gir --includedir=$(top_builddir)/src --includedir=$(srcdir) -o Epiphany-$(EPIPHANY_API_VERSION).typelib
-
-CLEANFILES += $(gir_DATA) $(typelibs_DATA)
-
-endif # HAVE_INTROSPECTION
-endif # !WITH_WEBKIT2
diff --git a/src/ephy-extension.c b/src/ephy-extension.c
deleted file mode 100644
index e78e6a606..000000000
--- a/src/ephy-extension.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003 Christian Persch
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-
-#include "ephy-extension.h"
-
-GType
-ephy_extension_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- const GTypeInfo our_info =
- {
- sizeof (EphyExtensionIface),
- NULL,
- NULL,
- };
-
- type = g_type_register_static (G_TYPE_INTERFACE,
- "EphyExtension",
- &our_info, 0);
- }
-
- return type;
-}
-
-void
-ephy_extension_attach_window (EphyExtension *extension,
- EphyWindow *window)
-{
- EphyExtensionIface *iface = EPHY_EXTENSION_GET_IFACE (extension);
- if (iface->attach_window)
- {
- iface->attach_window (extension, window);
- }
-}
-
-void
-ephy_extension_detach_window (EphyExtension *extension,
- EphyWindow *window)
-{
- EphyExtensionIface *iface = EPHY_EXTENSION_GET_IFACE (extension);
- if (iface->detach_window)
- {
- iface->detach_window (extension, window);
- }
-}
-
-void
-ephy_extension_attach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed)
-{
- EphyExtensionIface *iface = EPHY_EXTENSION_GET_IFACE (extension);
- if (iface->attach_tab)
- {
- iface->attach_tab (extension, window, embed);
- }
-}
-
-void
-ephy_extension_detach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed)
-{
- EphyExtensionIface *iface = EPHY_EXTENSION_GET_IFACE (extension);
- if (iface->detach_tab)
- {
- iface->detach_tab (extension, window, embed);
- }
-}
diff --git a/src/ephy-extension.h b/src/ephy-extension.h
deleted file mode 100644
index ab4657c5a..000000000
--- a/src/ephy-extension.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003 Christian Persch
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION)
-#error "Only <epiphany/epiphany.h> can be included directly."
-#endif
-
-#ifndef EPHY_EXTENSION_H
-#define EPHY_EXTENSION_H
-
-#include "ephy-embed.h"
-#include "ephy-window.h"
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_EXTENSION (ephy_extension_get_type ())
-#define EPHY_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_EXTENSION, EphyExtension))
-#define EPHY_EXTENSION_IFACE(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_EXTENSION, EphyExtensionIface))
-#define EPHY_IS_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_EXTENSION))
-#define EPHY_IS_EXTENSION_IFACE(class) (G_TYPE_CHECK_CLASS_TYPE ((class), EPHY_TYPE_EXTENSION))
-#define EPHY_EXTENSION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EPHY_TYPE_EXTENSION, EphyExtensionIface))
-
-typedef struct _EphyExtension EphyExtension;
-typedef struct _EphyExtensionIface EphyExtensionIface;
-
-struct _EphyExtensionIface
-{
- GTypeInterface base_iface;
-
- void (* attach_window) (EphyExtension *extension,
- EphyWindow *window);
- void (* detach_window) (EphyExtension *extension,
- EphyWindow *window);
- void (* attach_tab) (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed);
- void (* detach_tab) (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed);
-};
-
-GType ephy_extension_get_type (void);
-
-void ephy_extension_attach_window (EphyExtension *extension,
- EphyWindow *window);
-
-void ephy_extension_detach_window (EphyExtension *extension,
- EphyWindow *window);
-
-void ephy_extension_attach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed);
-
-void ephy_extension_detach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed);
-
-G_END_DECLS
-
-#endif
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c
deleted file mode 100644
index 71a888fc5..000000000
--- a/src/ephy-extensions-manager.c
+++ /dev/null
@@ -1,1159 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003, 2004 Christian Persch
- * Copyright © 2004 Adam Hooper
- * Copyright © 2005 Crispin Flowerday
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "ephy-extensions-manager.h"
-
-#include "ephy-debug.h"
-#include "ephy-embed-container.h"
-#include "ephy-file-helpers.h"
-#include "ephy-loader.h"
-#include "ephy-object-helpers.h"
-#include "ephy-prefs.h"
-#include "ephy-settings.h"
-#include "ephy-shell.h"
-#include "ephy-shlib-loader.h"
-
-#include <gio/gio.h>
-#include <gmodule.h>
-#include <string.h>
-
-#define EE_GROUP "Epiphany Extension"
-#define DOT_INI ".ephy-extension"
-#define RELOAD_DELAY 333 /* ms */
-#define RELOAD_SYNC_DELAY 1 /* seconds */
-
-#define EPHY_EXTENSIONS_MANAGER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_EXTENSIONS_MANAGER, EphyExtensionsManagerPrivate))
-
-struct _EphyExtensionsManagerPrivate
-{
- gboolean initialised;
-
- GList *data;
- GList *factories;
- GList *extensions;
- GList *dir_monitors;
- GList *windows;
- guint sync_timeout_id;
- GHashTable *reload_hash;
-};
-
-typedef struct
-{
- EphyExtensionInfo info;
- gboolean load_failed;
-
- char *loader_type;
-
- EphyLoader *loader; /* NULL if never loaded */
- GObject *extension; /* NULL if unloaded */
-} ExtensionInfo;
-
-typedef struct
-{
- char *type;
- EphyLoader *loader;
-} LoaderInfo;
-
-typedef enum
-{
- FORMAT_UNKNOWN,
- FORMAT_INI
-} ExtensionFormat;
-
-enum
-{
- CHANGED,
- ADDED,
- REMOVED,
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-static void ephy_extensions_manager_class_init (EphyExtensionsManagerClass *klass);
-static void ephy_extensions_manager_iface_init (EphyExtensionIface *iface);
-static void ephy_extensions_manager_init (EphyExtensionsManager *manager);
-
-G_DEFINE_TYPE_WITH_CODE (EphyExtensionsManager, ephy_extensions_manager, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (EPHY_TYPE_EXTENSION,
- ephy_extensions_manager_iface_init))
-
-static void
-ephy_extensions_manager_toggle_load (EphyExtensionsManager *manager,
- const char *identifier,
- gboolean status)
-{
- char **exts;
- GVariantBuilder builder;
- int i;
- gboolean found = FALSE;
-
- g_return_if_fail (EPHY_IS_EXTENSIONS_MANAGER (manager));
- g_return_if_fail (identifier != NULL);
-
- if (status)
- LOG ("Adding '%s' to extensions", identifier);
- else
- LOG ("Removing '%s' from extensions", identifier);
-
- exts = g_settings_get_strv (EPHY_SETTINGS_MAIN,
- EPHY_PREFS_ENABLED_EXTENSIONS);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY);
- for (i = 0; exts[i]; i++)
- {
- /* Ignore the extension if we are removing it. */
- if (g_strcmp0 (exts[i], identifier) == 0)
- {
- found = TRUE;
- if (!status)
- continue;
- }
-
- g_variant_builder_add (&builder, "s", exts[i]);
- }
-
- if (status && !found)
- g_variant_builder_add (&builder, "s", identifier);
-
- g_settings_set (EPHY_SETTINGS_MAIN,
- EPHY_PREFS_ENABLED_EXTENSIONS,
- "as", &builder);
-}
-
-/**
- * ephy_extensions_manager_load:
- * @manager: an #EphyExtensionsManager
- * @identifier: identifier of the extension to load
- *
- * Loads the extension corresponding to @identifier.
- **/
-void
-ephy_extensions_manager_load (EphyExtensionsManager *manager,
- const char *identifier)
-{
- ephy_extensions_manager_toggle_load (manager, identifier, TRUE);
-}
-
-/**
- * ephy_extensions_manager_unload:
- * @manager: an #EphyExtensionsManager
- * @identifier: filename of extension to unload, minus "lib" and "extension.so"
- *
- * Unloads the extension specified by @identifier.
- *
- * The extension with the same filename can afterwards be reloaded. However,
- * if any GTypes within the extension have changed parent types, Epiphany must
- * be restarted.
- **/
-void
-ephy_extensions_manager_unload (EphyExtensionsManager *manager,
- const char *identifier)
-{
- ephy_extensions_manager_toggle_load (manager, identifier, FALSE);
-}
-
-/**
- * ephy_extensions_manager_register:
- * @manager: an #EphyExtensionsManager
- * @object: an Extension
- *
- * Registers @object with the extensions manager. @object must implement the
- * #EphyExtension interface.
- **/
-void
-ephy_extensions_manager_register (EphyExtensionsManager *manager,
- GObject *object)
-{
- g_return_if_fail (EPHY_IS_EXTENSIONS_MANAGER (manager));
- g_return_if_fail (EPHY_IS_EXTENSION (object));
-
- manager->priv->extensions = g_list_prepend (manager->priv->extensions,
- g_object_ref (object));
-}
-
-
-/**
- * ephy_extensions_manager_get_extensions:
- * @manager: an #EphyExtensionsManager
- *
- * Returns the list of known extensions.
- *
- * Returns: (element-type EphyEmbed) (transfer container): a list of
- * #EphyExtensionInfo
- **/
-GList *
-ephy_extensions_manager_get_extensions (EphyExtensionsManager *manager)
-{
- return g_list_copy (manager->priv->data);
-}
-
-static void
-free_extension_info (ExtensionInfo *info)
-{
- EphyExtensionInfo *einfo = (EphyExtensionInfo *) info;
-
- g_free (einfo->identifier);
- g_key_file_free (einfo->keyfile);
- g_free (info->loader_type);
-
- if (info->extension != NULL)
- {
- g_return_if_fail (info->loader != NULL);
-
- ephy_loader_release_object (info->loader, info->extension);
- }
- if (info->loader != NULL)
- {
- g_object_unref (info->loader);
- }
-
- g_free (info);
-}
-
-static void
-free_loader_info (LoaderInfo *info)
-{
- g_free (info->type);
- g_object_unref (info->loader);
- g_free (info);
-}
-
-static int
-find_extension_info (const ExtensionInfo *info,
- const char *identifier)
-{
- return strcmp (info->info.identifier, identifier);
-}
-
-static ExtensionInfo *
-ephy_extensions_manager_parse_keyfile (EphyExtensionsManager *manager,
- GKeyFile *key_file,
- const char *identifier)
-{
- ExtensionInfo *info;
- EphyExtensionInfo *einfo;
- char *start_group;
-
- LOG ("Parsing INI description file for '%s'", identifier);
-
- start_group = g_key_file_get_start_group (key_file);
- if (start_group == NULL ||
- strcmp (start_group, EE_GROUP) != 0 ||
- !g_key_file_has_group (key_file, "Loader"))
- {
- g_warning ("Invalid extension description file for '%s'; "
- "missing 'Epiphany Extension' or 'Loader' group",
- identifier);
-
- g_key_file_free (key_file);
- g_free (start_group);
- return NULL;
- }
- g_free (start_group);
-
- if (!g_key_file_has_key (key_file, EE_GROUP, "Name", NULL) ||
- !g_key_file_has_key (key_file, EE_GROUP, "Description", NULL))
- {
- g_warning ("Invalid extension description file for '%s'; "
- "missing 'Name' or 'Description' keys.",
- identifier);
-
- g_key_file_free (key_file);
- return NULL;
- }
-
- info = g_new0 (ExtensionInfo, 1);
- einfo = (EphyExtensionInfo *) info;
- einfo->identifier = g_strdup (identifier);
- einfo->keyfile = key_file;
-
- info->loader_type = g_key_file_get_string (key_file, "Loader", "Type", NULL);
-
- /* sanity check */
- if (info->loader_type == NULL || info->loader_type[0] == '\0')
- {
- free_extension_info (info);
- return NULL;
- }
-
- manager->priv->data = g_list_prepend (manager->priv->data, info);
-
- g_signal_emit (manager, signals[ADDED], 0, info);
-
- return info;
-}
-
-static void
-ephy_extensions_manager_load_ini_file (EphyExtensionsManager *manager,
- const char *identifier,
- const char *path)
-{
- GKeyFile *keyfile;
- GError *err = NULL;
-
- keyfile = g_key_file_new ();
- if (!g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, &err))
- {
- g_warning ("Could load key file for '%s': '%s'",
- identifier, err->message);
- g_error_free (err);
- g_key_file_free (keyfile);
- return;
- }
-
- ephy_extensions_manager_parse_keyfile (manager, keyfile, identifier);
-}
-
-static char *
-path_to_identifier (const char *path)
-{
- char *identifier, *dot;
-
- identifier = g_path_get_basename (path);
- dot = strstr (identifier, DOT_INI);
-
- g_return_val_if_fail (dot != NULL, NULL);
-
- *dot = '\0';
-
- return identifier;
-}
-
-static ExtensionFormat
-format_from_path (const char *path)
-{
- ExtensionFormat format = FORMAT_UNKNOWN;
-
- if (g_str_has_suffix (path, DOT_INI))
- {
- format = FORMAT_INI;
- }
-
- return format;
-}
-
-static void
-ephy_extensions_manager_load_file (EphyExtensionsManager *manager,
- const char *path)
-{
- GList *element;
- char *identifier;
- ExtensionFormat format;
-
- identifier = path_to_identifier (path);
- g_return_if_fail (identifier != NULL);
- if (identifier == NULL) return;
-
- format = format_from_path (path);
- g_return_if_fail (format != FORMAT_UNKNOWN);
-
- element = g_list_find_custom (manager->priv->data, identifier,
- (GCompareFunc) find_extension_info);
- if (element != NULL)
- {
- g_warning ("Extension description for '%s' already read!",
- identifier);
-
- g_free (identifier);
- return;
- }
-
- if (format == FORMAT_INI)
- {
- ephy_extensions_manager_load_ini_file (manager, identifier,
- path);
- }
-
- g_free (identifier);
-}
-
-
-static int
-find_loader (const LoaderInfo *info,
- const char *type)
-{
- return strcmp (info->type, type);
-}
-
-static char *
-sanitise_type (const char *string)
-{
- char *str, *p;
-
- str = g_strdup (string);
- for (p = str; *p != '\0'; p++)
- {
- if (!g_ascii_isalpha (*p)) *p = '-';
- }
-
- return str;
-}
-
-static EphyLoader *
-get_loader_for_type (EphyExtensionsManager *manager,
- const char *type)
-{
- LoaderInfo *info;
- GList *l;
- char *path, *name, *stype, *data;
- GKeyFile *keyfile;
- EphyLoader *shlib_loader;
- GObject *loader;
-
- LOG ("Looking for loader for type '%s'", type);
-
- l = g_list_find_custom (manager->priv->factories, type,
- (GCompareFunc) find_loader);
- if (l != NULL)
- {
- info = (LoaderInfo *) l->data;
- return g_object_ref (info->loader);
- }
-
- if (strcmp (type, "shlib") == 0)
- {
- info = g_new (LoaderInfo, 1);
- info->type = g_strdup (type);
- info->loader = g_object_new (EPHY_TYPE_SHLIB_LOADER, NULL);
-
- manager->priv->factories =
- g_list_append (manager->priv->factories, info);
-
- return g_object_ref (info->loader);
- }
- if (strcmp (type, "python") == 0 ||
- strcmp (type, "seed") == 0)
- {
- return NULL;
- }
-
- shlib_loader = get_loader_for_type (manager, "shlib");
- g_return_val_if_fail (shlib_loader != NULL, NULL);
-
- stype = sanitise_type (type);
- name = g_strconcat ("lib", stype, "loader.", G_MODULE_SUFFIX, NULL);
- path = g_build_filename (LOADER_DIR, name, NULL);
- data = g_strconcat ("[Loader]\nType=shlib\nLibrary=", path, "\n", NULL);
- g_free (stype);
- g_free (name);
- g_free (path);
-
- keyfile = g_key_file_new ();
- if (!g_key_file_load_from_data (keyfile, data, strlen (data), 0, NULL))
- {
- g_free (data);
- return NULL;
- }
-
- loader = ephy_loader_get_object (shlib_loader, keyfile);
- g_key_file_free (keyfile);
-
- if (EPHY_IS_LOADER (loader))
- {
- info = g_new (LoaderInfo, 1);
- info->type = g_strdup (type);
- info->loader = EPHY_LOADER (loader);
-
- manager->priv->factories =
- g_list_append (manager->priv->factories, info);
-
- return g_object_ref (info->loader);
- }
-
- g_return_val_if_reached (NULL);
-
- return NULL;
-}
-
-static void
-attach_window (EphyWindow *window,
- EphyExtension *extension)
-{
- GList *tabs, *l;
-
- ephy_extension_attach_window (extension, window);
-
- tabs = ephy_embed_container_get_children
- (EPHY_EMBED_CONTAINER (window));
- for (l = tabs; l; l = l->next)
- {
- ephy_extension_attach_tab (extension, window,
- EPHY_EMBED (l->data));
- }
- g_list_free (tabs);
-}
-
-static void
-load_extension (EphyExtensionsManager *manager,
- ExtensionInfo *info)
-{
- EphyLoader *loader;
-
- g_return_if_fail (info->extension == NULL);
-
- LOG ("Loading extension '%s'", info->info.identifier);
-
- /* don't try again */
- if (info->load_failed) return;
-
- /* get a loader */
- loader = get_loader_for_type (manager, info->loader_type);
- if (loader == NULL)
- {
- g_message ("No loader found for extension '%s' of type '%s'\n",
- info->info.identifier, info->loader_type);
- return;
- }
-
- info->loader = loader;
-
- info->extension = ephy_loader_get_object (loader, info->info.keyfile);
-
- /* attach if the extension implements EphyExtensionIface */
- if (EPHY_IS_EXTENSION (info->extension))
- {
- manager->priv->extensions =
- g_list_prepend (manager->priv->extensions,
- g_object_ref (info->extension));
-
- g_list_foreach (manager->priv->windows, (GFunc) attach_window,
- info->extension);
- }
-
- if (info->extension != NULL)
- {
- info->info.active = TRUE;
- }
- else
- {
- info->info.active = FALSE;
- info->load_failed = TRUE;
- }
-}
-
-static void
-detach_window (EphyWindow *window,
- EphyExtension *extension)
-{
- GList *tabs, *l;
-
- tabs = ephy_embed_container_get_children
- (EPHY_EMBED_CONTAINER (window));
- for (l = tabs; l; l = l->next)
- {
- ephy_extension_detach_tab (extension, window,
- EPHY_EMBED (l->data));
- }
- g_list_free (tabs);
-
- ephy_extension_detach_window (extension, window);
-}
-
-static void
-unload_extension (EphyExtensionsManager *manager,
- ExtensionInfo *info)
-{
- g_return_if_fail (info->loader != NULL);
- g_return_if_fail (info->extension != NULL || info->load_failed);
-
- LOG ("Unloading extension '%s'", info->info.identifier);
-
- if (info->load_failed) return;
-
- /* detach if the extension implements EphyExtensionIface */
- if (EPHY_IS_EXTENSION (info->extension))
- {
- g_list_foreach (manager->priv->windows, (GFunc) detach_window,
- info->extension);
-
- manager->priv->extensions =
- g_list_remove (manager->priv->extensions, info->extension);
-
- /* we own two refs to the extension, the one we added when
- * we added it to the priv->extensions list, and the one returned
- * from get_object. Release object, and queue a unref, since if the
- * extension has its own functions queued in the idle loop, the
- * functions must exist in memory before being called.
- */
- ephy_object_idle_unref (info->extension);
- }
-
- ephy_loader_release_object (info->loader, G_OBJECT (info->extension));
-
- info->info.active = FALSE;
- info->extension = NULL;
-}
-
-static void
-sync_loaded_extensions (EphyExtensionsManager *manager)
-{
- char **extensions;
- GVariantBuilder builder;
- int i;
- gboolean has_ui = FALSE;
- GList *l;
- ExtensionInfo *info;
-
- LOG ("Synching changed list of active extensions");
-
- extensions = g_settings_get_strv (EPHY_SETTINGS_MAIN,
- EPHY_PREFS_ENABLED_EXTENSIONS);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY);
-
- /* Make sure the extensions-manager-ui is always loaded. */
- for (i = 0; extensions[i]; i++)
- {
- if (g_strcmp0 (extensions[i], "extensions-manager-ui") == 0)
- has_ui = TRUE;
-
- g_variant_builder_add (&builder, "s", extensions[i]);
- }
-
- if (!has_ui)
- {
- g_variant_builder_add (&builder, "s", "extensions-manager-ui");
- g_settings_set (EPHY_SETTINGS_MAIN,
- EPHY_PREFS_ENABLED_EXTENSIONS,
- "as", &builder);
-
- g_strfreev (extensions);
- extensions = g_settings_get_strv
- (EPHY_SETTINGS_MAIN,
- EPHY_PREFS_ENABLED_EXTENSIONS);
- }
- else
- {
- g_variant_builder_clear (&builder);
- }
-
- for (l = manager->priv->data; l != NULL; l = l->next)
- {
- gboolean changed;
- gboolean active = FALSE;
- int j;
-
- info = (ExtensionInfo *) l->data;
-
- for (j = 0; extensions[j]; j++)
- {
- if (!active && g_strcmp0 (extensions[j],
- info->info.identifier) == 0)
- active = TRUE;
- }
-
- LOG ("Extension '%s' is %sactive and %sloaded",
- info->info.identifier,
- active ? "" : "not ",
- info->info.active ? "" : "not ");
-
- changed = (info->info.enabled != active);
-
- info->info.enabled = active;
-
- if (active != info->info.active)
- {
- if (active)
- {
- load_extension (manager, info);
- }
- else
- {
- unload_extension (manager, info);
- }
-
- if (active == info->info.active)
- {
- changed = TRUE;
- }
- }
-
- if (changed)
- {
- g_signal_emit (manager, signals[CHANGED], 0, info);
- }
- }
-
- g_strfreev (extensions);
-}
-
-static void
-ephy_extensions_manager_unload_file (EphyExtensionsManager *manager,
- const char *path)
-{
- GList *l;
- ExtensionInfo *info;
- char *identifier;
-
- identifier = path_to_identifier (path);
-
- l = g_list_find_custom (manager->priv->data, identifier,
- (GCompareFunc) find_extension_info);
-
- if (l != NULL)
- {
- info = (ExtensionInfo *) l->data;
-
- manager->priv->data = g_list_remove (manager->priv->data, info);
-
- if (info->info.active == TRUE)
- {
- unload_extension (manager, info);
- }
-
- g_signal_emit (manager, signals[REMOVED], 0, info);
-
- free_extension_info (info);
- }
-
- g_free (identifier);
-}
-
-static gboolean
-reload_sync_cb (EphyExtensionsManager *manager)
-{
- EphyExtensionsManagerPrivate *priv = manager->priv;
-
- if (priv->sync_timeout_id != 0)
- {
- g_source_remove (priv->sync_timeout_id);
- priv->sync_timeout_id = 0;
- }
-
- sync_loaded_extensions (manager);
-
- return FALSE;
-}
-
-static gboolean
-reload_cb (gpointer *data)
-{
- EphyExtensionsManager *manager = EPHY_EXTENSIONS_MANAGER (data[0]);
- EphyExtensionsManagerPrivate *priv = manager->priv;
- char *path = data[1];
-
- LOG ("Reloading %s", path);
-
- /* We still need path and don't want to remove the timeout
- * which will be removed automatically when we return, so
- * just use _steal instead of _remove.
- */
- g_hash_table_steal (priv->reload_hash, path);
-
- ephy_extensions_manager_load_file (manager, path);
- g_free (path);
-
- /* Schedule a sync of active extensions */
- /* FIXME: just look if we need to activate *this* extension? */
-
- if (priv->sync_timeout_id != 0)
- {
- g_source_remove (priv->sync_timeout_id);
- }
-
- priv->sync_timeout_id = g_timeout_add_seconds (RELOAD_SYNC_DELAY,
- (GSourceFunc) reload_sync_cb,
- manager);
- return FALSE;
-}
-
-static void
-schedule_load_from_monitor (EphyExtensionsManager *manager,
- const char *path)
-{
- EphyExtensionsManagerPrivate *priv = manager->priv;
- char *identifier, *copy;
- gpointer *data;
- guint timeout_id;
-
- /* When a file is installed, it sometimes gets CREATED empty and then
- * gets its contents filled later (for a CHANGED signal). Theoretically
- * I suppose we could get a CHANGED signal when the file is half-full,
- * but I doubt that'll happen much (the files are <1000 bytes). We
- * don't want warnings all over the place, so we just wait a bit before
- * actually reloading the file. (We're assuming that if a file is
- * empty it'll be filled soon and this function will be called again.)
- *
- * Oh, and we return if the extension is already loaded, too.
- */
-
- identifier = path_to_identifier (path);
- g_return_if_fail (identifier != NULL);
- if (identifier == NULL) return;
-
- if (g_list_find_custom (manager->priv->data, identifier,
- (GCompareFunc) find_extension_info) != NULL)
- {
- g_free (identifier);
- return;
- }
- g_free (identifier);
-
- g_return_if_fail (priv->reload_hash != NULL);
-
- data = g_new (gpointer, 2);
- data[0] = (gpointer) manager;
- data[1] = copy = g_strdup (path);
- timeout_id = g_timeout_add_full (G_PRIORITY_LOW, RELOAD_DELAY,
- (GSourceFunc) reload_cb,
- data, (GDestroyNotify) g_free);
- g_hash_table_replace (priv->reload_hash, copy /* owns it */,
- GUINT_TO_POINTER (timeout_id));
-}
-
-static void
-dir_changed_cb (GFileMonitor *monitor,
- GFile *child,
- GFile *other_child,
- GFileMonitorEvent event_type,
- EphyExtensionsManager *manager)
-{
- char *path;
-
- path = g_file_get_path (child);
-
- /*
- * We only deal with XML and INI files:
- * Add them to the manager when created, remove them when deleted.
- */
- if (format_from_path (path) == FORMAT_UNKNOWN) return;
-
- switch (event_type)
- {
- case G_FILE_MONITOR_EVENT_CREATED:
- case G_FILE_MONITOR_EVENT_CHANGED:
- schedule_load_from_monitor (manager, path);
- break;
- case G_FILE_MONITOR_EVENT_DELETED:
- ephy_extensions_manager_unload_file (manager, path);
- break;
- default:
- break;
- }
-
- g_free (path);
-}
-
-static void
-ephy_extensions_manager_load_dir (EphyExtensionsManager *manager,
- const char *path)
-{
- char *file_path;
- GError *error = NULL;
- GDir *dir;
- const char *dir_elem;
- GFile *directory;
- GFileMonitor *monitor;
-
- LOG ("Scanning directory '%s'", path);
-
- START_PROFILER ("Scanning directory")
-
- dir = g_dir_open (path, 0, &error);
- if (error)
- {
- LOG ("Failed to open extension directory %s: %s",
- path, error->message);
- g_error_free (error);
- return;
- }
-
- dir_elem = g_dir_read_name (dir);
- while (dir_elem)
- {
- if (format_from_path (dir_elem) != FORMAT_UNKNOWN)
- {
- file_path = g_build_filename (path, dir_elem, NULL);
- ephy_extensions_manager_load_file (manager, file_path);
- g_free (file_path);
- }
-
- dir_elem = g_dir_read_name (dir);
- }
- g_dir_close (dir);
-
- directory = g_file_new_for_path (path);
- monitor = g_file_monitor_directory (directory, 0, NULL, NULL);
- g_object_unref (directory);
-
- if (monitor != NULL)
- {
- g_signal_connect (monitor, "changed",
- G_CALLBACK (dir_changed_cb),
- manager);
- manager->priv->dir_monitors = g_list_prepend
- (manager->priv->dir_monitors, monitor);
- }
-
- STOP_PROFILER ("Scanning directory")
-}
-
-static void
-active_extensions_cb (GSettings *settings,
- char *key,
- EphyExtensionsManager *manager)
-{
- sync_loaded_extensions (manager);
-}
-
-static void
-cancel_timeout (gpointer data)
-{
- guint id = GPOINTER_TO_UINT (data);
-
- g_source_remove (id);
-}
-
-static void
-ephy_extensions_manager_init (EphyExtensionsManager *manager)
-{
- EphyExtensionsManagerPrivate *priv;
-
- priv = manager->priv = EPHY_EXTENSIONS_MANAGER_GET_PRIVATE (manager);
-
- priv->reload_hash = g_hash_table_new_full (g_str_hash, g_str_equal,
- (GDestroyNotify) g_free,
- (GDestroyNotify) cancel_timeout);
-}
-
-void
-ephy_extensions_manager_startup (EphyExtensionsManager *manager)
-{
- char *path;
-
- g_return_if_fail (EPHY_IS_EXTENSIONS_MANAGER (manager));
-
- LOG ("EphyExtensionsManager startup");
-
- /* load the extensions descriptions */
- path = g_build_filename (ephy_dot_dir (), "extensions", NULL);
- ephy_extensions_manager_load_dir (manager, path);
- g_free (path);
-
- ephy_extensions_manager_load_dir (manager, EXTENSIONS_DIR);
-
- sync_loaded_extensions (manager);
-
- g_signal_connect (EPHY_SETTINGS_MAIN,
- "changed::" EPHY_PREFS_ENABLED_EXTENSIONS,
- G_CALLBACK (active_extensions_cb),
- manager);
-}
-
-static void
-ephy_extensions_manager_dispose (GObject *object)
-{
- EphyExtensionsManager *manager = EPHY_EXTENSIONS_MANAGER (object);
- EphyExtensionsManagerPrivate *priv = manager->priv;
-
- if (priv->reload_hash != NULL)
- {
- g_hash_table_destroy (priv->reload_hash);
- priv->reload_hash = NULL;
- }
-
- if (priv->sync_timeout_id != 0)
- {
- g_source_remove (priv->sync_timeout_id);
- priv->sync_timeout_id = 0;
- }
-
- if (priv->dir_monitors != NULL)
- {
- g_list_foreach (priv->dir_monitors, (GFunc) g_file_monitor_cancel, NULL);
- g_list_free (priv->dir_monitors);
- priv->dir_monitors = NULL;
- }
-
- if (priv->extensions != NULL)
- {
- g_list_foreach (priv->extensions, (GFunc) g_object_unref, NULL);
- g_list_free (priv->extensions);
- priv->extensions = NULL;
- }
-
- if (priv->factories != NULL)
- {
- /* FIXME release loaded loaders */
- g_list_foreach (priv->factories, (GFunc) free_loader_info, NULL);
- g_list_free (priv->factories);
- priv->factories = NULL;
- }
-
- if (priv->data != NULL)
- {
- g_list_foreach (priv->data, (GFunc) free_extension_info, NULL);
- g_list_free (priv->data);
- priv->data = NULL;
- }
-
- if (priv->windows != NULL)
- {
- g_list_free (priv->windows);
- priv->windows = NULL;
- }
-
- G_OBJECT_CLASS (ephy_extensions_manager_parent_class)->dispose (object);
-}
-
-static void
-attach_extension_to_window (EphyExtension *extension,
- EphyWindow *window)
-{
- attach_window (window, extension);
-}
-
-static void
-impl_attach_window (EphyExtension *extension,
- EphyWindow *window)
-{
- EphyExtensionsManager *manager = EPHY_EXTENSIONS_MANAGER (extension);
-
- LOG ("Attach window %p", window);
-
- g_list_foreach (manager->priv->extensions,
- (GFunc) attach_extension_to_window, window);
-
- manager->priv->windows = g_list_prepend (manager->priv->windows, window);
-}
-
-static void
-impl_detach_window (EphyExtension *extension,
- EphyWindow *window)
-{
- EphyExtensionsManager *manager = EPHY_EXTENSIONS_MANAGER (extension);
- GList *tabs, *l;
-
- LOG ("Detach window %p", window);
-
- manager->priv->windows = g_list_remove (manager->priv->windows, window);
-
- g_object_ref (window);
-
- /* Detach tabs (uses impl_detach_tab) */
- tabs = ephy_embed_container_get_children (EPHY_EMBED_CONTAINER (window));
- for (l = tabs; l; l = l->next)
- {
- ephy_extension_detach_tab (extension, window,
- EPHY_EMBED (l->data));
- }
- g_list_free (tabs);
-
- /* Then detach the window */
- g_list_foreach (manager->priv->extensions,
- (GFunc) ephy_extension_detach_window, window);
-
- g_object_unref (window);
-}
-
-static void
-impl_attach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed)
-{
- EphyExtensionsManager *manager = EPHY_EXTENSIONS_MANAGER (extension);
- GList *l;
-
- LOG ("Attach window %p embed %p", window, embed);
-
- for (l = manager->priv->extensions; l; l = l->next)
- {
- ephy_extension_attach_tab (EPHY_EXTENSION (l->data),
- window, embed);
- }
-}
-
-static void
-impl_detach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed)
-{
- EphyExtensionsManager *manager = EPHY_EXTENSIONS_MANAGER (extension);
- GList *l;
-
- LOG ("Detach window %p embed %p", window, embed);
-
- g_object_ref (window);
- g_object_ref (embed);
-
- for (l = manager->priv->extensions; l; l = l->next)
- {
- ephy_extension_detach_tab (EPHY_EXTENSION (l->data),
- window, embed);
- }
-
- g_object_unref (embed);
- g_object_unref (window);
-}
-
-static void
-ephy_extensions_manager_iface_init (EphyExtensionIface *iface)
-{
- iface->attach_window = impl_attach_window;
- iface->detach_window = impl_detach_window;
- iface->attach_tab = impl_attach_tab;
- iface->detach_tab = impl_detach_tab;
-}
-
-static void
-ephy_extensions_manager_class_init (EphyExtensionsManagerClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
-
- object_class->dispose = ephy_extensions_manager_dispose;
-
- signals[CHANGED] =
- g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyExtensionsManagerClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE,
- 1,
- G_TYPE_POINTER);
- signals[ADDED] =
- g_signal_new ("added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyExtensionsManagerClass, added),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE,
- 1,
- G_TYPE_POINTER);
- signals[REMOVED] =
- g_signal_new ("removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyExtensionsManagerClass, removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE,
- 1,
- G_TYPE_POINTER);
-
- g_type_class_add_private (object_class, sizeof (EphyExtensionsManagerPrivate));
-}
diff --git a/src/ephy-extensions-manager.h b/src/ephy-extensions-manager.h
deleted file mode 100644
index 2e7344c8e..000000000
--- a/src/ephy-extensions-manager.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright © 2003 Marco Pesenti Gritti
- * Copyright © 2003 Christian Persch
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION)
-#error "Only <epiphany/epiphany.h> can be included directly."
-#endif
-
-#ifndef EPHY_EXTENSIONS_MANAGER_H
-#define EPHY_EXTENSIONS_MANAGER_H
-
-#include "ephy-extension.h"
-
-#include <glib.h>
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_EXTENSIONS_MANAGER (ephy_extensions_manager_get_type ())
-#define EPHY_EXTENSIONS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_EXTENSIONS_MANAGER, EphyExtensionsManager))
-#define EPHY_EXTENSIONS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_EXTENSIONS_MANAGER, EphyExtensionsManagerClass))
-#define EPHY_IS_EXTENSIONS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_EXTENSIONS_MANAGER))
-#define EPHY_IS_EXTENSIONS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_EXTENSIONS_MANAGER))
-#define EPHY_EXTENSIONS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_EXTENSIONS_MANAGER, EphyExtensionsManagerClass))
-
-typedef struct _EphyExtensionsManager EphyExtensionsManager;
-typedef struct _EphyExtensionsManagerClass EphyExtensionsManagerClass;
-typedef struct _EphyExtensionsManagerPrivate EphyExtensionsManagerPrivate;
-
-typedef struct
-{
- char *identifier;
- GKeyFile *keyfile;
- guint active :1;
- guint enabled :1;
-} EphyExtensionInfo;
-
-struct _EphyExtensionsManagerClass
-{
- GObjectClass parent_class;
-
- /* Signals */
- void (* added) (EphyExtensionsManager *manager,
- EphyExtensionInfo *info);
- void (* changed) (EphyExtensionsManager *manager,
- EphyExtensionInfo *info);
- void (* removed) (EphyExtensionsManager *manager,
- EphyExtensionInfo *info);
-};
-
-struct _EphyExtensionsManager
-{
- GObject parent_instance;
-
- /*< private >*/
- EphyExtensionsManagerPrivate *priv;
-};
-
-GType ephy_extensions_manager_get_type (void);
-
-void ephy_extensions_manager_startup (EphyExtensionsManager *manager);
-
-void ephy_extensions_manager_load (EphyExtensionsManager *manager,
- const char *identifier);
-
-void ephy_extensions_manager_unload (EphyExtensionsManager *manager,
- const char *identifier);
-
-void ephy_extensions_manager_register (EphyExtensionsManager *manager,
- GObject *object);
-
-GList *ephy_extensions_manager_get_extensions (EphyExtensionsManager *manager);
-
-G_END_DECLS
-
-#endif
diff --git a/src/ephy-main.c b/src/ephy-main.c
index b2fc704be..d79d1ca23 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -42,10 +42,6 @@
#include <libxml/xmlversion.h>
#include <string.h>
-#ifdef ENABLE_INTROSPECTION
-#include <girepository.h>
-#endif
-
static GQuark startup_error_quark = 0;
#define STARTUP_ERROR_QUARK (startup_error_quark)
@@ -331,10 +327,6 @@ main (int argc,
g_option_context_set_main_group (option_context, option_group);
-#ifdef ENABLE_INTROSPECTION
- g_option_context_add_group (option_context, g_irepository_get_option_group ());
-#endif
-
g_option_context_add_group (option_context, gtk_get_option_group (TRUE));
#ifdef GNOME_ENABLE_DEBUG
diff --git a/src/ephy-session.c b/src/ephy-session.c
index e7d1e3438..70fc234dc 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -29,7 +29,6 @@
#include "ephy-embed-container.h"
#include "ephy-embed-utils.h"
#include "ephy-embed.h"
-#include "ephy-extension.h"
#include "ephy-file-helpers.h"
#include "ephy-gui.h"
#include "ephy-history-window.h"
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index f8ad2f8ed..d061c4896 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -30,7 +30,6 @@
#include "ephy-embed-container.h"
#include "ephy-embed-single.h"
#include "ephy-embed-utils.h"
-#include "ephy-extensions-manager.h"
#include "ephy-file-helpers.h"
#include "ephy-gui.h"
#include "ephy-history-window.h"
@@ -57,7 +56,6 @@ struct _EphyShellPrivate {
GList *windows;
GObject *lockdown;
EphyBookmarks *bookmarks;
- EphyExtensionsManager *extensions_manager;
GNetworkMonitor *network_monitor;
GtkWidget *bme;
GtkWidget *history_window;
@@ -592,6 +590,17 @@ download_started_cb (WebKitWebContext *web_context,
}
#endif
+static GObject *
+ephy_shell_get_lockdown (EphyShell *shell)
+{
+ g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
+
+ if (shell->priv->lockdown == NULL)
+ shell->priv->lockdown = g_object_new (EPHY_TYPE_LOCKDOWN, NULL);
+
+ return G_OBJECT (shell->priv->session);
+}
+
static void
ephy_shell_init (EphyShell *shell)
{
@@ -610,6 +619,10 @@ ephy_shell_init (EphyShell *shell)
G_CALLBACK (download_started_cb),
shell);
#endif
+
+ /* FIXME */
+ ephy_shell_get_lockdown (shell);
+ ephy_embed_shell_get_adblock_manager (embed_shell);
}
static void
@@ -619,9 +632,6 @@ ephy_shell_dispose (GObject *object)
LOG ("EphyShell disposing");
- /* This will unload the extensions. */
- g_clear_object (&priv->extensions_manager);
-
g_clear_object (&priv->session);
g_clear_object (&priv->lockdown);
g_clear_pointer (&priv->bme, gtk_widget_destroy);
@@ -868,25 +878,6 @@ ephy_shell_get_session (EphyShell *shell)
}
/**
- * ephy_shell_get_lockdown:
- * @shell: the #EphyShell
- *
- * Returns the lockdown controller.
- *
- * Return value: the lockdown controller
- **/
-static GObject *
-ephy_shell_get_lockdown (EphyShell *shell)
-{
- g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
-
- if (shell->priv->lockdown == NULL)
- shell->priv->lockdown = g_object_new (EPHY_TYPE_LOCKDOWN, NULL);
-
- return G_OBJECT (shell->priv->session);
-}
-
-/**
* ephy_shell_get_bookmarks:
*
* Return value: (transfer none):
@@ -902,31 +893,6 @@ ephy_shell_get_bookmarks (EphyShell *shell)
}
/**
- * ephy_shell_get_extensions_manager:
- *
- * Return value: (transfer none):
- **/
-GObject *
-ephy_shell_get_extensions_manager (EphyShell *es)
-{
- g_return_val_if_fail (EPHY_IS_SHELL (es), NULL);
-
- if (es->priv->extensions_manager == NULL) {
- /* Instantiate extensions manager */
- es->priv->extensions_manager =
- g_object_new (EPHY_TYPE_EXTENSIONS_MANAGER, NULL);
-
- ephy_extensions_manager_startup (es->priv->extensions_manager);
-
- /* FIXME */
- ephy_shell_get_lockdown (es);
- ephy_embed_shell_get_adblock_manager (embed_shell);
- }
-
- return G_OBJECT (es->priv->extensions_manager);
-}
-
-/**
* ephy_shell_get_net_monitor:
*
* Return value: (transfer none):
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index 9e0a4c7de..e9402e104 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -167,8 +167,6 @@ GObject *ephy_shell_get_net_monitor (EphyShell *shell);
EphyBookmarks *ephy_shell_get_bookmarks (EphyShell *shell);
-GObject *ephy_shell_get_extensions_manager (EphyShell *shell);
-
GtkWidget *ephy_shell_get_bookmarks_editor (EphyShell *shell);
GtkWidget *ephy_shell_get_history_window (EphyShell *shell);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index c84d0c6a2..6be58fe54 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -37,7 +37,6 @@
#include "ephy-embed-type-builtins.h"
#include "ephy-embed-utils.h"
#include "ephy-encoding-menu.h"
-#include "ephy-extension.h"
#include "ephy-file-helpers.h"
#include "ephy-find-toolbar.h"
#include "ephy-gui.h"
@@ -94,7 +93,6 @@ static const GtkActionEntry ephy_menu_entries [] = {
{ "PopupAction", NULL, "" },
{ "PagePopupAction", NULL, "" },
{ "NotebookPopupAction", NULL, "" },
- { "Extensions", NULL, N_("_Extensions") },
/* File actions. */
@@ -2926,7 +2924,6 @@ notebook_page_added_cb (EphyNotebook *notebook,
EphyWindow *window)
{
EphyWindowPrivate *priv = window->priv;
- EphyExtension *manager;
LOG ("page-added notebook %p embed %p position %u\n", notebook, embed, position);
@@ -2941,10 +2938,6 @@ notebook_page_added_cb (EphyNotebook *notebook,
g_signal_connect_object (ephy_embed_get_web_view (embed), "ge-modal-alert",
G_CALLBACK (embed_modal_alert_cb), window, G_CONNECT_AFTER);
- /* Let the extensions attach themselves to the tab */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_attach_tab (manager, window, embed);
-
if (priv->present_on_insert)
{
priv->present_on_insert = FALSE;
@@ -2961,7 +2954,6 @@ notebook_page_removed_cb (EphyNotebook *notebook,
EphyWindow *window)
{
EphyWindowPrivate *priv = window->priv;
- EphyExtension *manager;
LOG ("page-removed notebook %p embed %p position %u\n", notebook, embed, position);
@@ -2969,10 +2961,6 @@ notebook_page_removed_cb (EphyNotebook *notebook,
g_return_if_fail (EPHY_IS_EMBED (embed));
- /* Let the extensions remove themselves from the tab */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_detach_tab (manager, window, embed);
-
#if 0
g_signal_handlers_disconnect_by_func (G_OBJECT (embed),
G_CALLBACK (ephy_link_open),
@@ -3233,13 +3221,8 @@ ephy_window_dispose (GObject *object)
/* Only do these once */
if (window->priv->closing == FALSE)
{
- EphyExtension *manager;
-
window->priv->closing = TRUE;
- /* Let the extensions detach themselves from the window */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_detach_window (manager, window);
ephy_bookmarks_ui_detach_window (window);
g_signal_handlers_disconnect_by_func
@@ -3593,7 +3576,6 @@ ephy_window_constructor (GType type,
GObject *object;
EphyWindow *window;
EphyWindowPrivate *priv;
- EphyExtension *manager;
EphyEmbedSingle *single;
GtkSettings *settings;
GtkAction *action;
@@ -3711,9 +3693,6 @@ ephy_window_constructor (GType type,
/* Initialize the menus */
priv->enc_menu = ephy_encoding_menu_new (window);
- /* Once the window is sufficiently created let the extensions attach to it */
- manager = EPHY_EXTENSION (ephy_shell_get_extensions_manager (ephy_shell));
- ephy_extension_attach_window (manager, window);
ephy_bookmarks_ui_attach_window (window);
/* other notifiers */
diff --git a/src/epiphany.h.in b/src/epiphany.h.in
index 2f0564802..d218f6c69 100644
--- a/src/epiphany.h.in
+++ b/src/epiphany.h.in
@@ -47,8 +47,6 @@
#include <epiphany/ephy-embed-single.h>
#include <epiphany/ephy-embed-type-builtins.h>
#include <epiphany/ephy-embed-utils.h>
-#include <epiphany/ephy-extension.h>
-#include <epiphany/ephy-extensions-manager.h>
#include <epiphany/ephy-lib-type-builtins.h>
#include <epiphany/ephy-link.h>
#include <epiphany/ephy-loader.h>
diff --git a/src/resources/epiphany-ui.xml b/src/resources/epiphany-ui.xml
index 8b117c7a2..1c974292e 100644
--- a/src/resources/epiphany-ui.xml
+++ b/src/resources/epiphany-ui.xml
@@ -95,7 +95,6 @@
<placeholder name="ViewEncodingPlaceholder"/>
</menu>
<menuitem name="ViewPageSourceMenu" action="ViewPageSource"/>
- <menu name="ExtensionsMenu" action="Extensions"/>
<separator name="FileSep7"/>
<menuitem name="HelpAboutMenu" action="HelpAbout"/>
<menuitem name="FileCloseWindowMenu" action="FileCloseTab"/>