@@ -126,9 +126,6 @@ MemberNameSDict *Doxygen::functionNameSDict = 0;
126
126
FileNameList *Doxygen::inputNameList = 0 ; // all input files
127
127
FileNameDict *Doxygen::inputNameDict = 0 ;
128
128
GroupSDict *Doxygen::groupSDict = 0 ;
129
- FormulaList *Doxygen::formulaList = 0 ; // all formulas
130
- FormulaDict *Doxygen::formulaDict = 0 ; // all formulas
131
- FormulaDict *Doxygen::formulaNameDict = 0 ; // the label name of all formulas
132
129
PageSDict *Doxygen::pageSDict = 0 ;
133
130
PageSDict *Doxygen::exampleSDict = 0 ;
134
131
SectionDict *Doxygen::sectionDict = 0 ; // all page sections
@@ -197,7 +194,6 @@ void clearAll()
197
194
Doxygen::pageSDict->clear ();
198
195
Doxygen::exampleSDict->clear ();
199
196
Doxygen::inputNameList->clear ();
200
- Doxygen::formulaList->clear ();
201
197
Doxygen::sectionDict->clear ();
202
198
Doxygen::inputNameDict->clear ();
203
199
Doxygen::includeNameDict->clear ();
@@ -206,11 +202,10 @@ void clearAll()
206
202
Doxygen::dotFileNameDict->clear ();
207
203
Doxygen::mscFileNameDict->clear ();
208
204
Doxygen::diaFileNameDict->clear ();
209
- Doxygen::formulaDict->clear ();
210
- Doxygen::formulaNameDict->clear ();
211
205
Doxygen::tagDestinationDict.clear ();
212
206
delete Doxygen::citeDict;
213
207
delete Doxygen::mainPage; Doxygen::mainPage=0 ;
208
+ FormulaManager::instance ().clear ();
214
209
}
215
210
216
211
class Statistics
@@ -281,10 +276,6 @@ void statistics()
281
276
fprintf (stderr," --- typedefDict stats ----\n " );
282
277
fprintf (stderr," --- namespaceAliasDict stats ----\n " );
283
278
Doxygen::namespaceAliasDict.statistics ();
284
- fprintf (stderr," --- formulaDict stats ----\n " );
285
- Doxygen::formulaDict->statistics ();
286
- fprintf (stderr," --- formulaNameDict stats ----\n " );
287
- Doxygen::formulaNameDict->statistics ();
288
279
fprintf (stderr," --- tagDestinationDict stats ----\n " );
289
280
Doxygen::tagDestinationDict.statistics ();
290
281
fprintf (stderr," --- g_compoundKeywordDict stats ----\n " );
@@ -9576,66 +9567,6 @@ int readFileOrDirectory(const char *s,
9576
9567
9577
9568
// ----------------------------------------------------------------------------
9578
9569
9579
- void readFormulaRepository (QCString dir, bool cmp)
9580
- {
9581
- static int current_repository = 0 ;
9582
- int new_repository = 0 ;
9583
- QFile f (dir+" /formula.repository" );
9584
- if (f.open (IO_ReadOnly)) // open repository
9585
- {
9586
- msg (" Reading formula repository...\n " );
9587
- QTextStream t (&f);
9588
- QCString line;
9589
- Formula *f;
9590
- while (!t.eof ())
9591
- {
9592
- line=t.readLine ().utf8 ();
9593
- int se=line.find (' :' ); // find name and text separator.
9594
- if (se==-1 )
9595
- {
9596
- warn_uncond (" formula.repository is corrupted!\n " );
9597
- break ;
9598
- }
9599
- else
9600
- {
9601
- QCString formName = line.left (se);
9602
- QCString formText = line.right (line.length ()-se-1 );
9603
- if (cmp)
9604
- {
9605
- if ((f=Doxygen::formulaDict->find (formText))==0 )
9606
- {
9607
- term (" discrepancy between formula repositories! Remove "
9608
- " formula.repository and from_* files from output directories." );
9609
- }
9610
- QCString formLabel;
9611
- formLabel.sprintf (" \\ _form#%d" ,f->getId ());
9612
- if (formLabel != formName)
9613
- {
9614
- term (" discrepancy between formula repositories! Remove "
9615
- " formula.repository and from_* files from output directories." );
9616
- }
9617
- new_repository++;
9618
- }
9619
- else
9620
- {
9621
- f=new Formula (formText);
9622
- Doxygen::formulaList->append (f);
9623
- Doxygen::formulaDict->insert (formText,f);
9624
- Doxygen::formulaNameDict->insert (formName,f);
9625
- current_repository++;
9626
- }
9627
- }
9628
- }
9629
- }
9630
- if (cmp && (current_repository != new_repository))
9631
- {
9632
- term (" size discrepancy between formula repositories! Remove "
9633
- " formula.repository and from_* files from output directories." );
9634
- }
9635
- }
9636
-
9637
- // ----------------------------------------------------------------------------
9638
-
9639
9570
static void expandAliases ()
9640
9571
{
9641
9572
QDictIterator<QCString> adi (Doxygen::aliasDict);
@@ -9935,10 +9866,6 @@ void initDoxygen()
9935
9866
Doxygen::citeDict = new CiteDict (257 );
9936
9867
Doxygen::genericsDict = new GenericsSDict;
9937
9868
Doxygen::indexList = new IndexList;
9938
- Doxygen::formulaList = new FormulaList;
9939
- Doxygen::formulaList->setAutoDelete (TRUE );
9940
- Doxygen::formulaDict = new FormulaDict (1009 );
9941
- Doxygen::formulaNameDict = new FormulaDict (1009 );
9942
9869
Doxygen::sectionDict = new SectionDict (257 );
9943
9870
Doxygen::sectionDict->setAutoDelete (TRUE );
9944
9871
@@ -9968,10 +9895,9 @@ void initDoxygen()
9968
9895
9969
9896
void cleanUpDoxygen ()
9970
9897
{
9898
+ FormulaManager::instance ().clear ();
9899
+
9971
9900
delete Doxygen::sectionDict;
9972
- delete Doxygen::formulaNameDict;
9973
- delete Doxygen::formulaDict;
9974
- delete Doxygen::formulaList;
9975
9901
delete Doxygen::indexList;
9976
9902
delete Doxygen::genericsDict;
9977
9903
delete Doxygen::inputNameDict;
@@ -11036,18 +10962,22 @@ void parseInput()
11036
10962
11037
10963
if (Config_getBool (GENERATE_HTML) && !Config_getBool (USE_MATHJAX))
11038
10964
{
11039
- readFormulaRepository (Config_getString (HTML_OUTPUT));
10965
+ FormulaManager::instance (). readFormulas (Config_getString (HTML_OUTPUT));
11040
10966
}
11041
10967
if (Config_getBool (GENERATE_RTF))
11042
10968
{
11043
10969
// in case GENERRATE_HTML is set we just have to compare, both repositories should be identical
11044
- readFormulaRepository (Config_getString (RTF_OUTPUT),Config_getBool (GENERATE_HTML) && !Config_getBool (USE_MATHJAX));
10970
+ FormulaManager::instance ().readFormulas (Config_getString (RTF_OUTPUT),
10971
+ Config_getBool (GENERATE_HTML) &&
10972
+ !Config_getBool (USE_MATHJAX));
11045
10973
}
11046
10974
if (Config_getBool (GENERATE_DOCBOOK))
11047
10975
{
11048
10976
// in case GENERRATE_HTML is set we just have to compare, both repositories should be identical
11049
- readFormulaRepository (Config_getString (DOCBOOK_OUTPUT),
11050
- (Config_getBool (GENERATE_HTML) && !Config_getBool (USE_MATHJAX)) || Config_getBool (GENERATE_RTF));
10977
+ FormulaManager::instance ().readFormulas (Config_getString (DOCBOOK_OUTPUT),
10978
+ (Config_getBool (GENERATE_HTML) &&
10979
+ !Config_getBool (USE_MATHJAX)) ||
10980
+ Config_getBool (GENERATE_RTF));
11051
10981
}
11052
10982
11053
10983
/* *************************************************************************
@@ -11477,6 +11407,29 @@ void generateOutput()
11477
11407
}
11478
11408
g_s.end ();
11479
11409
11410
+ const FormulaManager &fm = FormulaManager::instance ();
11411
+ if (fm.hasFormulas () && generateHtml
11412
+ && !Config_getBool (USE_MATHJAX))
11413
+ {
11414
+ g_s.begin (" Generating images for formulas in HTML...\n " );
11415
+ fm.generateImages (Config_getString (HTML_OUTPUT), Config_getEnum (HTML_FORMULA_FORMAT)==" SVG" ?
11416
+ FormulaManager::Format::Vector : FormulaManager::Format::Bitmap, FormulaManager::HighDPI::On);
11417
+ g_s.end ();
11418
+ }
11419
+ if (fm.hasFormulas () && generateRtf)
11420
+ {
11421
+ g_s.begin (" Generating images for formulas in RTF...\n " );
11422
+ fm.generateImages (Config_getString (RTF_OUTPUT),FormulaManager::Format::Bitmap);
11423
+ g_s.end ();
11424
+ }
11425
+
11426
+ if (fm.hasFormulas () && generateDocbook)
11427
+ {
11428
+ g_s.begin (" Generating images for formulas in Docbook...\n " );
11429
+ fm.generateImages (Config_getString (DOCBOOK_OUTPUT),FormulaManager::Format::Bitmap);
11430
+ g_s.end ();
11431
+ }
11432
+
11480
11433
g_s.begin (" Generating example documentation...\n " );
11481
11434
generateExampleDocs ();
11482
11435
g_s.end ();
@@ -11516,27 +11469,6 @@ void generateOutput()
11516
11469
generateDirDocs (*g_outputList);
11517
11470
g_s.end ();
11518
11471
11519
- if (Doxygen::formulaList->count ()>0 && generateHtml
11520
- && !Config_getBool (USE_MATHJAX))
11521
- {
11522
- g_s.begin (" Generating bitmaps for formulas in HTML...\n " );
11523
- Doxygen::formulaList->generateBitmaps (Config_getString (HTML_OUTPUT));
11524
- g_s.end ();
11525
- }
11526
- if (Doxygen::formulaList->count ()>0 && generateRtf)
11527
- {
11528
- g_s.begin (" Generating bitmaps for formulas in RTF...\n " );
11529
- Doxygen::formulaList->generateBitmaps (Config_getString (RTF_OUTPUT));
11530
- g_s.end ();
11531
- }
11532
-
11533
- if (Doxygen::formulaList->count ()>0 && generateDocbook)
11534
- {
11535
- g_s.begin (" Generating bitmaps for formulas in Docbook...\n " );
11536
- Doxygen::formulaList->generateBitmaps (Config_getString (DOCBOOK_OUTPUT));
11537
- g_s.end ();
11538
- }
11539
-
11540
11472
if (Config_getBool (SORT_GROUP_NAMES))
11541
11473
{
11542
11474
Doxygen::groupSDict->sort ();
0 commit comments