~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/intl/uconv/ucvmath/nsUCvMathModule.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
 
4
 *
 
5
 * The contents of this file are subject to the Netscape Public License
 
6
 * Version 1.1 (the "License"); you may not use this file except in
 
7
 * compliance with the License. You may obtain a copy of the License at
 
8
 * http://www.mozilla.org/NPL/
 
9
 *
 
10
 * Software distributed under the License is distributed on an "AS IS" basis,
 
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
 * for the specific language governing rights and limitations under the
 
13
 * License.
 
14
 *
 
15
 * The Original Code is mozilla.org code.
 
16
 *
 
17
 * The Initial Developer of the Original Code is 
 
18
 * Netscape Communications Corporation.
 
19
 * Portions created by the Initial Developer are Copyright (C) 2000
 
20
 * the Initial Developer. All Rights Reserved.
 
21
 *
 
22
 * Contributor(s):
 
23
 *   Roger B. Sidje <rbs@maths.uq.edu.au>
 
24
 *
 
25
 *
 
26
 * Alternatively, the contents of this file may be used under the terms of
 
27
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
28
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
29
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
30
 * of those above. If you wish to allow use of your version of this file only
 
31
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
32
 * use your version of this file under the terms of the NPL, indicate your
 
33
 * decision by deleting the provisions above and replace them with the notice
 
34
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
35
 * the provisions above, a recipient may use your version of this file under
 
36
 * the terms of any one of the NPL, the GPL or the LGPL.
 
37
 *
 
38
 * ***** END LICENSE BLOCK ***** */
 
39
 
 
40
#include "pratom.h"
 
41
#include "nspr.h"
 
42
#include "nsString.h"
 
43
#include "nsCOMPtr.h"
 
44
#include "nsIFactory.h"
 
45
#include "nsIGenericFactory.h"
 
46
#include "nsIServiceManager.h"
 
47
#include "nsICharsetConverterManager.h"
 
48
#include "nsICategoryManager.h"
 
49
#include "nsEncoderDecoderUtils.h"
 
50
#include "nsIModule.h"
 
51
#include "nsUCvMathCID.h"
 
52
#include "nsUCvMathDll.h"
 
53
#include "nsCRT.h"
 
54
 
 
55
#include "nsUnicodeToTeXCMRttf.h"
 
56
#include "nsUnicodeToTeXCMMIttf.h"
 
57
#include "nsUnicodeToTeXCMSYttf.h"
 
58
#include "nsUnicodeToTeXCMEXttf.h"
 
59
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC) && !defined(XP_MACOSX)
 
60
#include "nsUnicodeToTeXCMRt1.h"
 
61
#include "nsUnicodeToTeXCMMIt1.h"
 
62
#include "nsUnicodeToTeXCMSYt1.h"
 
63
#include "nsUnicodeToTeXCMEXt1.h"
 
64
#endif
 
65
#include "nsUnicodeToMathematica1.h"
 
66
#include "nsUnicodeToMathematica2.h"
 
67
#include "nsUnicodeToMathematica3.h"
 
68
#include "nsUnicodeToMathematica4.h"
 
69
#include "nsUnicodeToMathematica5.h"
 
70
#include "nsUnicodeToMTExtra.h"
 
71
 
 
72
//----------------------------------------------------------------------------
 
73
// Global functions and data [declaration]
 
74
 
 
75
#define DECODER_NAME_BASE "Unicode Decoder-"
 
76
#define ENCODER_NAME_BASE "Unicode Encoder-"
 
77
 
 
78
NS_CONVERTER_REGISTRY_START
 
79
 
 
80
NS_UCONV_REG_UNREG_ENCODER("x-ttf-cmr",   NS_UNICODETOTEXCMRTTF_CID)
 
81
NS_UCONV_REG_UNREG_ENCODER("x-ttf-cmmi",  NS_UNICODETOTEXCMMITTF_CID)
 
82
NS_UCONV_REG_UNREG_ENCODER("x-ttf-cmsy",  NS_UNICODETOTEXCMSYTTF_CID)
 
83
NS_UCONV_REG_UNREG_ENCODER("x-ttf-cmex",  NS_UNICODETOTEXCMEXTTF_CID)
 
84
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC) && !defined(XP_MACOSX)
 
85
NS_UCONV_REG_UNREG_ENCODER("x-t1-cmr",   NS_UNICODETOTEXCMRT1_CID)
 
86
NS_UCONV_REG_UNREG_ENCODER("x-t1-cmmi",  NS_UNICODETOTEXCMMIT1_CID)
 
87
NS_UCONV_REG_UNREG_ENCODER("x-t1-cmsy",  NS_UNICODETOTEXCMSYT1_CID)
 
88
NS_UCONV_REG_UNREG_ENCODER("x-t1-cmex",  NS_UNICODETOTEXCMEXT1_CID)
 
89
#endif
 
90
NS_UCONV_REG_UNREG_ENCODER("x-mathematica1",  NS_UNICODETOMATHEMATICA1_CID)
 
91
NS_UCONV_REG_UNREG_ENCODER("x-mathematica2",  NS_UNICODETOMATHEMATICA2_CID)
 
92
NS_UCONV_REG_UNREG_ENCODER("x-mathematica3",  NS_UNICODETOMATHEMATICA3_CID)
 
93
NS_UCONV_REG_UNREG_ENCODER("x-mathematica4",  NS_UNICODETOMATHEMATICA4_CID)
 
