galeon r8964 - in trunk: . mozilla src



Author: philipl
Date: Fri Jul  4 19:03:08 2008
New Revision: 8964
URL: http://svn.gnome.org/viewvc/galeon?rev=8964&view=rev

Log:
2008-07-04  Philip Langdale  <philipl alumni utexas net>

	* configure.in
	* mozilla/GaleonWrapper.cpp
	* mozilla/ContentHandler.cpp
	* mozilla/MozRegisterComponents.cpp
	* mozilla/FilePicker.cpp
	* mozilla/mozilla-embed-shell.cpp
	* mozilla/GtkNSSClientAuthDialogs.cpp
	* mozilla/JSConsoleListener.cpp
	* mozilla/Makefile.am
	* src/Makefile.am: Updates to support the final 1.9 release
	of xulrunner (firefox 3.0). All the features that we had to
	turn off for 1.9 are still off. The real work in this change
	comes from Loic Minier <lool dooz org>, the hardworking
	Debian package maintainer. I just added some configure.in
	checks.



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/mozilla/ContentHandler.cpp
   trunk/mozilla/FilePicker.cpp
   trunk/mozilla/GaleonWrapper.cpp
   trunk/mozilla/GtkNSSClientAuthDialogs.cpp
   trunk/mozilla/JSConsoleListener.cpp
   trunk/mozilla/Makefile.am
   trunk/mozilla/MozRegisterComponents.cpp
   trunk/mozilla/mozilla-embed-shell.cpp
   trunk/src/Makefile.am

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Fri Jul  4 19:03:08 2008
@@ -183,15 +183,39 @@
 fi
 
 dnl #########################
+dnl User-Agent header
+dnl #########################
+AC_MSG_CHECKING([User-Agent header to use])
+
+AC_ARG_WITH([useragent-vendor],
+        AC_HELP_STRING([--with-useragent-vendor@<:@=User-Agent vendor@:>@],
+                [User-Agent header vendor part (default: "Galeon")]),
+        useragent_vendor="$with_useragent_vendor",
+        useragent_vendor="Galeon")
+AC_DEFINE_UNQUOTED(USERAGENT_VENDOR,
+        ["$useragent_vendor"],
+        [User-Agent header vendor part])
+AC_ARG_WITH([useragent-vendorsub],
+        AC_HELP_STRING([--with-useragent-vendorsub@<:@=User-Agent vendorSub@:>@],
+                [User-Agent header vendorSub part (default: release version)]),
+        useragent_vendorsub="$with_useragent_vendorsub",
+        useragent_vendorsub="$VERSION")
+AC_DEFINE_UNQUOTED(USERAGENT_VENDORSUB,
+        ["$useragent_vendorsub"],
+        [User-Agent header vendorSub part])
+
+AC_MSG_RESULT(["$useragent_vendor $useragent_vendorsub"])
+
+dnl #########################
 dnl Mozilla version checking
 dnl #########################
 AC_MSG_CHECKING([which mozilla engine to use])
 
 AC_ARG_WITH([mozilla],
-        AC_HELP_STRING([--with-mozilla@<:@=mozilla|seamonkey|firefox|xulrunner|thunderbird@:>@],
+        AC_HELP_STRING([--with-mozilla@<:@=libxul-embedding-unstable|mozilla|seamonkey|firefox|xulrunner|thunderbird@:>@],
                        [Which gecko engine to use (default: autodetect)]))
 
-GECKOS="firefox mozilla-firefox seamonkey mozilla xulrunner thunderbird mozilla-thunderbird"
+GECKOS="libxul-embedding-unstable firefox mozilla-firefox seamonkey mozilla xulrunner thunderbird mozilla-thunderbird"
 gecko=$with_mozilla
 autodetect=
 
@@ -215,6 +239,7 @@
 AC_MSG_RESULT([$gecko$autodetect])
 
 case "$gecko" in
+libxul-embedding-unstable) min_version=1.9 flavour=toolkit ;;
 mozilla) min_version=1.7.5 flavour=mozilla ;;
 seamonkey) min_version=1.0 flavour=mozilla ;;
 *firefox) min_version=1.0 flavour=toolkit ;;
