Remove dead code in intl. Bug 559489, r=smontagu

This commit is contained in:
Ehren Metcalfe 2010-07-04 15:42:04 +03:00
parent a883004a9e
commit 40edafab25
74 changed files with 19 additions and 3618 deletions

View File

@ -57,9 +57,7 @@ EXPORTS = \
nsICharsetDetectionAdaptor.h \
nsICharsetDetectionObserver.h \
nsICharsetDetector.h \
nsIMetaCharsetService.h \
nsIStringCharsetDetector.h \
nsIXMLEncodingService.h \
nsMetaCharsetCID.h \
nsXMLEncodingCID.h \
$(NULL)

View File

@ -1,58 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
#ifndef nsIMetaCharsetService_h__
#define nsIMetaCharsetService_h__
#include "nsISupports.h"
// {218F2AC1-0A48-11d3-B3BA-00805F8A6670}
#define NS_IMETA_CHARSET_SERVICE_IID \
{ 0x218f2ac1, 0xa48, 0x11d3, { 0xb3, 0xba, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } }
class nsIMetaCharsetService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMETA_CHARSET_SERVICE_IID)
NS_IMETHOD Start() = 0;
NS_IMETHOD End() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIMetaCharsetService,
NS_IMETA_CHARSET_SERVICE_IID)
#endif // nsIMetaCharsetService_h__

View File

@ -1,59 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
#ifndef nsIXMLEncodingService_h__
#define nsIXMLEncodingService_h__
#include "nsISupports.h"
// {12BB8F11-2389-11d3-B3BF-00805F8A6670}
#define NS_IXML_ENCODING_SERVICE_IID \
{ 0x12bb8f11, 0x2389, 0x11d3, { 0xb3, 0xbf, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } }
class nsIXMLEncodingService : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXML_ENCODING_SERVICE_IID)
NS_IMETHOD Start() = 0;
NS_IMETHOD End() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIXMLEncodingService,
NS_IXML_ENCODING_SERVICE_IID)
#endif // nsIXMLEncodingService_h__

View File

@ -53,9 +53,6 @@ LIBXUL_LIBRARY = 1
CPPSRCS = \
nsObserverBase.cpp \
nsXMLEncodingObserver.cpp \
nsMetaCharsetObserver.cpp \
nsDetectionAdaptor.cpp \
nsDebugDetector.cpp \
nsCyrillicDetector.cpp \
nsDocumentCharsetInfo.cpp \

View File

@ -49,22 +49,16 @@
#include "nsMetaCharsetCID.h"
#include "nsICharsetDetector.h"
#include "nsICharsetAlias.h"
#include "nsMetaCharsetObserver.h"
#include "nsDocumentCharsetInfo.h"
#include "nsXMLEncodingObserver.h"
#include "nsICharsetDetectionAdaptor.h"
#include "nsICharsetDetectionObserver.h"
#include "nsDetectionAdaptor.h"
#include "nsIStringCharsetDetector.h"
#include "nsCyrillicDetector.h"
#include "nsDocumentCharsetInfoCID.h"
#include "nsXMLEncodingCID.h"
#include "nsCharsetDetectionAdaptorCID.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMetaCharsetObserver)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocumentCharsetInfo)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsXMLEncodingObserver)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDetectionAdaptor)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsRUProbDetector)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUKProbDetector)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsRUStringProbDetector)

View File

