From 0893f1cfe12995d4516ae8c9ae7cc6ecc5ac9e62 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 16 Aug 2008 10:02:11 +0000 Subject: Imported Upstream version 0.4.3 --- (limited to 'components') diff --git a/components/Makefile.in b/components/Makefile.in index 7ba46b2..f9a42dc 100644 --- a/components/Makefile.in +++ b/components/Makefile.in @@ -33,14 +33,15 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = components -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/xulappinfo.js.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = xulappinfo.js SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -84,6 +85,10 @@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ +HULAHOP_BUILD_ID = @HULAHOP_BUILD_ID@ +HULAHOP_HOST_CPU = @HULAHOP_HOST_CPU@ +HULAHOP_HOST_OS = @HULAHOP_HOST_OS@ +HULAHOP_VERSION = @HULAHOP_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -185,7 +190,9 @@ xptdir = $(pkglibdir)/components xpt_in_files = hulahopAddCertException.idl xpt_DATA = $(xpt_in_files:.idl=.xpt) componentsdir = $(pkglibdir)/components -components_DATA = hulahopAddCertException.js +components_DATA = hulahopAddCertException.js \ + xulappinfo.js + EXTRA_DIST = $(xpt_in_files) $(components_DATA) CLEANFILES = $(xpt_DATA) DISTCLEANFILES = $(xpt_DATA) @@ -221,6 +228,8 @@ $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +xulappinfo.js: $(top_builddir)/config.status $(srcdir)/xulappinfo.js.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo diff --git a/components/xulappinfo.js b/components/xulappinfo.js new file mode 100644 index 0000000..11a4fba --- /dev/null +++ b/components/xulappinfo.js @@ -0,0 +1,106 @@ +/* FIXME: The values in the block below should be supplied by the activity. */ +const APPLICATION_ID = '{ab9fc198-f515-477b-843f-8fb52810a3e0}' +const APPLICATION_VENDOR = 'Sugar' +const APPLICATION_NAME = 'Browser Activity' +const APPLICATION_VERSION = '0.4.3' +const APPLICATION_BUILD_ID = '2008072400' + +const PLATFORM_VERSION = '1.9' +const PLATFORM_BUILD_ID = '2008072400' +const OS = 'linux-gnu' +const XPCOMABI = 'x86_64' + '-gcc3' + + +const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1"; +const XULAPPINFO_CID = Components.ID("{18eec982-b411-4f07-9fca-79d33ee6e4b5}"); + +const nsIXULAppInfo = Components.interfaces.nsIXULAppInfo; +const nsIXULRuntime = Components.interfaces.nsIXULRuntime; +const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar; +const nsIFactory = Components.interfaces.nsIFactory; + +function XULAppInfoService() +{} + +XULAppInfoService.prototype.ID = APPLICATION_ID +XULAppInfoService.prototype.vendor = APPLICATION_VENDOR +XULAppInfoService.prototype.name = APPLICATION_NAME +XULAppInfoService.prototype.version = APPLICATION_VERSION +XULAppInfoService.prototype.appBuildID = APPLICATION_BUILD_ID +XULAppInfoService.prototype.platformVersion = PLATFORM_VERSION +XULAppInfoService.prototype.platformBuildID = PLATFORM_BUILD_ID +XULAppInfoService.prototype.inSafeMode = false +XULAppInfoService.prototype.logConsoleErrors = true +XULAppInfoService.prototype.OS = OS +XULAppInfoService.prototype.XPCOMABI = XPCOMABI + +XULAppInfoService.prototype.QueryInterface = +function appinfo_QueryInterface(iid) +{ + if (!iid.equals(nsIXULAppInfo) && + !iid.equals(nsIXULRuntime) && + !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; +} + -- cgit v0.9.1