docthemes: Save themes def. to a file when added to ColorSets
[LibreOffice.git] / starmath / source / mathml / starmathdatabase.cxx
blobb8d3823bbf5b21f421ee4e09f331b24cc02bcf26
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <starmathdatabase.hxx>
21 #include <types.hxx>
23 SmToken starmathdatabase::Identify_SmXMLOperatorContext_Impl(std::u16string_view rText,
24 bool bIsStretchy, sal_Int32 nIndex)
26 auto cChar = o3tl::iterateCodePoints(rText, &nIndex);
27 switch (cChar)
29 case MS_COPROD:
30 return SmToken(TCOPROD, MS_COPROD, u"coprod"_ustr, TG::Oper, 5);
31 case MS_IIINT:
32 return SmToken(TIIINT, MS_IIINT, u"iiint"_ustr, TG::Oper, 5);
33 case MS_IINT:
34 return SmToken(TIINT, MS_IINT, u"iint"_ustr, TG::Oper, 5);
35 case MS_INT:
36 if (bIsStretchy)
37 return SmToken(TINTD, MS_INT, u"intd"_ustr, TG::Oper, 5);
38 else
39 return SmToken(TINT, MS_INT, u"int"_ustr, TG::Oper, 5);
40 case MS_LINT:
41 return SmToken(TLINT, MS_LINT, u"lint"_ustr, TG::Oper, 5);
42 case MS_LLINT:
43 return SmToken(TLLINT, MS_LLINT, u"llint"_ustr, TG::Oper, 5);
44 case MS_LLLINT:
45 return SmToken(TLLLINT, MS_LLLINT, u"lllint"_ustr, TG::Oper, 5);
46 case MS_PROD:
47 return SmToken(TPROD, MS_PROD, u"prod"_ustr, TG::Oper, 5);
48 case MS_SUM:
49 return SmToken(TSUM, MS_SUM, u"sum"_ustr, TG::Oper, 5);
50 case MS_MAJ:
51 return SmToken(TSUM, MS_MAJ, u"maj"_ustr, TG::Oper, 5);
52 case MS_FACT:
53 return SmToken(TFACT, MS_FACT, u"!"_ustr, TG::UnOper, 5);
54 case MS_NEG:
55 return SmToken(TNEG, MS_NEG, u"neg"_ustr, TG::UnOper, 5);
56 case MS_OMINUS:
57 return SmToken(TOMINUS, MS_OMINUS, u"ominus"_ustr, TG::Sum, 0);
58 case MS_OPLUS:
59 return SmToken(TOPLUS, MS_OPLUS, u"oplus"_ustr, TG::Sum, 0);
60 case MS_UNION:
61 return SmToken(TUNION, MS_UNION, u"union"_ustr, TG::Sum, 0);
62 case MS_OR:
63 return SmToken(TOR, MS_OR, u"|"_ustr, TG::Sum, 5);
64 case MS_PLUSMINUS:
65 return SmToken(TPLUSMINUS, MS_PLUSMINUS, u"+-"_ustr, TG::Sum | TG::UnOper, 5);
66 case MS_MINUSPLUS:
67 return SmToken(TMINUSPLUS, MS_MINUSPLUS, u"-+"_ustr, TG::Sum | TG::UnOper, 5);
68 case 0xe083:
69 case MS_PLUS:
70 return SmToken(TPLUS, MS_PLUS, u"+"_ustr, TG::Sum | TG::UnOper, 5);
71 case MS_MINUS:
72 return SmToken(TMINUS, MS_MINUS, u"-"_ustr, TG::Sum | TG::UnOper, 5);
73 case 0x2022:
74 case MS_CDOT:
75 return SmToken(TCDOT, MS_CDOT, u"cdot"_ustr, TG::Product, 0);
76 case MS_DIV:
77 return SmToken(TDIV, MS_DIV, u"div"_ustr, TG::Product, 0);
78 case MS_TIMES:
79 return SmToken(TTIMES, MS_TIMES, u"times"_ustr, TG::Product, 0);
80 case MS_INTERSECT:
81 return SmToken(TINTERSECT, MS_INTERSECT, u"intersection"_ustr, TG::Product, 0);
82 case MS_ODIVIDE:
83 return SmToken(TODIVIDE, MS_ODIVIDE, u"odivide"_ustr, TG::Product, 0);
84 case MS_ODOT:
85 return SmToken(TODOT, MS_ODOT, u"odot"_ustr, TG::Product, 0);
86 case MS_OTIMES:
87 return SmToken(TOTIMES, MS_OTIMES, u"otimes"_ustr, TG::Product, 0);
88 case MS_AND:
89 return SmToken(TAND, MS_AND, u"&"_ustr, TG::Product, 0);
90 case MS_MULTIPLY:
91 return SmToken(TMULTIPLY, MS_MULTIPLY, u"*"_ustr, TG::Product, 0);
92 case MS_SLASH:
93 if (bIsStretchy)
94 return SmToken(TWIDESLASH, MS_SLASH, u"wideslash"_ustr, TG::Product, 0);
95 else
96 return SmToken(TSLASH, MS_SLASH, u"slash"_ustr, TG::Product, 0);
97 case MS_BACKSLASH:
98 if (bIsStretchy)
99 return SmToken(TWIDEBACKSLASH, MS_BACKSLASH, u"widebslash"_ustr, TG::Product, 0);
100 else
101 return SmToken(TBACKSLASH, MS_BACKSLASH, u"bslash"_ustr, TG::Product, 0);
102 case MS_DEF:
103 return SmToken(TDEF, MS_DEF, u"def"_ustr, TG::Relation, 0);
104 case MS_LINE:
105 return SmToken(TDIVIDES, MS_LINE, u"divides"_ustr, TG::Relation, 0);
106 case MS_EQUIV:
107 return SmToken(TEQUIV, MS_EQUIV, u"equiv"_ustr, TG::Relation, 0);
108 case MS_GE:
109 return SmToken(TGE, MS_GE, u">="_ustr, TG::Relation, 0);
110 case MS_GESLANT:
111 return SmToken(TGESLANT, MS_GESLANT, u"geslant"_ustr, TG::Relation, 0);
112 case MS_GG:
113 return SmToken(TGG, MS_GG, u">>"_ustr, TG::Relation, 0);
114 case MS_GT:
115 return SmToken(TGT, MS_GT, u">"_ustr, TG::Relation, 0);
116 case MS_IN:
117 return SmToken(TIN, MS_IN, u"in"_ustr, TG::Relation, 0);
118 case MS_LE:
119 return SmToken(TLE, MS_LE, u"<="_ustr, TG::Relation, 0);
120 case MS_LESLANT:
121 return SmToken(TLESLANT, MS_LESLANT, u"leslant"_ustr, TG::Relation, 0);
122 case MS_LL:
123 return SmToken(TLL, MS_LL, u"<<"_ustr, TG::Relation, 0);
124 case MS_LT:
125 return SmToken(TLT, MS_LT, u"<"_ustr, TG::Relation, 0);
126 case MS_NDIVIDES:
127 return SmToken(TNDIVIDES, MS_NDIVIDES, u"ndivides"_ustr, TG::Relation, 0);
128 case MS_NEQ:
129 return SmToken(TNEQ, MS_NEQ, u"<>"_ustr, TG::Relation, 0);
130 case MS_NOTIN:
131 return SmToken(TNOTIN, MS_NOTIN, u"notin"_ustr, TG::Relation, 0);
132 case MS_NOTPRECEDES:
133 return SmToken(TNOTPRECEDES, MS_NOTPRECEDES, u"nprec"_ustr, TG::Relation, 0);
134 case MS_NSUBSET:
135 return SmToken(TNSUBSET, MS_NSUBSET, u"nsubset"_ustr, TG::Relation, 0);
136 case MS_NSUBSETEQ:
137 return SmToken(TNSUBSETEQ, MS_NSUBSETEQ, u"nsubseteq"_ustr, TG::Relation, 0);
138 case MS_NOTSUCCEEDS:
139 return SmToken(TNOTSUCCEEDS, MS_NOTSUCCEEDS, u"nsucc"_ustr, TG::Relation, 0);
140 case MS_NSUPSET:
141 return SmToken(TNSUPSET, MS_NSUPSET, u"nsupset"_ustr, TG::Relation, 0);
142 case MS_NSUPSETEQ:
143 return SmToken(TNSUPSETEQ, MS_NSUPSETEQ, u"nsupseteq"_ustr, TG::Relation, 0);
144 case MS_ORTHO:
145 return SmToken(TORTHO, MS_ORTHO, u"ortho"_ustr, TG::Relation, 0);
146 case MS_NI:
147 return SmToken(TNI, MS_NI, u"owns"_ustr, TG::Relation, 0);
148 case MS_DLINE:
149 return SmToken(TPARALLEL, MS_DLINE, u"parallel"_ustr, TG::Relation, 0);
150 case MS_PRECEDES:
151 return SmToken(TPRECEDES, MS_PRECEDES, u"prec"_ustr, TG::Relation, 0);
152 case MS_PRECEDESEQUAL:
153 return SmToken(TPRECEDESEQUAL, MS_PRECEDESEQUAL, u"preccurlyeq"_ustr, TG::Relation, 0);
154 case MS_PRECEDESEQUIV:
155 return SmToken(TPRECEDESEQUIV, MS_PRECEDESEQUIV, u"precsim"_ustr, TG::Relation, 0);
156 case MS_PROP:
157 return SmToken(TPROP, MS_PROP, u"prop"_ustr, TG::Relation, 0);
158 case MS_SIM:
159 return SmToken(TSIM, MS_SIM, u"sim"_ustr, TG::Relation, 0);
160 case 0x2245:
161 case MS_SIMEQ:
162 return SmToken(TSIMEQ, MS_SIMEQ, u"simeq"_ustr, TG::Relation, 0);
163 case MS_SUBSET:
164 return SmToken(TSUBSET, MS_SUBSET, u"subset"_ustr, TG::Relation, 0);
165 case MS_SUBSETEQ:
166 return SmToken(TSUBSETEQ, MS_SUBSETEQ, u"subseteq"_ustr, TG::Relation, 0);
167 case MS_SUCCEEDS:
168 return SmToken(TSUCCEEDS, MS_SUCCEEDS, u"succ"_ustr, TG::Relation, 0);
169 case MS_SUCCEEDSEQUAL:
170 return SmToken(TSUCCEEDSEQUAL, MS_SUCCEEDSEQUAL, u"succcurlyeq"_ustr, TG::Relation, 0);
171 case MS_SUCCEEDSEQUIV:
172 return SmToken(TSUCCEEDSEQUIV, MS_SUCCEEDSEQUIV, u"succsim"_ustr, TG::Relation, 0);
173 case MS_SUPSET:
174 return SmToken(TSUPSET, MS_SUPSET, u"supset"_ustr, TG::Relation, 0);
175 case MS_SUPSETEQ:
176 return SmToken(TSUPSETEQ, MS_SUPSETEQ, u"supseteq"_ustr, TG::Relation, 0);
177 case MS_RIGHTARROW:
178 return SmToken(TTOWARD, MS_RIGHTARROW, u"toward"_ustr, TG::Relation, 0);
179 case MS_TRANSL:
180 return SmToken(TTRANSL, MS_TRANSL, u"transl"_ustr, TG::Relation, 0);
181 case MS_TRANSR:
182 return SmToken(TTRANSR, MS_TRANSR, u"transr"_ustr, TG::Relation, 0);
183 case MS_ASSIGN:
184 return SmToken(TASSIGN, MS_ASSIGN, u"="_ustr, TG::Relation, 0);
185 case MS_LANGLE:
186 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
187 case MS_LMATHANGLE:
188 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
189 case MS_LBRACE:
190 return SmToken(TLBRACE, MS_LBRACE, u"lbrace"_ustr, TG::LBrace, 5);
191 case MS_LCEIL:
192 return SmToken(TLCEIL, MS_LCEIL, u"lceil"_ustr, TG::LBrace, 5);
193 case MS_LFLOOR:
194 return SmToken(TLFLOOR, MS_LFLOOR, u"lfloor"_ustr, TG::LBrace, 5);
195 case MS_LDBRACKET:
196 return SmToken(TLDBRACKET, MS_LDBRACKET, u"ldbracket"_ustr, TG::LBrace, 5);
197 case MS_LBRACKET:
198 return SmToken(TLBRACKET, MS_LBRACKET, u"["_ustr, TG::LBrace, 5);
199 case MS_LPARENT:
200 return SmToken(TLPARENT, MS_LPARENT, u"("_ustr, TG::LBrace, 5);
201 case MS_RANGLE:
202 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
203 case MS_RMATHANGLE:
204 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
205 case MS_RBRACE:
206 return SmToken(TRBRACE, MS_RBRACE, u"rbrace"_ustr, TG::RBrace, 5);
207 case MS_RCEIL:
208 return SmToken(TRCEIL, MS_RCEIL, u"rceil"_ustr, TG::RBrace, 5);
209 case MS_RFLOOR:
210 return SmToken(TRFLOOR, MS_RFLOOR, u"rfloor"_ustr, TG::RBrace, 5);
211 case MS_RDBRACKET:
212 return SmToken(TRDBRACKET, MS_RDBRACKET, u"rdbracket"_ustr, TG::RBrace, 5);
213 case MS_RBRACKET:
214 return SmToken(TRBRACKET, MS_RBRACKET, u"]"_ustr, TG::RBrace, 5);
215 case MS_RPARENT:
216 return SmToken(TRPARENT, MS_RPARENT, u")"_ustr, TG::RBrace, 5);
217 case MS_NONE:
218 return SmToken(TNONE, MS_NONE, u"none"_ustr, TG::RBrace | TG::LBrace, 5);
219 default:
220 return SmToken(TERROR, MS_NONE, u""_ustr, TG::NONE, SAL_MAX_UINT16);
224 SmToken starmathdatabase::Identify_Prefix_SmXMLOperatorContext_Impl(std::u16string_view rText,
225 sal_Int32 nIndex)
227 auto cChar = o3tl::iterateCodePoints(rText, &nIndex);
228 switch (cChar)
230 case MS_VERTLINE:
231 return SmToken(TLLINE, MS_VERTLINE, u"lline"_ustr, TG::LBrace, 5);
232 case MS_DVERTLINE:
233 return SmToken(TLDLINE, MS_DVERTLINE, u"ldline"_ustr, TG::LBrace, 5);
234 case MS_LANGLE:
235 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
236 case MS_LMATHANGLE:
237 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
238 case MS_LBRACE:
239 return SmToken(TLBRACE, MS_LBRACE, u"lbrace"_ustr, TG::LBrace, 5);
240 case MS_LCEIL:
241 return SmToken(TLCEIL, MS_LCEIL, u"lceil"_ustr, TG::LBrace, 5);
242 case MS_LFLOOR:
243 return SmToken(TLFLOOR, MS_LFLOOR, u"lfloor"_ustr, TG::LBrace, 5);
244 case MS_LDBRACKET:
245 return SmToken(TLDBRACKET, MS_LDBRACKET, u"ldbracket"_ustr, TG::LBrace, 5);
246 case MS_LBRACKET:
247 return SmToken(TLBRACKET, MS_LBRACKET, u"["_ustr, TG::LBrace, 5);
248 case MS_LPARENT:
249 return SmToken(TLPARENT, MS_LPARENT, u"("_ustr, TG::LBrace, 5);
250 case MS_RANGLE:
251 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
252 case MS_RMATHANGLE:
253 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
254 case MS_RBRACE:
255 return SmToken(TRBRACE, MS_RBRACE, u"rbrace"_ustr, TG::RBrace, 5);
256 case MS_RCEIL:
257 return SmToken(TRCEIL, MS_RCEIL, u"rceil"_ustr, TG::RBrace, 5);
258 case MS_RFLOOR:
259 return SmToken(TRFLOOR, MS_RFLOOR, u"rfloor"_ustr, TG::RBrace, 5);
260 case MS_RDBRACKET:
261 return SmToken(TRDBRACKET, MS_RDBRACKET, u"rdbracket"_ustr, TG::RBrace, 5);
262 case MS_RBRACKET:
263 return SmToken(TRBRACKET, MS_RBRACKET, u"]"_ustr, TG::RBrace, 5);
264 case MS_RPARENT:
265 return SmToken(TRPARENT, MS_RPARENT, u")"_ustr, TG::RBrace, 5);
266 case MS_NONE:
267 return SmToken(TNONE, MS_NONE, u"none"_ustr, TG::LBrace | TG::RBrace, 5);
268 default:
269 return SmToken(TERROR, MS_NONE, u""_ustr, TG::NONE, SAL_MAX_UINT16);
273 SmToken starmathdatabase::Identify_Postfix_SmXMLOperatorContext_Impl(std::u16string_view rText,
274 sal_Int32 nIndex)
276 auto cChar = o3tl::iterateCodePoints(rText, &nIndex);
277 switch (cChar)
279 case MS_VERTLINE:
280 return SmToken(TRLINE, MS_VERTLINE, u"rline"_ustr, TG::RBrace, 5);
281 case MS_DVERTLINE:
282 return SmToken(TRDLINE, MS_DVERTLINE, u"rdline"_ustr, TG::RBrace, 5);
283 case MS_LANGLE:
284 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
285 case MS_LMATHANGLE:
286 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
287 case MS_LBRACE:
288 return SmToken(TLBRACE, MS_LBRACE, u"lbrace"_ustr, TG::LBrace, 5);
289 case MS_LCEIL:
290 return SmToken(TLCEIL, MS_LCEIL, u"lceil"_ustr, TG::LBrace, 5);
291 case MS_LFLOOR:
292 return SmToken(TLFLOOR, MS_LFLOOR, u"lfloor"_ustr, TG::LBrace, 5);
293 case MS_LDBRACKET:
294 return SmToken(TLDBRACKET, MS_LDBRACKET, u"ldbracket"_ustr, TG::LBrace, 5);
295 case MS_LBRACKET:
296 return SmToken(TLBRACKET, MS_LBRACKET, u"["_ustr, TG::LBrace, 5);
297 case MS_LPARENT:
298 return SmToken(TLPARENT, MS_LPARENT, u"("_ustr, TG::LBrace, 5);
299 case MS_RANGLE:
300 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
301 case MS_RMATHANGLE:
302 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
303 case MS_RBRACE:
304 return SmToken(TRBRACE, MS_RBRACE, u"rbrace"_ustr, TG::RBrace, 5);
305 case MS_RCEIL:
306 return SmToken(TRCEIL, MS_RCEIL, u"rceil"_ustr, TG::RBrace, 5);
307 case MS_RFLOOR:
308 return SmToken(TRFLOOR, MS_RFLOOR, u"rfloor"_ustr, TG::RBrace, 5);
309 case MS_RDBRACKET:
310 return SmToken(TRDBRACKET, MS_RDBRACKET, u"rdbracket"_ustr, TG::RBrace, 5);
311 case MS_RBRACKET:
312 return SmToken(TRBRACKET, MS_RBRACKET, u"]"_ustr, TG::RBrace, 5);
313 case MS_RPARENT:
314 return SmToken(TRPARENT, MS_RPARENT, u")"_ustr, TG::RBrace, 5);
315 case MS_NONE:
316 return SmToken(TNONE, MS_NONE, u"none"_ustr, TG::LBrace | TG::RBrace, 5);
317 default:
318 return SmToken(TERROR, MS_NONE, u""_ustr, TG::NONE, SAL_MAX_UINT16);
322 SmToken
323 starmathdatabase::Identify_PrefixPostfix_SmXMLOperatorContext_Impl(std::u16string_view rText,
324 sal_Int32 nIndex)
326 auto cChar = o3tl::iterateCodePoints(rText, &nIndex);
327 switch (cChar)
329 case MS_VERTLINE:
330 return SmToken(TLRLINE, MS_VERTLINE, u"lrline"_ustr, TG::LBrace | TG::RBrace, 5);
331 case MS_DVERTLINE:
332 return SmToken(TLRDLINE, MS_DVERTLINE, u"lrdline"_ustr, TG::LBrace | TG::RBrace, 5);
333 case MS_LANGLE:
334 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
335 case MS_LMATHANGLE:
336 return SmToken(TLANGLE, MS_LMATHANGLE, u"langle"_ustr, TG::LBrace, 5);
337 case MS_LBRACE:
338 return SmToken(TLBRACE, MS_LBRACE, u"lbrace"_ustr, TG::LBrace, 5);
339 case MS_LCEIL:
340 return SmToken(TLCEIL, MS_LCEIL, u"lceil"_ustr, TG::LBrace, 5);
341 case MS_LFLOOR:
342 return SmToken(TLFLOOR, MS_LFLOOR, u"lfloor"_ustr, TG::LBrace, 5);
343 case MS_LDBRACKET:
344 return SmToken(TLDBRACKET, MS_LDBRACKET, u"ldbracket"_ustr, TG::LBrace, 5);
345 case MS_LBRACKET:
346 return SmToken(TLBRACKET, MS_LBRACKET, u"["_ustr, TG::LBrace, 5);
347 case MS_LPARENT:
348 return SmToken(TLPARENT, MS_LPARENT, u"("_ustr, TG::LBrace, 5);
349 case MS_RANGLE:
350 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
351 case MS_RMATHANGLE:
352 return SmToken(TRANGLE, MS_RMATHANGLE, u"rangle"_ustr, TG::RBrace, 5);
353 case MS_RBRACE:
354 return SmToken(TRBRACE, MS_RBRACE, u"rbrace"_ustr, TG::RBrace, 5);
355 case MS_RCEIL:
356 return SmToken(TRCEIL, MS_RCEIL, u"rceil"_ustr, TG::RBrace, 5);
357 case MS_RFLOOR:
358 return SmToken(TRFLOOR, MS_RFLOOR, u"rfloor"_ustr, TG::RBrace, 5);
359 case MS_RDBRACKET:
360 return SmToken(TRDBRACKET, MS_RDBRACKET, u"rdbracket"_ustr, TG::RBrace, 5);
361 case MS_RBRACKET:
362 return SmToken(TRBRACKET, MS_RBRACKET, u"]"_ustr, TG::RBrace, 5);
363 case MS_RPARENT:
364 return SmToken(TRPARENT, MS_RPARENT, u")"_ustr, TG::RBrace, 5);
365 case MS_NONE:
366 return SmToken(TNONE, MS_NONE, u"none"_ustr, TG::LBrace | TG::RBrace, 5);
367 default:
368 return SmToken(TERROR, MS_NONE, u""_ustr, TG::NONE, SAL_MAX_UINT16);
372 const SmColorTokenTableEntry starmathdatabase::aColorTokenTableParse[]
373 = { { u"aliceblue"_ustr, THTMLCOL, COL_SM_ALICEBLUE },
374 { u"antiquewhite"_ustr, THTMLCOL, COL_SM_ANTIQUEWHITE },
375 { u"aqua"_ustr, TMATHMLCOL, COL_SM_AQUA },
376 { u"aquamarine"_ustr, THTMLCOL, COL_SM_AQUAMARINE },
377 { u"azure"_ustr, THTMLCOL, COL_SM_AZURE },
378 { u"beige"_ustr, THTMLCOL, COL_SM_BEIGE },
379 { u"bisque"_ustr, THTMLCOL, COL_SM_BISQUE },
380 { u"black"_ustr, TMATHMLCOL, COL_SM_BLACK },
381 { u"blanchedalmond"_ustr, THTMLCOL, COL_SM_BLANCHEDALMOND },
382 { u"blue"_ustr, TMATHMLCOL, COL_SM_BLUE },
383 { u"blueviolet"_ustr, THTMLCOL, COL_SM_BLUEVIOLET },
384 { u"brown"_ustr, THTMLCOL, COL_SM_BROWN },
385 { u"burlywood"_ustr, THTMLCOL, COL_SM_BURLYWOOD },
386 { u"cadetblue"_ustr, THTMLCOL, COL_SM_CADETBLUE },
387 { u"chartreuse"_ustr, THTMLCOL, COL_SM_CHARTREUSE },
388 { u"chocolate"_ustr, THTMLCOL, COL_SM_CHOCOLATE },
389 { u"coral"_ustr, THTMLCOL, COL_SM_CORAL },
390 { u"cornflowerblue"_ustr, THTMLCOL, COL_SM_CORNFLOWERBLUE },
391 { u"cornsilk"_ustr, THTMLCOL, COL_SM_CORNSILK },
392 { u"crimson"_ustr, THTMLCOL, COL_SM_CRIMSON },
393 { u"cyan"_ustr, TMATHMLCOL, COL_SM_CYAN },
394 { u"darkblue"_ustr, THTMLCOL, COL_SM_DARKBLUE },
395 { u"darkcyan"_ustr, THTMLCOL, COL_SM_DARKCYAN },
396 { u"darkgoldenrod"_ustr, THTMLCOL, COL_SM_DARKGOLDENROD },
397 { u"darkgray"_ustr, THTMLCOL, COL_SM_DARKGRAY },
398 { u"darkgreen"_ustr, THTMLCOL, COL_SM_DARKGREEN },
399 { u"darkgrey"_ustr, THTMLCOL, COL_SM_DARKGREY },
400 { u"darkkhaki"_ustr, THTMLCOL, COL_SM_DARKKHAKI },
401 { u"darkmagenta"_ustr, THTMLCOL, COL_SM_DARKMAGENTA },
402 { u"darkolivegreen"_ustr, THTMLCOL, COL_SM_DARKOLIVEGREEN },
403 { u"darkorange"_ustr, THTMLCOL, COL_SM_DARKORANGE },
404 { u"darkorchid"_ustr, THTMLCOL, COL_SM_DARKORCHID },
405 { u"darkred"_ustr, THTMLCOL, COL_SM_DARKRED },
406 { u"darksalmon"_ustr, THTMLCOL, COL_SM_DARKSALMON },
407 { u"darkseagreen"_ustr, THTMLCOL, COL_SM_DARKSEAGREEN },
408 { u"darkslateblue"_ustr, THTMLCOL, COL_SM_DARKSLATEBLUE },
409 { u"darkslategray"_ustr, THTMLCOL, COL_SM_DARKSLATEGRAY },
410 { u"darkslategrey"_ustr, THTMLCOL, COL_SM_DARKSLATEGREY },
411 { u"darkturquoise"_ustr, THTMLCOL, COL_SM_DARKTURQUOISE },
412 { u"darkviolet"_ustr, THTMLCOL, COL_SM_DARKVIOLET },
413 { u"debian"_ustr, TICONICCOL, COL_SM_DEBIAN_MAGENTA },
414 { u"deeppink"_ustr, THTMLCOL, COL_SM_DEEPPINK },
415 { u"deepskyblue"_ustr, THTMLCOL, COL_SM_DEEPSKYBLUE },
416 { u"dimgray"_ustr, THTMLCOL, COL_SM_DIMGRAY },
417 { u"dimgrey"_ustr, THTMLCOL, COL_SM_DIMGREY },
418 { u"dodgerblue"_ustr, THTMLCOL, COL_SM_DODGERBLUE },
419 { u"dvip"_ustr, TDVIPSNAMESCOL, COL_SM_BLACK },
420 { u"firebrick"_ustr, THTMLCOL, COL_SM_FIREBRICK },
421 { u"floralwhite"_ustr, THTMLCOL, COL_SM_FLORALWHITE },
422 { u"forestgreen"_ustr, THTMLCOL, COL_SM_FORESTGREEN },
423 { u"fuchsia"_ustr, TMATHMLCOL, COL_SM_FUCHSIA },
424 { u"gainsboro"_ustr, THTMLCOL, COL_SM_GAINSBORO },
425 { u"ghostwhite"_ustr, THTMLCOL, COL_SM_GHOSTWHITE },
426 { u"gold"_ustr, THTMLCOL, COL_SM_GOLD },
427 { u"goldenrod"_ustr, THTMLCOL, COL_SM_GOLDENROD },
428 { u"gray"_ustr, TMATHMLCOL, COL_SM_GRAY },
429 { u"green"_ustr, TMATHMLCOL, COL_SM_GREEN },
430 { u"greenyellow"_ustr, THTMLCOL, COL_SM_GREENYELLOW },
431 { u"grey"_ustr, THTMLCOL, COL_SM_GREY },
432 { u"hex"_ustr, THEX, COL_SM_BLACK },
433 { u"honeydew"_ustr, THTMLCOL, COL_SM_HONEYDEW },
434 { u"hotpink"_ustr, THTMLCOL, COL_SM_HOTPINK },
435 { u"indianred"_ustr, THTMLCOL, COL_SM_INDIANRED },
436 { u"indigo"_ustr, THTMLCOL, COL_SM_INDIGO },
437 { u"ivory"_ustr, THTMLCOL, COL_SM_IVORY },
438 { u"khaki"_ustr, THTMLCOL, COL_SM_KHAKI },
439 { u"lavender"_ustr, THTMLCOL, COL_SM_LAVENDER },
440 { u"lavenderblush"_ustr, THTMLCOL, COL_SM_LAVENDERBLUSH },
441 { u"lawngreen"_ustr, THTMLCOL, COL_SM_LAWNGREEN },
442 { u"lemonchiffon"_ustr, THTMLCOL, COL_SM_LEMONCHIFFON },
443 { u"lightblue"_ustr, THTMLCOL, COL_SM_LIGHTBLUE },
444 { u"lightcoral"_ustr, THTMLCOL, COL_SM_LIGHTCORAL },
445 { u"lightcyan"_ustr, THTMLCOL, COL_SM_LIGHTCYAN },
446 { u"lightgoldenrodyellow"_ustr, THTMLCOL, COL_SM_LIGHTGOLDENRODYELLOW },
447 { u"lightgray"_ustr, THTMLCOL, COL_SM_LIGHTGRAY },
448 { u"lightgreen"_ustr, THTMLCOL, COL_SM_LIGHTGREEN },
449 { u"lightgrey"_ustr, THTMLCOL, COL_SM_LIGHTGREY },
450 { u"lightpink"_ustr, THTMLCOL, COL_SM_LIGHTPINK },
451 { u"lightsalmon"_ustr, THTMLCOL, COL_SM_LIGHTSALMON },
452 { u"lightseagreen"_ustr, THTMLCOL, COL_SM_LIGHTSEAGREEN },
453 { u"lightskyblue"_ustr, THTMLCOL, COL_SM_LIGHTSKYBLUE },
454 { u"lightslategray"_ustr, THTMLCOL, COL_SM_LIGHTSLATEGRAY },
455 { u"lightslategrey"_ustr, THTMLCOL, COL_SM_LIGHTSLATEGREY },
456 { u"lightsteelblue"_ustr, THTMLCOL, COL_SM_LIGHTSTEELBLUE },
457 { u"lightyellow"_ustr, THTMLCOL, COL_SM_LIGHTYELLOW },
458 { u"lime"_ustr, TMATHMLCOL, COL_SM_LIME },
459 { u"limegreen"_ustr, THTMLCOL, COL_SM_LIMEGREEN },
460 { u"linen"_ustr, THTMLCOL, COL_SM_LINEN },
461 { u"lo"_ustr, TICONICCOL, COL_SM_LO_GREEN },
462 { u"magenta"_ustr, TMATHMLCOL, COL_SM_MAGENTA },
463 { u"maroon"_ustr, TMATHMLCOL, COL_SM_MAROON },
464 { u"mediumaquamarine"_ustr, THTMLCOL, COL_SM_MEDIUMAQUAMARINE },
465 { u"mediumblue"_ustr, THTMLCOL, COL_SM_MEDIUMBLUE },
466 { u"mediumorchid"_ustr, THTMLCOL, COL_SM_MEDIUMORCHID },
467 { u"mediumpurple"_ustr, THTMLCOL, COL_SM_MEDIUMPURPLE },
468 { u"mediumseagreen"_ustr, THTMLCOL, COL_SM_MEDIUMSEAGREEN },
469 { u"mediumslateblue"_ustr, THTMLCOL, COL_SM_MEDIUMSLATEBLUE },
470 { u"mediumspringgreen"_ustr, THTMLCOL, COL_SM_MEDIUMSPRINGGREEN },
471 { u"mediumturquoise"_ustr, THTMLCOL, COL_SM_MEDIUMTURQUOISE },
472 { u"mediumvioletred"_ustr, THTMLCOL, COL_SM_MEDIUMVIOLETRED },
473 { u"midnightblue"_ustr, THTMLCOL, COL_SM_MIDNIGHTBLUE },
474 { u"mintcream"_ustr, THTMLCOL, COL_SM_MINTCREAM },
475 { u"mistyrose"_ustr, THTMLCOL, COL_SM_MISTYROSE },
476 { u"moccasin"_ustr, THTMLCOL, COL_SM_MOCCASIN },
477 { u"navajowhite"_ustr, THTMLCOL, COL_SM_NAVAJOWHITE },
478 { u"navy"_ustr, TMATHMLCOL, COL_SM_NAVY },
479 { u"oldlace"_ustr, THTMLCOL, COL_SM_OLDLACE },
480 { u"olive"_ustr, TMATHMLCOL, COL_SM_OLIVE },
481 { u"olivedrab"_ustr, THTMLCOL, COL_SM_OLIVEDRAB },
482 { u"orange"_ustr, THTMLCOL, COL_SM_ORANGE },
483 { u"orangered"_ustr, THTMLCOL, COL_SM_ORANGERED },
484 { u"orchid"_ustr, THTMLCOL, COL_SM_ORCHID },
485 { u"palegoldenrod"_ustr, THTMLCOL, COL_SM_PALEGOLDENROD },
486 { u"palegreen"_ustr, THTMLCOL, COL_SM_PALEGREEN },
487 { u"paleturquoise"_ustr, THTMLCOL, COL_SM_PALETURQUOISE },
488 { u"palevioletred"_ustr, THTMLCOL, COL_SM_PALEVIOLETRED },
489 { u"papayawhip"_ustr, THTMLCOL, COL_SM_PAPAYAWHIP },
490 { u"peachpuff"_ustr, THTMLCOL, COL_SM_PEACHPUFF },
491 { u"peru"_ustr, THTMLCOL, COL_SM_PERU },
492 { u"pink"_ustr, THTMLCOL, COL_SM_PINK },
493 { u"plum"_ustr, THTMLCOL, COL_SM_PLUM },
494 { u"powderblue"_ustr, THTMLCOL, COL_SM_POWDERBLUE },
495 { u"purple"_ustr, TMATHMLCOL, COL_SM_PURPLE },
496 { u"rebeccapurple"_ustr, THTMLCOL, COL_SM_REBECCAPURPLE },
497 { u"red"_ustr, TMATHMLCOL, COL_SM_RED },
498 { u"rgb"_ustr, TRGB, COL_AUTO },
499 { u"rgba"_ustr, TRGBA, COL_AUTO },
500 { u"rosybrown"_ustr, THTMLCOL, COL_SM_ROSYBROWN },
501 { u"royalblue"_ustr, THTMLCOL, COL_SM_ROYALBLUE },
502 { u"saddlebrown"_ustr, THTMLCOL, COL_SM_SADDLEBROWN },
503 { u"salmon"_ustr, THTMLCOL, COL_SM_SALMON },
504 { u"sandybrown"_ustr, THTMLCOL, COL_SM_SANDYBROWN },
505 { u"seagreen"_ustr, THTMLCOL, COL_SM_SEAGREEN },
506 { u"seashell"_ustr, THTMLCOL, COL_SM_SEASHELL },
507 { u"sienna"_ustr, THTMLCOL, COL_SM_SIENNA },
508 { u"silver"_ustr, TMATHMLCOL, COL_SM_SILVER },
509 { u"skyblue"_ustr, THTMLCOL, COL_SM_SKYBLUE },
510 { u"slateblue"_ustr, THTMLCOL, COL_SM_SLATEBLUE },
511 { u"slategray"_ustr, THTMLCOL, COL_SM_SLATEGRAY },
512 { u"slategrey"_ustr, THTMLCOL, COL_SM_SLATEGREY },
513 { u"snow"_ustr, THTMLCOL, COL_SM_SNOW },
514 { u"springgreen"_ustr, THTMLCOL, COL_SM_SPRINGGREEN },
515 { u"steelblue"_ustr, THTMLCOL, COL_SM_STEELBLUE },
516 { u"tan"_ustr, THTMLCOL, COL_SM_TAN },
517 { u"teal"_ustr, TMATHMLCOL, COL_SM_TEAL },
518 { u"thistle"_ustr, THTMLCOL, COL_SM_THISTLE },
519 { u"tomato"_ustr, THTMLCOL, COL_SM_TOMATO },
520 { u"turquoise"_ustr, THTMLCOL, COL_SM_TURQUOISE },
521 { u"ubuntu"_ustr, TICONICCOL, COL_SM_UBUNTU_ORANGE },
522 { u"violet"_ustr, THTMLCOL, COL_SM_VIOLET },
523 { u"wheat"_ustr, THTMLCOL, COL_SM_WHEAT },
524 { u"white"_ustr, TMATHMLCOL, COL_SM_WHITE },
525 { u"whitesmoke"_ustr, THTMLCOL, COL_SM_WHITESMOKE },
526 { u"yellow"_ustr, TMATHMLCOL, COL_SM_YELLOW },
527 { u"yellowgreen"_ustr, THTMLCOL, COL_SM_YELLOWGREEN } };
529 const SmColorTokenTableEntry starmathdatabase::aColorTokenTableHTML[]
530 = { { u"aliceblue"_ustr, THTMLCOL, COL_SM_ALICEBLUE },
531 { u"antiquewhite"_ustr, THTMLCOL, COL_SM_ANTIQUEWHITE },
532 { u"aqua"_ustr, TMATHMLCOL, COL_SM_AQUA },
533 { u"aquamarine"_ustr, THTMLCOL, COL_SM_AQUAMARINE },
534 { u"azure"_ustr, THTMLCOL, COL_SM_AZURE },
535 { u"beige"_ustr, THTMLCOL, COL_SM_BEIGE },
536 { u"bisque"_ustr, THTMLCOL, COL_SM_BISQUE },
537 { u"black"_ustr, TMATHMLCOL, COL_SM_BLACK },
538 { u"blanchedalmond"_ustr, THTMLCOL, COL_SM_BLANCHEDALMOND },
539 { u"blue"_ustr, TMATHMLCOL, COL_SM_BLUE },
540 { u"blueviolet"_ustr, THTMLCOL, COL_SM_BLUEVIOLET },
541 { u"brown"_ustr, THTMLCOL, COL_SM_BROWN },
542 { u"burlywood"_ustr, THTMLCOL, COL_SM_BURLYWOOD },
543 { u"cadetblue"_ustr, THTMLCOL, COL_SM_CADETBLUE },
544 { u"chartreuse"_ustr, THTMLCOL, COL_SM_CHARTREUSE },
545 { u"chocolate"_ustr, THTMLCOL, COL_SM_CHOCOLATE },
546 { u"coral"_ustr, THTMLCOL, COL_SM_CORAL },
547 { u"cornflowerblue"_ustr, THTMLCOL, COL_SM_CORNFLOWERBLUE },
548 { u"cornsilk"_ustr, THTMLCOL, COL_SM_CORNSILK },
549 { u"crimson"_ustr, THTMLCOL, COL_SM_CRIMSON },
550 { u"cyan"_ustr, TMATHMLCOL, COL_SM_CYAN },
551 { u"darkblue"_ustr, THTMLCOL, COL_SM_DARKBLUE },
552 { u"darkcyan"_ustr, THTMLCOL, COL_SM_DARKCYAN },
553 { u"darkgoldenrod"_ustr, THTMLCOL, COL_SM_DARKGOLDENROD },
554 { u"darkgray"_ustr, THTMLCOL, COL_SM_DARKGRAY },
555 { u"darkgreen"_ustr, THTMLCOL, COL_SM_DARKGREEN },
556 { u"darkgrey"_ustr, THTMLCOL, COL_SM_DARKGREY },
557 { u"darkkhaki"_ustr, THTMLCOL, COL_SM_DARKKHAKI },
558 { u"darkmagenta"_ustr, THTMLCOL, COL_SM_DARKMAGENTA },
559 { u"darkolivegreen"_ustr, THTMLCOL, COL_SM_DARKOLIVEGREEN },
560 { u"darkorange"_ustr, THTMLCOL, COL_SM_DARKORANGE },
561 { u"darkorchid"_ustr, THTMLCOL, COL_SM_DARKORCHID },
562 { u"darkred"_ustr, THTMLCOL, COL_SM_DARKRED },
563 { u"darksalmon"_ustr, THTMLCOL, COL_SM_DARKSALMON },
564 { u"darkseagreen"_ustr, THTMLCOL, COL_SM_DARKSEAGREEN },
565 { u"darkslateblue"_ustr, THTMLCOL, COL_SM_DARKSLATEBLUE },
566 { u"darkslategray"_ustr, THTMLCOL, COL_SM_DARKSLATEGRAY },
567 { u"darkslategrey"_ustr, THTMLCOL, COL_SM_DARKSLATEGREY },
568 { u"darkturquoise"_ustr, THTMLCOL, COL_SM_DARKTURQUOISE },
569 { u"darkviolet"_ustr, THTMLCOL, COL_SM_DARKVIOLET },
570 { u"deeppink"_ustr, THTMLCOL, COL_SM_DEEPPINK },
571 { u"deepskyblue"_ustr, THTMLCOL, COL_SM_DEEPSKYBLUE },
572 { u"dimgray"_ustr, THTMLCOL, COL_SM_DIMGRAY },
573 { u"dimgrey"_ustr, THTMLCOL, COL_SM_DIMGREY },
574 { u"dodgerblue"_ustr, THTMLCOL, COL_SM_DODGERBLUE },
575 { u"firebrick"_ustr, THTMLCOL, COL_SM_FIREBRICK },
576 { u"floralwhite"_ustr, THTMLCOL, COL_SM_FLORALWHITE },
577 { u"forestgreen"_ustr, THTMLCOL, COL_SM_FORESTGREEN },
578 { u"fuchsia"_ustr, TMATHMLCOL, COL_SM_FUCHSIA },
579 { u"gainsboro"_ustr, THTMLCOL, COL_SM_GAINSBORO },
580 { u"ghostwhite"_ustr, THTMLCOL, COL_SM_GHOSTWHITE },
581 { u"gold"_ustr, THTMLCOL, COL_SM_GOLD },
582 { u"goldenrod"_ustr, THTMLCOL, COL_SM_GOLDENROD },
583 { u"gray"_ustr, TMATHMLCOL, COL_SM_GRAY },
584 { u"green"_ustr, TMATHMLCOL, COL_SM_GREEN },
585 { u"greenyellow"_ustr, THTMLCOL, COL_SM_GREENYELLOW },
586 { u"grey"_ustr, THTMLCOL, COL_SM_GREY },
587 { u"honeydew"_ustr, THTMLCOL, COL_SM_HONEYDEW },
588 { u"hotpink"_ustr, THTMLCOL, COL_SM_HOTPINK },
589 { u"indianred"_ustr, THTMLCOL, COL_SM_INDIANRED },
590 { u"indigo"_ustr, THTMLCOL, COL_SM_INDIGO },
591 { u"ivory"_ustr, THTMLCOL, COL_SM_IVORY },
592 { u"khaki"_ustr, THTMLCOL, COL_SM_KHAKI },
593 { u"lavender"_ustr, THTMLCOL, COL_SM_LAVENDER },
594 { u"lavenderblush"_ustr, THTMLCOL, COL_SM_LAVENDERBLUSH },
595 { u"lawngreen"_ustr, THTMLCOL, COL_SM_LAWNGREEN },
596 { u"lemonchiffon"_ustr, THTMLCOL, COL_SM_LEMONCHIFFON },
597 { u"lightblue"_ustr, THTMLCOL, COL_SM_LIGHTBLUE },
598 { u"lightcoral"_ustr, THTMLCOL, COL_SM_LIGHTCORAL },
599 { u"lightcyan"_ustr, THTMLCOL, COL_SM_LIGHTCYAN },
600 { u"lightgoldenrodyellow"_ustr, THTMLCOL, COL_SM_LIGHTGOLDENRODYELLOW },
601 { u"lightgray"_ustr, THTMLCOL, COL_SM_LIGHTGRAY },
602 { u"lightgreen"_ustr, THTMLCOL, COL_SM_LIGHTGREEN },
603 { u"lightgrey"_ustr, THTMLCOL, COL_SM_LIGHTGREY },
604 { u"lightpink"_ustr, THTMLCOL, COL_SM_LIGHTPINK },
605 { u"lightsalmon"_ustr, THTMLCOL, COL_SM_LIGHTSALMON },
606 { u"lightseagreen"_ustr, THTMLCOL, COL_SM_LIGHTSEAGREEN },
607 { u"lightskyblue"_ustr, THTMLCOL, COL_SM_LIGHTSKYBLUE },
608 { u"lightslategray"_ustr, THTMLCOL, COL_SM_LIGHTSLATEGRAY },
609 { u"lightslategrey"_ustr, THTMLCOL, COL_SM_LIGHTSLATEGREY },
610 { u"lightsteelblue"_ustr, THTMLCOL, COL_SM_LIGHTSTEELBLUE },
611 { u"lightyellow"_ustr, THTMLCOL, COL_SM_LIGHTYELLOW },
612 { u"lime"_ustr, TMATHMLCOL, COL_SM_LIME },
613 { u"limegreen"_ustr, THTMLCOL, COL_SM_LIMEGREEN },
614 { u"linen"_ustr, THTMLCOL, COL_SM_LINEN },
615 { u"magenta"_ustr, TMATHMLCOL, COL_SM_MAGENTA },
616 { u"maroon"_ustr, TMATHMLCOL, COL_SM_MAROON },
617 { u"mediumaquamarine"_ustr, THTMLCOL, COL_SM_MEDIUMAQUAMARINE },
618 { u"mediumblue"_ustr, THTMLCOL, COL_SM_MEDIUMBLUE },
619 { u"mediumorchid"_ustr, THTMLCOL, COL_SM_MEDIUMORCHID },
620 { u"mediumpurple"_ustr, THTMLCOL, COL_SM_MEDIUMPURPLE },
621 { u"mediumseagreen"_ustr, THTMLCOL, COL_SM_MEDIUMSEAGREEN },
622 { u"mediumslateblue"_ustr, THTMLCOL, COL_SM_MEDIUMSLATEBLUE },
623 { u"mediumspringgreen"_ustr, THTMLCOL, COL_SM_MEDIUMSPRINGGREEN },
624 { u"mediumturquoise"_ustr, THTMLCOL, COL_SM_MEDIUMTURQUOISE },
625 { u"mediumvioletred"_ustr, THTMLCOL, COL_SM_MEDIUMVIOLETRED },
626 { u"midnightblue"_ustr, THTMLCOL, COL_SM_MIDNIGHTBLUE },
627 { u"mintcream"_ustr, THTMLCOL, COL_SM_MINTCREAM },
628 { u"mistyrose"_ustr, THTMLCOL, COL_SM_MISTYROSE },
629 { u"moccasin"_ustr, THTMLCOL, COL_SM_MOCCASIN },
630 { u"navajowhite"_ustr, THTMLCOL, COL_SM_NAVAJOWHITE },
631 { u"navy"_ustr, TMATHMLCOL, COL_SM_NAVY },
632 { u"oldlace"_ustr, THTMLCOL, COL_SM_OLDLACE },
633 { u"olive"_ustr, TMATHMLCOL, COL_SM_OLIVE },
634 { u"olivedrab"_ustr, THTMLCOL, COL_SM_OLIVEDRAB },
635 { u"orange"_ustr, THTMLCOL, COL_SM_ORANGE },
636 { u"orangered"_ustr, THTMLCOL, COL_SM_ORANGERED },
637 { u"orchid"_ustr, THTMLCOL, COL_SM_ORCHID },
638 { u"palegoldenrod"_ustr, THTMLCOL, COL_SM_PALEGOLDENROD },
639 { u"palegreen"_ustr, THTMLCOL, COL_SM_PALEGREEN },
640 { u"paleturquoise"_ustr, THTMLCOL, COL_SM_PALETURQUOISE },
641 { u"palevioletred"_ustr, THTMLCOL, COL_SM_PALEVIOLETRED },
642 { u"papayawhip"_ustr, THTMLCOL, COL_SM_PAPAYAWHIP },
643 { u"peachpuff"_ustr, THTMLCOL, COL_SM_PEACHPUFF },
644 { u"peru"_ustr, THTMLCOL, COL_SM_PERU },
645 { u"pink"_ustr, THTMLCOL, COL_SM_PINK },
646 { u"plum"_ustr, THTMLCOL, COL_SM_PLUM },
647 { u"powderblue"_ustr, THTMLCOL, COL_SM_POWDERBLUE },
648 { u"purple"_ustr, TMATHMLCOL, COL_SM_PURPLE },
649 { u"rebeccapurple"_ustr, THTMLCOL, COL_SM_REBECCAPURPLE },
650 { u"red"_ustr, TMATHMLCOL, COL_SM_RED },
651 { u"rosybrown"_ustr, THTMLCOL, COL_SM_ROSYBROWN },
652 { u"royalblue"_ustr, THTMLCOL, COL_SM_ROYALBLUE },
653 { u"saddlebrown"_ustr, THTMLCOL, COL_SM_SADDLEBROWN },
654 { u"salmon"_ustr, THTMLCOL, COL_SM_SALMON },
655 { u"sandybrown"_ustr, THTMLCOL, COL_SM_SANDYBROWN },
656 { u"seagreen"_ustr, THTMLCOL, COL_SM_SEAGREEN },
657 { u"seashell"_ustr, THTMLCOL, COL_SM_SEASHELL },
658 { u"sienna"_ustr, THTMLCOL, COL_SM_SIENNA },
659 { u"silver"_ustr, TMATHMLCOL, COL_SM_SILVER },
660 { u"skyblue"_ustr, THTMLCOL, COL_SM_SKYBLUE },
661 { u"slateblue"_ustr, THTMLCOL, COL_SM_SLATEBLUE },
662 { u"slategray"_ustr, THTMLCOL, COL_SM_SLATEGRAY },
663 { u"slategrey"_ustr, THTMLCOL, COL_SM_SLATEGREY },
664 { u"snow"_ustr, THTMLCOL, COL_SM_SNOW },
665 { u"springgreen"_ustr, THTMLCOL, COL_SM_SPRINGGREEN },
666 { u"steelblue"_ustr, THTMLCOL, COL_SM_STEELBLUE },
667 { u"tan"_ustr, THTMLCOL, COL_SM_TAN },
668 { u"teal"_ustr, TMATHMLCOL, COL_SM_TEAL },
669 { u"thistle"_ustr, THTMLCOL, COL_SM_THISTLE },
670 { u"tomato"_ustr, THTMLCOL, COL_SM_TOMATO },
671 { u"turquoise"_ustr, THTMLCOL, COL_SM_TURQUOISE },
672 { u"violet"_ustr, THTMLCOL, COL_SM_VIOLET },
673 { u"wheat"_ustr, THTMLCOL, COL_SM_WHEAT },
674 { u"white"_ustr, TMATHMLCOL, COL_SM_WHITE },
675 { u"whitesmoke"_ustr, THTMLCOL, COL_SM_WHITESMOKE },
676 { u"yellow"_ustr, TMATHMLCOL, COL_SM_YELLOW },
677 { u"yellowgreen"_ustr, THTMLCOL, COL_SM_YELLOWGREEN } };
679 const SmColorTokenTableEntry starmathdatabase::aColorTokenTableDVIPS[]
680 = { { u"apricot"_ustr, TDVIPSNAMESCOL, COL_SM_DIV_APRICOT },
681 { u"aquamarine"_ustr, TDVIPSNAMESCOL, COL_SM_DIV_AQUAMARINE },
682 { u"bittersweet"_ustr, TDVIPSNAMESCOL, COL_SM_DIV_BITTERSWEET },
683 { u"black"_ustr, TDVIPSNAMESCOL, COL_SM_BLACK },
684 { u"blue"_ustr, TDVIPSNAMESCOL, COL_SM_BLACK } };
686 const SmColorTokenTableEntry starmathdatabase::aColorTokenTableMATHML[] = {
687 // clang-format off
688 { u"aqua"_ustr, TMATHMLCOL, COL_SM_AQUA },
689 { u"black"_ustr, TMATHMLCOL, COL_SM_BLACK },
690 { u"blue"_ustr, TMATHMLCOL, COL_SM_BLUE },
691 { u"fuchsia"_ustr, TMATHMLCOL, COL_SM_FUCHSIA },
692 { u"gray"_ustr, TMATHMLCOL, COL_SM_GRAY },
693 { u"green"_ustr, TMATHMLCOL, COL_SM_GREEN },
694 { u"lime"_ustr, TMATHMLCOL, COL_SM_LIME },
695 { u"maroon"_ustr, TMATHMLCOL, COL_SM_MAROON },
696 { u"navy"_ustr, TMATHMLCOL, COL_SM_NAVY },
697 { u"olive"_ustr, TMATHMLCOL, COL_SM_OLIVE },
698 { u"purple"_ustr, TMATHMLCOL, COL_SM_PURPLE },
699 { u"red"_ustr, TMATHMLCOL, COL_SM_RED },
700 { u"silver"_ustr, TMATHMLCOL, COL_SM_SILVER },
701 { u"teal"_ustr, TMATHMLCOL, COL_SM_TEAL },
702 { u"white"_ustr, TMATHMLCOL, COL_SM_WHITE },
703 { u"yellow"_ustr, TMATHMLCOL, COL_SM_YELLOW }
704 // clang-format on
707 const SmColorTokenTableEntry starmathdatabase::aColorTokenTableERROR[]
708 = { { u""_ustr, TERROR, COL_SM_BLACK } };
710 SmColorTokenTableEntry starmathdatabase::Identify_Color_Parser(sal_uInt32 cColor)
712 for (auto i = std::begin(aColorTokenTableParse); i < std::end(aColorTokenTableParse); ++i)
713 if (i->equals(cColor))
714 return SmColorTokenTableEntry(i);
715 for (auto i = std::begin(aColorTokenTableDVIPS); i < std::end(aColorTokenTableDVIPS); ++i)
716 if (i->equals(cColor))
717 return SmColorTokenTableEntry(i);
718 if ((cColor & 0x00FFFFFF) == cColor)
719 return SmColorTokenTableEntry(u""_ustr, TRGB, cColor);
720 else
721 return SmColorTokenTableEntry(u""_ustr, TRGBA, cColor);
724 SmColorTokenTableEntry starmathdatabase::Identify_Color_MATHML(sal_uInt32 cColor)
726 for (auto i = std::begin(aColorTokenTableMATHML); i < std::end(aColorTokenTableMATHML); ++i)
727 if (i->equals(cColor))
728 return SmColorTokenTableEntry(i);
729 if ((cColor & 0x00FFFFFF) == cColor)
730 return SmColorTokenTableEntry(u""_ustr, TRGB, cColor);
731 else
732 return SmColorTokenTableEntry(u""_ustr, TRGBA, cColor);
735 SmColorTokenTableEntry starmathdatabase::Identify_Color_DVIPSNAMES(sal_uInt32 cColor)
737 for (auto i = std::begin(aColorTokenTableDVIPS); i < std::end(aColorTokenTableDVIPS); ++i)
738 if (i->equals(cColor))
739 return SmColorTokenTableEntry(i);
740 if ((cColor & 0x00FFFFFF) == cColor)
741 return SmColorTokenTableEntry(u""_ustr, TRGB, cColor);
742 else
743 return SmColorTokenTableEntry(u""_ustr, TRGBA, cColor);
746 const SmColorTokenTableEntry*
747 starmathdatabase::Identify_ColorName_Parser(std::u16string_view colorname)
749 if (colorname.empty())
750 return &aColorTokenTableERROR[0];
751 for (auto i = std::begin(aColorTokenTableParse); i < std::end(aColorTokenTableParse); ++i)
753 sal_Int32 matches = o3tl::compareToIgnoreAsciiCase(colorname, i->aIdent);
754 if (matches == 0)
755 return i;
756 if (matches < 0)
757 break;
759 return &aColorTokenTableERROR[0];
761 SmColorTokenTableEntry starmathdatabase::Identify_ColorName_HTML(std::u16string_view colorname)
763 if (colorname.empty())
764 return SmColorTokenTableEntry(u""_ustr, TERROR, COL_SM_BLACK);
765 if (colorname[0] == '#')
767 Color col = Color::STRtoRGB(colorname);
768 return SmColorTokenTableEntry(u""_ustr, TRGB, col);
770 for (auto i = std::begin(aColorTokenTableHTML); i < std::end(aColorTokenTableHTML); ++i)
772 sal_Int32 matches = o3tl::compareToIgnoreAsciiCase(colorname, i->aIdent);
773 if (matches == 0)
774 return SmColorTokenTableEntry(i);
775 if (matches < 0)
776 break;
778 return SmColorTokenTableEntry(u""_ustr, TERROR, COL_SM_BLACK);
780 const SmColorTokenTableEntry*
781 starmathdatabase::Identify_ColorName_DVIPSNAMES(std::u16string_view colorname)
783 if (colorname.empty())
784 return &aColorTokenTableERROR[0];
785 for (auto i = std::begin(aColorTokenTableDVIPS); i < std::end(aColorTokenTableDVIPS); ++i)
787 sal_Int32 matches = o3tl::compareToIgnoreAsciiCase(colorname, i->aIdent);
788 if (matches == 0)
789 return i;
790 if (matches < 0)
791 break;
793 return &aColorTokenTableERROR[0];