94
NS_UCONV_REG_UNREG_ENCODER("x-mathematica5",  NS_UNICODETOMATHEMATICA5_CID)
 
95
NS_UCONV_REG_UNREG_ENCODER("x-mtextra",  NS_UNICODETOMTEXTRA_CID)
 
96
 
 
97
NS_CONVERTER_REGISTRY_END
 
98
 
 
99
NS_IMPL_NSUCONVERTERREGSELF
 
100
 
 
101
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMRttf)
 
102
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMMIttf)
 
103
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMSYttf)
 
104
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMEXttf)
 
105
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC) && !defined(XP_MACOSX)
 
106
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMRt1)
 
107
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMMIt1)
 
108
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMSYt1)
 
109
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToTeXCMEXt1)
 
110
#endif
 
111
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica1)
 
112
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica2)
 
113
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica3)
 
114
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica4)
 
115
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMathematica5)
 
116
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeToMTExtra)
 
117
 
 
118
static const nsModuleComponentInfo components[] = 
 
119
{
 
120
  { 
 
121
    ENCODER_NAME_BASE "x-ttf-cmr" , NS_UNICODETOTEXCMRTTF_CID, 
 
122
    NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmr",
 
123
    nsUnicodeToTeXCMRttfConstructor, 
 
124
  },
 
125
  { 
 
126
    ENCODER_NAME_BASE "x-ttf-cmmi" , NS_UNICODETOTEXCMMITTF_CID, 
 
127
    NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmmi",
 
128
    nsUnicodeToTeXCMMIttfConstructor, 
 
129
  },
 
130
  { 
 
131
    ENCODER_NAME_BASE "x-ttf-cmsy" , NS_UNICODETOTEXCMSYTTF_CID, 
 
132
    NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmsy",
 
133
    nsUnicodeToTeXCMSYttfConstructor, 
 
134
  },
 
135
  { 
 
136
    ENCODER_NAME_BASE "x-ttf-cmex" , NS_UNICODETOTEXCMEXTTF_CID, 
 
137
    NS_UNICODEENCODER_CONTRACTID_BASE "x-ttf-cmex",
 
138
    nsUnicodeToTeXCMEXttfConstructor, 
 
139
  },
 
140
#if !defined(XP_WIN) && !defined(XP_OS2) && !defined(XP_MAC) && !defined(XP_MACOSX)
 
141
  { 
 
142
    ENCODER_NAME_BASE "x-t1-cmr" , NS_UNICODETOTEXCMRT1_CID, 
 
143
    NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmr",
 
144
    nsUnicodeToTeXCMRt1Constructor, 
 
145
  },
 
146
  { 
 
147
    ENCODER_NAME_BASE "x-t1-cmmi" , NS_UNICODETOTEXCMMIT1_CID, 
 
148
    NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmmi",
 
149
    nsUnicodeToTeXCMMIt1Constructor, 
 
150
  },
 
151
  { 
 
152
    ENCODER_NAME_BASE "x-t1-cmsy" , NS_UNICODETOTEXCMSYT1_CID, 
 
153
    NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmsy",
 
154
    nsUnicodeToTeXCMSYt1Constructor, 
 
155
  },
 
156
  { 
 
157
    ENCODER_NAME_BASE "x-t1-cmex" , NS_UNICODETOTEXCMEXT1_CID, 
 
158
    NS_UNICODEENCODER_CONTRACTID_BASE "x-t1-cmex",
 
159
    nsUnicodeToTeXCMEXt1Constructor, 
 
160
  },
 
161
#endif
 
162
  { 
 
163
    ENCODER_NAME_BASE "x-mathematica1" , NS_UNICODETOMATHEMATICA1_CID, 
 
164
    NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica1",
 
165
    nsUnicodeToMathematica1Constructor, 
 
166
    nsUConverterRegSelf, nsUConverterUnregSelf,
 
167
  },
 
168
  { 
 
169
    ENCODER_NAME_BASE "x-mathematica2" , NS_UNICODETOMATHEMATICA2_CID, 
 
170
    NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica2",
 
171
    nsUnicodeToMathematica2Constructor, 
 
172
  },
 
173
  { 
 
174
    ENCODER_NAME_BASE "x-mathematica3" , NS_UNICODETOMATHEMATICA3_CID, 
 
175
    NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica3",
 
176
    nsUnicodeToMathematica3Constructor, 
 
177
  },
 
178
  { 
 
179
    ENCODER_NAME_BASE "x-mathematica4" , NS_UNICODETOMATHEMATICA4_CID, 
 
180
    NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica4",
 
181
    nsUnicodeToMathematica4Constructor, 
 
182
  },
 
183
  { 
 
184
    ENCODER_NAME_BASE "x-mathematica5" , NS_UNICODETOMATHEMATICA5_CID, 
 
185
    NS_UNICODEENCODER_CONTRACTID_BASE "x-mathematica5",
 
186
    nsUnicodeToMathematica5Constructor, 
 
187
  },
 
188
  { 
 
189
    ENCODER_NAME_BASE "x-mtextra" , NS_UNICODETOMTEXTRA_CID, 
 
190
    NS_UNICODEENCODER_CONTRACTID_BASE "x-mtextra",
 
191
    nsUnicodeToMTExtraConstructor, 
 
192
  }
 
193
};
 
194
 
 
195
NS_IMPL_NSGETMODULE(nsUCvMathModule, components)
 
196