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