Doxygen
Loading...
Searching...
No Matches
index.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2023 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16/** @file
17 * @brief This file contains functions for the various index pages.
18 */
19
20#include <cstdlib>
21#include <array>
22
23#include <assert.h>
24
25#include "message.h"
26#include "index.h"
27#include "indexlist.h"
28#include "doxygen.h"
29#include "config.h"
30#include "filedef.h"
31#include "outputlist.h"
32#include "util.h"
33#include "groupdef.h"
34#include "language.h"
35#include "htmlgen.h"
36#include "htmlhelp.h"
37#include "ftvhelp.h"
38#include "dot.h"
40#include "dotlegendgraph.h"
41#include "pagedef.h"
42#include "dirdef.h"
43#include "vhdldocgen.h"
44#include "layout.h"
45#include "memberlist.h"
46#include "classlist.h"
47#include "namespacedef.h"
48#include "filename.h"
49#include "tooltip.h"
50#include "utf8.h"
51#include "portable.h"
52#include "moduledef.h"
53#include "sitemap.h"
54
55#define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX 200
56#define MAX_ITEMS_BEFORE_QUICK_INDEX 30
57
58constexpr auto alphaSepar = "<div class=\"alphasepar\"></div>";
59
60// helpers
62static void countFiles(int &htmlFiles,int &files);
63static int countGroups();
64static int countDirs();
65static int countNamespaces();
66static int countConcepts();
68static void countRelatedPages(int &docPages,int &indexPages);
69
70
72{
88 int indexedPages = 0;
92 std::array<int, ClassMemberHighlight::Total> documentedClassMembers = {};
93 std::array<int, FileMemberHighlight::Total> documentedFileMembers = {};
94 std::array<int,NamespaceMemberHighlight::Total> documentedNamespaceMembers = {};
95 std::array<int, ModuleMemberHighlight::Total> documentedModuleMembers = {};
96 std::array<MemberIndexMap,ClassMemberHighlight::Total> classIndexLetterUsed;
97 std::array<MemberIndexMap,FileMemberHighlight::Total> fileIndexLetterUsed;
98 std::array<MemberIndexMap,NamespaceMemberHighlight::Total> namespaceIndexLetterUsed;
99 std::array<MemberIndexMap,ModuleMemberHighlight::Total> moduleIndexLetterUsed;
100};
101
102Index::Index() : p(std::make_unique<Private>())
103{
104}
105
106Index::~Index() = default;
107
109{
110 static Index index;
111 return index;
112}
113
114int Index::numAnnotatedClasses() const { return p->annotatedClasses; }
115int Index::numAnnotatedClassesPrinted() const { return p->annotatedClassesPrinted; }
116int Index::numHierarchyClasses() const { return p->hierarchyClasses; }
117int Index::numAnnotatedInterfaces() const { return p->annotatedInterfaces; }
118int Index::numAnnotatedInterfacesPrinted() const { return p->annotatedInterfacesPrinted; }
119int Index::numHierarchyInterfaces() const { return p->hierarchyInterfaces; }
120int Index::numAnnotatedStructs() const { return p->annotatedStructs; }
121int Index::numAnnotatedStructsPrinted() const { return p->annotatedStructsPrinted; }
122int Index::numAnnotatedExceptions() const { return p->annotatedExceptions; }
123int Index::numAnnotatedExceptionsPrinted() const { return p->annotatedExceptionsPrinted; }
124int Index::numHierarchyExceptions() const { return p->hierarchyExceptions; }
125int Index::numDocumentedGroups() const { return p->documentedGroups; }
126int Index::numDocumentedNamespaces() const { return p->documentedNamespaces; }
127int Index::numDocumentedConcepts() const { return p->documentedConcepts; }
128int Index::numDocumentedModules() const { return p->documentedModules; }
129int Index::numIndexedPages() const { return p->indexedPages; }
130int Index::numDocumentedFiles() const { return p->documentedFiles; }
131int Index::numDocumentedPages() const { return p->documentedPages; }
132int Index::numDocumentedDirs() const { return p->documentedDirs; }
133int Index::numDocumentedClassMembers(ClassMemberHighlight::Enum e) const { return p->documentedClassMembers[e]; }
134int Index::numDocumentedFileMembers(FileMemberHighlight::Enum e) const { return p->documentedFileMembers[e]; }
135int Index::numDocumentedNamespaceMembers(NamespaceMemberHighlight::Enum e) const { return p->documentedNamespaceMembers[e]; }
136int Index::numDocumentedModuleMembers(ModuleMemberHighlight::Enum e) const { return p->documentedModuleMembers[e]; }
137
139{
140 return p->classIndexLetterUsed[static_cast<int>(e)];
141}
142
144{
145 return p->fileIndexLetterUsed[static_cast<int>(e)];
146}
147
149{
150 return p->namespaceIndexLetterUsed[static_cast<int>(e)];
151}
152
154{
155 return p->moduleIndexLetterUsed[static_cast<int>(e)];
156}
157
159{
160 p->documentedClassMembers[i]=0;
161 p->classIndexLetterUsed[i].clear();
162}
163
165{
166 p->documentedFileMembers[i]=0;
167 p->fileIndexLetterUsed[i].clear();
168}
169
171{
172 p->documentedNamespaceMembers[i]=0;
173 p->namespaceIndexLetterUsed[i].clear();
174}
175
177{
178 p->documentedModuleMembers[i]=0;
179 p->moduleIndexLetterUsed[i].clear();
180}
181
182static void MemberIndexMap_add(Index::MemberIndexMap &map,const std::string &letter,const MemberDef *md)
183{
184 auto it = map.find(letter);
185 if (it!=map.end())
186 {
187 it->second.push_back(md);
188 }
189 else
190 {
191 map.emplace(letter,std::vector<const MemberDef*>({md}));
192 }
193}
194
195void Index::incrementDocumentedClassMembers(int i,const std::string &letter,const MemberDef *md)
196{
197 p->documentedClassMembers[i]++;
198 MemberIndexMap_add(p->classIndexLetterUsed[i],letter,md);
199}
200
201void Index::incrementDocumentedFileMembers(int i,const std::string &letter,const MemberDef *md)
202{
203 p->documentedFileMembers[i]++;
204 MemberIndexMap_add(p->fileIndexLetterUsed[i],letter,md);
205}
206
207void Index::incrementDocumentedNamespaceMembers(int i,const std::string &letter,const MemberDef *md)
208{
209 p->documentedNamespaceMembers[i]++;
210 MemberIndexMap_add(p->namespaceIndexLetterUsed[i],letter,md);
211}
212
213void Index::incrementDocumentedModuleMembers(int i,const std::string &letter,const MemberDef *md)
214{
215 p->documentedModuleMembers[i]++;
216 MemberIndexMap_add(p->moduleIndexLetterUsed[i],letter,md);
217}
218
219
221{
222 auto sortMemberIndexList = [](MemberIndexMap &map)
223 {
224 for (auto &[name,list] : map)
225 {
226 std::stable_sort(list.begin(),list.end(),
227 [](const MemberDef *md1,const MemberDef *md2)
228 {
229 // consider candidates A::a, B::b, B::a, A::b, A::A, B::B,
230 // want after sorting: A::A, A::a, B::a, B::B, A::b, B::b
231 // so we can later group entries
232 // - A: A
233 // - a: A, B
234 // - B: B
235 // - b: A, B
236 int result = qstricmp_sort(md1->name(),md2->name());
237 if (result==0) // next compare with full scope
238 {
239 result = qstricmp_sort(md1->qualifiedName(),md2->qualifiedName());
240 }
241 return result<0;
242 });
243 }
244 };
245
246 for (auto &idx : p->classIndexLetterUsed)
247 {
248 sortMemberIndexList(idx);
249 }
250 for (auto &idx : p->fileIndexLetterUsed)
251 {
252 sortMemberIndexList(idx);
253 }
254 for (auto &idx : p->namespaceIndexLetterUsed)
255 {
256 sortMemberIndexList(idx);
257 }
258 for (auto &idx : p->moduleIndexLetterUsed)
259 {
260 sortMemberIndexList(idx);
261 }
262}
263
265{
266 for (int j=0;j<ClassMemberHighlight::Total;j++)
267 {
269 }
270 for (int j=0;j<NamespaceMemberHighlight::Total;j++)
271 {
273 }
274 for (int j=0;j<FileMemberHighlight::Total;j++)
275 {
277 }
278 for (int j=0;j<ModuleMemberHighlight::Total;j++)
279 {
281 }
282
283 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
284 p->annotatedClasses = countAnnotatedClasses(&p->annotatedClassesPrinted, ClassDef::Class); // "classes" + "annotated"
285 p->hierarchyClasses = countClassHierarchy(ClassDef::Class); // "hierarchy"
286 // "interfaces" + "annotated"
287 p->annotatedInterfaces = sliceOpt ? countAnnotatedClasses(&p->annotatedInterfacesPrinted, ClassDef::Interface) : 0;
288 // "interfacehierarchy"
289 p->hierarchyInterfaces = sliceOpt ? countClassHierarchy(ClassDef::Interface) : 0;
290 // "structs" + "annotated"
291 p->annotatedStructs = sliceOpt ? countAnnotatedClasses(&p->annotatedStructsPrinted, ClassDef::Struct) : 0;
292 // "exceptions" + "annotated"
293 p->annotatedExceptions = sliceOpt ? countAnnotatedClasses(&p->annotatedExceptionsPrinted, ClassDef::Exception) : 0;
294 // "exceptionhierarchy"
295 p->hierarchyExceptions = sliceOpt ? countClassHierarchy(ClassDef::Exception) : 0;
296 countFiles(p->documentedFiles,p->documentedFiles); // "files"
297 countRelatedPages(p->documentedPages,p->indexedPages); // "pages"
298 p->documentedGroups = countGroups(); // "topics"
299 p->documentedNamespaces = countNamespaces(); // "namespaces"
300 p->documentedConcepts = countConcepts(); // "concepts"
301 p->documentedDirs = countDirs(); // "dirs"
302 p->documentedModules = ModuleManager::instance().numDocumentedModules();
303 // "globals"
304 // "namespacemembers"
305 // "functions"
306}
307
308
309static void startIndexHierarchy(OutputList &ol,int level)
310{
314 if (level<6) ol.startIndexList();
316
321 ol.startItemList();
323}
324
325static void endIndexHierarchy(OutputList &ol,int level)
326{
330 if (level<6) ol.endIndexList();
332
337 ol.endItemList();
339}
340
341//----------------------------------------------------------------------------
342
344
345//----------------------------------------------------------------------------
346
347static void startQuickIndexList(OutputList &ol,bool letterTabs=FALSE)
348{
349 if (letterTabs)
350 {
351 ol.writeString(" <div id=\"navrow4\" class=\"tabs3\">\n");
352 }
353 else
354 {
355 ol.writeString(" <div id=\"navrow3\" class=\"tabs2\">\n");
356 }
357 ol.writeString(" <ul class=\"tablist\">\n");
358}
359
361{
362 ol.writeString(" </ul>\n");
363 ol.writeString(" </div>\n");
364}
365
366static void startQuickIndexItem(OutputList &ol,const QCString &l,
367 bool hl,bool /* compact */,bool &first)
368{
369 first=FALSE;
370 ol.writeString(" <li");
371 if (hl) ol.writeString(" class=\"current\"");
372 ol.writeString("><a ");
373 ol.writeString("href=\"");
374 ol.writeString(l);
375 ol.writeString("\">");
376 ol.writeString("<span>");
377}
378
380{
381 ol.writeString("</span>");
382 ol.writeString("</a>");
383 ol.writeString("</li>\n");
384}
385
386void startTitle(OutputList &ol,const QCString &fileName,const DefinitionMutable *def)
387{
388 bool generateOutlinePanel = Config_getBool(GENERATE_TREEVIEW) && Config_getBool(PAGE_OUTLINE_PANEL);
390 if (!generateOutlinePanel && def) def->writeSummaryLinks(ol);
391 ol.startTitleHead(fileName);
394}
395
396void endTitle(OutputList &ol,const QCString &fileName,const QCString &name)
397{
399 ol.endTitleHead(fileName,name);
400 ol.endHeaderSection();
401}
402
403void startFile(OutputList &ol,const QCString &name,bool isSource,const QCString &manName,
404 const QCString &title,HighlightedItem hli,bool additionalIndices,
405 const QCString &altSidebarName, int hierarchyLevel, const QCString &allMembersFile)
406{
407 bool disableIndex = Config_getBool(DISABLE_INDEX);
408 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
409 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
410 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
411 ol.startFile(name,isSource,manName,title,hierarchyLevel);
413 if (!disableIndex && !quickLinksAfterSplitbar)
414 {
415 ol.writeQuickLinks(hli,name);
416 }
417 if (!additionalIndices)
418 {
419 ol.endQuickIndices();
420 }
421 ol.writeSplitBar(!altSidebarName.isEmpty() ? altSidebarName : name, allMembersFile);
422 if (quickLinksAfterSplitbar)
423 {
424 ol.writeQuickLinks(hli,name);
425 }
426 ol.writeSearchInfo();
427}
428
429void endFile(OutputList &ol,bool skipNavIndex,bool skipEndContents,
430 const QCString &navPath)
431{
432 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
435 if (!skipNavIndex)
436 {
437 if (!skipEndContents) ol.endContents();
438 if (generateTreeView)
439 {
440 ol.writeString("</div><!-- doc-content -->\n");
441 ol.writeString("</div><!-- container -->\n");
442 }
443 }
444
445 ol.writeFooter(navPath); // write the footer
447 ol.endFile();
448}
449
450void endFileWithNavPath(OutputList &ol,const DefinitionMutable *d,bool showPageNavigation)
451{
452 bool generateTreeview = Config_getBool(GENERATE_TREEVIEW);
453 bool generateOutlinePanel = Config_getBool(PAGE_OUTLINE_PANEL);
454 QCString navPath;
455 if (generateTreeview)
456 {
459 ol.writeString("</div><!-- doc-content -->\n");
460 if (generateOutlinePanel && showPageNavigation) d->writePageNavigation(ol);
461 ol.writeString("</div><!-- container -->\n");
463 navPath = toDefinition(const_cast<DefinitionMutable*>(d))->navigationPathAsString();
464 }
465 endFile(ol,generateTreeview,TRUE,navPath);
466}
467
468//----------------------------------------------------------------------
469
470static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool addToIndex)
471{
472 bool isAnonymous = md->isAnonymous();
473 const MemberVector &enumList = md->enumFieldList();
474 bool isDir = md->isEnumerate() && std::any_of(enumList.begin(),enumList.end(),[](const auto &emd) { return emd->hasDocumentation(); });
475 auto defType = def->definitionType();
476 bool namespaceMemberInFileDocs = md->getNamespaceDef() && defType==Definition::TypeFile;
477 bool lAddToIndex = addToIndex && !namespaceMemberInFileDocs;
478 QCString name = namespaceMemberInFileDocs || defType==Definition::TypeModule ?
479 md->qualifiedName() : md->name();
480 if (md->getOuterScope()==def ||
481 (md->getNamespaceDef()!=nullptr && defType==Definition::TypeFile) ||
483 {
484 Doxygen::indexList->addContentsItem(isDir,
485 name,md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,lAddToIndex && md->getGroupDef()==nullptr);
486 }
487 else // inherited member
488 {
489 Doxygen::indexList->addContentsItem(isDir,
490 name,def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,lAddToIndex && md->getGroupDef()==nullptr);
491 }
492 if (isDir)
493 {
494 if (!isAnonymous)
495 {
496 Doxygen::indexList->incContentsDepth();
497 }
498 for (const auto &emd : enumList)
499 {
500 if (emd->hasDocumentation())
501 {
502 namespaceMemberInFileDocs = emd->getNamespaceDef() && defType==Definition::TypeFile;
503 lAddToIndex = addToIndex && !namespaceMemberInFileDocs;
504 QCString ename = namespaceMemberInFileDocs || defType==Definition::TypeModule ?
505 emd->qualifiedName() : emd->name();
506 if (emd->getOuterScope()==def ||
507 (emd->getNamespaceDef()!=nullptr && defType==Definition::TypeFile) ||
509 {
510 Doxygen::indexList->addContentsItem(FALSE,
511 ename,emd->getReference(),emd->getOutputFileBase(),emd->anchor(),FALSE,lAddToIndex && emd->getGroupDef()==nullptr);
512 }
513 else // inherited member
514 {
515 Doxygen::indexList->addContentsItem(FALSE,
516 ename,def->getReference(),def->getOutputFileBase(),emd->anchor(),FALSE,lAddToIndex && emd->getGroupDef()==nullptr);
517 }
518 }
519 }
520 if (!isAnonymous)
521 {
522 Doxygen::indexList->decContentsDepth();
523 }
524 }
525}
526
527//----------------------------------------------------------------------
528template<class T>
530 const QCString &name,const QCString &anchor,
531 bool addToIndex=TRUE,bool preventSeparateIndex=FALSE,
532 const ConceptLinkedRefMap *concepts = nullptr)
533
534{
535 int numClasses=0;
536 for (const auto &cd : def->getClasses())
537 {
538 if (cd->isLinkable()) numClasses++;
539 }
540 int numConcepts=0;
541 if (concepts)
542 {
543 for (const auto &cd : *concepts)
544 {
545 if (cd->isLinkable()) numConcepts++;
546 }
547 }
548 bool hasMembers = !def->getMemberLists().empty() || !def->getMemberGroups().empty() || (numClasses>0) || (numConcepts>0);
549 Doxygen::indexList->addContentsItem(hasMembers,name,
550 def->getReference(),def->getOutputFileBase(),anchor,
551 hasMembers && !preventSeparateIndex,
552 addToIndex,
553 def,
554 convertToHtml(name));
555 //printf("addMembersToIndex(def=%s hasMembers=%d numClasses=%d)\n",qPrint(def->name()),hasMembers,numClasses);
556 if (hasMembers || numClasses>0 || numConcepts>0)
557 {
558 Doxygen::indexList->incContentsDepth();
559 for (const auto &lde : LayoutDocManager::instance().docEntries(part))
560 {
561 auto kind = lde->kind();
562 if (kind==LayoutDocEntry::MemberDef)
563 {
564 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
565 if (lmd)
566 {
567 MemberList *ml = def->getMemberList(lmd->type);
568 if (ml)
569 {
570 for (const auto &md : *ml)
571 {
572 if (md->visibleInIndex())
573 {
574 writeMemberToIndex(def,md,addToIndex);
575 }
576 }
577 }
578 }
579 }
580 else if (kind==LayoutDocEntry::NamespaceClasses ||
581 kind==LayoutDocEntry::FileClasses ||
582 kind==LayoutDocEntry::ClassNestedClasses ||
583 kind==LayoutDocEntry::ModuleClasses
584 )
585 {
586 for (const auto &cd : def->getClasses())
587 {
588 if (cd->isLinkable() && (cd->partOfGroups().empty() || def->definitionType()==Definition::TypeGroup))
589 {
590 bool inlineSimpleStructs = Config_getBool(INLINE_SIMPLE_STRUCTS);
591 bool isNestedClass = def->definitionType()==Definition::TypeClass;
592 addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(lde->kind()==LayoutDocEntry::FileClasses),cd->anchor(),
593 addToIndex && (isNestedClass || (cd->isSimple() && inlineSimpleStructs)),
594 preventSeparateIndex || cd->isEmbeddedInOuterScope());
595 }
596 }
597 }
598 else if ((kind==LayoutDocEntry::FileConcepts || kind==LayoutDocEntry::ModuleConcepts) && concepts)
599 {
600 for (const auto &cd : *concepts)
601 {
602 if (cd->isLinkable() && (cd->partOfGroups().empty() || def->definitionType()==Definition::TypeGroup))
603 {
604 Doxygen::indexList->addContentsItem(false,cd->displayName(),
605 cd->getReference(),cd->getOutputFileBase(),QCString(),
606 addToIndex,
607 false,
608 cd);
609 }
610 }
611 }
612 }
613
614 Doxygen::indexList->decContentsDepth();
615 }
616}
617
618
619//----------------------------------------------------------------------------
620/*! Generates HTML Help tree of classes */
621
622static void writeClassTreeToOutput(OutputList &ol,const BaseClassList &bcl,int level,FTVHelp* ftv,bool addToIndex,ClassDefSet &visitedClasses)
623{
624 if (bcl.empty()) return;
625 bool started=FALSE;
626 for (const auto &bcd : bcl)
627 {
628 ClassDef *cd=bcd.classDef;
629 if (cd->getLanguage()==SrcLangExt::VHDL && VhdlDocGen::convert(cd->protection())!=VhdlDocGen::ENTITYCLASS)
630 {
631 continue;
632 }
633
634 bool b = cd->getLanguage()==SrcLangExt::VHDL ? classHasVisibleRoot(cd->subClasses()) : classHasVisibleRoot(cd->baseClasses());
635
636 if (cd->isVisibleInHierarchy() && b) // classHasVisibleRoot(cd->baseClasses()))
637 {
638 if (!started)
639 {
640 startIndexHierarchy(ol,level);
641 if (addToIndex)
642 {
643 Doxygen::indexList->incContentsDepth();
644 }
645 if (ftv)
646 {
647 ftv->incContentsDepth();
648 }
649 started=TRUE;
650 }
652 //printf("Passed...\n");
653 bool hasChildren = visitedClasses.find(cd)==visitedClasses.end() &&
655 QCString escapedName = convertToHtml(cd->displayName()); // avoid objective-C '<Protocol>' to be interpreted as XML/HTML tag
656 //printf("tree4: Has children %s: %d\n",qPrint(cd->name()),hasChildren);
657 if (cd->isLinkable())
658 {
659 //printf("Writing class %s\n",qPrint(cd->displayName()));
662 cd->getDefLine(),
663 cd,
664 nullptr,
665 escapedName,
666 DocOptions()
667 .setSingleLine(true)
668 .setAutolinkSupport(false));
670 if (cd->isReference())
671 {
672 ol.startTypewriter();
673 ol.docify(" [external]");
674 ol.endTypewriter();
675 }
676 if (addToIndex)
677 {
678 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor());
679 }
680 if (ftv)
681 {
682 if (cd->getLanguage()==SrcLangExt::VHDL)
683 {
684 ftv->addContentsItem(hasChildren,bcd.usedName,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
685 }
686 else
687 {
688 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd,escapedName);
689 }
690 }
691 }
692 else
693 {
695 ol.parseText(cd->name());
697 if (addToIndex)
698 {
699 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString());
700 }
701 if (ftv)
702 {
703 ftv->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString(),FALSE,FALSE,cd,escapedName);
704 }
705 }
706 if (hasChildren)
707 {
708 //printf("Class %s at %p visited=%d\n",qPrint(cd->name()),cd,cd->visited);
709 visitedClasses.insert(cd);
710 if (cd->getLanguage()==SrcLangExt::VHDL)
711 {
712 writeClassTreeToOutput(ol,cd->baseClasses(),level+1,ftv,addToIndex,visitedClasses);
713 }
714 else
715 {
716 writeClassTreeToOutput(ol,cd->subClasses(),level+1,ftv,addToIndex,visitedClasses);
717 }
718 }
719 ol.endIndexListItem();
720 }
721 }
722 if (started)
723 {
724 endIndexHierarchy(ol,level);
725 if (addToIndex)
726 {
727 Doxygen::indexList->decContentsDepth();
728 }
729 if (ftv)
730 {
731 ftv->decContentsDepth();
732 }
733 }
734}
735
736//----------------------------------------------------------------------------
737
738static bool dirHasVisibleChildren(const DirDef *dd)
739{
740 if (dd->hasDocumentation()) return TRUE;
741
742 for (const auto &fd : dd->getFiles())
743 {
744 bool genSourceFile = false;
745 if (fileVisibleInIndex(fd,genSourceFile))
746 {
747 return TRUE;
748 }
749 if (genSourceFile)
750 {
751 return TRUE;
752 }
753 }
754
755 for(const auto &subdd : dd->subDirs())
756 {
757 if (dirHasVisibleChildren(subdd))
758 {
759 return TRUE;
760 }
761 }
762 return FALSE;
763}
764
765//----------------------------------------------------------------------------
766static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHelp* ftv,bool addToIndex)
767{
768 if (level>20)
769 {
770 warn(dd->getDefFileName(),dd->getDefLine(),
771 "maximum nesting level exceeded for directory {}: "
772 "check for possible recursive directory relation!",dd->name());
773 return;
774 }
775
776 if (!dirHasVisibleChildren(dd))
777 {
778 return;
779 }
780
781 bool tocExpand = TRUE; //Config_getBool(TOC_EXPAND);
782 bool isDir = !dd->subDirs().empty() || // there are subdirs
783 (tocExpand && // or toc expand and
784 !dd->getFiles().empty() // there are files
785 );
786 //printf("gd='%s': pageDict=%d\n",qPrint(gd->name()),gd->pageDict->count());
787 if (addToIndex)
788 {
789 Doxygen::indexList->addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),QCString(),TRUE,TRUE);
790 Doxygen::indexList->incContentsDepth();
791 }
792 if (ftv)
793 {
794 ftv->addContentsItem(isDir,dd->shortName(),dd->getReference(),
796 ftv->incContentsDepth();
797 }
798
802 dd->getDefLine(),
803 dd,
804 nullptr,
805 dd->shortName(),
806 DocOptions()
807 .setSingleLine(true)
808 .setAutolinkSupport(false));
810 if (dd->isReference())
811 {
812 ol.startTypewriter();
813 ol.docify(" [external]");
814 ol.endTypewriter();
815 }
816
817 // write sub directories
818 if (dd->subDirs().size()>0)
819 {
820 startIndexHierarchy(ol,level+1);
821 for(const auto &subdd : dd->subDirs())
822 {
823 writeDirTreeNode(ol,subdd,level+1,ftv,addToIndex);
824 }
825 endIndexHierarchy(ol,level+1);
826 }
827
828 int fileCount=0;
829 if (!dd->getFiles().empty())
830 {
831 for (const auto &fd : dd->getFiles())
832 {
833 //bool allExternals = Config_getBool(ALLEXTERNALS);
834 //if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
835 //{
836 // fileCount++;
837 //}
838 bool genSourceFile = false;
839 if (fileVisibleInIndex(fd,genSourceFile))
840 {
841 fileCount++;
842 }
843 else if (genSourceFile)
844 {
845 fileCount++;
846 }
847 }
848 if (fileCount>0)
849 {
850 startIndexHierarchy(ol,level+1);
851 for (const auto &fd : dd->getFiles())
852 {
853 bool src = false;
854 bool doc = fileVisibleInIndex(fd,src);
855 QCString reference;
856 QCString outputBase;
857 if (doc)
858 {
859 reference = fd->getReference();
860 outputBase = fd->getOutputFileBase();
861 }
862 if (doc || src)
863 {
865 ol.startIndexItem(reference,outputBase);
866 ol.generateDoc(fd->getDefFileName(),
867 fd->getDefLine(),
868 fd,
869 nullptr,
870 fd->displayName(),
871 DocOptions()
872 .setSingleLine(true)
873 .setAutolinkSupport(false));
874 ol.endIndexItem(reference,outputBase);
875 ol.endIndexListItem();
876 if (ftv && (src || doc))
877 {
879 fd->displayName(),
880 reference,outputBase,
881 QCString(),FALSE,FALSE,fd);
882 }
883 }
884 }
885 endIndexHierarchy(ol,level+1);
886 }
887 }
888
889 if (tocExpand && addToIndex)
890 {
891 // write files of this directory
892 if (fileCount>0)
893 {
894 for (const auto &fd : dd->getFiles())
895 {
896 bool src = false;
897 bool doc = fileVisibleInIndex(fd,src);
898 if (doc)
899 {
900 addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString(),
901 !fd->isLinkableViaGroup(),FALSE,&fd->getConcepts());
902 }
903 else if (src)
904 {
905 Doxygen::indexList->addContentsItem(
906 FALSE, fd->name(), QCString(),
907 fd->getSourceFileBase(), QCString(), FALSE, TRUE, fd);
908 }
909 }
910 }
911 }
912 ol.endIndexListItem();
913
914 if (addToIndex)
915 {
916 Doxygen::indexList->decContentsDepth();
917 }
918 if (ftv)
919 {
920 ftv->decContentsDepth();
921 }
922}
923
924static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
925{
926 if (ftv)
927 {
930 }
932 for (const auto &dd : *Doxygen::dirLinkedMap)
933 {
934 if (dd->getOuterScope()==Doxygen::globalScope)
935 {
936 writeDirTreeNode(ol,dd.get(),0,ftv,addToIndex);
937 }
938 }
939 if (ftv)
940 {
941 for (const auto &fn : *Doxygen::inputNameLinkedMap)
942 {
943 for (const auto &fd : *fn)
944 {
945 if (fd->getDirDef()==nullptr) // top level file
946 {
947 bool src = false;
948 bool doc = fileVisibleInIndex(fd.get(),src);
949 QCString reference, outputBase;
950 if (doc)
951 {
952 reference = fd->getReference();
953 outputBase = fd->getOutputFileBase();
954 }
955 if (doc || src)
956 {
957 ftv->addContentsItem(FALSE,fd->displayName(),
958 reference, outputBase, QCString(),
959 FALSE,FALSE,fd.get());
960 }
961 if (addToIndex)
962 {
963 if (doc)
964 {
965 addMembersToIndex(fd.get(),LayoutDocManager::File,fd->displayName(),QCString(),TRUE,FALSE,&fd->getConcepts());
966 }
967 else if (src)
968 {
969 Doxygen::indexList->addContentsItem(
970 FALSE, fd->displayName(), QCString(),
971 fd->getSourceFileBase(), QCString(), FALSE, TRUE, fd.get());
972 }
973 }
974 }
975 }
976 }
977 }
978 endIndexHierarchy(ol,0);
979 if (ftv)
980 {
982 }
983}
984
985
986//----------------------------------------------------------------------------
987
988static void writeClassTreeForList(OutputList &ol,const ClassLinkedMap &cl,bool &started,FTVHelp* ftv,bool addToIndex,
989 ClassDef::CompoundType ct,ClassDefSet &visitedClasses)
990{
991 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
992 for (const auto &cd : cl)
993 {
994 //printf("class %s classHasVisibleRoot=%d isVisibleInHierarchy=%d\n",
995 // qPrint(cd->name()),
996 // classHasVisibleRoot(cd->baseClasses()),
997 // cd->isVisibleInHierarchy()
998 // );
999 bool b = false;
1000 if (cd->getLanguage()==SrcLangExt::VHDL)
1001 {
1002 if (VhdlDocGen::convert(cd->protection())!=VhdlDocGen::ENTITYCLASS)
1003 {
1004 continue;
1005 }
1006 b=!classHasVisibleRoot(cd->subClasses());
1007 }
1008 else if (sliceOpt && cd->compoundType() != ct)
1009 {
1010 continue;
1011 }
1012 else
1013 {
1014 b=!classHasVisibleRoot(cd->baseClasses());
1015 }
1016
1017 if (b) //filter on root classes
1018 {
1019 if (cd->isVisibleInHierarchy()) // should it be visible
1020 {
1021 if (!started)
1022 {
1023 startIndexHierarchy(ol,0);
1024 if (addToIndex)
1025 {
1026 Doxygen::indexList->incContentsDepth();
1027 }
1028 started=TRUE;
1029 }
1030 ol.startIndexListItem();
1031 bool hasChildren = visitedClasses.find(cd.get())==visitedClasses.end() &&
1032 classHasVisibleChildren(cd.get());
1033 //printf("list: Has children %s: %d\n",qPrint(cd->name()),hasChildren);
1034 QCString escapedName = convertToHtml(cd->displayName()); // avoid objective-C '<Protocol>' to be interpreted as XML/HTML tag
1035 if (cd->isLinkable())
1036 {
1037 //printf("Writing class %s isLinkable()=%d isLinkableInProject()=%d cd->isImplicitTemplateinstance()=%d\n",
1038 // qPrint(cd->displayName()),cd->isLinkable(),cd->isLinkableInProject(),cd->isImplicitTemplateInstance());
1039 ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
1040 ol.generateDoc(cd->getDefFileName(),
1041 cd->getDefLine(),
1042 cd.get(),
1043 nullptr,
1044 escapedName,
1045 DocOptions()
1046 .setSingleLine(true)
1047 .setAutolinkSupport(false));
1048 ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
1049 if (cd->isReference())
1050 {
1051 ol.startTypewriter();
1052 ol.docify(" [external]");
1053 ol.endTypewriter();
1054 }
1055 if (addToIndex)
1056 {
1057 if (cd->getLanguage()!=SrcLangExt::VHDL) // prevents double insertion in Design Unit List
1058 {
1059 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd.get(),escapedName);
1060 }
1061 }
1062 if (ftv)
1063 {
1064 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd.get(),escapedName);
1065 }
1066 }
1067 else
1068 {
1070 ol.parseText(cd->displayName());
1072 if (addToIndex)
1073 {
1074 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString(),FALSE,FALSE,cd.get(),escapedName);
1075 }
1076 if (ftv)
1077 {
1078 ftv->addContentsItem(hasChildren,cd->displayName(),QCString(),QCString(),QCString(),FALSE,FALSE,cd.get(),escapedName);
1079 }
1080 }
1081 if (cd->getLanguage()==SrcLangExt::VHDL && hasChildren)
1082 {
1083 writeClassTreeToOutput(ol,cd->baseClasses(),1,ftv,addToIndex,visitedClasses);
1084 visitedClasses.insert(cd.get());
1085 }
1086 else if (hasChildren)
1087 {
1088 writeClassTreeToOutput(ol,cd->subClasses(),1,ftv,addToIndex,visitedClasses);
1089 visitedClasses.insert(cd.get());
1090 }
1091 ol.endIndexListItem();
1092 }
1093 }
1094 }
1095}
1096
1097static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex,ClassDef::CompoundType ct)
1098{
1099 ClassDefSet visitedClasses;
1100 if (ftv)
1101 {
1102 ol.pushGeneratorState();
1104 }
1105 bool started=FALSE;
1106 writeClassTreeForList(ol,*Doxygen::classLinkedMap,started,ftv,addToIndex,ct,visitedClasses);
1107 writeClassTreeForList(ol,*Doxygen::hiddenClassLinkedMap,started,ftv,addToIndex,ct,visitedClasses);
1108 if (started)
1109 {
1110 endIndexHierarchy(ol,0);
1111 if (addToIndex)
1112 {
1113 Doxygen::indexList->decContentsDepth();
1114 }
1115 }
1116 if (ftv)
1117 {
1118 ol.popGeneratorState();
1119 }
1120}
1121
1122//----------------------------------------------------------------------------
1123
1125{
1126 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1127 int count=0;
1128 for (const auto &cd : cl)
1129 {
1130 if (sliceOpt && cd->compoundType() != ct)
1131 {
1132 continue;
1133 }
1134 if (!classHasVisibleRoot(cd->baseClasses())) // filter on root classes
1135 {
1136 if (cd->isVisibleInHierarchy()) // should it be visible
1137 {
1138 if (!cd->subClasses().empty()) // should have sub classes
1139 {
1140 count++;
1141 }
1142 }
1143 }
1144 }
1145 return count;
1146}
1147
1149{
1150 int count=0;
1153 return count;
1154}
1155
1156//----------------------------------------------------------------------------
1157
1159{
1160 if (Index::instance().numHierarchyClasses()==0) return;
1161 ol.pushGeneratorState();
1162 //1.{
1165
1166 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
1167 QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
1168 bool addToIndex = lne==nullptr || lne->visible();
1169
1170 startFile(ol,"hierarchy",false,QCString(), title, HighlightedItem::ClassHierarchy);
1171 startTitle(ol,QCString());
1172 ol.parseText(title);
1173 endTitle(ol,QCString(),QCString());
1174 ol.startContents();
1175 ol.startTextBlock();
1176
1177 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1178 {
1179 ol.pushGeneratorState();
1183 ol.startParagraph();
1184 ol.startTextLink("inherits",QCString());
1185 ol.parseText(theTranslator->trGotoGraphicalHierarchy());
1186 ol.endTextLink();
1187 ol.endParagraph();
1188 ol.popGeneratorState();
1189 }
1190 ol.parseText(lne ? lne->intro() : theTranslator->trClassHierarchyDescription());
1191 ol.endTextBlock();
1192
1193 // ---------------
1194 // Static class hierarchy for Latex/RTF
1195 // ---------------
1196 ol.pushGeneratorState();
1197 //2.{
1199 Doxygen::indexList->disable();
1200
1201 writeClassHierarchy(ol,nullptr,addToIndex,ClassDef::Class);
1202
1203 Doxygen::indexList->enable();
1204 ol.popGeneratorState();
1205 //2.}
1206
1207 // ---------------
1208 // Dynamic class hierarchical index for HTML
1209 // ---------------
1210 ol.pushGeneratorState();
1211 //2.{
1213
1214 {
1215 if (addToIndex)
1216 {
1217 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"hierarchy",QCString(),TRUE,TRUE);
1218 }
1219 FTVHelp ftv(false);
1220 writeClassHierarchy(ol,&ftv,addToIndex,ClassDef::Class);
1221 TextStream t;
1223 ol.pushGeneratorState();
1225 ol.writeString(t.str());
1226 ol.popGeneratorState();
1227 }
1228 ol.popGeneratorState();
1229 //2.}
1230 // ------
1231
1232 endFile(ol);
1233 ol.popGeneratorState();
1234 //1.}
1235}
1236
1237//----------------------------------------------------------------------------
1238
1240{
1241 if (Index::instance().numHierarchyClasses()==0) return;
1243 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
1244 QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
1245 startFile(ol,"inherits",false,QCString(),title,HighlightedItem::ClassHierarchy,FALSE,"hierarchy");
1246 startTitle(ol,QCString());
1247 ol.parseText(title);
1248 endTitle(ol,QCString(),QCString());
1249 ol.startContents();
1250 ol.startTextBlock();
1251 ol.startParagraph();
1252 ol.startTextLink("hierarchy",QCString());
1253 ol.parseText(theTranslator->trGotoTextualHierarchy());
1254 ol.endTextLink();
1255 ol.endParagraph();
1256 ol.endTextBlock();
1259 endFile(ol);
1260 ol.enableAll();
1261}
1262
1263//----------------------------------------------------------------------------
1264
1266{
1267 if (Index::instance().numHierarchyInterfaces()==0) return;
1268 ol.pushGeneratorState();
1269 //1.{
1271
1272 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceHierarchy);
1273 QCString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
1274 bool addToIndex = lne==nullptr || lne->visible();
1275
1276 startFile(ol,"interfacehierarchy",false,QCString(), title, HighlightedItem::InterfaceHierarchy);
1277 startTitle(ol,QCString());
1278 ol.parseText(title);
1279 endTitle(ol,QCString(),QCString());
1280 ol.startContents();
1281 ol.startTextBlock();
1282
1283 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1284 {
1287 ol.startParagraph();
1288 ol.startTextLink("interfaceinherits",QCString());
1289 ol.parseText(theTranslator->trGotoGraphicalHierarchy());
1290 ol.endTextLink();
1291 ol.endParagraph();
1294 }
1295 ol.parseText(lne ? lne->intro() : theTranslator->trInterfaceHierarchyDescription());
1296 ol.endTextBlock();
1297
1298 // ---------------
1299 // Static interface hierarchy for Latex/RTF
1300 // ---------------
1301 ol.pushGeneratorState();
1302 //2.{
1304 Doxygen::indexList->disable();
1305
1306 writeClassHierarchy(ol,nullptr,addToIndex,ClassDef::Interface);
1307
1308 Doxygen::indexList->enable();
1309 ol.popGeneratorState();
1310 //2.}
1311
1312 // ---------------
1313 // Dynamic interface hierarchical index for HTML
1314 // ---------------
1315 ol.pushGeneratorState();
1316 //2.{
1318
1319 {
1320 if (addToIndex)
1321 {
1322 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"interfacehierarchy",QCString(),TRUE,TRUE);
1323 }
1324 FTVHelp ftv(false);
1325 writeClassHierarchy(ol,&ftv,addToIndex,ClassDef::Interface);
1326 TextStream t;
1328 ol.pushGeneratorState();
1330 ol.writeString(t.str());
1331 ol.popGeneratorState();
1332 }
1333 ol.popGeneratorState();
1334 //2.}
1335 // ------
1336
1337 endFile(ol);
1338 ol.popGeneratorState();
1339 //1.}
1340}
1341
1342//----------------------------------------------------------------------------
1343
1345{
1346 if (Index::instance().numHierarchyInterfaces()==0) return;
1348 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceHierarchy);
1349 QCString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
1350 startFile(ol,"interfaceinherits",false,QCString(),title,HighlightedItem::InterfaceHierarchy,FALSE,"interfacehierarchy");
1351 startTitle(ol,QCString());
1352 ol.parseText(title);
1353 endTitle(ol,QCString(),QCString());
1354 ol.startContents();
1355 ol.startTextBlock();
1356 ol.startParagraph();
1357 ol.startTextLink("interfacehierarchy",QCString());
1358 ol.parseText(theTranslator->trGotoTextualHierarchy());
1359 ol.endTextLink();
1360 ol.endParagraph();
1361 ol.endTextBlock();
1364 endFile(ol);
1365 ol.enableAll();
1366}
1367
1368//----------------------------------------------------------------------------
1369
1371{
1372 if (Index::instance().numHierarchyExceptions()==0) return;
1373 ol.pushGeneratorState();
1374 //1.{
1376
1377 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionHierarchy);
1378 QCString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
1379 bool addToIndex = lne==nullptr || lne->visible();
1380
1381 startFile(ol,"exceptionhierarchy",false,QCString(), title, HighlightedItem::ExceptionHierarchy);
1382 startTitle(ol,QCString());
1383 ol.parseText(title);
1384 endTitle(ol,QCString(),QCString());
1385 ol.startContents();
1386 ol.startTextBlock();
1387
1388 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1389 {
1392 ol.startParagraph();
1393 ol.startTextLink("exceptioninherits",QCString());
1394 ol.parseText(theTranslator->trGotoGraphicalHierarchy());
1395 ol.endTextLink();
1396 ol.endParagraph();
1399 }
1400 ol.parseText(lne ? lne->intro() : theTranslator->trExceptionHierarchyDescription());
1401 ol.endTextBlock();
1402
1403 // ---------------
1404 // Static exception hierarchy for Latex/RTF
1405 // ---------------
1406 ol.pushGeneratorState();
1407 //2.{
1409 Doxygen::indexList->disable();
1410
1411 writeClassHierarchy(ol,nullptr,addToIndex,ClassDef::Exception);
1412
1413 Doxygen::indexList->enable();
1414 ol.popGeneratorState();
1415 //2.}
1416
1417 // ---------------
1418 // Dynamic exception hierarchical index for HTML
1419 // ---------------
1420 ol.pushGeneratorState();
1421 //2.{
1423
1424 {
1425 if (addToIndex)
1426 {
1427 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"exceptionhierarchy",QCString(),TRUE,TRUE);
1428 }
1429 FTVHelp ftv(false);
1430 writeClassHierarchy(ol,&ftv,addToIndex,ClassDef::Exception);
1431 TextStream t;
1433 ol.pushGeneratorState();
1435 ol.writeString(t.str());
1436 ol.popGeneratorState();
1437 }
1438 ol.popGeneratorState();
1439 //2.}
1440 // ------
1441
1442 endFile(ol);
1443 ol.popGeneratorState();
1444 //1.}
1445}
1446
1447//----------------------------------------------------------------------------
1448
1450{
1451 if (Index::instance().numHierarchyExceptions()==0) return;
1453 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionHierarchy);
1454 QCString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
1455 startFile(ol,"exceptioninherits",false,QCString(),title,HighlightedItem::ExceptionHierarchy,FALSE,"exceptionhierarchy");
1456 startTitle(ol,QCString());
1457 ol.parseText(title);
1458 endTitle(ol,QCString(),QCString());
1459 ol.startContents();
1460 ol.startTextBlock();
1461 ol.startParagraph();
1462 ol.startTextLink("exceptionhierarchy",QCString());
1463 ol.parseText(theTranslator->trGotoTextualHierarchy());
1464 ol.endTextLink();
1465 ol.endParagraph();
1466 ol.endTextBlock();
1469 endFile(ol);
1470 ol.enableAll();
1471}
1472
1473//----------------------------------------------------------------------------
1474
1475static void countFiles(int &allFiles,int &docFiles)
1476{
1477 allFiles=0;
1478 docFiles=0;
1479 for (const auto &fn : *Doxygen::inputNameLinkedMap)
1480 {
1481 for (const auto &fd: *fn)
1482 {
1483 bool src = false;
1484 bool doc = fileVisibleInIndex(fd.get(),src);
1485 if (doc || src)
1486 {
1487 allFiles++;
1488 }
1489 if (doc)
1490 {
1491 docFiles++;
1492 }
1493 }
1494 }
1495}
1496
1497static void writeSingleFileIndex(OutputList &ol,const FileDef *fd)
1498{
1499 //printf("Found filedef %s\n",qPrint(fd->name()));
1500 bool doc = fd->isLinkableInProject();
1501 bool src = fd->generateSourceFile();
1502 bool nameOk = !fd->isDocumentationFile();
1503 if (nameOk && (doc || src) && !fd->isReference())
1504 {
1505 QCString path;
1506 if (Config_getBool(FULL_PATH_NAMES))
1507 {
1508 path=stripFromPath(fd->getPath());
1509 }
1510 QCString fullName=fd->name();
1511 if (!path.isEmpty())
1512 {
1513 if (path.at(path.length()-1)!='/') fullName.prepend("/");
1514 fullName.prepend(path);
1515 }
1516
1517 ol.startIndexKey();
1518 ol.docify(path);
1519 if (doc)
1520 {
1522 //if (addToIndex)
1523 //{
1524 // addMembersToIndex(fd,LayoutDocManager::File,fullName,QCString());
1525 //}
1526 }
1527 else if (src)
1528 {
1530 }
1531 if (doc && src)
1532 {
1533 ol.pushGeneratorState();
1535 ol.docify(" ");
1537 ol.docify("[");
1538 ol.parseText(theTranslator->trCode());
1539 ol.docify("]");
1540 ol.endTextLink();
1541 ol.popGeneratorState();
1542 }
1543 ol.endIndexKey();
1544 bool hasBrief = !fd->briefDescription().isEmpty();
1545 ol.startIndexValue(hasBrief);
1546 if (hasBrief)
1547 {
1548 ol.generateDoc(fd->briefFile(),
1549 fd->briefLine(),
1550 fd,
1551 nullptr,
1552 fd->briefDescription(true),
1553 DocOptions()
1554 .setSingleLine(true)
1555 .setLinkFromIndex(true));
1556 }
1557 if (doc)
1558 {
1559 ol.endIndexValue(fd->getOutputFileBase(),hasBrief);
1560 }
1561 else // src
1562 {
1563 ol.endIndexValue(fd->getSourceFileBase(),hasBrief);
1564 }
1565 //ol.popGeneratorState();
1566 // --------------------------------------------------------
1567 }
1568}
1569//----------------------------------------------------------------------------
1570
1572{
1573 if (Index::instance().numDocumentedDirs()==0) return;
1574 ol.pushGeneratorState();
1576
1577 QCString title = theTranslator->trDirectories();
1578 startFile(ol,"dirs",false,QCString(),title,HighlightedItem::Files);
1579 startTitle(ol,title);
1580 ol.parseText(title);
1581 endTitle(ol,QCString(),QCString());
1582
1583 ol.startIndexList();
1584 for (const auto &dir : *Doxygen::dirLinkedMap)
1585 {
1586 if (dir->hasDocumentation())
1587 {
1588 writeDirTreeNode(ol, dir.get(), 1, nullptr, false);
1589 }
1590 }
1591
1592 ol.endIndexList();
1593
1594 endFile(ol);
1595 ol.popGeneratorState();
1596}
1597
1598//----------------------------------------------------------------------------
1599
1601{
1602 if (Index::instance().numDocumentedFiles()==0 || !Config_getBool(SHOW_FILES)) return;
1603
1604 ol.pushGeneratorState();
1607
1608 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileList);
1609 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files); // fall back
1610 QCString title = lne ? lne->title() : theTranslator->trFileList();
1611 bool addToIndex = lne==nullptr || lne->visible();
1612
1613 startFile(ol,"files",false,QCString(),title,HighlightedItem::Files);
1614 startTitle(ol,QCString());
1615 //if (!Config_getString(PROJECT_NAME).isEmpty())
1616 //{
1617 // title.prepend(Config_getString(PROJECT_NAME)+" ");
1618 //}
1619 ol.parseText(title);
1620 endTitle(ol,QCString(),QCString());
1621 ol.startContents();
1622 ol.startTextBlock();
1623
1624 if (addToIndex)
1625 {
1626 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"files",QCString(),TRUE,TRUE);
1627 Doxygen::indexList->incContentsDepth();
1628 }
1629
1630 ol.parseText(lne ? lne->intro() : theTranslator->trFileListDescription(Config_getBool(EXTRACT_ALL)));
1631 ol.endTextBlock();
1632
1633 // ---------------
1634 // Flat file index
1635 // ---------------
1636
1637 // 1. {
1638 ol.pushGeneratorState();
1640
1641 ol.startIndexList();
1642 if (Config_getBool(FULL_PATH_NAMES))
1643 {
1644 std::unordered_map<std::string,size_t> pathMap;
1645 std::vector<FilesInDir> outputFiles;
1646
1647 // re-sort input files in (dir,file) output order instead of (file,dir) input order
1648 for (const auto &fn : *Doxygen::inputNameLinkedMap)
1649 {
1650 for (const auto &fd : *fn)
1651 {
1652 QCString path=fd->getPath();
1653 if (path.isEmpty()) path="[external]";
1654 auto it = pathMap.find(path.str());
1655 if (it!=pathMap.end()) // existing path -> append
1656 {
1657 outputFiles.at(it->second).files.push_back(fd.get());
1658 }
1659 else // new path -> create path entry + append
1660 {
1661 pathMap.emplace(path.str(),outputFiles.size());
1662 outputFiles.emplace_back(path);
1663 outputFiles.back().files.push_back(fd.get());
1664 }
1665 }
1666 }
1667
1668 // sort the files by path
1669 std::stable_sort(outputFiles.begin(),
1670 outputFiles.end(),
1671 [](const auto &fp1,const auto &fp2) { return qstricmp_sort(fp1.path,fp2.path)<0; });
1672 // sort the files inside the directory by name
1673 for (auto &fp : outputFiles)
1674 {
1675 std::stable_sort(fp.files.begin(), fp.files.end(), compareFileDefs);
1676 }
1677 // write the results
1678 for (const auto &fp : outputFiles)
1679 {
1680 for (const auto &fd : fp.files)
1681 {
1682 writeSingleFileIndex(ol,fd);
1683 }
1684 }
1685 }
1686 else
1687 {
1688 for (const auto &fn : *Doxygen::inputNameLinkedMap)
1689 {
1690 for (const auto &fd : *fn)
1691 {
1692 writeSingleFileIndex(ol,fd.get());
1693 }
1694 }
1695 }
1696 ol.endIndexList();
1697
1698 // 1. }
1699 ol.popGeneratorState();
1700
1701 // ---------------
1702 // Hierarchical file index for HTML
1703 // ---------------
1704 ol.pushGeneratorState();
1706
1707 {
1708 FTVHelp ftv(false);
1709 writeDirHierarchy(ol,&ftv,addToIndex);
1710 TextStream t;
1712 ol.writeString(t.str());
1713 }
1714
1715 ol.popGeneratorState();
1716 // ------
1717
1718 if (addToIndex)
1719 {
1720 Doxygen::indexList->decContentsDepth();
1721 }
1722
1723 endFile(ol);
1724 ol.popGeneratorState();
1725}
1726
1727//----------------------------------------------------------------------------
1729{
1730 int count=0;
1731 for (const auto &nd : *Doxygen::namespaceLinkedMap)
1732 {
1733 if (nd->isLinkableInProject()) count++;
1734 }
1735 return count;
1736}
1737
1738//----------------------------------------------------------------------------
1739static int countConcepts()
1740{
1741 int count=0;
1742 for (const auto &cd : *Doxygen::conceptLinkedMap)
1743 {
1744 if (cd->isLinkableInProject()) count++;
1745 }
1746 return count;
1747}
1748
1749
1750//----------------------------------------------------------------------------
1751template<typename Ptr> const ClassDef *get_pointer(const Ptr &p);
1752template<> const ClassDef *get_pointer(const ClassLinkedMap::Ptr &p) { return p.get(); }
1753template<> const ClassDef *get_pointer(const ClassLinkedRefMap::Ptr &p) { return p; }
1754
1755template<class ListType>
1756static void writeClassTree(const ListType &cl,FTVHelp *ftv,bool addToIndex,bool globalOnly,ClassDef::CompoundType ct)
1757{
1758 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1759 for (const auto &cdi : cl)
1760 {
1761 const ClassDef *cd = get_pointer(cdi);
1762 if (cd->getLanguage()==SrcLangExt::VHDL)
1763 {
1766 )// no architecture
1767 {
1768 continue;
1769 }
1770 }
1771
1772 if (sliceOpt && cd->compoundType() != ct)
1773 {
1774 continue;
1775 }
1776
1777 if (!globalOnly ||
1778 cd->getOuterScope()==nullptr ||
1780 )
1781 {
1782 int count=0;
1783 for (const auto &ccd : cd->getClasses())
1784 {
1785 if (ccd->isLinkableInProject() && !ccd->isImplicitTemplateInstance())
1786 {
1787 count++;
1788 }
1789 }
1791 {
1792 QCString displayName = cd->displayName(false);
1793 if (ftv)
1794 {
1795 ftv->addContentsItem(count>0,displayName,cd->getReference(),
1796 cd->getOutputFileBase(),cd->anchor(),FALSE,TRUE,cd,convertToHtml(displayName));
1797 }
1798 if (addToIndex &&
1799 (cd->getOuterScope()==nullptr ||
1801 )
1802 )
1803 {
1804 addMembersToIndex(cd,LayoutDocManager::Class,
1805 displayName,
1806 cd->anchor(),
1807 cd->partOfGroups().empty() && !cd->isSimple());
1808 }
1809 if (count>0)
1810 {
1811 if (ftv) ftv->incContentsDepth();
1812 writeClassTree(cd->getClasses(),ftv,addToIndex,FALSE,ct);
1813 if (ftv) ftv->decContentsDepth();
1814 }
1815 }
1816 }
1817 }
1818}
1819
1820static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex)
1821{
1822 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
1823 {
1824 if (lde->kind()==LayoutDocEntry::MemberDef)
1825 {
1826 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
1827 if (lmd)
1828 {
1829 MemberList *ml = nd->getMemberList(lmd->type);
1830 if (ml)
1831 {
1832 for (const auto &md : *ml)
1833 {
1834 //printf(" member %s visible=%d\n",qPrint(md->name()),md->visibleInIndex());
1835 if (md->visibleInIndex())
1836 {
1837 writeMemberToIndex(nd,md,addToIndex);
1838 }
1839 }
1840 }
1841 }
1842 }
1843 }
1844}
1845
1846static void writeModuleMembers(const ModuleDef *mod,bool addToIndex)
1847{
1848 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Module))
1849 {
1850 if (lde->kind()==LayoutDocEntry::MemberDecl)
1851 {
1852 const LayoutDocEntryMemberDecl *lmd = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get());
1853 if (lmd)
1854 {
1855 MemberList *ml = mod->getMemberList(lmd->type);
1856 if (ml)
1857 {
1858 for (const auto &md : *ml)
1859 {
1860 //printf(" member %s visible=%d\n",qPrint(md->name()),md->visibleInIndex());
1861 if (md->visibleInIndex())
1862 {
1863 writeMemberToIndex(mod,md,addToIndex);
1864 }
1865 }
1866 }
1867 }
1868 }
1869 }
1870}
1871
1872
1873static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv,bool addToIndex);
1874static void writeNamespaceTree(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
1875 bool rootOnly,bool addToIndex);
1876
1878 bool rootOnly,bool addToIndex)
1879{
1880 if (!nd->isAnonymous() &&
1881 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
1882 {
1883
1884 bool hasNestedNamespace = namespaceHasNestedNamespace(nd);
1885 bool hasChildren = hasNestedNamespace ||
1888 bool isLinkable = nd->isLinkable();
1889 int visibleMembers = nd->countVisibleMembers();
1890
1891 //printf("namespace %s hasChildren=%d visibleMembers=%d\n",qPrint(nd->name()),hasChildren,visibleMembers);
1892
1893 QCString ref;
1894 QCString file;
1895 if (isLinkable)
1896 {
1897 ref = nd->getReference();
1898 file = nd->getOutputFileBase();
1899 if (nd->getLanguage()==SrcLangExt::VHDL) // UGLY HACK
1900 {
1901 file=file.replace(0,qstrlen("namespace"),"class");
1902 }
1903 }
1904
1905 bool isDir = hasChildren || visibleMembers>0;
1906 if (isLinkable || isDir)
1907 {
1908 ftv->addContentsItem(hasNestedNamespace,nd->localName(),ref,file,QCString(),FALSE,nd->partOfGroups().empty(),nd);
1909
1910 if (addToIndex)
1911 {
1912 Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
1913 hasChildren && !file.isEmpty(),nd->partOfGroups().empty());
1914 }
1915 if (addToIndex && isDir)
1916 {
1917 Doxygen::indexList->incContentsDepth();
1918 }
1919
1920 if (isDir)
1921 {
1922 ftv->incContentsDepth();
1923 writeNamespaceTree(nd->getNamespaces(),ftv,FALSE,addToIndex);
1924 writeClassTree(nd->getClasses(),nullptr,addToIndex,FALSE,ClassDef::Class);
1925 writeConceptList(nd->getConcepts(),nullptr,addToIndex);
1926 writeNamespaceMembers(nd,addToIndex);
1927 ftv->decContentsDepth();
1928 }
1929 if (addToIndex && isDir)
1930 {
1931 Doxygen::indexList->decContentsDepth();
1932 }
1933 }
1934 }
1935}
1936
1937static void writeNamespaceTree(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
1938 bool rootOnly,bool addToIndex)
1939{
1940 for (const auto &nd : nsLinkedMap)
1941 {
1942 if (nd->isVisibleInHierarchy())
1943 {
1944 writeNamespaceTreeElement(nd,ftv,rootOnly,addToIndex);
1945 }
1946 }
1947}
1948
1949static void writeNamespaceTree(const NamespaceLinkedMap &nsLinkedMap,FTVHelp *ftv,
1950 bool rootOnly,bool addToIndex)
1951{
1952 for (const auto &nd : nsLinkedMap)
1953 {
1954 if (nd->isVisibleInHierarchy())
1955 {
1956 writeNamespaceTreeElement(nd.get(),ftv,rootOnly,addToIndex);
1957 }
1958 }
1959}
1960
1961static void writeClassTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
1962 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct);
1963
1965 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
1966{
1967 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1968 if (!nd->isAnonymous() &&
1969 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
1970 {
1971 bool isDir = namespaceHasNestedClass(nd,sliceOpt,ct);
1972 bool isLinkable = nd->isLinkableInProject();
1973
1974 //printf("writeClassTreeInsideNamespaceElement namespace %s isLinkable=%d isDir=%d\n",qPrint(nd->name()),isLinkable,isDir);
1975
1976 QCString ref;
1977 QCString file;
1978 if (isLinkable)
1979 {
1980 ref = nd->getReference();
1981 file = nd->getOutputFileBase();
1982 if (nd->getLanguage()==SrcLangExt::VHDL) // UGLY HACK
1983 {
1984 file=file.replace(0,qstrlen("namespace"),"class");
1985 }
1986 }
1987
1988 if (isDir)
1989 {
1990 ftv->addContentsItem(isDir,nd->localName(),ref,file,QCString(),FALSE,TRUE,nd);
1991
1992 if (addToIndex)
1993 {
1994 // the namespace entry is already shown under the namespace list so don't
1995 // add it to the nav index and don't create a separate index file for it otherwise
1996 // it will overwrite the one written for the namespace list.
1997 Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
1998 false, // separateIndex
1999 false // addToNavIndex
2000 );
2001 }
2002 if (addToIndex)
2003 {
2004 Doxygen::indexList->incContentsDepth();
2005 }
2006
2007 ftv->incContentsDepth();
2008 writeClassTreeInsideNamespace(nd->getNamespaces(),ftv,FALSE,addToIndex,ct);
2009 ClassLinkedRefMap d = nd->getClasses();
2010 if (sliceOpt)
2011 {
2012 if (ct == ClassDef::Interface)
2013 {
2014 d = nd->getInterfaces();
2015 }
2016 else if (ct == ClassDef::Struct)
2017 {
2018 d = nd->getStructs();
2019 }
2020 else if (ct == ClassDef::Exception)
2021 {
2022 d = nd->getExceptions();
2023 }
2024 }
2025 writeClassTree(d,ftv,addToIndex,FALSE,ct);
2026 ftv->decContentsDepth();
2027
2028 if (addToIndex)
2029 {
2030 Doxygen::indexList->decContentsDepth();
2031 }
2032 }
2033 }
2034}
2035
2037 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
2038{
2039 for (const auto &nd : nsLinkedMap)
2040 {
2041 writeClassTreeInsideNamespaceElement(nd,ftv,rootOnly,addToIndex,ct);
2042 }
2043}
2044
2046 bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
2047{
2048 for (const auto &nd : nsLinkedMap)
2049 {
2050 writeClassTreeInsideNamespaceElement(nd.get(),ftv,rootOnly,addToIndex,ct);
2051 }
2052}
2053
2055{
2056 if (Index::instance().numDocumentedNamespaces()==0) return;
2057 ol.pushGeneratorState();
2060 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceList);
2061 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces); // fall back
2062 QCString title = lne ? lne->title() : theTranslator->trNamespaceList();
2063 bool addToIndex = lne==nullptr || lne->visible();
2064 startFile(ol,"namespaces",false,QCString(),title,HighlightedItem::Namespaces);
2065 startTitle(ol,QCString());
2066 ol.parseText(title);
2067 endTitle(ol,QCString(),QCString());
2068 ol.startContents();
2069 ol.startTextBlock();
2070 ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceListDescription(Config_getBool(EXTRACT_ALL)));
2071 ol.endTextBlock();
2072
2073 bool first=TRUE;
2074
2075 // ---------------
2076 // Linear namespace index for Latex/RTF
2077 // ---------------
2078 ol.pushGeneratorState();
2080
2081 for (const auto &nd : *Doxygen::namespaceLinkedMap)
2082 {
2083 if (nd->isLinkableInProject())
2084 {
2085 if (first)
2086 {
2087 ol.startIndexList();
2088 first=FALSE;
2089 }
2090 //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
2091 ol.startIndexKey();
2092 if (nd->getLanguage()==SrcLangExt::VHDL)
2093 {
2094 ol.writeObjectLink(QCString(), nd->getOutputFileBase().replace(0,qstrlen("namespace"),"class"),QCString(),nd->displayName());
2095 }
2096 else
2097 {
2098 ol.writeObjectLink(QCString(),nd->getOutputFileBase(),QCString(),nd->displayName());
2099 }
2100 ol.endIndexKey();
2101
2102 bool hasBrief = !nd->briefDescription().isEmpty();
2103 ol.startIndexValue(hasBrief);
2104 if (hasBrief)
2105 {
2106 ol.generateDoc(nd->briefFile(),
2107 nd->briefLine(),
2108 nd.get(),
2109 nullptr,
2110 nd->briefDescription(true),
2111 DocOptions()
2112 .setSingleLine(true)
2113 .setLinkFromIndex(true));
2114 }
2115 ol.endIndexValue(nd->getOutputFileBase(),hasBrief);
2116
2117 }
2118 }
2119 if (!first) ol.endIndexList();
2120
2121 ol.popGeneratorState();
2122
2123 // ---------------
2124 // Hierarchical namespace index for HTML
2125 // ---------------
2126 ol.pushGeneratorState();
2128
2129 {
2130 if (addToIndex)
2131 {
2132 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"namespaces",QCString(),TRUE,TRUE);
2133 Doxygen::indexList->incContentsDepth();
2134 }
2135 FTVHelp ftv(false);
2137 TextStream t;
2139 ol.writeString(t.str());
2140 if (addToIndex)
2141 {
2142 Doxygen::indexList->decContentsDepth();
2143 }
2144 }
2145
2146 ol.popGeneratorState();
2147 // ------
2148
2149 endFile(ol);
2150 ol.popGeneratorState();
2151}
2152
2153//----------------------------------------------------------------------------
2154
2156{
2157 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2158 int count=0;
2159 int countPrinted=0;
2160 for (const auto &cd : *Doxygen::classLinkedMap)
2161 {
2162 if (sliceOpt && cd->compoundType() != ct)
2163 {
2164 continue;
2165 }
2166 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2167 {
2168 if (!cd->isEmbeddedInOuterScope())
2169 {
2170 countPrinted++;
2171 }
2172 count++;
2173 }
2174 }
2175 *cp = countPrinted;
2176 return count;
2177}
2178
2179
2181{
2182 //LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
2183 //bool addToIndex = lne==nullptr || lne->visible();
2184 bool first=TRUE;
2185
2186 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2187
2188 for (const auto &cd : *Doxygen::classLinkedMap)
2189 {
2190 if (cd->getLanguage()==SrcLangExt::VHDL &&
2191 (VhdlDocGen::convert(cd->protection())==VhdlDocGen::PACKAGECLASS ||
2193 ) // no architecture
2194 {
2195 continue;
2196 }
2197 if (first)
2198 {
2199 ol.startIndexList();
2200 first=FALSE;
2201 }
2202
2203 if (sliceOpt && cd->compoundType() != ct)
2204 {
2205 continue;
2206 }
2207
2208 ol.pushGeneratorState();
2209 if (cd->isEmbeddedInOuterScope())
2210 {
2214 }
2215 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2216 {
2217 ol.startIndexKey();
2218 if (cd->getLanguage()==SrcLangExt::VHDL)
2219 {
2221 ol.docify(prot);
2222 ol.writeString(" ");
2223 }
2224 ol.writeObjectLink(QCString(),cd->getOutputFileBase(),cd->anchor(),cd->displayName());
2225 ol.endIndexKey();
2226 bool hasBrief = !cd->briefDescription().isEmpty();
2227 ol.startIndexValue(hasBrief);
2228 if (hasBrief)
2229 {
2230 ol.generateDoc(cd->briefFile(),
2231 cd->briefLine(),
2232 cd.get(),
2233 nullptr,
2234 cd->briefDescription(true),
2235 DocOptions()
2236 .setSingleLine(true)
2237 .setLinkFromIndex(true));
2238 }
2239 ol.endIndexValue(cd->getOutputFileBase(),hasBrief);
2240
2241 //if (addToIndex)
2242 //{
2243 // addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(),cd->anchor());
2244 //}
2245 }
2246 ol.popGeneratorState();
2247 }
2248 if (!first) ol.endIndexList();
2249}
2250
2251inline bool isId1(int c)
2252{
2253 return (c<127 && c>31); // printable ASCII character
2254}
2255
2256static QCString letterToLabel(const QCString &startLetter)
2257{
2258 if (startLetter.isEmpty()) return startLetter;
2259 const char *p = startLetter.data();
2260 char c = *p;
2261 QCString result;
2262 if (isId1(c))
2263 {
2264 result+=c;
2265 }
2266 else
2267 {
2268 result="0x";
2269 const char hex[]="0123456789abcdef";
2270 while ((c=*p++))
2271 {
2272 result+=hex[static_cast<unsigned char>(c)>>4];
2273 result+=hex[static_cast<unsigned char>(c)&0xf];
2274 }
2275 }
2276 return result;
2277}
2278
2279//----------------------------------------------------------------------------
2280
2281
2282using UsedIndexLetters = std::set<std::string>;
2283
2284// write an alphabetical index of all class with a header for each letter
2285static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct, int /* annotatedCount */)
2286{
2287 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2288
2289 // What starting letters are used
2290 UsedIndexLetters indexLettersUsed;
2291
2292 // first count the number of headers
2293 for (const auto &cd : *Doxygen::classLinkedMap)
2294 {
2295 if (sliceOpt && cd->compoundType() != ct)
2296 continue;
2297 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2298 {
2299 if (cd->getLanguage()==SrcLangExt::VHDL && !(VhdlDocGen::convert(cd->protection())==VhdlDocGen::ENTITYCLASS ))// no architecture
2300 continue;
2301
2302 // get the first UTF8 character (after the part that should be ignored)
2303 int index = getPrefixIndex(cd->className());
2304 std::string letter = getUTF8CharAt(cd->className().str(),index);
2305 if (!letter.empty())
2306 {
2307 indexLettersUsed.insert(convertUTF8ToUpper(letter));
2308 }
2309 }
2310 }
2311
2312 // write quick link index (row of letters)
2313 QCString alphaLinks = "<div class=\"qindex\">";
2314 bool first=true;
2315 for (const auto &letter : indexLettersUsed)
2316 {
2317 if (!first) alphaLinks += alphaSepar;
2318 first=false;
2319 QCString li = letterToLabel(letter);
2320 alphaLinks += "<a class=\"qindex\" href=\"#letter_" +
2321 li + "\">" +
2322 letter + "</a>";
2323 }
2324 alphaLinks += "</div>\n";
2325 ol.writeString(alphaLinks);
2326
2327 std::map<std::string, std::vector<const ClassDef*> > classesByLetter;
2328
2329 // fill the columns with the class list (row elements in each column,
2330 // expect for the columns with number >= itemsInLastRow, which get one
2331 // item less.
2332 for (const auto &cd : *Doxygen::classLinkedMap)
2333 {
2334 if (sliceOpt && cd->compoundType() != ct)
2335 continue;
2336 if (cd->getLanguage()==SrcLangExt::VHDL && !(VhdlDocGen::convert(cd->protection())==VhdlDocGen::ENTITYCLASS ))// no architecture
2337 continue;
2338
2339 if (cd->isLinkableInProject() && !cd->isImplicitTemplateInstance())
2340 {
2341 QCString className = cd->className();
2342 int index = getPrefixIndex(className);
2343 std::string letter = getUTF8CharAt(className.str(),index);
2344 if (!letter.empty())
2345 {
2346 letter = convertUTF8ToUpper(letter);
2347 auto it = classesByLetter.find(letter);
2348 if (it!=classesByLetter.end()) // add class to the existing list
2349 {
2350 it->second.push_back(cd.get());
2351 }
2352 else // new entry
2353 {
2354 classesByLetter.emplace(letter, std::vector<const ClassDef*>({ cd.get() }));
2355 }
2356 }
2357 }
2358 }
2359
2360 // sort the class lists per letter while ignoring the prefix
2361 for (auto &[letter,list] : classesByLetter)
2362 {
2363 std::stable_sort(list.begin(), list.end(),
2364 [](const auto &c1,const auto &c2)
2365 {
2366 QCString n1 = c1->className();
2367 QCString n2 = c2->className();
2368 return qstricmp_sort(n1.data()+getPrefixIndex(n1), n2.data()+getPrefixIndex(n2))<0;
2369 });
2370 }
2371
2372 // generate table
2373 if (!classesByLetter.empty())
2374 {
2375 ol.writeString("<div class=\"classindex\">\n");
2376 int counter=0;
2377 for (const auto &cl : classesByLetter)
2378 {
2379 QCString parity = (counter++%2)==0 ? "even" : "odd";
2380 ol.writeString("<dl class=\"classindex " + parity + "\">\n");
2381
2382 // write character heading
2383 ol.writeString("<dt class=\"alphachar\">");
2384 QCString s = letterToLabel(cl.first);
2385 ol.writeString("<a id=\"letter_");
2386 ol.writeString(s);
2387 ol.writeString("\" name=\"letter_");
2388 ol.writeString(s);
2389 ol.writeString("\">");
2390 ol.writeString(cl.first);
2391 ol.writeString("</a>");
2392 ol.writeString("</dt>\n");
2393
2394 // write class links
2395 for (const auto &cd : cl.second)
2396 {
2397 ol.writeString("<dd>");
2398 QCString namesp,cname;
2399 extractNamespaceName(cd->name(),cname,namesp);
2400 QCString nsDispName;
2401 SrcLangExt lang = cd->getLanguage();
2403 if (sep!="::")
2404 {
2405 nsDispName=substitute(namesp,"::",sep);
2406 cname=substitute(cname,"::",sep);
2407 }
2408 else
2409 {
2410 nsDispName=namesp;
2411 }
2412
2413 ol.writeObjectLink(cd->getReference(),
2414 cd->getOutputFileBase(),cd->anchor(),cname);
2415 if (!namesp.isEmpty())
2416 {
2417 ol.writeString(" (");
2418 NamespaceDef *nd = getResolvedNamespace(namesp);
2419 if (nd && nd->isLinkable())
2420 {
2422 nd->getOutputFileBase(),QCString(),nsDispName);
2423 }
2424 else
2425 {
2426 ol.docify(nsDispName);
2427 }
2428 ol.writeString(")");
2429 }
2430 ol.writeString("</dd>");
2431 }
2432
2433 ol.writeString("</dl>\n");
2434 }
2435 ol.writeString("</div>\n");
2436 }
2437}
2438
2439//----------------------------------------------------------------------------
2440
2442{
2443 if (Index::instance().numAnnotatedClasses()==0) return;
2444 ol.pushGeneratorState();
2446 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassIndex);
2447 QCString title = lne ? lne->title() : theTranslator->trCompoundIndex();
2448 bool addToIndex = lne==nullptr || lne->visible();
2449
2450 startFile(ol,"classes",false,QCString(),title,HighlightedItem::Classes);
2451
2452 startTitle(ol,QCString());
2453 ol.parseText(title);
2454 endTitle(ol,QCString(),QCString());
2455
2456 if (addToIndex)
2457 {
2458 Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"classes",QCString(),FALSE,TRUE);
2459 }
2460
2461 ol.startContents();
2462 writeAlphabeticalClassList(ol, ClassDef::Class, Index::instance().numAnnotatedClasses());
2463 endFile(ol); // contains ol.endContents()
2464
2465 ol.popGeneratorState();
2466}
2467
2468//----------------------------------------------------------------------------
2469
2471{
2472 if (Index::instance().numAnnotatedInterfaces()==0) return;
2473 ol.pushGeneratorState();
2475 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceIndex);
2476 QCString title = lne ? lne->title() : theTranslator->trInterfaceIndex();
2477 bool addToIndex = lne==nullptr || lne->visible();
2478
2479 startFile(ol,"interfaces",false,QCString(),title,HighlightedItem::Interfaces);
2480
2481 startTitle(ol,QCString());
2482 ol.parseText(title);
2483 endTitle(ol,QCString(),QCString());
2484
2485 if (addToIndex)
2486 {
2487 Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"interfaces",QCString(),FALSE,TRUE);
2488 }
2489
2490 ol.startContents();
2491 writeAlphabeticalClassList(ol, ClassDef::Interface, Index::instance().numAnnotatedInterfaces());
2492 endFile(ol); // contains ol.endContents()
2493
2494 ol.popGeneratorState();
2495}
2496
2497//----------------------------------------------------------------------------
2498
2500{
2501 if (Index::instance().numAnnotatedStructs()==0) return;
2502 ol.pushGeneratorState();
2504 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::StructIndex);
2505 QCString title = lne ? lne->title() : theTranslator->trStructIndex();
2506 bool addToIndex = lne==nullptr || lne->visible();
2507
2508 startFile(ol,"structs",false,QCString(),title,HighlightedItem::Structs);
2509
2510 startTitle(ol,QCString());
2511 ol.parseText(title);
2512 endTitle(ol,QCString(),QCString());
2513
2514 if (addToIndex)
2515 {
2516 Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"structs",QCString(),FALSE,TRUE);
2517 }
2518
2519 ol.startContents();
2520 writeAlphabeticalClassList(ol, ClassDef::Struct, Index::instance().numAnnotatedStructs());
2521 endFile(ol); // contains ol.endContents()
2522
2523 ol.popGeneratorState();
2524}
2525
2526//----------------------------------------------------------------------------
2527
2529{
2530 if (Index::instance().numAnnotatedExceptions()==0) return;
2531 ol.pushGeneratorState();
2533 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionIndex);
2534 QCString title = lne ? lne->title() : theTranslator->trExceptionIndex();
2535 bool addToIndex = lne==nullptr || lne->visible();
2536
2537 startFile(ol,"exceptions",false,QCString(),title,HighlightedItem::Exceptions);
2538
2539 startTitle(ol,QCString());
2540 ol.parseText(title);
2541 endTitle(ol,QCString(),QCString());
2542
2543 if (addToIndex)
2544 {
2545 Doxygen::indexList->addContentsItem(FALSE,title,QCString(),"exceptions",QCString(),FALSE,TRUE);
2546 }
2547
2548 ol.startContents();
2549 writeAlphabeticalClassList(ol, ClassDef::Exception, Index::instance().numAnnotatedExceptions());
2550 endFile(ol); // contains ol.endContents()
2551
2552 ol.popGeneratorState();
2553}
2554
2555//----------------------------------------------------------------------------
2556
2581
2583{
2584 //printf("writeAnnotatedIndex: count=%d printed=%d\n",
2585 // annotatedClasses,annotatedClassesPrinted);
2586 if (ctx.numAnnotated==0) return;
2587
2588 ol.pushGeneratorState();
2590 if (ctx.numPrinted==0)
2591 {
2594 }
2596 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(ctx.fallbackKind); // fall back
2597 QCString title = lne ? lne->title() : ctx.listDefaultTitleText;
2598 bool addToIndex = lne==nullptr || lne->visible();
2599
2600 startFile(ol,ctx.fileBaseName,false,QCString(),title,ctx.hiItem);
2601
2602 startTitle(ol,QCString());
2603 ol.parseText(title);
2604 endTitle(ol,QCString(),QCString());
2605
2606 ol.startContents();
2607
2608 ol.startTextBlock();
2609 ol.parseText(lne ? lne->intro() : ctx.listDefaultIntroText);
2610 ol.endTextBlock();
2611
2612 // ---------------
2613 // Linear class index for Latex/RTF
2614 // ---------------
2615 ol.pushGeneratorState();
2617 Doxygen::indexList->disable();
2618
2620
2621 Doxygen::indexList->enable();
2622 ol.popGeneratorState();
2623
2624 // ---------------
2625 // Hierarchical class index for HTML
2626 // ---------------
2627 ol.pushGeneratorState();
2629
2630 {
2631 if (addToIndex)
2632 {
2633 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),ctx.fileBaseName,QCString(),TRUE,TRUE);
2634 Doxygen::indexList->incContentsDepth();
2635 }
2636 FTVHelp ftv(false);
2639 TextStream t;
2641 ol.writeString(t.str());
2642 if (addToIndex)
2643 {
2644 Doxygen::indexList->decContentsDepth();
2645 }
2646 }
2647
2648 ol.popGeneratorState();
2649 // ------
2650
2651 endFile(ol); // contains ol.endContents()
2652 ol.popGeneratorState();
2653}
2654
2655//----------------------------------------------------------------------------
2656
2658{
2659 const auto &index = Index::instance();
2661 AnnotatedIndexContext(index.numAnnotatedClasses(),index.numAnnotatedClassesPrinted(),
2662 LayoutNavEntry::ClassList,LayoutNavEntry::Classes,
2663 theTranslator->trCompoundList(),theTranslator->trCompoundListDescription(),
2665 "annotated",
2667}
2668
2669//----------------------------------------------------------------------------
2670
2672{
2673 const auto &index = Index::instance();
2675 AnnotatedIndexContext(index.numAnnotatedInterfaces(),index.numAnnotatedInterfacesPrinted(),
2676 LayoutNavEntry::InterfaceList,LayoutNavEntry::Interfaces,
2677 theTranslator->trInterfaceList(),theTranslator->trInterfaceListDescription(),
2679 "annotatedinterfaces",
2681}
2682
2683//----------------------------------------------------------------------------
2684
2686{
2687 const auto &index = Index::instance();
2689 AnnotatedIndexContext(index.numAnnotatedStructs(),index.numAnnotatedStructsPrinted(),
2690 LayoutNavEntry::StructList,LayoutNavEntry::Structs,
2691 theTranslator->trStructList(),theTranslator->trStructListDescription(),
2693 "annotatedstructs",
2695}
2696
2697//----------------------------------------------------------------------------
2698
2700{
2701 const auto &index = Index::instance();
2703 AnnotatedIndexContext(index.numAnnotatedExceptions(),index.numAnnotatedExceptionsPrinted(),
2704 LayoutNavEntry::ExceptionList,LayoutNavEntry::Exceptions,
2705 theTranslator->trExceptionList(),theTranslator->trExceptionListDescription(),
2707 "annotatedexceptions",
2709}
2710
2711//----------------------------------------------------------------------------
2712static void writeClassLinkForMember(OutputList &ol,const MemberDef *md,const QCString &separator,
2713 QCString &prevClassName)
2714{
2715 const ClassDef *cd=md->getClassDef();
2716 if ( cd && prevClassName!=cd->displayName())
2717 {
2718 ol.writeString(separator);
2720 cd->displayName());
2721 prevClassName = cd->displayName();
2722 }
2723}
2724
2725static void writeFileLinkForMember(OutputList &ol,const MemberDef *md,const QCString &separator,
2726 QCString &prevFileName)
2727{
2728 const FileDef *fd=md->getFileDef();
2729 if (fd && prevFileName!=fd->name())
2730 {
2731 ol.writeString(separator);
2733 fd->name());
2734 prevFileName = fd->name();
2735 }
2736}
2737
2738static void writeNamespaceLinkForMember(OutputList &ol,const MemberDef *md,const QCString &separator,
2739 QCString &prevNamespaceName)
2740{
2741 const NamespaceDef *nd=md->getNamespaceDef();
2742 if (nd && prevNamespaceName!=nd->displayName())
2743 {
2744 ol.writeString(separator);
2746 nd->displayName());
2747 prevNamespaceName = nd->displayName();
2748 }
2749}
2750
2751static void writeModuleLinkForMember(OutputList &ol,const MemberDef *md,const QCString &separator,
2752 QCString &prevModuleName)
2753{
2754 const ModuleDef *mod=md->getModuleDef();
2755 if (mod && prevModuleName!=mod->displayName())
2756 {
2757 ol.writeString(separator);
2758 // link to the member declaration in the module page
2759 ol.writeObjectLink(mod->getReference(),mod->getOutputFileBase(),"r_"+md->anchor(),
2760 mod->displayName());
2761 prevModuleName = mod->displayName();
2762 }
2763}
2764
2765
2766static void writeMemberList(OutputList &ol,bool useSections,const std::string &page,
2767 const Index::MemberIndexMap &memberIndexMap,
2769{
2770 int index = static_cast<int>(type);
2771 const int numIndices = 4;
2772 ASSERT(index<numIndices);
2773
2774 typedef void (*writeLinkForMember_t)(OutputList &ol,const MemberDef *md,const QCString &separator,
2775 QCString &prevNamespaceName);
2776
2777 // each index tab has its own write function
2778 static writeLinkForMember_t writeLinkForMemberMap[numIndices] =
2779 {
2784 };
2785 QCString prevName;
2786 QCString prevDefName;
2787 bool first=TRUE;
2788 bool firstSection=TRUE;
2789 bool firstItem=TRUE;
2790 const Index::MemberIndexList *mil = nullptr;
2791 std::string letter;
2792 for (const auto &kv : memberIndexMap)
2793 {
2794 if (!page.empty()) // specific page mode
2795 {
2796 auto it = memberIndexMap.find(page);
2797 if (it != memberIndexMap.end())
2798 {
2799 mil = &it->second;
2800 letter = page;
2801 }
2802 }
2803 else // do all pages
2804 {
2805 mil = &kv.second;
2806 letter = kv.first;
2807 }
2808 if (mil==nullptr || mil->empty()) continue;
2809 for (const auto &md : *mil)
2810 {
2811 const char *sep = nullptr;
2812 bool isFunc=!md->isObjCMethod() &&
2813 (md->isFunction() || md->isSlot() || md->isSignal());
2814 QCString name=type==Definition::TypeModule ? md->qualifiedName() : md->name();
2815 int startIndex = getPrefixIndex(name);
2816 if (name.data()+startIndex!=prevName) // new entry
2817 {
2818 if ((prevName.isEmpty() ||
2819 tolower(name.at(startIndex))!=tolower(prevName.at(0))) &&
2820 useSections) // new section
2821 {
2822 if (!firstItem) ol.endItemListItem();
2823 if (!firstSection) ol.endItemList();
2824 QCString cs = letterToLabel(letter);
2825 QCString anchor = "index_"+convertToId(cs);
2826 QCString title = "- "+letter+" -";
2827 ol.startSection(anchor,title,SectionType::Subsection);
2828 ol.docify(title);
2830 ol.startItemList();
2831 firstSection=FALSE;
2832 firstItem=TRUE;
2833 }
2834 else if (!useSections && first)
2835 {
2836 ol.startItemList();
2837 first=FALSE;
2838 }
2839
2840 // member name
2841 if (!firstItem) ol.endItemListItem();
2842 ol.startItemListItem();
2843 firstItem=FALSE;
2844 ol.docify(name);
2845 if (isFunc) ol.docify("()");
2846 //ol.writeString("\n");
2847
2848 // link to class
2849 prevDefName="";
2850 sep = "&#160;:&#160;";
2851 prevName = name.data()+startIndex;
2852 }
2853 else // same entry
2854 {
2855 sep = ", ";
2856 // link to class for other members with the same name
2857 }
2858 if (index<numIndices)
2859 {
2860 // write the link for the specific list type
2861 writeLinkForMemberMap[index](ol,md,sep,prevDefName);
2862 }
2863 }
2864 if (!page.empty())
2865 {
2866 break;
2867 }
2868 }
2869 if (!firstItem) ol.endItemListItem();
2870 ol.endItemList();
2871}
2872
2873//----------------------------------------------------------------------------
2874
2876{
2877 bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
2878 const ClassDef *cd=nullptr;
2879
2880 if (md->isLinkableInProject() &&
2881 (cd=md->getClassDef()) &&
2882 cd->isLinkableInProject() &&
2884 {
2885 QCString n = md->name();
2886 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
2887 if (!letter.empty())
2888 {
2889 letter = convertUTF8ToLower(letter);
2890 bool isFriendToHide = hideFriendCompounds &&
2891 (md->typeString()=="friend class" ||
2892 md->typeString()=="friend struct" ||
2893 md->typeString()=="friend union");
2894 if (!(md->isFriend() && isFriendToHide) &&
2895 (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2896 )
2897 {
2899 }
2900 if (md->isFunction() || md->isSlot() || md->isSignal())
2901 {
2903 }
2904 else if (md->isVariable())
2905 {
2907 }
2908 else if (md->isTypedef())
2909 {
2911 }
2912 else if (md->isEnumerate())
2913 {
2915 }
2916 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2917 {
2919 }
2920 else if (md->isProperty())
2921 {
2923 }
2924 else if (md->isEvent())
2925 {
2927 }
2928 else if (md->isRelated() || md->isForeign() ||
2929 (md->isFriend() && !isFriendToHide))
2930 {
2932 }
2933 }
2934 }
2935}
2936
2937//----------------------------------------------------------------------------
2938
2940{
2941 const NamespaceDef *nd=md->getNamespaceDef();
2942 if (nd && nd->isLinkableInProject() && md->isLinkableInProject())
2943 {
2944 QCString n = md->name();
2945 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
2946 if (!letter.empty())
2947 {
2948 letter = convertUTF8ToLower(letter);
2949 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2950 {
2952 }
2953 if (md->isFunction())
2954 {
2956 }
2957 else if (md->isVariable())
2958 {
2960 }
2961 else if (md->isTypedef())
2962 {
2964 }
2965 else if (md->isSequence())
2966 {
2968 }
2969 else if (md->isDictionary())
2970 {
2972 }
2973 else if (md->isEnumerate())
2974 {
2976 }
2977 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2978 {
2980 }
2981 }
2982 }
2983}
2984
2985//----------------------------------------------------------------------------
2986
2988{
2989 const FileDef *fd=md->getFileDef();
2990 if (fd && fd->isLinkableInProject() && md->isLinkableInProject())
2991 {
2992 QCString n = md->name();
2993 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
2994 if (!letter.empty())
2995 {
2996 letter = convertUTF8ToLower(letter);
2997 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2998 {
3000 }
3001 if (md->isFunction())
3002 {
3004 }
3005 else if (md->isVariable())
3006 {
3008 }
3009 else if (md->isTypedef())
3010 {
3012 }
3013 else if (md->isSequence())
3014 {
3016 }
3017 else if (md->isDictionary())
3018 {
3020 }
3021 else if (md->isEnumerate())
3022 {
3024 }
3025 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
3026 {
3028 }
3029 else if (md->isDefine())
3030 {
3032 }
3033 }
3034 }
3035}
3036
3037//----------------------------------------------------------------------------
3038
3040{
3041 const ModuleDef *mod = md->getModuleDef();
3042 if (mod && mod->isPrimaryInterface() && mod->isLinkableInProject() && md->isLinkableInProject())
3043 {
3044 QCString n = md->name();
3045 std::string letter = getUTF8CharAt(n.str(),getPrefixIndex(n));
3046 if (!letter.empty())
3047 {
3048 letter = convertUTF8ToLower(letter);
3049 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
3050 {
3052 }
3053 if (md->isFunction())
3054 {
3056 }
3057 else if (md->isVariable())
3058 {
3060 }
3061 else if (md->isTypedef())
3062 {
3064 }
3065 else if (md->isEnumerate())
3066 {
3068 }
3069 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
3070 {
3072 }
3073 }
3074 }
3075}
3076
3077//----------------------------------------------------------------------------
3078
3080 const Index::MemberIndexMap &map,const std::string &page,
3081 QCString fullName,bool multiPage)
3082{
3083 bool first=TRUE;
3085 for (const auto &[letter,list] : map)
3086 {
3087 QCString ci(letter);
3088 QCString is = letterToLabel(ci);
3089 QCString anchor;
3091 if (!multiPage)
3092 anchor="#index_";
3093 else if (first)
3094 anchor=fullName+extension+"#index_";
3095 else
3096 anchor=fullName+"_"+is+extension+"#index_";
3097 startQuickIndexItem(ol,anchor+convertToId(is),letter==page,TRUE,first);
3098 ol.writeString(ci);
3100 first=FALSE;
3101 }
3103 ol.writeString(R"js(
3104<script type="text/javascript">
3105function updateNavHighlight() {
3106 var currentHash = window.location.hash;
3107 var navItems = document.querySelectorAll('#navrow4 .tablist li');
3108
3109 for (var i = 0; i < navItems.length; i++) {
3110 var item = navItems[i];
3111 var link = item.querySelector('a');
3112 item.classList.remove('current');
3113 if (link && link.getAttribute('href') === currentHash) {
3114 item.classList.add('current');
3115 }
3116 }
3117
3118 if (currentHash) {
3119 var target = document.querySelector(currentHash);
3120 if (target) {
3121 target.scrollIntoView();
3122 }
3123 }
3124}
3125updateNavHighlight();
3126window.addEventListener('hashchange', updateNavHighlight);
3127</script>
3128 )js");
3129}
3130
3131static void writeMemberIndex(OutputList &ol,
3132 const Index::MemberIndexMap &map, QCString fullName,bool multiPage)
3133{
3134 bool first=true;
3135 ol.writeString("<br/>\n");
3136 QCString alphaLinks = "<div class=\"qindex\">";
3137 StringMap usedLetters;
3138 for (const auto &[letter,list] : map)
3139 {
3140 usedLetters.emplace(convertUTF8ToUpper(letter),letter);
3141 }
3142 for (const auto &[letterUC,letter] : usedLetters)
3143 {
3144 QCString ci(letter);
3145 QCString is = letterToLabel(ci);
3146 QCString anchor;
3148 if (!multiPage)
3149 anchor="#index_";
3150 else if (first)
3151 anchor=fullName+extension+"#index_";
3152 else
3153 anchor=fullName+"_"+is+extension+"#index_";
3154
3155 if (!first) alphaLinks += alphaSepar;
3156 first=false;
3157 QCString li = letterToLabel(letter);
3158 alphaLinks += "<a class=\"qindex\" href=\"" + anchor +
3159 li + "\">" +
3160 letterUC + "</a>";
3161 }
3162 alphaLinks += "</div>\n";
3163 ol.writeString(alphaLinks);
3164}
3165
3166//----------------------------------------------------------------------------
3167
3168/** Helper class representing a class member in the navigation menu. */
3169struct CmhlInfo
3170{
3171 CmhlInfo(const char *fn,const QCString &t) : fname(fn), title(t) {}
3172 const char *fname;
3174};
3175
3176static const CmhlInfo *getCmhlInfo(size_t hl)
3177{
3178 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3179 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3180 static CmhlInfo cmhlInfo[] =
3181 {
3182 CmhlInfo("functions", theTranslator->trAll()),
3183 CmhlInfo("functions_func",
3184 fortranOpt ? theTranslator->trSubprograms() :
3185 vhdlOpt ? theTranslator->trFunctionAndProc() :
3186 theTranslator->trFunctions()),
3187 CmhlInfo("functions_vars",theTranslator->trVariables()),
3188 CmhlInfo("functions_type",theTranslator->trTypedefs()),
3189 CmhlInfo("functions_enum",theTranslator->trEnumerations()),
3190 CmhlInfo("functions_eval",theTranslator->trEnumerationValues()),
3191 CmhlInfo("functions_prop",theTranslator->trProperties()),
3192 CmhlInfo("functions_evnt",theTranslator->trEvents()),
3193 CmhlInfo("functions_rela",theTranslator->trRelatedSymbols())
3194 };
3195 return &cmhlInfo[hl];
3196}
3197
3199{
3200 const auto &index = Index::instance();
3201 if (index.numDocumentedClassMembers(hl)==0) return;
3202
3203 bool disableIndex = Config_getBool(DISABLE_INDEX);
3204 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3205 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3206 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3207 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3208
3209 bool multiPageIndex=FALSE;
3210 if (index.numDocumentedClassMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3211 {
3212 multiPageIndex=TRUE;
3213 }
3214
3215 ol.pushGeneratorState();
3217
3219 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
3220 QCString title = lne ? lne->title() : theTranslator->trCompoundMembers();
3221 if (hl!=ClassMemberHighlight::All) title+=QCString(" - ")+getCmhlInfo(hl)->title;
3222 bool addToIndex = lne==nullptr || lne->visible();
3223
3224 if (addToIndex)
3225 {
3226 Doxygen::indexList->addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,QCString(),
3227 getCmhlInfo(hl)->fname,QCString(),multiPageIndex,TRUE);
3228 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3229 }
3230
3231 bool first=TRUE;
3232 for (const auto &[letter,list] : index.isClassIndexLetterUsed(hl))
3233 {
3234 QCString fileName = getCmhlInfo(hl)->fname;
3235 if (multiPageIndex)
3236 {
3237 QCString cs(letter);
3238 if (!first)
3239 {
3240 fileName+="_"+letterToLabel(cs);
3241 }
3242 if (addToIndex)
3243 {
3244 Doxygen::indexList->addContentsItem(FALSE,cs,QCString(),fileName,QCString(),FALSE,TRUE);
3245 }
3246 }
3247
3248 bool quickIndex = index.numDocumentedClassMembers(hl)>maxItemsBeforeQuickIndex;
3249
3250 auto writeQuickLinks = [&,cap_letter=letter]()
3251 {
3253 if (!dynamicMenus)
3254 {
3256
3257 // index item for global member list
3260 ol.writeString(fixSpaces(getCmhlInfo(0)->title));
3262
3263 // index items per category member lists
3264 for (int i=1;i<ClassMemberHighlight::Total;i++)
3265 {
3266 if (index.numDocumentedClassMembers(static_cast<ClassMemberHighlight::Enum>(i))>0)
3267 {
3269 ol.writeString(fixSpaces(getCmhlInfo(i)->title));
3270 //printf("multiPageIndex=%d first=%d fileName=%s file=%s title=%s\n",
3271 // multiPageIndex,first,qPrint(fileName),getCmhlInfo(i)->fname,qPrint(getCmhlInfo(i)->title));
3273 }
3274 }
3275
3277
3278 // quick alphabetical index
3279 if (quickIndex)
3280 {
3281 writeQuickMemberIndex(ol,index.isClassIndexLetterUsed(hl),cap_letter,
3282 getCmhlInfo(hl)->fname,multiPageIndex);
3283 }
3284
3285 ol.writeString("</div><!-- main-nav -->\n");
3286 }
3287 };
3288
3289 ol.startFile(fileName+extension,false,QCString(),title);
3290 ol.startQuickIndices();
3291 if (!disableIndex && !quickLinksAfterSplitbar)
3292 {
3293 writeQuickLinks();
3294 }
3295 ol.endQuickIndices();
3296 ol.writeSplitBar(fileName,QCString());
3297 if (quickLinksAfterSplitbar)
3298 {
3299 writeQuickLinks();
3300 if (!dynamicMenus)
3301 {
3302 ol.writeString("<div id=\"container\">\n");
3303 ol.writeString("<div id=\"doc-content\">\n");
3304 }
3305 }
3307
3308 ol.startContents();
3309
3310 ol.startTextBlock();
3311 ol.parseText(hl == ClassMemberHighlight::All && lne ? lne->intro() : theTranslator->trCompoundMembersDescriptionTotal(hl));
3312 ol.endTextBlock();
3313 if (dynamicMenus || disableIndex)
3314 {
3315 writeMemberIndex(ol,index.isClassIndexLetterUsed(hl),getCmhlInfo(hl)->fname,multiPageIndex);
3316 }
3317
3318 writeMemberList(ol,quickIndex,
3319 multiPageIndex ? letter : std::string(),
3320 index.isClassIndexLetterUsed(hl),
3322 endFile(ol);
3323 first=FALSE;
3324 }
3325
3326 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3327
3328 ol.popGeneratorState();
3329}
3330
3331static void writeClassMemberIndex(OutputList &ol)
3332{
3333 const auto &index = Index::instance();
3334 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
3335 bool addToIndex = lne==nullptr || lne->visible();
3337 if (index.numDocumentedClassMembers(ClassMemberHighlight::All)>0 && addToIndex)
3339 Doxygen::indexList->addContentsItem(TRUE,lne ? lne->title() : theTranslator->trCompoundMembers(),QCString(),"functions",QCString());
3340 Doxygen::indexList->incContentsDepth();
3341 }
3351 if (index.numDocumentedClassMembers(ClassMemberHighlight::All)>0 && addToIndex)
3352 {
3353 Doxygen::indexList->decContentsDepth();
3354 }
3355
3356}
3357
3358//----------------------------------------------------------------------------
3359
3360/** Helper class representing a file member in the navigation menu. */
3361struct FmhlInfo
3362{
3363 FmhlInfo(const char *fn,const QCString &t) : fname(fn), title(t) {}
3364 const char *fname;
3365 QCString title;
3367
3368static const FmhlInfo *getFmhlInfo(size_t hl)
3369{
3370 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3371 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3372 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3373 static FmhlInfo fmhlInfo[] =
3374 {
3375 FmhlInfo("globals", theTranslator->trAll()),
3376 FmhlInfo("globals_func",
3377 fortranOpt ? theTranslator->trSubprograms() :
3378 vhdlOpt ? theTranslator->trFunctionAndProc() :
3379 theTranslator->trFunctions()),
3380 FmhlInfo("globals_vars",sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables()),
3381 FmhlInfo("globals_type",theTranslator->trTypedefs()),
3382 FmhlInfo("globals_sequ",theTranslator->trSequences()),
3383 FmhlInfo("globals_dict",theTranslator->trDictionaries()),
3384 FmhlInfo("globals_enum",theTranslator->trEnumerations()),
3385 FmhlInfo("globals_eval",theTranslator->trEnumerationValues()),
3386 FmhlInfo("globals_defs",theTranslator->trDefines())
3387 };
3388 return &fmhlInfo[hl];
3389}
3390
3392{
3393 const auto &index = Index::instance();
3394 if (index.numDocumentedFileMembers(hl)==0) return;
3395
3396 bool disableIndex = Config_getBool(DISABLE_INDEX);
3397 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3398 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3399 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3400 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3401
3402 bool multiPageIndex=FALSE;
3403 if (Index::instance().numDocumentedFileMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3404 {
3405 multiPageIndex=TRUE;
3406 }
3407
3408 ol.pushGeneratorState();
3410
3412 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
3413 QCString title = lne ? lne->title() : theTranslator->trFileMembers();
3414 bool addToIndex = lne==nullptr || lne->visible();
3415
3416 if (addToIndex)
3417 {
3418 Doxygen::indexList->addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,QCString(),
3419 getFmhlInfo(hl)->fname,QCString(),multiPageIndex,TRUE);
3420 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3421 }
3422
3423 bool first=TRUE;
3424 for (const auto &[letter,list] : index.isFileIndexLetterUsed(hl))
3425 {
3426 QCString fileName = getFmhlInfo(hl)->fname;
3427 if (multiPageIndex)
3428 {
3429 QCString cs(letter);
3430 if (!first)
3431 {
3432 fileName+="_"+letterToLabel(cs);
3433 }
3434 if (addToIndex)
3435 {
3436 Doxygen::indexList->addContentsItem(FALSE,cs,QCString(),fileName,QCString(),FALSE,TRUE);
3437 }
3438 }
3439
3440 bool quickIndex = index.numDocumentedFileMembers(hl)>maxItemsBeforeQuickIndex;
3441
3442 auto writeQuickLinks = [&,cap_letter=letter]()
3443 {
3445 if (!dynamicMenus)
3446 {
3448
3449 // index item for all file member lists
3452 ol.writeString(fixSpaces(getFmhlInfo(0)->title));
3454
3455 // index items for per category member lists
3456 for (int i=1;i<FileMemberHighlight::Total;i++)
3457 {
3458 if (Index::instance().numDocumentedFileMembers(static_cast<FileMemberHighlight::Enum>(i))>0)
3459 {
3461 getFmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
3462 ol.writeString(fixSpaces(getFmhlInfo(i)->title));
3464 }
3465 }
3466
3468
3469 if (quickIndex)
3470 {
3471 writeQuickMemberIndex(ol,index.isFileIndexLetterUsed(hl),cap_letter,
3472 getFmhlInfo(hl)->fname,multiPageIndex);
3473 }
3474
3475 ol.writeString("</div><!-- main-nav -->\n");
3476 }
3477 };
3478
3479 ol.startFile(fileName+extension,false,QCString(),title);
3480 ol.startQuickIndices();
3481 if (!disableIndex && !quickLinksAfterSplitbar)
3482 {
3483 writeQuickLinks();
3484 }
3485 ol.endQuickIndices();
3486 ol.writeSplitBar(fileName,QCString());
3487 if (quickLinksAfterSplitbar)
3488 {
3489 writeQuickLinks();
3490 if (!dynamicMenus)
3491 {
3492 ol.writeString("<div id=\"container\">\n");
3493 ol.writeString("<div id=\"doc-content\">\n");
3495 }
3496 ol.writeSearchInfo();
3497
3498 ol.startContents();
3499
3500 ol.startTextBlock();
3501 ol.parseText(hl == FileMemberHighlight::All && lne ? lne->intro() : theTranslator->trFileMembersDescriptionTotal(hl));
3502 ol.endTextBlock();
3503 if (dynamicMenus || disableIndex)
3504 {
3505 writeMemberIndex(ol,index.isFileIndexLetterUsed(hl),getFmhlInfo(hl)->fname,multiPageIndex);
3506 }
3507
3508 writeMemberList(ol,quickIndex,
3509 multiPageIndex ? letter : std::string(),
3510 index.isFileIndexLetterUsed(hl),
3512 endFile(ol);
3513 first=FALSE;
3514 }
3515 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3516 ol.popGeneratorState();
3517}
3518
3519static void writeFileMemberIndex(OutputList &ol)
3520{
3521 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
3522 bool addToIndex = lne==nullptr || lne->visible();
3523 if (Index::instance().numDocumentedFileMembers(FileMemberHighlight::All)>0 && addToIndex)
3525 Doxygen::indexList->addContentsItem(true,lne ? lne->title() : theTranslator->trFileMembers(),QCString(),"globals",QCString());
3526 Doxygen::indexList->incContentsDepth();
3527 }
3537 if (Index::instance().numDocumentedFileMembers(FileMemberHighlight::All)>0 && addToIndex)
3538 {
3539 Doxygen::indexList->decContentsDepth();
3540 }
3541
3542}
3543
3544//----------------------------------------------------------------------------
3545
3546/** Helper class representing a namespace member in the navigation menu. */
3547struct NmhlInfo
3548{
3549 NmhlInfo(const char *fn,const QCString &t) : fname(fn), title(t) {}
3550 const char *fname;
3551 QCString title;
3552};
3554static const NmhlInfo *getNmhlInfo(size_t hl)
3555{
3556 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3557 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3558 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3559 static NmhlInfo nmhlInfo[] =
3560 {
3561 NmhlInfo("namespacemembers", theTranslator->trAll()),
3562 NmhlInfo("namespacemembers_func",
3563 fortranOpt ? theTranslator->trSubprograms() :
3564 vhdlOpt ? theTranslator->trFunctionAndProc() :
3565 theTranslator->trFunctions()),
3566 NmhlInfo("namespacemembers_vars",sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables()),
3567 NmhlInfo("namespacemembers_type",theTranslator->trTypedefs()),
3568 NmhlInfo("namespacemembers_sequ",theTranslator->trSequences()),
3569 NmhlInfo("namespacemembers_dict",theTranslator->trDictionaries()),
3570 NmhlInfo("namespacemembers_enum",theTranslator->trEnumerations()),
3571 NmhlInfo("namespacemembers_eval",theTranslator->trEnumerationValues())
3572 };
3573 return &nmhlInfo[hl];
3574}
3575
3576//----------------------------------------------------------------------------
3577
3580{
3581 const auto &index = Index::instance();
3582 if (index.numDocumentedNamespaceMembers(hl)==0) return;
3583
3584 bool disableIndex = Config_getBool(DISABLE_INDEX);
3585 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3586 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3587 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3588 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3589
3590 bool multiPageIndex=FALSE;
3591 if (index.numDocumentedNamespaceMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3592 {
3593 multiPageIndex=TRUE;
3594 }
3595
3596 ol.pushGeneratorState();
3598
3600 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
3601 QCString title = lne ? lne->title() : theTranslator->trNamespaceMembers();
3602 bool addToIndex = lne==nullptr || lne->visible();
3603
3604 if (addToIndex)
3605 {
3606 Doxygen::indexList->addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,QCString(),
3607 getNmhlInfo(hl)->fname,QCString(),multiPageIndex,TRUE);
3608 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3609 }
3610
3611 bool first=TRUE;
3612 for (const auto &[letter,list] : index.isNamespaceIndexLetterUsed(hl))
3613 {
3614 QCString fileName = getNmhlInfo(hl)->fname;
3615 if (multiPageIndex)
3616 {
3617 QCString cs(letter);
3618 if (!first)
3619 {
3620 fileName+="_"+letterToLabel(cs);
3621 }
3622 if (addToIndex)
3623 {
3624 Doxygen::indexList->addContentsItem(FALSE,cs,QCString(),fileName,QCString(),FALSE,TRUE);
3625 }
3626 }
3627
3628 bool quickIndex = index.numDocumentedNamespaceMembers(hl)>maxItemsBeforeQuickIndex;
3629
3630 auto writeQuickLinks = [&,cap_letter=letter]()
3631 {
3633 if (!dynamicMenus)
3634 {
3636
3637 // index item for all namespace member lists
3640 ol.writeString(fixSpaces(getNmhlInfo(0)->title));
3642
3643 // index items per category member lists
3644 for (int i=1;i<NamespaceMemberHighlight::Total;i++)
3645 {
3646 if (index.numDocumentedNamespaceMembers(static_cast<NamespaceMemberHighlight::Enum>(i))>0)
3647 {
3649 getNmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
3650 ol.writeString(fixSpaces(getNmhlInfo(i)->title));
3652 }
3653 }
3654
3656
3657 if (quickIndex)
3658 {
3659 writeQuickMemberIndex(ol,index.isNamespaceIndexLetterUsed(hl),cap_letter,
3660 getNmhlInfo(hl)->fname,multiPageIndex);
3661 }
3662
3663 ol.writeString("</div><!-- main-nav -->\n");
3664 }
3665 };
3666
3667 ol.startFile(fileName+extension,false,QCString(),title);
3668 ol.startQuickIndices();
3669 if (!disableIndex && !quickLinksAfterSplitbar)
3670 {
3671 writeQuickLinks();
3672 }
3673 ol.endQuickIndices();
3674 ol.writeSplitBar(fileName,QCString());
3675 if (quickLinksAfterSplitbar)
3676 {
3677 writeQuickLinks();
3678 if (!dynamicMenus)
3679 {
3680 ol.writeString("<div id=\"container\">\n");
3681 ol.writeString("<div id=\"doc-content\">\n");
3682 }
3683 }
3684 ol.writeSearchInfo();
3685
3686 ol.startContents();
3687
3688 ol.startTextBlock();
3689 ol.parseText(hl == NamespaceMemberHighlight::All && lne ? lne->intro() : theTranslator->trNamespaceMembersDescriptionTotal(hl));
3690 ol.endTextBlock();
3691
3692 writeMemberList(ol,quickIndex,
3693 multiPageIndex ? letter : std::string(),
3694 index.isNamespaceIndexLetterUsed(hl),
3696 endFile(ol);
3697 first=FALSE;
3698 }
3699 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3700 ol.popGeneratorState();
3701}
3702
3704{
3705 const auto &index = Index::instance();
3706 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
3707 bool addToIndex = lne==nullptr || lne->visible();
3708 if (index.numDocumentedNamespaceMembers(NamespaceMemberHighlight::All)>0 && addToIndex)
3710 Doxygen::indexList->addContentsItem(true,lne ? lne->title() : theTranslator->trNamespaceMembers(),QCString(),"namespacemembers",QCString());
3711 Doxygen::indexList->incContentsDepth();
3712 }
3713 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3727}
3728
3729//----------------------------------------------------------------------------
3731/** Helper class representing a module member in the navigation menu. */
3732struct MmhlInfo
3733{
3734 MmhlInfo(const char *fn,const QCString &t) : fname(fn), title(t) {}
3735 const char *fname;
3737};
3738
3739static const MmhlInfo *getMmhlInfo(size_t hl)
3740{
3741 static MmhlInfo nmhlInfo[] =
3742 {
3743 MmhlInfo("modulemembers", theTranslator->trAll()),
3744 MmhlInfo("modulemembers_func",theTranslator->trFunctions()),
3745 MmhlInfo("modulemembers_vars",theTranslator->trVariables()),
3746 MmhlInfo("modulemembers_type",theTranslator->trTypedefs()),
3747 MmhlInfo("modulemembers_enum",theTranslator->trEnumerations()),
3748 MmhlInfo("modulemembers_eval",theTranslator->trEnumerationValues())
3749 };
3750 return &nmhlInfo[hl];
3751}
3752
3753//----------------------------------------------------------------------------
3754
3757{
3758 const auto &index = Index::instance();
3759 if (index.numDocumentedModuleMembers(hl)==0) return;
3760
3761 bool disableIndex = Config_getBool(DISABLE_INDEX);
3762 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3763 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3764 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3765 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
3766
3767 bool multiPageIndex=FALSE;
3768 if (index.numDocumentedModuleMembers(hl)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3769 {
3770 multiPageIndex=TRUE;
3771 }
3772
3773 ol.pushGeneratorState();
3775
3777 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ModuleMembers);
3778 QCString title = lne ? lne->title() : theTranslator->trModulesMembers();
3779 bool addToIndex = lne==nullptr || lne->visible();
3780
3781 if (addToIndex)
3782 {
3783 Doxygen::indexList->addContentsItem(multiPageIndex,getMmhlInfo(hl)->title,QCString(),
3784 getMmhlInfo(hl)->fname,QCString(),multiPageIndex,TRUE);
3785 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3786 }
3787
3788 bool first=TRUE;
3789 for (const auto &[letter,list] : index.isModuleIndexLetterUsed(hl))
3790 {
3791 QCString fileName = getMmhlInfo(hl)->fname;
3792 if (multiPageIndex)
3793 {
3794 QCString cs(letter);
3795 if (!first)
3796 {
3797 fileName+="_"+letterToLabel(cs);
3798 }
3799 if (addToIndex)
3800 {
3801 Doxygen::indexList->addContentsItem(FALSE,cs,QCString(),fileName,QCString(),FALSE,TRUE);
3802 }
3803 }
3804
3805 bool quickIndex = index.numDocumentedModuleMembers(hl)>maxItemsBeforeQuickIndex;
3806
3807 auto writeQuickLinks = [&,cap_letter=letter]()
3808 {
3810 if (!dynamicMenus)
3811 {
3813
3814 // index item for all namespace member lists
3817 ol.writeString(fixSpaces(getMmhlInfo(0)->title));
3819
3820 // index items per category member lists
3821 for (int i=1;i<ModuleMemberHighlight::Total;i++)
3822 {
3823 if (index.numDocumentedModuleMembers(static_cast<ModuleMemberHighlight::Enum>(i))>0)
3824 {
3826 getMmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
3827 ol.writeString(fixSpaces(getMmhlInfo(i)->title));
3829 }
3830 }
3831
3833
3834 if (quickIndex)
3835 {
3836 writeQuickMemberIndex(ol,index.isModuleIndexLetterUsed(hl),cap_letter,
3837 getMmhlInfo(hl)->fname,multiPageIndex);
3838 }
3839
3840 ol.writeString("</div><!-- main-nav -->\n");
3841 }
3842 };
3843
3844 ol.startFile(fileName+extension,false,QCString(),title);
3845 ol.startQuickIndices();
3846 if (!disableIndex && !quickLinksAfterSplitbar)
3847 {
3848 writeQuickLinks();
3849 }
3850 ol.endQuickIndices();
3851 ol.writeSplitBar(fileName,QCString());
3852 if (quickLinksAfterSplitbar)
3853 {
3854 writeQuickLinks();
3855 if (!dynamicMenus)
3856 {
3857 ol.writeString("<div id=\"container\">\n");
3858 ol.writeString("<div id=\"doc-content\">\n");
3859 }
3860 }
3861 ol.writeSearchInfo();
3863 ol.startContents();
3864
3865 ol.startTextBlock();
3866 ol.parseText(hl == ModuleMemberHighlight::All && lne ? lne->intro() : theTranslator->trModuleMembersDescriptionTotal(hl));
3867 ol.endTextBlock();
3868 if (dynamicMenus || disableIndex)
3869 {
3870 writeMemberIndex(ol,index.isModuleIndexLetterUsed(hl),getMmhlInfo(hl)->fname,multiPageIndex);
3871 }
3872
3873 writeMemberList(ol,quickIndex,
3874 multiPageIndex ? letter : std::string(),
3875 index.isModuleIndexLetterUsed(hl),
3877 endFile(ol);
3878 first=FALSE;
3879 }
3880 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3881 ol.popGeneratorState();
3882}
3883
3884
3885//----------------------------------------------------------------------------
3886
3888{
3889 const auto &index = Index::instance();
3890 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ModuleMembers);
3891 bool addToIndex = lne==nullptr || lne->visible();
3892 if (index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0 && addToIndex)
3893 {
3894 Doxygen::indexList->addContentsItem(true,lne ? lne->title() : theTranslator->trModulesMembers(),QCString(),"modulemembers",QCString());
3895 Doxygen::indexList->incContentsDepth();
3896 }
3897 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3904 if (index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0 && addToIndex)
3905 {
3906 Doxygen::indexList->decContentsDepth();
3907 }
3908}
3909
3910//----------------------------------------------------------------------------
3911
3912static void writeExampleIndex(OutputList &ol)
3913{
3914 if (Doxygen::exampleLinkedMap->empty()) return;
3915 ol.pushGeneratorState();
3918 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Examples);
3919 QCString title = lne ? lne->title() : theTranslator->trExamples();
3920 bool addToIndex = lne==nullptr || lne->visible();
3921
3922 startFile(ol,"examples",false,QCString(),title,HighlightedItem::Examples);
3923
3924 startTitle(ol,QCString());
3925 ol.parseText(title);
3926 endTitle(ol,QCString(),QCString());
3927
3928 ol.startContents();
3929
3930 if (addToIndex)
3931 {
3932 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"examples",QCString(),TRUE,TRUE);
3933 Doxygen::indexList->incContentsDepth();
3934 }
3935
3936 ol.startTextBlock();
3937 ol.parseText(lne ? lne->intro() : theTranslator->trExamplesDescription());
3938 ol.endTextBlock();
3939
3940 ol.startItemList();
3941 for (const auto &pd : *Doxygen::exampleLinkedMap)
3942 {
3943 ol.startItemListItem();
3944 QCString n=pd->getOutputFileBase();
3945 if (!pd->title().isEmpty())
3946 {
3947 ol.writeObjectLink(QCString(),n,QCString(),pd->title());
3948 if (addToIndex)
3949 {
3950 Doxygen::indexList->addContentsItem(FALSE,filterTitle(pd->title()),pd->getReference(),n,QCString(),FALSE,TRUE);
3951 }
3953 else
3954 {
3955 ol.writeObjectLink(QCString(),n,QCString(),pd->name());
3956 if (addToIndex)
3957 {
3958 Doxygen::indexList->addContentsItem(FALSE,pd->name(),pd->getReference(),n,QCString(),FALSE,TRUE);
3959 }
3960 }
3961 ol.endItemListItem();
3962 //ol.writeString("\n");
3963 }
3964 ol.endItemList();
3965
3966 if (addToIndex)
3967 {
3968 Doxygen::indexList->decContentsDepth();
3969 }
3971 ol.popGeneratorState();
3972}
3973
3974
3975//----------------------------------------------------------------------------
3976
3977static void countRelatedPages(int &docPages,int &indexPages)
3978{
3979 docPages=indexPages=0;
3980 for (const auto &pd : *Doxygen::pageLinkedMap)
3982 if (pd->visibleInIndex() && !pd->hasParentPage())
3983 {
3984 indexPages++;
3985 }
3986 if (pd->documentedPage())
3987 {
3988 docPages++;
3989 }
3990 }
3991}
3992
3993//----------------------------------------------------------------------------
3994
3995static bool mainPageHasOwnTitle()
3996{
3997 QCString projectName = Config_getString(PROJECT_NAME);
3998 QCString title;
4000 {
4001 title = filterTitle(Doxygen::mainPage->title());
4002 }
4003 return !projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0;
4004}
4005
4006static void writePages(PageDef *pd,FTVHelp *ftv)
4007{
4008 //printf("writePages()=%s pd=%p mainpage=%p\n",qPrint(pd->name()),(void*)pd,(void*)Doxygen::mainPage.get());
4009 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
4010 bool addToIndex = lne==nullptr || lne->visible();
4011 if (!addToIndex) return;
4012
4013 bool hasSubPages = pd->hasSubPages();
4014 bool hasSections = pd->hasSections();
4015
4016 if (pd->visibleInIndex())
4017 {
4018 QCString pageTitle, pageTitleAsHtml;
4019
4020 if (pd->title().isEmpty())
4021 pageTitle=pd->name();
4022 else
4023 pageTitle = parseCommentAsText(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4024 pageTitleAsHtml = parseCommentAsHtml(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4025
4026 if (ftv)
4027 {
4028 //printf("*** adding %s hasSubPages=%d hasSections=%d\n",qPrint(pageTitle),hasSubPages,hasSections);
4029 ftv->addContentsItem(
4030 hasSubPages,pageTitle,
4031 pd->getReference(),pd->getOutputFileBase(),
4032 QCString(),hasSubPages,TRUE,pd,pageTitleAsHtml);
4033 }
4034 if (addToIndex && pd!=Doxygen::mainPage.get())
4035 {
4036 Doxygen::indexList->addContentsItem(
4037 hasSubPages || hasSections,pageTitle,
4038 pd->getReference(),pd->getOutputFileBase(),
4039 QCString(),hasSubPages,TRUE,pd,pageTitleAsHtml);
4040 }
4041 }
4042 if (hasSubPages && ftv) ftv->incContentsDepth();
4043 bool doIndent = (hasSections || hasSubPages) &&
4044 (pd!=Doxygen::mainPage.get() || mainPageHasOwnTitle());
4045 if (doIndent)
4046 {
4047 Doxygen::indexList->incContentsDepth();
4048 }
4049 if (hasSections)
4050 {
4051 pd->addSectionsToIndex();
4052 }
4053 for (const auto &subPage : pd->getSubPages())
4054 {
4055 writePages(subPage,ftv);
4056 }
4057 if (hasSubPages && ftv) ftv->decContentsDepth();
4058 if (doIndent)
4059 {
4060 Doxygen::indexList->decContentsDepth();
4061 }
4062 //printf("end writePages()=%s\n",qPrint(pd->title()));
4063}
4064
4065//----------------------------------------------------------------------------
4066
4067static void writePageIndex(OutputList &ol)
4068{
4069 if (Index::instance().numIndexedPages()==0) return;
4070 ol.pushGeneratorState();
4072 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
4073 QCString title = lne ? lne->title() : theTranslator->trRelatedPages();
4074 startFile(ol,"pages",false,QCString(),title,HighlightedItem::Pages);
4075 startTitle(ol,QCString());
4076 ol.parseText(title);
4077 endTitle(ol,QCString(),QCString());
4078 ol.startContents();
4079 ol.startTextBlock();
4080 ol.parseText(lne ? lne->intro() : theTranslator->trRelatedPagesDescription());
4081 ol.endTextBlock();
4082
4083 {
4084 FTVHelp ftv(false);
4085 for (const auto &pd : *Doxygen::pageLinkedMap)
4086 {
4087 if ((pd->getOuterScope()==nullptr ||
4088 pd->getOuterScope()->definitionType()!=Definition::TypePage) && // not a sub page
4089 pd->visibleInIndex()
4090 )
4091 {
4092 writePages(pd.get(),&ftv);
4093 }
4094 }
4095 TextStream t;
4097 ol.writeString(t.str());
4098 }
4099
4100// ol.popGeneratorState();
4101 // ------
4102
4103 endFile(ol);
4104 ol.popGeneratorState();
4105}
4106
4107//----------------------------------------------------------------------------
4108
4109static int countGroups()
4110{
4111 int count=0;
4112 for (const auto &gd : *Doxygen::groupLinkedMap)
4113 {
4114 if (!gd->isReference())
4115 {
4116 //gd->visited=FALSE;
4117 count++;
4118 }
4119 }
4120 return count;
4121}
4122
4123//----------------------------------------------------------------------------
4124
4125static int countDirs()
4126{
4127 int count=0;
4128 for (const auto &dd : *Doxygen::dirLinkedMap)
4129 {
4130 if (dd->isLinkableInProject())
4131 {
4132 count++;
4133 }
4134 }
4135 return count;
4136}
4137
4138
4139//----------------------------------------------------------------------------
4140
4141void writeGraphInfo(OutputList &ol)
4142{
4143 if (!Config_getBool(HAVE_DOT) || !Config_getBool(GENERATE_HTML)) return;
4144 ol.pushGeneratorState();
4146
4147 DotLegendGraph gd;
4148 gd.writeGraph(Config_getString(HTML_OUTPUT));
4149
4150 bool oldStripCommentsState = Config_getBool(STRIP_CODE_COMMENTS);
4151 bool oldCreateSubdirs = Config_getBool(CREATE_SUBDIRS);
4152 // temporarily disable the stripping of comments for our own code example!
4153 Config_updateBool(STRIP_CODE_COMMENTS,FALSE);
4154 // temporarily disable create subdirs for linking to our example
4155 Config_updateBool(CREATE_SUBDIRS,FALSE);
4156
4157 startFile(ol,"graph_legend",false,QCString(),theTranslator->trLegendTitle());
4158 startTitle(ol,QCString());
4159 ol.parseText(theTranslator->trLegendTitle());
4160 endTitle(ol,QCString(),QCString());
4161 ol.startContents();
4162 QCString legendDocs = theTranslator->trLegendDocs();
4163 int s = legendDocs.find("<center>");
4164 int e = legendDocs.find("</center>");
4165 QCString imgExt = getDotImageExtension();
4166 if (imgExt=="svg" && s!=-1 && e!=-1)
4167 {
4168 legendDocs = legendDocs.left(s+8) + "[!-- " + "SVG 0 --]" + legendDocs.mid(e);
4169 //printf("legendDocs=%s\n",qPrint(legendDocs));
4170 }
4171
4172 {
4173 auto fd = createFileDef("","graph_legend.dox");
4174 ol.generateDoc("graph_legend",1,fd.get(),nullptr,legendDocs,DocOptions());
4175 }
4176
4177 // restore config settings
4178 Config_updateBool(STRIP_CODE_COMMENTS,oldStripCommentsState);
4179 Config_updateBool(CREATE_SUBDIRS,oldCreateSubdirs);
4180
4181 endFile(ol);
4182 ol.popGeneratorState();
4183}
4184
4185
4186
4187//----------------------------------------------------------------------------
4188/*!
4189 * write groups as hierarchical trees
4190 */
4191static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FTVHelp* ftv, bool addToIndex)
4192{
4193 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
4194 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
4195 if (level>20)
4196 {
4197 warn(gd->getDefFileName(),gd->getDefLine(),
4198 "maximum nesting level exceeded for group {}: check for possible recursive group relation!",gd->name());
4199 return;
4200 }
4201
4202 /* Some groups should appear twice under different parent-groups.
4203 * That is why we should not check if it was visited
4204 */
4205 if ((!gd->isASubGroup() || level>0) && gd->isVisible() && gd->isVisibleInHierarchy())
4206 {
4207 //printf("gd->name()=%s #members=%d\n",qPrint(gd->name()),gd->countMembers());
4208 // write group info
4209 bool hasSubGroups = !gd->getSubGroups().empty();
4210 bool hasSubPages = !gd->getPages().empty();
4211 size_t numSubItems = 0;
4212 for (const auto &ml : gd->getMemberLists())
4213 {
4214 if (ml->listType().isDocumentation())
4215 {
4216 numSubItems += ml->size();
4217 }
4218 }
4219 numSubItems += gd->getNamespaces().size();
4220 numSubItems += gd->getClasses().size();
4221 numSubItems += gd->getFiles().size();
4222 numSubItems += gd->getConcepts().size();
4223 numSubItems += gd->getDirs().size();
4224 numSubItems += gd->getPages().size();
4225
4226 bool isDir = hasSubGroups || hasSubPages || numSubItems>0;
4227 QCString title = parseCommentAsText(gd,nullptr,gd->groupTitle(),gd->getDefFileName(),gd->getDefLine());
4228 QCString titleAsHtml = parseCommentAsHtml(gd,nullptr,gd->groupTitle(),gd->getDefFileName(),gd->getDefLine());
4229
4230 //printf("gd='%s': pageDict=%d\n",qPrint(gd->name()),gd->pageDict->count());
4231 if (addToIndex)
4232 {
4233 Doxygen::indexList->addContentsItem(isDir,title,
4235 isDir,TRUE,nullptr,titleAsHtml);
4236 Doxygen::indexList->incContentsDepth();
4237 }
4238 if (ftv)
4239 {
4240 ftv->addContentsItem(hasSubGroups,title,
4242 FALSE,FALSE,gd,titleAsHtml);
4243 ftv->incContentsDepth();
4244 }
4245
4246 ol.startIndexListItem();
4248 ol.generateDoc(gd->getDefFileName(),
4249 gd->getDefLine(),
4250 gd,
4251 nullptr,
4252 gd->groupTitle(),
4253 DocOptions()
4254 .setSingleLine(true)
4255 .setAutolinkSupport(false));
4257
4258 if (gd->isReference())
4259 {
4260 ol.startTypewriter();
4261 ol.docify(" [external]");
4262 ol.endTypewriter();
4263 }
4264
4265 for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
4266 {
4267 if (lde->kind()==LayoutDocEntry::MemberDef && addToIndex)
4268 {
4269 const LayoutDocEntryMemberDef *lmd = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get());
4270 if (lmd)
4271 {
4272 MemberList *ml = gd->getMemberList(lmd->type);
4273 if (ml)
4274 {
4275 for (const auto &md : *ml)
4276 {
4277 const MemberVector &enumList = md->enumFieldList();
4278 isDir = !enumList.empty() && md->isEnumerate();
4279 if (md->isVisible() && !md->isAnonymous())
4280 {
4281 Doxygen::indexList->addContentsItem(isDir,
4282 md->qualifiedName(),md->getReference(),
4283 md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
4284 }
4285 if (isDir)
4286 {
4287 Doxygen::indexList->incContentsDepth();
4288 for (const auto &emd : enumList)
4289 {
4290 if (emd->isVisible())
4291 {
4292 Doxygen::indexList->addContentsItem(FALSE,
4293 emd->qualifiedName(),emd->getReference(),emd->getOutputFileBase(),
4294 emd->anchor(),FALSE,addToIndex);
4295 }
4296 }
4297 Doxygen::indexList->decContentsDepth();
4298 }
4299 }
4300 }
4301 }
4302 }
4303 else if (lde->kind()==LayoutDocEntry::GroupClasses && addToIndex)
4304 {
4305 for (const auto &cd : gd->getClasses())
4306 {
4307 //bool nestedClassInSameGroup =
4308 // cd->getOuterScope() && cd->getOuterScope()->definitionType()==Definition::TypeClass &&
4309 // cd->getOuterScope()->partOfGroups().empty() && cd->getOuterScope()->partOfGroups()->contains(gd);
4310 //printf("===== GroupClasses: %s visible=%d nestedClassInSameGroup=%d\n",qPrint(cd->name()),cd->isVisible(),nestedClassInSameGroup);
4311 if (cd->isVisible() /*&& !nestedClassInSameGroup*/)
4312 {
4314 LayoutDocManager::Class,
4315 cd->displayName(),
4316 cd->anchor(),
4317 addToIndex,
4318 TRUE);
4319 }
4320 }
4321 }
4322 else if (lde->kind()==LayoutDocEntry::GroupNamespaces && addToIndex && Config_getBool(SHOW_NAMESPACES))
4323 {
4324 for (const auto &nd : gd->getNamespaces())
4325 {
4326 if (nd->isVisible())
4327 {
4328 Doxygen::indexList->addContentsItem(FALSE,
4329 nd->displayName(),nd->getReference(),
4330 nd->getOutputFileBase(),QCString(),FALSE,Config_getBool(SHOW_NAMESPACES));
4331 }
4332 }
4333 }
4334 else if (lde->kind()==LayoutDocEntry::GroupConcepts && addToIndex)
4335 {
4336 for (const auto &cd : gd->getConcepts())
4337 {
4338 if (cd->isVisible())
4339 {
4340 Doxygen::indexList->addContentsItem(FALSE,
4341 cd->displayName(),cd->getReference(),
4342 cd->getOutputFileBase(),QCString(),FALSE,addToIndex);
4343 }
4344 }
4345 }
4346 else if (lde->kind()==LayoutDocEntry::GroupFiles && addToIndex)
4347 {
4348 for (const auto &fd : gd->getFiles())
4349 {
4350 if (fd->isVisible())
4351 {
4352 Doxygen::indexList->addContentsItem(FALSE,
4353 fd->displayName(),fd->getReference(),
4354 fd->getOutputFileBase(),QCString(),FALSE,fd->isLinkableViaGroup());
4355 }
4356 }
4357 }
4358 else if (lde->kind()==LayoutDocEntry::GroupDirs && addToIndex)
4359 {
4360 for (const auto &dd : gd->getDirs())
4361 {
4362 if (dd->isVisible())
4363 {
4364 Doxygen::indexList->addContentsItem(FALSE,
4365 dd->shortName(),dd->getReference(),
4366 dd->getOutputFileBase(),QCString(),FALSE,FALSE);
4367 }
4368 }
4369 }
4370 else if (lde->kind()==LayoutDocEntry::GroupPageDocs && addToIndex)
4371 {
4372 for (const auto &pd : gd->getPages())
4373 {
4374 const SectionInfo *si=nullptr;
4375 if (!pd->name().isEmpty()) si=SectionManager::instance().find(pd->name());
4376 hasSubPages = pd->hasSubPages();
4377 bool hasSections = pd->hasSections();
4378 QCString pageTitle;
4379 if (pd->title().isEmpty())
4380 pageTitle=pd->name();
4381 else
4382 pageTitle = parseCommentAsText(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4383 QCString pageTitleAsHtml = parseCommentAsHtml(pd,nullptr,pd->title(),pd->getDefFileName(),pd->getDefLine());
4384 Doxygen::indexList->addContentsItem(
4385 hasSubPages || hasSections,
4386 pageTitle,
4387 gd->getReference(),
4388 gd->getOutputFileBase(),
4389 si ? si->label() : QCString(),
4390 hasSubPages || hasSections,
4391 TRUE,
4392 nullptr,
4393 pageTitleAsHtml); // addToNavIndex
4394 if (hasSections || hasSubPages)
4395 {
4396 Doxygen::indexList->incContentsDepth();
4397 }
4398 if (hasSections)
4399 {
4400 pd->addSectionsToIndex();
4401 }
4402 writePages(pd,nullptr);
4403 if (hasSections || hasSubPages)
4404 {
4405 Doxygen::indexList->decContentsDepth();
4406 }
4407 }
4408 }
4409 else if (lde->kind()==LayoutDocEntry::GroupNestedGroups)
4410 {
4411 if (!gd->getSubGroups().empty())
4413 startIndexHierarchy(ol,level+1);
4414 for (const auto &subgd : gd->getSubGroups())
4415 {
4416 writeGroupTreeNode(ol,subgd,level+1,ftv,addToIndex);
4417 }
4418 endIndexHierarchy(ol,level+1);
4419 }
4420 }
4421 }
4422
4423 ol.endIndexListItem();
4424
4425 if (addToIndex)
4426 {
4427 Doxygen::indexList->decContentsDepth();
4428 }
4429 if (ftv)
4430 {
4431 ftv->decContentsDepth();
4432 }
4433 //gd->visited=TRUE;
4434 }
4435}
4437static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
4438{
4439 if (ftv)
4440 {
4441 ol.pushGeneratorState();
4443 }
4444 startIndexHierarchy(ol,0);
4445 for (const auto &gd : *Doxygen::groupLinkedMap)
4446 {
4447 if (gd->isVisibleInHierarchy())
4448 {
4449 writeGroupTreeNode(ol,gd.get(),0,ftv,addToIndex);
4450 }
4451 }
4452 endIndexHierarchy(ol,0);
4453 if (ftv)
4454 {
4455 ol.popGeneratorState();
4456 }
4457}
4458
4459//----------------------------------------------------------------------------
4460
4461static void writeTopicIndex(OutputList &ol)
4462{
4463 if (Index::instance().numDocumentedGroups()==0) return;
4464 ol.pushGeneratorState();
4465 // 1.{
4468 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Topics);
4469 QCString title = lne ? lne->title() : theTranslator->trTopics();
4470 bool addToIndex = lne==nullptr || lne->visible();
4471
4472 startFile(ol,"topics",false,QCString(),title,HighlightedItem::Topics);
4473 startTitle(ol,QCString());
4474 ol.parseText(title);
4475 endTitle(ol,QCString(),QCString());
4476 ol.startContents();
4477 ol.startTextBlock();
4478 ol.parseText(lne ? lne->intro() : theTranslator->trTopicListDescription());
4479 ol.endTextBlock();
4480
4481 // ---------------
4482 // Normal group index for Latex/RTF
4483 // ---------------
4484 // 2.{
4485 ol.pushGeneratorState();
4487 Doxygen::indexList->disable();
4488
4489 writeGroupHierarchy(ol,nullptr,FALSE);
4490
4491 Doxygen::indexList->enable();
4492 ol.popGeneratorState();
4493 // 2.}
4494
4495 // ---------------
4496 // interactive group index for HTML
4497 // ---------------
4498 // 2.{
4499 ol.pushGeneratorState();
4501
4502 {
4503 if (addToIndex)
4504 {
4505 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"topics",QCString(),TRUE,TRUE);
4506 Doxygen::indexList->incContentsDepth();
4507 }
4508 FTVHelp ftv(false);
4509 writeGroupHierarchy(ol,&ftv,addToIndex);
4510 TextStream t;
4513 ol.writeString(t.str());
4514 if (addToIndex)
4515 {
4516 Doxygen::indexList->decContentsDepth();
4517 }
4518 }
4519 ol.popGeneratorState();
4520 // 2.}
4521
4522 endFile(ol);
4523 ol.popGeneratorState();
4524 // 1.}
4525}
4526
4527
4528//----------------------------------------------------------------------------
4529
4530static void writeModuleTreeNode(OutputList &ol, const ModuleDef *mod,
4531 FTVHelp* ftv, bool addToIndex)
4532{
4533 int visibleMembers = mod->countVisibleMembers();
4534 bool isDir=visibleMembers>0;
4535 if (addToIndex)
4536 {
4537 Doxygen::indexList->addContentsItem(isDir,mod->name(),
4538 mod->getReference(),mod->getOutputFileBase(),QCString(),isDir,TRUE);
4539 }
4540 if (ftv)
4541 {
4542 ftv->addContentsItem(false,mod->name(),
4543 mod->getReference(),mod->getOutputFileBase(),QCString(),
4544 false,false,mod);
4545 }
4546 ol.startIndexListItem();
4548 ol.generateDoc(mod->getDefFileName(),
4549 mod->getDefLine(),
4550 mod,
4551 nullptr,
4552 mod->qualifiedName(),
4553 DocOptions()
4554 .setSingleLine(true)
4555 .setAutolinkSupport(false));
4557 if (mod->isReference())
4558 {
4560 ol.docify(" [external]");
4561 ol.endTypewriter();
4562 }
4563 if (addToIndex && isDir)
4564 {
4565 Doxygen::indexList->incContentsDepth();
4566 }
4567 if (isDir)
4568 {
4569 //ftv->incContentsDepth();
4570 writeClassTree(mod->getClasses(),nullptr,addToIndex,FALSE,ClassDef::Class);
4571 writeConceptList(mod->getConcepts(),nullptr,addToIndex);
4572 writeModuleMembers(mod,addToIndex);
4573 //ftv->decContentsDepth();
4574 }
4575 if (addToIndex && isDir)
4576 {
4577 Doxygen::indexList->decContentsDepth();
4578 }
4579 ol.endIndexListItem();
4580}
4581
4582//----------------------------------------------------------------------------
4584static void writeModuleList(OutputList &ol, FTVHelp *ftv,bool addToIndex)
4585{
4586 if (ftv)
4587 {
4588 ol.pushGeneratorState();
4590 }
4591 startIndexHierarchy(ol,0);
4592 for (const auto &mod : ModuleManager::instance().modules())
4593 {
4594 if (mod->isPrimaryInterface())
4595 {
4596 writeModuleTreeNode(ol,mod.get(),ftv,addToIndex);
4597 }
4598 }
4599 endIndexHierarchy(ol,0);
4600 if (ftv)
4601 {
4602 ol.popGeneratorState();
4603 }
4604}
4605
4606//----------------------------------------------------------------------------
4607
4608static void writeModuleIndex(OutputList &ol)
4609{
4610 if (ModuleManager::instance().numDocumentedModules()==0) return;
4611 ol.pushGeneratorState();
4612 // 1.{
4613
4616 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ModuleList);
4617 if (lne==nullptr) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Modules); // fall back
4618 QCString title = lne ? lne->title() : theTranslator->trModules();
4619 bool addToIndex = lne==nullptr || lne->visible();
4620
4621 startFile(ol,"modules",false,QCString(),title,HighlightedItem::Modules);
4622 startTitle(ol,QCString());
4623 ol.parseText(title);
4624 endTitle(ol,QCString(),QCString());
4625 ol.startContents();
4626 ol.startTextBlock();
4627 ol.parseText(lne ? lne->intro() : theTranslator->trModulesListDescription(Config_getBool(EXTRACT_ALL)));
4628 ol.endTextBlock();
4629
4630 // ---------------
4631 // Normal group index for Latex/RTF
4632 // ---------------
4633 // 2.{
4634 ol.pushGeneratorState();
4636 Doxygen::indexList->disable();
4637
4638 writeModuleList(ol,nullptr,FALSE);
4639
4640 Doxygen::indexList->enable();
4641 ol.popGeneratorState();
4642 // 2.}
4643
4644 // ---------------
4645 // interactive group index for HTML
4646 // ---------------
4647 // 2.{
4648 ol.pushGeneratorState();
4650
4652 if (addToIndex)
4653 {
4654 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"modules",QCString(),TRUE,TRUE);
4655 Doxygen::indexList->incContentsDepth();
4656 }
4657 FTVHelp ftv(false);
4658 writeModuleList(ol,&ftv,addToIndex);
4659 TextStream t;
4661 ol.writeString(t.str());
4662 if (addToIndex)
4663 {
4664 Doxygen::indexList->decContentsDepth();
4665 }
4666 }
4667 ol.popGeneratorState();
4668 // 2.}
4669 endFile(ol);
4670 ol.popGeneratorState();
4671 // 1.}
4672}
4673
4674//----------------------------------------------------------------------------
4675
4676static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv,bool addToIndex)
4677{
4678 for (const auto &cd : concepts)
4679 {
4680 if (cd->isLinkableInProject())
4681 {
4682 if (ftv)
4683 {
4684 ftv->addContentsItem(false,cd->displayName(FALSE),cd->getReference(),
4685 cd->getOutputFileBase(),QCString(),false,cd->partOfGroups().empty(),cd);
4686 }
4687 if (addToIndex)
4688 {
4689 Doxygen::indexList->addContentsItem(false,cd->displayName(FALSE),cd->getReference(),
4690 cd->getOutputFileBase(),QCString(),false,cd->partOfGroups().empty());
4691 }
4692 }
4693 }
4694}
4695
4697 bool rootOnly, bool addToIndex);
4698
4699static void writeConceptTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap,FTVHelp *ftv,
4700 bool rootOnly, bool addToIndex)
4701{
4702 for (const auto &nd : nsLinkedMap)
4703 {
4704 writeConceptTreeInsideNamespaceElement(nd,ftv,rootOnly,addToIndex);
4705 }
4706}
4707
4708
4710 bool rootOnly, bool addToIndex)
4711{
4712 if (!nd->isAnonymous() &&
4713 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
4714 {
4715 bool isDir = namespaceHasNestedConcept(nd);
4716 bool isLinkable = nd->isLinkableInProject();
4717
4718 //printf("writeConceptTreeInsideNamespaceElement namespace %s isLinkable=%d isDir=%d\n",qPrint(nd->name()),isLinkable,isDir);
4719
4720 QCString ref;
4721 QCString file;
4722 if (isLinkable)
4723 {
4724 ref = nd->getReference();
4725 file = nd->getOutputFileBase();
4726 }
4727
4728 if (isDir)
4729 {
4730 ftv->addContentsItem(isDir,nd->localName(),ref,file,QCString(),FALSE,TRUE,nd);
4731
4732 if (addToIndex)
4733 {
4734 // the namespace entry is already shown under the namespace list so don't
4735 // add it to the nav index and don't create a separate index file for it otherwise
4736 // it will overwrite the one written for the namespace list.
4737 Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
4738 false, // separateIndex
4739 false // addToNavIndex
4740 );
4741 }
4742 if (addToIndex)
4743 {
4744 Doxygen::indexList->incContentsDepth();
4745 }
4746
4747 ftv->incContentsDepth();
4749 writeConceptList(nd->getConcepts(),ftv,addToIndex);
4750 ftv->decContentsDepth();
4751
4752 if (addToIndex)
4753 {
4754 Doxygen::indexList->decContentsDepth();
4755 }
4756 }
4758}
4759
4760static void writeConceptRootList(FTVHelp *ftv,bool addToIndex)
4761{
4762 for (const auto &cd : *Doxygen::conceptLinkedMap)
4763 {
4764 if ((cd->getOuterScope()==nullptr ||
4765 cd->getOuterScope()==Doxygen::globalScope) && cd->isLinkableInProject()
4766 )
4767 {
4768 //printf("*** adding %s hasSubPages=%d hasSections=%d\n",qPrint(pageTitle),hasSubPages,hasSections);
4769 ftv->addContentsItem(
4770 false,cd->localName(),cd->getReference(),cd->getOutputFileBase(),
4771 QCString(),false,cd->partOfGroups().empty(),cd.get());
4772 if (addToIndex)
4773 {
4774 Doxygen::indexList->addContentsItem(
4775 false,cd->localName(),cd->getReference(),cd->getOutputFileBase(),
4776 QCString(),false,cd->partOfGroups().empty(),cd.get());
4777 }
4778 }
4779 }
4780}
4781
4782static void writeConceptIndex(OutputList &ol)
4783{
4784 if (Index::instance().numDocumentedConcepts()==0) return;
4785 ol.pushGeneratorState();
4786 // 1.{
4789 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Concepts);
4790 QCString title = lne ? lne->title() : theTranslator->trConceptList();
4791 bool addToIndex = lne==nullptr || lne->visible();
4792
4793 startFile(ol,"concepts",false,QCString(),title,HighlightedItem::Concepts);
4794 startTitle(ol,QCString());
4795 ol.parseText(title);
4796 endTitle(ol,QCString(),QCString());
4797 ol.startContents();
4798 ol.startTextBlock();
4799 ol.parseText(lne ? lne->intro() : theTranslator->trConceptListDescription(Config_getBool(EXTRACT_ALL)));
4800 ol.endTextBlock();
4801
4802 // ---------------
4803 // Normal group index for Latex/RTF
4804 // ---------------
4805 // 2.{
4806 ol.pushGeneratorState();
4808
4809 bool first=TRUE;
4810 for (const auto &cd : *Doxygen::conceptLinkedMap)
4811 {
4812 if (cd->isLinkableInProject())
4813 {
4814 if (first)
4815 {
4816 ol.startIndexList();
4817 first=FALSE;
4818 }
4819 //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
4820 ol.startIndexKey();
4821 ol.writeObjectLink(QCString(),cd->getOutputFileBase(),QCString(),cd->displayName());
4822 ol.endIndexKey();
4823
4824 bool hasBrief = !cd->briefDescription().isEmpty();
4825 ol.startIndexValue(hasBrief);
4826 if (hasBrief)
4827 {
4828 ol.generateDoc(cd->briefFile(),
4829 cd->briefLine(),
4830 cd.get(),
4831 nullptr,
4832 cd->briefDescription(true),
4833 DocOptions()
4834 .setSingleLine(true)
4835 .setLinkFromIndex(true));
4836 }
4837 ol.endIndexValue(cd->getOutputFileBase(),hasBrief);
4838
4839 }
4840 }
4841 if (!first) ol.endIndexList();
4842
4843 ol.popGeneratorState();
4844 // 2.}
4845
4846 // ---------------
4847 // interactive group index for HTML
4848 // ---------------
4849 // 2.{
4850 ol.pushGeneratorState();
4852
4853 {
4854 if (addToIndex)
4855 {
4856 Doxygen::indexList->addContentsItem(TRUE,title,QCString(),"concepts",QCString(),TRUE,TRUE);
4857 Doxygen::indexList->incContentsDepth();
4859 FTVHelp ftv(false);
4860 for (const auto &nd : *Doxygen::namespaceLinkedMap)
4861 {
4862 writeConceptTreeInsideNamespaceElement(nd.get(),&ftv,true,addToIndex);
4863 }
4864 writeConceptRootList(&ftv,addToIndex);
4865 TextStream t;
4867 ol.writeString(t.str());
4868 if (addToIndex)
4869 {
4870 Doxygen::indexList->decContentsDepth();
4871 }
4872 }
4873 ol.popGeneratorState();
4874 // 2.}
4875
4876 endFile(ol);
4877 ol.popGeneratorState();
4878 // 1.}
4879}
4880
4881//----------------------------------------------------------------------------
4882
4884{
4885 if (lne->baseFile().startsWith("usergroup"))
4886 {
4887 ol.pushGeneratorState();
4890 startTitle(ol,QCString());
4891 ol.parseText(lne->title());
4892 endTitle(ol,QCString(),QCString());
4893 ol.startContents();
4894 int count=0;
4895 for (const auto &entry: lne->children())
4896 {
4897 if (entry->visible()) count++;
4898 }
4899 if (count>0)
4900 {
4901 ol.writeString("<ul>\n");
4902 for (const auto &entry: lne->children())
4903 {
4904 if (entry->visible())
4905 {
4906 ol.writeString("<li><a href=\""+entry->url()+"\"><span>"+
4907 fixSpaces(entry->title())+"</span></a></li>\n");
4908 }
4909 }
4910 ol.writeString("</ul>\n");
4911 }
4912 endFile(ol);
4913 ol.popGeneratorState();
4914 }
4915}
4916
4917//----------------------------------------------------------------------------
4918
4919
4920static void writeIndex(OutputList &ol)
4921{
4922 bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
4923 bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
4924 bool disableIndex = Config_getBool(DISABLE_INDEX);
4925 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
4926 bool pageOutlinePanel = Config_getBool(PAGE_OUTLINE_PANEL);
4927 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
4928 QCString projectName = Config_getString(PROJECT_NAME);
4929 // save old generator state
4930 ol.pushGeneratorState();
4931
4932 QCString projPrefix;
4933 if (!projectName.isEmpty())
4934 {
4935 projPrefix=projectName+" ";
4936 }
4937
4938 //--------------------------------------------------------------------
4939 // write HTML index
4940 //--------------------------------------------------------------------
4942
4943 QCString defFileName =
4944 Doxygen::mainPage ? Doxygen::mainPage->docFile() : QCString("[generated]");
4945 int defLine =
4946 Doxygen::mainPage ? Doxygen::mainPage->docLine() : -1;
4947
4948 QCString title, titleAsHtml;
4949 if (!mainPageHasTitle())
4950 {
4951 title = theTranslator->trMainPage();
4952 }
4953 else if (Doxygen::mainPage)
4954 {
4955 title = parseCommentAsText(Doxygen::mainPage.get(),nullptr,Doxygen::mainPage->title(),
4956 Doxygen::mainPage->getDefFileName(),Doxygen::mainPage->getDefLine());
4957 titleAsHtml = parseCommentAsHtml(Doxygen::mainPage.get(),nullptr,Doxygen::mainPage->title(),
4958 Doxygen::mainPage->getDefFileName(),Doxygen::mainPage->getDefLine());
4959 }
4960
4961 QCString indexName="index";
4962 ol.startFile(indexName,false,QCString(),title);
4963
4965 {
4966 bool hasSubs = Doxygen::mainPage->hasSubPages() || Doxygen::mainPage->hasSections();
4967 bool hasTitle = !projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0;
4968 //printf("** mainPage title=%s hasTitle=%d hasSubs=%d\n",qPrint(title),hasTitle,hasSubs);
4969 if (hasTitle) // to avoid duplicate entries in the treeview
4970 {
4971 Doxygen::indexList->addContentsItem(hasSubs,
4972 title,
4973 QCString(),
4974 indexName,
4975 QCString(),
4976 hasSubs,
4977 TRUE,
4978 nullptr,
4979 titleAsHtml);
4980 }
4981 if (hasSubs)
4982 {
4983 writePages(Doxygen::mainPage.get(),nullptr);
4984 }
4985 }
4986
4987 bool quickLinksAfterSplitbar = !disableIndex && generateTreeView && fullSidebar;
4988 ol.startQuickIndices();
4989 if (!disableIndex && !quickLinksAfterSplitbar)
4990 {
4992 }
4993 ol.endQuickIndices();
4994 ol.writeSplitBar(indexName,QCString());
4995 if (quickLinksAfterSplitbar)
4996 {
4998 }
4999 ol.writeSearchInfo();
5000 bool headerWritten=FALSE;
5002 {
5003 if (!Doxygen::mainPage->title().isEmpty())
5004 {
5005 if (Doxygen::mainPage->title().lower() != "notitle")
5006 ol.startPageDoc(Doxygen::mainPage->title());
5007 else
5008 ol.startPageDoc("");
5009 }
5010 else
5011 ol.startPageDoc(projectName);
5012 }
5013 if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty())
5014 {
5015 if (Doxygen::mainPage->title().lower()!="notitle")
5016 {
5017 ol.startHeaderSection();
5019 ol.generateDoc(Doxygen::mainPage->docFile(),
5020 Doxygen::mainPage->getStartBodyLine(),
5021 Doxygen::mainPage.get(),
5022 nullptr,
5023 Doxygen::mainPage->title(),
5024 DocOptions()
5025 .setSingleLine(true));
5026 headerWritten = TRUE;
5027 }
5028 }
5029 else
5030 {
5031 if (!projectName.isEmpty())
5032 {
5033 ol.startHeaderSection();
5035 ol.parseText(theTranslator->trDocumentation(projectName));
5036 headerWritten = TRUE;
5037 }
5038 }
5039 if (headerWritten)
5040 {
5042 ol.endHeaderSection();
5043 }
5044
5045 ol.startContents();
5046 if (Config_getBool(DISABLE_INDEX) && Doxygen::mainPage==nullptr)
5047 {
5049 }
5050
5052 {
5053 if (Doxygen::mainPage->localToc().isHtmlEnabled() && Doxygen::mainPage->hasSections() && !(generateTreeView && pageOutlinePanel))
5054 {
5055 Doxygen::mainPage->writeToc(ol,Doxygen::mainPage->localToc());
5056 }
5057
5058 ol.startTextBlock();
5059 ol.generateDoc(defFileName,
5060 defLine,
5061 Doxygen::mainPage.get(),
5062 nullptr,
5063 Doxygen::mainPage->documentation(),
5064 DocOptions()
5065 .setIndexWords(true));
5066 ol.endTextBlock();
5067 ol.endPageDoc();
5068 }
5069
5072 ol.writeString("<a href=\"" + fn + "\"></a>\n");
5073 Doxygen::indexList->addIndexFile(fn);
5074
5075 if (Doxygen::mainPage &&
5076 generateTreeView &&
5077 pageOutlinePanel &&
5078 Doxygen::mainPage->localToc().isHtmlEnabled() &&
5079 Doxygen::mainPage->hasSections()
5080 )
5081 {
5082 ol.writeString("</div><!-- doc-content -->\n");
5083 ol.endContents();
5084 Doxygen::mainPage->writePageNavigation(ol);
5085 ol.writeString("</div><!-- container -->\n");
5086 endFile(ol,true,true);
5087 }
5088 else
5089 {
5090 endFile(ol);
5091 }
5092
5094
5095 //--------------------------------------------------------------------
5096 // write LaTeX/RTF index
5097 //--------------------------------------------------------------------
5101
5103 {
5104 msg("Generating main page...\n");
5105 Doxygen::mainPage->writeDocumentation(ol);
5106 }
5107
5108 ol.startFile("refman",false,QCString(),QCString());
5112
5113 if (projPrefix.isEmpty())
5114 {
5115 ol.parseText(theTranslator->trReferenceManual());
5116 }
5117 else
5118 {
5119 ol.parseText(projPrefix);
5120 }
5121
5122 if (!Config_getString(PROJECT_NUMBER).isEmpty())
5123 {
5124 ol.startProjectNumber();
5125 ol.generateDoc(defFileName,
5126 defLine,
5127 Doxygen::mainPage.get(),
5128 nullptr,
5129 Config_getString(PROJECT_NUMBER),
5130 DocOptions());
5131 ol.endProjectNumber();
5132 }
5135 ol.parseText(theTranslator->trGeneratedBy());
5139
5140 ol.lastIndexPage();
5142 {
5145 }
5146 const auto &index = Index::instance();
5147 if (index.numDocumentedPages()>0)
5148 {
5151 }
5152
5154 if (!Config_getBool(LATEX_HIDE_INDICES))
5155 {
5156 //if (indexedPages>0)
5157 //{
5158 // ol.startIndexSection(isPageIndex);
5159 // ol.parseText(/*projPrefix+*/ theTranslator->trPageIndex());
5160 // ol.endIndexSection(isPageIndex);
5161 //}
5162 if (index.numDocumentedModules()>0)
5163 {
5165 ol.parseText(/*projPrefix+*/ theTranslator->trModuleIndex());
5167 }
5168 if (index.numDocumentedGroups()>0)
5169 {
5171 ol.parseText(/*projPrefix+*/ theTranslator->trTopicIndex());
5173 }
5174 if (index.numDocumentedDirs()>0)
5175 {
5177 ol.parseText(theTranslator->trDirIndex());
5179 }
5180 if (Config_getBool(SHOW_NAMESPACES) && (index.numDocumentedNamespaces()>0))
5181 {
5182 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces);
5183 if (lne)
5184 {
5186 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModulesIndex():theTranslator->trNamespaceIndex()));
5188 }
5189 }
5190 if (index.numDocumentedConcepts()>0)
5191 {
5193 ol.parseText(/*projPrefix+*/theTranslator->trConceptIndex());
5195 }
5196 if (index.numHierarchyInterfaces()>0)
5197 {
5199 ol.parseText(/*projPrefix+*/theTranslator->trHierarchicalIndex());
5201 }
5202 if (index.numHierarchyClasses()>0)
5203 {
5204 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
5205 if (lne)
5206 {
5208 ol.parseText(/*projPrefix+*/
5209 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
5210 vhdlOpt ? theTranslator->trHierarchicalIndex() :
5211 theTranslator->trHierarchicalIndex()
5212 ));
5214 }
5215 }
5216 if (index.numHierarchyExceptions()>0)
5217 {
5219 ol.parseText(/*projPrefix+*/theTranslator->trHierarchicalIndex());
5221 }
5222 if (index.numAnnotatedInterfacesPrinted()>0)
5223 {
5225 ol.parseText(/*projPrefix+*/theTranslator->trInterfaceIndex());
5227 }
5228 if (index.numAnnotatedClassesPrinted()>0)
5229 {
5231 ol.parseText(/*projPrefix+*/
5232 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
5233 vhdlOpt ? theTranslator->trDesignUnitIndex() :
5234 theTranslator->trCompoundIndex()
5235 ));
5237 }
5238 if (index.numAnnotatedStructsPrinted()>0)
5239 {
5241 ol.parseText(/*projPrefix+*/theTranslator->trStructIndex());
5243 }
5244 if (index.numAnnotatedExceptionsPrinted()>0)
5245 {
5247 ol.parseText(/*projPrefix+*/theTranslator->trExceptionIndex());
5249 }
5250 if (Config_getBool(SHOW_FILES) && index.numDocumentedFiles()>0)
5251 {
5253 ol.parseText(/*projPrefix+*/theTranslator->trFileIndex());
5255 }
5256 }
5258
5259 if (index.numDocumentedModules()>0)
5260 {
5262 ol.parseText(/*projPrefix+*/theTranslator->trModuleDocumentation());
5264 }
5265 if (index.numDocumentedGroups()>0)
5266 {
5268 ol.parseText(/*projPrefix+*/theTranslator->trTopicDocumentation());
5270 }
5271 if (index.numDocumentedDirs()>0)
5272 {
5274 ol.parseText(/*projPrefix+*/theTranslator->trDirDocumentation());
5276 }
5277 if (index.numDocumentedNamespaces()>0)
5278 {
5280 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModuleDocumentation():theTranslator->trNamespaceDocumentation()));
5282 }
5283 if (index.numDocumentedConcepts()>0)
5284 {
5286 ol.parseText(/*projPrefix+*/theTranslator->trConceptDocumentation());
5288 }
5289 if (index.numAnnotatedInterfacesPrinted()>0)
5290 {
5292 ol.parseText(/*projPrefix+*/theTranslator->trInterfaceDocumentation());
5294 }
5295 if (index.numAnnotatedClassesPrinted()>0)
5296 {
5298 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trTypeDocumentation():theTranslator->trClassDocumentation()));
5300 }
5301 if (index.numAnnotatedStructsPrinted()>0)
5302 {
5304 ol.parseText(/*projPrefix+*/theTranslator->trStructDocumentation());
5307 if (index.numAnnotatedExceptionsPrinted()>0)
5310 ol.parseText(/*projPrefix+*/theTranslator->trExceptionDocumentation());
5312 }
5313 if (Config_getBool(SHOW_FILES) && index.numDocumentedFiles()>0)
5314 {
5316 ol.parseText(/*projPrefix+*/theTranslator->trFileDocumentation());
5318 }
5319 if (!Doxygen::exampleLinkedMap->empty())
5320 {
5322 ol.parseText(/*projPrefix+*/theTranslator->trExamples());
5324 }
5326 endFile(ol);
5327
5328 ol.popGeneratorState();
5329}
5330
5331static std::vector<bool> indexWritten;
5332
5333static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &entries)
5334{
5335 auto isRef = [](const QCString &s)
5336 {
5337 return s.startsWith("@ref") || s.startsWith("\\ref");
5338 };
5339 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
5340 const auto &index = Index::instance();
5341 for (const auto &lne : entries)
5342 {
5343 LayoutNavEntry::Kind kind = lne->kind();
5344 size_t idx = static_cast<size_t>(kind);
5345 if (idx>=indexWritten.size())
5346 {
5347 size_t oldSize = indexWritten.size();
5348 size_t newSize = idx+1;
5349 indexWritten.resize(newSize);
5350 for (size_t i=oldSize; i<newSize; i++) indexWritten.at(i)=FALSE;
5351 }
5352 //printf("starting %s kind=%d\n",qPrint(lne->title()),lne->kind());
5353 bool addToIndex=lne->visible();
5354 bool needsClosing=FALSE;
5355 if (!indexWritten.at(idx))
5356 {
5357 switch(kind)
5358 {
5359 case LayoutNavEntry::MainPage:
5360 msg("Generating index page...\n");
5361 writeIndex(ol);
5362 break;
5363 case LayoutNavEntry::Pages:
5364 msg("Generating page index...\n");
5365 writePageIndex(ol);
5366 break;
5367 case LayoutNavEntry::Topics:
5368 msg("Generating topic index...\n");
5369 writeTopicIndex(ol);
5370 break;
5371 case LayoutNavEntry::Modules:
5372 {
5373 if (index.numDocumentedModules()>0 && addToIndex)
5374 {
5375 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
5376 Doxygen::indexList->incContentsDepth();
5377 needsClosing=TRUE;
5378 }
5379 }
5380 break;
5381 case LayoutNavEntry::ModuleList:
5382 msg("Generating module index...\n");
5383 writeModuleIndex(ol);
5384 break;
5385 case LayoutNavEntry::ModuleMembers:
5386 msg("Generating module member index...\n");
5388 break;
5389 case LayoutNavEntry::Namespaces:
5390 {
5391 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
5392 if (showNamespaces)
5393 {
5394 if (index.numDocumentedNamespaces()>0 && addToIndex)
5395 {
5396 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
5397 Doxygen::indexList->incContentsDepth();
5398 needsClosing=TRUE;
5399 }
5400 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne.get()) // for backward compatibility with old layout file
5401 {
5402 msg("Generating namespace index...\n");
5404 }
5405 }
5406 }
5407 break;
5408 case LayoutNavEntry::NamespaceList:
5409 {
5410 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
5411 if (showNamespaces)
5412 {
5413 msg("Generating namespace index...\n");
5415 }
5416 }
5417 break;
5418 case LayoutNavEntry::NamespaceMembers:
5419 msg("Generating namespace member index...\n");
5421 break;
5422 case LayoutNavEntry::Classes:
5423 if (index.numAnnotatedClasses()>0 && addToIndex)
5424 {
5425 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
5426 Doxygen::indexList->incContentsDepth();
5427 needsClosing=TRUE;
5428 }
5429 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne.get()) // for backward compatibility with old layout file
5430 {
5431 msg("Generating annotated compound index...\n");
5433 }
5434 break;
5435 case LayoutNavEntry::Concepts:
5436 msg("Generating concept index...\n");
5438 break;
5439 case LayoutNavEntry::ClassList:
5440 msg("Generating annotated compound index...\n");
5442 break;
5443 case LayoutNavEntry::ClassIndex:
5444 msg("Generating alphabetical compound index...\n");
5446 break;
5447 case LayoutNavEntry::ClassHierarchy:
5448 msg("Generating hierarchical class index...\n");
5450 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
5451 {
5452 msg("Generating graphical class hierarchy...\n");
5454 }
5455 break;
5456 case LayoutNavEntry::ClassMembers:
5457 if (!sliceOpt)
5458 {
5459 msg("Generating member index...\n");
5461 }
5462 break;
5463 case LayoutNavEntry::Interfaces:
5464 if (sliceOpt && index.numAnnotatedInterfaces()>0 && addToIndex)
5465 {
5466 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
5467 Doxygen::indexList->incContentsDepth();
5468 needsClosing=TRUE;
5469 }
5470 break;
5471 case LayoutNavEntry::InterfaceList:
5472 if (sliceOpt)
5473 {
5474 msg("Generating annotated interface index...\n");
5476 }
5477 break;
5478 case LayoutNavEntry::InterfaceIndex:
5479 if (sliceOpt)
5480 {
5481 msg("Generating alphabetical interface index...\n");
5483 }
5484 break;
5485 case LayoutNavEntry::InterfaceHierarchy:
5486 if (sliceOpt)
5487 {
5488 msg("Generating hierarchical interface index...\n");
5490 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
5491 {
5492 msg("Generating graphical interface hierarchy...\n");
5494 }
5495 }
5496 break;
5497 case LayoutNavEntry::Structs:
5498 if (sliceOpt && index.numAnnotatedStructs()>0 && addToIndex)
5499 {
5500 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
5501 Doxygen::indexList->incContentsDepth();
5502 needsClosing=TRUE;
5503 }
5504 break;
5505 case LayoutNavEntry::StructList:
5506 if (sliceOpt)
5507 {
5508 msg("Generating annotated struct index...\n");
5510 }
5511 break;
5512 case LayoutNavEntry::StructIndex:
5513 if (sliceOpt)
5514 {
5515 msg("Generating alphabetical struct index...\n");
5517 }
5518 break;
5519 case LayoutNavEntry::Exceptions:
5520 if (sliceOpt && index.numAnnotatedExceptions()>0 && addToIndex)
5521 {
5522 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
5523 Doxygen::indexList->incContentsDepth();
5524 needsClosing=TRUE;
5525 }
5526 break;
5527 case LayoutNavEntry::ExceptionList:
5528 if (sliceOpt)
5529 {
5530 msg("Generating annotated exception index...\n");
5532 }
5533 break;
5534 case LayoutNavEntry::ExceptionIndex:
5535 if (sliceOpt)
5536 {
5537 msg("Generating alphabetical exception index...\n");
5539 }
5540 break;
5541 case LayoutNavEntry::ExceptionHierarchy:
5542 if (sliceOpt)
5543 {
5544 msg("Generating hierarchical exception index...\n");
5546 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
5547 {
5548 msg("Generating graphical exception hierarchy...\n");
5550 }
5551 }
5552 break;
5553 case LayoutNavEntry::Files:
5554 {
5555 if (Config_getBool(SHOW_FILES) && index.numDocumentedFiles()>0 && addToIndex)
5556 {
5557 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString());
5558 Doxygen::indexList->incContentsDepth();
5559 needsClosing=TRUE;
5560 }
5561 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne.get()) // for backward compatibility with old layout file
5562 {
5563 msg("Generating file index...\n");
5564 writeFileIndex(ol);
5565 }
5566 }
5567 break;
5568 case LayoutNavEntry::FileList:
5569 msg("Generating file index...\n");
5570 writeFileIndex(ol);
5571 break;
5572 case LayoutNavEntry::FileGlobals:
5573 msg("Generating file member index...\n");
5575 break;
5576 case LayoutNavEntry::Examples:
5577 msg("Generating example index...\n");
5579 break;
5580 case LayoutNavEntry::User:
5581 if (addToIndex)
5582 {
5583 // prepend a ! or ^ marker to the URL to avoid tampering with it
5584 QCString url = correctURL(lne->url(),"!"); // add ! to relative URL
5585 bool isRelative=url.at(0)=='!';
5586 if (!url.isEmpty() && !isRelative) // absolute URL
5587 {
5588 url.prepend("^"); // prepend ^ to absolute URL
5589 }
5590 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),
5591 url,QCString(),FALSE,isRef(lne->baseFile()) || isRelative);
5592 }
5593 break;
5594 case LayoutNavEntry::UserGroup:
5595 if (addToIndex)
5596 {
5597 QCString url = correctURL(lne->url(),"!"); // add ! to relative URL
5598 if (!url.isEmpty())
5599 {
5600 if (url=="!") // result of a "[none]" url
5601 {
5602 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),QCString(),QCString(),FALSE,FALSE);
5603 }
5604 else
5605 {
5606 bool isRelative=url.at(0)=='!';
5607 if (!isRelative) // absolute URL
5608 {
5609 url.prepend("^"); // prepend ^ to absolute URL
5610 }
5611 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),
5612 url,QCString(),FALSE,isRef(lne->baseFile()) || isRelative);
5613 }
5614 }
5615 else
5616 {
5617 Doxygen::indexList->addContentsItem(TRUE,lne->title(),QCString(),lne->baseFile(),QCString(),TRUE,TRUE);
5618 }
5619 Doxygen::indexList->incContentsDepth();
5620 needsClosing=TRUE;
5621 }
5622 writeUserGroupStubPage(ol,lne.get());
5623 break;
5624 case LayoutNavEntry::None:
5625 assert(kind != LayoutNavEntry::None); // should never happen, means not properly initialized
5626 break;
5627 }
5628 if (kind!=LayoutNavEntry::User && kind!=LayoutNavEntry::UserGroup) // User entry may appear multiple times
5629 {
5630 indexWritten.at(idx)=TRUE;
5632 }
5634 if (needsClosing)
5635 {
5636 switch(kind)
5637 {
5638 case LayoutNavEntry::Modules:
5639 case LayoutNavEntry::Namespaces:
5640 case LayoutNavEntry::Classes:
5641 case LayoutNavEntry::Files:
5642 case LayoutNavEntry::UserGroup:
5643 Doxygen::indexList->decContentsDepth();
5644 break;
5645 default:
5646 break;
5647 }
5648 }
5649 //printf("ending %s kind=%d\n",qPrint(lne->title()),lne->kind());
5650 }
5651
5652 // always write the directory index as it is used for non-HTML output only
5653 writeDirIndex(ol);
5654}
5655
5656static bool quickLinkVisible(LayoutNavEntry::Kind kind)
5657{
5658 const auto &index = Index::instance();
5659 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
5660 bool showFiles = Config_getBool(SHOW_FILES);
5661 bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
5662 switch (kind)
5663 {
5664 case LayoutNavEntry::MainPage: return TRUE;
5665 case LayoutNavEntry::User: return TRUE;
5666 case LayoutNavEntry::UserGroup: return TRUE;
5667 case LayoutNavEntry::Pages: return index.numIndexedPages()>0;
5668 case LayoutNavEntry::Topics: return index.numDocumentedGroups()>0;
5669 case LayoutNavEntry::Modules: return index.numDocumentedModules()>0;
5670 case LayoutNavEntry::ModuleList: return index.numDocumentedModules()>0;
5671 case LayoutNavEntry::ModuleMembers: return index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0;
5672 case LayoutNavEntry::Namespaces: return index.numDocumentedNamespaces()>0 && showNamespaces;
5673 case LayoutNavEntry::NamespaceList: return index.numDocumentedNamespaces()>0 && showNamespaces;
5674 case LayoutNavEntry::NamespaceMembers: return index.numDocumentedNamespaceMembers(NamespaceMemberHighlight::All)>0;
5675 case LayoutNavEntry::Concepts: return index.numDocumentedConcepts()>0;
5676 case LayoutNavEntry::Classes: return index.numAnnotatedClasses()>0;
5677 case LayoutNavEntry::ClassList: return index.numAnnotatedClasses()>0;
5678 case LayoutNavEntry::ClassIndex: return index.numAnnotatedClasses()>0;
5679 case LayoutNavEntry::ClassHierarchy: return index.numHierarchyClasses()>0;
5680 case LayoutNavEntry::ClassMembers: return index.numDocumentedClassMembers(ClassMemberHighlight::All)>0 && !sliceOpt;
5681 case LayoutNavEntry::Interfaces: return index.numAnnotatedInterfaces()>0;
5682 case LayoutNavEntry::InterfaceList: return index.numAnnotatedInterfaces()>0;
5683 case LayoutNavEntry::InterfaceIndex: return index.numAnnotatedInterfaces()>0;
5684 case LayoutNavEntry::InterfaceHierarchy: return index.numHierarchyInterfaces()>0;
5685 case LayoutNavEntry::Structs: return index.numAnnotatedStructs()>0;
5686 case LayoutNavEntry::StructList: return index.numAnnotatedStructs()>0;
5687 case LayoutNavEntry::StructIndex: return index.numAnnotatedStructs()>0;
5688 case LayoutNavEntry::Exceptions: return index.numAnnotatedExceptions()>0;
5689 case LayoutNavEntry::ExceptionList: return index.numAnnotatedExceptions()>0;
5690 case LayoutNavEntry::ExceptionIndex: return index.numAnnotatedExceptions()>0;
5691 case LayoutNavEntry::ExceptionHierarchy: return index.numHierarchyExceptions()>0;
5692 case LayoutNavEntry::Files: return index.numDocumentedFiles()>0 && showFiles;
5693 case LayoutNavEntry::FileList: return index.numDocumentedFiles()>0 && showFiles;
5694 case LayoutNavEntry::FileGlobals: return index.numDocumentedFileMembers(FileMemberHighlight::All)>0;
5695 case LayoutNavEntry::Examples: return !Doxygen::exampleLinkedMap->empty();
5696 case LayoutNavEntry::None: // should never happen, means not properly initialized
5697 assert(kind != LayoutNavEntry::None);
5698 return FALSE;
5699 }
5700 return FALSE;
5701}
5702
5703template<class T>
5704void renderMemberIndicesAsJs(std::ostream &t,
5705 std::function<std::size_t(std::size_t)> numDocumented,
5706 std::function<Index::MemberIndexMap(std::size_t)> getMemberList,
5707 const T *(*getInfo)(size_t hl),
5708 std::size_t total)
5709{
5710 // index items per category member lists
5711 bool firstMember=TRUE;
5712 for (std::size_t i=0;i<total;i++)
5713 {
5714 if (numDocumented(i)>0)
5715 {
5716 t << ",";
5717 if (firstMember)
5718 {
5719 t << "children:[";
5720 firstMember=FALSE;
5721 }
5722 t << "\n{text:\"" << convertToJSString(getInfo(i)->title) << "\",url:\""
5723 << convertToJSString(getInfo(i)->fname+Doxygen::htmlFileExtension) << "\"";
5724
5725 // Check if we have many members, then add sub entries per letter...
5726 // quick alphabetical index
5727 bool quickIndex = numDocumented(i)>maxItemsBeforeQuickIndex;
5728 if (quickIndex)
5729 {
5730 bool multiPageIndex=FALSE;
5731 if (numDocumented(i)>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
5732 {
5733 multiPageIndex=TRUE;
5734 }
5735 t << ",children:[\n";
5736 bool firstLetter=TRUE;
5737 for (const auto &[letter,list] : getMemberList(i))
5738 {
5739 if (!firstLetter) t << ",\n";
5740 QCString ci(letter);
5741 QCString is(letterToLabel(ci));
5742 QCString anchor;
5744 QCString fullName = getInfo(i)->fname;
5745 if (!multiPageIndex || firstLetter)
5746 anchor=fullName+extension+"#index_";
5747 else // other pages of multi page index
5748 anchor=fullName+"_"+is+extension+"#index_";
5749 t << "{text:\"" << convertToJSString(ci) << "\",url:\""
5750 << convertToJSString(anchor+convertToId(is)) << "\"}";
5751 firstLetter=FALSE;
5752 }
5753 t << "]";
5754 }
5755 t << "}";
5756 }
5757 }
5758 if (!firstMember)
5759 {
5760 t << "]";
5761 }
5762}
5763
5764static bool renderQuickLinksAsJs(std::ostream &t,LayoutNavEntry *root,bool first)
5765{
5766 int count=0;
5767 for (const auto &entry : root->children())
5768 {
5769 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
5770 }
5771 if (count>0) // at least one item is visible
5772 {
5773 bool firstChild = TRUE;
5774 if (!first) t << ",";
5775 t << "children:[\n";
5776 for (const auto &entry : root->children())
5777 {
5778 if (entry->visible() && quickLinkVisible(entry->kind()))
5779 {
5780 if (!firstChild) t << ",\n";
5781 firstChild=FALSE;
5782 QCString url = entry->url();
5783 if (isURL(url)) url = "^" + url;
5784 t << "{text:\"" << convertToJSString(entry->title()) << "\",url:\""
5785 << convertToJSString(url) << "\"";
5786 bool hasChildren=FALSE;
5787 if (entry->kind()==LayoutNavEntry::ModuleMembers)
5788 {
5789 auto numDoc = [](std::size_t i) {
5791 };
5792 auto memList = [](std::size_t i) {
5794 };
5795 renderMemberIndicesAsJs(t,numDoc,memList,getMmhlInfo,static_cast<std::size_t>(ModuleMemberHighlight::Total));
5796 }
5797 if (entry->kind()==LayoutNavEntry::NamespaceMembers)
5798 {
5799 auto numDoc = [](std::size_t i) {
5801 };
5802 auto memList = [](std::size_t i) {
5804 };
5805 renderMemberIndicesAsJs(t,numDoc,memList,getNmhlInfo,static_cast<std::size_t>(NamespaceMemberHighlight::Total));
5806 }
5807 else if (entry->kind()==LayoutNavEntry::ClassMembers)
5808 {
5809 auto numDoc = [](std::size_t i) {
5811 };
5812 auto memList = [](std::size_t i) {
5815 renderMemberIndicesAsJs(t,numDoc,memList,getCmhlInfo,static_cast<std::size_t>(ClassMemberHighlight::Total));
5816 }
5817 else if (entry->kind()==LayoutNavEntry::FileGlobals)
5818 {
5819 auto numDoc = [](std::size_t i) {
5821 };
5822 auto memList = [](std::size_t i) {
5824 };
5825 renderMemberIndicesAsJs(t,numDoc,memList,getFmhlInfo,static_cast<std::size_t>(FileMemberHighlight::Total));
5826 }
5827 else // recursive into child list
5828 {
5829 hasChildren = renderQuickLinksAsJs(t,entry.get(),FALSE);
5831 if (hasChildren) t << "]";
5832 t << "}";
5833 }
5834 }
5835 }
5836 return count>0;
5837}
5838
5839static void writeMenuData()
5840{
5841 if (!Config_getBool(GENERATE_HTML) || Config_getBool(DISABLE_INDEX)) return;
5842 QCString outputDir = Config_getBool(HTML_OUTPUT);
5844 std::ofstream t = Portable::openOutputStream(outputDir+"/menudata.js");
5845 if (t.is_open())
5846 {
5848 t << "var menudata={";
5849 bool hasChildren = renderQuickLinksAsJs(t,root,TRUE);
5850 if (hasChildren) t << "]";
5851 t << "}\n";
5852 }
5853}
5854
5856{
5857 writeMenuData();
5859 if (lne)
5860 {
5862 }
5863}
A abstract class representing of a compound symbol.
Definition classdef.h:104
virtual bool isVisibleInHierarchy() const =0
the class is visible in a class diagram, or class hierarchy
virtual const BaseClassList & baseClasses() const =0
Returns the list of base classes from which this class directly inherits.
virtual bool isSimple() const =0
virtual Protection protection() const =0
Return the protection level (Public,Protected,Private) in which this compound was found.
virtual bool isImplicitTemplateInstance() const =0
CompoundType
The various compound types.
Definition classdef.h:109
@ Interface
Definition classdef.h:112
@ Exception
Definition classdef.h:115
virtual CompoundType compoundType() const =0
Returns the type of compound this is, i.e.
virtual ClassLinkedRefMap getClasses() const =0
returns the classes nested into this class
virtual const BaseClassList & subClasses() const =0
Returns the list of sub classes that directly derive from this class.
static const QCString crawlFileName
Definition sitemap.h:75
The common base class of all entity definitions found in the sources.
Definition definition.h:77
virtual bool isVisible() const =0
virtual const QCString & localName() const =0
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
virtual bool hasSections() const =0
virtual QCString navigationPathAsString() const =0
virtual QCString getDefFileName() const =0
virtual bool isLinkable() const =0
virtual int getDefLine() const =0
virtual DefType definitionType() const =0
virtual QCString anchor() const =0
virtual int briefLine() const =0
virtual bool hasDocumentation() const =0
virtual bool isLinkableInProject() const =0
virtual QCString briefDescription(bool abbreviate=FALSE) const =0
virtual bool isAnonymous() const =0
virtual QCString getReference() const =0
virtual QCString getSourceFileBase() const =0
virtual const GroupList & partOfGroups() const =0
virtual QCString qualifiedName() const =0
virtual QCString displayName(bool includeScope=TRUE) const =0
virtual QCString briefFile() const =0
virtual QCString getOutputFileBase() const =0
virtual Definition * getOuterScope() const =0
virtual bool isReference() const =0
virtual const QCString & name() const =0
virtual void writePageNavigation(OutputList &) const =0
virtual void writeSummaryLinks(OutputList &) const =0
A model of a directory symbol.
Definition dirdef.h:110
virtual const QCString shortName() const =0
virtual const DirList & subDirs() const =0
virtual const FileList & getFiles() const =0
Represents a graphical class hierarchy.
Representation of a legend explaining the meaning of boxes, arrows, and colors.
void writeGraph(const QCString &path)
static NamespaceLinkedMap * namespaceLinkedMap
Definition doxygen.h:114
static ConceptLinkedMap * conceptLinkedMap
Definition doxygen.h:97
static std::unique_ptr< PageDef > mainPage
Definition doxygen.h:100
static FileNameLinkedMap * inputNameLinkedMap
Definition doxygen.h:104
static ClassLinkedMap * classLinkedMap
Definition doxygen.h:95
static PageLinkedMap * exampleLinkedMap
Definition doxygen.h:98
static NamespaceDefMutable * globalScope
Definition doxygen.h:120
static IndexList * indexList
Definition doxygen.h:131
static ClassLinkedMap * hiddenClassLinkedMap
Definition doxygen.h:96
static QCString htmlFileExtension
Definition doxygen.h:121
static PageLinkedMap * pageLinkedMap
Definition doxygen.h:99
static DirLinkedMap * dirLinkedMap
Definition doxygen.h:126
static GroupLinkedMap * groupLinkedMap
Definition doxygen.h:113
A class that generates a dynamic tree view side panel.
Definition ftvhelp.h:41
void decContentsDepth()
Definition ftvhelp.cpp:154
void incContentsDepth()
Definition ftvhelp.cpp:143
void addContentsItem(bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def, const QCString &nameAsHtml=QCString())
Definition ftvhelp.cpp:186
void generateTreeViewInline(TextStream &t)
Definition ftvhelp.cpp:881
A model of a file symbol.
Definition filedef.h:99
virtual QCString includeName() const =0
virtual QCString getPath() const =0
virtual bool generateSourceFile() const =0
virtual bool isDocumentationFile() const =0
A model of a group of symbols.
Definition groupdef.h:52
virtual const DirList & getDirs() const =0
virtual const GroupList & getSubGroups() const =0
virtual QCString groupTitle() const =0
virtual const FileList & getFiles() const =0
virtual const MemberLists & getMemberLists() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const PageLinkedRefMap & getPages() const =0
virtual const NamespaceLinkedRefMap & getNamespaces() const =0
virtual bool isASubGroup() const =0
virtual bool isVisibleInHierarchy() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
virtual MemberList * getMemberList(MemberListType lt) const =0
void incrementDocumentedNamespaceMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:207
int numAnnotatedInterfacesPrinted() const
Definition index.cpp:118
void addClassMemberNameToIndex(const MemberDef *md)
Definition index.cpp:2875
std::vector< const MemberDef * > MemberIndexList
Definition index.h:167
void resetDocumentedNamespaceMembers(int i)
Definition index.cpp:170
int numDocumentedFiles() const
Definition index.cpp:130
int numDocumentedNamespaces() const
Definition index.cpp:126
int numIndexedPages() const
Definition index.cpp:129
int numAnnotatedClassesPrinted() const
Definition index.cpp:115
int numDocumentedGroups() const
Definition index.cpp:125
void resetDocumentedModuleMembers(int i)
Definition index.cpp:176
int numDocumentedModules() const
Definition index.cpp:128
void incrementDocumentedFileMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:201
int numAnnotatedStructs() const
Definition index.cpp:120
int numDocumentedConcepts() const
Definition index.cpp:127
void addNamespaceMemberNameToIndex(const MemberDef *md)
Definition index.cpp:2939
void resetDocumentedClassMembers(int i)
Definition index.cpp:158
int numAnnotatedStructsPrinted() const
Definition index.cpp:121
void incrementDocumentedClassMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:195
MemberIndexMap isClassIndexLetterUsed(ClassMemberHighlight::Enum e) const
Definition index.cpp:138
void addFileMemberNameToIndex(const MemberDef *md)
Definition index.cpp:2987
void incrementDocumentedModuleMembers(int i, const std::string &letter, const MemberDef *md)
Definition index.cpp:213
int numHierarchyInterfaces() const
Definition index.cpp:119
int numDocumentedClassMembers(ClassMemberHighlight::Enum e) const
Definition index.cpp:133
int numDocumentedModuleMembers(ModuleMemberHighlight::Enum e) const
Definition index.cpp:136
void addModuleMemberNameToIndex(const MemberDef *md)
Definition index.cpp:3039
int numDocumentedNamespaceMembers(NamespaceMemberHighlight::Enum e) const
Definition index.cpp:135
int numDocumentedPages() const
Definition index.cpp:131
int numHierarchyExceptions() const
Definition index.cpp:124
int numAnnotatedExceptionsPrinted() const
Definition index.cpp:123
int numDocumentedFileMembers(FileMemberHighlight::Enum e) const
Definition index.cpp:134
int numAnnotatedExceptions() const
Definition index.cpp:122
MemberIndexMap isFileIndexLetterUsed(FileMemberHighlight::Enum e) const
Definition index.cpp:143
void sortMemberIndexLists()
Definition index.cpp:220
std::map< std::string, MemberIndexList > MemberIndexMap
Definition index.h:168
static Index & instance()
Definition index.cpp:108
void countDataStructures()
Definition index.cpp:264
int numHierarchyClasses() const
Definition index.cpp:116
MemberIndexMap isModuleIndexLetterUsed(ModuleMemberHighlight::Enum e) const
Definition index.cpp:153
void resetDocumentedFileMembers(int i)
Definition index.cpp:164
int numDocumentedDirs() const
Definition index.cpp:132
int numAnnotatedInterfaces() const
Definition index.cpp:117
Index()
Definition index.cpp:102
std::unique_ptr< Private > p
Definition index.h:221
int numAnnotatedClasses() const
Definition index.cpp:114
MemberIndexMap isNamespaceIndexLetterUsed(NamespaceMemberHighlight::Enum e) const
Definition index.cpp:148
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1437
LayoutNavEntry * rootNavEntry() const
returns the (invisible) root of the navigation tree.
Definition layout.cpp:1448
std::unique_ptr< ClassDef > Ptr
Definition linkedmap.h:38
const T * find(const std::string &key) const
Definition linkedmap.h:47
size_t size() const
Definition linkedmap.h:375
bool empty() const
Definition linkedmap.h:374
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
virtual QCString typeString() const =0
virtual bool isSignal() const =0
virtual bool isFriend() const =0
virtual bool isForeign() const =0
virtual bool isRelated() const =0
virtual bool isSequence() const =0
virtual const ClassDef * getClassDef() const =0
virtual GroupDef * getGroupDef()=0
virtual bool isTypedef() const =0
virtual bool isSlot() const =0
virtual const MemberVector & enumFieldList() const =0
virtual const FileDef * getFileDef() const =0
virtual bool isEvent() const =0
virtual bool isFunction() const =0
virtual bool isDictionary() const =0
virtual const ModuleDef * getModuleDef() const =0
virtual bool isDefine() const =0
virtual const NamespaceDef * getNamespaceDef() const =0
virtual bool isEnumerate() const =0
virtual bool isVariable() const =0
virtual bool isStrong() const =0
virtual const MemberDef * getEnumScope() const =0
virtual bool isEnumValue() const =0
virtual bool isProperty() const =0
A list of MemberDef objects as shown in documentation sections.
Definition memberlist.h:125
A vector of MemberDef object.
Definition memberlist.h:35
bool empty() const noexcept
Definition memberlist.h:60
iterator end() noexcept
Definition memberlist.h:56
iterator begin() noexcept
Definition memberlist.h:54
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual int countVisibleMembers() const =0
virtual bool isPrimaryInterface() const =0
virtual const ConceptLinkedRefMap & getConcepts() const =0
virtual const ClassLinkedRefMap & getClasses() const =0
int numDocumentedModules() const
static ModuleManager & instance()
An abstract interface of a namespace symbol.
virtual MemberList * getMemberList(MemberListType lt) const =0
virtual ConceptLinkedRefMap getConcepts() const =0
virtual ClassLinkedRefMap getStructs() const =0
virtual ClassLinkedRefMap getExceptions() const =0
virtual NamespaceLinkedRefMap getNamespaces() const =0
virtual int countVisibleMembers() const =0
virtual ClassLinkedRefMap getClasses() const =0
virtual ClassLinkedRefMap getInterfaces() const =0
Class representing a list of output generators that are written to in parallel.
Definition outputlist.h:315
void endTextBlock(bool paraBreak=FALSE)
Definition outputlist.h:672
void writeString(const QCString &text)
Definition outputlist.h:411
void writeSearchInfo()
Definition outputlist.h:397
void startIndexItem(const QCString &ref, const QCString &file)
Definition outputlist.h:433
void endTitleHead(const QCString &fileName, const QCString &name)
Definition outputlist.h:405
void endSection(const QCString &lab, SectionType t)
Definition outputlist.h:588
void endIndexValue(const QCString &name, bool b)
Definition outputlist.h:427
void startItemList()
Definition outputlist.h:429
void disable(OutputType o)
void startIndexKey()
Definition outputlist.h:421
void startTitleHead(const QCString &fileName)
Definition outputlist.h:403
void enable(OutputType o)
void endContents()
Definition outputlist.h:620
void endHeaderSection()
Definition outputlist.h:467
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition outputlist.h:439
void endIndexItem(const QCString &ref, const QCString &file)
Definition outputlist.h:435
void writeGraphicalHierarchy(DotGfxHierarchyTable &g)
Definition outputlist.h:668
void startHeaderSection()
Definition outputlist.h:465
void endIndexList()
Definition outputlist.h:419
void docify(const QCString &s)
Definition outputlist.h:437
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, const DocOptions &options)
void startParagraph(const QCString &classDef=QCString())
Definition outputlist.h:407
void endPageDoc()
Definition outputlist.h:624
void endIndexSection(IndexSection is)
Definition outputlist.h:387
void endFile()
Definition outputlist.h:401
void startProjectNumber()
Definition outputlist.h:391
void startTextBlock(bool dense=FALSE)
Definition outputlist.h:670
void endParagraph()
Definition outputlist.h:409
void endIndexKey()
Definition outputlist.h:423
void startQuickIndices()
Definition outputlist.h:602
void endTextLink()
Definition outputlist.h:444
void startItemListItem()
Definition outputlist.h:457
void endItemListItem()
Definition outputlist.h:459
void startTypewriter()
Definition outputlist.h:449
void pushGeneratorState()
void disableAllBut(OutputType o)
void popGeneratorState()
void startFile(const QCString &name, bool isSource, const QCString &manName, const QCString &title, int hierarchyLevel=0)
void lastIndexPage()
Definition outputlist.h:674
void startIndexValue(bool b)
Definition outputlist.h:425
void endIndexListItem()
Definition outputlist.h:415
void endQuickIndices()
Definition outputlist.h:604
void startPageDoc(const QCString &pageTitle)
Definition outputlist.h:622
void writeSplitBar(const QCString &name, const QCString &allMembersFile)
Definition outputlist.h:606
void endItemList()
Definition outputlist.h:431
void startContents()
Definition outputlist.h:618
void writeFooter(const QCString &navPath)
Definition outputlist.h:399
void startIndexList()
Definition outputlist.h:417
void enableAll()
void endProjectNumber()
Definition outputlist.h:393
void endTypewriter()
Definition outputlist.h:451
void startIndexListItem()
Definition outputlist.h:413
void parseText(const QCString &textStr)
void startSection(const QCString &lab, const QCString &title, SectionType t)
Definition outputlist.h:586
void startIndexSection(IndexSection is)
Definition outputlist.h:385
void startTextLink(const QCString &file, const QCString &anchor)
Definition outputlist.h:442
void writeQuickLinks(HighlightedItem hli, const QCString &file, bool extraTabs=false)
Definition outputlist.h:612
A model of a page symbol.
Definition pagedef.h:26
virtual void addSectionsToIndex()=0
virtual bool visibleInIndex() const =0
virtual const PageLinkedRefMap & getSubPages() const =0
virtual bool hasSubPages() const =0
virtual QCString title() const =0
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString & prepend(const char *s)
Definition qcstring.h:422
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
bool startsWith(const char *s) const
Definition qcstring.h:507
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
char & at(size_t i)
Returns a reference to the character at index i.
Definition qcstring.h:593
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
const std::string & str() const
Definition qcstring.h:552
QCString & replace(size_t index, size_t len, const char *s)
Definition qcstring.cpp:217
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172
QCString left(size_t len) const
Definition qcstring.h:229
class that provide information about a section.
Definition section.h:58
QCString label() const
Definition section.h:69
static SectionManager & instance()
returns a reference to the singleton
Definition section.h:179
static constexpr int Subsection
Definition section.h:34
Text streaming class that buffers data.
Definition textstream.h:36
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:216
static QCString getProtectionName(int prot)
static VhdlClasses convert(Protection prot)
Definition vhdldocgen.h:80
bool classHasVisibleRoot(const BaseClassList &bcl)
bool classVisibleInIndex(const ClassDef *cd)
bool classHasVisibleChildren(const ClassDef *cd)
std::vector< BaseClassDef > BaseClassList
Definition classdef.h:81
std::unordered_set< const ClassDef * > ClassDefSet
Definition classdef.h:95
#define Config_updateBool(name, value)
Definition config.h:40
#define Config_getBool(name)
Definition config.h:33
#define Config_getString(name)
Definition config.h:32
std::map< std::string, std::string > StringMap
Definition containers.h:30
Definition * toDefinition(DefinitionMutable *dm)
static constexpr auto hex
static void addMembersToIndex()
Definition doxygen.cpp:8207
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
Definition filedef.cpp:1959
constexpr auto JAVASCRIPT_LICENSE_TEXT
Definition ftvhelp.h:72
static bool quickLinkVisible(LayoutNavEntry::Kind kind)
Definition htmlgen.cpp:2805
static void writeConceptTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:4674
static void writeClassTreeInsideNamespaceElement(const NamespaceDef *nd, FTVHelp *ftv, bool rootOnly, bool addToIndex, ClassDef::CompoundType ct)
Definition index.cpp:1964
void startTitle(OutputList &ol, const QCString &fileName, const DefinitionMutable *def)
Definition index.cpp:386
static void writeIndexHierarchyEntries(OutputList &ol, const LayoutNavEntryList &entries)
Definition index.cpp:5308
static void writeClassTreeToOutput(OutputList &ol, const BaseClassList &bcl, int level, FTVHelp *ftv, bool addToIndex, ClassDefSet &visitedClasses)
Definition index.cpp:622
void endFile(OutputList &ol, bool skipNavIndex, bool skipEndContents, const QCString &navPath)
Definition index.cpp:429
#define MAX_ITEMS_BEFORE_QUICK_INDEX
Definition index.cpp:56
static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight::Enum hl)
Definition index.cpp:3366
#define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX
Definition index.cpp:55
static void writeNamespaceTree(const NamespaceLinkedRefMap &nsLinkedMap, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:1937
static bool renderQuickLinksAsJs(std::ostream &t, LayoutNavEntry *root, bool first)
Definition index.cpp:5739
static void writeGraphicalClassHierarchy(OutputList &ol)
Definition index.cpp:1239
static void writeAnnotatedStructIndex(OutputList &ol)
Definition index.cpp:2685
static void writeAlphabeticalExceptionIndex(OutputList &ol)
Definition index.cpp:2528
static void writeDirIndex(OutputList &ol)
Definition index.cpp:1571
static void writeClassMemberIndex(OutputList &ol)
Definition index.cpp:3306
void writeGraphInfo(OutputList &ol)
Definition index.cpp:4116
static std::vector< bool > indexWritten
Definition index.cpp:5306
static int countConcepts()
Definition index.cpp:1739
void endTitle(OutputList &ol, const QCString &fileName, const QCString &name)
Definition index.cpp:396
static void writeAnnotatedIndex(OutputList &ol)
Definition index.cpp:2657
static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight::Enum hl)
Definition index.cpp:3173
static void writeAnnotatedClassList(OutputList &ol, ClassDef::CompoundType ct)
Definition index.cpp:2180
static void writeFileIndex(OutputList &ol)
Definition index.cpp:1600
static void writeGraphicalInterfaceHierarchy(OutputList &ol)
Definition index.cpp:1344
static void endQuickIndexList(OutputList &ol)
Definition index.cpp:360
static void writeAlphabeticalIndex(OutputList &ol)
Definition index.cpp:2441
static int countClassHierarchy(ClassDef::CompoundType ct)
Definition index.cpp:1148
static void startQuickIndexItem(OutputList &ol, const QCString &l, bool hl, bool, bool &first)
Definition index.cpp:366
static void writeAnnotatedInterfaceIndex(OutputList &ol)
Definition index.cpp:2671
static void writePageIndex(OutputList &ol)
Definition index.cpp:4042
static void writeNamespaceIndex(OutputList &ol)
Definition index.cpp:2054
static void writeClassTreeInsideNamespace(const NamespaceLinkedRefMap &nsLinkedMap, FTVHelp *ftv, bool rootOnly, bool addToIndex, ClassDef::CompoundType ct)
Definition index.cpp:2036
void renderMemberIndicesAsJs(std::ostream &t, std::function< std::size_t(std::size_t)> numDocumented, std::function< Index::MemberIndexMap(std::size_t)> getMemberList, const T *(*getInfo)(size_t hl), std::size_t total)
Definition index.cpp:5679
static void writeAnnotatedExceptionIndex(OutputList &ol)
Definition index.cpp:2699
static void writeHierarchicalInterfaceIndex(OutputList &ol)
Definition index.cpp:1265
static void writeNamespaceMembers(const NamespaceDef *nd, bool addToIndex)
Definition index.cpp:1820
static void countRelatedPages(int &docPages, int &indexPages)
Definition index.cpp:3952
static void writeUserGroupStubPage(OutputList &ol, LayoutNavEntry *lne)
Definition index.cpp:4858
static int countGroups()
Definition index.cpp:4084
static void writeNamespaceMemberIndexFiltered(OutputList &ol, NamespaceMemberHighlight::Enum hl)
Definition index.cpp:3553
static void writeNamespaceTreeElement(const NamespaceDef *nd, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:1877
static bool mainPageHasOwnTitle()
Definition index.cpp:3970
static void writeTopicIndex(OutputList &ol)
Definition index.cpp:4436
static void writeClassTree(const ListType &cl, FTVHelp *ftv, bool addToIndex, bool globalOnly, ClassDef::CompoundType ct)
Definition index.cpp:1756
static void writeModuleMemberIndex(OutputList &ol)
Definition index.cpp:3862
static void writeConceptRootList(FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4735
static int countDirs()
Definition index.cpp:4100
static const FmhlInfo * getFmhlInfo(size_t hl)
Definition index.cpp:3343
constexpr auto alphaSepar
Definition index.cpp:58
static void writeGraphicalExceptionHierarchy(OutputList &ol)
Definition index.cpp:1449
bool isId1(int c)
Definition index.cpp:2251
static void writeFileLinkForMember(OutputList &ol, const MemberDef *md, const QCString &separator, QCString &prevFileName)
Definition index.cpp:2725
static const MmhlInfo * getMmhlInfo(size_t hl)
Definition index.cpp:3714
static void writePages(PageDef *pd, FTVHelp *ftv)
Definition index.cpp:3981
static void countFiles(int &htmlFiles, int &files)
Definition index.cpp:1475
static void writeClassHierarchy(OutputList &ol, FTVHelp *ftv, bool addToIndex, ClassDef::CompoundType ct)
Definition index.cpp:1097
static void writeSingleFileIndex(OutputList &ol, const FileDef *fd)
Definition index.cpp:1497
static void writeNamespaceLinkForMember(OutputList &ol, const MemberDef *md, const QCString &separator, QCString &prevNamespaceName)
Definition index.cpp:2738
static void writeExampleIndex(OutputList &ol)
Definition index.cpp:3887
static int countClassesInTreeList(const ClassLinkedMap &cl, ClassDef::CompoundType ct)
Definition index.cpp:1124
static void writeAlphabeticalInterfaceIndex(OutputList &ol)
Definition index.cpp:2470
static void endQuickIndexItem(OutputList &ol)
Definition index.cpp:379
static void writeMemberIndex(OutputList &ol, const Index::MemberIndexMap &map, QCString fullName, bool multiPage)
Definition index.cpp:3106
static void writeAnnotatedIndexGeneric(OutputList &ol, const AnnotatedIndexContext ctx)
Definition index.cpp:2582
static const NmhlInfo * getNmhlInfo(size_t hl)
Definition index.cpp:3529
const ClassDef * get_pointer(const Ptr &p)
static int countAnnotatedClasses(int *cp, ClassDef::CompoundType ct)
Definition index.cpp:2155
static void writeAlphabeticalStructIndex(OutputList &ol)
Definition index.cpp:2499
static void writeGroupHierarchy(OutputList &ol, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4412
static void writeModuleMembers(const ModuleDef *mod, bool addToIndex)
Definition index.cpp:1846
static void writeConceptTreeInsideNamespaceElement(const NamespaceDef *nd, FTVHelp *ftv, bool rootOnly, bool addToIndex)
Definition index.cpp:4684
void startFile(OutputList &ol, const QCString &name, bool isSource, const QCString &manName, const QCString &title, HighlightedItem hli, bool additionalIndices, const QCString &altSidebarName, int hierarchyLevel, const QCString &allMembersFile)
Definition index.cpp:403
static const CmhlInfo * getCmhlInfo(size_t hl)
Definition index.cpp:3151
static void writeDirHierarchy(OutputList &ol, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:924
std::set< std::string > UsedIndexLetters
Definition index.cpp:2282
static void writeConceptList(const ConceptLinkedRefMap &concepts, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4651
static void writeClassLinkForMember(OutputList &ol, const MemberDef *md, const QCString &separator, QCString &prevClassName)
Definition index.cpp:2712
void writeIndexHierarchy(OutputList &ol)
Definition index.cpp:5830
static void writeModuleList(OutputList &ol, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4559
static bool dirHasVisibleChildren(const DirDef *dd)
Definition index.cpp:738
static int countNamespaces()
Definition index.cpp:1728
static void endIndexHierarchy(OutputList &ol, int level)
Definition index.cpp:325
const int maxItemsBeforeQuickIndex
Definition index.cpp:343
static QCString letterToLabel(const QCString &startLetter)
Definition index.cpp:2256
static void writeQuickMemberIndex(OutputList &ol, const Index::MemberIndexMap &map, const std::string &page, QCString fullName, bool multiPage)
Definition index.cpp:3079
void endFileWithNavPath(OutputList &ol, const DefinitionMutable *d, bool showPageNavigation)
Definition index.cpp:450
static void writeConceptIndex(OutputList &ol)
Definition index.cpp:4757
static void writeModuleLinkForMember(OutputList &ol, const MemberDef *md, const QCString &separator, QCString &prevModuleName)
Definition index.cpp:2751
static void writeModuleIndex(OutputList &ol)
Definition index.cpp:4583
static void MemberIndexMap_add(Index::MemberIndexMap &map, const std::string &letter, const MemberDef *md)
Definition index.cpp:182
static void writeIndex(OutputList &ol)
Definition index.cpp:4895
static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:766
static void startIndexHierarchy(OutputList &ol, int level)
Definition index.cpp:309
static bool quickLinkVisible(LayoutNavEntry::Kind kind)
Definition index.cpp:5631
static void writeModuleTreeNode(OutputList &ol, const ModuleDef *mod, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4505
static void writeHierarchicalExceptionIndex(OutputList &ol)
Definition index.cpp:1370
static void writeNamespaceMemberIndex(OutputList &ol)
Definition index.cpp:3678
static void writeHierarchicalIndex(OutputList &ol)
Definition index.cpp:1158
static void writeMenuData()
Definition index.cpp:5814
static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FTVHelp *ftv, bool addToIndex)
Definition index.cpp:4166
static void writeMemberToIndex(const Definition *def, const MemberDef *md, bool addToIndex)
Definition index.cpp:470
static void writeMemberList(OutputList &ol, bool useSections, const std::string &page, const Index::MemberIndexMap &memberIndexMap, Definition::DefType type)
Definition index.cpp:2766
static void writeFileMemberIndex(OutputList &ol)
Definition index.cpp:3494
static void writeClassTreeForList(OutputList &ol, const ClassLinkedMap &cl, bool &started, FTVHelp *ftv, bool addToIndex, ClassDef::CompoundType ct, ClassDefSet &visitedClasses)
Definition index.cpp:988
static void writeModuleMemberIndexFiltered(OutputList &ol, ModuleMemberHighlight::Enum hl)
Definition index.cpp:3730
static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct, int)
Definition index.cpp:2285
static void startQuickIndexList(OutputList &ol, bool letterTabs=FALSE)
Definition index.cpp:347
HighlightedItem
Definition index.h:59
@ AnnotatedExceptions
Definition index.h:76
@ InterfaceHierarchy
Definition index.h:66
@ AnnotatedInterfaces
Definition index.h:74
@ NamespaceMembers
Definition index.h:78
@ AnnotatedClasses
Definition index.h:73
@ AnnotatedStructs
Definition index.h:75
@ ExceptionHierarchy
Definition index.h:67
@ isMainPage
Definition index.h:35
@ isTitlePageAuthor
Definition index.h:34
@ isFileIndex
Definition index.h:43
@ isFileDocumentation
Definition index.h:51
@ isPageDocumentation
Definition index.h:53
@ isDirDocumentation
Definition index.h:47
@ isModuleDocumentation
Definition index.h:45
@ isClassHierarchyIndex
Definition index.h:41
@ isModuleIndex
Definition index.h:36
@ isTopicIndex
Definition index.h:37
@ isConceptIndex
Definition index.h:40
@ isExampleDocumentation
Definition index.h:52
@ isClassDocumentation
Definition index.h:49
@ isCompoundIndex
Definition index.h:42
@ isEndIndex
Definition index.h:55
@ isConceptDocumentation
Definition index.h:50
@ isDirIndex
Definition index.h:38
@ isNamespaceIndex
Definition index.h:39
@ isNamespaceDocumentation
Definition index.h:48
@ isTitlePageStart
Definition index.h:33
@ isTopicDocumentation
Definition index.h:46
Translator * theTranslator
Definition language.cpp:71
std::vector< std::unique_ptr< LayoutNavEntry > > LayoutNavEntryList
Definition layout.h:152
#define warn(file, line, fmt,...)
Definition message.h:97
#define msg(fmt,...)
Definition message.h:94
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:648
bool namespaceHasNestedNamespace(const NamespaceDef *nd)
bool namespaceHasNestedClass(const NamespaceDef *nd, bool filterClasses, ClassDef::CompoundType ct)
NamespaceDef * getResolvedNamespace(const QCString &name)
bool namespaceHasNestedConcept(const NamespaceDef *nd)
Portable versions of functions that are platform dependent.
int qstricmp(const char *s1, const char *s2)
Definition qcstring.cpp:530
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:571
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
uint32_t qstrlen(const char *str)
Returns the length of string str, or 0 if a null pointer is passed.
Definition qcstring.h:58
#define ASSERT(x)
Definition qcstring.h:39
const LayoutNavEntry::Kind fallbackKind
Definition index.cpp:2574
AnnotatedIndexContext(int numAnno, int numPrint, LayoutNavEntry::Kind lk, LayoutNavEntry::Kind fk, const QCString &title, const QCString &intro, ClassDef::CompoundType ct, const QCString &fn, HighlightedItem hi)
Definition index.cpp:2559
const ClassDef::CompoundType compoundType
Definition index.cpp:2577
const HighlightedItem hiItem
Definition index.cpp:2579
const QCString fileBaseName
Definition index.cpp:2578
const LayoutNavEntry::Kind listKind
Definition index.cpp:2573
const QCString listDefaultTitleText
Definition index.cpp:2575
const int numAnnotated
Definition index.cpp:2571
const QCString listDefaultIntroText
Definition index.cpp:2576
Helper class representing a class member in the navigation menu.
Definition index.cpp:3145
CmhlInfo(const char *fn, const QCString &t)
Definition index.cpp:3146
QCString title
Definition index.cpp:3148
const char * fname
Definition index.cpp:3147
Helper class representing a file member in the navigation menu.
Definition index.cpp:3337
FmhlInfo(const char *fn, const QCString &t)
Definition index.cpp:3338
const char * fname
Definition index.cpp:3339
QCString title
Definition index.cpp:3340
std::array< MemberIndexMap, ModuleMemberHighlight::Total > moduleIndexLetterUsed
Definition index.cpp:99
int annotatedExceptions
Definition index.cpp:81
std::array< MemberIndexMap, ClassMemberHighlight::Total > classIndexLetterUsed
Definition index.cpp:96
int documentedModules
Definition index.cpp:87
int annotatedExceptionsPrinted
Definition index.cpp:82
int documentedPages
Definition index.cpp:90
int documentedConcepts
Definition index.cpp:86
int annotatedStructs
Definition index.cpp:79
int annotatedInterfaces
Definition index.cpp:76
int hierarchyInterfaces
Definition index.cpp:78
int annotatedStructsPrinted
Definition index.cpp:80
std::array< int, FileMemberHighlight::Total > documentedFileMembers
Definition index.cpp:93
int documentedDirs
Definition index.cpp:91
std::array< MemberIndexMap, FileMemberHighlight::Total > fileIndexLetterUsed
Definition index.cpp:97
int indexedPages
Definition index.cpp:88
std::array< int, ModuleMemberHighlight::Total > documentedModuleMembers
Definition index.cpp:95
int annotatedClasses
Definition index.cpp:73
int annotatedInterfacesPrinted
Definition index.cpp:77
int hierarchyExceptions
Definition index.cpp:83
int documentedFiles
Definition index.cpp:89
int documentedNamespaces
Definition index.cpp:85
std::array< int, NamespaceMemberHighlight::Total > documentedNamespaceMembers
Definition index.cpp:94
int documentedGroups
Definition index.cpp:84
std::array< int, ClassMemberHighlight::Total > documentedClassMembers
Definition index.cpp:92
std::array< MemberIndexMap, NamespaceMemberHighlight::Total > namespaceIndexLetterUsed
Definition index.cpp:98
int annotatedClassesPrinted
Definition index.cpp:74
int hierarchyClasses
Definition index.cpp:75
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:112
MemberListType type
Definition layout.h:118
Represents of a member definition list with configurable title.
Definition layout.h:132
MemberListType type
Definition layout.h:137
Base class for the layout of a navigation item at the top of the HTML pages.
Definition layout.h:156
QCString title() const
Definition layout.h:216
QCString url() const
Definition layout.cpp:151
const LayoutNavEntryList & children() const
Definition layout.h:219
QCString intro() const
Definition layout.h:217
QCString baseFile() const
Definition layout.h:214
LayoutNavEntry * find(LayoutNavEntry::Kind k, const QCString &file=QCString()) const
Definition layout.cpp:133
Kind kind() const
Definition layout.h:213
bool visible() const
Definition layout.h:222
Kind
Definition layout.h:193
Helper class representing a module member in the navigation menu.
Definition index.cpp:3708
MmhlInfo(const char *fn, const QCString &t)
Definition index.cpp:3709
QCString title
Definition index.cpp:3711
const char * fname
Definition index.cpp:3710
Helper class representing a namespace member in the navigation menu.
Definition index.cpp:3523
const char * fname
Definition index.cpp:3525
QCString title
Definition index.cpp:3526
NmhlInfo(const char *fn, const QCString &t)
Definition index.cpp:3524
SrcLangExt
Definition types.h:207
std::string convertUTF8ToUpper(const std::string &input)
Converts the input string into a upper case version, also taking into account non-ASCII characters th...
Definition utf8.cpp:192
std::string convertUTF8ToLower(const std::string &input)
Converts the input string into a lower case version, also taking into account non-ASCII characters th...
Definition utf8.cpp:187
std::string getUTF8CharAt(const std::string &input, size_t pos)
Returns the UTF8 character found at byte position pos in the input string.
Definition utf8.cpp:127
Various UTF8 related helper functions.
QCString convertToJSString(const QCString &s, bool keepEntities, bool singleQuotes)
Definition util.cpp:4022
bool mainPageHasTitle()
Definition util.cpp:6302
QCString parseCommentAsHtml(const Definition *scope, const MemberDef *member, const QCString &doc, const QCString &fileName, int lineNr)
Definition util.cpp:5423
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:3962
QCString parseCommentAsText(const Definition *scope, const MemberDef *md, const QCString &doc, const QCString &fileName, int lineNr)
Definition util.cpp:5367
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:5943
QCString filterTitle(const QCString &title)
Definition util.cpp:5628
bool fileVisibleInIndex(const FileDef *fd, bool &genSourceFile)
Definition util.cpp:6107
bool isURL(const QCString &url)
Checks whether the given url starts with a supported protocol.
Definition util.cpp:5931
static QCString stripFromPath(const QCString &p, const StringVector &l)
Definition util.cpp:298
void extractNamespaceName(const QCString &scopeName, QCString &className, QCString &namespaceName, bool allowEmptyClass)
Definition util.cpp:3696
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang.
Definition util.cpp:5915
QCString getDotImageExtension()
Definition util.cpp:6307
int getPrefixIndex(const QCString &name)
Definition util.cpp:3230
QCString convertToId(const QCString &s)
Definition util.cpp:3871
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:4920
A bunch of utility functions.
QCString fixSpaces(const QCString &s)
Definition util.h:522