epiphany-extensions r1729 - in branches/gnome-2-22/extensions/livehttpheaders: . mozilla



Author: chpe
Date: Sun May 18 21:51:22 2008
New Revision: 1729
URL: http://svn.gnome.org/viewvc/epiphany-extensions?rev=1729&view=rev

Log:
Fix the glue in the livehttpheaders extension.


Modified:
   branches/gnome-2-22/extensions/livehttpheaders/extension.c
   branches/gnome-2-22/extensions/livehttpheaders/mozilla/Makefile.am
   branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.cpp
   branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.h

Modified: branches/gnome-2-22/extensions/livehttpheaders/extension.c
==============================================================================
--- branches/gnome-2-22/extensions/livehttpheaders/extension.c	(original)
+++ branches/gnome-2-22/extensions/livehttpheaders/extension.c	Sun May 18 21:51:22 2008
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include "ephy-livehttpheaders-extension.h"
+#include "mozilla-helper.h"
 #include "ephy-debug.h"
 
 #include <gmodule.h>
@@ -34,6 +35,9 @@
 {
 	LOG ("Registering EphyLivehttpheadersExtension");
 
+        if (!mozilla_glue_startup ())
+              return 0;
+
 #ifdef ENABLE_NLS
        /* Initialise the i18n stuff */
         bindtextdomain (GETTEXT_PACKAGE, EPHY_EXTENSIONS_LOCALEDIR);

Modified: branches/gnome-2-22/extensions/livehttpheaders/mozilla/Makefile.am
==============================================================================
--- branches/gnome-2-22/extensions/livehttpheaders/mozilla/Makefile.am	(original)
+++ branches/gnome-2-22/extensions/livehttpheaders/mozilla/Makefile.am	Sun May 18 21:51:22 2008
@@ -23,3 +23,10 @@
 	$(MOZILLA_COMPONENT_CFLAGS)	\
 	$(EPIPHANY_DEPENDENCY_CFLAGS) 	\
 	$(AM_CXXFLAGS)
+
+if HAVE_GECKO_1_9
+if HAVE_GECKO_XPCOM_GLUE
+liblivehttpheadersmozilla_la_CPPFLAGS += \
+ 	-DXPCOM_GLUE_USE_NSPR
+endif
+endif

Modified: branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.cpp
==============================================================================
--- branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.cpp	(original)
+++ branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.cpp	Sun May 18 21:51:22 2008
@@ -22,6 +22,11 @@
 
 #include "config.h"
 
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
 #include "mozilla-helper.h"
 #include "LiveHTTPHeadersListener.h"
 
@@ -70,3 +75,25 @@
 {
 	return listener->ClearFrames ();
 }
+
+gboolean
+mozilla_glue_startup (void)
+{
+#ifdef XPCOM_GLUE
+	static const GREVersionRange greVersion = {
+	  "1.9a", PR_TRUE,
+	  "2", PR_TRUE
+	};
+	char xpcomLocation[4096];
+
+	if (NS_FAILED (GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcomLocation, sizeof (xpcomLocation))) ||
+	    NS_FAILED (XPCOMGlueStartup (xpcomLocation)) ||
+	    NS_FAILED (GTKEmbedGlueStartup ()) ||
+	    NS_FAILED (GTKEmbedGlueStartupInternal()))
+                return FALSE;
+
+        return TRUE;
+#else
+        return TRUE;
+#endif /* XPCOM_GLUE */
+}

Modified: branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.h
==============================================================================
--- branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.h	(original)
+++ branches/gnome-2-22/extensions/livehttpheaders/mozilla/mozilla-helper.h	Sun May 18 21:51:22 2008
@@ -39,6 +39,8 @@
 GSList *	get_frames (void);
 void 		clear_frames (void);
 
+gboolean       mozilla_glue_startup             (void);
+
 G_END_DECLS
 
 #endif



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