@ -42,10 +42,7 @@
#include "nsCharDetConstructors.h"
NS_DEFINE_NAMED_CID(NS_META_CHARSET_CID);
NS_DEFINE_NAMED_CID(NS_DOCUMENTCHARSETINFO_CID);
NS_DEFINE_NAMED_CID(NS_XML_ENCODING_CID);
NS_DEFINE_NAMED_CID(NS_CHARSET_DETECTION_ADAPTOR_CID);
NS_DEFINE_NAMED_CID(NS_RU_PROBDETECTOR_CID);
NS_DEFINE_NAMED_CID(NS_UK_PROBDETECTOR_CID);
NS_DEFINE_NAMED_CID(NS_RU_STRING_PROBDETECTOR_CID);
@ -57,10 +54,7 @@ NS_DEFINE_NAMED_CID(NS_LASTBLKDBG_DETECTOR_CID);
#endif /* INCLUDE_DBGDETECTOR */
static const mozilla::Module::CIDEntry kChardetCIDs[] = {
{ &kNS_META_CHARSET_CID, false, NULL, nsMetaCharsetObserverConstructor },
{ &kNS_DOCUMENTCHARSETINFO_CID, false, NULL, nsDocumentCharsetInfoConstructor },
{ &kNS_XML_ENCODING_CID, false, NULL, nsXMLEncodingObserverConstructor },
{ &kNS_CHARSET_DETECTION_ADAPTOR_CID, false, NULL, nsDetectionAdaptorConstructor },
{ &kNS_RU_PROBDETECTOR_CID, false, NULL, nsRUProbDetectorConstructor },
{ &kNS_UK_PROBDETECTOR_CID, false, NULL, nsUKProbDetectorConstructor },
{ &kNS_RU_STRING_PROBDETECTOR_CID, false, NULL, nsRUStringProbDetectorConstructor },
@ -74,10 +68,7 @@ static const mozilla::Module::CIDEntry kChardetCIDs[] = {
};
static const mozilla::Module::ContractIDEntry kChardetContracts[] = {
{ NS_META_CHARSET_CONTRACTID, &kNS_META_CHARSET_CID },
{ NS_DOCUMENTCHARSETINFO_CONTRACTID, &kNS_DOCUMENTCHARSETINFO_CID },
{ NS_XML_ENCODING_CONTRACTID, &kNS_XML_ENCODING_CID },
{ NS_CHARSET_DETECTION_ADAPTOR_CONTRACTID, &kNS_CHARSET_DETECTION_ADAPTOR_CID },
{ NS_CHARSET_DETECTOR_CONTRACTID_BASE "ruprob", &kNS_RU_PROBDETECTOR_CID },
{ NS_CHARSET_DETECTOR_CONTRACTID_BASE "ukprob", &kNS_UK_PROBDETECTOR_CID },
{ NS_STRCDETECTOR_CONTRACTID_BASE "ruprob", &kNS_RU_STRING_PROBDETECTOR_CID },

View File

@ -1,171 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 "nsString.h"
#include "plstr.h"
#include "pratom.h"
#include "nsCharDetDll.h"
#include "nsIParser.h"
#include "nsIDocument.h"
#include "nsDetectionAdaptor.h"
#include "nsIContentSink.h"
//--------------------------------------------------------------
NS_IMETHODIMP nsMyObserver::Notify(
const char* aCharset, nsDetectionConfident aConf)
{
nsresult rv = NS_OK;
if(mWeakRefParser) {
nsCAutoString existingCharset;
PRInt32 existingSource;
mWeakRefParser->GetDocumentCharset(existingCharset, existingSource);
if (existingSource >= kCharsetFromAutoDetection)
return NS_OK;
}
if(!mCharset.Equals(aCharset)) {
if(mNotifyByReload) {
rv = mWebShellSvc->StopDocumentLoad();
rv = mWebShellSvc->ReloadDocument(aCharset, kCharsetFromAutoDetection);
} else {
nsDependentCString newcharset(aCharset);
if (mWeakRefParser) {
mWeakRefParser->SetDocumentCharset(newcharset, kCharsetFromAutoDetection);
nsCOMPtr<nsIContentSink> contentSink = mWeakRefParser->GetContentSink();
if (contentSink)
contentSink->SetDocumentCharset(newcharset);
}
if(mWeakRefDocument)
mWeakRefDocument->SetDocumentCharacterSet(newcharset);
}
}
return NS_OK;
}
//--------------------------------------------------------------
NS_IMETHODIMP nsMyObserver::Init( nsIWebShellServices* aWebShellSvc,
nsIDocument* aDocument,
nsIParser* aParser,
const char* aCharset,
const char* aCommand)
{
if(aCommand) {
mCommand = aCommand;
}
if(aCharset) {
mCharset = aCharset;
}
if(aDocument) {
mWeakRefDocument = aDocument;
}
if(aParser) {
mWeakRefParser = aParser;
}
if(nsnull != aWebShellSvc)
{
mWebShellSvc = aWebShellSvc;
return NS_OK;
}
return NS_ERROR_ILLEGAL_VALUE;
}
//--------------------------------------------------------------
NS_IMPL_ISUPPORTS1 ( nsMyObserver ,nsICharsetDetectionObserver)
//--------------------------------------------------------------
nsDetectionAdaptor::nsDetectionAdaptor( void )
{
mDontFeedToDetector = PR_TRUE;
}
//--------------------------------------------------------------
nsDetectionAdaptor::~nsDetectionAdaptor()
{
}
//--------------------------------------------------------------
NS_IMPL_ISUPPORTS2 (nsDetectionAdaptor, nsIParserFilter, nsICharsetDetectionAdaptor)
//--------------------------------------------------------------
NS_IMETHODIMP nsDetectionAdaptor::Init(
nsIWebShellServices* aWebShellSvc, nsICharsetDetector *aDetector,
nsIDocument* aDocument, nsIParser* aParser, const char* aCharset,
const char* aCommand)
{
if((nsnull != aWebShellSvc) && (nsnull != aDetector) && (nsnull != aCharset))
{
nsresult rv = NS_OK;
mObserver = new nsMyObserver();
if(!mObserver)
return NS_ERROR_OUT_OF_MEMORY;
rv = mObserver->Init(aWebShellSvc, aDocument, aParser, aCharset, aCommand);
if(NS_SUCCEEDED(rv)) {
rv = aDetector->Init(mObserver.get());
if(NS_SUCCEEDED(rv)) {
mDetector = aDetector;
mDontFeedToDetector = PR_FALSE;
return NS_OK;
}
}
}
return NS_ERROR_ILLEGAL_VALUE;
}
//--------------------------------------------------------------
NS_IMETHODIMP nsDetectionAdaptor::RawBuffer
(const char * buffer, PRUint32 * buffer_length)
{
if((mDontFeedToDetector) || (!mDetector))
return NS_OK;
nsresult rv = NS_OK;
rv = mDetector->DoIt((const char*)buffer, *buffer_length, &mDontFeedToDetector);
if(mObserver)
mObserver->SetNotifyByReload(PR_TRUE);
return NS_OK;
}
//--------------------------------------------------------------
NS_IMETHODIMP nsDetectionAdaptor::Finish()
{
if((mDontFeedToDetector) || (!mDetector))
return NS_OK;
nsresult rv = NS_OK;
rv = mDetector->Done();
return NS_OK;
}

View File

@ -1,131 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
#ifndef nsDetectionAdaptor_h__
#define nsDetectionAdaptor_h__
#include "nsCOMPtr.h"
#include "nsIWebShellServices.h"
#include "nsIParserFilter.h"
static NS_DEFINE_IID(kIParserFilterIID, NS_IPARSERFILTER_IID);
class nsIDocument;
class CToken;
//--------------------------------------------------------------
class nsMyObserver : public nsICharsetDetectionObserver
{
public:
NS_DECL_ISUPPORTS
public:
nsMyObserver( void )
{
mWebShellSvc = nsnull;
mNotifyByReload = PR_FALSE;
mWeakRefDocument = nsnull;
mWeakRefParser = nsnull;
}
virtual ~nsMyObserver( void )
{
// do not release nor delete mWeakRefDocument
// do not release nor delete mWeakRefParser
}
// Methods to support nsICharsetDetectionAdaptor
NS_IMETHOD Init(nsIWebShellServices* aWebShellSvc,
nsIDocument* aDocument,
nsIParser* aParser,
const char* aCharset,
const char* aCommand);
// Methods to support nsICharsetDetectionObserver
NS_IMETHOD Notify(const char* aCharset, nsDetectionConfident aConf);
void SetNotifyByReload(PRBool aByReload) { mNotifyByReload = aByReload; }
private:
nsCOMPtr<nsIWebShellServices> mWebShellSvc;
PRBool mNotifyByReload;
//The adaptor is owned by parser as filter, and adaptor owns detector,
//which in turn owns observer. Parser also live within the lifespan of
//document. The ownership tree is like:
// document->parser->adaptor->detector->observer
//We do not want to own Document & Parser to avoid ownership loop. That
//will cause memory leakage.
//If in future this chain got changed, ie. parser outlives document, or
//detector outlives parser, we might want to change weak reference here.
nsIDocument* mWeakRefDocument;
nsIParser* mWeakRefParser;
nsCAutoString mCharset;
nsCAutoString mCommand;
};
class nsDetectionAdaptor :
public nsIParserFilter,
public nsICharsetDetectionAdaptor
{
public:
NS_DECL_ISUPPORTS
public:
nsDetectionAdaptor( void );
virtual ~nsDetectionAdaptor( void );
// Methods to support nsICharsetDetectionAdaptor
NS_IMETHOD Init(nsIWebShellServices* aWebShellSvc, nsICharsetDetector *aDetector,
nsIDocument* aDocument,
nsIParser* aParser,
const char* aCharset,
const char* aCommand=nsnull);
// Methode to suppor nsIParserFilter
NS_IMETHOD RawBuffer(const char * buffer, PRUint32 * buffer_length) ;
NS_IMETHOD Finish();
// really don't care the following two, only because they are defined
// in nsIParserFilter.h
NS_IMETHOD WillAddToken(CToken & token) { return NS_OK; }
NS_IMETHOD ProcessTokens( void ) {return NS_OK;}
private:
nsCOMPtr<nsICharsetDetector> mDetector;
PRBool mDontFeedToDetector;
nsCOMPtr<nsMyObserver> mObserver;
};
#endif /* nsDetectionAdaptor_h__ */

View File

@ -1,440 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 "nsDeque.h"
#include "nsICharsetAlias.h"
#include "nsMetaCharsetObserver.h"
#include "nsIMetaCharsetService.h"
#include "nsIElementObserver.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsISupports.h"
#include "nsCRT.h"
#include "nsIParser.h"
#include "pratom.h"
#include "nsCharDetDll.h"
#include "nsIServiceManager.h"
#include "nsObserverBase.h"
#include "nsWeakReference.h"
#include "nsIParserService.h"
#include "nsParserCIID.h"
#include "nsMetaCharsetCID.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID);
static const eHTMLTags gWatchTags[] =
{ eHTMLTag_meta,
eHTMLTag_unknown
};
//-------------------------------------------------------------------------
nsMetaCharsetObserver::nsMetaCharsetObserver()
{
bMetaCharsetObserverStarted = PR_FALSE;
nsresult res;
mAlias = nsnull;
nsCOMPtr<nsICharsetAlias> calias(do_GetService(kCharsetAliasCID, &res));
if(NS_SUCCEEDED(res)) {
mAlias = calias;
}
}
//-------------------------------------------------------------------------
nsMetaCharsetObserver::~nsMetaCharsetObserver()
{
}
//-------------------------------------------------------------------------
NS_IMPL_ADDREF ( nsMetaCharsetObserver )
NS_IMPL_RELEASE ( nsMetaCharsetObserver )
// Use the new scheme
NS_IMPL_QUERY_INTERFACE4(nsMetaCharsetObserver,
nsIElementObserver,
nsIObserver,
nsIMetaCharsetService,
nsISupportsWeakReference)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMetaCharsetObserver::Notify(
PRUint32 aDocumentID,
const PRUnichar* aTag,
PRUint32 numOfAttributes,
const PRUnichar* nameArray[],
const PRUnichar* valueArray[])
{
if(!nsDependentString(aTag).LowerCaseEqualsLiteral("meta"))
return NS_ERROR_ILLEGAL_VALUE;
else
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMetaCharsetObserver::Notify(
PRUint32 aDocumentID,
eHTMLTags aTag,
PRUint32 numOfAttributes,
const PRUnichar* nameArray[],
const PRUnichar* valueArray[])
{
if(eHTMLTag_meta != aTag)
return NS_ERROR_ILLEGAL_VALUE;
else
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
}
NS_IMETHODIMP nsMetaCharsetObserver::Notify(
PRUint32 aDocumentID,
PRUint32 numOfAttributes,
const PRUnichar* nameArray[],
const PRUnichar* valueArray[])
{
nsDeque keys(0);
nsDeque values(0);
PRUint32 i;
for(i=0;i<numOfAttributes;i++)
{
keys.Push((void*)nameArray[i]);
values.Push((void*)valueArray[i]);
}
return NS_OK;//Notify((nsISupports*)aDocumentID, &keys, &values);
}
NS_IMETHODIMP nsMetaCharsetObserver::Notify(
nsISupports* aDocShell,
nsISupports* aChannel,
const PRUnichar* aTag,
const nsTArray<nsString>* keys,
const nsTArray<nsString>* values,
const PRUint32 aFlags)
{
nsresult result = NS_OK;
// bug 125317 - document.write content is already an unicode content.
if (!(aFlags & nsIElementObserver::IS_DOCUMENT_WRITE)) {
if(!nsDependentString(aTag).LowerCaseEqualsLiteral("meta")) {
result = NS_ERROR_ILLEGAL_VALUE;
}
else {
result = Notify(aDocShell, aChannel, keys, values);
}
}
return result;
}
#define IS_SPACE_CHARS(ch) (ch == ' ' || ch == '\b' || ch == '\r' || ch == '\n')
NS_IMETHODIMP nsMetaCharsetObserver::Notify(
nsISupports* aDocShell,
nsISupports* aChannel,
const nsTArray<nsString>* keys,
const nsTArray<nsString>* values)
{
NS_PRECONDITION(keys!=nsnull && values!=nsnull,"Need key-value pair");
PRUint32 numOfAttributes = keys->Length();
NS_ASSERTION( numOfAttributes == values->Length(), "size mismatch");
nsresult res=NS_OK;
#ifdef DEBUG
PRUnichar Uxcommand[]={'X','_','C','O','M','M','A','N','D','\0'};
PRUnichar UcharsetSource[]={'c','h','a','r','s','e','t','S','o','u','r','c','e','\0'};
PRUnichar Ucharset[]={'c','h','a','r','s','e','t','\0'};
NS_ASSERTION(numOfAttributes >= 3, "should have at least 3 private attribute");
NS_ASSERTION(0==nsCRT::strcmp(Uxcommand,(keys->ElementAt(numOfAttributes-1)).get()),"last name should be 'X_COMMAND'" );
NS_ASSERTION(0==nsCRT::strcmp(UcharsetSource,(keys->ElementAt(numOfAttributes-2)).get()),"2nd last name should be 'charsetSource'" );
NS_ASSERTION(0==nsCRT::strcmp(Ucharset,(keys->ElementAt(numOfAttributes-3)).get()),"3rd last name should be 'charset'" );
#endif
NS_ASSERTION(mAlias, "Didn't get nsICharsetAlias in constructor");
if(nsnull == mAlias)
return NS_ERROR_ABORT;
// we need at least 5 - HTTP-EQUIV, CONTENT and 3 private
if(numOfAttributes >= 5 )
{
const nsString& srcStr = values->ElementAt(numOfAttributes-2);
PRInt32 err;
PRInt32 src = srcStr.ToInteger(&err);
// if we cannot convert the string into PRInt32, return error
NS_ASSERTION(NS_SUCCEEDED(err), "cannot get charset source");
if(NS_FAILED(err))
return NS_ERROR_ILLEGAL_VALUE;
if(kCharsetFromMetaTag <= src)
return NS_OK; // current charset has higher priority. don't bother to do the following
const PRUnichar *httpEquivValue=nsnull;
const PRUnichar *contentValue=nsnull;
const PRUnichar *charsetValue=nsnull;
for (PRUint32 i = 0; i < numOfAttributes - 3; i++)
{
const PRUnichar *keyStr;
keyStr = keys->ElementAt(i).get();
//Change 3.190 in nsHTMLTokens.cpp allow ws/tab/cr/lf exist before
// and after text value, this need to be skipped before comparison
while(IS_SPACE_CHARS(*keyStr))
keyStr++;
if(Substring(keyStr, keyStr+10).LowerCaseEqualsLiteral("http-equiv"))
httpEquivValue = values->ElementAt(i).get();
else if(Substring(keyStr, keyStr+7).LowerCaseEqualsLiteral("content"))
contentValue = values->ElementAt(i).get();
else if (Substring(keyStr, keyStr+7).LowerCaseEqualsLiteral("charset"))
charsetValue = values->ElementAt(i).get();
}
NS_NAMED_LITERAL_STRING(contenttype, "Content-Type");
NS_NAMED_LITERAL_STRING(texthtml, "text/html");
if(nsnull == httpEquivValue || nsnull == contentValue)
return NS_OK;
while(IS_SPACE_CHARS(*httpEquivValue))
++httpEquivValue;
// skip opening quote
if (*httpEquivValue == '\'' || *httpEquivValue == '\"')
++httpEquivValue;
while(IS_SPACE_CHARS(*contentValue))
++contentValue;
// skip opening quote
if (*contentValue == '\'' || *contentValue == '\"')
++contentValue;
if(
Substring(httpEquivValue,
httpEquivValue+contenttype.Length()).Equals(contenttype,
nsCaseInsensitiveStringComparator())
&&
Substring(contentValue,
contentValue+texthtml.Length()).Equals(texthtml,
nsCaseInsensitiveStringComparator())
)
{
nsCAutoString newCharset;
if (nsnull == charsetValue)
{
nsAutoString contentPart1(contentValue+9); // after "text/html"
PRInt32 start = contentPart1.RFind("charset=", PR_TRUE ) ;
PRInt32 end = contentPart1.Length();
if(kNotFound != start)
{
start += 8; // 8 = "charset=".length
while (start < end && contentPart1.CharAt(start) == PRUnichar(' '))
++start;
if (start < end) {
end = contentPart1.FindCharInSet("\'\"; ", start);
if(kNotFound == end )
end = contentPart1.Length();
NS_ASSERTION(end>=start, "wrong index");
LossyCopyUTF16toASCII(Substring(contentPart1, start, end-start),
newCharset);
}
}
}
else
{
LossyCopyUTF16toASCII(nsDependentString(charsetValue), newCharset);
}
nsCAutoString charsetString;
charsetString.AssignWithConversion(values->ElementAt(numOfAttributes-3));
if (!newCharset.IsEmpty())
{
if(! newCharset.Equals(charsetString, nsCaseInsensitiveCStringComparator()))
{
PRBool same = PR_FALSE;
nsresult res2 = mAlias->Equals( newCharset, charsetString , &same);
if(NS_SUCCEEDED(res2) && (! same))
{
nsCAutoString preferred;
res2 = mAlias->GetPreferred(newCharset, preferred);
if(NS_SUCCEEDED(res2))
{
// following charset should have been detected by parser
if (!preferred.EqualsLiteral("UTF-16") &&
!preferred.EqualsLiteral("UTF-16BE") &&
!preferred.EqualsLiteral("UTF-16LE") &&
!preferred.EqualsLiteral("UTF-32") &&
!preferred.EqualsLiteral("UTF-32BE") &&
!preferred.EqualsLiteral("UTF-32LE")) {
// Propagate the error message so that the parser can
// shutdown correctly. - Ref. Bug 96440
res = NotifyDocShell(aDocShell,
aChannel,
preferred.get(),
kCharsetFromMetaTag);
}
} // if(NS_SUCCEEDED(res)
}
}
else {
res = NS_HTMLPARSER_VALID_META_CHARSET;
} // if EqualIgnoreCase
} // if !newCharset.IsEmpty()
} // if
}
else
{
nsAutoString compatCharset;
if (NS_SUCCEEDED(GetCharsetFromCompatibilityTag(keys, values, compatCharset)))
{
if (!compatCharset.IsEmpty()) {
res = NotifyDocShell(aDocShell,
aChannel,
NS_ConvertUTF16toUTF8(compatCharset).get(),
kCharsetFromMetaTag);
}
}
}
return res;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMetaCharsetObserver::GetCharsetFromCompatibilityTag(
const nsTArray<nsString>* keys,
const nsTArray<nsString>* values,
nsAString& aCharset)
{
if (!mAlias)
return NS_ERROR_ABORT;
aCharset.Truncate(0);
nsresult res = NS_OK;
// support for non standard case for compatibility
// e.g. <META charset="ISO-8859-1">
PRUint32 numOfAttributes = keys->Length();
if ((numOfAttributes >= 3) &&
(keys->ElementAt(0).LowerCaseEqualsLiteral("charset")))
{
const nsString& srcStr = values->ElementAt(numOfAttributes-2);
PRInt32 err;
PRInt32 src = srcStr.ToInteger(&err);
// if we cannot convert the string into PRInt32, return error
if (NS_FAILED(err))
return NS_ERROR_ILLEGAL_VALUE;
// current charset have a lower priority
if (kCharsetFromMetaTag > src)
{
nsCAutoString newCharset;
newCharset.AssignWithConversion(values->ElementAt(0).get());
nsCAutoString preferred;
res = mAlias->GetPreferred(newCharset,
preferred);
if (NS_SUCCEEDED(res))
{
// compare against the current charset,
// also some charsets which should have been found in
// the BOM detection.
const nsString& currentCharset = values->ElementAt(numOfAttributes-3);
if (!preferred.Equals(NS_LossyConvertUTF16toASCII(currentCharset)) &&
!preferred.EqualsLiteral("UTF-16") &&
!preferred.EqualsLiteral("UTF-16BE") &&
!preferred.EqualsLiteral("UTF-16LE") &&
!preferred.EqualsLiteral("UTF-32") &&
!preferred.EqualsLiteral("UTF-32BE") &&
!preferred.EqualsLiteral("UTF-32LE"))
AppendASCIItoUTF16(preferred, aCharset);
}
}
}
return res;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMetaCharsetObserver::Observe(nsISupports *aSubject,
const char *aTopic,
const PRUnichar *aData)
{
nsresult rv = NS_OK;
if (!nsCRT::strcmp(aTopic, "parser-service-start")) {
rv = Start();
}
return rv;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMetaCharsetObserver::Start()
{
nsresult rv = NS_OK;
if (!bMetaCharsetObserverStarted) {
bMetaCharsetObserverStarted = PR_TRUE;
nsCOMPtr<nsIParserService> parserService(do_GetService(NS_PARSERSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv))
return rv;
rv = parserService->RegisterObserver(this,
NS_LITERAL_STRING("text/html"),
gWatchTags);
}
return rv;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsMetaCharsetObserver::End()
{
nsresult rv = NS_OK;
if (bMetaCharsetObserverStarted) {
bMetaCharsetObserverStarted = PR_FALSE;
nsCOMPtr<nsIParserService> parserService(do_GetService(NS_PARSERSERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv))
return rv;
rv = parserService->UnregisterObserver(this, NS_LITERAL_STRING("text/html"));
}
return rv;
}
//==========================================================================

View File

@ -1,112 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
#ifndef nsMetaCharsetObserverFactory_h__
#define nsMetaCharsetObserverFactory_h__
#include "nsIFactory.h"
#include "nsIMetaCharsetService.h"
#include "nsIElementObserver.h"
#include "nsIObserver.h"
#include "nsObserverBase.h"
#include "nsWeakReference.h"
#include "nsTArray.h"
//==========================================================================
//
// Class declaration for the class
//
//==========================================================================
class nsMetaCharsetObserver: public nsIElementObserver,
public nsIObserver,
public nsObserverBase,
public nsIMetaCharsetService,
public nsSupportsWeakReference {
public:
nsMetaCharsetObserver();
virtual ~nsMetaCharsetObserver();
/* methode for nsIElementObserver */
/*
* Subject call observer when the parser hit the tag
* @param aDocumentID- ID of the document
* @param aTag- the tag
* @param numOfAttributes - number of attributes
* @param nameArray - array of name.
* @param valueArray - array of value
*/
NS_IMETHOD Notify(PRUint32 aDocumentID, eHTMLTags aTag, PRUint32 numOfAttributes,
const PRUnichar* nameArray[], const PRUnichar* valueArray[]);
NS_IMETHOD Notify(PRUint32 aDocumentID, const PRUnichar* aTag, PRUint32 numOfAttributes,
const PRUnichar* nameArray[], const PRUnichar* valueArray[]);
NS_IMETHOD Notify(nsISupports* aWebShell,
nsISupports* aChannel,
const PRUnichar* aTag,
const nsTArray<nsString>* keys,
const nsTArray<nsString>* values,
const PRUint32 aFlags);
NS_DECL_ISUPPORTS
/* methode for nsIObserver */
NS_DECL_NSIOBSERVER
/* methode for nsIMetaCharsetService */
NS_IMETHOD Start();
NS_IMETHOD End();
private:
NS_IMETHOD Notify(PRUint32 aDocumentID, PRUint32 numOfAttributes,
const PRUnichar* nameArray[], const PRUnichar* valueArray[]);
NS_IMETHOD Notify(nsISupports* aWebShell,
nsISupports* aChannel,
const nsTArray<nsString>* keys,
const nsTArray<nsString>* values);
NS_IMETHOD GetCharsetFromCompatibilityTag(const nsTArray<nsString>* keys,
const nsTArray<nsString>* values,
nsAString& aCharset);
nsCOMPtr<nsICharsetAlias> mAlias;
PRBool bMetaCharsetObserverStarted;
};
#endif // nsMetaCharsetObserverFactory_h__

View File

@ -1,235 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 "nsICharsetAlias.h"
#include "nsXMLEncodingObserver.h"
#include "nsIXMLEncodingService.h"
#include "nsIElementObserver.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsISupports.h"
#include "nsCRT.h"
#include "nsIParser.h"
#include "pratom.h"
#include "nsCharDetDll.h"
#include "nsIServiceManager.h"
#include "nsObserverBase.h"
#include "nsWeakReference.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "mozilla/Services.h"
static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID);
static const eHTMLTags gTags[] =
{ eHTMLTag_instruction,
eHTMLTag_unknown
};
//-------------------------------------------------------------------------
nsXMLEncodingObserver::nsXMLEncodingObserver()
{
bXMLEncodingObserverStarted = PR_FALSE;
}
//-------------------------------------------------------------------------
nsXMLEncodingObserver::~nsXMLEncodingObserver()
{
// call to end the ObserverService
if (bXMLEncodingObserverStarted) {
End();
}
}
//-------------------------------------------------------------------------
NS_IMPL_ADDREF ( nsXMLEncodingObserver )
NS_IMPL_RELEASE ( nsXMLEncodingObserver )
// Use the new scheme
NS_IMPL_QUERY_INTERFACE4(nsXMLEncodingObserver,
nsIElementObserver,
nsIObserver,
nsIXMLEncodingService,
nsISupportsWeakReference)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsXMLEncodingObserver::Notify(
PRUint32 aDocumentID,
const PRUnichar* aTag,
PRUint32 numOfAttributes,
const PRUnichar* nameArray[],
const PRUnichar* valueArray[])
{
if(!nsDependentString(aTag).LowerCaseEqualsLiteral("?xml"))
return NS_ERROR_ILLEGAL_VALUE;
else
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsXMLEncodingObserver::Notify(
PRUint32 aDocumentID,
eHTMLTags aTag,
PRUint32 numOfAttributes,
const PRUnichar* nameArray[],
const PRUnichar* valueArray[])
{
if(eHTMLTag_meta != aTag)
return NS_ERROR_ILLEGAL_VALUE;
else
return Notify(aDocumentID, numOfAttributes, nameArray, valueArray);
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsXMLEncodingObserver::Notify(
PRUint32 aDocumentID,
PRUint32 numOfAttributes,
const PRUnichar* nameArray[],
const PRUnichar* valueArray[])
{
nsresult res = NS_OK;
PRUint32 i;
if(numOfAttributes >= 3)
{
PRBool bGotCurrentCharset=PR_FALSE;
PRBool bGotCurrentCharsetSource = PR_FALSE;
PRBool bGotEncoding = PR_FALSE;
nsCAutoString currentCharset(NS_LITERAL_CSTRING("unknown"));
nsAutoString charsetSourceStr(NS_LITERAL_STRING("unknown"));
nsCAutoString encoding(NS_LITERAL_CSTRING("unknown"));
for(i=0; i < numOfAttributes; i++)
{
if(0==nsCRT::strcmp(nameArray[i], NS_LITERAL_STRING("charset").get()))
{
bGotCurrentCharset = PR_TRUE;
LossyCopyUTF16toASCII(nsDependentString(valueArray[i]), currentCharset);
} else if(0==nsCRT::strcmp(nameArray[i], NS_LITERAL_STRING("charsetSource").get())) {
bGotCurrentCharsetSource = PR_TRUE;
charsetSourceStr = valueArray[i];
} else if(nsDependentString(nameArray[i]).LowerCaseEqualsLiteral("encoding")) {
bGotEncoding = PR_TRUE;
LossyCopyUTF16toASCII(nsDependentString(valueArray[i]), encoding);
}
}
// if we cannot find currentCharset or currentCharsetSource
// return error.
if( ! (bGotCurrentCharset && bGotCurrentCharsetSource))
{
return NS_ERROR_ILLEGAL_VALUE;
}
PRInt32 err;
PRInt32 charsetSourceInt = charsetSourceStr.ToInteger(&err);
// if we cannot convert the string into PRInt32, return error
if(NS_FAILED(err))
return NS_ERROR_ILLEGAL_VALUE;
PRInt32 currentCharsetSource = charsetSourceInt;
if(kCharsetFromMetaTag > currentCharsetSource)
{
if(! encoding.Equals(currentCharset))
{
nsCOMPtr<nsICharsetAlias> calias = do_GetService(kCharsetAliasCID, &res);
if(NS_SUCCEEDED(res) && (nsnull != calias) )
{
PRBool same = PR_FALSE;
res = calias->Equals( encoding, currentCharset, &same);
if(NS_SUCCEEDED(res) && (! same))
{
nsCAutoString preferred;
res = calias->GetPreferred(encoding,
preferred);
if(NS_SUCCEEDED(res))
{
res = NotifyDocShell(0,0, preferred.get(), kCharsetFromMetaTag );
return res;
} // if check for GetPreferred
} // if check res for Equals
} // if check res for GetService
} // if Equals
} // if
} // if
return NS_OK;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsXMLEncodingObserver::Observe(nsISupports*, const char*, const PRUnichar*)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsXMLEncodingObserver::Start()
{
nsresult res = NS_OK;
if (bXMLEncodingObserverStarted)
return res;
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (!obs)
return NS_ERROR_FAILURE;
res = obs->AddObserver(this, "xmlparser", PR_TRUE);
bXMLEncodingObserverStarted = PR_TRUE;
return res;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsXMLEncodingObserver::End()
{
nsresult res = NS_OK;
if (!bXMLEncodingObserverStarted)
return res;
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (!obs)
return NS_ERROR_FAILURE;
res = obs->RemoveObserver(this, "xmlparser");
bXMLEncodingObserverStarted = PR_FALSE;
return res;
}

View File

@ -1,96 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
#ifndef nsXMLEncodingObserverFactory_h__
#define nsXMLEncodingObserverFactory_h__
#include "nsIFactory.h"
#include "nsIXMLEncodingService.h"
#include "nsIElementObserver.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsObserverBase.h"
#include "nsWeakReference.h"
#include "nsTArray.h"
class nsXMLEncodingObserver: public nsIElementObserver,
public nsIObserver,
public nsObserverBase,
public nsIXMLEncodingService,
public nsSupportsWeakReference {
public:
nsXMLEncodingObserver();
virtual ~nsXMLEncodingObserver();
/* methode for nsIElementObserver */
/*
* Subject call observer when the parser hit the tag
* @param aDocumentID- ID of the document
* @param aTag- the tag
* @param numOfAttributes - number of attributes
* @param nameArray - array of name.
* @param valueArray - array of value
*/
NS_IMETHOD Notify(PRUint32 aDocumentID, eHTMLTags aTag, PRUint32 numOfAttributes,
const PRUnichar* nameArray[], const PRUnichar* valueArray[]);
NS_IMETHOD Notify(PRUint32 aDocumentID, const PRUnichar* aTag, PRUint32 numOfAttributes,
const PRUnichar* nameArray[], const PRUnichar* valueArray[]);
NS_IMETHOD Notify(nsISupports* aDocShell,
nsISupports* aChannel,
const PRUnichar* aTag,
const nsTArray<nsString>* keys,
const nsTArray<nsString>* values,
const PRUint32 aFlags)
{ return NS_ERROR_NOT_IMPLEMENTED; }
NS_DECL_ISUPPORTS
/* methode for nsIObserver */
NS_DECL_NSIOBSERVER
/* methode for nsIXMLEncodingService */
NS_IMETHOD Start();
NS_IMETHOD End();
private:
NS_IMETHOD Notify(PRUint32 aDocumentID, PRUint32 numOfAttributes,
const PRUnichar* nameArray[], const PRUnichar* valueArray[]);
PRBool bXMLEncodingObserverStarted;
};
#endif // nsXMLEncodingObserverFactory_h__

View File

@ -63,49 +63,6 @@ nsLocale::nsLocale(void)
NS_ASSERTION(fHashtable, "nsLocale: failed to allocate PR_Hashtable");
}
nsLocale::nsLocale(nsLocale* other) : fHashtable(nsnull), fCategoryCount(0)
{
fHashtable = PL_NewHashTable(LOCALE_HASH_SIZE,&nsLocale::Hash_HashFunction,
&nsLocale::Hash_CompareNSString,
&nsLocale::Hash_CompareNSString, NULL, NULL);
NS_ASSERTION(fHashtable, "nsLocale: failed to allocate PR_Hashtable");
//
// enumerate Hash and copy
//
PL_HashTableEnumerateEntries(other->fHashtable,
&nsLocale::Hash_EnumerateCopy, fHashtable);
}
nsLocale::nsLocale(const nsTArray<nsString>& categoryList,
const nsTArray<nsString>& valueList)
: fHashtable(NULL), fCategoryCount(0)
{
PRUnichar* key, *value;
fHashtable = PL_NewHashTable(LOCALE_HASH_SIZE,&nsLocale::Hash_HashFunction,
&nsLocale::Hash_CompareNSString,
&nsLocale::Hash_CompareNSString,
NULL, NULL);
NS_ASSERTION(fHashtable, "nsLocale: failed to allocate PR_Hashtable");
if (fHashtable)
{
for(PRUint32 i=0; i < categoryList.Length(); ++i)
{
key = ToNewUnicode(categoryList[i]);
NS_ASSERTION(key, "nsLocale: failed to allocate internal hash key");
value = ToNewUnicode(valueList[i]);
NS_ASSERTION(value, "nsLocale: failed to allocate internal hash value");
if (!PL_HashTableAdd(fHashtable,key,value)) {
nsMemory::Free(key);
nsMemory::Free(value);
}
}
}
}
nsLocale::~nsLocale(void)
{
// enumerate all the entries with a delete function to
@ -186,25 +143,3 @@ nsLocale::Hash_EnumerateDelete(PLHashEntry *he, PRIntn hashIndex, void *arg)
return (HT_ENUMERATE_NEXT | HT_ENUMERATE_REMOVE);
}
PRIntn
nsLocale::Hash_EnumerateCopy(PLHashEntry *he, PRIntn hashIndex, void* arg)
{
PRUnichar* newKey = ToNewUnicode(nsDependentString((PRUnichar *)he->key));
if (!newKey)
return HT_ENUMERATE_STOP;
PRUnichar* newValue = ToNewUnicode(nsDependentString((PRUnichar *)he->value));
if (!newValue) {
nsMemory::Free(newKey);
return HT_ENUMERATE_STOP;
}
if (!PL_HashTableAdd((PLHashTable*)arg, newKey, newValue)) {
nsMemory::Free(newKey);
nsMemory::Free(newValue);
return HT_ENUMERATE_STOP;
}
return (HT_ENUMERATE_NEXT);
}

View File

@ -63,8 +63,6 @@ class nsLocale : public nsILocale {
public:
nsLocale(void);
nsLocale(const nsTArray<nsString>& categoryList, const nsTArray<nsString>& valueList);
nsLocale(nsLocale* other);
virtual ~nsLocale(void);
/* Declare methods from nsILocale */
@ -77,7 +75,6 @@ protected:
static PLHashNumber Hash_HashFunction(const void* key);
static PRIntn Hash_CompareNSString(const void* s1, const void* s2);
static PRIntn Hash_EnumerateDelete(PLHashEntry *he, PRIntn hashIndex, void *arg);
static PRIntn Hash_EnumerateCopy(PLHashEntry *he, PRIntn hashIndex, void *arg);
PLHashTable* fHashtable;
PRUint32 fCategoryCount;

View File

@ -66,9 +66,6 @@ public:
virtual PRInt32 NextWord(const PRUnichar* aText, PRUint32 aLen,
PRUint32 aPos) = 0;
virtual PRInt32 PrevWord(const PRUnichar* aText, PRUint32 aLen,
PRUint32 aPos) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIWordBreaker, NS_IWORDBREAKER_IID)

View File

@ -182,31 +182,3 @@ PRInt32 nsSampleWordBreaker::NextWord(
return NS_WORDBREAKER_NEED_MORE_TEXT;
return cur;
}
PRInt32 nsSampleWordBreaker::PrevWord(
const PRUnichar* aText, PRUint32 aLen, PRUint32 aPos)
{
PRInt8 c1, c2;
PRUint32 cur = aPos;
if (cur == aLen) {
if (cur == 0)
return NS_WORDBREAKER_NEED_MORE_TEXT;
--cur;
}
c1 = this->GetClass(aText[cur]);
for(; cur > 0; cur--)
{
c2 = this->GetClass(aText[cur-1]);
if(c2 != c1)
break;
}
if(kWbClassThaiLetter == c1)
{
// need to call Thai word breaker from here
// we should pass the whole Thai segment to the thai word breaker to find a shorter answer
}
if (!cur)
return NS_WORDBREAKER_NEED_MORE_TEXT;
return cur;
}

View File

@ -66,8 +66,6 @@ public:
PRInt32 NextWord(const PRUnichar* aText, PRUint32 aLen, PRUint32 aPos);
PRInt32 PrevWord(const PRUnichar* aText, PRUint32 aLen, PRUint32 aPos);
protected:
PRUint8 GetClass(PRUnichar aChar);
};

View File

@ -43,7 +43,6 @@
*
* nsIUnicodeDecoder
* nsIUnicodeEncoder
* nsICharRepresentable
*/
[uuid(c60097ba-c79d-461b-9116-80a66404c0b0)]
interface nsINativeUConvService : nsISupports

View File

@ -44,7 +44,6 @@
#include "nsIUnicodeDecoder.h"
#include "nsIUnicodeEncoder.h"
#include "nsICharRepresentable.h"
#include "nsNativeUConvService.h"
#include "nsAutoPtr.h"
@ -56,8 +55,7 @@
class IConvAdaptor : public nsIUnicodeDecoder,
public nsIUnicodeEncoder,
public nsICharRepresentable
public nsIUnicodeEncoder
{
public:
IConvAdaptor();
@ -103,8 +101,6 @@ public:
nsIUnicharEncoder * aEncoder,
PRUnichar aChar);
NS_IMETHOD FillInfo(PRUint32* aInfo);
private:
nsresult ConvertInternal(void * aSrc,
@ -124,10 +120,9 @@ private:
#endif
};
NS_IMPL_ISUPPORTS3(IConvAdaptor,
NS_IMPL_ISUPPORTS2(IConvAdaptor,
nsIUnicodeEncoder,
nsIUnicodeDecoder,
nsICharRepresentable)
nsIUnicodeDecoder)
IConvAdaptor::IConvAdaptor()
{
@ -281,16 +276,6 @@ IConvAdaptor::SetOutputErrorBehavior(PRInt32 aBehavior,
return NS_ERROR_FAILURE;
}
nsresult
IConvAdaptor::FillInfo(PRUint32* aInfo)
{
#ifdef DEBUG
printf(" * IConvAdaptor - FillInfo called\n");
#endif
*aInfo = 0;
return NS_OK;
}
nsresult
IConvAdaptor::ConvertInternal(void * aSrc,

View File

@ -39,7 +39,6 @@
#include "nsNativeUConvService.h"
#include "nsIUnicodeDecoder.h"
#include "nsIUnicodeEncoder.h"
#include "nsICharRepresentable.h"
#include "nsIPlatformCharset.h"
#include "nsIServiceManager.h"
@ -74,8 +73,7 @@ void DisplayLastError(const char * msg)
class WinCEUConvAdapter : public nsIUnicodeDecoder,
public nsIUnicodeEncoder,
public nsICharRepresentable
public nsIUnicodeEncoder
{
public:
@ -121,15 +119,12 @@ public:
nsIUnicharEncoder * aEncoder,
PRUnichar aChar);
NS_IMETHOD FillInfo(PRUint32* aInfo);
PRUint32 mCodepage;
};
NS_IMPL_ISUPPORTS3(WinCEUConvAdapter,
NS_IMPL_ISUPPORTS2(WinCEUConvAdapter,
nsIUnicodeDecoder,
nsIUnicodeEncoder,
nsICharRepresentable)
nsIUnicodeEncoder)
WinCEUConvAdapter::WinCEUConvAdapter()
{
@ -401,12 +396,6 @@ WinCEUConvAdapter::SetOutputErrorBehavior(PRInt32 aBehavior,
return NS_OK;
}
NS_IMETHODIMP
WinCEUConvAdapter::FillInfo(PRUint32* aInfo)
{
return NS_OK;
}
// NativeUConvService
NS_IMPL_ISUPPORTS1(NativeUConvService,

View File

@ -49,7 +49,6 @@ EXPORTS = \
nsIPlatformCharset.h \
nsIUnicodeDecoder.h \
nsIUnicodeEncoder.h \
nsICharRepresentable.h \
uconvutil.h \
nsEncoderDecoderUtils.h \
nsUConvCID.h \

View File

@ -1,73 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 Communicator client code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 ***** */
#ifndef nsICharRepresentable_h__
#define nsICharRepresentable_h__
#include "nscore.h"
#include "nsISupports.h"
// {A4D9A521-185A-11d3-B3BD-00805F8A6670}
#define NS_ICHARREPRESENTABLE_IID \
{ 0xa4d9a521, 0x185a, 0x11d3, { 0xb3, 0xbd, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } }
/*
The following two macro have been duplicate in umap.c.
You need to change both place to make it work
*/
#define IS_REPRESENTABLE(info, c) (((info)[(c) >> 5] >> ((c) & 0x1f)) & 1L)
#define SET_REPRESENTABLE(info, c) (info)[(c) >> 5] |= (1L << ((c) & 0x1f))
#define CLEAR_REPRESENTABLE(info, c) (info)[(c) >> 5] &= (~(1L << ((c) & 0x1f)))
// number of PRUint32 in the 64Kbit char map
#define UCS2_MAP_LEN 2048
/**
*/
class nsICharRepresentable : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICHARREPRESENTABLE_IID)
NS_IMETHOD FillInfo(PRUint32* aInfo) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICharRepresentable, NS_ICHARREPRESENTABLE_IID)
#endif /* nsIUnicodeDecoder_h__ */

View File

@ -44,30 +44,6 @@
#define UNICODE_BYTE_ORDER_MARK 0xFEFF
NS_IMETHODIMP NS_NewUTF8ToUnicode(nsISupports* aOuter,
const nsIID& aIID,
void** aResult)
{
if (!aResult) {
return NS_ERROR_NULL_POINTER;
}
if (aOuter) {
*aResult = nsnull;
return NS_ERROR_NO_AGGREGATION;
}
nsUTF8ToUnicode * inst = new nsUTF8ToUnicode();
if (!inst) {
*aResult = nsnull;
return NS_ERROR_OUT_OF_MEMORY;
}
nsresult res = inst->QueryInterface(aIID, aResult);
if (NS_FAILED(res)) {
*aResult = nsnull;
delete inst;
}
return res;
}
//----------------------------------------------------------------------
// Class nsUTF8ToUnicode [implementation]

View File

@ -59,12 +59,6 @@ NS_IMETHODIMP nsUnicodeToUTF8::GetMaxLength(const PRUnichar * aSrc,
return NS_OK;
}
NS_IMETHODIMP nsUnicodeToUTF8::FillInfo(PRUint32 *aInfo)
{
memset(aInfo, 0xFF, (0x10000L >> 3));
return NS_OK;
}
NS_IMETHODIMP nsUnicodeToUTF8::Convert(const PRUnichar * aSrc,
PRInt32 * aSrcLength,
char * aDest,

View File

@ -68,8 +68,6 @@ public:
*/
nsUnicodeToUTF8() {mHighSurrogate = 0;}
NS_IMETHOD FillInfo(PRUint32* aInfo);
NS_IMETHOD Convert(const PRUnichar * aSrc,
PRInt32 * aSrcLength,
char * aDest,

View File

@ -44,7 +44,6 @@
#include "nsISupports.h"
#include "nsICharsetConverterManager.h"
#include "nsIPlatformCharset.h"
#include "nsICharRepresentable.h"
#include "prmem.h"
#include "nsReadableUtils.h"
@ -52,8 +51,6 @@
static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID);
static NS_DEFINE_CID(kPlatformCharsetCID, NS_PLATFORMCHARSET_CID);
//#define TEST_IS_REPRESENTABLE
/**
* Test program for the Unicode Converters.
*
@ -218,20 +215,6 @@ nsresult testEncoder(nsIUnicodeEncoder * aEnc,
return NS_ERROR_UNEXPECTED;
}
#ifdef TEST_IS_REPRESENTABLE
nsICharRepresentable* rp = nsnull;
res = aEnc->QueryInterface(NS_GET_IID(nsICharRepresentable),(void**) &rp);
if(NS_SUCCEEDED(res)) {
PRUint32 *info= (PRUint32*)PR_Calloc((0x10000 >> 5), 4);
rp->FillInfo(info);
for(int i=0;i< 0x10000;i++)
{
if(IS_REPRESENTABLE(info, i))
printf("%4x\n", i);
}
}
#endif
return NS_OK;
}

View File

@ -38,7 +38,6 @@
#include "nsGBKConvUtil.h"
#include "gbku.h"
#include "nsCRT.h"
#include "nsICharRepresentable.h"
#define MAX_GBK_LENGTH 24066 /* (0xfe-0x80)*(0xfe-0x3f) */
//--------------------------------------------------------------------
// nsGBKConvUtil
@ -149,67 +148,3 @@ void nsGBKConvUtil::InitToGBKTable()
}
gInitToGBKTable = PR_TRUE;
}
void nsGBKConvUtil::FillInfo(
PRUint32 *aInfo,
PRUint8 aStart1, PRUint8 aEnd1,
PRUint8 aStart2, PRUint8 aEnd2
)
{
PRUint16 i,j, k;
PRUnichar unicode;
for ( i=aStart1; i<=aEnd1; i++)
{
for( j=aStart2; j<=aEnd2; j++)
{
k = (i - 0x0081)*0x00BF +(j-0x0040);
unicode = gGBKToUnicodeTable[k];
NS_ASSERTION(unicode != 0xFFFF, "somehow the table still use 0xffff");
if (unicode != UCS2_NO_MAPPING)
{
SET_REPRESENTABLE(aInfo, unicode);
}
}
}
}
void nsGBKConvUtil::FillGB2312Info(
PRUint32 *aInfo
)
{
// The following range is coded by looking at the GB2312 standard
// and make sure we do not call FillInfo for undefined code point
// Symbol
// row 1 - 1 range (full)
FillInfo(aInfo, 0x21|0x80, 0x21|0x80, 0x21|0x80, 0x7E|0x80);
// row 2 - 3 range
FillInfo(aInfo, 0x22|0x80, 0x22|0x80, (0x20+17)|0x80, (0x20+66)|0x80);
FillInfo(aInfo, 0x22|0x80, 0x22|0x80, (0x20+69)|0x80, (0x20+78)|0x80);
FillInfo(aInfo, 0x22|0x80, 0x22|0x80, (0x20+81)|0x80, (0x20+92)|0x80);
// row 3 - 1 range (full)
FillInfo(aInfo, 0x23|0x80, 0x23|0x80, 0x21|0x80, 0x7E|0x80);
// row 4 - 1 range
FillInfo(aInfo, 0x24|0x80, 0x24|0x80, (0x20+ 1)|0x80, (0x20+83)|0x80);
// row 5 - 1 range
FillInfo(aInfo, 0x25|0x80, 0x25|0x80, (0x20+ 1)|0x80, (0x20+86)|0x80);
// row 6 - 2 range
FillInfo(aInfo, 0x26|0x80, 0x26|0x80, (0x20+ 1)|0x80, (0x20+24)|0x80);
FillInfo(aInfo, 0x26|0x80, 0x26|0x80, (0x20+33)|0x80, (0x20+56)|0x80);
// row 7
FillInfo(aInfo, 0x27|0x80, 0x27|0x80, (0x20+ 1)|0x80, (0x20+33)|0x80);
FillInfo(aInfo, 0x27|0x80, 0x27|0x80, (0x20+49)|0x80, (0x20+81)|0x80);
// row 8
FillInfo(aInfo, 0x28|0x80, 0x28|0x80, (0x20+ 1)|0x80, (0x20+26)|0x80);
FillInfo(aInfo, 0x28|0x80, 0x28|0x80, (0x20+36)|0x80, (0x20+73)|0x80);
// row 9
FillInfo(aInfo, 0x29|0x80, 0x29|0x80, (0x20+ 4)|0x80, (0x20+79)|0x80);
// Frequent used Hanzi
// 3021-567e
FillInfo(aInfo, 0x30|0x80, 0x56|0x80, 0x21|0x80, 0x7E|0x80);
// 5721-5779
FillInfo(aInfo, 0x57|0x80, 0x57|0x80, 0x21|0x80, 0x79|0x80);
// Infrequent used Hanzi
// 5821-777e
FillInfo(aInfo, 0x58|0x80, 0x77|0x80, 0x21|0x80, 0x7E|0x80);
}

View File

@ -46,8 +46,5 @@ public:
PRUnichar GBKCharToUnicode(char aByte1, char aByte2);
PRBool UnicodeToGBKChar(PRUnichar aChar, PRBool aToGL,
char* aOutByte1, char* aOutByte2);
void FillInfo(PRUint32 *aInfo, PRUint8 aStart1, PRUint8 aEnd1,
PRUint8 aStart2, PRUint8 aEnd2);
void FillGB2312Info(PRUint32 *aInfo);
};
#endif /* nsGBKConvUtil_h__ */

View File

@ -37,7 +37,6 @@
* ***** END LICENSE BLOCK ***** */
#include "nsUnicodeToGB2312V2.h"
#include "nsICharRepresentable.h"
#include "nsUCvCnDll.h"
#include "gbku.h"
@ -99,15 +98,3 @@ NS_IMETHODIMP nsUnicodeToGB2312V2::ConvertNoBuff(const PRUnichar * aSrc,
*aSrcLength = iSrcLength;
return res;
}
//----------------------------------------------------------------------
// Subclassing of nsTableEncoderSupport class [implementation]
NS_IMETHODIMP nsUnicodeToGB2312V2::FillInfo(PRUint32 *aInfo)
{
mUtil.FillGB2312Info(aInfo);
//GB2312 font lib also have single byte ASCII characters, set them here
for ( PRUint16 u = 0x0000; u <= 0x007F; u++)
SET_REPRESENTABLE(aInfo, u);
return NS_OK;
}

View File

@ -75,7 +75,6 @@ protected:
return NS_OK;
} // just make it not abstract;
NS_IMETHOD FillInfo(PRUint32 *aInfo);
protected:
nsGBKConvUtil mUtil;
};

View File

@ -46,7 +46,6 @@
*/
#include "nsUnicodeToGBK.h"
#include "nsICharRepresentable.h"
#include "nsUCvCnDll.h"
#include "gbku.h"
#include "uconvutil.h"
@ -343,32 +342,3 @@ NS_IMETHODIMP nsUnicodeToGBK::ConvertNoBuff(
*aSrcLength = iSrcLength;
return res;
}
//----------------------------------------------------------------------
// Subclassing of nsTableEncoderSupport class [implementation]
NS_IMETHODIMP nsUnicodeToGBK::FillInfo(PRUint32 *aInfo)
{
mUtil.FillInfo(aInfo, 0x81, 0xFE, 0x40, 0xFE);
if(! mExtensionEncoder )
CreateExtensionEncoder();
if(mExtensionEncoder)
{
nsCOMPtr<nsICharRepresentable> aRep = do_QueryInterface(mExtensionEncoder);
aRep->FillInfo(aInfo);
}
if(! m4BytesEncoder )
Create4BytesEncoder();
if(m4BytesEncoder)
{
nsCOMPtr<nsICharRepresentable> aRep = do_QueryInterface(m4BytesEncoder);
aRep->FillInfo(aInfo);
}
//GBK font lib also have single byte ASCII characters, set them here
for (PRUint16 SrcUnicode = 0x0000; SrcUnicode <= 0x007F; SrcUnicode++)
SET_REPRESENTABLE(aInfo, SrcUnicode);
SET_REPRESENTABLE(aInfo, 0x20ac); // euro
return NS_OK;
}

View File

@ -78,8 +78,6 @@ protected:
return NS_OK;
} // just make it not abstract;
NS_IMETHOD FillInfo(PRUint32 *aInfo);
virtual void CreateExtensionEncoder();
virtual void Create4BytesEncoder();

View File

@ -148,12 +148,3 @@ NS_IMETHODIMP nsUnicodeToHZ::FinishNoBuff(char * aDest, PRInt32 * aDestLength)
}
return NS_OK;
}
NS_IMETHODIMP nsUnicodeToHZ::FillInfo(PRUint32 *aInfo)
{
mUtil.FillGB2312Info(aInfo);
//GB2312 font lib also have single byte ASCII characters, set them here
for ( PRUint16 u = 0x0000; u <= 0x007F; u++)
SET_REPRESENTABLE(aInfo, u);
return NS_OK;
}

View File

@ -71,8 +71,6 @@ protected:
NS_IMETHOD FinishNoBuff(char * aDest, PRInt32 * aDestLength);
NS_IMETHOD FillInfo(PRUint32 *aInfo);
NS_IMETHOD ConvertNoBuffNoErr(const PRUnichar * aSrc, PRInt32 * aSrcLength,
char * aDest, PRInt32 * aDestLength)
{

View File

@ -228,12 +228,6 @@ nsresult nsUnicodeToISO2022JP::ConvertHankaku(const PRUnichar * aSrc,
//----------------------------------------------------------------------
// Subclassing of nsTableEncoderSupport class [implementation]
NS_IMETHODIMP nsUnicodeToISO2022JP::FillInfo(PRUint32* aInfo)
{
return nsUnicodeEncodeHelper::FillInfo(aInfo, SIZE_OF_TABLES,
(uMappingTable **) g_ufMappingTables);
}
NS_IMETHODIMP nsUnicodeToISO2022JP::ConvertNoBuffNoErr(
const PRUnichar * aSrc,
PRInt32 * aSrcLength,

View File

@ -79,7 +79,6 @@ protected:
char * aDest, PRInt32 * aDestLength);
NS_IMETHOD FinishNoBuff(char * aDest, PRInt32 * aDestLength);
NS_IMETHOD Reset();
NS_IMETHOD FillInfo(PRUint32 *aInfo);
};
#endif /* nsUnicodeToISO2022JP_h___ */

View File

@ -58,7 +58,6 @@
#include "nsIUnicodeDecoder.h"
#include "nsServiceManagerUtils.h"
#include "nsICharsetConverterManager.h"
#include "nsICharRepresentable.h"
#include <string.h>
typedef struct {
@ -133,33 +132,25 @@ typedef struct {
#define UP_VBASE 0xE300 // 0xE300 = Vfill, 0xE302 = Ah
#define UP_TBASE 0xE404 // 0xE400 = Tfill, 0xE404 = Kiyeok
// EUC-KR decoder for FillInfo.
static nsCOMPtr<nsIUnicodeDecoder> gDecoder = 0;
static inline void FillInfoRange (PRUint32* aInfo, PRUint32 aStart,
PRUint32 aEnd);
static nsresult JamoNormalize (const PRUnichar* aInSeq,
PRUnichar** aOutSeq, PRInt32* aLength);
static void JamosToExtJamos (PRUnichar* aInSeq, PRInt32* aLength);
static const JamoNormMap* JamoClusterSearch(JamoNormMap aKey,
const JamoNormMap* aClusters,
PRInt16 aClustersSize);
static nsresult FillInfoEUCKR (PRUint32 *aInfo, PRUint16 aHigh1,
PRUint16 aHigh2);
static PRInt32 JamoNormMapComp (const JamoNormMap& p1,
const JamoNormMap& p2);
static PRInt16 JamoSrchReplace (const JamoNormMap* aCluster,
PRUint16 aSize, PRUnichar *aIn,
PRInt32* aLength, PRUint16 aOffset);
static nsresult GetDecoder (nsIUnicodeDecoder** aDecoder);
static nsresult ScanDecomposeSyllable (PRUnichar *aIn, PRInt32* aLength,
const PRInt32 aMaxLen);
//----------------------------------------------------------------------
// Class nsUnicodeToJamoTTF [implementation]
NS_IMPL_ISUPPORTS2(nsUnicodeToJamoTTF, nsIUnicodeEncoder, nsICharRepresentable)
NS_IMPL_ISUPPORTS1(nsUnicodeToJamoTTF, nsIUnicodeEncoder)
NS_IMETHODIMP
nsUnicodeToJamoTTF::SetOutputErrorBehavior(PRInt32 aBehavior,
@ -338,50 +329,6 @@ nsUnicodeToJamoTTF::GetMaxLength(const PRUnichar * aSrc, PRInt32 aSrcLength,
return NS_OK;
}
NS_IMETHODIMP
nsUnicodeToJamoTTF::FillInfo(PRUint32* aInfo)
{
FillInfoRange(aInfo, SBASE, SEND);
PRUnichar i;
// Hangul Conjoining Jamos
for(i = 0x1100; i<= 0x1159; i++)
SET_REPRESENTABLE(aInfo, i);
SET_REPRESENTABLE(aInfo, 0x115f);
for(i = 0x1160; i <= 0x11a2; i++)
SET_REPRESENTABLE(aInfo, i);
for(i = 0x11a8; i <= 0x11f9; i++)
SET_REPRESENTABLE(aInfo, i);
// Hangul Tone marks
SET_REPRESENTABLE(aInfo, HTONE1);
SET_REPRESENTABLE(aInfo, HTONE2);
// UnPark fonts have US-ASCII chars.
for(i=0x20; i < 0x7f; i++)
SET_REPRESENTABLE(aInfo, i);
nsresult rv;
// UnPark fonts have Hanjas and symbols defined in KS X 1001 as well.
// XXX: Do we need to exclude Cyrillic, Greek letters and some Latin letters
// included in KS X 1001 as 'symbol characters'?
// KS X 1001 has only a subset of Greek and Cyrillic alphabets and
// Latin letters with diacritic marks so that including them may
// result in ransom-note like effect if it is listed *before*
// any genuine Greek/Russian/Latin fonts in CSS.
// Lead byte range for symbol chars. in EUC-KR : 0xA1 - 0xAF
rv = FillInfoEUCKR(aInfo, 0xA1, 0xAF);
NS_ENSURE_SUCCESS(rv, rv);
// Lead byte range for Hanja in EUC-KR : 0xCA - 0xFD.
return FillInfoEUCKR(aInfo, 0xCA, 0xFD);
}
/**
* Copied from mslvt.otp by Jin-Hwan Cho <chofchof@ktug.or.kr>.
* Extended by Jungshik Shin <jshin@mailaps.org> to support
@ -684,89 +631,6 @@ nsUnicodeToJamoTTF::RenderAsPrecompSyllable (PRUnichar* aSrc,
return composed;
}
// Fill up Cmap array quickly for a rather large range.
/* static */
inline void FillInfoRange(PRUint32* aInfo, PRUint32 aStart, PRUint32 aEnd)
{
PRUint32 b = aStart >> 5;
PRUint32 e = aEnd >> 5;
if (aStart & 0x1f)
aInfo[b++] |= ~ (0xFFFFFFFFL >> (32 - ((aStart) & 0x1f)));
for( ; b < e ; b++)
aInfo[b] |= 0xFFFFFFFFL;
aInfo[e] |= (0xFFFFFFFFL >> (31 - ((aEnd) & 0x1f)));
}
#define ROWLEN 94
#define IS_GR94(x) (0xA0 < (x) && (x) < 0xFF)
// Given a range [aHigh1, aHigh2] in high bytes of EUC-KR, convert
// rows of 94 characters in the range (row by row) to Unicode and set
// representability if the result is not 0xFFFD (Unicode replacement char.).
/* static */
nsresult FillInfoEUCKR (PRUint32 *aInfo, PRUint16 aHigh1, PRUint16 aHigh2)
{
char row[ROWLEN * 2];
PRUnichar dest[ROWLEN];
nsresult rv = NS_OK;
NS_ENSURE_TRUE(aInfo, NS_ERROR_NULL_POINTER);
NS_ENSURE_TRUE(IS_GR94(aHigh1) && IS_GR94(aHigh2), NS_ERROR_INVALID_ARG);
nsCOMPtr<nsIUnicodeDecoder> decoder;
rv = GetDecoder(getter_AddRefs(decoder));
NS_ENSURE_SUCCESS(rv,rv);
for (PRUint16 i = aHigh1 ; i <= aHigh2; i++)
{
PRUint16 j;
// handle a row of 94 char. at a time.
for (j = 0 ; j < ROWLEN; j++)
{
row[j * 2] = char(i);
row[j * 2 + 1] = char(j + 0xa1);
}
PRInt32 srcLen = ROWLEN * 2;
PRInt32 destLen = ROWLEN;
rv = decoder->Convert(row, &srcLen, dest, &destLen);
NS_ENSURE_SUCCESS(rv, rv);
// set representability according to the conversion result.
for (j = 0 ; j < ROWLEN; j++)
if (dest[j] != 0xFFFD)
SET_REPRESENTABLE(aInfo, dest[j]);
}
return rv;
}
/* static */
nsresult GetDecoder(nsIUnicodeDecoder** aDecoder)
{
nsresult rv;
if (gDecoder) {
*aDecoder = gDecoder.get();
NS_ADDREF(*aDecoder);
return NS_OK;
}
nsCOMPtr<nsICharsetConverterManager> charsetConverterManager;
charsetConverterManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
rv = charsetConverterManager->GetUnicodeDecoderRaw("EUC-KR", getter_AddRefs(gDecoder));
NS_ENSURE_SUCCESS(rv,rv);
*aDecoder = gDecoder.get();
NS_ADDREF(*aDecoder);
return NS_OK;
}
/* static */
PRInt32 JamoNormMapComp (const JamoNormMap& p1, const JamoNormMap& p2)
{

View File

@ -46,7 +46,7 @@
//----------------------------------------------------------------------
// Class nsUnicodeToJamoTTF [declaration]
class nsUnicodeToJamoTTF : public nsIUnicodeEncoder, public nsICharRepresentable
class nsUnicodeToJamoTTF : public nsIUnicodeEncoder
{
NS_DECL_ISUPPORTS
@ -76,8 +76,6 @@ public:
PRInt32 aBehavior,
nsIUnicharEncoder * aEncoder, PRUnichar aChar);
NS_IMETHOD FillInfo(PRUint32* aInfo);
protected:
PRUnichar *mJamos;
PRUnichar mJamosStatic[9];

View File

@ -55,9 +55,9 @@
//----------------------------------------------------------------------
// Class nsUnicodeToTSCII [implementation]
NS_IMPL_ISUPPORTS2(nsUnicodeToTSCII, nsIUnicodeEncoder, nsICharRepresentable)
NS_IMPL_ISUPPORTS1(nsUnicodeToTSCII, nsIUnicodeEncoder)
/*
* During UCS-4 to TSCII conversion, mState contains
* the last byte (or sometimes the last two bytes) to be output.
@ -389,47 +389,6 @@ nsUnicodeToTSCII::GetMaxLength(const PRUnichar * aSrc, PRInt32 aSrcLength,
}
NS_IMETHODIMP
nsUnicodeToTSCII::FillInfo(PRUint32* aInfo)
{
// Tamil block is so sparse.
static const PRUint8 coverage[] = {
0xe8, // 11101000 U+0B87 - U+0B80
0xc7, // 11000111 U+0B8F - U+0B88
0x3d, // 00111101 U+0B97 - U+0B90
0xd6, // 11010110 U+0B9F - U+0B98
0x18, // 00011000 U+0BA7 - U+0BA0
0xc7, // 11000111 U+0BAF - U+0BA8
0xbf, // 10111111 U+0BB7 - U+0BB0
0xc7, // 11000111 U+0BBF - U+0BB8
0xc7, // 11000111 U+0BC7 - U+0BC0
0x3d, // 00111101 U+0BCF - U+0BC8
0x80, // 10000000 U+0BD7 - U+0BD0
0x00, // 00000000 U+0BDF - U+0BD8
0x80, // 10000000 U+0BE7 - U+0BE0
0xff, // 11111111 U+0BEF - U+0BE8
0x07, // 00000111 U+0BF7 - U+0BF0
};
PRUnichar i;
for(i = 0; i < 0x78; i++)
if (coverage[i / 8] & (1 << (i % 8)))
SET_REPRESENTABLE(aInfo, i + UNI_TAMIL_START);
// TSCII is a superset of US-ASCII.
for(i = 0x20; i < 0x7f; i++)
SET_REPRESENTABLE(aInfo, i);
// additional characters in TSCII
SET_REPRESENTABLE(aInfo, 0xA9); // copyright sign
SET_REPRESENTABLE(aInfo, UNI_LEFT_SINGLE_QUOTE);
SET_REPRESENTABLE(aInfo, UNI_RIGHT_SINGLE_QUOTE);
SET_REPRESENTABLE(aInfo, UNI_LEFT_DOUBLE_QUOTE);
SET_REPRESENTABLE(aInfo, UNI_RIGHT_DOUBLE_QUOTE);
return NS_OK;
}
NS_IMETHODIMP
nsUnicodeToTSCII::SetOutputErrorBehavior(PRInt32 aBehavior,
nsIUnicharEncoder *aEncoder,

View File

@ -44,12 +44,11 @@
#include "nsCOMPtr.h"
#include "nsISupports.h"
#include "nsIUnicodeEncoder.h"
#include "nsICharRepresentable.h"
//----------------------------------------------------------------------
// Class nsUnicodeToTSCII [declaration]
class nsUnicodeToTSCII : public nsIUnicodeEncoder, public nsICharRepresentable
class nsUnicodeToTSCII : public nsIUnicodeEncoder
{
NS_DECL_ISUPPORTS
@ -72,8 +71,6 @@ public:
nsIUnicharEncoder * aEncoder,
PRUnichar aChar);
NS_IMETHOD FillInfo(PRUint32* aInfo);
private:
PRUint32 mBuffer; // buffer for character(s) to be combined with the following
// character. Up to 4 single byte characters can be

View File

@ -127,12 +127,6 @@ NS_IMETHODIMP nsUnicodeToUTF16BE::SetOutputErrorBehavior(PRInt32 aBehavior,
return NS_OK;
}
NS_IMETHODIMP nsUnicodeToUTF16BE::FillInfo(PRUint32 *aInfo)
{
::memset(aInfo, 0xFF, (0x10000L >> 3));
return NS_OK;
}
NS_IMETHODIMP nsUnicodeToUTF16BE::CopyData(char* aDest, const PRUnichar* aSrc, PRInt32 aLen )
{
#ifdef IS_BIG_ENDIAN

View File

@ -57,10 +57,6 @@ public:
NS_IMETHOD SetOutputErrorBehavior(PRInt32 aBehavior,
nsIUnicharEncoder * aEncoder, PRUnichar aChar);
//--------------------------------------------------------------------
// Interface nsICharRepresentable [declaration]
NS_IMETHOD FillInfo(PRUint32 *aInfo);
protected:
PRUnichar mBOM;
NS_IMETHOD CopyData(char* aDest, const PRUnichar* aSrc, PRInt32 aLen );

View File

@ -221,12 +221,6 @@ NS_IMETHODIMP nsUnicodeToUTF32Base::GetMaxLength(const PRUnichar * aSrc,
return NS_OK;
}
NS_IMETHODIMP nsUnicodeToUTF32Base::FillInfo(PRUint32 *aInfo)
{
memset(aInfo, 0xFF, (0x10000L >> 3));
return NS_OK;
}
//----------------------------------------------------------------------
// Class nsUnicodeToUTF32BE [implementation]

View File

@ -72,7 +72,6 @@ protected:
// Subclassing of nsIUnicodeEncoder class [declaration]
NS_IMETHOD Reset() {mBOM = 0; mHighSurrogate = 0; return NS_OK;}
NS_IMETHOD FillInfo(PRUint32* aInfo);
NS_IMETHOD SetOutputErrorBehavior(PRInt32 aBehavior,
nsIUnicharEncoder * aEncoder,
PRUnichar aChar)

View File

@ -55,12 +55,6 @@ nsBasicUTF7Encoder::nsBasicUTF7Encoder(char aLastChar, char aEscChar)
Reset();
}
NS_IMETHODIMP nsBasicUTF7Encoder::FillInfo(PRUint32 *aInfo)
{
memset(aInfo, 0xFF, (0x10000L >> 3));
return NS_OK;
}
nsresult nsBasicUTF7Encoder::ShiftEncoding(PRInt32 aEncoding,
char * aDest,
PRInt32 * aDestLength)

View File

@ -58,8 +58,6 @@ public:
*/
nsBasicUTF7Encoder(char aLastChar, char aEscChar);
NS_IMETHOD FillInfo(PRUint32 *aInfo);
protected:
PRInt32 mEncoding; // current encoding

View File

@ -41,7 +41,6 @@
#include "nsIUnicodeEncoder.h"
#include "nsIUnicodeDecoder.h"
#include "uconvutil.h"
#include "nsICharRepresentable.h"
// all the useful constructors
NS_METHOD

View File

@ -38,7 +38,6 @@
#include "pratom.h"
#include "nsIComponentManager.h"
#include "nsICharRepresentable.h"
#include "nsUCSupport.h"
#include "nsUnicodeDecodeHelper.h"
#include "nsUnicodeEncodeHelper.h"
@ -113,15 +112,6 @@ void nsBufferDecoderSupport::FillBuffer(const char ** aSrc, PRInt32 aSrcLength)
(*aSrc) += bcr;
}
void nsBufferDecoderSupport::DoubleBuffer()
{
mBufferCapacity *= 2;
char * newBuffer = new char [mBufferCapacity];
if (mBufferLength > 0) memcpy(newBuffer, mBuffer, mBufferLength);
delete [] mBuffer;
mBuffer = newBuffer;
}
//----------------------------------------------------------------------
// Subclassing of nsBasicDecoderSupport class [implementation]
@ -376,13 +366,12 @@ nsBasicEncoder::~nsBasicEncoder()
NS_IMPL_ADDREF(nsBasicEncoder)
NS_IMPL_RELEASE(nsBasicEncoder)
#ifdef NS_DEBUG
NS_IMPL_QUERY_INTERFACE3(nsBasicEncoder,
nsIUnicodeEncoder,
nsICharRepresentable, nsIBasicEncoder)
#else
NS_IMPL_QUERY_INTERFACE2(nsBasicEncoder,
nsIUnicodeEncoder,
nsICharRepresentable)
nsIBasicEncoder)
#else
NS_IMPL_QUERY_INTERFACE1(nsBasicEncoder,
nsIUnicodeEncoder)
#endif
//----------------------------------------------------------------------
// Class nsEncoderSupport [implementation]
@ -629,10 +618,6 @@ nsTableEncoderSupport::~nsTableEncoderSupport()
{
}
NS_IMETHODIMP nsTableEncoderSupport::FillInfo(PRUint32 *aInfo)
{
return nsUnicodeEncodeHelper::FillInfo(aInfo, mMappingTable);
}
//----------------------------------------------------------------------
// Subclassing of nsEncoderSupport class [implementation]
@ -669,10 +654,6 @@ nsMultiTableEncoderSupport::~nsMultiTableEncoderSupport()
{
}
NS_IMETHODIMP nsMultiTableEncoderSupport::FillInfo(PRUint32 *aInfo)
{
return nsUnicodeEncodeHelper::FillInfo(aInfo,mTableCount, mMappingTable);
}
//----------------------------------------------------------------------
// Subclassing of nsEncoderSupport class [implementation]

View File

@ -41,7 +41,6 @@
#include "nsCOMPtr.h"
#include "nsIUnicodeEncoder.h"
#include "nsIUnicodeDecoder.h"
#include "nsICharRepresentable.h"
#include "uconvutil.h"
#include "mozilla/Mutex.h"
@ -151,7 +150,6 @@ protected:
PRUnichar * aDest, PRInt32 * aDestLength) = 0;
void FillBuffer(const char ** aSrc, PRInt32 aSrcLength);
void DoubleBuffer();
public:
@ -296,7 +294,7 @@ protected:
//----------------------------------------------------------------------
// Class nsBasicEncoder [declaration]
class nsBasicEncoder : public nsIUnicodeEncoder, public nsICharRepresentable
class nsBasicEncoder : public nsIUnicodeEncoder
#ifdef NS_DEBUG
,public nsIBasicEncoder
#endif
@ -398,10 +396,6 @@ public:
NS_IMETHOD GetMaxLength(const PRUnichar * aSrc,
PRInt32 aSrcLength,
PRInt32 * aDestLength);
//--------------------------------------------------------------------
// Interface nsICharRepresentable [declaration]
NS_IMETHOD FillInfo(PRUint32 *aInfo) = 0;
};
//----------------------------------------------------------------------
@ -433,7 +427,6 @@ public:
* Class destructor.
*/
virtual ~nsTableEncoderSupport();
NS_IMETHOD FillInfo( PRUint32 *aInfo);
protected:
@ -474,7 +467,6 @@ public:
* Class destructor.
*/
virtual ~nsMultiTableEncoderSupport();
NS_IMETHOD FillInfo( PRUint32 *aInfo);
protected:

View File

@ -152,16 +152,3 @@ nsresult nsUnicodeEncodeHelper::ConvertByMultiTable(
*aDestLength = dest - aDest;
return res;
}
nsresult nsUnicodeEncodeHelper::FillInfo(PRUint32 *aInfo, uMappingTable * aMappingTable)
{
uFillInfo((uTable*) aMappingTable, aInfo);
return NS_OK;
}
nsresult nsUnicodeEncodeHelper::FillInfo(PRUint32 *aInfo, PRInt32 aTableCount, uMappingTable ** aMappingTable)
{
for (PRInt32 i=0; i<aTableCount; i++)
uFillInfo((uTable*) aMappingTable[i], aInfo);
return NS_OK;
}

View File

@ -67,12 +67,6 @@ public:
char * aDest, PRInt32 * aDestLength, PRInt32 aTableCount,
uScanClassID * aScanClassArray,
uShiftOutTable ** aShiftOutTable, uMappingTable ** aMappingTable);
/**
* Create Char Representable Info
*/
static nsresult FillInfo(PRUint32* aInfo, uMappingTable * aMappingTable);
static nsresult FillInfo(PRUint32* aInfo, PRInt32 aTableCount, uMappingTable ** aMappingTable);
};
#endif // nsUnicodeEncodeHelper_h__

View File

@ -90,27 +90,11 @@ PRIVATE const HitFormateFunc m_hit[uNumFormatTag] =
#define uHit(format,in,cell) (* m_hit[(format)])((in),(cell))
#define uMap(format,in,uT,cell) (* m_map[(format)])((in),(uT),(cell))
#define uFillInfoCell(format,uT,cell,info) (* m_fillinfo[(format)])((uT),(cell),(info))
#define uGetMapCell(uT, item) ((uMapCell *)(((PRUint16 *)uT) + (uT)->offsetToMapCellArray + (item)*(UMAPCELL_SIZE/sizeof(PRUint16))))
#define uGetFormat(uT, item) (((((PRUint16 *)uT) + (uT)->offsetToFormatArray)[(item)>> 2 ] >> (((item)% 4 ) << 2)) & 0x0f)
/*=================================================================================
=================================================================================*/
MODULE_PRIVATE void uFillInfo(const uTable *uT, PRUint32* aInfo)
{
PRUint16 itemOfList = uT->itemOfList;
PRUint16 i;
for(i=0;i<itemOfList;i++)
{
const uMapCell* uCell;
PRInt8 format = uGetFormat(uT,i);
uCell = uGetMapCell(uT,i);
uFillInfoCell(format, uT, uCell, aInfo);
}
}
/*=================================================================================
=================================================================================*/
MODULE_PRIVATE PRBool uMapCode(const uTable *uT, PRUint16 in, PRUint16* out)
{

View File

@ -45,9 +45,6 @@
extern "C" {
#endif
void uFillInfo(const uTable *uT,
PRUint32 *info);
PRBool uMapCode(const uTable *uT,
PRUint16 in,
PRUint16* out);

View File

@ -67,10 +67,6 @@ public:
// Convert an array of Unicode characters into lower case
NS_IMETHOD ToLower( const PRUnichar* anArray, PRUnichar* aReturn, PRUint32 aLen) = 0;
// Convert an array of Unicode characters into title case
NS_IMETHOD ToTitle( const PRUnichar* anArray, PRUnichar* aReturn,
PRUint32 aLen, PRBool aStartInWordBundary=PR_TRUE) = 0;
// case-insensitive PRUnichar* comparison - aResult returns similar
// to strcasecmp
NS_IMETHOD CaseInsensitiveCompare(const PRUnichar* aLeft, const PRUnichar* aRight, PRUint32 aLength, PRInt32* aResult) = 0;

View File

@ -310,48 +310,6 @@ nsresult nsCaseConversionImp2::ToLower(
}
nsresult nsCaseConversionImp2::ToTitle(
const PRUnichar* anArray, PRUnichar* aReturn, PRUint32 aLen,
PRBool aStartInWordBoundary
)
{
if(0 == aLen)
return NS_OK;
//
// We need to replace this implementation to a real one
// Currently, it only do the right thing for ASCII
// Howerver, we need a word breaker to do the right job
//
// this->ToLower(anArray, aReturn, aLen);
// CSS define Capitalize as
// Uppercases the first character of each word
//
PRBool bLastIsSpace = IS_ASCII_SPACE(anArray[0]);
if(aStartInWordBoundary)
{
this->ToTitle(anArray[0], &aReturn[0]);
}
PRUint32 i;
for(i=1;i<aLen;i++)
{
if(bLastIsSpace)
{
this->ToTitle(anArray[i], &aReturn[i]);
}
else
{
aReturn[i] = anArray[i];
}
bLastIsSpace = IS_ASCII_SPACE(aReturn[i]);
}
return NS_OK;
}
// implementation moved from the old nsCRT routine
NS_IMETHODIMP
nsCaseConversionImp2::CaseInsensitiveCompare(const PRUnichar *aLeft,

View File

@ -61,9 +61,6 @@ public:
NS_IMETHOD ToLower(const PRUnichar* anArray, PRUnichar* aReturn, PRUint32 aLen);
NS_IMETHOD ToTitle(const PRUnichar* anArray, PRUnichar* aReturn,
PRUint32 aLen, PRBool aStartInWordBoundary = PR_TRUE);
NS_IMETHOD CaseInsensitiveCompare(const PRUnichar* aLeft, const PRUnichar* aRight, PRUint32 aLength, PRInt32 *aResult);
};

View File

@ -277,15 +277,3 @@ nsEntityConverter::ConvertToEntities(const PRUnichar *inString, PRUint32 entityV
return NS_OK;
}
nsresult NS_NewEntityConverter(nsISupports** oResult)
{
if(!oResult)
return NS_ERROR_NULL_POINTER;
*oResult = new nsEntityConverter();
if(*oResult)
NS_ADDREF(*oResult);
return (*oResult) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}

View File

@ -40,8 +40,6 @@
#include "nsIStringBundle.h"
#include "nsCOMPtr.h"
nsresult NS_NewEntityConverter(nsISupports** oResult);
#define kVERSION_STRING_LEN 128
class nsEntityVersionList

View File

@ -396,16 +396,3 @@ const char * nsSaveAsCharset::GetNextCharset()
// bump the index and return the next charset
return mCharsetList[++mCharsetListIndex].get();
}
/////////////////////////////////////////////////////////////////////////////////////////
nsresult
NS_NewSaveAsCharset(nsISupports **inst)
{
if(nsnull == inst )
return NS_ERROR_NULL_POINTER;
*inst = (nsISupports *) new nsSaveAsCharset;
if(*inst)
NS_ADDREF(*inst);
return (*inst) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}

View File

@ -100,6 +100,3 @@ protected:
PRInt32 mCharsetListIndex;
};
nsresult NS_NewSaveAsCharset(nsISupports **inst);

View File

@ -376,29 +376,6 @@ void TestCaseConversion()
}
}
/*
* It would be pointless to test ToTitle() with the whole buffer, since
* the expected result would be that only the first character would be
* transformed. Instead, pass a series of 2-character buffers starting
* with each character of the test cases, and check that the first
* character is transformed as expected and the second remains unchanged
*/
printf("Test 7 - ToTitle(PRUnichar*, PRUnichar*, PRUint32):\n");
for (i = 0; i < T4LEN; i++)
{
PRUnichar* titleTest = t4data + i;
res = t->ToTitle(titleTest, buf, 2);
if(NS_FAILED(res)) {
printf("\tFailed!! return value != NS_OK\n");
} else {
if (buf[0] != t4result[i] || buf[1] != t4data[i + 1])
{
printf("\tFailed!! result unexpected %d\n", i);
break;
}
}
}
NS_RELEASE(t);
}
printf("==============================\n");

