[epiphany-extensions/peas: 8/15] soup-fly: port to libpeas



commit af9e0e97685e628761df59003cfd8d70ba84b12f
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Mon Apr 4 12:35:29 2011 -0500

    soup-fly: port to libpeas
    
    FIXME: broke GObject type registration

 extensions/soup-fly/Makefile.am                   |   11 ++---
 extensions/soup-fly/ephy-soup-fly-extension.c     |   12 +++++
 extensions/soup-fly/ephy-soup-fly-extension.h     |    9 +++-
 extensions/soup-fly/extension.c                   |   46 ---------------------
 extensions/soup-fly/soup-fly.ephy-extension.in.in |   11 -----
 extensions/soup-fly/soup-fly.plugin.in.in         |    7 +++
 6 files changed, 30 insertions(+), 66 deletions(-)
---
diff --git a/extensions/soup-fly/Makefile.am b/extensions/soup-fly/Makefile.am
index 82d62b6..405c3f4 100644
--- a/extensions/soup-fly/Makefile.am
+++ b/extensions/soup-fly/Makefile.am
@@ -5,8 +5,7 @@ libsoupflyextension_la_SOURCES = \
 	ephy-soup-fly-extension.c	\
 	ephy-soup-fly-extension.h	\
 	soup-fly.c \
-	soup-fly.h \
-	extension.c
+	soup-fly.h
 
 libsoupflyextension_la_CPPFLAGS = \
 	-I$(top_srcdir)/include				\
@@ -20,14 +19,14 @@ libsoupflyextension_la_CFLAGS = \
 
 libsoupflyextension_la_LDFLAGS = \
 	-module -avoid-version \
-	-export-symbols $(top_srcdir)/ephy-extension.symbols \
+	-no-undefined \
 	$(AM_LDFLAGS)
 
 extensioninidir = $(extensiondir)
-extensionini_in_files = soup-fly.ephy-extension.in.in
-extensionini_DATA = $(extensionini_in_files:.ephy-extension.in.in=.ephy-extension)
+extensionini_in_files = soup-fly.plugin.in.in
+extensionini_DATA = $(extensionini_in_files:.plugin.in.in=.plugin)
 
-%.ephy-extension.in: %.ephy-extension.in.in $(extension_LTLIBRARIES)
+%.plugin.in: %.plugin.in.in $(extension_LTLIBRARIES)
 	$(AM_V_GEN) \
 	sed -e "s|%LIBRARY%|`. ./$(extension_LTLIBRARIES) && echo $$dlname`|" \
 	    -e "s|%EXTENSION_DIR%|$(extensiondir)|" \
diff --git a/extensions/soup-fly/ephy-soup-fly-extension.c b/extensions/soup-fly/ephy-soup-fly-extension.c
index 125824d..98b4683 100644
--- a/extensions/soup-fly/ephy-soup-fly-extension.c
+++ b/extensions/soup-fly/ephy-soup-fly-extension.c
@@ -29,6 +29,7 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
 #include <string.h>
+#include <libpeas/peas.h>
 
 #define WINDOW_DATA_KEY "EphySoupFlyExtWindowData"
 
@@ -242,3 +243,14 @@ ephy_soup_fly_extension_iface_init (EphyExtensionIface *iface)
   iface->attach_window = impl_attach_window;
   iface->detach_window = impl_detach_window;
 }
+
+G_MODULE_EXPORT void
+peas_register_types (PeasObjectModule *module)
+{
+	soup_fly_register_type (G_TYPE_MODULE (module));
+	ephy_soup_fly_extension_register_type (G_TYPE_MODULE (module));
+
+	peas_object_module_register_extension_type (module,
+						    EPHY_TYPE_EXTENSION,
+						    EPHY_TYPE_SOUP_FLY_EXTENSION);
+}
diff --git a/extensions/soup-fly/ephy-soup-fly-extension.h b/extensions/soup-fly/ephy-soup-fly-extension.h
index 1880a7d..63a2f79 100644
--- a/extensions/soup-fly/ephy-soup-fly-extension.h
+++ b/extensions/soup-fly/ephy-soup-fly-extension.h
@@ -21,7 +21,8 @@
 #ifndef EPHY_SOUP_FLY_EXTENSION_H
 #define EPHY_SOUP_FLY_EXTENSION_H
 
-#include <glib-object.h>
+#include <glib.h>
+#include <libpeas/peas.h>
 
 G_BEGIN_DECLS
 
@@ -37,11 +38,11 @@ typedef struct _EphySoupFlyExtensionClass   EphySoupFlyExtensionClass;
 typedef struct _EphySoupFlyExtensionPrivate EphySoupFlyExtensionPrivate;
 
 struct _EphySoupFlyExtensionClass {
-  GObjectClass parent_class;
+  PeasExtensionBaseClass parent_class;
 };
 
 struct _EphySoupFlyExtension {
-  GObject parent_instance;
+  PeasExtensionBase parent_instance;
 
   /*< private >*/
   EphySoupFlyExtensionPrivate *priv;
@@ -50,6 +51,8 @@ struct _EphySoupFlyExtension {
 GType ephy_soup_fly_extension_get_type      (void);
 GType ephy_soup_fly_extension_register_type (GTypeModule *module);
 
+G_MODULE_EXPORT void	peas_register_types	(PeasObjectModule *module);
+
 G_END_DECLS
 
 #endif
diff --git a/extensions/soup-fly/soup-fly.plugin.in.in b/extensions/soup-fly/soup-fly.plugin.in.in
new file mode 100644
index 0000000..f3f476c
--- /dev/null
+++ b/extensions/soup-fly/soup-fly.plugin.in.in
@@ -0,0 +1,7 @@
+[Plugin]
+Module=%LIBRARY%
+IAge=1
+_Name=Soup Fly
+_Description=A tool to debug the SoupSession WebKit uses.
+Authors=Xan López <xan gnome org>
+Website=http://www.gnome.org/projects/epiphany/extensions.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]