galeon r8975 - in trunk: . mozilla



Author: philipl
Date: Sat Aug  2 19:39:10 2008
New Revision: 8975
URL: http://svn.gnome.org/viewvc/galeon?rev=8975&view=rev

Log:
2008-08-02  Philip Langdale  <philipl alumni utexas net>

	*      configure.in
	A      mozilla/EphyXULAppInfo.h
	A      mozilla/EphyXULAppInfo.cpp
	*      mozilla/MozRegisterComponents.cpp
	*      mozilla/Makefile.am: Port XULAppInfo support from
	Epiphany. Thanks to Marcin Krol <hawk pld-linux org> for
	doing the hard work.



Added:
   trunk/mozilla/EphyXULAppInfo.cpp
   trunk/mozilla/EphyXULAppInfo.h
Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/mozilla/Makefile.am
   trunk/mozilla/MozRegisterComponents.cpp

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Sat Aug  2 19:39:10 2008
@@ -7,6 +7,13 @@
 AM_CONFIG_HEADER(config.h)
 AC_CONFIG_SRCDIR(configure.in)
 
+AC_CANONICAL_HOST
+AC_DEFINE_UNQUOTED([EPHY_HOST],["$host"],[The host])
+AC_DEFINE_UNQUOTED([EPHY_HOST_CPU],["$host_cpu"],[The host CPU type])
+AC_DEFINE_UNQUOTED([EPHY_HOST_VENDOR],["$host_vendor"],[The host vendor])
+AC_DEFINE_UNQUOTED([EPHY_HOST_OS],["$host_os"],[The host OS])
+AC_DEFINE_UNQUOTED([EPHY_BUILD_ID],["$(TZ=UTC0 date +'%Y%m%d')"],[The build date])
+
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 
 dnl put the ACLOCAL flags in the Makefile
@@ -766,6 +773,15 @@
 	[AC_DEFINE([HAVE_NSIPROMPTSERVICE2_H],[1],
 	[Define if nsIPromptService2.h exists])])
 
+dnl nsIXULAppInfo is needed for 1.9
+AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/nsIXULAppInfo.h],
+	[AC_DEFINE([HAVE_NSIXULAPPINFO_H],[1],
+	[Define if nsIXULAppInfo.h exists])])
+AC_CHECK_FILE([$MOZILLA_INCLUDE_ROOT/xpcom/nsIXULAppInfo.h],
+	[AC_DEFINE([HAVE_NSIXULAPPINFO_H],[1],
+	[Define if nsIXULAppInfo.h exists])])
+AM_CONDITIONAL([HAVE_NSIXULAPPINFO_H], [test "$result" = "yes"])
+
 dnl restore flags
 CXXFLAGS="$_SAVE_CXXFLAGS $MOZ_DEBUG_FLAGS"
 CPPFLAGS=$_SAVE_CPPFLAGS

Added: trunk/mozilla/EphyXULAppInfo.cpp
==============================================================================
--- (empty file)
+++ trunk/mozilla/EphyXULAppInfo.cpp	Sat Aug  2 19:39:10 2008
@@ -0,0 +1,130 @@
+/*
+ *  Copyright  2008 Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "mozilla-config.h"
+#include "config.h"
+
+#include <nsStringGlue.h>
+
+#include "EphyXULAppInfo.h"
+
+NS_IMPL_ISUPPORTS2 (EphyXULAppInfo, nsIXULRuntime, nsIXULAppInfo)
+
+EphyXULAppInfo::EphyXULAppInfo ()
+  : mLogConsoleErrors (PR_TRUE)
+{
+}
+
+EphyXULAppInfo::~EphyXULAppInfo ()
+{
+}
+
+/* readonly attribute ACString vendor; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetVendor(nsACString & aVendor)
+{
+  aVendor.Assign ("GNOME");
+  return NS_OK;
+}
+
+/* readonly attribute ACString name; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetName(nsACString & aName)
+{
+  aName.Assign ("GNOME Web Browser");
+  return NS_OK;
+}
+
+/* readonly attribute ACString ID; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetID(nsACString & aID)
+{
+  aID.Assign ("{8cbd4d83-3182-4d7e-9889-a8d77bf1f205}");
+  return NS_OK;
+}
+
+/* readonly attribute ACString version; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetVersion(nsACString & aVersion)
+{
+  aVersion.Assign (VERSION);
+  return NS_OK;
+}
+
+/* readonly attribute ACString appBuildID; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetAppBuildID(nsACString & aAppBuildID)
+{
+  aAppBuildID.Assign (EPHY_BUILD_ID);
+  return NS_OK;
+}
+
+/* readonly attribute ACString platformVersion; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetPlatformVersion(nsACString & aPlatformVersion)
+{
+  aPlatformVersion.Assign ("1.9");
+  return NS_OK;
+}
+
+/* readonly attribute ACString platformBuildID; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetPlatformBuildID(nsACString & aPlatformBuildID)
+{
+  aPlatformBuildID.Assign (EPHY_BUILD_ID);
+  return NS_OK;
+}
+
+/* readonly attribute boolean inSafeMode; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetInSafeMode(PRBool *aInSafeMode)
+{
+  *aInSafeMode = PR_FALSE;
+  return NS_OK;
+}
+
+/* attribute boolean logConsoleErrors; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetLogConsoleErrors(PRBool *aLogConsoleErrors)
+{
+  *aLogConsoleErrors = mLogConsoleErrors;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+EphyXULAppInfo::SetLogConsoleErrors(PRBool aLogConsoleErrors)
+{
+  mLogConsoleErrors = aLogConsoleErrors;
+  return NS_OK;
+}
+
+/* readonly attribute AUTF8String OS; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetOS(nsACString & aOS)
+{
+  aOS.Assign (EPHY_HOST_OS);
+  return NS_OK;
+}
+
+/* readonly attribute AUTF8String XPCOMABI; */
+NS_IMETHODIMP
+EphyXULAppInfo::GetXPCOMABI(nsACString & aXPCOMABI)
+{
+  aXPCOMABI.Assign (EPHY_HOST_CPU "-gcc3");
+  return NS_OK;
+}