View File

@ -1,177 +0,0 @@
#!/usr/local/bin/perl
#
# ***** 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 IBM code.
#
# The Initial Developer of the Original Code is
# IBM.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Simon Montagu
#
# Alternatively, the contents of this file may be used under the terms of
# either of 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 *****
# This program generates the header file symmtable.h from the Unicode
# informative data file BidiMirroring.txt.
# See the comments in that file for details of its structure and contents.
#
# At the moment we only handle cases where there is another Unicode
# character whose glyph can serve as at least an adequate version of
# the mirror image of the original character's glyph. This leaves open
# the problem of how to provide mirrored glyphs for characters where
# this is not the case.
# Process the input file
$ucp = "[0-9a-fA-F]{4}"; # Unicode code point (4 successive hex digits) as a pattern to match
open ( UNICODATA , "< BidiMirroring.txt")
|| die "Cannot find BidiMirroring.txt.\
The file should be avaiable here:\
http://www.unicode.org/Public/UNIDATA/BidiMirroring.txt\n";
while (<UNICODATA>) {
chop;
if (/^($ucp); ($ucp) # (.+)/) { # If the line looks like this pattern
# (example: 0028; 0029 # LEFT PARENTHESIS)
if (hex($1) > 0xFFFF) {
printf "ALERT! %X There are now symmetric characters outside the BMP\n", $1;
}
@table[hex($1)]=hex($2); # Enter the symmetric pair in the table
@isblock[hex(substr($1, 0, 2))]=1; # Remember this block
}
}
close(UNICODATA);
# Generate license and header
open ( OUT , "> symmtable.h")
|| die "cannot open output symmtable.h file";
$npl = <<END_OF_NPL;
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** 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 IBM code.
*
* The Initial Developer of the Original Code is
* International Business Machines Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* 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 ***** */
/*
DO NOT EDIT THIS DOCUMENT !!! THIS DOCUMENT IS GENERATED BY
mozilla/intl/unicharutil/util/gensymmtable.pl
*/
END_OF_NPL
print OUT $npl;
# Generate data tables
$indexed_blocks = 0;
printf OUT "\n/* Indexes to symmtable by Unicode block */\n";
printf OUT "const static PRUint8 symmtable_index[256] = {\n";
print OUT "/* ";
foreach $byte (0 .. 0xf) {
printf OUT "_%X ", $byte;
}
print OUT "*/\n";
foreach $row (0 .. 0xf) {
printf OUT "/* %X_ */ ", $row;
foreach $byte (0 .. 0xf) {
if (@isblock[($row << 4) | ($byte)]) {
printf OUT " %d,", ++$indexed_blocks;
} else {
printf OUT " 0,";
}
}
print OUT "\n";
}
print OUT "};\n";
printf OUT "const static PRUint16 symmtable[%d] [256] = {\n", ($indexed_blocks);
foreach $block (0 .. 0xff) {
if (@isblock[$block]) {
if ($block != 0) {
printf OUT ",\n"
}
printf OUT " {\n/* Block U%02X__ */\n", $block;
print OUT "/* ";
foreach $byte (0 .. 0xf) {
printf OUT " _%X ", $byte;
}
print OUT "*/\n";
foreach $row (0 .. 0xf) {
printf OUT "/* %X_ */ ", $row;
foreach $byte (0 .. 0xf) {
$ix = ($block << 8) | ($row << 4) | ($byte);
printf OUT ("%#6x", (@table[$ix]) ? @table[$ix] : $ix);
if ((($row << 4) | $byte) < 0xff) {
print OUT ", ";
}
}
print OUT "\n";
}
print OUT " }";
}
}
print OUT "\n};\n";
# Generate conversion method
print OUT "\nstatic PRUint32 Mirrored(PRUint32 u)\n{\n";
print OUT " if (u < 0x10000) {\n";
print OUT " PRUint8 index = symmtable_index[(u & 0xFFFFFF00) >> 8];\n";
print OUT " if (index) {\n";
print OUT " return symmtable[index - 1] [u & 0xFF];\n";
print OUT " }\n";
print OUT " }\n return u;\n}\n";
close(OUT);

