epiphany-extensions r1726 - in branches/gnome-2-22/extensions/error-viewer: . mozilla
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: epiphany-extensions r1726 - in branches/gnome-2-22/extensions/error-viewer: . mozilla
- Date: Sun, 18 May 2008 21:51:05 +0000 (UTC)
Author: chpe
Date: Sun May 18 21:51:05 2008
New Revision: 1726
URL: http://svn.gnome.org/viewvc/epiphany-extensions?rev=1726&view=rev
Log:
Fix the galue in the error-viewer extension.
Modified:
branches/gnome-2-22/extensions/error-viewer/extension.c
branches/gnome-2-22/extensions/error-viewer/mozilla/Makefile.am
branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-helpers.cpp
branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-helpers.h
branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-link-checker.cpp
Modified: branches/gnome-2-22/extensions/error-viewer/extension.c
==============================================================================
--- branches/gnome-2-22/extensions/error-viewer/extension.c (original)
+++ branches/gnome-2-22/extensions/error-viewer/extension.c Sun May 18 21:51:05 2008
@@ -26,6 +26,7 @@
#include "error-viewer.h"
#include "link-checker.h"
#include "sgml-validator.h"
+#include "mozilla-helpers.h"
#include "ephy-debug.h"
#include <gmodule.h>
@@ -38,6 +39,9 @@
{
LOG ("Registering EphyErrorViewerExtension");
+ 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/error-viewer/mozilla/Makefile.am
==============================================================================
--- branches/gnome-2-22/extensions/error-viewer/mozilla/Makefile.am (original)
+++ branches/gnome-2-22/extensions/error-viewer/mozilla/Makefile.am Sun May 18 21:51:05 2008
@@ -35,3 +35,10 @@
$(MOZILLA_COMPONENT_CFLAGS) \
$(EPIPHANY_DEPENDENCY_CFLAGS) \
$(AM_CXXFLAGS)
+
+if HAVE_GECKO_1_9
+if HAVE_GECKO_XPCOM_GLUE
+liberrorviewermozilla_la_CPPFLAGS += \
+ -DXPCOM_GLUE_USE_NSPR
+endif
+endif
Modified: branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-helpers.cpp
==============================================================================
--- branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-helpers.cpp (original)
+++ branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-helpers.cpp Sun May 18 21:51:05 2008
@@ -20,6 +20,11 @@
#include "mozilla-config.h"
#include "config.h"
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
#include <nsStringAPI.h>
#include <gtkmozembed.h>
@@ -39,7 +44,7 @@
mozilla_get_doctype (EphyEmbed *embed)
{
nsCOMPtr<nsIWebBrowser> browser;
- gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (embed),
+ gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (gtk_bin_get_child (GTK_BIN (embed))),
getter_AddRefs (browser));
NS_ENSURE_TRUE (browser, NULL);
@@ -70,7 +75,7 @@
mozilla_get_content_type (EphyEmbed *embed)
{
nsCOMPtr<nsIWebBrowser> browser;
- gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (embed),
+ gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (gtk_bin_get_child (GTK_BIN (embed))),
getter_AddRefs (browser));
NS_ENSURE_TRUE (browser, NULL);
@@ -94,3 +99,26 @@
return g_strdup (cType.get());
}
+
+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/error-viewer/mozilla/mozilla-helpers.h
==============================================================================
--- branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-helpers.h (original)
+++ branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-helpers.h Sun May 18 21:51:05 2008
@@ -35,6 +35,8 @@
gboolean mozilla_check_url (EphyEmbed *embed, char *url);
+gboolean mozilla_glue_startup (void);
+
G_END_DECLS
#endif
Modified: branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-link-checker.cpp
==============================================================================
--- branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-link-checker.cpp (original)
+++ branches/gnome-2-22/extensions/error-viewer/mozilla/mozilla-link-checker.cpp Sun May 18 21:51:05 2008
@@ -45,7 +45,7 @@
nsresult rv;
nsCOMPtr<nsIWebBrowser> browser;
- gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (embed),
+ gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (gtk_bin_get_child (GTK_BIN (embed))),
getter_AddRefs (browser));
NS_ENSURE_TRUE (browser, );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]