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