epiphany-extensions r1731 - in branches/gnome-2-22/extensions/select-stylesheet: . mozilla



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

Log:
Fix the glue in the select-stylesheet extension.


Modified:
   branches/gnome-2-22/extensions/select-stylesheet/extension.c
   branches/gnome-2-22/extensions/select-stylesheet/mozilla/Makefile.am
   branches/gnome-2-22/extensions/select-stylesheet/mozilla/mozilla-helpers.cpp
   branches/gnome-2-22/extensions/select-stylesheet/mozilla/mozilla-helpers.h

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

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

Modified: branches/gnome-2-22/extensions/select-stylesheet/mozilla/mozilla-helpers.cpp
==============================================================================
--- branches/gnome-2-22/extensions/select-stylesheet/mozilla/mozilla-helpers.cpp	(original)
+++ branches/gnome-2-22/extensions/select-stylesheet/mozilla/mozilla-helpers.cpp	Sun May 18 21:51:32 2008
@@ -27,6 +27,11 @@
 
 #include <glib/gi18n-lib.h>
 
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
 #include <nsStringAPI.h>
 
 #include <gtkmozembed.h>
@@ -103,7 +108,7 @@
 	NS_ENSURE_TRUE (aEmbed, NS_ERROR_FAILURE);
 
 	nsCOMPtr<nsIWebBrowser> browser;
-	gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (gtk_bin_get_child (GTK_BIN (embed))),
+	gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (gtk_bin_get_child (GTK_BIN (aEmbed))),
 					 getter_AddRefs (browser));
 	NS_ENSURE_TRUE (browser, NS_ERROR_FAILURE);
 
@@ -290,3 +295,25 @@
 		item->SetDisabled (strcmp (cTitle.get(), aSelected->mName) != 0);
 	}
 }
+
+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/select-stylesheet/mozilla/mozilla-helpers.h
==============================================================================
--- branches/gnome-2-22/extensions/select-stylesheet/mozilla/mozilla-helpers.h	(original)
+++ branches/gnome-2-22/extensions/select-stylesheet/mozilla/mozilla-helpers.h	Sun May 18 21:51:32 2008
@@ -48,6 +48,8 @@
 void		mozilla_set_stylesheet		(EphyEmbed *embed,
 						 MozillaStyleSheet *style);
 
+gboolean       mozilla_glue_startup             (void);
+
 G_END_DECLS
 
 #endif /* MOZILLA_HELPERS_H */



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