epiphany r8755 - in trunk: . src



Author: chpe
Date: Sat Feb  7 15:01:40 2009
New Revision: 8755
URL: http://svn.gnome.org/viewvc/epiphany?rev=8755&view=rev

Log:
Add gobject introspection support; use --enable-introspection.


Modified:
   trunk/configure.ac
   trunk/src/Makefile.am
   trunk/src/ephy-main.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sat Feb  7 15:01:40 2009
@@ -211,12 +211,51 @@
 
 AC_CHECK_HEADERS([X11/XF86keysym.h])
 
+EPIPHANY_FEATURES=
+
+# *********************
+# GObject Introspection
+# *********************
+
+AC_MSG_CHECKING([whether to enable GObject introspection support])
+AC_ARG_ENABLE([introspection],
+  [AS_HELP_STRING([--enable-introspection],[Enable GObject introspection (default: disabled)])],
+  [],[enable_introspection=no])
+AC_MSG_RESULT([$enable_introspection])
+
+G_IR_SCANNER=
+G_IR_COMPILER=
+G_IR_GENERATE=
+GIRDIR=
+GIRTYPELIBDIR=
+
+if test "$enable_introspection" = "yes"; then
+  EPIPHANY_FEATURES="$EPIPHANY_FEATURES introspection"
+
+  GOBJECT_INTROSPECTION_REQUIRED=0.6.2
+  PKG_CHECK_MODULES([INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
+  
+  G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
+  G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
+  G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
+  GIRDIR="$($PKG_CONFIG --variable=girdir gobject-introspection-1.0)"
+  GIRTYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+
+  AC_DEFINE([ENABLE_INTROSPECTION],[1],[Define to enable GObject introspection support])
+fi
+
+AC_SUBST([G_IR_SCANNER])
+AC_SUBST([G_IR_COMPILER])
+AC_SUBST([G_IR_GENERATE])
+AC_SUBST([GIRDIR])
+AC_SUBST([GIRTYPELIBDIR])
+
+AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
+
 # ******
 # Python
 # ******
 
-EPIPHANY_FEATURES=
-
 AC_MSG_CHECKING([whether Python support is requested])
 
 AC_ARG_ENABLE([python],
@@ -562,6 +601,7 @@
 
  	Zeroconf bookmarks support : $enable_zeroconf
  	NetworkManager support     : $enable_network_manager
+ 	GObject introspection      : $enable_introspection
  	Python support             : $enable_python
  	Build tests                : $enable_tests
 "

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sat Feb  7 15:01:40 2009
@@ -216,6 +216,11 @@
 	$(DBUS_LIBS) \
 	$(LIBINTL)
 
+if ENABLE_INTROSPECTION
+epiphany_CFLAGS += $(INTROSPECTION_CFLAGS)
+epiphany_LDADD += $(INTROSPECTION_LIBS)
+endif
+
 if ENABLE_PYTHON
 epiphany_LDADD += \
 	libpyphany.la				\
@@ -494,4 +499,68 @@
 
 #check-local: check-python-binding
 
-endif
+endif # ENABLE_PYTHON
+
+if ENABLE_INTROSPECTION
+EPHY_GIR_H_FILES = \
+	$(top_srcdir)/embed/ephy-command-manager.h \
+	$(top_srcdir)/embed/ephy-cookie-manager.h \
+	$(top_srcdir)/embed/ephy-embed-event.h \
+	$(top_srcdir)/embed/ephy-embed-factory.h \
+	$(top_srcdir)/embed/ephy-embed.h \
+	$(top_srcdir)/embed/ephy-embed-persist.h \
+	$(top_srcdir)/embed/ephy-embed-shell.h \
+	$(top_srcdir)/embed/ephy-embed-single.h \
+	$(top_srcdir)/embed/ephy-favicon-cache.h \
+	$(top_srcdir)/embed/ephy-history.h \
+	$(top_srcdir)/embed/ephy-password-manager.h \
+	$(top_srcdir)/embed/ephy-permission-manager.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/egg/egg-editable-toolbar.h \
+	$(top_srcdir)/lib/egg/egg-toolbars-model.h \
+	$(top_srcdir)/lib/widgets/ephy-search-entry.h \
+	$(top_srcdir)/lib/widgets/ephy-spinner.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-action.h \
+	$(top_srcdir)/src/ephy-notebook.h \
+	$(top_srcdir)/src/ephy-session.h \
+	$(top_srcdir)/src/ephy-shell.h \
+	$(top_srcdir)/src/ephy-statusbar.h \
+	$(top_srcdir)/src/ephy-toolbar.h \
+	$(top_srcdir)/src/ephy-window.h \
+	$(NULL)
+
+Epiphany-$(EPIPHANY_API_VERSION).gir: epiphany $(G_IR_SCANNER)
+	$(G_IR_SCANNER) -v \
+		--namespace Epiphany \
+		--nsversion=$(EPIPHANY_API_VERSION) \
+		--add-include-path=. \
+		--add-include-path=$(srcdir) \
+		--include=Gtk-2.0 \
+		--include=libxml2-2.0 \
+		--program=./epiphany \
+		--output $@ \
+		--pkg epiphany-$(EPIPHANY_API_VERSION) \
+		$(EPHY_GIR_H_FILES)
+
+girdir = $(GIRDIR)
+gir_DATA = Epiphany-$(EPIPHANY_API_VERSION).gir
+
+typelibsdir = $(GIRTYPELIBDIR)
+typelibs_DATA = Epiphany-$(EPIPHANY_API_VERSION).typelib
+
+Epiphany-$(EPIPHANY_API_VERSION).typelib: Epiphany-$(EPIPHANY_API_VERSION).gir $(G_IR_COMPILER)
+	g-ir-compiler Epiphany-$(EPIPHANY_API_VERSION).gir -o Epiphany-$(EPIPHANY_API_VERSION).typelib
+
+EXTRA_DIST += Epiphany-$(EPIPHANY_API_VERSION).gir
+CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+
+endif # ENABLE_INTROSPECTION

Modified: trunk/src/ephy-main.c
==============================================================================
--- trunk/src/ephy-main.c	(original)
+++ trunk/src/ephy-main.c	Sat Feb  7 15:01:40 2009
@@ -45,6 +45,10 @@
 #include <errno.h>
 #include <string.h>
 
+#ifdef ENABLE_INTROSPECTION
+#include <girepository.h>
+#endif
+
 #ifdef HAVE_LIBNOTIFY
 #include <libnotify/notify.h>
 #endif
@@ -79,6 +83,19 @@
  return FALSE;
 }
  
+#ifdef ENABLE_INTROSPECTION
+static gboolean
+option_introspection_dump_cb (const gchar *option_name,
+                              const gchar *value,
+                              gpointer     data,
+                              GError     **error)
+{
+        g_irepository_dump (value, NULL);
+        exit (0);
+        return TRUE;
+}
+#endif /* ENABLE_INTROSPECTION */
+
 static const GOptionEntry option_entries[] =
 {
 	{ "new-tab", 'n', 0, G_OPTION_ARG_NONE, &open_in_new_tab,
@@ -101,6 +118,10 @@
 	  "", N_("URL â")},
 	{ "version", 0, G_OPTION_FLAG_NO_ARG | G_OPTION_FLAG_HIDDEN, 
 	  G_OPTION_ARG_CALLBACK, option_version_cb, NULL, NULL },
+#ifdef ENABLE_INTROSPECTION
+	{ "introspect-dump", 0, G_OPTION_FLAG_HIDDEN, 
+	  G_OPTION_ARG_CALLBACK, option_introspection_dump_cb, NULL, NULL },
+#endif
 	{ NULL }
 };
 



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