[epiphany-extensions/peas: 10/10] gestures: port to libpeas



commit b33e76832ef8cff608f62d7d6e4dab7962169ffd
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Mon Apr 4 12:50:33 2011 -0500

    gestures: port to libpeas
    
    FIXME: crashes on gesture

 extensions/gestures/Makefile.am                   |    9 ++--
 extensions/gestures/ephy-gestures-extension.c     |   14 ++++++-
 extensions/gestures/ephy-gestures-extension.h     |    9 ++--
 extensions/gestures/gestures.c                    |   45 ---------------------
 extensions/gestures/gestures.ephy-extension.in.in |   11 -----
 extensions/gestures/gestures.plugin.in.in         |    7 +++
 6 files changed, 29 insertions(+), 66 deletions(-)
---
diff --git a/extensions/gestures/Makefile.am b/extensions/gestures/Makefile.am
index 1e4b5b4..e3d5c3c 100644
--- a/extensions/gestures/Makefile.am
+++ b/extensions/gestures/Makefile.am
@@ -6,7 +6,6 @@ libgesturesextension_la_SOURCES = 	\
 	ephy-gesture.h			\
 	ephy-gestures-extension.c	\
 	ephy-gestures-extension.h	\
-	gestures.c			\
 	stroke.c			\
 	stroke.h
 
@@ -22,17 +21,17 @@ libgesturesextension_la_CFLAGS = \
 
 libgesturesextension_la_LDFLAGS = \
 	-module -avoid-version \
-	-export-symbols $(top_srcdir)/ephy-extension.symbols \
+	-no-undefined \
 	$(AM_LDFLAGS)
  
 gesturesdir = $(pkgdatadir)
 gestures_DATA =	ephy-gestures.xml
 
 extensioninidir = $(extensiondir)
-extensionini_in_files = gestures.ephy-extension.in.in
-extensionini_DATA = $(extensionini_in_files:.ephy-extension.in.in=.ephy-extension)
+extensionini_in_files = gestures.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/gestures/ephy-gestures-extension.c b/extensions/gestures/ephy-gestures-extension.c
index a435b0c..bd4c8c7 100644
--- a/extensions/gestures/ephy-gestures-extension.c
+++ b/extensions/gestures/ephy-gestures-extension.c
@@ -29,11 +29,12 @@
 
 #include <epiphany/epiphany.h>
 
-#include <gmodule.h>
 #include <libxml/tree.h>
 
 #include <string.h>
 
+#include <libpeas/peas.h>
+
 #define WINDOW_DATA_KEY	"EphyGesturesExtension::WindowData"
 
 #define EPHY_GESTURES_EXTENSION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_GESTURES_EXTENSION, EphyGesturesExtensionPrivate))
@@ -364,3 +365,14 @@ ephy_gestures_extension_class_init (EphyGesturesExtensionClass *class)
 
 	g_type_class_add_private (object_class, sizeof (EphyGesturesExtensionPrivate));
 }
+
+G_MODULE_EXPORT void
+peas_register_types (PeasObjectModule *module)
+{
+	ephy_gesture_register_type (G_TYPE_MODULE (module));
+	ephy_gestures_extension_register_type (G_TYPE_MODULE (module));
+
+	peas_object_module_register_extension_type (module,
+						    EPHY_TYPE_EXTENSION,
+						    EPHY_TYPE_GESTURES_EXTENSION);
+}
diff --git a/extensions/gestures/ephy-gestures-extension.h b/extensions/gestures/ephy-gestures-extension.h
index c061973..154be30 100644
--- a/extensions/gestures/ephy-gestures-extension.h
+++ b/extensions/gestures/ephy-gestures-extension.h
@@ -23,8 +23,7 @@
 #define EPHY_GESTURES_EXTENSION_H
 
 #include <glib.h>
-#include <glib-object.h>
-#include <gmodule.h>
+#include <libpeas/peas.h>
 
 G_BEGIN_DECLS
 
@@ -41,12 +40,12 @@ typedef struct EphyGesturesExtensionPrivate	EphyGesturesExtensionPrivate;
 
 struct EphyGesturesExtensionClass
 {
-	GObjectClass parent_class;
+	PeasExtensionBaseClass parent_class;
 };
 
 struct EphyGesturesExtension
 {
-	GObject parent_instance;
+	PeasExtensionBase parent_instance;
 
 	EphyGesturesExtensionPrivate *priv;
 };
@@ -55,6 +54,8 @@ GType	ephy_gestures_extension_get_type	(void);
 
 GType	ephy_gestures_extension_register_type	(GTypeModule *module);
 
+G_MODULE_EXPORT void	peas_register_types	(PeasObjectModule *module);
+
 G_END_DECLS
 
 #endif
diff --git a/extensions/gestures/gestures.plugin.in.in b/extensions/gestures/gestures.plugin.in.in
new file mode 100644
index 0000000..c4cfd30
--- /dev/null
+++ b/extensions/gestures/gestures.plugin.in.in
@@ -0,0 +1,7 @@
+[Plugin]
+Module=%LIBRARY%
+IAge=1
+_Name=Gestures
+_Description=Perform actions with mouse gestures
+Authors=Adam Hooper <adamh cvs gnome org>;Christian Persch <chpe 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]