From a09eb7621fa2a2eda66a8f0308080569953c92c9 Mon Sep 17 00:00:00 2001 From: "bsmedberg%covad.net" Date: Mon, 19 Jul 2004 13:03:43 +0000 Subject: [PATCH] Add native chrome-registry support for platform-specific packages (through the c:platformPackage arc), and centralize the chrome://global-platform/locale/ files. git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@159472 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/allmakefiles.sh | 2 -- mozilla/chrome/src/nsChromeRegistry.cpp | 21 ++++++++++++- mozilla/chrome/src/nsChromeRegistry.h | 1 + mozilla/toolkit/Makefile.in | 1 - mozilla/toolkit/locale/Makefile.in | 30 ------------------- .../toolkit/locale/contents-platform.rdf.in | 24 --------------- mozilla/toolkit/locale/jar.mn | 14 --------- .../global-platform}/mac/intl.properties | 0 .../mac/platformKeys.properties} | 0 .../global-platform}/unix/intl.properties | 0 .../unix}/platformKeys.properties | 0 .../global-platform}/win/intl.properties | 0 .../win/platformKeys.properties | 18 +++++++++++ mozilla/toolkit/locales/jar.mn | 7 +++++ 14 files changed, 46 insertions(+), 72 deletions(-) delete mode 100644 mozilla/toolkit/locale/Makefile.in delete mode 100755 mozilla/toolkit/locale/contents-platform.rdf.in delete mode 100644 mozilla/toolkit/locale/jar.mn rename mozilla/toolkit/{locale => locales/en-US/chrome/global-platform}/mac/intl.properties (100%) rename mozilla/toolkit/{locale/platformKeys-mac.properties => locales/en-US/chrome/global-platform/mac/platformKeys.properties} (100%) rename mozilla/toolkit/{locale => locales/en-US/chrome/global-platform}/unix/intl.properties (100%) rename mozilla/toolkit/{locale => locales/en-US/chrome/global-platform/unix}/platformKeys.properties (100%) rename mozilla/toolkit/{locale => locales/en-US/chrome/global-platform}/win/intl.properties (100%) create mode 100644 mozilla/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties diff --git a/mozilla/allmakefiles.sh b/mozilla/allmakefiles.sh index 8a356740a32..43f57d852d0 100755 --- a/mozilla/allmakefiles.sh +++ b/mozilla/allmakefiles.sh @@ -895,7 +895,6 @@ chrome/tools/chromereg/Makefile toolkit/Makefile toolkit/content/Makefile toolkit/content/buildconfig.html -toolkit/locale/Makefile toolkit/obsolete/Makefile toolkit/components/autocomplete/Makefile toolkit/components/autocomplete/public/Makefile @@ -926,7 +925,6 @@ toolkit/mozapps/installer/windows/wizard/setup/Makefile toolkit/mozapps/installer/windows/wizard/setuprsc/Makefile toolkit/mozapps/installer/windows/wizard/uninstall/Makefile toolkit/xre/Makefile -toolkit/locale/contents-platform.rdf toolkit/components/passwordmgr/resources/content/contents.rdf toolkit/components/passwordmgr/resources/locale/contents.rdf toolkit/mozapps/contents-content.rdf diff --git a/mozilla/chrome/src/nsChromeRegistry.cpp b/mozilla/chrome/src/nsChromeRegistry.cpp index 27fc88b26af..c25c997a044 100644 --- a/mozilla/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/chrome/src/nsChromeRegistry.cpp @@ -129,6 +129,7 @@ DEFINE_RDF_VOCAB(CHROME_URI, CHROME, skinVersion); DEFINE_RDF_VOCAB(CHROME_URI, CHROME, localeVersion); DEFINE_RDF_VOCAB(CHROME_URI, CHROME, packageVersion); DEFINE_RDF_VOCAB(CHROME_URI, CHROME, disabled); +DEFINE_RDF_VOCAB(CHROME_URI, CHROME, platformPackage); //////////////////////////////////////////////////////////////////////////////// @@ -300,6 +301,10 @@ nsChromeRegistry::Init() getter_AddRefs(mDisabled)); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF resource"); + rv = mRDFService->GetResource(nsDependentCString(kURICHROME_platformPackage), + getter_AddRefs(mPlatformPackage)); + NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF resource"); + nsCOMPtr observerService = do_GetService("@mozilla.org/observer-service;1", &rv); if (observerService) { @@ -615,7 +620,21 @@ nsChromeRegistry::GetBaseURL(const nsACString& aPackage, } // From this resource, follow the "baseURL" arc. - return FollowArc(mChromeDataSource, aBaseURL, resource, mBaseURL); + rv = FollowArc(mChromeDataSource, aBaseURL, resource, mBaseURL); + NS_ENSURE_SUCCESS(rv, rv); + + nsCAutoString isPlatformPackage; + rv = FollowArc(mChromeDataSource, isPlatformPackage, packageResource, mPlatformPackage); + if (NS_FAILED(rv) || !isPlatformPackage.Equals("true")) return NS_OK; + +#if defined(XP_WIN) || defined(XP_OS2) + aBaseURL.Append("win/"); +#elif defined(XP_MACOSX) + aBaseURL.Append("mac/"); +#else + aBaseURL.Append("unix/"); +#endif + return NS_OK; } nsresult diff --git a/mozilla/chrome/src/nsChromeRegistry.h b/mozilla/chrome/src/nsChromeRegistry.h index 4c5f10f0d10..250e3ba0a7b 100644 --- a/mozilla/chrome/src/nsChromeRegistry.h +++ b/mozilla/chrome/src/nsChromeRegistry.h @@ -252,6 +252,7 @@ protected: nsCOMPtr mLocaleVersion; nsCOMPtr mPackageVersion; nsCOMPtr mDisabled; + nsCOMPtr mPlatformPackage; nsCOMPtr mOverrideJAR; nsCString mOverrideJARURL; diff --git a/mozilla/toolkit/Makefile.in b/mozilla/toolkit/Makefile.in index 7d1876150b5..5aeb234ea6b 100644 --- a/mozilla/toolkit/Makefile.in +++ b/mozilla/toolkit/Makefile.in @@ -45,7 +45,6 @@ include $(DEPTH)/config/autoconf.mk DIRS = \ content \ - locale \ locales \ obsolete \ profile \ diff --git a/mozilla/toolkit/locale/Makefile.in b/mozilla/toolkit/locale/Makefile.in deleted file mode 100644 index 056e648f533..00000000000 --- a/mozilla/toolkit/locale/Makefile.in +++ /dev/null @@ -1,30 +0,0 @@ -# -# The contents of this file are subject to the Netscape 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/NPL/ -# -# 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 Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): -# - - -DEPTH = ../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ - -include $(DEPTH)/config/autoconf.mk - -include $(topsrcdir)/config/rules.mk diff --git a/mozilla/toolkit/locale/contents-platform.rdf.in b/mozilla/toolkit/locale/contents-platform.rdf.in deleted file mode 100755 index 3498e089f13..00000000000 --- a/mozilla/toolkit/locale/contents-platform.rdf.in +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/mozilla/toolkit/locale/jar.mn b/mozilla/toolkit/locale/jar.mn deleted file mode 100644 index 50312f9d84a..00000000000 --- a/mozilla/toolkit/locale/jar.mn +++ /dev/null @@ -1,14 +0,0 @@ -en-win.jar: -+ locale/en-US/global-platform/contents.rdf (contents-platform.rdf) - locale/en-US/global-platform/intl.properties (win/intl.properties) -+ locale/en-US/global-platform/platformKeys.properties (platformKeys.properties) - -en-unix.jar: -+ locale/en-US/global-platform/contents.rdf (contents-platform.rdf) - locale/en-US/global-platform/intl.properties (unix/intl.properties) -+ locale/en-US/global-platform/platformKeys.properties (platformKeys.properties) - -en-mac.jar: -+ locale/en-US/global-platform/contents.rdf (contents-platform.rdf) - locale/en-US/global-platform/intl.properties (mac/intl.properties) -+ locale/en-US/global-platform/platformKeys.properties (platformKeys-mac.properties) diff --git a/mozilla/toolkit/locale/mac/intl.properties b/mozilla/toolkit/locales/en-US/chrome/global-platform/mac/intl.properties similarity index 100% rename from mozilla/toolkit/locale/mac/intl.properties rename to mozilla/toolkit/locales/en-US/chrome/global-platform/mac/intl.properties diff --git a/mozilla/toolkit/locale/platformKeys-mac.properties b/mozilla/toolkit/locales/en-US/chrome/global-platform/mac/platformKeys.properties similarity index 100% rename from mozilla/toolkit/locale/platformKeys-mac.properties rename to mozilla/toolkit/locales/en-US/chrome/global-platform/mac/platformKeys.properties diff --git a/mozilla/toolkit/locale/unix/intl.properties b/mozilla/toolkit/locales/en-US/chrome/global-platform/unix/intl.properties similarity index 100% rename from mozilla/toolkit/locale/unix/intl.properties rename to mozilla/toolkit/locales/en-US/chrome/global-platform/unix/intl.properties diff --git a/mozilla/toolkit/locale/platformKeys.properties b/mozilla/toolkit/locales/en-US/chrome/global-platform/unix/platformKeys.properties similarity index 100% rename from mozilla/toolkit/locale/platformKeys.properties rename to mozilla/toolkit/locales/en-US/chrome/global-platform/unix/platformKeys.properties diff --git a/mozilla/toolkit/locale/win/intl.properties b/mozilla/toolkit/locales/en-US/chrome/global-platform/win/intl.properties similarity index 100% rename from mozilla/toolkit/locale/win/intl.properties rename to mozilla/toolkit/locales/en-US/chrome/global-platform/win/intl.properties diff --git a/mozilla/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties b/mozilla/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties new file mode 100644 index 00000000000..55ba8064888 --- /dev/null +++ b/mozilla/toolkit/locales/en-US/chrome/global-platform/win/platformKeys.properties @@ -0,0 +1,18 @@ +#default +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts + +#the shift key +VK_SHIFT=Shift + +#the command key +VK_META=Meta + +#the alt key +VK_ALT=Alt + +#the control key +VK_CONTROL=Ctrl + +#the separator character used between modifiers +MODIFIER_SEPARATOR=+ diff --git a/mozilla/toolkit/locales/jar.mn b/mozilla/toolkit/locales/jar.mn index b0df7969fdf..1010c30468f 100644 --- a/mozilla/toolkit/locales/jar.mn +++ b/mozilla/toolkit/locales/jar.mn @@ -71,6 +71,13 @@ + locale/global-region/region.dtd (@AB_CD@/chrome/global-region/region.dtd) + locale/global-region/region.properties (@AB_CD@/chrome/global-region/region.properties) + locale/global-region/builtinURLs.rdf (@AB_CD@/chrome/global-region/builtinURLs.rdf) +* locale/global-platform/contents.rdf (@AB_CD@/chrome/global-platform/contents.rdf) + locale/global-platform/mac/platformKeys.properties (@AB_CD@/chrome/global-platform/mac/platformKeys.properties) + locale/global-platform/unix/platformKeys.properties (@AB_CD@/chrome/global-platform/unix/platformKeys.properties) + locale/global-platform/win/platformKeys.properties (@AB_CD@/chrome/global-platform/win/platformKeys.properties) + locale/global-platform/mac/intl.properties (@AB_CD@/chrome/global-platform/mac/intl.properties) + locale/global-platform/unix/intl.properties (@AB_CD@/chrome/global-platform/unix/intl.properties) + locale/global-platform/win/intl.properties (@AB_CD@/chrome/global-platform/win/intl.properties) * locale/necko/contents.rdf (@AB_CD@/chrome/necko/contents.rdf) locale/necko/necko.properties (@AB_CD@/chrome/necko/necko.properties) locale/necko/redirect_loop.dtd (@AB_CD@/chrome/necko/redirect_loop.dtd)