bug 294943 - Implement nsIXULAppInfo in suite trunk, also fixes building of suite/ for suite, r=bsmedberg sr=Neil a=chofmann

This commit is contained in:
kairo%kairo.at 2005-06-21 16:01:09 +00:00
parent 8abb157646
commit 46f6298dff
7 changed files with 206 additions and 0 deletions

View File

@ -937,6 +937,8 @@ browser/themes/winstripe/Makefile
MAKEFILES_suite="
suite/Makefile
suite/components/Makefile
suite/components/xulappinfo/Makefile
"
MAKEFILES_xulrunner="

View File

@ -531,6 +531,7 @@ MOZ_THUNDERBIRD = @MOZ_THUNDERBIRD@
MOZ_STANDALONE_COMPOSER= @MOZ_STANDALONE_COMPOSER@
MOZ_STATIC_MAIL_BUILD = @MOZ_STATIC_MAIL_BUILD@
MOZ_SUNBIRD = @MOZ_SUNBIRD@
MOZ_SUITE = @MOZ_SUITE@
WINCE = @WINCE@
MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@

View File

@ -3905,6 +3905,7 @@ esac
AC_SUBST(MOZ_BUILD_APP)
AC_SUBST(MOZ_XUL_APP)
AC_SUBST(MOZ_SUITE)
AC_SUBST(MOZ_PHOENIX)
AC_SUBST(MOZ_THUNDERBIRD)
AC_SUBST(MOZ_STANDALONE_COMPOSER)

View File

@ -42,5 +42,8 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = \
components \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,50 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# the mozilla.org SeaMonkey project.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = \
xulappinfo \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,64 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# the mozilla.org SeaMonkey project.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DEFINES += -DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
-DMOZ_APP_VERSION=$(MOZ_APP_VERSION)
MODULE = xulappinfo
XPIDL_MODULE = xulappinfo
XPIDLSRCS = nsIXULAppInfo.idl
EXTRA_COMPONENTS = xulappinfo.js
include $(topsrcdir)/config/rules.mk
nsIXULAppInfo.idl: $(topsrcdir)/toolkit/xre/nsIXULAppInfo.idl
$(NSINSTALL) $(topsrcdir)/toolkit/xre/nsIXULAppInfo.idl .
xulappinfo.js: xulappinfo.js.in
$(PERL) $(MOZILLA_DIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $^ > $@
GARBAGE += xulappinfo.js

View File

@ -0,0 +1,85 @@
const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
const XULAPPINFO_CID = Components.ID("{f8b59582-5808-4e6e-a467-339e9c82756f}");
const nsIXULAppInfo = Components.interfaces.nsIXULAppInfo;
const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
const nsIFactory = Components.interfaces.nsIFactory;
function XULAppInfoService()
{}
XULAppInfoService.prototype.vendor = "mozilla.org";
XULAppInfoService.prototype.ID = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}";
#expand XULAppInfoService.prototype.name = "__MOZ_APP_DISPLAYNAME__";
#expand XULAppInfoService.prototype.version = "__MOZ_APP_VERSION__";
#expand XULAppInfoService.prototype.appBuildID = "__BUILD_ID__";
#expand XULAppInfoService.prototype.geckoBuildID = "__BUILD_ID__";
XULAppInfoService.prototype.QueryInterface =
function appinfo_QueryInterface(iid)
{
if (!iid.equals(nsIXULAppInfo) &&
!iid.equals(nsISupports))
{
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
}
var XULAppInfoFactory = new Object();
XULAppInfoFactory.createInstance =
function(outer, iid)
{
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
if (!iid.equals(nsIXULAppInfo) && !iid.equals(nsISupports))
throw Components.results.NS_ERROR_INVALID_ARG;
return new XULAppInfoService();
}
var XULAppInfoModule = new Object();
XULAppInfoModule.registerSelf =
function mod_registerSelf(compMgr, fileSpec, location, type)
{
compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
compMgr.registerFactoryLocation(XULAPPINFO_CID,
"XUL AppInfo service",
XULAPPINFO_CONTRACTID,
fileSpec, location, type);
}
XULAppInfoModule.unregisterSelf =
function mod_unregisterSelf(compMgr, fileSpec, location)
{
}
XULAppInfoModule.getClassObject =
function mod_getClassObject(compMgr, cid, iid)
{
if (cid.equals(XULAPPINFO_CID))
return XULAppInfoFactory;
if (!iid.equals(nsIFactory))
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
throw Components.results.NS_ERROR_NO_INTERFACE;
}
XULAppInfoModule.canUnload =
function mod_canUnload(compMgr)
{
return true;
}
/* entrypoint */
function NSGetModule(compMgr, fileSpec)
{
return XULAppInfoModule;
}