View File

@ -41,7 +41,6 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsBidiUtils.h"
#include "symmtable.h"
#include "bidicattable.h"
#include "nsCharTraits.h"
@ -148,24 +147,6 @@ nsresult HandleNumbers(PRUnichar* aBuffer, PRUint32 aSize, PRUint32 aNumFlag)
return NS_OK;
}
PRUint32 SymmSwap(PRUint32 aChar)
{
return Mirrored(aChar);
}
eBidiCategory GetBidiCategory(PRUint32 aChar)
{
eBidiCategory oResult = GetBidiCat(aChar);
if (eBidiCat_CC == oResult)
oResult = (eBidiCategory)(aChar & 0xFF); /* Control codes have special treatment to keep the tables smaller */
return oResult;
}
PRBool IsBidiCategory(PRUint32 aChar, eBidiCategory aBidiCategory)
{
return (GetBidiCategory(aChar) == aBidiCategory);
}
#define LRM_CHAR 0x200e
PRBool IsBidiControl(PRUint32 aChar)
{

View File

@ -141,23 +141,6 @@ typedef enum nsCharType nsCharType;
*/
nsresult HandleNumbers(PRUnichar* aBuffer, PRUint32 aSize, PRUint32 aNumFlag);
/**
* Give a Unicode character, return the symmetric equivalent
*/
PRUint32 SymmSwap(PRUint32 aChar);
/**
* Give a UTF-32 codepoint, return an eBidiCategory
*/
eBidiCategory GetBidiCategory(PRUint32 aChar);
/**
* Give a UTF-32 codepoint and an eBidiCategory,
* return PR_TRUE if the codepoint is in that category,
* return PR_FALSE, otherwise
*/
PRBool IsBidiCategory(PRUint32 aChar, eBidiCategory aBidiCategory);
/**
* Give a UTF-32 codepoint, return a nsCharType (compatible with ICU)
*/

View File

@ -1,671 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** 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 Communicator client code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Brian Stell <bstell@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of 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 <stdio.h>
#include "prmem.h"
#include "nsCRT.h"
#include "nsICharRepresentable.h"
#include "nsCompressedCharMap.h"
void
FreeCCMap(PRUint16* &aMap)
{
if (!aMap)
return;
PR_Free(aMap - CCMAP_EXTRA);
aMap = nsnull;
}
PRUint16*
MapToCCMap(PRUint32* aMap)
{
// put the data into a temp map
nsCompressedCharMap ccmapObj;
ccmapObj.SetChars(aMap);
PRUint16 *ccmap = (PRUint16*)PR_Malloc((CCMAP_EXTRA + ccmapObj.GetSize()) * sizeof(PRUint16));
NS_ASSERTION(ccmap, "failed to alloc new CCMap");
if (!ccmap)
return nsnull;
ccmap += CCMAP_EXTRA;
CCMAP_SIZE(ccmap) = ccmapObj.GetSize();
CCMAP_FLAG(ccmap) = CCMAP_NONE_FLAG;
ccmapObj.FillCCMap(ccmap);
#ifdef DEBUG
for (int i=0; i<NUM_UNICODE_CHARS; i++) {
PRBool oldb = IS_REPRESENTABLE(aMap, i);
PRBool newb = CCMAP_HAS_CHAR(ccmap, i);
if ((oldb) != (newb)) {
NS_ASSERTION(oldb==newb,"failed to generate map correctly");
}
}
#endif
return ccmap;
}
PRUint16* CreateEmptyCCMap()
{
PRUint16 *ccmap = (PRUint16*)PR_Malloc((CCMAP_EXTRA + 16) * sizeof(PRUint16));
NS_ASSERTION(ccmap, "failed to alloc new CCMap");
if (!ccmap)
return nsnull;
memset(ccmap, '\0', CCMAP_EMPTY_SIZE_PER_INT16 * sizeof(PRUint16)+ CCMAP_EXTRA);
ccmap += CCMAP_EXTRA;
CCMAP_SIZE(ccmap) = CCMAP_EMPTY_SIZE_PER_INT16;
CCMAP_FLAG(ccmap) = CCMAP_NONE_FLAG;
return ccmap;
}
PRUint16*
MapperToCCMap(nsICharRepresentable *aMapper)
{
PRUint32 map[UCS2_MAP_LEN];
memset(map, 0, sizeof(map));
nsresult res = aMapper->FillInfo(map);
if (NS_FAILED(res))
return nsnull;
PRUint16* ccMap = MapToCCMap(map);
return ccMap;
}
PRBool
NextNonEmptyCCMapPage(const PRUint16* aCCMap, PRUint32 *aPageStart)
{
int i, j, l;
int planeend = 0;
int planestart = 0;
unsigned int k;
const PRUint16* ccmap;
PRUint32 pagestart = *aPageStart;
if(CCMAP_FLAG(aCCMap) & CCMAP_SURROGATE_FLAG) {
// for SURROGATE
planeend = EXTENDED_UNICODE_PLANES;
}
if(pagestart != CCMAP_BEGIN_AT_START_OF_MAP) {
planestart = CCMAP_PLANE(pagestart);
}
// checking each plane
for(l=planestart; l<=planeend; l++, pagestart = CCMAP_BEGIN_AT_START_OF_MAP) {
if(l != 0 && CCMAP_FLAG(aCCMap) & CCMAP_SURROGATE_FLAG) {
// for SURROGATE - get ccmap per plane
ccmap = CCMAP_FOR_PLANE_EXT(aCCMap, l);
} else {
// only BMP
ccmap = aCCMap;
}
//
// Point to the next page
//
unsigned int upper_index;
unsigned int mid_index;
if (pagestart == CCMAP_BEGIN_AT_START_OF_MAP) {
upper_index = 0;
mid_index = 0;
} else {
upper_index = CCMAP_UPPER_INDEX(pagestart & 0xffff);
mid_index = CCMAP_MID_INDEX(pagestart & 0xffff) + 1;
}
// walk thru the upper pointers
const PRUint16 *upper = &ccmap[0];
for (i=upper_index; i<CCMAP_NUM_UPPER_POINTERS; i++, mid_index=0) {
if (upper[i] == CCMAP_EMPTY_MID) {
continue;
}
// walk the mid array
const PRUint16 *mid = &ccmap[upper[i]];
for (j=mid_index; j<CCMAP_NUM_MID_POINTERS; j++) {
if (mid[j] == CCMAP_EMPTY_PAGE)
continue;
// walk the page
const ALU_TYPE *page = (ALU_TYPE*)&ccmap[mid[j]];
for (k=0; k<CCMAP_NUM_ALUS_PER_PAGE; k++) {
if (page[k] != 0) {
PRUint32 base = (i*CCMAP_NUM_UCHARS_PER_MID) + (j*CCMAP_NUM_UCHARS_PER_PAGE);
NS_ASSERTION(base<NUM_UNICODE_CHARS, "invalid page address");
// return exact UCS4 code point, plane number + base
*aPageStart = (((PRUint32)l)<<16)+base;
return PR_TRUE;
}
}
}
}
}
return PR_FALSE;
}
#define CCMAP_MID_OFFSET(m, i) ((m)[i])
#define CCMAP_PAGE_OFFSET_FROM_MIDOFFSET(m, midoffset, i) ((m)[(i) + (midoffset)])
/***********************************************************************************
*compare 2 ccmap and see if they are exactly the same
* Here I assume both ccmap is generated by
* nsCompressedCharMap::SetChars(PRUint32* aMap)
* This funtion rely on current implementation of above function. The that changed,
* we might need to revisit this implementation.
***********************************************************************************/
PRBool IsSameCCMap(PRUint16* ccmap1, PRUint16* ccmap2)
{
PRUint16 len1 = CCMAP_SIZE(ccmap1);
PRUint16 len2 = CCMAP_SIZE(ccmap2);
if (len1 != len2)
return PR_FALSE;
if (memcmp(ccmap1, ccmap2, sizeof(PRUint16)*len1))
return PR_FALSE;
return PR_TRUE;
}
PRUint16*
nsCompressedCharMap::NewCCMap()
{
if (mExtended) {
return MapToCCMapExt(mMap, mExtMap+1, EXTENDED_UNICODE_PLANES);
} else {
PRUint16 *newMap = (PRUint16*)PR_Malloc((CCMAP_EXTRA + mUsedLen) * sizeof(PRUint16));
NS_ASSERTION(newMap, "failed to alloc new CCMap");
if (!newMap)
return nsnull;
newMap += CCMAP_EXTRA;
CCMAP_SIZE(newMap) = GetSize();
CCMAP_FLAG(newMap) = CCMAP_NONE_FLAG;
FillCCMap(newMap);
return newMap;
}
}
PRUint16*
nsCompressedCharMap::FillCCMap(PRUint16* aCCMap)
{
// transfer the data
for (int i=0; i<mUsedLen; i++)
aCCMap[i] = u.mCCMap[i];
return aCCMap;
}
nsCompressedCharMap::~nsCompressedCharMap()
{
if(mExtended){
int i;
for (i = 1; i <= EXTENDED_UNICODE_PLANES; ++i) {
if (mExtMap[i]) {
PR_Free(mExtMap[i]);
}
}
}
}
nsCompressedCharMap::nsCompressedCharMap()
{
// initialize map to have:
// 1 upper pointer array
// 1 empty mid pointer array
// 1 empty page
int i;
memset(u.mCCMap, 0, sizeof(u.mCCMap));
mUsedLen = 0;
mAllOnesPage = 0;
// init the upper pointers
PRUint16 *upper = &u.mCCMap[0];
for (i=0; i<CCMAP_NUM_UPPER_POINTERS; i++) {
upper[i] = CCMAP_EMPTY_MID;
}
mUsedLen += CCMAP_NUM_UPPER_POINTERS;
// init the empty mid
NS_ASSERTION(mUsedLen==CCMAP_EMPTY_MID, "empty mid offset misconfigured");
PRUint16 *mid = &u.mCCMap[CCMAP_EMPTY_MID];
for (i=0; i<CCMAP_NUM_MID_POINTERS; i++) {
mid[i] = CCMAP_EMPTY_PAGE;
}
mUsedLen += CCMAP_NUM_MID_POINTERS;
// init the empty page
NS_ASSERTION(mUsedLen==CCMAP_EMPTY_PAGE, "empty page offset misconfigured");
// the page was zero'd by the memset above
mUsedLen += CCMAP_NUM_PRUINT16S_PER_PAGE;
// init extended
mExtended = PR_FALSE;
memset(mExtMap+1, 0, sizeof(PRUint32*) * EXTENDED_UNICODE_PLANES);
memset(mMap, 0, sizeof(mMap));
mExtMap[0] = mMap;
}
void
nsCompressedCharMap::SetChar(PRUint32 aChar)
{
if (mExtended) {
PRUint32 plane_num = CCMAP_PLANE(aChar);
NS_ASSERTION(plane_num <= EXTENDED_UNICODE_PLANES,"invalid plane");
if (plane_num <= EXTENDED_UNICODE_PLANES) {
if (mExtMap[plane_num] == 0) {
mExtMap[plane_num] = (PRUint32*)PR_Malloc(sizeof(PRUint32)*UCS2_MAP_LEN);
NS_ASSERTION(mExtMap[plane_num], "failed to alloc new mExtMap");
if (!mExtMap[plane_num]) {
return;
}
memset(mExtMap[plane_num], 0, sizeof(PRUint32)*UCS2_MAP_LEN);
}
SET_REPRESENTABLE(mExtMap[plane_num], aChar & 0xffff);
}
} else {
NS_ASSERTION(aChar <= 0xffff, "extended char is passed");
unsigned int i;
unsigned int upper_index = CCMAP_UPPER_INDEX(aChar);
unsigned int mid_index = CCMAP_MID_INDEX(aChar);
PRUint16 mid_offset = u.mCCMap[upper_index];
if (mid_offset == CCMAP_EMPTY_MID) {
mid_offset = u.mCCMap[upper_index] = mUsedLen;
mUsedLen += CCMAP_NUM_MID_POINTERS;
NS_ASSERTION(mUsedLen<=CCMAP_MAX_LEN,"length too long");
// init the mid
PRUint16 *mid = &u.mCCMap[mid_offset];
for (i=0; i<CCMAP_NUM_MID_POINTERS; i++) {
NS_ASSERTION(mid[i]==0, "this mid pointer should be unused");
mid[i] = CCMAP_EMPTY_PAGE;
}
}
PRUint16 page_offset = u.mCCMap[mid_offset+mid_index];
if (page_offset == CCMAP_EMPTY_PAGE) {
page_offset = u.mCCMap[mid_offset+mid_index] = mUsedLen;
mUsedLen += CCMAP_NUM_PRUINT16S_PER_PAGE;
NS_ASSERTION(mUsedLen<=CCMAP_MAX_LEN,"length too long");
// init the page
PRUint16 *page = &u.mCCMap[page_offset];
for (i=0; i<CCMAP_NUM_PRUINT16S_PER_PAGE; i++) {
NS_ASSERTION(page[i]==0, "this page should be unused");
page[i] = 0;
}
}
#undef CCMAP_SET_CHAR
#define CCMAP_SET_CHAR(m,c) (CCMAP_TO_ALU(m,c) |= (CCMAP_POW2(CCMAP_BIT_INDEX(c))))
CCMAP_SET_CHAR(u.mCCMap,aChar);
#undef CCMAP_SET_CHAR
NS_ASSERTION(CCMAP_HAS_CHAR(u.mCCMap,aChar), "failed to set bit");
}
}
void
nsCompressedCharMap::SetChars(PRUint16 aBase, ALU_TYPE* aPage)
{
unsigned int i;
unsigned int upper_index = CCMAP_UPPER_INDEX(aBase);
unsigned int mid_index = CCMAP_MID_INDEX(aBase);
NS_ASSERTION((aBase&CCMAP_PAGE_MASK)==0, "invalid page address");
//
// check of none/all bits set
//
PRUint16 num_none_set = 0;
PRUint16 num_all_set = 0;
for (i=0; i<CCMAP_NUM_ALUS_PER_PAGE; i++) {
if (aPage[i] == 0)
num_none_set++;
else if (aPage[i] == CCMAP_ALU_MASK)
num_all_set++;
}
if (num_none_set == CCMAP_NUM_ALUS_PER_PAGE) {
return;
}
//
// Alloc mid if necessary
//
PRUint16 mid_offset = u.mCCMap[upper_index];
if (mid_offset == CCMAP_EMPTY_MID) {
mid_offset = u.mCCMap[upper_index] = mUsedLen;
mUsedLen += CCMAP_NUM_MID_POINTERS;
NS_ASSERTION(mUsedLen<=CCMAP_MAX_LEN,"length too long");
// init the mid
PRUint16 *mid = &u.mCCMap[mid_offset];
for (i=0; i<CCMAP_NUM_MID_POINTERS; i++) {
NS_ASSERTION(mid[i]==0, "this mid pointer should be unused");
mid[i] = CCMAP_EMPTY_PAGE;
}
}
//
// if all bits set share an "all bits set" page
//
if (num_all_set == CCMAP_NUM_ALUS_PER_PAGE) {
if (mAllOnesPage == 0) {
mAllOnesPage = mUsedLen;
mUsedLen += CCMAP_NUM_PRUINT16S_PER_PAGE;
NS_ASSERTION(mUsedLen<=CCMAP_MAX_LEN,"length too long");
ALU_TYPE *all_ones_page = (ALU_TYPE*)&u.mCCMap[mAllOnesPage];
for (i=0; i<CCMAP_NUM_ALUS_PER_PAGE; i++) {
NS_ASSERTION(all_ones_page[i]==0, "this page should be unused");
all_ones_page[i] = CCMAP_ALU_MASK;
}
}
u.mCCMap[mid_offset+mid_index] = mAllOnesPage;
return;
}
//
// Alloc page if necessary
//
PRUint16 page_offset = u.mCCMap[mid_offset+mid_index];
if (page_offset == CCMAP_EMPTY_PAGE) {
page_offset = u.mCCMap[mid_offset+mid_index] = mUsedLen;
mUsedLen += CCMAP_NUM_PRUINT16S_PER_PAGE;
NS_ASSERTION(mUsedLen<=CCMAP_MAX_LEN,"length too long");
}
// copy the page data
ALU_TYPE *page = (ALU_TYPE*)&u.mCCMap[page_offset];
for (i=0; i<CCMAP_NUM_ALUS_PER_PAGE; i++) {
NS_ASSERTION(page[i]==0, "this page should be unused");
page[i] = aPage[i];
}
}
void
nsCompressedCharMap::SetChars(PRUint16* aCCMap)
{
int i, j;
if(mExtended){
PRUint32 page = CCMAP_BEGIN_AT_START_OF_MAP;
while (NextNonEmptyCCMapPage(aCCMap, &page)) {
PRUint32 pagechar = page;
for (i=0; i<(CCMAP_BITS_PER_PAGE/8); i++) {
for (j=0; j<8; j++) {
if (CCMAP_HAS_CHAR_EXT(aCCMap, pagechar)) {
SetChar(pagechar);
}
pagechar++;
}
}
}
} else {
//
// Copy the input CCMap
//
// walk thru the upper pointers
PRUint16 *upper = &aCCMap[0];
for (i=0; i<CCMAP_NUM_UPPER_POINTERS; i++) {
if (upper[i] == CCMAP_EMPTY_MID)
continue;
// walk the mid array
PRUint16 *mid = &aCCMap[upper[i]];
for (j=0; j<CCMAP_NUM_MID_POINTERS; j++) {
if (mid[j] == CCMAP_EMPTY_PAGE)
continue;
PRUint32 base = (i*CCMAP_NUM_UCHARS_PER_MID) + (j*CCMAP_NUM_UCHARS_PER_PAGE);
NS_ASSERTION(base<NUM_UNICODE_CHARS, "invalid page address");
ALU_TYPE *page = (ALU_TYPE*)&aCCMap[mid[j]];
SetChars((PRUint16)base, page);
}
}
}
}
void
nsCompressedCharMap::SetChars(PRUint32* aMap)
{
PRUint32* frommap_page;
frommap_page = aMap;
PRUint16 base = 0;
for (int i=0; i<CCMAP_TOTAL_PAGES; i++) {
#if (CCMAP_BITS_PER_ALU == CCMAP_BITS_PER_PRUINT32)
SetChars(base, (ALU_TYPE*)frommap_page);
frommap_page += CCMAP_PRUINT32S_PER_PAGE;
#elif (CCMAP_BITS_PER_ALU > CCMAP_BITS_PER_PRUINT32)
int j, k = CCMAP_BITS_PER_PRUINT32;
ALU_TYPE page[CCMAP_NUM_ALUS_PER_PAGE];
ALU_TYPE *p = page;
for (j=0; j<CCMAP_ALUS_PER_PAGE; j++) {
ALU_TYPE alu_val = 0;
ALU_TYPE tmp;
for (k=0; k<CCMAP_PRUINT32S_PER_ALU; k++) {
tmp = *frommap_page;
tmp <<= (k*CCMAP_BITS_PER_PRUINT32);
//alu_val |= (*frommap_page)<<(k*CCMAP_BITS_PER_PRUINT32);
alu_val |= tmp;
frommap_page++;
}
*p++ = alu_val;
}
SetChars(base, page);
#elif (CCMAP_BITS_PER_ALU < CCMAP_BITS_PER_PRUINT32)
int j, k;
ALU_TYPE page[CCMAP_NUM_ALUS_PER_PAGE];
int v = CCMAP_PRUINT32S_PER_PAGE;
ALU_TYPE *p = page;
for (j=0; j<CCMAP_PRUINT32S_PER_PAGE; j++) {
PRUint32 pruint32_val = *frommap_page++;
for (k=0; k<CCMAP_ALUS_PER_PRUINT32; k++) {
*p++ = pruint32_val & CCMAP_ALU_MASK;
pruint32_val >>= CCMAP_BITS_PER_ALU;
}
}
SetChars(base, page);
#endif
base += CCMAP_NUM_UCHARS_PER_PAGE;
}
}
#ifdef DEBUG
void
printCCMap(PRUint16* aCCMap)
{
PRUint32 page = CCMAP_BEGIN_AT_START_OF_MAP;
while (NextNonEmptyCCMapPage(aCCMap, &page)) {
int i;
PRUint32 pagechar = page;
printf("CCMap:0x%04lx=", (long)page);
for (i=0; i<(CCMAP_BITS_PER_PAGE/8); i++) {
unsigned char val = 0;
for (int j=0; j<8; j++) {
if (CCMAP_HAS_CHAR(aCCMap, pagechar)) {
val |= 1 << j;
}
pagechar++;
}
printf("%02x", val);
}
printf("\n");
}
}
#endif
// Non-BMP unicode support extension, create ccmap for both BMP and extended planes
PRUint16*
MapToCCMapExt(PRUint32* aBmpPlaneMap, PRUint32** aOtherPlaneMaps, PRUint32 aOtherPlaneNum)
{
nsCompressedCharMap* otherPlaneObj[EXTENDED_UNICODE_PLANES];
PRUint32 totalSize;
PRUint16 i;
PRUint32 *planeCCMapOffsets;
PRUint32 currOffset;
NS_ASSERTION(aOtherPlaneNum <= EXTENDED_UNICODE_PLANES, "illegal argument value");
if (aOtherPlaneNum > EXTENDED_UNICODE_PLANES)
return nsnull;
// Put the data into a temp map
nsCompressedCharMap bmpCcmapObj;
bmpCcmapObj.SetChars(aBmpPlaneMap);
// Add bmp size
totalSize = bmpCcmapObj.GetSize();
// Add bmp length field
totalSize += CCMAP_EXTRA;
// Add Plane array
totalSize += EXTENDED_UNICODE_PLANES * sizeof(PRUint32)/sizeof(PRUint16);
// Add an empty plane ccmap
// A totally empty plane ccmap can be represented by 16 *(PRUint16)0.
totalSize += CCMAP_EMPTY_SIZE_PER_INT16;
// Create ccmap for other planes
for (i = 0; i < aOtherPlaneNum; i++) {
if (aOtherPlaneMaps[i]) {
otherPlaneObj[i] = new nsCompressedCharMap();
NS_ASSERTION(otherPlaneObj[i],
"unable to create new nsCompressedCharMap");
if(otherPlaneObj[i]) {
otherPlaneObj[i]->SetChars(aOtherPlaneMaps[i]);
totalSize += otherPlaneObj[i]->GetSize();
}
} else {
otherPlaneObj[i] = nsnull;
}
}
PRUint16 *ccmap = (PRUint16*)PR_Malloc(totalSize * sizeof(PRUint16));
NS_ASSERTION(ccmap, "failed to alloc new CCMap");
if (!ccmap)
return nsnull;
// Assign BMP ccmap size
ccmap += CCMAP_EXTRA;
CCMAP_SIZE(ccmap) = bmpCcmapObj.GetSize();
CCMAP_FLAG(ccmap) = CCMAP_SURROGATE_FLAG;
// Fill bmp plane ccmap
bmpCcmapObj.FillCCMap(ccmap);
// Get pointer for plane ccmap offset array
currOffset = bmpCcmapObj.GetSize();
planeCCMapOffsets = (PRUint32*)(ccmap+currOffset);
currOffset += sizeof(PRUint32)/sizeof(PRUint16)*EXTENDED_UNICODE_PLANES;
// Put a empty ccmap there
memset(ccmap+currOffset, '\0', sizeof(PRUint16)*16);
PRUint32 emptyCCMapOffset = currOffset;
currOffset += CCMAP_EMPTY_SIZE_PER_INT16;
// Now fill all rest of the planes' ccmap and put off in array
for (i = 0; i <aOtherPlaneNum; i++) {
if (aOtherPlaneMaps[i] && otherPlaneObj[i]) {
*(planeCCMapOffsets+i) = currOffset;
otherPlaneObj[i]->FillCCMap(ccmap+currOffset);
currOffset += otherPlaneObj[i]->GetSize();
}
else
*(planeCCMapOffsets+i) = emptyCCMapOffset;
}
for (; i < EXTENDED_UNICODE_PLANES; i++) {
*(planeCCMapOffsets+i) = emptyCCMapOffset;
}
// remove all nsCompressedCharMap objects allocated
for (i = 0; i < aOtherPlaneNum; i++) {
if (otherPlaneObj[i])
delete otherPlaneObj[i];
}
#ifdef DEBUG
PRUint32 k, h, l, plane, offset;
PRBool oldb;
PRBool newb;
// testing for BMP plane
for (k=0; k<NUM_UNICODE_CHARS; k++) {
oldb = IS_REPRESENTABLE(aBmpPlaneMap, k);
newb = CCMAP_HAS_CHAR_EXT(ccmap, k);
NS_ASSERTION(oldb==newb,"failed to generate map correctly");
}
//testing for extension plane
for (k = 0x10000; k < 0x100000; k++) {
plane = k/0x10000;
if (plane > aOtherPlaneNum)
break;
if (aOtherPlaneMaps[plane-1])
oldb = IS_REPRESENTABLE(aOtherPlaneMaps[plane-1], k&0xffff);
else
oldb = 0;
newb = CCMAP_HAS_CHAR_EXT(ccmap, k);
NS_ASSERTION(oldb==newb, "failed to generate extension map correctly");
}
// testing for non-BMP plane
for (h = 0; h < 0x400; h++) {
for (l = 0; l < 0x400; l++) {
plane = h >> 6;
offset = (h*0x400 + l) & 0xffff;
if (aOtherPlaneMaps[plane])
oldb = IS_REPRESENTABLE(aOtherPlaneMaps[plane], offset);
else
oldb = 0;
newb = CCMAP_HAS_CHAR_EXT2(ccmap, h+0xd800, l+0xdc00);
NS_ASSERTION(oldb==newb, "failed to generate extension map correctly");
}
}
#endif
return ccmap;
}

View File

@ -39,7 +39,6 @@
#ifndef NSCOMPRESSEDCHARMAP_H
#define NSCOMPRESSEDCHARMAP_H
#include "prtypes.h"
#include "nsICharRepresentable.h"
#define ALU_SIZE PR_BITS_PER_LONG
//#define ALU_SIZE 16
@ -59,23 +58,8 @@
# define CCMAP_BITS_PER_ALU_LOG2 4
#endif
class nsICharRepresentable;
extern PRUint16* CreateEmptyCCMap();
extern PRUint16* MapToCCMap(PRUint32* aMap);
extern PRUint16* MapperToCCMap(nsICharRepresentable *aMapper);
extern void FreeCCMap(PRUint16* &aMap);
extern PRBool NextNonEmptyCCMapPage(const PRUint16 *, PRUint32 *);
extern PRBool IsSameCCMap(PRUint16* ccmap1, PRUint16* ccmap2);
#ifdef DEBUG
void printCCMap(PRUint16* aCCMap);
#endif
// surrogate support extension
extern PRUint16*
MapToCCMapExt(PRUint32* aBmpPlaneMap, PRUint32** aOtherPlaneMaps, PRUint32 aOtherPlaneNum);
// Note: nsCompressedCharMap.cpp along with class
// nsCompressedCharMap was removed in bug 559489.
//
// nsCompressedCharMap
@ -103,36 +87,6 @@ MapToCCMapExt(PRUint32* aBmpPlaneMap, PRUint32** aOtherPlaneMaps, PRUint32 aOthe
// non-bmp unicode support extension
#define EXTENDED_UNICODE_PLANES 16
class nsCompressedCharMap {
public:
nsCompressedCharMap();
~nsCompressedCharMap();
PRUint16* NewCCMap();
PRUint16* FillCCMap(PRUint16* aCCMap);
PRUint16 GetSize() {return mUsedLen;}
void SetChar(PRUint32);
void SetChars(PRUint16*);
void SetChars(PRUint16, ALU_TYPE*);
void SetChars(PRUint32*);
void Extend() {mExtended = PR_TRUE;} // enable surrogate area
protected:
union {
PRUint16 mCCMap[CCMAP_MAX_LEN];
ALU_TYPE used_for_align; // do not use; only here to cause
// alignment
} u;
PRUint16 mUsedLen; // in PRUint16
PRUint16 mAllOnesPage;
PRBool mExtended;
// for surrogate support
PRUint32* mExtMap[EXTENDED_UNICODE_PLANES+1];
PRUint32 mMap[UCS2_MAP_LEN];
};
//
// Character Map Compression
//

View File

@ -173,22 +173,6 @@ nsCaseInsensitiveStringComparator::operator()(PRUnichar lhs,
return 1;
}
#else // MOZILLA_INTERNAL_API
PRInt32
CaseInsensitiveCompare(const PRUnichar *a,
const PRUnichar *b,
PRUint32 len)
{
nsICaseConversion* caseConv = NS_GetCaseConversion();
if (!caseConv)
return NS_strcmp(a, b);
PRInt32 result;
caseConv->CaseInsensitiveCompare(a, b, len, &result);
return result;
}
#endif // MOZILLA_INTERNAL_API
PRUnichar

View File

@ -107,11 +107,6 @@ CaseInsensitiveFindInReadable(const nsAString& aPattern,
nsCaseInsensitiveStringComparator());
}
#else // MOZILLA_INTERNAL_API
NS_HIDDEN_(PRInt32)
CaseInsensitiveCompare(const PRUnichar *a, const PRUnichar *b, PRUint32 len);
#endif // MOZILLA_INTERNAL_API
#endif /* nsUnicharUtils_h__ */

View File

@ -36,7 +36,6 @@
INTL_UNICHARUTIL_UTIL_LCPPSRCS = \
nsUnicharUtils.cpp \
nsCompressedCharMap.cpp \
nsBidiUtils.cpp \
$(NULL)

View File

@ -1,336 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** 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 IBM code.
*
* The Initial Developer of the Original Code is
* International Business Machines Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* 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 ***** */
/*
DO NOT EDIT THIS DOCUMENT !!! THIS DOCUMENT IS GENERATED BY
mozilla/intl/unicharutil/util/gensymmtable.pl
*/
/* Indexes to symmtable by Unicode block */
const static PRUint8 symmtable_index[256] = {
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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xfda, 0xfdb, 0xfdc, 0xfdd, 0xfde, 0xfdf,
/* E_ */ 0xfe0, 0xfe1, 0xfe2, 0xfe3, 0xfe4, 0xfe5, 0xfe6, 0xfe7, 0xfe8, 0xfe9, 0xfea, 0xfeb, 0xfec, 0xfed, 0xfee, 0xfef,
/* F_ */ 0xff0, 0xff1, 0xff2, 0xff3, 0xff4, 0xff5, 0xff6, 0xff7, 0xff8, 0xff9, 0xffa, 0xffb, 0xffc, 0xffd, 0xffe, 0xfff
},
{
/* Block U16__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0x1600, 0x1601, 0x1602, 0x1603, 0x1604, 0x1605, 0x1606, 0x1607, 0x1608, 0x1609, 0x160a, 0x160b, 0x160c, 0x160d, 0x160e, 0x160f,
/* 1_ */ 0x1610, 0x1611, 0x1612, 0x1613, 0x1614, 0x1615, 0x1616, 0x1617, 0x1618, 0x1619, 0x161a, 0x161b, 0x161c, 0x161d, 0x161e, 0x161f,
/* 2_ */ 0x1620, 0x1621, 0x1622, 0x1623, 0x1624, 0x1625, 0x1626, 0x1627, 0x1628, 0x1629, 0x162a, 0x162b, 0x162c, 0x162d, 0x162e, 0x162f,
/* 3_ */ 0x1630, 0x1631, 0x1632, 0x1633, 0x1634, 0x1635, 0x1636, 0x1637, 0x1638, 0x1639, 0x163a, 0x163b, 0x163c, 0x163d, 0x163e, 0x163f,
/* 4_ */ 0x1640, 0x1641, 0x1642, 0x1643, 0x1644, 0x1645, 0x1646, 0x1647, 0x1648, 0x1649, 0x164a, 0x164b, 0x164c, 0x164d, 0x164e, 0x164f,
/* 5_ */ 0x1650, 0x1651, 0x1652, 0x1653, 0x1654, 0x1655, 0x1656, 0x1657, 0x1658, 0x1659, 0x165a, 0x165b, 0x165c, 0x165d, 0x165e, 0x165f,
/* 6_ */ 0x1660, 0x1661, 0x1662, 0x1663, 0x1664, 0x1665, 0x1666, 0x1667, 0x1668, 0x1669, 0x166a, 0x166b, 0x166c, 0x166d, 0x166e, 0x166f,
/* 7_ */ 0x1670, 0x1671, 0x1672, 0x1673, 0x1674, 0x1675, 0x1676, 0x1677, 0x1678, 0x1679, 0x167a, 0x167b, 0x167c, 0x167d, 0x167e, 0x167f,
/* 8_ */ 0x1680, 0x1681, 0x1682, 0x1683, 0x1684, 0x1685, 0x1686, 0x1687, 0x1688, 0x1689, 0x168a, 0x168b, 0x168c, 0x168d, 0x168e, 0x168f,
/* 9_ */ 0x1690, 0x1691, 0x1692, 0x1693, 0x1694, 0x1695, 0x1696, 0x1697, 0x1698, 0x1699, 0x169a, 0x169c, 0x169b, 0x169d, 0x169e, 0x169f,
/* A_ */ 0x16a0, 0x16a1, 0x16a2, 0x16a3, 0x16a4, 0x16a5, 0x16a6, 0x16a7, 0x16a8, 0x16a9, 0x16aa, 0x16ab, 0x16ac, 0x16ad, 0x16ae, 0x16af,
/* B_ */ 0x16b0, 0x16b1, 0x16b2, 0x16b3, 0x16b4, 0x16b5, 0x16b6, 0x16b7, 0x16b8, 0x16b9, 0x16ba, 0x16bb, 0x16bc, 0x16bd, 0x16be, 0x16bf,
/* C_ */ 0x16c0, 0x16c1, 0x16c2, 0x16c3, 0x16c4, 0x16c5, 0x16c6, 0x16c7, 0x16c8, 0x16c9, 0x16ca, 0x16cb, 0x16cc, 0x16cd, 0x16ce, 0x16cf,
/* D_ */ 0x16d0, 0x16d1, 0x16d2, 0x16d3, 0x16d4, 0x16d5, 0x16d6, 0x16d7, 0x16d8, 0x16d9, 0x16da, 0x16db, 0x16dc, 0x16dd, 0x16de, 0x16df,
/* E_ */ 0x16e0, 0x16e1, 0x16e2, 0x16e3, 0x16e4, 0x16e5, 0x16e6, 0x16e7, 0x16e8, 0x16e9, 0x16ea, 0x16eb, 0x16ec, 0x16ed, 0x16ee, 0x16ef,
/* F_ */ 0x16f0, 0x16f1, 0x16f2, 0x16f3, 0x16f4, 0x16f5, 0x16f6, 0x16f7, 0x16f8, 0x16f9, 0x16fa, 0x16fb, 0x16fc, 0x16fd, 0x16fe, 0x16ff
},
{
/* Block U20__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x200b, 0x200c, 0x200d, 0x200e, 0x200f,
/* 1_ */ 0x2010, 0x2011, 0x2012, 0x2013, 0x2014, 0x2015, 0x2016, 0x2017, 0x2018, 0x2019, 0x201a, 0x201b, 0x201c, 0x201d, 0x201e, 0x201f,
/* 2_ */ 0x2020, 0x2021, 0x2022, 0x2023, 0x2024, 0x2025, 0x2026, 0x2027, 0x2028, 0x2029, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0x202f,
/* 3_ */ 0x2030, 0x2031, 0x2032, 0x2033, 0x2034, 0x2035, 0x2036, 0x2037, 0x2038, 0x203a, 0x2039, 0x203b, 0x203c, 0x203d, 0x203e, 0x203f,
/* 4_ */ 0x2040, 0x2041, 0x2042, 0x2043, 0x2044, 0x2046, 0x2045, 0x2047, 0x2048, 0x2049, 0x204a, 0x204b, 0x204c, 0x204d, 0x204e, 0x204f,
/* 5_ */ 0x2050, 0x2051, 0x2052, 0x2053, 0x2054, 0x2055, 0x2056, 0x2057, 0x2058, 0x2059, 0x205a, 0x205b, 0x205c, 0x205d, 0x205e, 0x205f,
/* 6_ */ 0x2060, 0x2061, 0x2062, 0x2063, 0x2064, 0x2065, 0x2066, 0x2067, 0x2068, 0x2069, 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f,
/* 7_ */ 0x2070, 0x2071, 0x2072, 0x2073, 0x2074, 0x2075, 0x2076, 0x2077, 0x2078, 0x2079, 0x207a, 0x207b, 0x207c, 0x207e, 0x207d, 0x207f,
/* 8_ */ 0x2080, 0x2081, 0x2082, 0x2083, 0x2084, 0x2085, 0x2086, 0x2087, 0x2088, 0x2089, 0x208a, 0x208b, 0x208c, 0x208e, 0x208d, 0x208f,
/* 9_ */ 0x2090, 0x2091, 0x2092, 0x2093, 0x2094, 0x2095, 0x2096, 0x2097, 0x2098, 0x2099, 0x209a, 0x209b, 0x209c, 0x209d, 0x209e, 0x209f,
/* A_ */ 0x20a0, 0x20a1, 0x20a2, 0x20a3, 0x20a4, 0x20a5, 0x20a6, 0x20a7, 0x20a8, 0x20a9, 0x20aa, 0x20ab, 0x20ac, 0x20ad, 0x20ae, 0x20af,
/* B_ */ 0x20b0, 0x20b1, 0x20b2, 0x20b3, 0x20b4, 0x20b5, 0x20b6, 0x20b7, 0x20b8, 0x20b9, 0x20ba, 0x20bb, 0x20bc, 0x20bd, 0x20be, 0x20bf,
/* C_ */ 0x20c0, 0x20c1, 0x20c2, 0x20c3, 0x20c4, 0x20c5, 0x20c6, 0x20c7, 0x20c8, 0x20c9, 0x20ca, 0x20cb, 0x20cc, 0x20cd, 0x20ce, 0x20cf,
/* D_ */ 0x20d0, 0x20d1, 0x20d2, 0x20d3, 0x20d4, 0x20d5, 0x20d6, 0x20d7, 0x20d8, 0x20d9, 0x20da, 0x20db, 0x20dc, 0x20dd, 0x20de, 0x20df,
/* E_ */ 0x20e0, 0x20e1, 0x20e2, 0x20e3, 0x20e4, 0x20e5, 0x20e6, 0x20e7, 0x20e8, 0x20e9, 0x20ea, 0x20eb, 0x20ec, 0x20ed, 0x20ee, 0x20ef,
/* F_ */ 0x20f0, 0x20f1, 0x20f2, 0x20f3, 0x20f4, 0x20f5, 0x20f6, 0x20f7, 0x20f8, 0x20f9, 0x20fa, 0x20fb, 0x20fc, 0x20fd, 0x20fe, 0x20ff
},
{
/* Block U22__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0x2200, 0x2201, 0x2202, 0x2203, 0x2204, 0x2205, 0x2206, 0x2207, 0x220b, 0x220c, 0x220d, 0x2208, 0x2209, 0x220a, 0x220e, 0x220f,
/* 1_ */ 0x2210, 0x2211, 0x2212, 0x2213, 0x2214, 0x29f5, 0x2216, 0x2217, 0x2218, 0x2219, 0x221a, 0x221b, 0x221c, 0x221d, 0x221e, 0x221f,
/* 2_ */ 0x2220, 0x2221, 0x2222, 0x2223, 0x2224, 0x2225, 0x2226, 0x2227, 0x2228, 0x2229, 0x222a, 0x222b, 0x222c, 0x222d, 0x222e, 0x222f,
/* 3_ */ 0x2230, 0x2231, 0x2232, 0x2233, 0x2234, 0x2235, 0x2236, 0x2237, 0x2238, 0x2239, 0x223a, 0x223b, 0x223d, 0x223c, 0x223e, 0x223f,
/* 4_ */ 0x2240, 0x2241, 0x2242, 0x22cd, 0x2244, 0x2245, 0x2246, 0x2247, 0x2248, 0x2249, 0x224a, 0x224b, 0x224c, 0x224d, 0x224e, 0x224f,
/* 5_ */ 0x2250, 0x2251, 0x2253, 0x2252, 0x2255, 0x2254, 0x2256, 0x2257, 0x2258, 0x2259, 0x225a, 0x225b, 0x225c, 0x225d, 0x225e, 0x225f,
/* 6_ */ 0x2260, 0x2261, 0x2262, 0x2263, 0x2265, 0x2264, 0x2267, 0x2266, 0x2269, 0x2268, 0x226b, 0x226a, 0x226c, 0x226d, 0x226f, 0x226e,
/* 7_ */ 0x2271, 0x2270, 0x2273, 0x2272, 0x2275, 0x2274, 0x2277, 0x2276, 0x2279, 0x2278, 0x227b, 0x227a, 0x227d, 0x227c, 0x227f, 0x227e,
/* 8_ */ 0x2281, 0x2280, 0x2283, 0x2282, 0x2285, 0x2284, 0x2287, 0x2286, 0x2289, 0x2288, 0x228b, 0x228a, 0x228c, 0x228d, 0x228e, 0x2290,
/* 9_ */ 0x228f, 0x2292, 0x2291, 0x2293, 0x2294, 0x2295, 0x2296, 0x2297, 0x29b8, 0x2299, 0x229a, 0x229b, 0x229c, 0x229d, 0x229e, 0x229f,
/* A_ */ 0x22a0, 0x22a1, 0x22a3, 0x22a2, 0x22a4, 0x22a5, 0x2ade, 0x22a7, 0x2ae4, 0x2ae3, 0x22aa, 0x2ae5, 0x22ac, 0x22ad, 0x22ae, 0x22af,
/* B_ */ 0x22b1, 0x22b0, 0x22b3, 0x22b2, 0x22b5, 0x22b4, 0x22b7, 0x22b6, 0x22b8, 0x22b9, 0x22ba, 0x22bb, 0x22bc, 0x22bd, 0x22be, 0x22bf,
/* C_ */ 0x22c0, 0x22c1, 0x22c2, 0x22c3, 0x22c4, 0x22c5, 0x22c6, 0x22c7, 0x22c8, 0x22ca, 0x22c9, 0x22cc, 0x22cb, 0x2243, 0x22ce, 0x22cf,
/* D_ */ 0x22d1, 0x22d0, 0x22d2, 0x22d3, 0x22d4, 0x22d5, 0x22d7, 0x22d6, 0x22d9, 0x22d8, 0x22db, 0x22da, 0x22dd, 0x22dc, 0x22df, 0x22de,
/* E_ */ 0x22e1, 0x22e0, 0x22e3, 0x22e2, 0x22e5, 0x22e4, 0x22e7, 0x22e6, 0x22e9, 0x22e8, 0x22eb, 0x22ea, 0x22ed, 0x22ec, 0x22ee, 0x22ef,
/* F_ */ 0x22f1, 0x22f0, 0x22fa, 0x22fb, 0x22fc, 0x22f5, 0x22fd, 0x22fe, 0x22f8, 0x22f9, 0x22f2, 0x22f3, 0x22f4, 0x22f6, 0x22f7, 0x22ff
},
{
/* Block U23__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0x2300, 0x2301, 0x2302, 0x2303, 0x2304, 0x2305, 0x2306, 0x2307, 0x2309, 0x2308, 0x230b, 0x230a, 0x230c, 0x230d, 0x230e, 0x230f,
/* 1_ */ 0x2310, 0x2311, 0x2312, 0x2313, 0x2314, 0x2315, 0x2316, 0x2317, 0x2318, 0x2319, 0x231a, 0x231b, 0x231c, 0x231d, 0x231e, 0x231f,
/* 2_ */ 0x2320, 0x2321, 0x2322, 0x2323, 0x2324, 0x2325, 0x2326, 0x2327, 0x2328, 0x232a, 0x2329, 0x232b, 0x232c, 0x232d, 0x232e, 0x232f,
/* 3_ */ 0x2330, 0x2331, 0x2332, 0x2333, 0x2334, 0x2335, 0x2336, 0x2337, 0x2338, 0x2339, 0x233a, 0x233b, 0x233c, 0x233d, 0x233e, 0x233f,
/* 4_ */ 0x2340, 0x2341, 0x2342, 0x2343, 0x2344, 0x2345, 0x2346, 0x2347, 0x2348, 0x2349, 0x234a, 0x234b, 0x234c, 0x234d, 0x234e, 0x234f,
/* 5_ */ 0x2350, 0x2351, 0x2352, 0x2353, 0x2354, 0x2355, 0x2356, 0x2357, 0x2358, 0x2359, 0x235a, 0x235b, 0x235c, 0x235d, 0x235e, 0x235f,
/* 6_ */ 0x2360, 0x2361, 0x2362, 0x2363, 0x2364, 0x2365, 0x2366, 0x2367, 0x2368, 0x2369, 0x236a, 0x236b, 0x236c, 0x236d, 0x236e, 0x236f,
/* 7_ */ 0x2370, 0x2371, 0x2372, 0x2373, 0x2374, 0x2375, 0x2376, 0x2377, 0x2378, 0x2379, 0x237a, 0x237b, 0x237c, 0x237d, 0x237e, 0x237f,
/* 8_ */ 0x2380, 0x2381, 0x2382, 0x2383, 0x2384, 0x2385, 0x2386, 0x2387, 0x2388, 0x2389, 0x238a, 0x238b, 0x238c, 0x238d, 0x238e, 0x238f,
/* 9_ */ 0x2390, 0x2391, 0x2392, 0x2393, 0x2394, 0x2395, 0x2396, 0x2397, 0x2398, 0x2399, 0x239a, 0x239b, 0x239c, 0x239d, 0x239e, 0x239f,
/* A_ */ 0x23a0, 0x23a1, 0x23a2, 0x23a3, 0x23a4, 0x23a5, 0x23a6, 0x23a7, 0x23a8, 0x23a9, 0x23aa, 0x23ab, 0x23ac, 0x23ad, 0x23ae, 0x23af,
/* B_ */ 0x23b0, 0x23b1, 0x23b2, 0x23b3, 0x23b4, 0x23b5, 0x23b6, 0x23b7, 0x23b8, 0x23b9, 0x23ba, 0x23bb, 0x23bc, 0x23bd, 0x23be, 0x23bf,
/* C_ */ 0x23c0, 0x23c1, 0x23c2, 0x23c3, 0x23c4, 0x23c5, 0x23c6, 0x23c7, 0x23c8, 0x23c9, 0x23ca, 0x23cb, 0x23cc, 0x23cd, 0x23ce, 0x23cf,
/* D_ */ 0x23d0, 0x23d1, 0x23d2, 0x23d3, 0x23d4, 0x23d5, 0x23d6, 0x23d7, 0x23d8, 0x23d9, 0x23da, 0x23db, 0x23dc, 0x23dd, 0x23de, 0x23df,
/* E_ */ 0x23e0, 0x23e1, 0x23e2, 0x23e3, 0x23e4, 0x23e5, 0x23e6, 0x23e7, 0x23e8, 0x23e9, 0x23ea, 0x23eb, 0x23ec, 0x23ed, 0x23ee, 0x23ef,
/* F_ */ 0x23f0, 0x23f1, 0x23f2, 0x23f3, 0x23f4, 0x23f5, 0x23f6, 0x23f7, 0x23f8, 0x23f9, 0x23fa, 0x23fb, 0x23fc, 0x23fd, 0x23fe, 0x23ff
},
{
/* Block U27__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0x2700, 0x2701, 0x2702, 0x2703, 0x2704, 0x2705, 0x2706, 0x2707, 0x2708, 0x2709, 0x270a, 0x270b, 0x270c, 0x270d, 0x270e, 0x270f,
/* 1_ */ 0x2710, 0x2711, 0x2712, 0x2713, 0x2714, 0x2715, 0x2716, 0x2717, 0x2718, 0x2719, 0x271a, 0x271b, 0x271c, 0x271d, 0x271e, 0x271f,
/* 2_ */ 0x2720, 0x2721, 0x2722, 0x2723, 0x2724, 0x2725, 0x2726, 0x2727, 0x2728, 0x2729, 0x272a, 0x272b, 0x272c, 0x272d, 0x272e, 0x272f,
/* 3_ */ 0x2730, 0x2731, 0x2732, 0x2733, 0x2734, 0x2735, 0x2736, 0x2737, 0x2738, 0x2739, 0x273a, 0x273b, 0x273c, 0x273d, 0x273e, 0x273f,
/* 4_ */ 0x2740, 0x2741, 0x2742, 0x2743, 0x2744, 0x2745, 0x2746, 0x2747, 0x2748, 0x2749, 0x274a, 0x274b, 0x274c, 0x274d, 0x274e, 0x274f,
/* 5_ */ 0x2750, 0x2751, 0x2752, 0x2753, 0x2754, 0x2755, 0x2756, 0x2757, 0x2758, 0x2759, 0x275a, 0x275b, 0x275c, 0x275d, 0x275e, 0x275f,
/* 6_ */ 0x2760, 0x2761, 0x2762, 0x2763, 0x2764, 0x2765, 0x2766, 0x2767, 0x2769, 0x2768, 0x276b, 0x276a, 0x276d, 0x276c, 0x276f, 0x276e,
/* 7_ */ 0x2771, 0x2770, 0x2773, 0x2772, 0x2775, 0x2774, 0x2776, 0x2777, 0x2778, 0x2779, 0x277a, 0x277b, 0x277c, 0x277d, 0x277e, 0x277f,
/* 8_ */ 0x2780, 0x2781, 0x2782, 0x2783, 0x2784, 0x2785, 0x2786, 0x2787, 0x2788, 0x2789, 0x278a, 0x278b, 0x278c, 0x278d, 0x278e, 0x278f,
/* 9_ */ 0x2790, 0x2791, 0x2792, 0x2793, 0x2794, 0x2795, 0x2796, 0x2797, 0x2798, 0x2799, 0x279a, 0x279b, 0x279c, 0x279d, 0x279e, 0x279f,
/* A_ */ 0x27a0, 0x27a1, 0x27a2, 0x27a3, 0x27a4, 0x27a5, 0x27a6, 0x27a7, 0x27a8, 0x27a9, 0x27aa, 0x27ab, 0x27ac, 0x27ad, 0x27ae, 0x27af,
/* B_ */ 0x27b0, 0x27b1, 0x27b2, 0x27b3, 0x27b4, 0x27b5, 0x27b6, 0x27b7, 0x27b8, 0x27b9, 0x27ba, 0x27bb, 0x27bc, 0x27bd, 0x27be, 0x27bf,
/* C_ */ 0x27c0, 0x27c1, 0x27c2, 0x27c4, 0x27c3, 0x27c6, 0x27c5, 0x27c7, 0x27c9, 0x27c8, 0x27ca, 0x27cb, 0x27cc, 0x27cd, 0x27ce, 0x27cf,
/* D_ */ 0x27d0, 0x27d1, 0x27d2, 0x27d3, 0x27d4, 0x27d6, 0x27d5, 0x27d7, 0x27d8, 0x27d9, 0x27da, 0x27db, 0x27dc, 0x27de, 0x27dd, 0x27df,
/* E_ */ 0x27e0, 0x27e1, 0x27e3, 0x27e2, 0x27e5, 0x27e4, 0x27e7, 0x27e6, 0x27e9, 0x27e8, 0x27eb, 0x27ea, 0x27ed, 0x27ec, 0x27ef, 0x27ee,
/* F_ */ 0x27f0, 0x27f1, 0x27f2, 0x27f3, 0x27f4, 0x27f5, 0x27f6, 0x27f7, 0x27f8, 0x27f9, 0x27fa, 0x27fb, 0x27fc, 0x27fd, 0x27fe, 0x27ff
},
{
/* Block U29__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0x2900, 0x2901, 0x2902, 0x2903, 0x2904, 0x2905, 0x2906, 0x2907, 0x2908, 0x2909, 0x290a, 0x290b, 0x290c, 0x290d, 0x290e, 0x290f,
/* 1_ */ 0x2910, 0x2911, 0x2912, 0x2913, 0x2914, 0x2915, 0x2916, 0x2917, 0x2918, 0x2919, 0x291a, 0x291b, 0x291c, 0x291d, 0x291e, 0x291f,
/* 2_ */ 0x2920, 0x2921, 0x2922, 0x2923, 0x2924, 0x2925, 0x2926, 0x2927, 0x2928, 0x2929, 0x292a, 0x292b, 0x292c, 0x292d, 0x292e, 0x292f,
/* 3_ */ 0x2930, 0x2931, 0x2932, 0x2933, 0x2934, 0x2935, 0x2936, 0x2937, 0x2938, 0x2939, 0x293a, 0x293b, 0x293c, 0x293d, 0x293e, 0x293f,
/* 4_ */ 0x2940, 0x2941, 0x2942, 0x2943, 0x2944, 0x2945, 0x2946, 0x2947, 0x2948, 0x2949, 0x294a, 0x294b, 0x294c, 0x294d, 0x294e, 0x294f,
/* 5_ */ 0x2950, 0x2951, 0x2952, 0x2953, 0x2954, 0x2955, 0x2956, 0x2957, 0x2958, 0x2959, 0x295a, 0x295b, 0x295c, 0x295d, 0x295e, 0x295f,
/* 6_ */ 0x2960, 0x2961, 0x2962, 0x2963, 0x2964, 0x2965, 0x2966, 0x2967, 0x2968, 0x2969, 0x296a, 0x296b, 0x296c, 0x296d, 0x296e, 0x296f,
/* 7_ */ 0x2970, 0x2971, 0x2972, 0x2973, 0x2974, 0x2975, 0x2976, 0x2977, 0x2978, 0x2979, 0x297a, 0x297b, 0x297c, 0x297d, 0x297e, 0x297f,
/* 8_ */ 0x2980, 0x2981, 0x2982, 0x2984, 0x2983, 0x2986, 0x2985, 0x2988, 0x2987, 0x298a, 0x2989, 0x298c, 0x298b, 0x2990, 0x298f, 0x298e,
/* 9_ */ 0x298d, 0x2992, 0x2991, 0x2994, 0x2993, 0x2996, 0x2995, 0x2998, 0x2997, 0x2999, 0x299a, 0x299b, 0x299c, 0x299d, 0x299e, 0x299f,
/* A_ */ 0x29a0, 0x29a1, 0x29a2, 0x29a3, 0x29a4, 0x29a5, 0x29a6, 0x29a7, 0x29a8, 0x29a9, 0x29aa, 0x29ab, 0x29ac, 0x29ad, 0x29ae, 0x29af,
/* B_ */ 0x29b0, 0x29b1, 0x29b2, 0x29b3, 0x29b4, 0x29b5, 0x29b6, 0x29b7, 0x2298, 0x29b9, 0x29ba, 0x29bb, 0x29bc, 0x29bd, 0x29be, 0x29bf,
/* C_ */ 0x29c1, 0x29c0, 0x29c2, 0x29c3, 0x29c5, 0x29c4, 0x29c6, 0x29c7, 0x29c8, 0x29c9, 0x29ca, 0x29cb, 0x29cc, 0x29cd, 0x29ce, 0x29d0,
/* D_ */ 0x29cf, 0x29d2, 0x29d1, 0x29d3, 0x29d5, 0x29d4, 0x29d6, 0x29d7, 0x29d9, 0x29d8, 0x29db, 0x29da, 0x29dc, 0x29dd, 0x29de, 0x29df,
/* E_ */ 0x29e0, 0x29e1, 0x29e2, 0x29e3, 0x29e4, 0x29e5, 0x29e6, 0x29e7, 0x29e8, 0x29e9, 0x29ea, 0x29eb, 0x29ec, 0x29ed, 0x29ee, 0x29ef,
/* F_ */ 0x29f0, 0x29f1, 0x29f2, 0x29f3, 0x29f4, 0x2215, 0x29f6, 0x29f7, 0x29f9, 0x29f8, 0x29fa, 0x29fb, 0x29fd, 0x29fc, 0x29fe, 0x29ff
},
{
/* Block U2A__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_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, 0x2ef8, 0x2ef9, 0x2efa, 0x2efb, 0x2efc, 0x2efd, 0x2efe, 0x2eff
},
{
/* Block U30__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0x3000, 0x3001, 0x3002, 0x3003, 0x3004, 0x3005, 0x3006, 0x3007, 0x3009, 0x3008, 0x300b, 0x300a, 0x300d, 0x300c, 0x300f, 0x300e,
/* 1_ */ 0x3011, 0x3010, 0x3012, 0x3013, 0x3015, 0x3014, 0x3017, 0x3016, 0x3019, 0x3018, 0x301b, 0x301a, 0x301c, 0x301d, 0x301e, 0x301f,
/* 2_ */ 0x3020, 0x3021, 0x3022, 0x3023, 0x3024, 0x3025, 0x3026, 0x3027, 0x3028, 0x3029, 0x302a, 0x302b, 0x302c, 0x302d, 0x302e, 0x302f,
/* 3_ */ 0x3030, 0x3031, 0x3032, 0x3033, 0x3034, 0x3035, 0x3036, 0x3037, 0x3038, 0x3039, 0x303a, 0x303b, 0x303c, 0x303d, 0x303e, 0x303f,
/* 4_ */ 0x3040, 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, 0x3049, 0x304a, 0x304b, 0x304c, 0x304d, 0x304e, 0x304f,
/* 5_ */ 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305a, 0x305b, 0x305c, 0x305d, 0x305e, 0x305f,
/* 6_ */ 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306a, 0x306b, 0x306c, 0x306d, 0x306e, 0x306f,
/* 7_ */ 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307a, 0x307b, 0x307c, 0x307d, 0x307e, 0x307f,
/* 8_ */ 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308a, 0x308b, 0x308c, 0x308d, 0x308e, 0x308f,
/* 9_ */ 0x3090, 0x3091, 0x3092, 0x3093, 0x3094, 0x3095, 0x3096, 0x3097, 0x3098, 0x3099, 0x309a, 0x309b, 0x309c, 0x309d, 0x309e, 0x309f,
/* A_ */ 0x30a0, 0x30a1, 0x30a2, 0x30a3, 0x30a4, 0x30a5, 0x30a6, 0x30a7, 0x30a8, 0x30a9, 0x30aa, 0x30ab, 0x30ac, 0x30ad, 0x30ae, 0x30af,
/* B_ */ 0x30b0, 0x30b1, 0x30b2, 0x30b3, 0x30b4, 0x30b5, 0x30b6, 0x30b7, 0x30b8, 0x30b9, 0x30ba, 0x30bb, 0x30bc, 0x30bd, 0x30be, 0x30bf,
/* C_ */ 0x30c0, 0x30c1, 0x30c2, 0x30c3, 0x30c4, 0x30c5, 0x30c6, 0x30c7, 0x30c8, 0x30c9, 0x30ca, 0x30cb, 0x30cc, 0x30cd, 0x30ce, 0x30cf,
/* D_ */ 0x30d0, 0x30d1, 0x30d2, 0x30d3, 0x30d4, 0x30d5, 0x30d6, 0x30d7, 0x30d8, 0x30d9, 0x30da, 0x30db, 0x30dc, 0x30dd, 0x30de, 0x30df,
/* E_ */ 0x30e0, 0x30e1, 0x30e2, 0x30e3, 0x30e4, 0x30e5, 0x30e6, 0x30e7, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec, 0x30ed, 0x30ee, 0x30ef,
/* F_ */ 0x30f0, 0x30f1, 0x30f2, 0x30f3, 0x30f4, 0x30f5, 0x30f6, 0x30f7, 0x30f8, 0x30f9, 0x30fa, 0x30fb, 0x30fc, 0x30fd, 0x30fe, 0x30ff
},
{
/* Block UFE__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0xfe00, 0xfe01, 0xfe02, 0xfe03, 0xfe04, 0xfe05, 0xfe06, 0xfe07, 0xfe08, 0xfe09, 0xfe0a, 0xfe0b, 0xfe0c, 0x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fe8e, 0xfe8f,
/* 9_ */ 0xfe90, 0xfe91, 0xfe92, 0xfe93, 0xfe94, 0xfe95, 0xfe96, 0xfe97, 0xfe98, 0xfe99, 0xfe9a, 0xfe9b, 0xfe9c, 0xfe9d, 0xfe9e, 0xfe9f,
/* A_ */ 0xfea0, 0xfea1, 0xfea2, 0xfea3, 0xfea4, 0xfea5, 0xfea6, 0xfea7, 0xfea8, 0xfea9, 0xfeaa, 0xfeab, 0xfeac, 0xfead, 0xfeae, 0xfeaf,
/* B_ */ 0xfeb0, 0xfeb1, 0xfeb2, 0xfeb3, 0xfeb4, 0xfeb5, 0xfeb6, 0xfeb7, 0xfeb8, 0xfeb9, 0xfeba, 0xfebb, 0xfebc, 0xfebd, 0xfebe, 0xfebf,
/* C_ */ 0xfec0, 0xfec1, 0xfec2, 0xfec3, 0xfec4, 0xfec5, 0xfec6, 0xfec7, 0xfec8, 0xfec9, 0xfeca, 0xfecb, 0xfecc, 0xfecd, 0xfece, 0xfecf,
/* D_ */ 0xfed0, 0xfed1, 0xfed2, 0xfed3, 0xfed4, 0xfed5, 0xfed6, 0xfed7, 0xfed8, 0xfed9, 0xfeda, 0xfedb, 0xfedc, 0xfedd, 0xfede, 0xfedf,
/* E_ */ 0xfee0, 0xfee1, 0xfee2, 0xfee3, 0xfee4, 0xfee5, 0xfee6, 0xfee7, 0xfee8, 0xfee9, 0xfeea, 0xfeeb, 0xfeec, 0xfeed, 0xfeee, 0xfeef,
/* F_ */ 0xfef0, 0xfef1, 0xfef2, 0xfef3, 0xfef4, 0xfef5, 0xfef6, 0xfef7, 0xfef8, 0xfef9, 0xfefa, 0xfefb, 0xfefc, 0xfefd, 0xfefe, 0xfeff
},
{
/* Block UFF__ */
/* _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F */
/* 0_ */ 0xff00, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07, 0xff09, 0xff08, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f,
/* 1_ */ 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1e, 0xff1d, 0xff1c, 0xff1f,
/* 2_ */ 0xff20, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f,
/* 3_ */ 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, 0xff39, 0xff3a, 0xff3d, 0xff3c, 0xff3b, 0xff3e, 0xff3f,
/* 4_ */ 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
/* 5_ */ 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, 0xff58, 0xff59, 0xff5a, 0xff5d, 0xff5c, 0xff5b, 0xff5e, 0xff60,
/* 6_ */ 0xff5f, 0xff61, 0xff63, 0xff62, 0xff64, 0xff65, 0xff66, 0xff67, 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
/* 7_ */ 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77, 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f,
/* 8_ */ 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87, 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f,
/* 9_ */ 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97, 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f,
/* A_ */ 0xffa0, 0xffa1, 0xffa2, 0xffa3, 0xffa4, 0xffa5, 0xffa6, 0xffa7, 0xffa8, 0xffa9, 0xffaa, 0xffab, 0xffac, 0xffad, 0xffae, 0xffaf,
/* B_ */ 0xffb0, 0xffb1, 0xffb2, 0xffb3, 0xffb4, 0xffb5, 0xffb6, 0xffb7, 0xffb8, 0xffb9, 0xffba, 0xffbb, 0xffbc, 0xffbd, 0xffbe, 0xffbf,
/* C_ */ 0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc4, 0xffc5, 0xffc6, 0xffc7, 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf,
/* D_ */ 0xffd0, 0xffd1, 0xffd2, 0xffd3, 0xffd4, 0xffd5, 0xffd6, 0xffd7, 0xffd8, 0xffd9, 0xffda, 0xffdb, 0xffdc, 0xffdd, 0xffde, 0xffdf,
/* E_ */ 0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe4, 0xffe5, 0xffe6, 0xffe7, 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec, 0xffed, 0xffee, 0xffef,
/* F_ */ 0xfff0, 0xfff1, 0xfff2, 0xfff3, 0xfff4, 0xfff5, 0xfff6, 0xfff7, 0xfff8, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd, 0xfffe, 0xffff
}
};
static PRUint32 Mirrored(PRUint32 u)
{
if (u < 0x10000) {
PRUint8 index = symmtable_index[(u & 0xFFFFFF00) >> 8];
if (index) {
return symmtable[index - 1] [u & 0xFF];
}
}
return u;
}

