2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* ***** 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 Foundation code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2005
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Vladimir Vukicevic <vladimir@pobox.com>
|
|
|
|
*
|
|
|
|
* 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 ***** */
|
|
|
|
|
|
|
|
#include "gfxPlatform.h"
|
|
|
|
|
|
|
|
#if defined(XP_WIN)
|
|
|
|
#include "gfxWindowsPlatform.h"
|
|
|
|
#elif defined(XP_MACOSX)
|
|
|
|
#include "gfxPlatformMac.h"
|
|
|
|
#elif defined(MOZ_WIDGET_GTK2)
|
|
|
|
#include "gfxPlatformGtk.h"
|
2008-04-19 06:19:04 -07:00
|
|
|
#elif defined(MOZ_WIDGET_QT)
|
|
|
|
#include "gfxQtPlatform.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#elif defined(XP_BEOS)
|
|
|
|
#include "gfxBeOSPlatform.h"
|
|
|
|
#elif defined(XP_OS2)
|
|
|
|
#include "gfxOS2Platform.h"
|
|
|
|
#endif
|
|
|
|
|
2009-08-16 06:52:12 -07:00
|
|
|
#include "gfxPlatformFontList.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "gfxContext.h"
|
|
|
|
#include "gfxImageSurface.h"
|
2007-03-29 14:48:46 -07:00
|
|
|
#include "gfxTextRunCache.h"
|
2007-07-03 20:39:01 -07:00
|
|
|
#include "gfxTextRunWordCache.h"
|
2008-09-30 20:01:53 -07:00
|
|
|
#include "gfxUserFontSet.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsServiceManagerUtils.h"
|
2009-01-18 12:14:14 -08:00
|
|
|
#include "nsTArray.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-09-08 14:47:26 -07:00
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "cairo.h"
|
2009-04-07 09:02:11 -07:00
|
|
|
#include "qcms.h"
|
2007-07-23 15:02:17 -07:00
|
|
|
|
2008-01-30 16:23:36 -08:00
|
|
|
#include "plstr.h"
|
2007-07-23 15:02:17 -07:00
|
|
|
#include "nsIPrefService.h"
|
|
|
|
#include "nsIPrefBranch.h"
|
2008-09-08 14:47:26 -07:00
|
|
|
#include "nsIPrefBranch2.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
gfxPlatform *gPlatform = nsnull;
|
2008-07-16 20:09:08 -07:00
|
|
|
|
|
|
|
// These two may point to the same profile
|
2009-04-07 09:02:11 -07:00
|
|
|
static qcms_profile *gCMSOutputProfile = nsnull;
|
|
|
|
static qcms_profile *gCMSsRGBProfile = nsnull;
|
2008-07-16 20:09:08 -07:00
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
static qcms_transform *gCMSRGBTransform = nsnull;
|
|
|
|
static qcms_transform *gCMSInverseRGBTransform = nsnull;
|
|
|
|
static qcms_transform *gCMSRGBATransform = nsnull;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-09-08 14:47:26 -07:00
|
|
|
static PRBool gCMSInitialized = PR_FALSE;
|
|
|
|
static eCMSMode gCMSMode = eCMSMode_Off;
|
|
|
|
static int gCMSIntent = -2;
|
|
|
|
|
2008-08-11 21:55:36 -07:00
|
|
|
static const char *CMPrefName = "gfx.color_management.mode";
|
|
|
|
static const char *CMPrefNameOld = "gfx.color_management.enabled";
|
|
|
|
static const char *CMIntentPrefName = "gfx.color_management.rendering_intent";
|
2008-09-08 14:47:26 -07:00
|
|
|
static const char *CMProfilePrefName = "gfx.color_management.display_profile";
|
|
|
|
static const char *CMForceSRGBPrefName = "gfx.color_management.force_srgb";
|
|
|
|
|
|
|
|
static void ShutdownCMS();
|
2008-08-11 21:55:36 -07:00
|
|
|
static void MigratePrefs();
|
|
|
|
|
2008-09-08 14:47:26 -07:00
|
|
|
/* Class to listen for pref changes so that chrome code can dynamically
|
|
|
|
force sRGB as an output profile. See Bug #452125. */
|
|
|
|
class SRGBOverrideObserver : public nsIObserver,
|
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_IMPL_ISUPPORTS2(SRGBOverrideObserver, nsIObserver, nsISupportsWeakReference)
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
SRGBOverrideObserver::Observe(nsISupports *aSubject,
|
|
|
|
const char *aTopic,
|
|
|
|
const PRUnichar *someData)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_strcmp(someData,
|
|
|
|
NS_LITERAL_STRING("gfx.color_mangement.force_srgb").get()),
|
|
|
|
"Restarting CMS on wrong pref!");
|
|
|
|
ShutdownCMS();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-30 16:23:36 -08:00
|
|
|
// this needs to match the list of pref font.default.xx entries listed in all.js!
|
|
|
|
// the order *must* match the order in eFontPrefLang
|
|
|
|
static const char *gPrefLangNames[] = {
|
|
|
|
"x-western",
|
|
|
|
"x-central-euro",
|
|
|
|
"ja",
|
|
|
|
"zh-TW",
|
|
|
|
"zh-CN",
|
|
|
|
"zh-HK",
|
|
|
|
"ko",
|
|
|
|
"x-cyrillic",
|
|
|
|
"x-baltic",
|
|
|
|
"el",
|
|
|
|
"tr",
|
|
|
|
"th",
|
|
|
|
"he",
|
|
|
|
"ar",
|
|
|
|
"x-devanagari",
|
|
|
|
"x-tamil",
|
|
|
|
"x-armn",
|
|
|
|
"x-beng",
|
|
|
|
"x-cans",
|
|
|
|
"x-ethi",
|
|
|
|
"x-geor",
|
|
|
|
"x-gujr",
|
|
|
|
"x-guru",
|
|
|
|
"x-khmr",
|
|
|
|
"x-mlym",
|
2008-04-03 21:23:18 -07:00
|
|
|
"x-orya",
|
|
|
|
"x-telu",
|
|
|
|
"x-knda",
|
|
|
|
"x-sinh",
|
2008-01-30 16:23:36 -08:00
|
|
|
"x-unicode",
|
|
|
|
"x-user-def"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
gfxPlatform*
|
|
|
|
gfxPlatform::GetPlatform()
|
|
|
|
{
|
2007-03-29 14:48:46 -07:00
|
|
|
return gPlatform;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
gfxPlatform::Init()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(!gPlatform, "Already started???");
|
2007-03-22 10:30:00 -07:00
|
|
|
#if defined(XP_WIN)
|
2007-03-29 14:48:46 -07:00
|
|
|
gPlatform = new gfxWindowsPlatform;
|
2007-03-22 10:30:00 -07:00
|
|
|
#elif defined(XP_MACOSX)
|
2007-03-29 14:48:46 -07:00
|
|
|
gPlatform = new gfxPlatformMac;
|
2007-03-22 10:30:00 -07:00
|
|
|
#elif defined(MOZ_WIDGET_GTK2)
|
2007-03-29 14:48:46 -07:00
|
|
|
gPlatform = new gfxPlatformGtk;
|
2008-04-19 06:19:04 -07:00
|
|
|
#elif defined(MOZ_WIDGET_QT)
|
|
|
|
gPlatform = new gfxQtPlatform;
|
2007-03-22 10:30:00 -07:00
|
|
|
#elif defined(XP_BEOS)
|
2007-03-29 14:48:46 -07:00
|
|
|
gPlatform = new gfxBeOSPlatform;
|
2007-03-22 10:30:00 -07:00
|
|
|
#elif defined(XP_OS2)
|
2007-03-29 14:48:46 -07:00
|
|
|
gPlatform = new gfxOS2Platform;
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
2007-03-29 14:48:46 -07:00
|
|
|
if (!gPlatform)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
nsresult rv;
|
|
|
|
|
2009-08-16 06:52:12 -07:00
|
|
|
#if defined(XP_MACOSX) // temporary, until this is implemented on others
|
|
|
|
rv = gfxPlatformFontList::Init();
|
2007-03-29 14:48:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
2009-08-16 06:52:12 -07:00
|
|
|
NS_ERROR("Could not initialize gfxPlatformFontList");
|
2007-03-29 14:48:46 -07:00
|
|
|
Shutdown();
|
|
|
|
return rv;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2007-03-29 14:48:46 -07:00
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-04-03 20:32:43 -07:00
|
|
|
rv = gfxFontCache::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize gfxFontCache");
|
|
|
|
Shutdown();
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2007-07-03 20:39:01 -07:00
|
|
|
rv = gfxTextRunWordCache::Init();
|
2007-03-29 14:48:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
2007-07-03 20:39:01 -07:00
|
|
|
NS_ERROR("Could not initialize gfxTextRunWordCache");
|
|
|
|
Shutdown();
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = gfxTextRunCache::Init();
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Could not initialize gfxTextRunCache");
|
2007-03-29 14:48:46 -07:00
|
|
|
Shutdown();
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2008-08-11 21:55:36 -07:00
|
|
|
/* Pref migration hook. */
|
|
|
|
MigratePrefs();
|
|
|
|
|
2008-09-08 14:47:26 -07:00
|
|
|
/* Create and register our CMS Override observer. */
|
|
|
|
gPlatform->overrideObserver = new SRGBOverrideObserver();
|
|
|
|
nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
|
|
|
if (prefs)
|
|
|
|
prefs->AddObserver(CMForceSRGBPrefName, gPlatform->overrideObserver, PR_TRUE);
|
|
|
|
|
2007-03-29 14:48:46 -07:00
|
|
|
return NS_OK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gfxPlatform::Shutdown()
|
|
|
|
{
|
2007-03-29 14:48:46 -07:00
|
|
|
// These may be called before the corresponding subsystems have actually
|
|
|
|
// started up. That's OK, they can handle it.
|
2007-07-03 20:39:01 -07:00
|
|
|
gfxTextRunCache::Shutdown();
|
|
|
|
gfxTextRunWordCache::Shutdown();
|
2007-04-03 20:32:43 -07:00
|
|
|
gfxFontCache::Shutdown();
|
2009-08-16 06:52:12 -07:00
|
|
|
#if defined(XP_MACOSX) // temporary, until this is implemented on others
|
|
|
|
gfxPlatformFontList::Shutdown();
|
2007-03-29 14:48:46 -07:00
|
|
|
#endif
|
2008-07-16 20:09:08 -07:00
|
|
|
|
|
|
|
// Free the various non-null transforms and loaded profiles
|
2008-09-08 14:47:26 -07:00
|
|
|
ShutdownCMS();
|
2008-07-16 20:09:08 -07:00
|
|
|
|
2008-09-08 14:47:26 -07:00
|
|
|
/* Unregister our CMS Override callback. */
|
|
|
|
nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
|
|
|
if (prefs)
|
|
|
|
prefs->RemoveObserver(CMForceSRGBPrefName, gPlatform->overrideObserver);
|
2008-07-16 20:09:08 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
delete gPlatform;
|
|
|
|
gPlatform = nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
gfxPlatform::~gfxPlatform()
|
|
|
|
{
|
|
|
|
// The cairo folks think we should only clean up in debug builds,
|
|
|
|
// but we're generally in the habit of trying to shut down as
|
|
|
|
// cleanly as possible even in production code, so call this
|
|
|
|
// cairo_debug_* function unconditionally.
|
2007-10-25 18:21:50 -07:00
|
|
|
//
|
|
|
|
// because cairo can assert and thus crash on shutdown, don't do this in release builds
|
2008-02-11 22:47:40 -08:00
|
|
|
#if MOZ_TREE_CAIRO && (defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING) || defined(NS_TRACE_MALLOC))
|
2007-03-22 10:30:00 -07:00
|
|
|
cairo_debug_reset_static_data();
|
2007-10-25 18:21:50 -07:00
|
|
|
#endif
|
2007-10-06 00:26:13 -07:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
// It would be nice to do this (although it might need to be after
|
|
|
|
// the cairo shutdown that happens in ~gfxPlatform). It even looks
|
|
|
|
// idempotent. But it has fatal assertions that fire if stuff is
|
|
|
|
// leaked, and we hit them.
|
|
|
|
FcFini();
|
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
already_AddRefed<gfxASurface>
|
2007-11-27 01:35:18 -08:00
|
|
|
gfxPlatform::OptimizeImage(gfxImageSurface *aSurface,
|
|
|
|
gfxASurface::gfxImageFormat format)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
const gfxIntSize& surfaceSize = aSurface->GetSize();
|
|
|
|
|
2007-11-27 01:35:18 -08:00
|
|
|
nsRefPtr<gfxASurface> optSurface = CreateOffscreenSurface(surfaceSize, format);
|
|
|
|
if (!optSurface || optSurface->CairoStatus() != 0)
|
2007-03-22 10:30:00 -07:00
|
|
|
return nsnull;
|
|
|
|
|
2007-12-31 20:42:49 -08:00
|
|
|
gfxContext tmpCtx(optSurface);
|
|
|
|
tmpCtx.SetOperator(gfxContext::OPERATOR_SOURCE);
|
|
|
|
tmpCtx.SetSource(aSurface);
|
|
|
|
tmpCtx.Paint();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
gfxASurface *ret = optSurface;
|
|
|
|
NS_ADDREF(ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
gfxPlatform::GetFontList(const nsACString& aLangGroup,
|
|
|
|
const nsACString& aGenericFamily,
|
2009-01-18 12:14:14 -08:00
|
|
|
nsTArray<nsString>& aListOfFonts)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
gfxPlatform::UpdateFontList()
|
|
|
|
{
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
2008-09-30 20:01:53 -07:00
|
|
|
#define GFX_DOWNLOADABLE_FONTS_ENABLED "gfx.downloadable_fonts.enabled"
|
|
|
|
|
|
|
|
PRBool
|
|
|
|
gfxPlatform::DownloadableFontsEnabled()
|
|
|
|
{
|
|
|
|
static PRBool initialized = PR_FALSE;
|
|
|
|
static PRBool allowDownloadableFonts = PR_FALSE;
|
|
|
|
|
|
|
|
if (initialized == PR_FALSE) {
|
|
|
|
initialized = PR_TRUE;
|
|
|
|
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
|
|
|
if (prefs) {
|
|
|
|
PRBool allow;
|
|
|
|
nsresult rv = prefs->GetBoolPref(GFX_DOWNLOADABLE_FONTS_ENABLED, &allow);
|
|
|
|
if (NS_SUCCEEDED(rv))
|
|
|
|
allowDownloadableFonts = allow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return allowDownloadableFonts;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
static void
|
|
|
|
AppendGenericFontFromPref(nsString& aFonts, const char *aLangGroup, const char *aGenericName)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
|
2009-04-04 02:43:42 -07:00
|
|
|
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
2007-03-22 10:30:00 -07:00
|
|
|
if (!prefs)
|
|
|
|
return;
|
|
|
|
|
|
|
|
nsCAutoString prefName;
|
2009-04-04 02:43:42 -07:00
|
|
|
nsXPIDLCString nameValue, nameListValue;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-04-04 02:43:42 -07:00
|
|
|
nsCAutoString genericDotLang;
|
2007-03-22 10:30:00 -07:00
|
|
|
if (aGenericName) {
|
2009-04-04 02:43:42 -07:00
|
|
|
genericDotLang.Assign(aGenericName);
|
2007-03-22 10:30:00 -07:00
|
|
|
} else {
|
|
|
|
prefName.AssignLiteral("font.default.");
|
|
|
|
prefName.Append(aLangGroup);
|
2009-04-04 02:43:42 -07:00
|
|
|
prefs->GetCharPref(prefName.get(), getter_Copies(genericDotLang));
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
genericDotLang.AppendLiteral(".");
|
|
|
|
genericDotLang.Append(aLangGroup);
|
|
|
|
|
2007-12-27 17:28:26 -08:00
|
|
|
// fetch font.name.xxx value
|
2007-03-22 10:30:00 -07:00
|
|
|
prefName.AssignLiteral("font.name.");
|
|
|
|
prefName.Append(genericDotLang);
|
2009-04-04 02:43:42 -07:00
|
|
|
rv = prefs->GetCharPref(prefName.get(), getter_Copies(nameValue));
|
2007-03-22 10:30:00 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
if (!aFonts.IsEmpty())
|
|
|
|
aFonts.AppendLiteral(", ");
|
2009-04-04 02:43:42 -07:00
|
|
|
aFonts.Append(NS_ConvertUTF8toUTF16(nameValue));
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2007-12-27 17:28:26 -08:00
|
|
|
// fetch font.name-list.xxx value
|
2007-03-22 10:30:00 -07:00
|
|
|
prefName.AssignLiteral("font.name-list.");
|
|
|
|
prefName.Append(genericDotLang);
|
2009-04-04 02:43:42 -07:00
|
|
|
rv = prefs->GetCharPref(prefName.get(), getter_Copies(nameListValue));
|
2007-12-27 17:28:26 -08:00
|
|
|
if (NS_SUCCEEDED(rv) && !nameListValue.Equals(nameValue)) {
|
2007-03-22 10:30:00 -07:00
|
|
|
if (!aFonts.IsEmpty())
|
|
|
|
aFonts.AppendLiteral(", ");
|
2009-04-04 02:43:42 -07:00
|
|
|
aFonts.Append(NS_ConvertUTF8toUTF16(nameListValue));
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2007-07-18 07:22:06 -07:00
|
|
|
gfxPlatform::GetPrefFonts(const char *aLangGroup, nsString& aFonts, PRBool aAppendUnicode)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
aFonts.Truncate();
|
|
|
|
|
|
|
|
AppendGenericFontFromPref(aFonts, aLangGroup, nsnull);
|
2007-07-18 07:22:06 -07:00
|
|
|
if (aAppendUnicode)
|
|
|
|
AppendGenericFontFromPref(aFonts, "x-unicode", nsnull);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2008-01-30 16:23:36 -08:00
|
|
|
PRBool gfxPlatform::ForEachPrefFont(eFontPrefLang aLangArray[], PRUint32 aLangArrayLen, PrefFontCallback aCallback,
|
|
|
|
void *aClosure)
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
|
2009-04-04 02:43:42 -07:00
|
|
|
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
2008-01-30 16:23:36 -08:00
|
|
|
if (!prefs)
|
|
|
|
return PR_FALSE;
|
|
|
|
|
|
|
|
PRUint32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < aLangArrayLen; i++) {
|
|
|
|
eFontPrefLang prefLang = aLangArray[i];
|
|
|
|
const char *langGroup = GetPrefLangName(prefLang);
|
|
|
|
|
|
|
|
nsCAutoString prefName;
|
2009-04-04 02:43:42 -07:00
|
|
|
nsXPIDLCString nameValue, nameListValue;
|
2008-01-30 16:23:36 -08:00
|
|
|
|
2009-04-04 02:43:42 -07:00
|
|
|
nsCAutoString genericDotLang;
|
2008-01-30 16:23:36 -08:00
|
|
|
prefName.AssignLiteral("font.default.");
|
|
|
|
prefName.Append(langGroup);
|
2009-04-04 02:43:42 -07:00
|
|
|
prefs->GetCharPref(prefName.get(), getter_Copies(genericDotLang));
|
2008-01-30 16:23:36 -08:00
|
|
|
|
|
|
|
genericDotLang.AppendLiteral(".");
|
|
|
|
genericDotLang.Append(langGroup);
|
|
|
|
|
|
|
|
// fetch font.name.xxx value
|
|
|
|
prefName.AssignLiteral("font.name.");
|
|
|
|
prefName.Append(genericDotLang);
|
2009-04-04 02:43:42 -07:00
|
|
|
rv = prefs->GetCharPref(prefName.get(), getter_Copies(nameValue));
|
2008-01-30 16:23:36 -08:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2009-04-04 02:43:42 -07:00
|
|
|
if (!aCallback(prefLang, NS_ConvertUTF8toUTF16(nameValue), aClosure))
|
2008-01-30 16:23:36 -08:00
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// fetch font.name-list.xxx value
|
|
|
|
prefName.AssignLiteral("font.name-list.");
|
|
|
|
prefName.Append(genericDotLang);
|
2009-04-04 02:43:42 -07:00
|
|
|
rv = prefs->GetCharPref(prefName.get(), getter_Copies(nameListValue));
|
2008-01-30 16:23:36 -08:00
|
|
|
if (NS_SUCCEEDED(rv) && !nameListValue.Equals(nameValue)) {
|
2009-04-04 02:43:42 -07:00
|
|
|
if (!aCallback(prefLang, NS_ConvertUTF8toUTF16(nameListValue), aClosure))
|
2008-01-30 16:23:36 -08:00
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
eFontPrefLang
|
|
|
|
gfxPlatform::GetFontPrefLangFor(const char* aLang)
|
|
|
|
{
|
|
|
|
if (!aLang || !aLang[0])
|
|
|
|
return eFontPrefLang_Others;
|
|
|
|
for (PRUint32 i = 0; i < PRUint32(eFontPrefLang_LangCount); ++i) {
|
|
|
|
if (!PL_strcasecmp(gPrefLangNames[i], aLang))
|
|
|
|
return eFontPrefLang(i);
|
|
|
|
}
|
|
|
|
return eFontPrefLang_Others;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char*
|
|
|
|
gfxPlatform::GetPrefLangName(eFontPrefLang aLang)
|
|
|
|
{
|
|
|
|
if (PRUint32(aLang) < PRUint32(eFontPrefLang_AllCount))
|
|
|
|
return gPrefLangNames[PRUint32(aLang)];
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
const PRUint32 kFontPrefLangCJKMask = (1 << (PRUint32) eFontPrefLang_Japanese) | (1 << (PRUint32) eFontPrefLang_ChineseTW)
|
|
|
|
| (1 << (PRUint32) eFontPrefLang_ChineseCN) | (1 << (PRUint32) eFontPrefLang_ChineseHK)
|
2008-01-31 00:41:09 -08:00
|
|
|
| (1 << (PRUint32) eFontPrefLang_Korean) | (1 << (PRUint32) eFontPrefLang_CJKSet);
|
2008-01-30 16:23:36 -08:00
|
|
|
PRBool
|
|
|
|
gfxPlatform::IsLangCJK(eFontPrefLang aLang)
|
|
|
|
{
|
|
|
|
return kFontPrefLangCJKMask & (1 << (PRUint32) aLang);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gfxPlatform::AppendPrefLang(eFontPrefLang aPrefLangs[], PRUint32& aLen, eFontPrefLang aAddLang)
|
|
|
|
{
|
|
|
|
if (aLen >= kMaxLenPrefLangList) return;
|
|
|
|
|
|
|
|
// make sure
|
|
|
|
PRUint32 i = 0;
|
|
|
|
while (i < aLen && aPrefLangs[i] != aAddLang) {
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i == aLen) {
|
|
|
|
aPrefLangs[aLen] = aAddLang;
|
|
|
|
aLen++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-11 21:55:36 -07:00
|
|
|
eCMSMode
|
|
|
|
gfxPlatform::GetCMSMode()
|
2007-07-23 15:02:17 -07:00
|
|
|
{
|
2008-09-08 14:47:26 -07:00
|
|
|
if (gCMSInitialized == PR_FALSE) {
|
|
|
|
gCMSInitialized = PR_TRUE;
|
2007-07-23 15:02:17 -07:00
|
|
|
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
|
|
|
if (prefs) {
|
2008-08-11 21:55:36 -07:00
|
|
|
PRInt32 mode;
|
2007-07-23 15:02:17 -07:00
|
|
|
nsresult rv =
|
2008-08-11 21:55:36 -07:00
|
|
|
prefs->GetIntPref(CMPrefName, &mode);
|
|
|
|
if (NS_SUCCEEDED(rv) && (mode >= 0) && (mode < eCMSMode_AllCount)) {
|
2008-09-08 14:47:26 -07:00
|
|
|
gCMSMode = static_cast<eCMSMode>(mode);
|
2007-07-23 15:02:17 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-09-08 14:47:26 -07:00
|
|
|
return gCMSMode;
|
2007-07-23 15:02:17 -07:00
|
|
|
}
|
|
|
|
|
2008-07-23 10:33:12 -07:00
|
|
|
/* Chris Murphy (CM consultant) suggests this as a default in the event that we
|
|
|
|
cannot reproduce relative + Black Point Compensation. BPC brings an
|
|
|
|
unacceptable performance overhead, so we go with perceptual. */
|
2009-04-07 09:02:11 -07:00
|
|
|
#define INTENT_DEFAULT QCMS_INTENT_PERCEPTUAL
|
|
|
|
#define INTENT_MIN 0
|
|
|
|
#define INTENT_MAX 3
|
2008-07-23 10:33:12 -07:00
|
|
|
|
|
|
|
PRBool
|
|
|
|
gfxPlatform::GetRenderingIntent()
|
|
|
|
{
|
2008-09-08 14:47:26 -07:00
|
|
|
if (gCMSIntent == -2) {
|
2008-07-23 10:33:12 -07:00
|
|
|
|
|
|
|
/* Try to query the pref system for a rendering intent. */
|
|
|
|
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
|
|
|
if (prefs) {
|
|
|
|
PRInt32 pIntent;
|
2008-08-11 21:55:36 -07:00
|
|
|
nsresult rv = prefs->GetIntPref(CMIntentPrefName, &pIntent);
|
2008-07-23 10:33:12 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
|
|
|
|
/* If the pref is within range, use it as an override. */
|
|
|
|
if ((pIntent >= INTENT_MIN) && (pIntent <= INTENT_MAX))
|
2008-09-08 14:47:26 -07:00
|
|
|
gCMSIntent = pIntent;
|
2008-07-23 10:33:12 -07:00
|
|
|
|
|
|
|
/* If the pref is out of range, use embedded profile. */
|
|
|
|
else
|
2008-09-08 14:47:26 -07:00
|
|
|
gCMSIntent = -1;
|
2008-07-23 10:33:12 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we didn't get a valid intent from prefs, use the default. */
|
2008-09-08 14:47:26 -07:00
|
|
|
if (gCMSIntent == -2)
|
|
|
|
gCMSIntent = INTENT_DEFAULT;
|
2008-07-23 10:33:12 -07:00
|
|
|
}
|
2008-09-08 14:47:26 -07:00
|
|
|
return gCMSIntent;
|
2008-07-23 10:33:12 -07:00
|
|
|
}
|
|
|
|
|
2008-09-10 19:21:03 -07:00
|
|
|
void
|
2009-04-07 09:02:11 -07:00
|
|
|
gfxPlatform::TransformPixel(const gfxRGBA& in, gfxRGBA& out, qcms_transform *transform)
|
2008-09-10 19:21:03 -07:00
|
|
|
{
|
|
|
|
|
|
|
|
if (transform) {
|
2009-04-07 09:02:11 -07:00
|
|
|
/* we want the bytes in RGB order */
|
2008-09-10 19:21:03 -07:00
|
|
|
#ifdef IS_LITTLE_ENDIAN
|
2009-04-07 09:02:11 -07:00
|
|
|
/* ABGR puts the bytes in |RGBA| order on little endian */
|
2008-09-10 19:21:03 -07:00
|
|
|
PRUint32 packed = in.Packed(gfxRGBA::PACKED_ABGR);
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_transform_data(transform,
|
2008-09-10 19:21:03 -07:00
|
|
|
(PRUint8 *)&packed, (PRUint8 *)&packed,
|
|
|
|
1);
|
|
|
|
out.~gfxRGBA();
|
|
|
|
new (&out) gfxRGBA(packed, gfxRGBA::PACKED_ABGR);
|
|
|
|
#else
|
2009-04-07 09:02:11 -07:00
|
|
|
/* ARGB puts the bytes in |ARGB| order on big endian */
|
2008-09-10 19:21:03 -07:00
|
|
|
PRUint32 packed = in.Packed(gfxRGBA::PACKED_ARGB);
|
2009-04-07 09:02:11 -07:00
|
|
|
/* add one to move past the alpha byte */
|
|
|
|
qcms_transform_data(transform,
|
2008-09-10 19:21:03 -07:00
|
|
|
(PRUint8 *)&packed + 1, (PRUint8 *)&packed + 1,
|
|
|
|
1);
|
|
|
|
out.~gfxRGBA();
|
|
|
|
new (&out) gfxRGBA(packed, gfxRGBA::PACKED_ARGB);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (&out != &in)
|
|
|
|
out = in;
|
|
|
|
}
|
2008-07-23 10:33:12 -07:00
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile *
|
2007-07-23 15:02:17 -07:00
|
|
|
gfxPlatform::GetPlatformCMSOutputProfile()
|
|
|
|
{
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile *
|
2007-07-23 15:02:17 -07:00
|
|
|
gfxPlatform::GetCMSOutputProfile()
|
|
|
|
{
|
|
|
|
if (!gCMSOutputProfile) {
|
|
|
|
|
|
|
|
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
|
|
|
if (prefs) {
|
2008-09-08 14:47:26 -07:00
|
|
|
|
|
|
|
nsresult rv;
|
|
|
|
|
|
|
|
/* Determine if we're using the internal override to force sRGB as
|
|
|
|
an output profile for reftests. See Bug 452125. */
|
|
|
|
PRBool hasSRGBOverride, doSRGBOverride;
|
|
|
|
rv = prefs->PrefHasUserValue(CMForceSRGBPrefName, &hasSRGBOverride);
|
|
|
|
if (NS_SUCCEEDED(rv) && hasSRGBOverride) {
|
|
|
|
rv = prefs->GetBoolPref(CMForceSRGBPrefName, &doSRGBOverride);
|
|
|
|
if (NS_SUCCEEDED(rv) && doSRGBOverride)
|
|
|
|
gCMSOutputProfile = GetCMSsRGBProfile();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gCMSOutputProfile) {
|
|
|
|
|
|
|
|
nsXPIDLCString fname;
|
|
|
|
rv = prefs->GetCharPref(CMProfilePrefName,
|
|
|
|
getter_Copies(fname));
|
|
|
|
if (NS_SUCCEEDED(rv) && !fname.IsEmpty()) {
|
2009-04-07 09:02:11 -07:00
|
|
|
gCMSOutputProfile = qcms_profile_from_path(fname);
|
2008-09-08 14:47:26 -07:00
|
|
|
}
|
2007-07-23 15:02:17 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gCMSOutputProfile) {
|
|
|
|
gCMSOutputProfile =
|
|
|
|
gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfile();
|
|
|
|
}
|
|
|
|
|
2008-12-06 22:32:24 -08:00
|
|
|
/* Determine if the profile looks bogus. If so, close the profile
|
|
|
|
* and use sRGB instead. See bug 460629, */
|
2009-04-07 09:02:11 -07:00
|
|
|
if (gCMSOutputProfile && qcms_profile_is_bogus(gCMSOutputProfile)) {
|
2008-12-06 22:32:24 -08:00
|
|
|
NS_ASSERTION(gCMSOutputProfile != GetCMSsRGBProfile(),
|
|
|
|
"Builtin sRGB profile tagged as bogus!!!");
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile_release(gCMSOutputProfile);
|
2008-12-06 22:32:24 -08:00
|
|
|
gCMSOutputProfile = nsnull;
|
|
|
|
}
|
|
|
|
|
2007-07-23 15:02:17 -07:00
|
|
|
if (!gCMSOutputProfile) {
|
2008-07-16 20:09:08 -07:00
|
|
|
gCMSOutputProfile = GetCMSsRGBProfile();
|
2007-07-23 15:02:17 -07:00
|
|
|
}
|
2008-08-15 13:59:18 -07:00
|
|
|
/* Precache the LUT16 Interpolations for the output profile. See
|
|
|
|
bug 444661 for details. */
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile_precache_output_transform(gCMSOutputProfile);
|
2007-07-23 15:02:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return gCMSOutputProfile;
|
|
|
|
}
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile *
|
2008-07-16 20:09:08 -07:00
|
|
|
gfxPlatform::GetCMSsRGBProfile()
|
|
|
|
{
|
2008-08-15 13:59:18 -07:00
|
|
|
if (!gCMSsRGBProfile) {
|
|
|
|
|
|
|
|
/* Create the profile using lcms. */
|
2009-04-07 09:02:11 -07:00
|
|
|
gCMSsRGBProfile = qcms_profile_sRGB();
|
2008-08-15 13:59:18 -07:00
|
|
|
}
|
2008-07-16 20:09:08 -07:00
|
|
|
return gCMSsRGBProfile;
|
|
|
|
}
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_transform *
|
2007-07-23 15:02:17 -07:00
|
|
|
gfxPlatform::GetCMSRGBTransform()
|
|
|
|
{
|
|
|
|
if (!gCMSRGBTransform) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile *inProfile, *outProfile;
|
2007-07-23 15:02:17 -07:00
|
|
|
outProfile = GetCMSOutputProfile();
|
2008-07-16 20:09:08 -07:00
|
|
|
inProfile = GetCMSsRGBProfile();
|
2007-07-23 15:02:17 -07:00
|
|
|
|
|
|
|
if (!inProfile || !outProfile)
|
|
|
|
return nsnull;
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
gCMSRGBTransform = qcms_transform_create(inProfile, QCMS_DATA_RGB_8,
|
|
|
|
outProfile, QCMS_DATA_RGB_8,
|
|
|
|
QCMS_INTENT_PERCEPTUAL);
|
2007-07-23 15:02:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return gCMSRGBTransform;
|
|
|
|
}
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_transform *
|
2007-08-30 09:21:16 -07:00
|
|
|
gfxPlatform::GetCMSInverseRGBTransform()
|
|
|
|
{
|
|
|
|
if (!gCMSInverseRGBTransform) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile *inProfile, *outProfile;
|
2007-08-30 09:21:16 -07:00
|
|
|
inProfile = GetCMSOutputProfile();
|
2008-07-16 20:09:08 -07:00
|
|
|
outProfile = GetCMSsRGBProfile();
|
2007-08-30 09:21:16 -07:00
|
|
|
|
|
|
|
if (!inProfile || !outProfile)
|
|
|
|
return nsnull;
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
gCMSInverseRGBTransform = qcms_transform_create(inProfile, QCMS_DATA_RGB_8,
|
|
|
|
outProfile, QCMS_DATA_RGB_8,
|
|
|
|
QCMS_INTENT_PERCEPTUAL);
|
2007-08-30 09:21:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return gCMSInverseRGBTransform;
|
|
|
|
}
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_transform *
|
2007-07-23 15:02:17 -07:00
|
|
|
gfxPlatform::GetCMSRGBATransform()
|
|
|
|
{
|
|
|
|
if (!gCMSRGBATransform) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile *inProfile, *outProfile;
|
2007-07-23 15:02:17 -07:00
|
|
|
outProfile = GetCMSOutputProfile();
|
2008-07-16 20:09:08 -07:00
|
|
|
inProfile = GetCMSsRGBProfile();
|
2007-07-23 15:02:17 -07:00
|
|
|
|
|
|
|
if (!inProfile || !outProfile)
|
|
|
|
return nsnull;
|
|
|
|
|
2009-04-07 09:02:11 -07:00
|
|
|
gCMSRGBATransform = qcms_transform_create(inProfile, QCMS_DATA_RGBA_8,
|
|
|
|
outProfile, QCMS_DATA_RGBA_8,
|
|
|
|
QCMS_INTENT_PERCEPTUAL);
|
2007-07-23 15:02:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return gCMSRGBATransform;
|
|
|
|
}
|
2008-08-11 21:55:36 -07:00
|
|
|
|
2008-09-08 14:47:26 -07:00
|
|
|
/* Shuts down various transforms and profiles for CMS. */
|
|
|
|
static void ShutdownCMS()
|
|
|
|
{
|
|
|
|
|
|
|
|
if (gCMSRGBTransform) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_transform_release(gCMSRGBTransform);
|
2008-09-08 14:47:26 -07:00
|
|
|
gCMSRGBTransform = nsnull;
|
|
|
|
}
|
|
|
|
if (gCMSInverseRGBTransform) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_transform_release(gCMSInverseRGBTransform);
|
2008-09-08 14:47:26 -07:00
|
|
|
gCMSInverseRGBTransform = nsnull;
|
|
|
|
}
|
|
|
|
if (gCMSRGBATransform) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_transform_release(gCMSRGBATransform);
|
2008-09-08 14:47:26 -07:00
|
|
|
gCMSRGBATransform = nsnull;
|
|
|
|
}
|
|
|
|
if (gCMSOutputProfile) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile_release(gCMSOutputProfile);
|
2008-09-08 14:47:26 -07:00
|
|
|
|
|
|
|
// handle the aliased case
|
|
|
|
if (gCMSsRGBProfile == gCMSOutputProfile)
|
|
|
|
gCMSsRGBProfile = nsnull;
|
|
|
|
gCMSOutputProfile = nsnull;
|
|
|
|
}
|
|
|
|
if (gCMSsRGBProfile) {
|
2009-04-07 09:02:11 -07:00
|
|
|
qcms_profile_release(gCMSsRGBProfile);
|
2008-09-08 14:47:26 -07:00
|
|
|
gCMSsRGBProfile = nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reset the state variables
|
|
|
|
gCMSIntent = -2;
|
|
|
|
gCMSMode = eCMSMode_Off;
|
|
|
|
gCMSInitialized = PR_FALSE;
|
|
|
|
}
|
|
|
|
|
2008-08-11 21:55:36 -07:00
|
|
|
static void MigratePrefs()
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Load the pref service. If we don't get it die quietly since this isn't
|
|
|
|
critical code. */
|
|
|
|
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
|
|
|
if (!prefs)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Migrate from the boolean color_management.enabled pref - we now use
|
|
|
|
color_management.mode. */
|
|
|
|
PRBool hasOldCMPref;
|
|
|
|
nsresult rv =
|
|
|
|
prefs->PrefHasUserValue(CMPrefNameOld, &hasOldCMPref);
|
|
|
|
if (NS_SUCCEEDED(rv) && (hasOldCMPref == PR_TRUE)) {
|
|
|
|
PRBool CMWasEnabled;
|
|
|
|
rv = prefs->GetBoolPref(CMPrefNameOld, &CMWasEnabled);
|
|
|
|
if (NS_SUCCEEDED(rv) && (CMWasEnabled == PR_TRUE))
|
|
|
|
prefs->SetIntPref(CMPrefName, eCMSMode_All);
|
|
|
|
prefs->ClearUserPref(CMPrefNameOld);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|