epiphany-extensions r1730 - in branches/gnome-2-22/extensions/sample-mozilla: . mozilla



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

Log:
Fix the glue in the sample-mozilla extension.


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

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

Modified: branches/gnome-2-22/extensions/sample-mozilla/mozilla/mozilla-sample.cpp
==============================================================================
--- branches/gnome-2-22/extensions/sample-mozilla/mozilla/mozilla-sample.cpp	(original)
+++ branches/gnome-2-22/extensions/sample-mozilla/mozilla/mozilla-sample.cpp	Sun May 18 21:51:27 2008
@@ -24,6 +24,11 @@
 
 #include <glib.h>
 
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
 #include <nsCOMPtr.h>
 #include <nsIDOMEvent.h>
 #include <nsIDOMMouseEvent.h>
@@ -45,3 +50,25 @@
 
 	g_print ("Button %u\n", button);
 }
+
+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/sample-mozilla/mozilla/mozilla-sample.h
==============================================================================
--- branches/gnome-2-22/extensions/sample-mozilla/mozilla/mozilla-sample.h	(original)
+++ branches/gnome-2-22/extensions/sample-mozilla/mozilla/mozilla-sample.h	Sun May 18 21:51:27 2008
@@ -28,6 +28,8 @@
 
 void	mozilla_do_something (gpointer dom_event);
 
+gboolean       mozilla_glue_startup             (void);
+
 G_END_DECLS
 
 #endif

Modified: branches/gnome-2-22/extensions/sample-mozilla/sample-mozilla.c
==============================================================================
--- branches/gnome-2-22/extensions/sample-mozilla/sample-mozilla.c	(original)
+++ branches/gnome-2-22/extensions/sample-mozilla/sample-mozilla.c	Sun May 18 21:51:27 2008
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include "ephy-sample2-extension.h"
+#include "mozilla-sample.h"
 #include "ephy-debug.h"
 
 #include <gmodule.h>
@@ -34,6 +35,9 @@
 {
 	LOG ("Registering EphySample2Extension");
 
+        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]