epiphany-extensions r1732 - in branches/gnome-2-22/extensions/smart-bookmarks: . mozilla



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

Log:
Fix the glue in the smart-bookmarks extension.


Modified:
   branches/gnome-2-22/extensions/smart-bookmarks/mozilla/Makefile.am
   branches/gnome-2-22/extensions/smart-bookmarks/mozilla/mozilla-selection.cpp
   branches/gnome-2-22/extensions/smart-bookmarks/mozilla/mozilla-selection.h
   branches/gnome-2-22/extensions/smart-bookmarks/smart-bookmarks.c

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

Modified: branches/gnome-2-22/extensions/smart-bookmarks/mozilla/mozilla-selection.cpp
==============================================================================
--- branches/gnome-2-22/extensions/smart-bookmarks/mozilla/mozilla-selection.cpp	(original)
+++ branches/gnome-2-22/extensions/smart-bookmarks/mozilla/mozilla-selection.cpp	Sun May 18 21:51:38 2008
@@ -24,6 +24,11 @@
 
 #include <glib.h>
 
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
 #include <nsStringAPI.h>
 
 #include <gtkmozembed.h>
@@ -128,3 +133,25 @@
 
 	return NULL;
 }
+
+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/smart-bookmarks/mozilla/mozilla-selection.h
==============================================================================
--- branches/gnome-2-22/extensions/smart-bookmarks/mozilla/mozilla-selection.h	(original)
+++ branches/gnome-2-22/extensions/smart-bookmarks/mozilla/mozilla-selection.h	Sun May 18 21:51:38 2008
@@ -29,6 +29,8 @@
 
 char *mozilla_get_selected_text (EphyEmbed *embed);
 
+gboolean mozilla_glue_startup (void);
+
 G_END_DECLS
 
 #endif

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



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