Added: trunk/mozilla/EphyXULAppInfo.h
==============================================================================
--- (empty file)
+++ trunk/mozilla/EphyXULAppInfo.h	Sat Aug  2 19:39:10 2008
@@ -0,0 +1,48 @@
+/*
+ *  Copyright  2008 Christian Persch
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef EPHY_XUL_APP_INFO_H
+#define EPHY_XUL_APP_INFO_H
+
+#include <nsIXULAppInfo.h>
+#include <nsIXULRuntime.h>
+
+#include <nsAutoPtr.h>
+#include <nsCOMPtr.h>
+
+#define EPHY_XUL_APP_INFO_CLASSNAME	"Galeon XUL App Info"
+
+/* 3032bcd2-663c-4583-88bf-6f251123f6dd */
+#define EPHY_XUL_APP_INFO_CID { 0x3032bcd2, 0x663c, 0x4583, { 0x88, 0xbf, 0x6f, 0x25, 0x11, 0x23, 0xf6, 0xdd } }
+
+class EphyXULAppInfo : public nsIXULAppInfo,
+                       public nsIXULRuntime
+{
+	public:
+		EphyXULAppInfo ();
+		virtual ~EphyXULAppInfo();
+
+		NS_DECL_ISUPPORTS
+                NS_DECL_NSIXULAPPINFO
+                NS_DECL_NSIXULRUNTIME
+
+	private:
+                PRBool mLogConsoleErrors;
+};
+
+#endif /* EPHY_XUL_APP_INFO_H */

Modified: trunk/mozilla/Makefile.am
==============================================================================
--- trunk/mozilla/Makefile.am	(original)
+++ trunk/mozilla/Makefile.am	Sat Aug  2 19:39:10 2008
@@ -54,6 +54,7 @@
 	-I$(MOZILLA_INCLUDE_ROOT)/windowwatcher \
 	-I$(MOZILLA_INCLUDE_ROOT)/xpcom \
 	-I$(MOZILLA_INCLUDE_ROOT)/xpconnect \
+	-I$(MOZILLA_INCLUDE_ROOT)/xulapp \
 	$(GCONF_CFLAGS) \
 	$(GALEON_DEPENDENCY_CFLAGS) \
 	-DLIB_DIR=\"$(pkglibdir)\" \
@@ -162,6 +163,12 @@
 	JSConsoleService.h
 endif
 
+if HAVE_NSIXULAPPINFO_H
+libmozillaembed_la_SOURCES +=		\
+	EphyXULAppInfo.cpp              \
+	EphyXULAppInfo.h
+endif
+
 libmozillaembed_la_LIBADD = \
 	$(MOZILLA_COMPONENT_LIBS) \
 	$(top_builddir)/embed/libembed.la

Modified: trunk/mozilla/MozRegisterComponents.cpp
==============================================================================
--- trunk/mozilla/MozRegisterComponents.cpp	(original)
+++ trunk/mozilla/MozRegisterComponents.cpp	Sat Aug  2 19:39:10 2008
@@ -41,6 +41,11 @@
 #include "GtkNSSSecurityWarningDialogs.h"
 #endif
 
+#ifdef HAVE_NSIXULAPPINFO_H
+#include <nsXULAppAPI.h>
+#include "EphyXULAppInfo.h"
+#endif
+
 #include "ExternalProtocolService.h"
 #include "GaleonAboutModule.h"
 
@@ -85,6 +90,9 @@
 #ifdef HAVE_NSIJSCONSOLESERVICE_H
 NS_GENERIC_FACTORY_CONSTRUCTOR(JSConsoleService)
 #endif
+#ifdef HAVE_NSIXULAPPINFO_H
+NS_GENERIC_FACTORY_CONSTRUCTOR(EphyXULAppInfo)
+#endif
 
 // NS_DOWNLOAD_CONTRACTID was renamed in mozilla 1.8b
 #ifndef NS_TRANSFER_CONTRACTID
@@ -251,6 +259,14 @@
 		EphyPromptServiceConstructor
 	},
 #endif /* HAVE_NSINONBLOCKINGALERTSERVICE_H */
+#ifdef HAVE_NSIXULAPPINFO_H
+	{
+		EPHY_XUL_APP_INFO_CLASSNAME,
+		EPHY_XUL_APP_INFO_CID,
+		XULAPPINFO_SERVICE_CONTRACTID,
+		EphyXULAppInfoConstructor
+	},
+#endif
 };
 
 #define NS_MSGCONTENTPOLICY_CONTRACTID "@mozilla.org/messenger/content-policy;1"



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