epiphany-extensions r1727 - in branches/gnome-2-22/extensions/greasemonkey: . mozilla
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: epiphany-extensions r1727 - in branches/gnome-2-22/extensions/greasemonkey: . mozilla
- Date: Sun, 18 May 2008 21:51:11 +0000 (UTC)
Author: chpe
Date: Sun May 18 21:51:10 2008
New Revision: 1727
URL: http://svn.gnome.org/viewvc/epiphany-extensions?rev=1727&view=rev
Log:
Fix the glue in the greasemonkey extension.
Modified:
branches/gnome-2-22/extensions/greasemonkey/extension.c
branches/gnome-2-22/extensions/greasemonkey/mozilla/Makefile.am
branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.cpp
branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.h
Modified: branches/gnome-2-22/extensions/greasemonkey/extension.c
==============================================================================
--- branches/gnome-2-22/extensions/greasemonkey/extension.c (original)
+++ branches/gnome-2-22/extensions/greasemonkey/extension.c Sun May 18 21:51:10 2008
@@ -23,6 +23,7 @@
#include "greasemonkey-script.h"
#include "ephy-greasemonkey-extension.h"
+#include "mozilla-helpers.h"
#include "ephy-debug.h"
#include <gmodule.h>
@@ -35,6 +36,9 @@
{
LOG ("Registering EphyGreasemonkeyExtension");
+ 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/greasemonkey/mozilla/Makefile.am
==============================================================================
--- branches/gnome-2-22/extensions/greasemonkey/mozilla/Makefile.am (original)
+++ branches/gnome-2-22/extensions/greasemonkey/mozilla/Makefile.am Sun May 18 21:51:10 2008
@@ -23,3 +23,10 @@
$(MOZILLA_COMPONENT_CFLAGS) \
$(EPIPHANY_DEPENDENCY_CFLAGS) \
$(AM_CXXFLAGS)
+
+if HAVE_GECKO_1_9
+if HAVE_GECKO_XPCOM_GLUE
+libgreasemonkeymozilla_la_CPPFLAGS += \
+ -DXPCOM_GLUE_USE_NSPR
+endif
+endif
Modified: branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.cpp
==============================================================================
--- branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.cpp (original)
+++ branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.cpp Sun May 18 21:51:10 2008
@@ -24,6 +24,11 @@
#include <glib.h>
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
#include <nsStringAPI.h>
#include <nsCOMPtr.h>
@@ -101,3 +106,26 @@
return TRUE;
}
+
+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
+#error hi there!
+ return TRUE;
+#endif /* XPCOM_GLUE */
+}
Modified: branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.h
==============================================================================
--- branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.h (original)
+++ branches/gnome-2-22/extensions/greasemonkey/mozilla/mozilla-helpers.h Sun May 18 21:51:10 2008
@@ -31,6 +31,8 @@
gboolean mozilla_evaluate_js (gpointer event,
const char *script);
+gboolean mozilla_glue_startup (void);
+
G_END_DECLS
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]