View File

@ -61,22 +61,8 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IELEMENTOBSERVER_IID)
enum { IS_DOCUMENT_WRITE = 1U };
/*
* Subject call observer when the parser hit the tag
* @param aDocumentID- ID of the document
* @param aTag- the tag
* @param numOfAttributes - number of attributes
* @param nameArray - array of name.
* @param valueArray - array of value
*/
NS_IMETHOD Notify(PRUint32 aDocumentID, eHTMLTags aTag,
PRUint32 numOfAttributes, const PRUnichar* nameArray[],
const PRUnichar* valueArray[]) = 0;
NS_IMETHOD Notify(PRUint32 aDocumentID, const PRUnichar* aTag,
PRUint32 numOfAttributes, const PRUnichar* nameArray[],
const PRUnichar* valueArray[]) = 0;
/* Subject call observer when the parser hit the tag */
NS_IMETHOD Notify(nsISupports* aDocShell,
nsISupports* aChannel,
const PRUnichar* aTag,

View File

@ -64,10 +64,6 @@ class nsIParserFilter : public nsISupports {
NS_IMETHOD RawBuffer(const char * buffer, PRUint32 * buffer_length) = 0;
NS_IMETHOD WillAddToken(CToken & token) = 0;
NS_IMETHOD ProcessTokens( /* don't know what goes here yet */ void ) = 0;
NS_IMETHOD Finish() = 0;
};

View File

@ -206,9 +206,6 @@ nsGlobalHistory::OpenDB
<font>
nsFontCache::
<font>
nsFontMetricsGTK::
<font>
nsFont::nsFont

View File

@ -556,215 +556,6 @@ __builtin_new
__builtin_vec_new
xptiTypelibGuts::xptiTypelibGuts(XPTHeader *)
# ----------------------------------------------------------------------
#
# nsFontMetricsGTK
#
<nsFontMetricsGTK>
__builtin_new
nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int)
nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *)
<nsFontMetricsGTK>
__builtin_new
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
nsCompressedCharMap::NewCCMap(void)
MapToCCMap(unsigned int *)
MapperToCCMap(nsICharRepresentable *)
nsFontMetricsGTK::GetFontHandle(void *&)
<nsFontMetricsGTK>
PR_Malloc
nsVoidArray::SizeTo(int)
nsVoidArray::GrowArrayBy(int)
nsVoidArray::InsertElementAt(void *, int)
nsTArray<nsCString>::InsertElementAt(int, nsCString const &)
nsFontMetricsGTK::QueryInterface(nsID const &, void **)
<nsFontMetricsGTK>
__builtin_new
nsCStringKey::Clone(void) const
nsHashtable::Put(nsHashKey *, void *)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
__builtin_new
__builtin_vec_new
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Calloc
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
__builtin_vec_new
nsDrawingSurfaceGTK type_info function
nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *)
<nsFontMetricsGTK>
__builtin_new
nsFontWeight::operator new(unsigned int)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
__builtin_new
nsFontNode::operator new(unsigned int)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
__builtin_new
nsFontStretch::operator new(unsigned int)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
__builtin_new
nsFontStyle::operator new(unsigned int)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
PL_HashTableFinalize(PLHashTable *)
PL_HashTableRawAdd
nsHashtable::Put(nsHashKey *, void *)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Realloc
PR_vsxprintf
PR_WaitForPollableEvent
PR_vsmprintf
PR_smprintf
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
PR_vsxprintf
PR_WaitForPollableEvent
PR_WaitForPollableEvent
PR_WaitForPollableEvent
PR_vsmprintf
PR_smprintf
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Realloc
PR_vsxprintf
PR_WaitForPollableEvent
PR_WaitForPollableEvent
PR_WaitForPollableEvent
PR_vsmprintf
PR_smprintf
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Realloc
nsFontMetricsGTK::PickASizeAndLoad(nsFontStretch *, nsFontCharSetInfo *, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
PL_HashTableFinalize(PLHashTable *)
PL_HashTableInit(PLHashTable *, unsigned int, unsigned int (*)(void const *), int (*)(void const *, void const *), int (*)(void const *, void const *), PLHashAllocOps const *, void *)
nsHashtable::nsHashtable(unsigned int, int)
nsDrawingSurfaceGTK type_info function
nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *)
<nsFontMetricsGTK>
PR_Malloc
PL_HashTableFinalize(PLHashTable *)
PL_HashTableRawAdd
nsHashtable::Put(nsHashKey *, void *)
nsDrawingSurfaceGTK type_info function
nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *)
<nsFontMetricsGTK>
__builtin_new
nsFontMetricsGTK::SearchNode
<nsFontMetricsGTK>
PR_Malloc
PR_vsxprintf
PR_WaitForPollableEvent
PR_WaitForPollableEvent
PR_vsmprintf
PR_smprintf
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
PL_HashTableFinalize(PLHashTable *)
PL_HashTableRawAdd
nsHashtable::Put(nsHashKey *, void *)
nsFontMetricsGTK::TryNodes(nsACString &, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
PL_HashTableFinalize(PLHashTable *)
PL_HashTableRawAdd
nsHashtable::Put(nsHashKey *, void *)
nsFontMetricsGTK::TryNode(nsCString *, unsigned short)
<nsFontMetricsGTK>
PR_Realloc
nsVoidArray::SizeTo(int)
nsAutoVoidArray::SizeTo(int)
nsVoidArray::GrowArrayBy(int)
nsVoidArray::InsertElementAt(void *, int)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Realloc
nsFontMetricsGTK::AddToLoadedFontsList(nsFontGTK *)
<nsFontMetricsGTK>
PR_Realloc
PR_vsxprintf
PR_WaitForPollableEvent
PR_WaitForPollableEvent
PR_vsmprintf
PR_smprintf
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
nsMemoryImpl::Alloc(unsigned int)
nsMemory::Alloc(unsigned int)
nsCStringKey::Clone(void) const
nsHashtable::Put(nsHashKey *, void *)
nsFontMetricsGTK::SearchNode(nsFontNode *, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
nsMemoryImpl::Alloc(unsigned int)
nsMemory::Alloc(unsigned int)
nsCStringKey::Clone(void) const
nsHashtable::Put(nsHashKey *, void *)
nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int)
nsFontMetricsGTK::Init(nsFont const &, nsIAtom *, nsIDeviceContext *)
<nsFontMetricsGTK>
PR_Malloc
nsMemoryImpl::Alloc(unsigned int)
nsMemory::Alloc(unsigned int)
nsCStringKey::Clone(void) const
nsHashtable::Put(nsHashKey *, void *)
nsFontMetricsGTK::TryNodes(nsACString &, unsigned short)
<nsFontMetricsGTK>
PR_Malloc
nsMemoryImpl::Alloc(unsigned int)
nsMemory::Alloc(unsigned int)
nsCStringKey::Clone(void) const
nsHashtable::Put(nsHashKey *, void *)
nsFontMetricsGTK::TryNode(nsCString *, unsigned short)
<nsFontMetricsGTK>
__builtin_new
nsFontMetricsGTK::TryNodes(nsACString &, unsigned short)
# ----------------------------------------------------------------------
#
# nsPluginTag
@ -2031,7 +1822,6 @@ nsDrawingSurfaceGTK type_info function
<nsDrawingSurfaceGTK>
PR_Malloc
nsCompressedCharMap::NewCCMap(void)
nsDrawingSurfaceGTK::Init(_GdkGC *, unsigned int, unsigned int, unsigned int)
# ----------------------------------------------------------------------