aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@igalia.com>2012-07-31 22:09:17 +0800
committerDiego Escalante Urrelo <diegoe@igalia.com>2012-07-31 22:30:49 +0800
commite1944188455f159dfa9c9fcc45b0e3887c88ad53 (patch)
tree0a433172702ba527d50e06685bc99e43989adf74 /src
parentd46dbdabfb2f3b1885b0eb30bde4cc7652475292 (diff)
downloadgsoc2013-epiphany-e1944188455f159dfa9c9fcc45b0e3887c88ad53.tar
gsoc2013-epiphany-e1944188455f159dfa9c9fcc45b0e3887c88ad53.tar.gz
gsoc2013-epiphany-e1944188455f159dfa9c9fcc45b0e3887c88ad53.tar.bz2
gsoc2013-epiphany-e1944188455f159dfa9c9fcc45b0e3887c88ad53.tar.lz
gsoc2013-epiphany-e1944188455f159dfa9c9fcc45b0e3887c88ad53.tar.xz
gsoc2013-epiphany-e1944188455f159dfa9c9fcc45b0e3887c88ad53.tar.zst
gsoc2013-epiphany-e1944188455f159dfa9c9fcc45b0e3887c88ad53.zip
extensions: remove seed support
https://bugzilla.gnome.org/show_bug.cgi?id=680905
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am18
-rw-r--r--src/ephy-extensions-manager.c21
-rw-r--r--src/ephy-seed-extension.c276
-rw-r--r--src/ephy-seed-extension.h61
-rw-r--r--src/ephy-seed-loader.c107
-rw-r--r--src/ephy-seed-loader.h61
6 files changed, 2 insertions, 542 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 3750c19ec..d7725fb50 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -136,20 +136,6 @@ BUILT_SOURCES = \
$(TYPES_SOURCE) \
$(NULL)
-if ENABLE_SEED
-NOINST_H_FILES += \
- ephy-seed-extension.h \
- ephy-seed-loader.h \
- $(NULL)
-
-libephymain_la_SOURCES += \
- ephy-seed-loader.c \
- ephy-seed-extension.c \
- $(NULL)
-
-libephymain_la_CFLAGS += $(SEED_CFLAGS)
-endif # ENABLE_SEED
-
epiphany_SOURCES = ephy-main.c \
$(EPIPHANY_RESOURCES) \
$(NULL)
@@ -190,10 +176,6 @@ epiphany_LDADD += $(INTROSPECTION_LIBS)
endif
endif
-if ENABLE_SEED
-epiphany_LDADD += $(SEED_LIBS)
-endif # ENABLE_SEED
-
TYPES_SOURCE = \
ephy-type-builtins.c \
ephy-type-builtins.h
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c
index c048550cb..71a888fc5 100644
--- a/src/ephy-extensions-manager.c
+++ b/src/ephy-extensions-manager.c
@@ -38,10 +38,6 @@
#include <gmodule.h>
#include <string.h>
-#ifdef ENABLE_SEED
-#include "ephy-seed-loader.h"
-#endif
-
#define EE_GROUP "Epiphany Extension"
#define DOT_INI ".ephy-extension"
#define RELOAD_DELAY 333 /* ms */
@@ -447,25 +443,12 @@ get_loader_for_type (EphyExtensionsManager *manager,
return g_object_ref (info->loader);
}
- if (strcmp (type, "python") == 0)
+ if (strcmp (type, "python") == 0 ||
+ strcmp (type, "seed") == 0)
{
return NULL;
}
-#ifdef ENABLE_SEED
- if (strcmp (type, "seed") == 0)
- {
- info = g_new (LoaderInfo, 1);
- info->type = g_strdup (type);
- info->loader = g_object_new (EPHY_TYPE_SEED_LOADER, NULL);
-
- manager->priv->factories =
- g_list_append (manager->priv->factories, info);
-
- return g_object_ref (info->loader);
- return NULL;
- }
-#endif
shlib_loader = get_loader_for_type (manager, "shlib");
g_return_val_if_fail (shlib_loader != NULL, NULL);
diff --git a/src/ephy-seed-extension.c b/src/ephy-seed-extension.c
deleted file mode 100644
index 4f7479f9e..000000000
--- a/src/ephy-seed-extension.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/*
- * Copyright © 2009, Robert Carr
- *
- * 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 <seed.h>
-
-#include "ephy-seed-extension.h"
-
-#include "ephy-extension.h"
-#include "ephy-window.h"
-#include "ephy-file-helpers.h"
-#include "ephy-debug.h"
-
-SeedEngine * global_eng = NULL;
-
-static void ephy_seed_extension_iface_init (EphyExtensionIface *iface);
-
-#define EPHY_SEED_EXTENSION_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SEED_EXTENSION, EphySeedExtensionPrivate))
-
-struct _EphySeedExtensionPrivate
-{
- char *filename;
-
- SeedContext ctx;
- SeedObject obj;
-};
-
-enum
- {
- PROP_0,
- PROP_FILENAME
- };
-
-static void
-ephy_seed_extension_init (EphySeedExtension *extension)
-{
- LOG ("EphySeedExtension initialising");
-
- extension->priv = EPHY_SEED_EXTENSION_GET_PRIVATE (extension);
-}
-
-static void
-call_seed_func (EphyExtension *extension,
- const char *func_name,
- EphyWindow *window,
- EphyEmbed *embed) /* HACK: tab may be NULL */
-{
- EphySeedExtension *seed_ext;
- EphySeedExtensionPrivate *priv;
- SeedObject function;
- SeedException exception = NULL;
- SeedValue args[2];
-
- seed_ext = EPHY_SEED_EXTENSION (extension);
- priv = seed_ext->priv;
-
- if (priv->obj == NULL || !seed_value_is_object (priv->ctx, priv->obj))
- return;
-
- function = seed_object_get_property (priv->ctx, priv->obj, func_name);
-
- if (!seed_value_is_function (priv->ctx, function))
- return;
-
- args[0] = seed_value_from_object (priv->ctx, G_OBJECT(window), exception);
- if (embed != NULL)
- args[1] = seed_value_from_object (priv->ctx, G_OBJECT(embed), exception);
-
- seed_object_call (global_eng->context, function, NULL, embed == NULL ? 1 : 2,
- args, &exception);
- if (exception)
- g_warning ("seed_exception: %s \n", seed_exception_to_string (priv->ctx, exception));
-
-}
-
-static void
-impl_attach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed)
-{
- call_seed_func (extension, "attach_tab", window, embed);
-}
-
-static void
-impl_detach_tab (EphyExtension *extension,
- EphyWindow *window,
- EphyEmbed *embed)
-{
- call_seed_func (extension, "detach_tab", window, embed);
- seed_context_collect (global_eng->context);
-}
-
-static void
-impl_attach_window (EphyExtension *extension,
- EphyWindow *window)
-{
- call_seed_func (extension, "attach_window", window, NULL);
-}
-
-static void
-impl_detach_window (EphyExtension *extension,
- EphyWindow *window)
-{
- call_seed_func (extension, "detach_window", window, NULL);
- seed_context_collect (global_eng->context);
-}
-
-static void
-ephy_seed_extension_iface_init (EphyExtensionIface *iface)
-{
- iface->attach_tab = impl_attach_tab;
- iface->detach_tab = impl_detach_tab;
- iface->attach_window = impl_attach_window;
- iface->detach_window = impl_detach_window;
-}
-
-G_DEFINE_TYPE_WITH_CODE (EphySeedExtension, ephy_seed_extension, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (EPHY_TYPE_EXTENSION,
- ephy_seed_extension_iface_init))
-static gchar *
-ephy_seed_extension_get_file (const gchar * name)
-{
- gchar *dot_path, *system_path, *dirname, *filename;
-
- filename = g_strconcat (name, ".js", NULL);
- dot_path = g_build_filename (ephy_dot_dir(), "extensions", filename, NULL);
-
- if (g_file_test (dot_path, G_FILE_TEST_EXISTS)) {
- g_free(filename);
- return dot_path;
- }
- g_free (dot_path);
-
- system_path = g_build_filename (EXTENSIONS_DIR, filename, NULL);
- g_free (filename);
- if (g_file_test (system_path, G_FILE_TEST_EXISTS)) {
- return system_path;
- }
- g_free (system_path);
-
- dirname = g_path_get_dirname (name);
- if (g_path_is_absolute (dirname)) {
- g_free (dirname);
- return g_strdup (name);
- }
- g_free (dirname);
-
- return NULL;
-}
-
-static GObject *
-ephy_seed_extension_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
-{
- SeedScript *script = NULL;
- GObject *object;
- EphySeedExtension *ext;
-
- object =
- G_OBJECT_CLASS (ephy_seed_extension_parent_class)->constructor (type,
- n_construct_properties,
- construct_params);
-
- ext = EPHY_SEED_EXTENSION (object);
-
- if (ext->priv->filename)
- script = seed_script_new_from_file (global_eng->context,
- ext->priv->filename);
-
- ext->priv->ctx = seed_context_create (global_eng->group, NULL);
- ext->priv->obj = seed_evaluate (global_eng->context,
- script,
- NULL);
- seed_value_protect (ext->priv->ctx, ext->priv->obj);
-
- if (seed_script_exception (script))
- g_warning ("seed_exception: %s",
- seed_exception_to_string (global_eng->context,
- seed_script_exception (script)));
-
-
- return object;
-}
-
-static void
-ephy_seed_extension_finalize (GObject *object)
-{
- EphySeedExtension *extension =
- EPHY_SEED_EXTENSION (object);
-
- seed_value_unprotect (extension->priv->ctx,
- extension->priv->obj);
- seed_context_unref (extension->priv->ctx);
-
- G_OBJECT_CLASS (ephy_seed_extension_parent_class)->finalize (object);
-}
-
-static void
-ephy_seed_extension_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- /* no readable properties */
- g_return_if_reached ();
-}
-
-static void
-ephy_seed_extension_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- EphySeedExtension *ext = EPHY_SEED_EXTENSION (object);
-
- switch (prop_id) {
- case PROP_FILENAME:
- ext->priv->filename =
- ephy_seed_extension_get_file (g_value_get_string (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- }
-}
-
-static void
-ephy_seed_extension_class_init (EphySeedExtensionClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = ephy_seed_extension_finalize;
- object_class->constructor = ephy_seed_extension_constructor;
- object_class->get_property = ephy_seed_extension_get_property;
- object_class->set_property = ephy_seed_extension_set_property;
-
- g_object_class_install_property
- (object_class,
- PROP_FILENAME,
- g_param_spec_string ("filename",
- "Filename",
- "Filename",
- NULL,
- G_PARAM_WRITABLE | G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
- G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (EphySeedExtensionPrivate));
-
- if (global_eng == NULL) {
- global_eng = seed_init (NULL, NULL);
- seed_simple_evaluate (global_eng->context,
- "Gtk = imports.gi.Gtk;"
- "Epiphany = imports.gi.Epiphany;",
- NULL);
- }
-}
-
diff --git a/src/ephy-seed-extension.h b/src/ephy-seed-extension.h
deleted file mode 100644
index 2559899ba..000000000
--- a/src/ephy-seed-extension.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/*
- * Copyright © 2009, Robert Carr <carrr@rpi.edu>
- *
- * 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_SEED_EXTENSION_H
-#define EPHY_SEED_EXTENSION_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_SEED_EXTENSION (ephy_seed_extension_get_type ())
-#define EPHY_SEED_EXTENSION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_SEED_EXTENSION, EphySeedExtension))
-#define EPHY_SEED_EXTENSION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_SEED_EXTENSION, EphySeedExtensionClass))
-#define EPHY_IS_SEED_EXTENSION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_SEED_EXTENSION))
-#define EPHY_IS_SEED_EXTENSION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_SEED_EXTENSION))
-#define EPHY_SEED_EXTENSION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_SEED_EXTENSION, EphySeedExtensionClass))
-
-typedef struct _EphySeedExtension EphySeedExtension;
-typedef struct _EphySeedExtensionClass EphySeedExtensionClass;
-typedef struct _EphySeedExtensionPrivate EphySeedExtensionPrivate;
-
-struct _EphySeedExtensionClass
-{
- GObjectClass parent_class;
-};
-
-struct _EphySeedExtension
-{
- GObject parent_instance;
-
- /*< private >*/
- EphySeedExtensionPrivate *priv;
-};
-
-GType ephy_seed_extension_get_type (void);
-
-G_END_DECLS
-
-#endif
diff --git a/src/ephy-seed-loader.c b/src/ephy-seed-loader.c
deleted file mode 100644
index 81aa25b74..000000000
--- a/src/ephy-seed-loader.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/*
- * Copyright © 2009, Robert Carr <carrr@rpi.edu>
- *
- * 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-seed-loader.h"
-#include "ephy-seed-extension.h"
-#include "ephy-loader.h"
-#include "ephy-debug.h"
-
-#include <seed.h>
-
-#define EPHY_SEED_LOADER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SEED_LOADER, EphySeedLoaderPrivate))
-
-struct _EphySeedLoaderPrivate
-{
- gpointer dummy;
-};
-
-static GObject *
-impl_get_object (EphyLoader *eloader,
- GKeyFile *keyfile)
-{
- char *filename;
- GObject *object;
-
- g_return_val_if_fail (keyfile != NULL, NULL);
-
- filename = g_key_file_get_string (keyfile, "Loader", "Module", NULL);
- if (filename == NULL) {
- g_warning ("NULL module name!\n");
- return NULL;
- }
-
- object = g_object_new (EPHY_TYPE_SEED_EXTENSION,
- "filename", filename,
- NULL);
-
- g_free (filename);
-
- return object;
-}
-
-static void
-impl_release_object (EphyLoader *eloader,
- GObject *object)
-{
- g_return_if_fail (object != NULL);
-
- g_object_unref (object);
-}
-
-static void
-ephy_seed_loader_iface_init (EphyLoaderIface *iface)
-{
- iface->type = "seed";
- iface->get_object = impl_get_object;
- iface->release_object = impl_release_object;
-}
-
-G_DEFINE_TYPE_WITH_CODE (EphySeedLoader, ephy_seed_loader, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (EPHY_TYPE_LOADER, ephy_seed_loader_iface_init))
-
-static void
-ephy_seed_loader_init (EphySeedLoader *loader)
-{
- loader->priv = EPHY_SEED_LOADER_GET_PRIVATE (loader);
-
- LOG ("EphySeedLoader initialising");
-
-}
-
-static void
-ephy_seed_loader_finalize (GObject *object)
-{
- LOG ("EphySeedLoader finalising");
-
- G_OBJECT_CLASS (ephy_seed_loader_parent_class)->finalize (object);
-}
-
-static void
-ephy_seed_loader_class_init (EphySeedLoaderClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = ephy_seed_loader_finalize;
-
- g_type_class_add_private (object_class, sizeof (EphySeedLoaderPrivate));
-}
-
diff --git a/src/ephy-seed-loader.h b/src/ephy-seed-loader.h
deleted file mode 100644
index d6ef29354..000000000
--- a/src/ephy-seed-loader.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/*
- * Copyright Robert Carr, <carrr@rpi.edu> 2009
- *
- * 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_SEED_LOADER_H
-#define EPHY_SEED_LOADER_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_SEED_LOADER (ephy_seed_loader_get_type ())
-#define EPHY_SEED_LOADER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_SEED_LOADER, EphySeedLoader))
-#define EPHY_SEED_LOADER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_SEED_LOADER, EphySeedLoaderClass))
-#define EPHY_IS_SEED_LOADER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_SEED_LOADER))
-#define EPHY_IS_SEED_LOADER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_SEED_LOADER))
-#define EPHY_SEED_LOADER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_SEED_LOADER, EphySeedLoaderClass))
-
-typedef struct _EphySeedLoader EphySeedLoader;
-typedef struct _EphySeedLoaderClass EphySeedLoaderClass;
-typedef struct _EphySeedLoaderPrivate EphySeedLoaderPrivate;
-
-struct _EphySeedLoaderClass
-{
- GObjectClass parent_class;
-};
-
-struct _EphySeedLoader
-{
- GObject parent_instance;
-
- /*< private >*/
- EphySeedLoaderPrivate *priv;
-};
-
-GType ephy_seed_loader_get_type (void);
-
-G_END_DECLS
-
-#endif /* !EPHY_SEED_LOADER_H */