[epiphany-extensions/peas: 5/15] push-scroller: port to libpeas



commit 933a2de0bb39c802f926c9be1f59c1cd9602161d
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Sun Apr 3 18:58:41 2011 -0500

    push-scroller: port to libpeas
    
    FIXME: fails to work, but seems to be unrelated to porting.

 extensions/push-scroller/Makefile.am               |   11 ++---
 .../push-scroller/ephy-push-scroller-extension.c   |   11 ++++-
 .../push-scroller/ephy-push-scroller-extension.h   |    7 ++-
 extensions/push-scroller/extension.c               |   47 --------------------
 .../push-scroller.ephy-extension.in.in             |   10 ----
 .../push-scroller/push-scroller.plugin.in.in       |    7 +++
 6 files changed, 27 insertions(+), 66 deletions(-)
---
diff --git a/extensions/push-scroller/Makefile.am b/extensions/push-scroller/Makefile.am
index ac57126..f0db6fb 100644
--- a/extensions/push-scroller/Makefile.am
+++ b/extensions/push-scroller/Makefile.am
@@ -5,8 +5,7 @@ libpushscrollerextension_la_SOURCES = \
 	ephy-push-scroller-extension.c	\
 	ephy-push-scroller-extension.h	\
 	ephy-push-scroller.c		\
-	ephy-push-scroller.h		\
-	extension.c
+	ephy-push-scroller.h
 
 libpushscrollerextension_la_CPPFLAGS = \
         -I$(top_srcdir)/include					\
@@ -23,14 +22,14 @@ libpushscrollerextension_la_LIBADD =
 
 libpushscrollerextension_la_LDFLAGS = \
 	-module -avoid-version \
-	-export-symbols $(top_srcdir)/ephy-extension.symbols \
+	-no-undefined \
 	$(AM_LDFLAGS)
 
 extensioninidir = $(extensiondir)
-extensionini_in_files = push-scroller.ephy-extension.in.in
-extensionini_DATA = $(extensionini_in_files:.ephy-extension.in.in=.ephy-extension)
+extensionini_in_files = push-scroller.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/push-scroller/ephy-push-scroller-extension.c b/extensions/push-scroller/ephy-push-scroller-extension.c
index 5e5a010..1a0d211 100644
--- a/extensions/push-scroller/ephy-push-scroller-extension.c
+++ b/extensions/push-scroller/ephy-push-scroller-extension.c
@@ -27,7 +27,7 @@
 
 #include <epiphany/epiphany.h>
 
-#include <gmodule.h>
+#include <libpeas/peas.h>
 
 #define WINDOW_DATA_KEY	"EphyPushScrollerExtension::WindowData"
 
@@ -170,3 +170,12 @@ ephy_push_scroller_extension_register_type (GTypeModule *module)
 
 	return type;
 }
+
+G_MODULE_EXPORT void
+peas_register_types (PeasObjectModule *module)
+{
+	ephy_push_scroller_extension_register_type (G_TYPE_MODULE (module));
+	peas_object_module_register_extension_type (module,
+						    EPHY_TYPE_EXTENSION,
+						    EPHY_TYPE_PUSH_SCROLLER_EXTENSION);
+}
diff --git a/extensions/push-scroller/ephy-push-scroller-extension.h b/extensions/push-scroller/ephy-push-scroller-extension.h
index 468609f..6619e73 100644
--- a/extensions/push-scroller/ephy-push-scroller-extension.h
+++ b/extensions/push-scroller/ephy-push-scroller-extension.h
@@ -24,6 +24,7 @@
 
 #include <glib.h>
 #include <glib-object.h>
+#include <libpeas/peas.h>
 
 G_BEGIN_DECLS
 
@@ -39,18 +40,20 @@ typedef struct _EphyPushScrollerExtensionClass	EphyPushScrollerExtensionClass;
 
 struct _EphyPushScrollerExtensionClass
 {
-	GObjectClass parent_class;
+	PeasExtensionBaseClass parent_class;
 };
 
 struct _EphyPushScrollerExtension
 {
-	GObject parent_instance;
+	PeasExtensionBase parent_instance;
 };
 
 GType	ephy_push_scroller_extension_get_type		(void);
 
 GType	ephy_push_scroller_extension_register_type	(GTypeModule *module);
 
+G_MODULE_EXPORT void   peas_register_types		(PeasObjectModule *module);
+
 G_END_DECLS
 
 #endif
diff --git a/extensions/push-scroller/push-scroller.plugin.in.in b/extensions/push-scroller/push-scroller.plugin.in.in
new file mode 100644
index 0000000..eed02dc
--- /dev/null
+++ b/extensions/push-scroller/push-scroller.plugin.in.in
@@ -0,0 +1,7 @@
+[Plugin]
+Module=%LIBRARY%
+IAge=1
+_Name=Push Scroll
+_Description=Drag the page on middle mouse click
+Authors=Samuel Abels <spam2 debain org>
+Website=http://www.gnome.org/projects/epiphany/extensions.html



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