@@ -225,21 +250,32 @@
 MOZILLA=$gecko
 AC_SUBST([MOZILLA])
 
-PKG_CHECK_MODULES(XPCOM_COMPONENT, $MOZILLA-xpcom >= $min_version)
+if test $MOZILLA = libxul-embedding-unstable; then
+    MOZILLA_XPCOM=$MOZILLA
+    MOZILLA_GTKMOZEMBED=$MOZILLA
+else
+    MOZILLA_XPCOM=$MOZILLA-xpcom
+    MOZILLA_XPCOM=$MOZILLA-gtkmozembed
+fi
+PKG_CHECK_MODULES(XPCOM_COMPONENT, $MOZILLA_XPCOM >= $min_version)
 
-MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA-xpcom`"
+MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir $MOZILLA_XPCOM`"
+if test $MOZILLA = libxul-embedding-unstable; then
+    MOZILLA_INCLUDE_ROOT="$MOZILLA_INCLUDE_ROOT/`$PKG_CONFIG --variable=includetype $MOZILLA_XPCOM`"
+fi
 AC_SUBST(MOZILLA_INCLUDE_ROOT)
 
-MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $MOZILLA-xpcom`"
-AC_SUBST(MOZILLA_HOME)
-
-PKG_CHECK_MODULES(MOZILLA_COMPONENT, $MOZILLA-gtkmozembed >= $min_version,
+PKG_CHECK_MODULES(MOZILLA_COMPONENT, $MOZILLA_GTKMOZEMBED >= $min_version,
 		  [has_gtkmozembed=yes], [has_gtkmozembed=no])
 if test "x$has_gtkmozembed" = "xno"; then
 	MOZILLA_COMPONENT_CFLAGS="$XPCOM_COMPONENT_CFLAGS -I$MOZILLA_INCLUDE_ROOT/gtkembedmoz"
 	MOZILLA_COMPONENT_LIBS="$XPCOM_COMPONENT_LIBS -lxul"
 fi
 
+#if test $MOZILLA = xulrunner; then
+#  MOZILLA_COMPONENT_LIBS="$MOZILLA_COMPONENT_LIBS -lxul"
+#fi
+
 AC_ARG_ENABLE(libxpcomglue_s,
 	[  --enable-libxpcomglue_s Enable linking with libxpcomglue_s (needed for trunk builds)],,
 	enable_libxpcomglue_s=no)
@@ -252,8 +288,34 @@
 
 AC_DEFINE(ENABLE_MOZILLA_EMBED, 1, [Define to 1 if you wish to enable the Mozilla renderer.])
 
-MOZILLA_VERSION=`$PKG_CONFIG --modversion $MOZILLA-xpcom`
-AC_MSG_RESULT([Using $MOZILLA version $MOZILLA_VERSION from $MOZILLA_HOME])
+_SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $XPCOM_COMPONENT_CFLAGS"
+AC_MSG_CHECKING([[whether we have a xpcom glue]])
+AC_COMPILE_IFELSE(
+        [AC_LANG_SOURCE(
+                [[
+                  #ifndef XPCOM_GLUE
+                  #error "no xpcom glue found"
+                  #endif]]
+        )],
+        [gecko_cv_have_xpcom_glue=yes],
+        [gecko_cv_have_xpcom_glue=no])
+AC_MSG_RESULT([$gecko_cv_have_xpcom_glue])
+CPPFLAGS="$_SAVE_CPPFLAGS"
+AM_CONDITIONAL([HAVE_XPCOM_GLUE], [test "$gecko_cv_have_xpcom_glue" = "yes"])
+
+MOZILLA_VERSION=`$PKG_CONFIG --modversion $MOZILLA_XPCOM`
+if test "$gecko_cv_have_xpcom_glue" = "yes"; then
+    MOZILLA_HOME=""
+    MOZILLA_COMPONENT_CFLAGS="$MOZILLA_COMPONENT_CFLAGS -DXPCOM_GLUE_USE_NSPR"
+    MOZILLA_COMPONENT_CFLAGS="$MOZILLA_COMPONENT_CFLAGS `pkg-config --cflags nspr`"
+    MOZILLA_COMPONENT_LIBS="$MOZILLA_COMPONENT_LIBS `pkg-config --libs nspr`"
+    AC_MSG_RESULT([Using $MOZILLA version $MOZILLA_VERSION])
+else
+    MOZILLA_HOME="`$PKG_CONFIG --variable=libdir $MOZILLA_XPCOM`"
+    AC_MSG_RESULT([Using $MOZILLA version $MOZILLA_VERSION])
+fi
+AC_SUBST(MOZILLA_HOME)
 
 AC_LANG_POP(C++)
 
@@ -303,10 +365,14 @@
 _SAVE_CPPFLAGS=$CPPFLAGS
 _SAVE_LDFLAGS=$LDFLAGS
 
+#CPPFLAGS="-I$MOZILLA_INCLUDE_ROOT $MOZILLA_COMPONENT_CFLAGS $GALEON_DEPENDENCY_CFLAGS"
+#CXXFLAGS="$_SAVE_CXXFLAGS $AM_CXXFLAGS -I$MOZILLA_INCLUDE_ROOT $MOZILLA_COMPONENT_CFLAGS"
+#LDFLAGS="$_SAVE_LDFLAGS $AM_LDFLAGS $MOZILLA_COMPONENT_LIBS"
 CPPFLAGS="-I$MOZILLA_INCLUDE_ROOT `$PKG_CONFIG --cflags-only-I $MOZILLA-xpcom` $GALEON_DEPENDENCY_CFLAGS"
 CXXFLAGS="$_SAVE_CXXFLAGS $AM_CXXFLAGS -I$MOZILLA_INCLUDE_ROOT `pkg-config --cflags $MOZILLA-xpcom`"
 LDFLAGS="$_SAVE_LDFLAGS $AM_LDFLAGS `pkg-config --libs $MOZILLA-xpcom`"
 
+
 TEST_MOZILLA_INCLUDE_DIRS="widget mimetype docshell history dom necko string layout gfx content js exthandler pipnss uriloader caps xpconnect nkcache fastfind gtkembedmoz chrome"
 for i in $TEST_MOZILLA_INCLUDE_DIRS ; do
    CXXFLAGS="$CXXFLAGS -I$MOZILLA_INCLUDE_ROOT/$i"
@@ -363,6 +429,23 @@
 
 AC_MSG_RESULT([$result])
 
+dnl Changed from nsIFileURL to nsIURI
+AC_MSG_CHECKING([whether nsIFilePicker::GetFileURL expect nsIURI])
+
+AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM(
+		[[#include <nsIURI.h>
+		  #include <nsIFilePicker.h>]],
+		[[nsIFilePicker *p;
+		  nsIURI *u;
+		  p->GetFileURL (&u);]]
+	)],
+	[AC_DEFINE([HAVE_NSIFILEPICKER_NSIURI],[1],
+	           [Define if nsIFilePicker::GetFileURL uses nsIURI]) result=yes],
+	[result=no])
+
+AC_MSG_RESULT([$result])
+
 dnl Changed from char* to nsAString& in 1.8a1
 dnl https://bugzilla.mozilla.org/show_bug.cgi?id=235502
 AC_MSG_CHECKING([whether nsIMIMEInfo methods expect nsAString&])
@@ -765,6 +848,19 @@
 	[result=no])
 AC_MSG_RESULT([$result])
 
+dnl nsIHelperAppLauncherDialog::PromptForSaveToFile takes aForcePrompt
+AC_MSG_CHECKING([whether nsIHelperAppLauncherDialog::PromptForSaveToFile takes aForcePrompt])
+AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM(
+		[[#include <nsIHelperAppLauncherDialog.h>]],
+		[[ nsIHelperAppLauncherDialog *d;
+		   d->PromptForSaveToFile(NULL, NULL, NULL, NULL, PR_TRUE, NULL); ]]
+	)],
+	[AC_DEFINE([HAVE_NSIHELPERAPPLAUNCHERDIALOG_FORCEPROMPT], [1],
+		   [Define if nsIHelperAppLauncherDialog::PromptForSaveToFile takes aForcePrompt]) result=yes],
+	[result=no])
+AC_MSG_RESULT([$result])
+
 
 dnl nsIDocShell::GetSecurityUI was added in 1.8b2 as part of the fastback
 dnl patch
@@ -1134,6 +1230,20 @@
 	[result=no])
 AC_MSG_RESULT([$result])
 
+dnl GetMessage -> GetMessageMoz
+AC_MSG_CHECKING([for nsIConsoleMessage::GetMessageMoz])
+AC_COMPILE_IFELSE(
+	[AC_LANG_PROGRAM(
+		[[#include <nsIConsoleMessage.h>]],
+		[[nsIConsoleMessage *m;
+		  PRUnichar *s;
+		  m->GetMessageMoz(&s);]]
+	)],
+	[AC_DEFINE([HAVE_NSICONSOLEMESSAGE_GETMESSAGEMOZ], [1],
+		   [Define if nsIConsoleMessage::GetMessageMoz exists]) result=yes],
+	[result=no])
+AC_MSG_RESULT([$result])
+
 dnl nsIClassInfo's impl macros were moved to their own file in 1.9a1
 dnl https://bugzilla.mozilla.org/show_bug.cgi?id=330420
 AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/nsIClassInfoImpl.h],
@@ -1158,6 +1268,9 @@
 AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/necko/nsIPassword.h],
 	[AC_DEFINE([HAVE_NSIPASSWORD_H],[1],
 	[Define if nsIPassword.h exists])])
+AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/passwordmgr/nsIPassword.h],
+	[AC_DEFINE([HAVE_NSIPASSWORD_H],[1],
+	[Define if nsIPassword.h exists])])
 
 dnl restore flags
 CXXFLAGS="$_SAVE_CXXFLAGS $MOZ_DEBUG_FLAGS"
@@ -1320,7 +1433,7 @@
 
 dnl ===========================================================================
 
-if test "$gecko" == "xulrunner"; then
+if test "$gecko" == "xulrunner" || test "$gecko" == "libxul-embedding-unstable"; then
 	echo ""
 	echo "Note that Galeon has a runtime dependency on the 'cookie' and 'permission'"
 	echo "mozilla extensions. These are not built as part of the default xulrunner"

Modified: trunk/mozilla/ContentHandler.cpp
==============================================================================
--- trunk/mozilla/ContentHandler.cpp	(original)
+++ trunk/mozilla/ContentHandler.cpp	Fri Jul  4 19:03:08 2008
@@ -298,6 +298,9 @@
 						   nsISupports *aWindowContext,
 						   const PRUnichar *aDefaultFile,
 						   const PRUnichar *aSuggestedFileExtension,
+#ifdef HAVE_NSINSIHELPERAPPLAUNCHERDIALOG_FORCEPROMPT
+						   PRBool aForcePrompt,
+#endif
 						   nsILocalFile **_retval)
 {
 	mContext = aWindowContext;
@@ -306,7 +309,11 @@
 	GtkWidget *parentWindow = GaleonUtils::FindGtkParent (parentDOMWindow);
 
 	/* Get the directory to use for downloading into */
+#ifdef HAVE_NSINSIHELPERAPPLAUNCHERDIALOG_FORCEPROMPT
+	if (!eel_gconf_get_boolean (CONF_DOWNLOADING_ASK_DIR) && !aForcePrompt)
+#else
 	if (!eel_gconf_get_boolean (CONF_DOWNLOADING_ASK_DIR))
+#endif
 	{
 		nsresult rv =  BuildDownloadPath (GulCString (aDefaultFile).get(),
 						  parentWindow, _retval);

Modified: trunk/mozilla/FilePicker.cpp
==============================================================================
--- trunk/mozilla/FilePicker.cpp	(original)
+++ trunk/mozilla/FilePicker.cpp	Fri Jul  4 19:03:08 2008
@@ -354,8 +354,12 @@
 	return NS_OK;
 }
 
-/* readonly attribute nsIFileURL fileURL; */
+/* readonly attribute nsIURI/nsIFileURL fileURL; */
+#ifdef HAVE_NSIFILEPICKER_NSIURI
+NS_IMETHODIMP GFilePicker::GetFileURL(nsIURI **aFileURL)
+#else
 NS_IMETHODIMP GFilePicker::GetFileURL(nsIFileURL **aFileURL)
+#endif
 {
 	LOG ("GFilePicker::GetFileURL");
 

Modified: trunk/mozilla/GaleonWrapper.cpp
==============================================================================
--- trunk/mozilla/GaleonWrapper.cpp	(original)
+++ trunk/mozilla/GaleonWrapper.cpp	Fri Jul  4 19:03:08 2008
@@ -1643,19 +1643,23 @@
     ~GConsoleMessage() {}
 
     NS_DECL_ISUPPORTS
-
-    NS_IMETHODIMP GetMessage(PRUnichar **result)
-    {
-	    *result = NS_StringCloneData (mMessage);
-	    return NS_OK;
-    }
+    NS_DECL_NSICONSOLEMESSAGE
 
 private:
     GulString mMessage;
 };
 
-NS_IMPL_THREADSAFE_ISUPPORTS1(GConsoleMessage, nsIConsoleMessage)
+#ifdef HAVE_NSICONSOLEMESSAGE_GETMESSAGEMOZ
+NS_IMETHODIMP GConsoleMessage::GetMessageMoz(PRUnichar **result)
+#else
+NS_IMETHODIMP GConsoleMessage::GetMessage(PRUnichar **result)
+#endif
+{
+	*result = NS_StringCloneData (mMessage);
+	return NS_OK;
+}
 
+NS_IMPL_ISUPPORTS1(GConsoleMessage, nsIConsoleMessage)
 
 nsresult GaleonWrapper::EvaluateJS (const char *script)
 {

Modified: trunk/mozilla/GtkNSSClientAuthDialogs.cpp
==============================================================================
--- trunk/mozilla/GtkNSSClientAuthDialogs.cpp	(original)
+++ trunk/mozilla/GtkNSSClientAuthDialogs.cpp	Fri Jul  4 19:03:08 2008
@@ -72,7 +72,7 @@
 {
 }
 
-NS_IMPL_THREADSAFE_ISUPPORTS1 (GtkNSSClientAuthDialogs, 
+NS_IMPL_ISUPPORTS1 (GtkNSSClientAuthDialogs, 
 			       nsIClientAuthDialogs)
 
 /** 

Modified: trunk/mozilla/JSConsoleListener.cpp
==============================================================================
--- trunk/mozilla/JSConsoleListener.cpp	(original)
+++ trunk/mozilla/JSConsoleListener.cpp	Fri Jul  4 19:03:08 2008
@@ -50,7 +50,11 @@
 {
 	PRUnichar *message;
 
+#ifdef HAVE_NSICONSOLEMESSAGE_GETMESSAGEMOZ
+	aMessage->GetMessageMoz (&message);
+#else
 	aMessage->GetMessage (&message);
+#endif
 
 	GaleonJSConsole * js_console;
 	js_console = galeon_embed_shell_get_js_console (embed_shell);

Modified: trunk/mozilla/Makefile.am
==============================================================================
--- trunk/mozilla/Makefile.am	(original)
+++ trunk/mozilla/Makefile.am	Fri Jul  4 19:03:08 2008
@@ -58,9 +58,12 @@
 	$(GALEON_DEPENDENCY_CFLAGS) \
 	-DLIB_DIR=\"$(pkglibdir)\" \
 	-DSHARE_DIR=\"$(pkgdatadir)\"	\
-	-DGALEON_MOZILLA_HOME=\"$(MOZILLA_HOME)\" \
 	-D_GNU_SOURCE=1			\
-	-include $(MOZILLA_INCLUDE_ROOT)/mozilla-config.h
+	-include mozilla-config.h
+
+if ! HAVE_XPCOM_GLUE
+INCLUDES += -DGALEON_MOZILLA_HOME=\"$(MOZILLA_HOME)\"
+endif
 
 noinst_LTLIBRARIES = libmozillaembed.la
 
@@ -93,8 +96,6 @@
 	CookiePromptService.h		\
 	EventContext.cpp                \
 	EventContext.h                  \
-	ExternalProtocolService.cpp     \
-	ExternalProtocolService.h       \
 	EphyPromptService.cpp		\
 	EphyPromptService.h		\
 	FilePicker.cpp			\
@@ -135,6 +136,12 @@
 	SideBarProxy.cpp		\
 	SideBarProxy.h
 
+if ! HAVE_XPCOM_GLUE
+libmozillaembed_la_SOURCES += \
+	ExternalProtocolService.cpp     \
+	ExternalProtocolService.h
+endif
+
 if HAVE_NSSTRING_INTERNAL
 libmozillaembed_la_SOURCES +=	\
 	GaleonAboutModule.cpp		\

Modified: trunk/mozilla/MozRegisterComponents.cpp
==============================================================================
--- trunk/mozilla/MozRegisterComponents.cpp	(original)
+++ trunk/mozilla/MozRegisterComponents.cpp	Fri Jul  4 19:03:08 2008
@@ -79,7 +79,9 @@
 NS_GENERIC_FACTORY_CONSTRUCTOR(GaleonAboutModule)
 NS_GENERIC_FACTORY_CONSTRUCTOR(GMyportalProtocolHandler)
 #endif
+#ifndef XPCOM_GLUE
 NS_GENERIC_FACTORY_CONSTRUCTOR(GExternalProtocolService)
+#endif
 #ifdef HAVE_NSIJSCONSOLESERVICE_H
 NS_GENERIC_FACTORY_CONSTRUCTOR(JSConsoleService)
 #endif
@@ -136,12 +138,14 @@
 		NS_IHELPERAPPLAUNCHERDLG_CONTRACTID,
 		GContentHandlerConstructor
 	},
+#ifndef XPCOM_GLUE
 	{
 		G_EXTERNALPROTOCOLSERVICE_CLASSNAME,
 		G_EXTERNALPROTOCOLSERVICE_CID,
 		NS_EXTERNALPROTOCOLSERVICE_CONTRACTID,
 		GExternalProtocolServiceConstructor
 	},
+#endif
 	{
 		GALEON_GLOBALHISTORY_CLASSNAME,
 		GALEON_GLOBALHISTORY_CID,
@@ -316,9 +320,15 @@
 	for (guint i = 0; i < G_N_ELEMENTS (sAppComps); i++)
 	{
 		nsCOMPtr<nsIGenericFactory> componentFactory;
-		rv = NS_NewGenericFactory(getter_AddRefs(componentFactory),
-					  &(sAppComps[i]));
-		if (NS_FAILED(rv) || !componentFactory)
+		componentFactory = do_CreateInstance(NS_GENERICFACTORY_CONTRACTID);
+		if(!componentFactory)
+		{
+			g_warning ("Failed to create a generic factory for %s\n", sAppComps[i].mDescription);
+			ret = FALSE;
+			continue;
+		}
+		rv = componentFactory->SetComponentInfo(&(sAppComps[i]));
+		if (NS_FAILED(rv))
 		{
 			g_warning ("Failed to make a factory for %s\n", sAppComps[i].mDescription);
 

Modified: trunk/mozilla/mozilla-embed-shell.cpp
==============================================================================
--- trunk/mozilla/mozilla-embed-shell.cpp	(original)
+++ trunk/mozilla/mozilla-embed-shell.cpp	Fri Jul  4 19:03:08 2008
@@ -24,6 +24,11 @@
 #include <nsComponentManagerUtils.h>
 #include <nsServiceManagerUtils.h>
 
+#ifdef XPCOM_GLUE
+#include <nsXPCOMGlue.h>
+#include <gtkmozembed_glue.cpp>
+#endif
+
 #define MOZILLA_CLIENT
 #include "gtkmozembed.h"
 #include "gtkmozembed_internal.h"
@@ -77,9 +82,9 @@
 
 //For setting the locale. hopefully gtkmozembed will do itself soon
 #include <nsIChromeRegistry.h>
-#include <locale/nsILocaleService.h>
+#include <nsILocaleService.h>
 #ifdef HAVE_NSICHROMEREGISTRYSEA_H
-# include <chrome/nsIChromeRegistrySea.h>
+# include <nsIChromeRegistrySea.h>
 #endif
 
 #ifdef HAVE_NSITOOLKITCHROMEREGISTRY_H
@@ -158,8 +163,8 @@
 
 	// Also set vendor and vendorSub prefs so that mozilla can construct
 	// the user agent string for us.
-	pref->SetCharPref ("general.useragent.vendor", "Galeon");
-	pref->SetCharPref ("general.useragent.vendorSub", VERSION);
+	pref->SetCharPref ("general.useragent.vendor", USERAGENT_VENDOR);
+	pref->SetCharPref ("general.useragent.vendorSub", USERAGENT_VENDORSUB);
 
 	return TRUE;
 }
@@ -182,6 +187,7 @@
 			  mes);
 }
 
+#ifdef GALEON_MOZILLA_HOME
 static void
 mozilla_init_home (void)
 {
@@ -199,6 +205,7 @@
 #endif
 	g_free (mozilla_home);
 }
+#endif /* GALEON_MOZILLA_HOME */
 
 static void
 mozilla_init_profile (void)
@@ -231,8 +238,10 @@
 	/* Add /usr/lib/mozilla/plugins (bug 149812) */
 	g_string_append (new_path, ":/usr/lib/mozilla/plugins");
 
+#ifdef GALEON_MOZILLA_HOME
 	/* Add the current mozilla build's plugins dir */
 	g_string_append (new_path, ":" GALEON_MOZILLA_HOME "/plugins");
+#endif
 
 	g_setenv ("MOZ_PLUGIN_PATH", new_path->str, TRUE);
 
@@ -369,19 +378,65 @@
 
 	mes->priv->encodings = NULL;
 
+	nsresult rv;
+#ifdef XPCOM_GLUE
+	static const GREVersionRange greVersion = {
+	  "1.9a", PR_TRUE,
+	  "1.9.*", PR_TRUE
+	};
+	char xpcomLocation[4096];
+	rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0, xpcomLocation, 4096);
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not determine locale!\n");
+	  return;
+	}
+
+	// Startup the XPCOM Glue that links us up with XPCOM.
+	rv = XPCOMGlueStartup(xpcomLocation);
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not determine locale!\n");
+	  return;
+	}
+
+	rv = GTKEmbedGlueStartup();
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not startup glue!\n");
+	  return;
+	}
+
+	rv = GTKEmbedGlueStartupInternal();
+	if (NS_FAILED (rv))
+	{
+	  g_warning ("Could not startup internal glue!\n");
+	  return;
+	}
+
+	char *lastSlash = strrchr(xpcomLocation, '/');
+	if (lastSlash)
+	  *lastSlash = '\0';
+
+	gtk_moz_embed_set_path(xpcomLocation);
+#endif // XPCOM_GLUE
+#ifdef GALEON_MOZILLA_HOME
+	mozilla_init_home ();
+#endif
 	/* Pre initialization */
 	mozilla_init_plugin_path();
-	mozilla_init_home ();
 	mozilla_init_profile ();
 
+	/* Fire up the beast */
+	gtk_moz_embed_push_startup ();
+
+
 #if HAVE_NSITOOLKITCHROMEREGISTRY_H
 	nsCOMPtr<nsIDirectoryServiceProvider> dp = new EphyDirectoryProvider ();
 	if (dp) {
 		gtk_moz_embed_set_directory_service_provider (dp);
 	}
 #endif
-	/* Fire up the best */
-	gtk_moz_embed_push_startup ();
 }
 
 

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Fri Jul  4 19:03:08 2008
@@ -145,7 +145,11 @@
 	$(GALEON_DEPENDENCY_LIBS) \
 	$(INTLLIBS)
 
+if HAVE_XPCOM_GLUE
+galeon_LDFLAGS = -dlopen self
+else
 galeon_LDFLAGS = -R$(MOZILLA_HOME) -dlopen self
+endif
 
 if ENABLE_GTKHTML_EMBED
 gtkhtmlembed_libs = $(top_builddir)/gtkhtml/libgtkhtmlembed.la



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