2001-09-26 04:47:52 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
2000-03-23 12:31:16 +03:00
|
|
|
*
|
2001-09-26 04:47:52 +04:00
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.1 (the "License"); you may not use this file except in
|
|
|
|
* compliance with the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/NPL/
|
2000-03-23 12:31:16 +03:00
|
|
|
*
|
2001-09-26 04:47:52 +04:00
|
|
|
* 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.
|
2000-03-23 12:31:16 +03:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-26 04:47:52 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2000-03-23 12:31:16 +03:00
|
|
|
*
|
2001-09-26 04:47:52 +04:00
|
|
|
* Contributor(s):
|
2000-03-23 12:31:16 +03:00
|
|
|
* Roger B. Sidje <rbs@maths.uq.edu.au>
|
|
|
|
*
|
|
|
|
*
|
2001-09-26 04:47:52 +04:00
|
|
|
* 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 NPL, 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 NPL, the GPL or the LGPL.
|
2001-09-20 04:02:59 +04:00
|
|
|
*
|
2001-09-26 04:47:52 +04:00
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2000-03-23 12:31:16 +03:00
|
|
|
|
|
|
|
#include "pratom.h"
|
|
|
|
#include "nspr.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIFactory.h"
|
|
|
|
#include "nsIRegistry.h"
|
2001-01-27 02:54:31 +03:00
|
|
|
#include "nsIGenericFactory.h"
|
2000-03-23 12:31:16 +03:00
|
|
|
#include "nsIServiceManager.h"
|
2001-01-27 02:54:31 +03:00
|
|
|
#include "nsICharsetConverterManager.h"
|
2000-03-23 12:31:16 +03:00
|
|
|
#include "nsIModule.h"
|
|
|
|
#include "nsUCvMathCID.h"
|
|
|
|
#include "nsUCvMathDll.h"
|
|
|
|
|
2001-03-27 16:41:48 +04:00
|
|
|
#include "nsUnicodeToTeXCMRttf.h"
|
|
|
|
#include "nsUnicodeToTeXCMMIttf.h"
|
2000-03-23 12:31:16 +03:00
|
|
|
#include "nsUnicodeToTeXCMSYttf.h"
|
|
|
|
#include "nsUnicodeToTeXCMEXttf.h"
|
2002-02-24 03:26:54 +03:00
|
|
|
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC)
|
2001-03-27 16:41:48 +04:00
|
|
|
#include "nsUnicodeToTeXCMRt1.h"
|
|
|
|
#include "nsUnicodeToTeXCMMIt1.h"
|
|
|
|
#include "nsUnicodeToTeXCMSYt1.h"
|
2000-03-23 12:31:16 +03:00
|
|
|
#include "nsUnicodeToTeXCMEXt1.h"
|
2001-03-27 16:41:48 +04:00
|
|
|
#endif
|
2000-03-23 12:31:16 +03:00
|
|
|
#include "nsUnicodeToMathematica1.h"
|
|
|
|
#include "nsUnicodeToMathematica2.h"
|
|
|
|
#include "nsUnicodeToMathematica3.h"
|
|
|
|
#include "nsUnicodeToMathematica4.h"
|
|
|
|
#include "nsUnicodeToMathematica5.h"
|
|
|
|
#include "nsUnicodeToMTExtra.h"
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
// Global functions and data [declaration]
|
|
|
|
|
|
|
|
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
|
|
|
|
|
|
|
#define DECODER_NAME_BASE "Unicode Decoder-"
|
|
|
|
#define ENCODER_NAME_BASE "Unicode Encoder-"
|
|
|
|
|
2002-02-15 18:12:23 +03:00
|
|
|
NS_CONVERTER_REGISTRY_START
|
2001-01-27 02:54:31 +03:00
|
|
|
|
2002-02-15 18:12:23 +03:00
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-ttf-cmr", NS_UNICODETOTEXCMRTTF_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-ttf-cmmi", NS_UNICODETOTEXCMMITTF_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-ttf-cmsy", NS_UNICODETOTEXCMSYTTF_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-ttf-cmex", NS_UNICODETOTEXCMEXTTF_CID)
|
2002-02-24 03:26:54 +03:00
|
|
|
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC)
|
2002-02-15 18:12:23 +03:00
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-t1-cmr", NS_UNICODETOTEXCMRT1_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-t1-cmmi", NS_UNICODETOTEXCMMIT1_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-t1-cmsy", NS_UNICODETOTEXCMSYT1_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-t1-cmex", NS_UNICODETOTEXCMEXT1_CID)
|
2001-03-27 16:41:48 +04:00
|
|
|
#endif
|
2002-02-15 18:12:23 +03:00
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-mathematica1", NS_UNICODETOMATHEMATICA1_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-mathematica2", NS_UNICODETOMATHEMATICA2_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-mathematica3", NS_UNICODETOMATHEMATICA3_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-mathematica4", NS_UNICODETOMATHEMATICA4_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-mathematica5", NS_UNICODETOMATHEMATICA5_CID)
|
|
|
|
NS_UCONV_REG_UNREG("Unicode", "x-mtextra", NS_UNICODETOMTEXTRA_CID)
|
|
|
|
|
|
|
|
NS_CONVERTER_REGISTRY_END
|
|
|
|
|
|
|
|
NS_IMPL_NSUCONVERTERREGSELF
|
2001-01-27 02:54:31 +03:00
|
|
|
|
2001-03-27 16:41:48 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMRttf);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMMIttf);
|
2001-01-27 02:54:31 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMSYttf);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMEXttf);
|
2002-02-24 03:26:54 +03:00
|
|
|
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC)
|
2001-03-27 16:41:48 +04:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMRt1);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMMIt1);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMSYt1);
|
2001-01-27 02:54:31 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMEXt1);
|
2001-03-27 16:41:48 +04:00
|
|
|
#endif
|
2001-01-27 02:54:31 +03:00
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica1);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica2);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica3);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica4);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica5);
|
|
|
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMTExtra);
|
|
|
|
|
2002-01-31 00:14:20 +03:00
|
|
|
static const nsModuleComponentInfo components[] =
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
2001-03-27 16:41:48 +04:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-ttf-cmr" , NS_UNICODETOTEXCMRTTF_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmr",
|
|
|
|
nsUnicodeToTeXCMRttfConstructor,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-ttf-cmmi" , NS_UNICODETOTEXCMMITTF_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmmi",
|
|
|
|
nsUnicodeToTeXCMMIttfConstructor,
|
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-ttf-cmsy" , NS_UNICODETOTEXCMSYTTF_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmsy",
|
|
|
|
nsUnicodeToTeXCMSYttfConstructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-ttf-cmex" , NS_UNICODETOTEXCMEXTTF_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmex",
|
|
|
|
nsUnicodeToTeXCMEXttfConstructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2002-02-24 03:26:54 +03:00
|
|
|
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC)
|
2001-03-27 16:41:48 +04:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-t1-cmr" , NS_UNICODETOTEXCMRT1_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmr",
|
|
|
|
nsUnicodeToTeXCMRt1Constructor,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-t1-cmmi" , NS_UNICODETOTEXCMMIT1_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmmi",
|
|
|
|
nsUnicodeToTeXCMMIt1Constructor,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-t1-cmsy" , NS_UNICODETOTEXCMSYT1_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmsy",
|
|
|
|
nsUnicodeToTeXCMSYt1Constructor,
|
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-t1-cmex" , NS_UNICODETOTEXCMEXT1_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmex",
|
|
|
|
nsUnicodeToTeXCMEXt1Constructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2001-03-27 16:41:48 +04:00
|
|
|
#endif
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-mathematica1" , NS_UNICODETOMATHEMATICA1_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica1",
|
|
|
|
nsUnicodeToMathematica1Constructor,
|
2002-02-15 18:12:23 +03:00
|
|
|
nsUConverterRegSelf, nsUConverterUnregSelf,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-mathematica2" , NS_UNICODETOMATHEMATICA2_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica2",
|
|
|
|
nsUnicodeToMathematica2Constructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-mathematica3" , NS_UNICODETOMATHEMATICA3_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica3",
|
|
|
|
nsUnicodeToMathematica3Constructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-mathematica4" , NS_UNICODETOMATHEMATICA4_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica4",
|
|
|
|
nsUnicodeToMathematica4Constructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-mathematica5" , NS_UNICODETOMATHEMATICA5_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica5",
|
|
|
|
nsUnicodeToMathematica5Constructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
},
|
2001-01-27 02:54:31 +03:00
|
|
|
{
|
|
|
|
ENCODER_NAME_BASE "x-mtextra" , NS_UNICODETOMTEXTRA_CID,
|
|
|
|
NS_UNICODEENCODER_CONTRACTID_BASE "x-mtextra",
|
|
|
|
nsUnicodeToMTExtraConstructor,
|
2000-03-23 12:31:16 +03:00
|
|
|
}
|
2001-01-27 02:54:31 +03:00
|
|
|
};
|
2000-03-23 12:31:16 +03:00
|
|
|
|
2001-05-05 09:33:37 +04:00
|
|
|
NS_IMPL_NSGETMODULE(nsUCvMathModule, components);
|
2000-03-23 12:31:16 +03:00
|
|
|
|