1 /******************************************************************************
5 * Copyright (C) 1997-2015 by Dimitri van Heesch.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
19 * @brief This file contains functions for the various index pages.
25 #include <qtextstream.h>
26 #include <qdatetime.h>
35 #include "outputlist.h"
45 #include "vhdldocgen.h"
47 #include "memberlist.h"
48 #include "classlist.h"
49 #include "namespacedef.h"
52 #define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX 200
53 #define MAX_ITEMS_BEFORE_QUICK_INDEX 30
57 int annotatedClassesPrinted;
59 int annotatedInterfaces;
60 int annotatedInterfacesPrinted;
61 int hierarchyInterfaces;
63 int annotatedStructsPrinted;
64 int annotatedExceptions;
65 int annotatedExceptionsPrinted;
66 int hierarchyExceptions;
69 int documentedNamespaces;
71 int documentedClassMembers[CMHL_Total];
72 int documentedFileMembers[FMHL_Total];
73 int documentedNamespaceMembers[NMHL_Total];
74 int documentedHtmlFiles;
78 static int countClassHierarchy(ClassDef::CompoundType ct);
79 static void countFiles(int &htmlFiles,int &files);
80 static int countGroups();
81 static int countDirs();
82 static int countNamespaces();
83 static int countAnnotatedClasses(int *cp,ClassDef::CompoundType ct);
84 static void countRelatedPages(int &docPages,int &indexPages);
86 void countDataStructures()
88 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
89 annotatedClasses = countAnnotatedClasses(&annotatedClassesPrinted, ClassDef::Class); // "classes" + "annotated"
90 hierarchyClasses = countClassHierarchy(ClassDef::Class); // "hierarchy"
91 // "interfaces" + "annotated"
92 annotatedInterfaces = sliceOpt ? countAnnotatedClasses(&annotatedInterfacesPrinted, ClassDef::Interface) : 0;
93 // "interfacehierarchy"
94 hierarchyInterfaces = sliceOpt ? countClassHierarchy(ClassDef::Interface) : 0;
95 // "structs" + "annotated"
96 annotatedStructs = sliceOpt ? countAnnotatedClasses(&annotatedStructsPrinted, ClassDef::Struct) : 0;
97 // "exceptions" + "annotated"
98 annotatedExceptions = sliceOpt ? countAnnotatedClasses(&annotatedExceptionsPrinted, ClassDef::Exception) : 0;
99 // "exceptionhierarchy"
100 hierarchyExceptions = sliceOpt ? countClassHierarchy(ClassDef::Exception) : 0;
101 countFiles(documentedHtmlFiles,documentedFiles); // "files"
102 countRelatedPages(documentedPages,indexedPages); // "pages"
103 documentedGroups = countGroups(); // "modules"
104 documentedNamespaces = countNamespaces(); // "namespaces"
105 documentedDirs = countDirs(); // "dirs"
107 // "namespacemembers"
111 static void startIndexHierarchy(OutputList &ol,int level)
113 ol.pushGeneratorState();
114 ol.disable(OutputGenerator::Man);
115 ol.disable(OutputGenerator::Html);
116 if (level<6) ol.startIndexList();
117 ol.popGeneratorState();
119 ol.pushGeneratorState();
120 ol.disable(OutputGenerator::Latex);
121 ol.disable(OutputGenerator::RTF);
122 ol.disable(OutputGenerator::Docbook);
124 ol.popGeneratorState();
127 static void endIndexHierarchy(OutputList &ol,int level)
129 ol.pushGeneratorState();
130 ol.disable(OutputGenerator::Man);
131 ol.disable(OutputGenerator::Html);
132 if (level<6) ol.endIndexList();
133 ol.popGeneratorState();
135 ol.pushGeneratorState();
136 ol.disable(OutputGenerator::Latex);
137 ol.disable(OutputGenerator::Docbook);
138 ol.disable(OutputGenerator::RTF);
140 ol.popGeneratorState();
143 //----------------------------------------------------------------------------
145 class MemberIndexList : public QList<MemberDef>
148 typedef MemberDef ElementType;
149 MemberIndexList(uint letter) : QList<MemberDef>(), m_letter(letter) {}
150 ~MemberIndexList() {}
151 int compareValues(const MemberDef *md1, const MemberDef *md2) const
153 int result = qstricmp(md1->name(),md2->name());
156 result = qstricmp(md1->qualifiedName(),md2->qualifiedName());
160 uint letter() const { return m_letter; }
165 static LetterToIndexMap<MemberIndexList> g_memberIndexLetterUsed[CMHL_Total];
166 static LetterToIndexMap<MemberIndexList> g_fileIndexLetterUsed[FMHL_Total];
167 static LetterToIndexMap<MemberIndexList> g_namespaceIndexLetterUsed[NMHL_Total];
169 const int maxItemsBeforeQuickIndex = MAX_ITEMS_BEFORE_QUICK_INDEX;
171 //----------------------------------------------------------------------------
173 //----------------------------------------------------------------------------
175 static void startQuickIndexList(OutputList &ol,bool letterTabs=FALSE)
177 bool fancyTabs = TRUE;
182 ol.writeString(" <div id=\"navrow4\" class=\"tabs3\">\n");
186 ol.writeString(" <div id=\"navrow3\" class=\"tabs2\">\n");
188 ol.writeString(" <ul class=\"tablist\">\n");
192 ol.writeString(" <div class=\"qindex\">");
196 static void endQuickIndexList(OutputList &ol)
198 bool fancyTabs = TRUE;
201 ol.writeString(" </ul>\n");
203 ol.writeString(" </div>\n");
206 static void startQuickIndexItem(OutputList &ol,const char *l,
207 bool hl,bool compact,bool &first)
209 bool fancyTabs = TRUE;
210 if (!first && compact && !fancyTabs) ol.writeString(" | ");
214 ol.writeString(" <li");
215 if (hl) ol.writeString(" class=\"current\"");
216 ol.writeString("><a ");
220 if (!compact) ol.writeString("<li>");
223 ol.writeString("<a class=\"qindexHL\" ");
227 ol.writeString("<a class=\"qindex\" ");
230 ol.writeString("href=\"");
232 ol.writeString("\">");
235 ol.writeString("<span>");
239 static void endQuickIndexItem(OutputList &ol)
242 if (fancyTabs) ol.writeString("</span>");
243 ol.writeString("</a>");
244 if (fancyTabs) ol.writeString("</li>\n");
247 // don't make this static as it is called from a template function and some
248 // old compilers don't support calls to static functions from a template.
249 QCString fixSpaces(const QCString &s)
251 return substitute(s," "," ");
254 void startTitle(OutputList &ol,const char *fileName,Definition *def)
256 ol.startHeaderSection();
257 if (def) def->writeSummaryLinks(ol);
258 ol.startTitleHead(fileName);
259 ol.pushGeneratorState();
260 ol.disable(OutputGenerator::Man);
263 void endTitle(OutputList &ol,const char *fileName,const char *name)
265 ol.popGeneratorState();
266 ol.endTitleHead(fileName,name);
267 ol.endHeaderSection();
270 void startFile(OutputList &ol,const char *name,const char *manName,
271 const char *title,HighlightedItem hli,bool additionalIndices,
272 const char *altSidebarName)
274 static bool disableIndex = Config_getBool(DISABLE_INDEX);
275 ol.startFile(name,manName,title);
276 ol.startQuickIndices();
279 ol.writeQuickLinks(TRUE,hli,name);
281 if (!additionalIndices)
283 ol.endQuickIndices();
285 ol.writeSplitBar(altSidebarName ? altSidebarName : name);
286 ol.writeSearchInfo();
287 resetDotNodeNumbering();
290 void endFile(OutputList &ol,bool skipNavIndex,bool skipEndContents,
291 const QCString &navPath)
293 static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
294 ol.pushGeneratorState();
295 ol.disableAllBut(OutputGenerator::Html);
298 if (!skipEndContents) ol.endContents();
299 if (generateTreeView)
301 ol.writeString("</div><!-- doc-content -->\n");
304 ol.writeFooter(navPath); // write the footer
305 ol.popGeneratorState();
309 void endFileWithNavPath(Definition *d,OutputList &ol)
311 static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
313 if (generateTreeView)
315 ol.pushGeneratorState();
316 ol.disableAllBut(OutputGenerator::Html);
317 ol.writeString("</div><!-- doc-content -->\n");
318 ol.popGeneratorState();
319 navPath = d->navigationPathAsString();
321 endFile(ol,generateTreeView,TRUE,navPath);
324 //----------------------------------------------------------------------
326 void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
327 const QCString &name,const QCString &anchor,
328 bool addToIndex=TRUE,bool preventSeparateIndex=FALSE)
330 bool hasMembers = def->getMemberLists().count()>0 || def->getMemberGroupSDict()!=0;
331 Doxygen::indexList->addContentsItem(hasMembers,name,
332 def->getReference(),def->getOutputFileBase(),anchor,
333 hasMembers && !preventSeparateIndex,
337 ClassSDict *classes = def->getClassSDict();
341 ClassSDict::Iterator it(*classes);
342 for (;(cd=it.current());++it)
344 if (cd->isLinkable()) numClasses++;
347 //printf("addMembersToIndex(def=%s hasMembers=%d numClasses=%d)\n",def->name().data(),hasMembers,numClasses);
348 if (hasMembers || numClasses>0)
350 Doxygen::indexList->incContentsDepth();
351 QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(part));
353 for (eli.toFirst();(lde=eli.current());++eli)
355 if (lde->kind()==LayoutDocEntry::MemberDef)
357 LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
358 MemberList *ml = def->getMemberList(lmd->type);
361 MemberListIterator mi(*ml);
363 for (mi.toFirst();(md=mi.current());++mi)
365 MemberList *enumList = md->enumFieldList();
366 bool isDir = enumList!=0 && md->isEnumerate();
367 bool isAnonymous = md->name().find('@')!=-1;
368 static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
369 static bool extractStatic = Config_getBool(EXTRACT_STATIC);
371 (!hideUndocMembers || md->hasDocumentation()) &&
372 (!md->isStatic() || extractStatic)
375 if (md->getOuterScope()==def || md->getOuterScope()==Doxygen::globalScope)
377 Doxygen::indexList->addContentsItem(isDir,
378 md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
380 else // inherited member
382 Doxygen::indexList->addContentsItem(isDir,
383 md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
390 Doxygen::indexList->incContentsDepth();
392 MemberListIterator emli(*enumList);
394 for (emli.toFirst();(emd=emli.current());++emli)
396 if (!hideUndocMembers || emd->hasDocumentation())
398 if (emd->getOuterScope()==def || emd->getOuterScope()==Doxygen::globalScope)
400 Doxygen::indexList->addContentsItem(FALSE,
401 emd->name(),emd->getReference(),emd->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
403 else // inherited member
405 Doxygen::indexList->addContentsItem(FALSE,
406 emd->name(),def->getReference(),def->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
412 Doxygen::indexList->decContentsDepth();
418 else if (lde->kind()==LayoutDocEntry::NamespaceClasses ||
419 lde->kind()==LayoutDocEntry::FileClasses ||
420 lde->kind()==LayoutDocEntry::ClassNestedClasses
426 ClassSDict::Iterator it(*classes);
427 for (;(cd=it.current());++it)
429 if (cd->isLinkable() && (cd->partOfGroups()==0 || def->definitionType()==Definition::TypeGroup))
431 static bool inlineSimpleStructs = Config_getBool(INLINE_SIMPLE_STRUCTS);
432 bool isNestedClass = def->definitionType()==Definition::TypeClass;
433 addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(FALSE),cd->anchor(),
434 addToIndex && (isNestedClass || (cd->isSimple() && inlineSimpleStructs)),
435 preventSeparateIndex || cd->isEmbeddedInOuterScope());
442 Doxygen::indexList->decContentsDepth();
447 //----------------------------------------------------------------------------
448 /*! Generates HTML Help tree of classes */
450 static void writeClassTree(OutputList &ol,const BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex)
453 BaseClassListIterator bcli(*bcl);
455 for ( ; bcli.current() ; ++bcli)
457 ClassDef *cd=bcli.current()->classDef;
458 if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
464 if (cd->getLanguage()==SrcLangExt_VHDL)
466 b=hasVisibleRoot(cd->subClasses());
470 b=hasVisibleRoot(cd->baseClasses());
473 if (cd->isVisibleInHierarchy() && b) // hasVisibleRoot(cd->baseClasses()))
477 startIndexHierarchy(ol,level);
480 Doxygen::indexList->incContentsDepth();
484 ftv->incContentsDepth();
488 ol.startIndexListItem();
489 //printf("Passed...\n");
490 bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd);
491 //printf("tree4: Has children %s: %d\n",cd->name().data(),hasChildren);
492 if (cd->isLinkable())
494 //printf("Writing class %s\n",cd->displayName().data());
495 ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
496 ol.parseText(cd->displayName());
497 ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
498 if (cd->isReference())
500 ol.startTypewriter();
501 ol.docify(" [external]");
506 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor());
510 if (cd->getLanguage()==SrcLangExt_VHDL)
512 ftv->addContentsItem(hasChildren,bcli.current()->usedName,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
516 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
522 ol.startIndexItem(0,0);
523 ol.parseText(cd->name());
524 ol.endIndexItem(0,0);
527 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),0,0,0);
531 ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE,cd);
536 //printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited);
537 bool wasVisited=cd->visited;
539 if (cd->getLanguage()==SrcLangExt_VHDL)
541 writeClassTree(ol,cd->baseClasses(),wasVisited,level+1,ftv,addToIndex);
545 writeClassTree(ol,cd->subClasses(),wasVisited,level+1,ftv,addToIndex);
548 ol.endIndexListItem();
553 endIndexHierarchy(ol,level);
556 Doxygen::indexList->decContentsDepth();
560 ftv->decContentsDepth();
565 //----------------------------------------------------------------------------
567 static bool dirHasVisibleChildren(DirDef *dd)
569 if (dd->hasDocumentation()) return TRUE;
571 QListIterator<FileDef> fli(*dd->getFiles());
573 for (fli.toFirst();(fd=fli.current());++fli)
576 if (fileVisibleInIndex(fd,genSourceFile))
586 QListIterator<DirDef> dli(dd->subDirs());
588 for (dli.toFirst();(subdd=dli.current());++dli)
590 if (dirHasVisibleChildren(subdd))
598 //----------------------------------------------------------------------------
599 static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv,bool addToIndex)
603 warn(dd->getDefFileName(),dd->getDefLine(),
604 "maximum nesting level exceeded for directory %s: "
605 "check for possible recursive directory relation!\n",dd->name().data()
610 if (!dirHasVisibleChildren(dd))
615 static bool tocExpand = TRUE; //Config_getBool(TOC_EXPAND);
616 bool isDir = dd->subDirs().count()>0 || // there are subdirs
617 (tocExpand && // or toc expand and
618 dd->getFiles() && dd->getFiles()->count()>0 // there are files
620 //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
623 Doxygen::indexList->addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0,TRUE,TRUE);
624 Doxygen::indexList->incContentsDepth();
628 ftv->addContentsItem(isDir,dd->shortName(),dd->getReference(),
629 dd->getOutputFileBase(),0,FALSE,TRUE,dd);
630 ftv->incContentsDepth();
633 ol.startIndexListItem();
634 ol.startIndexItem(dd->getReference(),dd->getOutputFileBase());
635 ol.parseText(dd->shortName());
636 ol.endIndexItem(dd->getReference(),dd->getOutputFileBase());
637 if (dd->isReference())
639 ol.startTypewriter();
640 ol.docify(" [external]");
644 // write sub directories
645 if (dd->subDirs().count()>0)
647 startIndexHierarchy(ol,level+1);
648 QListIterator<DirDef> dli(dd->subDirs());
650 for (dli.toFirst();(subdd=dli.current());++dli)
652 writeDirTreeNode(ol,subdd,level+1,ftv,addToIndex);
654 endIndexHierarchy(ol,level+1);
657 FileList *fileList=dd->getFiles();
659 if (fileList && fileList->count()>0)
661 QListIterator<FileDef> it(*fileList);
663 for (;(fd=it.current());++it)
665 //static bool allExternals = Config_getBool(ALLEXTERNALS);
666 //if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
671 if (fileVisibleInIndex(fd,genSourceFile))
675 else if (genSourceFile)
682 startIndexHierarchy(ol,level+1);
683 for (it.toFirst();(fd=it.current());++it)
686 doc = fileVisibleInIndex(fd,src);
691 reference = fd->getReference();
692 outputBase = fd->getOutputFileBase();
696 ol.startIndexListItem();
697 ol.startIndexItem(reference,outputBase);
698 ol.parseText(fd->displayName());
699 ol.endIndexItem(reference,outputBase);
700 ol.endIndexListItem();
701 if (ftv && (src || doc))
703 ftv->addContentsItem(FALSE,
705 reference,outputBase,
710 endIndexHierarchy(ol,level+1);
714 if (tocExpand && addToIndex)
716 // write files of this directory
719 QListIterator<FileDef> it(*fileList);
721 for (;(fd=it.current());++it)
723 //static bool allExternals = Config_getBool(ALLEXTERNALS);
724 //if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
726 doc = fileVisibleInIndex(fd,src);
729 addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString(),TRUE);
733 Doxygen::indexList->addContentsItem(
734 FALSE, convertToHtml(fd->name(),TRUE), 0,
735 fd->getSourceFileBase(), 0, FALSE, TRUE, fd);
740 ol.endIndexListItem();
744 Doxygen::indexList->decContentsDepth();
748 ftv->decContentsDepth();
752 static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
756 ol.pushGeneratorState();
757 ol.disable(OutputGenerator::Html);
759 static bool fullPathNames = Config_getBool(FULL_PATH_NAMES);
760 startIndexHierarchy(ol,0);
763 SDict<DirDef>::Iterator dli(*Doxygen::directories);
765 for (dli.toFirst();(dd=dli.current());++dli)
767 if (dd->getOuterScope()==Doxygen::globalScope)
769 writeDirTreeNode(ol,dd,0,ftv,addToIndex);
775 FileNameListIterator fnli(*Doxygen::inputNameList);
777 for (fnli.toFirst();(fn=fnli.current());++fnli)
779 FileNameIterator fni(*fn);
781 for (;(fd=fni.current());++fni)
783 static bool fullPathNames = Config_getBool(FULL_PATH_NAMES);
784 if (!fullPathNames || fd->getDirDef()==0) // top level file
787 doc = fileVisibleInIndex(fd,src);
788 QCString reference, outputBase;
791 reference = fd->getReference();
792 outputBase = fd->getOutputFileBase();
796 ftv->addContentsItem(FALSE,fd->displayName(),
797 reference, outputBase, 0,
804 addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString(),TRUE);
808 Doxygen::indexList->addContentsItem(
809 FALSE, convertToHtml(fd->name(),TRUE), 0,
810 fd->getSourceFileBase(), 0, FALSE, TRUE, fd);
817 endIndexHierarchy(ol,0);
820 ol.popGeneratorState();
825 //----------------------------------------------------------------------------
827 static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FTVHelp* ftv,bool addToIndex,
828 ClassDef::CompoundType ct)
830 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
831 ClassSDict::Iterator cli(*cl);
833 for (;(cd=cli.current());++cli)
835 //printf("class %s hasVisibleRoot=%d isVisibleInHierarchy=%d\n",
836 // cd->name().data(),
837 // hasVisibleRoot(cd->baseClasses()),
838 // cd->isVisibleInHierarchy()
841 if (cd->getLanguage()==SrcLangExt_VHDL)
843 if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
847 b=!hasVisibleRoot(cd->subClasses());
849 else if (sliceOpt && cd->compoundType() != ct)
855 b=!hasVisibleRoot(cd->baseClasses());
858 if (b) //filter on root classes
860 if (cd->isVisibleInHierarchy()) // should it be visible
864 startIndexHierarchy(ol,0);
867 Doxygen::indexList->incContentsDepth();
871 ol.startIndexListItem();
872 bool hasChildren = !cd->visited && classHasVisibleChildren(cd);
873 //printf("list: Has children %s: %d\n",cd->name().data(),hasChildren);
874 if (cd->isLinkable())
876 //printf("Writing class %s isLinkable()=%d isLinkableInProject()=%d cd->templateMaster()=%p\n",
877 // cd->displayName().data(),cd->isLinkable(),cd->isLinkableInProject(),cd->templateMaster());
878 ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
879 ol.parseText(cd->displayName());
880 ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
881 if (cd->isReference())
883 ol.startTypewriter();
884 ol.docify(" [external]");
889 if (cd->getLanguage()!=SrcLangExt_VHDL) // prevents double insertion in Design Unit List
890 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE);
894 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
899 ol.startIndexItem(0,0);
900 ol.parseText(cd->displayName());
901 ol.endIndexItem(0,0);
904 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE);
908 ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE,cd);
911 if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren)
913 writeClassTree(ol,cd->baseClasses(),cd->visited,1,ftv,addToIndex);
916 else if (hasChildren)
918 writeClassTree(ol,cd->subClasses(),cd->visited,1,ftv,addToIndex);
921 ol.endIndexListItem();
927 static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex,ClassDef::CompoundType ct)
929 initClassHierarchy(Doxygen::classSDict);
930 initClassHierarchy(Doxygen::hiddenClasses);
933 ol.pushGeneratorState();
934 ol.disable(OutputGenerator::Html);
937 writeClassTreeForList(ol,Doxygen::classSDict,started,ftv,addToIndex,ct);
938 writeClassTreeForList(ol,Doxygen::hiddenClasses,started,ftv,addToIndex,ct);
941 endIndexHierarchy(ol,0);
944 Doxygen::indexList->decContentsDepth();
949 ol.popGeneratorState();
953 //----------------------------------------------------------------------------
955 static int countClassesInTreeList(const ClassSDict &cl, ClassDef::CompoundType ct)
957 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
959 ClassSDict::Iterator cli(cl);
961 for (;(cd=cli.current());++cli)
963 if (sliceOpt && cd->compoundType() != ct)
967 if (!hasVisibleRoot(cd->baseClasses())) // filter on root classes
969 if (cd->isVisibleInHierarchy()) // should it be visible
971 if (cd->subClasses()) // should have sub classes
981 static int countClassHierarchy(ClassDef::CompoundType ct)
984 initClassHierarchy(Doxygen::classSDict);
985 initClassHierarchy(Doxygen::hiddenClasses);
986 count+=countClassesInTreeList(*Doxygen::classSDict, ct);
987 count+=countClassesInTreeList(*Doxygen::hiddenClasses, ct);
991 //----------------------------------------------------------------------------
993 static void writeHierarchicalIndex(OutputList &ol)
995 if (hierarchyClasses==0) return;
996 ol.pushGeneratorState();
998 ol.disable(OutputGenerator::Man);
999 ol.disable(OutputGenerator::Docbook);
1001 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
1002 QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
1003 bool addToIndex = lne==0 || lne->visible();
1005 startFile(ol,"hierarchy",0, title, HLI_ClassHierarchy);
1007 ol.parseText(title);
1010 ol.startTextBlock();
1012 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1014 ol.pushGeneratorState();
1015 ol.disable(OutputGenerator::Latex);
1016 ol.disable(OutputGenerator::RTF);
1017 ol.disable(OutputGenerator::Docbook);
1018 ol.startParagraph();
1019 ol.startTextLink("inherits",0);
1020 ol.parseText(theTranslator->trGotoGraphicalHierarchy());
1023 ol.popGeneratorState();
1025 ol.parseText(lne ? lne->intro() : theTranslator->trClassHierarchyDescription());
1029 // Static class hierarchy for Latex/RTF
1031 ol.pushGeneratorState();
1033 ol.disable(OutputGenerator::Html);
1034 Doxygen::indexList->disable();
1036 writeClassHierarchy(ol,0,addToIndex,ClassDef::Class);
1038 Doxygen::indexList->enable();
1039 ol.popGeneratorState();
1043 // Dynamic class hierarchical index for HTML
1045 ol.pushGeneratorState();
1047 ol.disableAllBut(OutputGenerator::Html);
1052 Doxygen::indexList->addContentsItem(TRUE,title,0,"hierarchy",0,TRUE,TRUE);
1054 FTVHelp* ftv = new FTVHelp(FALSE);
1055 writeClassHierarchy(ol,ftv,addToIndex,ClassDef::Class);
1057 FTextStream t(&outStr);
1058 ftv->generateTreeViewInline(t);
1059 ol.pushGeneratorState();
1060 ol.disableAllBut(OutputGenerator::Html);
1061 ol.writeString(outStr);
1062 ol.popGeneratorState();
1065 ol.popGeneratorState();
1070 ol.popGeneratorState();
1074 //----------------------------------------------------------------------------
1076 static void writeGraphicalClassHierarchy(OutputList &ol)
1078 if (hierarchyClasses==0) return;
1079 ol.disableAllBut(OutputGenerator::Html);
1080 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
1081 QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
1082 startFile(ol,"inherits",0,title,HLI_ClassHierarchy,FALSE,"hierarchy");
1084 ol.parseText(title);
1087 ol.startTextBlock();
1088 ol.startParagraph();
1089 ol.startTextLink("hierarchy",0);
1090 ol.parseText(theTranslator->trGotoTextualHierarchy());
1094 DotGfxHierarchyTable g;
1095 ol.writeGraphicalHierarchy(g);
1100 //----------------------------------------------------------------------------
1102 static void writeHierarchicalInterfaceIndex(OutputList &ol)
1104 if (hierarchyInterfaces==0) return;
1105 ol.pushGeneratorState();
1107 ol.disable(OutputGenerator::Man);
1109 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceHierarchy);
1110 QCString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
1111 bool addToIndex = lne==0 || lne->visible();
1113 startFile(ol,"interfacehierarchy",0, title, HLI_InterfaceHierarchy);
1115 ol.parseText(title);
1118 ol.startTextBlock();
1120 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1122 ol.disable(OutputGenerator::Latex);
1123 ol.disable(OutputGenerator::RTF);
1124 ol.startParagraph();
1125 ol.startTextLink("interfaceinherits",0);
1126 ol.parseText(theTranslator->trGotoGraphicalHierarchy());
1129 ol.enable(OutputGenerator::Latex);
1130 ol.enable(OutputGenerator::RTF);
1132 ol.parseText(lne ? lne->intro() : theTranslator->trInterfaceHierarchyDescription());
1136 // Static interface hierarchy for Latex/RTF
1138 ol.pushGeneratorState();
1140 ol.disable(OutputGenerator::Html);
1141 Doxygen::indexList->disable();
1143 writeClassHierarchy(ol,0,addToIndex,ClassDef::Interface);
1145 Doxygen::indexList->enable();
1146 ol.popGeneratorState();
1150 // Dynamic interface hierarchical index for HTML
1152 ol.pushGeneratorState();
1154 ol.disableAllBut(OutputGenerator::Html);
1159 Doxygen::indexList->addContentsItem(TRUE,title,0,"interfacehierarchy",0,TRUE,TRUE);
1161 FTVHelp* ftv = new FTVHelp(FALSE);
1162 writeClassHierarchy(ol,ftv,addToIndex,ClassDef::Interface);
1164 FTextStream t(&outStr);
1165 ftv->generateTreeViewInline(t);
1166 ol.pushGeneratorState();
1167 ol.disableAllBut(OutputGenerator::Html);
1168 ol.writeString(outStr);
1169 ol.popGeneratorState();
1172 ol.popGeneratorState();
1177 ol.popGeneratorState();
1181 //----------------------------------------------------------------------------
1183 static void writeGraphicalInterfaceHierarchy(OutputList &ol)
1185 if (hierarchyInterfaces==0) return;
1186 ol.disableAllBut(OutputGenerator::Html);
1187 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceHierarchy);
1188 QCString title = lne ? lne->title() : theTranslator->trInterfaceHierarchy();
1189 startFile(ol,"interfaceinherits",0,title,HLI_InterfaceHierarchy,FALSE,"interfacehierarchy");
1191 ol.parseText(title);
1194 ol.startTextBlock();
1195 ol.startParagraph();
1196 ol.startTextLink("interfacehierarchy",0);
1197 ol.parseText(theTranslator->trGotoTextualHierarchy());
1201 DotGfxHierarchyTable g("interface_",ClassDef::Interface);
1202 ol.writeGraphicalHierarchy(g);
1207 //----------------------------------------------------------------------------
1209 static void writeHierarchicalExceptionIndex(OutputList &ol)
1211 if (hierarchyExceptions==0) return;
1212 ol.pushGeneratorState();
1214 ol.disable(OutputGenerator::Man);
1216 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionHierarchy);
1217 QCString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
1218 bool addToIndex = lne==0 || lne->visible();
1220 startFile(ol,"exceptionhierarchy",0, title, HLI_ExceptionHierarchy);
1222 ol.parseText(title);
1225 ol.startTextBlock();
1227 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
1229 ol.disable(OutputGenerator::Latex);
1230 ol.disable(OutputGenerator::RTF);
1231 ol.startParagraph();
1232 ol.startTextLink("exceptioninherits",0);
1233 ol.parseText(theTranslator->trGotoGraphicalHierarchy());
1236 ol.enable(OutputGenerator::Latex);
1237 ol.enable(OutputGenerator::RTF);
1239 ol.parseText(lne ? lne->intro() : theTranslator->trExceptionHierarchyDescription());
1243 // Static exception hierarchy for Latex/RTF
1245 ol.pushGeneratorState();
1247 ol.disable(OutputGenerator::Html);
1248 Doxygen::indexList->disable();
1250 writeClassHierarchy(ol,0,addToIndex,ClassDef::Exception);
1252 Doxygen::indexList->enable();
1253 ol.popGeneratorState();
1257 // Dynamic exception hierarchical index for HTML
1259 ol.pushGeneratorState();
1261 ol.disableAllBut(OutputGenerator::Html);
1266 Doxygen::indexList->addContentsItem(TRUE,title,0,"exceptionhierarchy",0,TRUE,TRUE);
1268 FTVHelp* ftv = new FTVHelp(FALSE);
1269 writeClassHierarchy(ol,ftv,addToIndex,ClassDef::Exception);
1271 FTextStream t(&outStr);
1272 ftv->generateTreeViewInline(t);
1273 ol.pushGeneratorState();
1274 ol.disableAllBut(OutputGenerator::Html);
1275 ol.writeString(outStr);
1276 ol.popGeneratorState();
1279 ol.popGeneratorState();
1284 ol.popGeneratorState();
1288 //----------------------------------------------------------------------------
1290 static void writeGraphicalExceptionHierarchy(OutputList &ol)
1292 if (hierarchyExceptions==0) return;
1293 ol.disableAllBut(OutputGenerator::Html);
1294 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionHierarchy);
1295 QCString title = lne ? lne->title() : theTranslator->trExceptionHierarchy();
1296 startFile(ol,"exceptioninherits",0,title,HLI_ExceptionHierarchy,FALSE,"exceptionhierarchy");
1298 ol.parseText(title);
1301 ol.startTextBlock();
1302 ol.startParagraph();
1303 ol.startTextLink("exceptionhierarchy",0);
1304 ol.parseText(theTranslator->trGotoTextualHierarchy());
1308 DotGfxHierarchyTable g("exception_",ClassDef::Exception);
1309 ol.writeGraphicalHierarchy(g);
1314 //----------------------------------------------------------------------------
1316 static void countFiles(int &htmlFiles,int &files)
1320 FileNameListIterator fnli(*Doxygen::inputNameList);
1322 for (;(fn=fnli.current());++fnli)
1324 FileNameIterator fni(*fn);
1326 for (;(fd=fni.current());++fni)
1329 doc = fileVisibleInIndex(fd,src);
1342 static void writeSingleFileIndex(OutputList &ol,FileDef *fd)
1344 //printf("Found filedef %s\n",fd->name().data());
1345 bool doc = fd->isLinkableInProject();
1346 bool src = fd->generateSourceFile();
1347 bool nameOk = !fd->isDocumentationFile();
1348 if (nameOk && (doc || src) && !fd->isReference())
1351 if (Config_getBool(FULL_PATH_NAMES))
1353 path=stripFromPath(fd->getPath().copy());
1355 QCString fullName=fd->name();
1356 if (!path.isEmpty())
1358 if (path.at(path.length()-1)!='/') fullName.prepend("/");
1359 fullName.prepend(path);
1366 ol.writeObjectLink(0,fd->getOutputFileBase(),0,fd->name());
1369 // addMembersToIndex(fd,LayoutDocManager::File,fullName,QCString());
1375 ol.docify(fd->name());
1379 // Doxygen::indexList->addContentsItem(FALSE,fullName,0,0,0);
1384 ol.pushGeneratorState();
1385 ol.disableAllBut(OutputGenerator::Html);
1387 ol.startTextLink(fd->includeName(),0);
1389 ol.parseText(theTranslator->trCode());
1392 ol.popGeneratorState();
1395 bool hasBrief = !fd->briefDescription().isEmpty();
1396 ol.startIndexValue(hasBrief);
1401 fd->briefFile(),fd->briefLine(),
1403 fd->briefDescription(TRUE),
1404 FALSE, // index words
1407 TRUE, // single line
1408 TRUE // link from index
1412 ol.endIndexValue(fd->getOutputFileBase(),hasBrief);
1413 //ol.popGeneratorState();
1414 // --------------------------------------------------------
1418 //----------------------------------------------------------------------------
1420 static void writeFileIndex(OutputList &ol)
1422 if (documentedHtmlFiles==0) return;
1424 ol.pushGeneratorState();
1425 ol.disable(OutputGenerator::Man);
1426 ol.disable(OutputGenerator::Docbook);
1427 if (documentedFiles==0) ol.disableAllBut(OutputGenerator::Html);
1429 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileList);
1430 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files); // fall back
1431 QCString title = lne ? lne->title() : theTranslator->trFileList();
1432 bool addToIndex = lne==0 || lne->visible();
1434 startFile(ol,"files",0,title,HLI_Files);
1436 //if (!Config_getString(PROJECT_NAME).isEmpty())
1438 // title.prepend(Config_getString(PROJECT_NAME)+" ");
1440 ol.parseText(title);
1443 ol.startTextBlock();
1447 Doxygen::indexList->addContentsItem(TRUE,title,0,"files",0,TRUE,TRUE);
1448 Doxygen::indexList->incContentsDepth();
1451 ol.parseText(lne ? lne->intro() : theTranslator->trFileListDescription(Config_getBool(EXTRACT_ALL)));
1459 ol.pushGeneratorState();
1460 ol.disable(OutputGenerator::Html);
1462 OutputNameDict outputNameDict(1009);
1463 OutputNameList outputNameList;
1464 outputNameList.setAutoDelete(TRUE);
1466 if (Config_getBool(FULL_PATH_NAMES))
1468 // re-sort input files in (dir,file) output order instead of (file,dir) input order
1469 FileNameListIterator fnli(*Doxygen::inputNameList);
1471 for (fnli.toFirst();(fn=fnli.current());++fnli)
1473 FileNameIterator fni(*fn);
1475 for (;(fd=fni.current());++fni)
1477 QCString path=fd->getPath();
1478 if (path.isEmpty()) path="[external]";
1479 FileList *fl = outputNameDict.find(path);
1483 //printf("+ inserting %s---%s\n",fd->getPath().data(),fd->name().data());
1487 //printf("o inserting %s---%s\n",fd->getPath().data(),fd->name().data());
1488 fl = new FileList(path);
1490 outputNameList.append(fl);
1491 outputNameDict.insert(path,fl);
1497 ol.startIndexList();
1498 if (Config_getBool(FULL_PATH_NAMES))
1500 outputNameList.sort();
1501 QListIterator<FileList> fnli(outputNameList);
1503 for (fnli.toFirst();(fl=fnli.current());++fnli)
1506 QListIterator<FileDef> it(*fl);
1508 for (;(fd=it.current());++it)
1510 writeSingleFileIndex(ol,fd);
1516 FileNameListIterator fnli(*Doxygen::inputNameList);
1518 for (fnli.toFirst();(fn=fnli.current());++fnli)
1520 FileNameIterator fni(*fn);
1522 for (;(fd=fni.current());++fni)
1524 writeSingleFileIndex(ol,fd);
1531 ol.popGeneratorState();
1534 // Hierarchical file index for HTML
1536 ol.pushGeneratorState();
1537 ol.disableAllBut(OutputGenerator::Html);
1539 FTVHelp* ftv = new FTVHelp(FALSE);
1540 writeDirHierarchy(ol,ftv,addToIndex);
1542 FTextStream t(&outStr);
1543 ftv->generateTreeViewInline(t);
1544 ol.writeString(outStr);
1547 ol.popGeneratorState();
1552 Doxygen::indexList->decContentsDepth();
1556 ol.popGeneratorState();
1559 //----------------------------------------------------------------------------
1560 static int countNamespaces()
1563 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
1565 for (;(nd=nli.current());++nli)
1567 if (nd->isLinkableInProject()) count++;
1572 //----------------------------------------------------------------------------
1574 void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalOnly,ClassDef::CompoundType ct)
1576 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1579 ClassSDict::Iterator cli(*clDict);
1581 for (;(cd=cli.current());++cli)
1583 if (cd->getLanguage()==SrcLangExt_VHDL)
1585 if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS ||
1586 (VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS
1591 if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ARCHITECTURECLASS)
1593 QCString n=cd->name();
1594 cd->setClassName(n.data());
1598 if (sliceOpt && cd->compoundType() != ct)
1604 cd->getOuterScope()==0 ||
1605 cd->getOuterScope()==Doxygen::globalScope
1609 if (cd->getClassSDict())
1611 ClassSDict::Iterator ccit(*cd->getClassSDict());
1613 for (;(ccd=ccit.current());++ccit)
1615 if (ccd->isLinkableInProject() && ccd->templateMaster()==0)
1621 if (classVisibleInIndex(cd) && cd->templateMaster()==0)
1623 ftv->addContentsItem(count>0,cd->displayName(FALSE),cd->getReference(),
1624 cd->getOutputFileBase(),cd->anchor(),FALSE,TRUE,cd);
1626 /*cd->partOfGroups()==0 &&*/
1627 (cd->getOuterScope()==0 ||
1628 cd->getOuterScope()->definitionType()!=Definition::TypeClass
1632 addMembersToIndex(cd,LayoutDocManager::Class,
1633 cd->displayName(FALSE),
1635 cd->partOfGroups()==0 && !cd->isSimple());
1639 ftv->incContentsDepth();
1640 writeClassTree(cd->getClassSDict(),ftv,addToIndex,FALSE,ct);
1641 ftv->decContentsDepth();
1649 static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv,
1650 bool rootOnly,bool showClasses,bool addToIndex,ClassDef::CompoundType ct)
1652 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1655 NamespaceSDict::Iterator nli(*nsDict);
1657 for (nli.toFirst();(nd=nli.current());++nli)
1659 if (nd->localName().find('@')==-1 &&
1660 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
1663 bool hasChildren = namespaceHasVisibleChild(nd,showClasses,sliceOpt,ct);
1664 bool isLinkable = nd->isLinkableInProject();
1670 ref = nd->getReference();
1671 file = nd->getOutputFileBase();
1672 if (nd->getLanguage()==SrcLangExt_VHDL) // UGLY HACK
1674 file=file.replace(0,qstrlen("namespace"),"class");
1678 if ((isLinkable && !showClasses) || hasChildren)
1680 ftv->addContentsItem(hasChildren,nd->localName(),ref,file,0,FALSE,TRUE,nd);
1684 Doxygen::indexList->addContentsItem(hasChildren,nd->localName(),ref,file,QCString(),
1685 hasChildren && !file.isEmpty(),addToIndex);
1688 //printf("*** writeNamespaceTree count=%d addToIndex=%d showClasses=%d classCount=%d\n",
1689 // count,addToIndex,showClasses,classCount);
1692 if (addToIndex) Doxygen::indexList->incContentsDepth();
1693 ftv->incContentsDepth();
1694 writeNamespaceTree(nd->getNamespaceSDict(),ftv,FALSE,showClasses,addToIndex,ct);
1697 ClassSDict *d = nd->getClassSDict();
1700 if (ct == ClassDef::Interface)
1702 d = nd->getInterfaceSDict();
1704 else if (ct == ClassDef::Struct)
1706 d = nd->getStructSDict();
1708 else if (ct == ClassDef::Exception)
1710 d = nd->getExceptionSDict();
1713 writeClassTree(d,ftv,addToIndex,FALSE,ct);
1715 ftv->decContentsDepth();
1716 if (addToIndex) Doxygen::indexList->decContentsDepth();
1725 static void writeNamespaceIndex(OutputList &ol)
1727 if (documentedNamespaces==0) return;
1728 ol.pushGeneratorState();
1729 ol.disable(OutputGenerator::Man);
1730 ol.disable(OutputGenerator::Docbook);
1731 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceList);
1732 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces); // fall back
1733 QCString title = lne ? lne->title() : theTranslator->trNamespaceList();
1734 bool addToIndex = lne==0 || lne->visible();
1735 startFile(ol,"namespaces",0,title,HLI_Namespaces);
1737 ol.parseText(title);
1740 ol.startTextBlock();
1741 ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceListDescription(Config_getBool(EXTRACT_ALL)));
1747 // Linear namespace index for Latex/RTF
1749 ol.pushGeneratorState();
1750 ol.disable(OutputGenerator::Html);
1752 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
1754 for (nli.toFirst();(nd=nli.current());++nli)
1756 if (nd->isLinkableInProject())
1760 ol.startIndexList();
1763 //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
1765 if (nd->getLanguage()==SrcLangExt_VHDL)
1767 ol.writeObjectLink(0, nd->getOutputFileBase().replace(0,qstrlen("namespace"),"class"),0,nd->displayName());
1771 ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->displayName());
1775 bool hasBrief = !nd->briefDescription().isEmpty();
1776 ol.startIndexValue(hasBrief);
1781 nd->briefFile(),nd->briefLine(),
1783 nd->briefDescription(TRUE),
1784 FALSE, // index words
1787 TRUE, // single line
1788 TRUE // link from index
1792 ol.endIndexValue(nd->getOutputFileBase(),hasBrief);
1796 if (!first) ol.endIndexList();
1798 ol.popGeneratorState();
1801 // Hierarchical namespace index for HTML
1803 ol.pushGeneratorState();
1804 ol.disableAllBut(OutputGenerator::Html);
1809 Doxygen::indexList->addContentsItem(TRUE,title,0,"namespaces",0,TRUE,TRUE);
1810 Doxygen::indexList->incContentsDepth();
1812 FTVHelp* ftv = new FTVHelp(FALSE);
1813 writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,FALSE,addToIndex,ClassDef::Class);
1815 FTextStream t(&outStr);
1816 ftv->generateTreeViewInline(t);
1817 ol.writeString(outStr);
1821 Doxygen::indexList->decContentsDepth();
1825 ol.popGeneratorState();
1829 ol.popGeneratorState();
1832 //----------------------------------------------------------------------------
1834 static int countAnnotatedClasses(int *cp, ClassDef::CompoundType ct)
1836 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1839 ClassSDict::Iterator cli(*Doxygen::classSDict);
1841 for (;(cd=cli.current());++cli)
1843 if (sliceOpt && cd->compoundType() != ct)
1847 if (cd->isLinkableInProject() && cd->templateMaster()==0)
1849 if (!cd->isEmbeddedInOuterScope())
1861 static void writeAnnotatedClassList(OutputList &ol,ClassDef::CompoundType ct)
1863 //LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
1864 //bool addToIndex = lne==0 || lne->visible();
1867 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
1869 ClassSDict::Iterator cli(*Doxygen::classSDict);
1872 for (cli.toFirst();(cd=cli.current());++cli)
1874 if (cd->getLanguage()==SrcLangExt_VHDL &&
1875 ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS ||
1876 (VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS)
1877 ) // no architecture
1883 ol.startIndexList();
1887 if (sliceOpt && cd->compoundType() != ct)
1892 ol.pushGeneratorState();
1893 if (cd->isEmbeddedInOuterScope())
1895 ol.disable(OutputGenerator::Latex);
1896 ol.disable(OutputGenerator::Docbook);
1897 ol.disable(OutputGenerator::RTF);
1899 if (cd->isLinkableInProject() && cd->templateMaster()==0)
1902 if (cd->getLanguage()==SrcLangExt_VHDL)
1904 QCString prot= VhdlDocGen::getProtectionName((VhdlDocGen::VhdlClasses)cd->protection());
1905 ol.docify(prot.data());
1906 ol.writeString(" ");
1908 ol.writeObjectLink(0,cd->getOutputFileBase(),cd->anchor(),cd->displayName());
1910 bool hasBrief = !cd->briefDescription().isEmpty();
1911 ol.startIndexValue(hasBrief);
1915 cd->briefFile(),cd->briefLine(),
1917 cd->briefDescription(TRUE),
1918 FALSE, // indexWords
1921 TRUE, // single line
1922 TRUE // link from index
1925 ol.endIndexValue(cd->getOutputFileBase(),hasBrief);
1929 // addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(),cd->anchor());
1932 ol.popGeneratorState();
1934 if (!first) ol.endIndexList();
1937 inline bool isId1(int c)
1939 return (c<127 && c>31); // printable ASCII character
1942 static QCString letterToLabel(uint startLetter)
1944 char s[11]; // max 0x12345678 + '\0'
1945 if (isId1(startLetter)) // printable ASCII character
1947 s[0]=(char)startLetter;
1952 const char hex[]="0123456789abcdef";
1956 if (startLetter>(1<<24)) // 4 byte character
1958 s[i++]=hex[(startLetter>>28)&0xf];
1959 s[i++]=hex[(startLetter>>24)&0xf];
1961 if (startLetter>(1<<16)) // 3 byte character
1963 s[i++]=hex[(startLetter>>20)&0xf];
1964 s[i++]=hex[(startLetter>>16)&0xf];
1966 if (startLetter>(1<<8)) // 2 byte character
1968 s[i++]=hex[(startLetter>>12)&0xf];
1969 s[i++]=hex[(startLetter>>8)&0xf];
1971 // one byte character
1972 s[i++]=hex[(startLetter>>4)&0xf];
1973 s[i++]=hex[(startLetter>>0)&0xf];
1979 //----------------------------------------------------------------------------
1981 /** Special class list where sorting takes IGNORE_PREFIX into account. */
1982 class PrefixIgnoreClassList : public ClassList
1985 typedef ClassDef ElementType;
1986 PrefixIgnoreClassList(uint letter) : m_letter(letter) {}
1987 uint letter() const { return m_letter; }
1989 virtual int compareValue(const ClassDef *c1, const ClassDef *c2) const
1991 QCString n1 = c1->className();
1992 QCString n2 = c2->className();
1993 return qstricmp (n1.data()+getPrefixIndex(n1), n2.data()+getPrefixIndex(n2));
1998 /** Class representing a cell in the alphabetical class index. */
1999 class AlphaIndexTableCell
2002 AlphaIndexTableCell(int row,int col,uint letter,ClassDef *cd) :
2003 m_letter(letter), m_class(cd), m_row(row), m_col(col)
2004 { //printf("AlphaIndexTableCell(%d,%d,%c,%s)\n",row,col,letter!=0 ? letter: '-',
2005 // cd!=(ClassDef*)0x8 ? cd->name().data() : "<null>");
2008 ClassDef *classDef() const { return m_class; }
2009 uint letter() const { return m_letter; }
2010 int row() const { return m_row; }
2011 int column() const { return m_col; }
2020 /** Class representing a row in the alphabetical class index. */
2021 class AlphaIndexTableRows : public QList<AlphaIndexTableCell>
2024 AlphaIndexTableRows() { setAutoDelete(TRUE); }
2027 /** Iterator for the cells in a row of the alphabetical class index. */
2028 class AlphaIndexTableRowsIterator : public QListIterator<AlphaIndexTableCell>
2031 AlphaIndexTableRowsIterator(const AlphaIndexTableRows &list) :
2032 QListIterator<AlphaIndexTableCell>(list) {}
2035 /** Class representing the columns in the alphabetical class index. */
2036 class AlphaIndexTableColumns : public QList<AlphaIndexTableRows>
2039 AlphaIndexTableColumns() { setAutoDelete(TRUE); }
2042 class UsedIndexLetters : public SIntDict<uint>
2045 UsedIndexLetters() : SIntDict<uint>(257) { setAutoDelete(TRUE); }
2046 void add(uint letter)
2048 uint *v = find(letter);
2051 append(letter,new uint(letter));
2055 int compareValues( const uint *p1, const uint *p2) const
2057 return (int)*p1 - (int)*p2; // subtracting is done by int not uint.
2061 // write an alphabetical index of all class with a header for each letter
2062 static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct, int annotatedCount)
2064 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
2066 // What starting letters are used
2067 UsedIndexLetters indexLettersUsed;
2069 // first count the number of headers
2070 ClassSDict::Iterator cli(*Doxygen::classSDict);
2074 for (;(cd=cli.current());++cli)
2076 if (sliceOpt && cd->compoundType() != ct)
2078 if (cd->isLinkableInProject() && cd->templateMaster()==0)
2080 if (cd->getLanguage()==SrcLangExt_VHDL && !((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS ))// no architecture
2083 int index = getPrefixIndex(cd->className());
2084 //printf("name=%s index=%d %d\n",cd->className().data(),index,cd->protection());
2085 startLetter=getUtf8CodeToLower(cd->className(),index);
2086 indexLettersUsed.add(startLetter);
2089 indexLettersUsed.sort();
2091 // write quick link index (row of letters)
2092 QCString alphaLinks = "<div class=\"qindex\">";
2093 SIntDict<uint>::Iterator it(indexLettersUsed);
2095 for (it.toFirst();(pLetter=it.current());++it)
2097 if (headerItems) alphaLinks += " | ";
2099 QCString li = letterToLabel(*pLetter);
2100 QCString ls = QString(QChar(*pLetter)).utf8();
2101 alphaLinks += (QCString)"<a class=\"qindex\" href=\"#letter_" +
2105 alphaLinks += "</div>\n";
2106 ol.writeString(alphaLinks);
2109 // the number of columns in the table
2110 const int columns = Config_getInt(COLS_IN_ALPHA_INDEX);
2113 int totalItems = headerItems*2 + annotatedCount; // number of items in the table (headers span 2 items)
2114 int rows = (totalItems + columns - 1)/columns; // number of rows in the table
2116 //printf("headerItems=%d totalItems=%d columns=%d rows=%d itemsInLastRow=%d\n",
2117 // headerItems,totalItems,columns,rows,itemsInLastRow);
2119 // Keep a list of classes for each starting letter
2120 LetterToIndexMap<PrefixIgnoreClassList> classesByLetter;
2121 AlphaIndexTableColumns tableColumns;
2123 // fill the columns with the class list (row elements in each column,
2124 // expect for the columns with number >= itemsInLastRow, which get one
2128 for (cli.toFirst();(cd=cli.current());++cli)
2130 if (sliceOpt && cd->compoundType() != ct)
2132 if (cd->getLanguage()==SrcLangExt_VHDL && !((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS ))// no architecture
2135 if (cd->isLinkableInProject() && cd->templateMaster()==0)
2137 int index = getPrefixIndex(cd->className());
2138 startLetter=getUtf8CodeToLower(cd->className(),index);
2139 // Do some sorting again, since the classes are sorted by name with
2140 // prefix, which should be ignored really.
2141 if (cd->getLanguage()==SrcLangExt_VHDL)
2143 if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS )// no architecture
2145 classesByLetter.append(startLetter,cd);
2150 classesByLetter.append(startLetter,cd);
2155 #define NEXT_ROW() \
2158 if (row>maxRows) maxRows=row; \
2159 if (row>=rows && col<columns) \
2163 tableRows = new AlphaIndexTableRows; \
2164 tableColumns.append(tableRows); \
2169 AlphaIndexTableRows *tableRows = new AlphaIndexTableRows;
2170 tableColumns.append(tableRows);
2171 int col=0,row=0,maxRows=0;
2172 PrefixIgnoreClassList *cl;
2173 SIntDict<PrefixIgnoreClassList>::Iterator lit(classesByLetter);
2174 for (lit.toFirst();(cl=lit.current());++lit)
2176 uint l = cl->letter();
2177 // add special header cell
2178 tableRows->append(new AlphaIndexTableCell(row,col,l,(ClassDef*)0x8));
2180 tableRows->append(new AlphaIndexTableCell(row,col,0,(ClassDef*)0x8));
2182 ClassListIterator cit(*cl);
2184 ClassDef *cd = cit.current();
2186 tableRows->append(new AlphaIndexTableCell(row,col,0,cd));
2189 for (;(cd=cit.current()); ++cit)
2192 tableRows->append(new AlphaIndexTableCell(row,col,0,cd));
2198 // create row iterators for each column
2199 AlphaIndexTableRowsIterator **colIterators = new AlphaIndexTableRowsIterator*[columns];
2200 for (i=0;i<columns;i++)
2202 if (i<(int)tableColumns.count())
2204 colIterators[i] = new AlphaIndexTableRowsIterator(*tableColumns.at(i));
2206 else // empty column
2208 colIterators[i] = 0;
2212 ol.writeString("<table class=\"classindex\">\n");
2214 for (i=0;i<=maxRows;i++) // foreach table row
2216 //printf("writing row %d\n",i);
2217 //ol.nextTableRow();
2218 ol.writeString("<tr>");
2219 // the last column may contain less items then the others
2220 //int colsInRow = (i<rows-1) ? columns : itemsInLastRow;
2221 //printf("row [%d]\n",i);
2222 for (j=0;j<columns;j++) // foreach table column
2224 if (colIterators[j])
2226 AlphaIndexTableCell *cell = colIterators[j]->current();
2231 if (cell->letter()!=0)
2233 QCString s = letterToLabel(cell->letter());
2234 ol.writeString("<td rowspan=\"2\" valign=\"bottom\">");
2235 ol.writeString("<a name=\"letter_");
2237 ol.writeString("\"></a>");
2238 ol.writeString("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
2240 "<td><div class=\"ah\">  ");
2241 ol.writeString(QString(QChar(cell->letter())).utf8());
2242 ol.writeString( "  </div>"
2247 else if (cell->classDef()!=(ClassDef*)0x8)
2249 cd = cell->classDef();
2250 ol.writeString("<td valign=\"top\">");
2251 QCString namesp,cname;
2252 //if (cd->getNamespaceDef()) namesp=cd->getNamespaceDef()->displayName();
2253 //QCString cname=cd->className();
2254 extractNamespaceName(cd->name(),cname,namesp);
2255 QCString nsDispName;
2256 SrcLangExt lang = cd->getLanguage();
2257 QCString sep = getLanguageSpecificSeparator(lang);
2260 nsDispName=substitute(namesp,"::",sep);
2261 cname=substitute(cname,"::",sep);
2268 ol.writeObjectLink(cd->getReference(),
2269 cd->getOutputFileBase(),cd->anchor(),cname);
2270 if (!namesp.isEmpty())
2273 NamespaceDef *nd = getResolvedNamespace(namesp);
2274 if (nd && nd->isLinkable())
2276 ol.writeObjectLink(nd->getReference(),
2277 nd->getOutputFileBase(),0,nsDispName);
2281 ol.docify(nsDispName);
2285 ol.writeNonBreakableSpace(3);
2289 ol.writeString("<td>");
2291 ++(*colIterators[j]);
2292 ol.writeString("</td>");
2297 ol.writeString("<td></td>");
2301 ol.writeString("</tr>\n");
2303 ol.writeString("</table>\n");
2305 ol.writeString(alphaLinks);
2307 // release the temporary memory
2308 for (i=0;i<columns;i++)
2310 delete colIterators[i];
2312 delete[] colIterators;
2315 //----------------------------------------------------------------------------
2317 static void writeAlphabeticalIndex(OutputList &ol)
2319 if (annotatedClasses==0) return;
2320 ol.pushGeneratorState();
2321 ol.disableAllBut(OutputGenerator::Html);
2322 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassIndex);
2323 QCString title = lne ? lne->title() : theTranslator->trCompoundIndex();
2324 bool addToIndex = lne==0 || lne->visible();
2326 startFile(ol,"classes",0,title,HLI_Classes);
2329 ol.parseText(title);
2334 Doxygen::indexList->addContentsItem(FALSE,title,0,"classes",0,FALSE,TRUE);
2338 writeAlphabeticalClassList(ol, ClassDef::Class, annotatedClasses);
2339 endFile(ol); // contains ol.endContents()
2341 ol.popGeneratorState();
2344 //----------------------------------------------------------------------------
2346 static void writeAlphabeticalInterfaceIndex(OutputList &ol)
2348 if (annotatedInterfaces==0) return;
2349 ol.pushGeneratorState();
2350 ol.disableAllBut(OutputGenerator::Html);
2351 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceIndex);
2352 QCString title = lne ? lne->title() : theTranslator->trInterfaceIndex();
2353 bool addToIndex = lne==0 || lne->visible();
2355 startFile(ol,"interfaces",0,title,HLI_Interfaces);
2358 ol.parseText(title);
2363 Doxygen::indexList->addContentsItem(FALSE,title,0,"interfaces",0,FALSE,TRUE);
2367 writeAlphabeticalClassList(ol, ClassDef::Interface, annotatedInterfaces);
2368 endFile(ol); // contains ol.endContents()
2370 ol.popGeneratorState();
2373 //----------------------------------------------------------------------------
2375 static void writeAlphabeticalStructIndex(OutputList &ol)
2377 if (annotatedStructs==0) return;
2378 ol.pushGeneratorState();
2379 ol.disableAllBut(OutputGenerator::Html);
2380 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::StructIndex);
2381 QCString title = lne ? lne->title() : theTranslator->trStructIndex();
2382 bool addToIndex = lne==0 || lne->visible();
2384 startFile(ol,"structs",0,title,HLI_Structs);
2387 ol.parseText(title);
2392 Doxygen::indexList->addContentsItem(FALSE,title,0,"structs",0,FALSE,TRUE);
2396 writeAlphabeticalClassList(ol, ClassDef::Struct, annotatedStructs);
2397 endFile(ol); // contains ol.endContents()
2399 ol.popGeneratorState();
2402 //----------------------------------------------------------------------------
2404 static void writeAlphabeticalExceptionIndex(OutputList &ol)
2406 if (annotatedExceptions==0) return;
2407 ol.pushGeneratorState();
2408 ol.disableAllBut(OutputGenerator::Html);
2409 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionIndex);
2410 QCString title = lne ? lne->title() : theTranslator->trExceptionIndex();
2411 bool addToIndex = lne==0 || lne->visible();
2413 startFile(ol,"exceptions",0,title,HLI_Exceptions);
2416 ol.parseText(title);
2421 Doxygen::indexList->addContentsItem(FALSE,title,0,"exceptions",0,FALSE,TRUE);
2425 writeAlphabeticalClassList(ol, ClassDef::Exception, annotatedExceptions);
2426 endFile(ol); // contains ol.endContents()
2428 ol.popGeneratorState();
2431 //----------------------------------------------------------------------------
2433 static void writeAnnotatedIndex(OutputList &ol)
2435 //printf("writeAnnotatedIndex: count=%d printed=%d\n",
2436 // annotatedClasses,annotatedClassesPrinted);
2437 if (annotatedClasses==0) return;
2439 ol.pushGeneratorState();
2440 ol.disable(OutputGenerator::Man);
2441 if (annotatedClassesPrinted==0)
2443 ol.disable(OutputGenerator::Latex);
2444 ol.disable(OutputGenerator::RTF);
2446 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
2447 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes); // fall back
2448 QCString title = lne ? lne->title() : theTranslator->trCompoundList();
2449 bool addToIndex = lne==0 || lne->visible();
2452 startFile(ol,"annotated",0,title,HLI_AnnotatedClasses);
2455 ol.parseText(title);
2460 ol.startTextBlock();
2461 ol.parseText(lne ? lne->intro() : theTranslator->trCompoundListDescription());
2465 // Linear class index for Latex/RTF
2467 ol.pushGeneratorState();
2468 ol.disable(OutputGenerator::Html);
2469 Doxygen::indexList->disable();
2471 writeAnnotatedClassList(ol, ClassDef::Class);
2473 Doxygen::indexList->enable();
2474 ol.popGeneratorState();
2477 // Hierarchical class index for HTML
2479 ol.pushGeneratorState();
2480 ol.disableAllBut(OutputGenerator::Html);
2485 Doxygen::indexList->addContentsItem(TRUE,title,0,"annotated",0,TRUE,TRUE);
2486 Doxygen::indexList->incContentsDepth();
2488 FTVHelp* ftv = new FTVHelp(FALSE);
2489 writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Class);
2490 writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Class);
2492 FTextStream t(&outStr);
2493 ftv->generateTreeViewInline(t);
2494 ol.writeString(outStr);
2498 Doxygen::indexList->decContentsDepth();
2502 ol.popGeneratorState();
2505 endFile(ol); // contains ol.endContents()
2506 ol.popGeneratorState();
2509 //----------------------------------------------------------------------------
2511 static void writeAnnotatedInterfaceIndex(OutputList &ol)
2513 //printf("writeAnnotatedInterfaceIndex: count=%d printed=%d\n",
2514 // annotatedInterfaces,annotatedInterfacesPrinted);
2515 if (annotatedInterfaces==0) return;
2517 ol.pushGeneratorState();
2518 ol.disable(OutputGenerator::Man);
2519 if (annotatedInterfacesPrinted==0)
2521 ol.disable(OutputGenerator::Latex);
2522 ol.disable(OutputGenerator::RTF);
2524 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceList);
2525 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Interfaces); // fall back
2526 QCString title = lne ? lne->title() : theTranslator->trInterfaceList();
2527 bool addToIndex = lne==0 || lne->visible();
2529 startFile(ol,"annotatedinterfaces",0,title,HLI_AnnotatedInterfaces);
2532 ol.parseText(title);
2537 ol.startTextBlock();
2538 ol.parseText(lne ? lne->intro() : theTranslator->trInterfaceListDescription());
2542 // Linear interface index for Latex/RTF
2544 ol.pushGeneratorState();
2545 ol.disable(OutputGenerator::Html);
2546 Doxygen::indexList->disable();
2548 writeAnnotatedClassList(ol, ClassDef::Interface);
2550 Doxygen::indexList->enable();
2551 ol.popGeneratorState();
2554 // Hierarchical interface index for HTML
2556 ol.pushGeneratorState();
2557 ol.disableAllBut(OutputGenerator::Html);
2562 Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedinterfaces",0,TRUE,TRUE);
2563 Doxygen::indexList->incContentsDepth();
2565 FTVHelp* ftv = new FTVHelp(FALSE);
2566 writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Interface);
2567 writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Interface);
2569 FTextStream t(&outStr);
2570 ftv->generateTreeViewInline(t);
2571 ol.writeString(outStr);
2575 Doxygen::indexList->decContentsDepth();
2579 ol.popGeneratorState();
2582 endFile(ol); // contains ol.endContents()
2583 ol.popGeneratorState();
2586 //----------------------------------------------------------------------------
2588 static void writeAnnotatedStructIndex(OutputList &ol)
2590 //printf("writeAnnotatedStructIndex: count=%d printed=%d\n",
2591 // annotatedStructs,annotatedStructsPrinted);
2592 if (annotatedStructs==0) return;
2594 ol.pushGeneratorState();
2595 ol.disable(OutputGenerator::Man);
2596 if (annotatedStructsPrinted==0)
2598 ol.disable(OutputGenerator::Latex);
2599 ol.disable(OutputGenerator::RTF);
2601 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::StructList);
2602 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Structs); // fall back
2603 QCString title = lne ? lne->title() : theTranslator->trStructList();
2604 bool addToIndex = lne==0 || lne->visible();
2606 startFile(ol,"annotatedstructs",0,title,HLI_AnnotatedStructs);
2609 ol.parseText(title);
2614 ol.startTextBlock();
2615 ol.parseText(lne ? lne->intro() : theTranslator->trStructListDescription());
2619 // Linear struct index for Latex/RTF
2621 ol.pushGeneratorState();
2622 ol.disable(OutputGenerator::Html);
2623 Doxygen::indexList->disable();
2625 writeAnnotatedClassList(ol, ClassDef::Struct);
2627 Doxygen::indexList->enable();
2628 ol.popGeneratorState();
2631 // Hierarchical struct index for HTML
2633 ol.pushGeneratorState();
2634 ol.disableAllBut(OutputGenerator::Html);
2639 Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedstructs",0,TRUE,TRUE);
2640 Doxygen::indexList->incContentsDepth();
2642 FTVHelp* ftv = new FTVHelp(FALSE);
2643 writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Struct);
2644 writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Struct);
2646 FTextStream t(&outStr);
2647 ftv->generateTreeViewInline(t);
2648 ol.writeString(outStr);
2652 Doxygen::indexList->decContentsDepth();
2656 ol.popGeneratorState();
2659 endFile(ol); // contains ol.endContents()
2660 ol.popGeneratorState();
2663 //----------------------------------------------------------------------------
2665 static void writeAnnotatedExceptionIndex(OutputList &ol)
2667 //printf("writeAnnotatedExceptionIndex: count=%d printed=%d\n",
2668 // annotatedExceptions,annotatedExceptionsPrinted);
2669 if (annotatedExceptions==0) return;
2671 ol.pushGeneratorState();
2672 ol.disable(OutputGenerator::Man);
2673 if (annotatedExceptionsPrinted==0)
2675 ol.disable(OutputGenerator::Latex);
2676 ol.disable(OutputGenerator::RTF);
2678 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionList);
2679 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Exceptions); // fall back
2680 QCString title = lne ? lne->title() : theTranslator->trExceptionList();
2681 bool addToIndex = lne==0 || lne->visible();
2683 startFile(ol,"annotatedexceptions",0,title,HLI_AnnotatedExceptions);
2686 ol.parseText(title);
2691 ol.startTextBlock();
2692 ol.parseText(lne ? lne->intro() : theTranslator->trExceptionListDescription());
2696 // Linear interface index for Latex/RTF
2698 ol.pushGeneratorState();
2699 ol.disable(OutputGenerator::Html);
2700 Doxygen::indexList->disable();
2702 writeAnnotatedClassList(ol, ClassDef::Exception);
2704 Doxygen::indexList->enable();
2705 ol.popGeneratorState();
2708 // Hierarchical interface index for HTML
2710 ol.pushGeneratorState();
2711 ol.disableAllBut(OutputGenerator::Html);
2716 Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedexceptions",0,TRUE,TRUE);
2717 Doxygen::indexList->incContentsDepth();
2719 FTVHelp* ftv = new FTVHelp(FALSE);
2720 writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Exception);
2721 writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Exception);
2723 FTextStream t(&outStr);
2724 ftv->generateTreeViewInline(t);
2725 ol.writeString(outStr);
2729 Doxygen::indexList->decContentsDepth();
2733 ol.popGeneratorState();
2736 endFile(ol); // contains ol.endContents()
2737 ol.popGeneratorState();
2740 //----------------------------------------------------------------------------
2741 static void writeClassLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
2742 QCString &prevClassName)
2744 ClassDef *cd=md->getClassDef();
2745 if ( cd && prevClassName!=cd->displayName())
2747 ol.docify(separator);
2748 ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(),
2750 ol.writeString("\n");
2751 prevClassName = cd->displayName();
2755 static void writeFileLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
2756 QCString &prevFileName)
2758 FileDef *fd=md->getFileDef();
2759 if (fd && prevFileName!=fd->name())
2761 ol.docify(separator);
2762 ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(),
2764 ol.writeString("\n");
2765 prevFileName = fd->name();
2769 static void writeNamespaceLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
2770 QCString &prevNamespaceName)
2772 NamespaceDef *nd=md->getNamespaceDef();
2773 if (nd && prevNamespaceName!=nd->displayName())
2775 ol.docify(separator);
2776 ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(),
2778 ol.writeString("\n");
2779 prevNamespaceName = nd->displayName();
2783 static void writeMemberList(OutputList &ol,bool useSections,int page,
2784 const LetterToIndexMap<MemberIndexList> &memberLists,
2785 DefinitionIntf::DefType type)
2787 int index = (int)type;
2790 typedef void (*writeLinkForMember_t)(OutputList &ol,MemberDef *md,const char *separator,
2791 QCString &prevNamespaceName);
2793 // each index tab has its own write function
2794 static writeLinkForMember_t writeLinkForMemberMap[3] =
2796 &writeClassLinkForMember,
2797 &writeFileLinkForMember,
2798 &writeNamespaceLinkForMember
2801 QCString prevDefName;
2803 bool firstSection=TRUE;
2804 bool firstItem=TRUE;
2805 MemberIndexList *ml;
2806 SIntDict<MemberIndexList>::Iterator it(memberLists);
2807 for (it.toFirst();(ml=it.current());++it)
2811 ml = memberLists[page];
2814 if (ml==0 || ml->count()==0) continue;
2816 QListIterator<MemberDef> mli(*ml);
2818 for (mli.toFirst();(md=mli.current());++mli)
2821 bool isFunc=!md->isObjCMethod() &&
2822 (md->isFunction() || md->isSlot() || md->isSignal());
2823 QCString name=md->name();
2824 int startIndex = getPrefixIndex(name);
2825 if (QCString(name.data()+startIndex)!=prevName) // new entry
2827 if ((prevName.isEmpty() ||
2828 tolower(name.at(startIndex))!=tolower(prevName.at(0))) &&
2829 useSections) // new section
2831 if (!firstItem) ol.endItemListItem();
2832 if (!firstSection) ol.endItemList();
2833 QCString cs = letterToLabel(ml->letter());
2834 QCString cl = QString(QChar(ml->letter())).utf8();
2835 QCString anchor=(QCString)"index_"+convertToId(cs);
2836 QCString title=(QCString)"- "+cl+" -";
2837 ol.startSection(anchor,title,SectionInfo::Subsection);
2839 ol.endSection(anchor,SectionInfo::Subsection);
2844 else if (!useSections && first)
2851 if (!firstItem) ol.endItemListItem();
2852 ol.startItemListItem();
2855 if (isFunc) ol.docify("()");
2856 ol.writeString("\n");
2861 prevName = name.data()+startIndex;
2866 // link to class for other members with the same name
2870 // write the link for the specific list type
2871 writeLinkForMemberMap[index](ol,md,sep,prevDefName);
2875 if (!firstItem) ol.endItemListItem();
2879 //----------------------------------------------------------------------------
2881 void initClassMemberIndices()
2884 for (j=0;j<CMHL_Total;j++)
2886 documentedClassMembers[j]=0;
2887 g_memberIndexLetterUsed[j].clear();
2891 void addClassMemberNameToIndex(MemberDef *md)
2893 static bool hideFriendCompounds = Config_getBool(HIDE_FRIEND_COMPOUNDS);
2898 if (md->isLinkableInProject() &&
2899 (cd=md->getClassDef()) &&
2900 cd->isLinkableInProject() &&
2901 cd->templateMaster()==0)
2903 QCString n = md->name();
2904 int index = getPrefixIndex(n);
2905 uint letter = getUtf8CodeToLower(n,index);
2908 bool isFriendToHide = hideFriendCompounds &&
2909 (QCString(md->typeString())=="friend class" ||
2910 QCString(md->typeString())=="friend struct" ||
2911 QCString(md->typeString())=="friend union");
2912 if (!(md->isFriend() && isFriendToHide) &&
2913 (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2916 g_memberIndexLetterUsed[CMHL_All].append(letter,md);
2917 documentedClassMembers[CMHL_All]++;
2919 if (md->isFunction() || md->isSlot() || md->isSignal())
2921 g_memberIndexLetterUsed[CMHL_Functions].append(letter,md);
2922 documentedClassMembers[CMHL_Functions]++;
2924 else if (md->isVariable())
2926 g_memberIndexLetterUsed[CMHL_Variables].append(letter,md);
2927 documentedClassMembers[CMHL_Variables]++;
2929 else if (md->isTypedef())
2931 g_memberIndexLetterUsed[CMHL_Typedefs].append(letter,md);
2932 documentedClassMembers[CMHL_Typedefs]++;
2934 else if (md->isEnumerate())
2936 g_memberIndexLetterUsed[CMHL_Enums].append(letter,md);
2937 documentedClassMembers[CMHL_Enums]++;
2939 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2941 g_memberIndexLetterUsed[CMHL_EnumValues].append(letter,md);
2942 documentedClassMembers[CMHL_EnumValues]++;
2944 else if (md->isProperty())
2946 g_memberIndexLetterUsed[CMHL_Properties].append(letter,md);
2947 documentedClassMembers[CMHL_Properties]++;
2949 else if (md->isEvent())
2951 g_memberIndexLetterUsed[CMHL_Events].append(letter,md);
2952 documentedClassMembers[CMHL_Events]++;
2954 else if (md->isRelated() || md->isForeign() ||
2955 (md->isFriend() && !isFriendToHide))
2957 g_memberIndexLetterUsed[CMHL_Related].append(letter,md);
2958 documentedClassMembers[CMHL_Related]++;
2964 //----------------------------------------------------------------------------
2966 void initNamespaceMemberIndices()
2969 for (j=0;j<NMHL_Total;j++)
2971 documentedNamespaceMembers[j]=0;
2972 g_namespaceIndexLetterUsed[j].clear();
2976 void addNamespaceMemberNameToIndex(MemberDef *md)
2978 NamespaceDef *nd=md->getNamespaceDef();
2979 if (nd && nd->isLinkableInProject() && md->isLinkableInProject())
2981 QCString n = md->name();
2982 int index = getPrefixIndex(n);
2983 uint letter = getUtf8CodeToLower(n,index);
2986 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2988 g_namespaceIndexLetterUsed[NMHL_All].append(letter,md);
2989 documentedNamespaceMembers[NMHL_All]++;
2992 if (md->isFunction())
2994 g_namespaceIndexLetterUsed[NMHL_Functions].append(letter,md);
2995 documentedNamespaceMembers[NMHL_Functions]++;
2997 else if (md->isVariable())
2999 g_namespaceIndexLetterUsed[NMHL_Variables].append(letter,md);
3000 documentedNamespaceMembers[NMHL_Variables]++;
3002 else if (md->isTypedef())
3004 g_namespaceIndexLetterUsed[NMHL_Typedefs].append(letter,md);
3005 documentedNamespaceMembers[NMHL_Typedefs]++;
3007 else if (md->isSequence())
3009 g_namespaceIndexLetterUsed[NMHL_Sequences].append(letter,md);
3010 documentedNamespaceMembers[NMHL_Sequences]++;
3012 else if (md->isDictionary())
3014 g_namespaceIndexLetterUsed[NMHL_Dictionaries].append(letter,md);
3015 documentedNamespaceMembers[NMHL_Dictionaries]++;
3017 else if (md->isEnumerate())
3019 g_namespaceIndexLetterUsed[NMHL_Enums].append(letter,md);
3020 documentedNamespaceMembers[NMHL_Enums]++;
3022 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
3024 g_namespaceIndexLetterUsed[NMHL_EnumValues].append(letter,md);
3025 documentedNamespaceMembers[NMHL_EnumValues]++;
3031 //----------------------------------------------------------------------------
3033 void initFileMemberIndices()
3036 for (j=0;j<NMHL_Total;j++)
3038 documentedFileMembers[j]=0;
3039 g_fileIndexLetterUsed[j].clear();
3043 void addFileMemberNameToIndex(MemberDef *md)
3045 FileDef *fd=md->getFileDef();
3046 if (fd && fd->isLinkableInProject() && md->isLinkableInProject())
3048 QCString n = md->name();
3049 int index = getPrefixIndex(n);
3050 uint letter = getUtf8CodeToLower(n,index);
3053 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
3055 g_fileIndexLetterUsed[FMHL_All].append(letter,md);
3056 documentedFileMembers[FMHL_All]++;
3059 if (md->isFunction())
3061 g_fileIndexLetterUsed[FMHL_Functions].append(letter,md);
3062 documentedFileMembers[FMHL_Functions]++;
3064 else if (md->isVariable())
3066 g_fileIndexLetterUsed[FMHL_Variables].append(letter,md);
3067 documentedFileMembers[FMHL_Variables]++;
3069 else if (md->isTypedef())
3071 g_fileIndexLetterUsed[FMHL_Typedefs].append(letter,md);
3072 documentedFileMembers[FMHL_Typedefs]++;
3074 else if (md->isSequence())
3076 g_fileIndexLetterUsed[FMHL_Sequences].append(letter,md);
3077 documentedFileMembers[FMHL_Sequences]++;
3079 else if (md->isDictionary())
3081 g_fileIndexLetterUsed[FMHL_Dictionaries].append(letter,md);
3082 documentedFileMembers[FMHL_Dictionaries]++;
3084 else if (md->isEnumerate())
3086 g_fileIndexLetterUsed[FMHL_Enums].append(letter,md);
3087 documentedFileMembers[FMHL_Enums]++;
3089 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
3091 g_fileIndexLetterUsed[FMHL_EnumValues].append(letter,md);
3092 documentedFileMembers[FMHL_EnumValues]++;
3094 else if (md->isDefine())
3096 g_fileIndexLetterUsed[FMHL_Defines].append(letter,md);
3097 documentedFileMembers[FMHL_Defines]++;
3103 //----------------------------------------------------------------------------
3105 static void writeQuickMemberIndex(OutputList &ol,
3106 const LetterToIndexMap<MemberIndexList> &charUsed,uint page,
3107 QCString fullName,bool multiPage)
3110 startQuickIndexList(ol,TRUE);
3111 SIntDict<MemberIndexList>::Iterator it(charUsed);
3112 MemberIndexList *ml;
3113 for (it.toFirst();(ml=it.current());++it)
3115 uint i = ml->letter();
3116 QCString is = letterToLabel(i);
3117 QCString ci = QString(QChar(i)).utf8();
3119 QCString extension=Doxygen::htmlFileExtension;
3123 anchor=fullName+extension+"#index_";
3125 anchor=fullName+"_"+letterToLabel(i)+extension+"#index_";
3126 startQuickIndexItem(ol,anchor+convertToId(is),i==page,TRUE,first);
3128 endQuickIndexItem(ol);
3131 endQuickIndexList(ol);
3134 //----------------------------------------------------------------------------
3136 /** Helper class representing a class member in the navigation menu. */
3139 CmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
3144 static const CmhlInfo *getCmhlInfo(int hl)
3146 static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3147 static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3148 static CmhlInfo cmhlInfo[] =
3150 CmhlInfo("functions", theTranslator->trAll()),
3151 CmhlInfo("functions_func",
3152 fortranOpt ? theTranslator->trSubprograms() :
3153 vhdlOpt ? theTranslator->trFunctionAndProc() :
3154 theTranslator->trFunctions()),
3155 CmhlInfo("functions_vars",theTranslator->trVariables()),
3156 CmhlInfo("functions_type",theTranslator->trTypedefs()),
3157 CmhlInfo("functions_enum",theTranslator->trEnumerations()),
3158 CmhlInfo("functions_eval",theTranslator->trEnumerationValues()),
3159 CmhlInfo("functions_prop",theTranslator->trProperties()),
3160 CmhlInfo("functions_evnt",theTranslator->trEvents()),
3161 CmhlInfo("functions_rela",theTranslator->trRelatedFunctions())
3163 return &cmhlInfo[hl];
3166 static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight hl)
3168 if (documentedClassMembers[hl]==0) return;
3170 static bool disableIndex = Config_getBool(DISABLE_INDEX);
3172 bool multiPageIndex=FALSE;
3173 if (documentedClassMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3175 multiPageIndex=TRUE;
3178 ol.pushGeneratorState();
3179 ol.disableAllBut(OutputGenerator::Html);
3181 QCString extension=Doxygen::htmlFileExtension;
3182 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
3183 QCString title = lne ? lne->title() : theTranslator->trCompoundMembers();
3184 if (hl!=CMHL_All) title+=(QCString)" - "+getCmhlInfo(hl)->title;
3185 bool addToIndex = lne==0 || lne->visible();
3189 Doxygen::indexList->addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,0,
3190 getCmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
3191 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3195 SIntDict<MemberIndexList>::Iterator it(g_memberIndexLetterUsed[hl]);
3196 MemberIndexList *ml;
3197 for (it.toFirst();(ml=it.current());++it)
3199 uint page = ml->letter();
3200 QCString fileName = getCmhlInfo(hl)->fname;
3205 fileName+="_"+letterToLabel(page);
3207 QCString cs = QString(QChar(page)).utf8();
3210 Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
3213 bool quickIndex = documentedClassMembers[hl]>maxItemsBeforeQuickIndex;
3215 ol.startFile(fileName+extension,0,title);
3216 ol.startQuickIndices();
3219 ol.writeQuickLinks(TRUE,HLI_Functions,0);
3221 if (!Config_getBool(HTML_DYNAMIC_MENUS))
3223 startQuickIndexList(ol);
3225 // index item for global member list
3226 startQuickIndexItem(ol,
3227 getCmhlInfo(0)->fname+Doxygen::htmlFileExtension,hl==CMHL_All,TRUE,first);
3228 ol.writeString(fixSpaces(getCmhlInfo(0)->title));
3229 endQuickIndexItem(ol);
3232 // index items per category member lists
3233 for (i=1;i<CMHL_Total;i++)
3235 if (documentedClassMembers[i]>0)
3237 startQuickIndexItem(ol,getCmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
3238 ol.writeString(fixSpaces(getCmhlInfo(i)->title));
3239 //printf("multiPageIndex=%d first=%d fileName=%s file=%s title=%s\n",
3240 // multiPageIndex,first,fileName.data(),getCmhlInfo(i)->fname,getCmhlInfo(i)->title.data());
3241 endQuickIndexItem(ol);
3245 endQuickIndexList(ol);
3247 // quick alphabetical index
3250 writeQuickMemberIndex(ol,g_memberIndexLetterUsed[hl],page,
3251 getCmhlInfo(hl)->fname,multiPageIndex);
3255 ol.endQuickIndices();
3256 ol.writeSplitBar(fileName);
3257 ol.writeSearchInfo();
3263 ol.startTextBlock();
3264 ol.parseText(lne ? lne->intro() : theTranslator->trCompoundMembersDescription(Config_getBool(EXTRACT_ALL)));
3269 // hack to work around a mozilla bug, which refuses to switch to
3270 // normal lists otherwise
3271 ol.writeString(" ");
3274 writeMemberList(ol,quickIndex,
3275 multiPageIndex?page:-1,
3276 g_memberIndexLetterUsed[hl],
3277 Definition::TypeClass);
3282 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3284 ol.popGeneratorState();
3287 static void writeClassMemberIndex(OutputList &ol)
3289 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
3290 bool addToIndex = lne==0 || lne->visible();
3292 if (documentedClassMembers[CMHL_All]>0 && addToIndex)
3294 Doxygen::indexList->addContentsItem(TRUE,lne ? lne->title() : theTranslator->trCompoundMembers(),0,"functions",0);
3295 Doxygen::indexList->incContentsDepth();
3297 writeClassMemberIndexFiltered(ol,CMHL_All);
3298 writeClassMemberIndexFiltered(ol,CMHL_Functions);
3299 writeClassMemberIndexFiltered(ol,CMHL_Variables);
3300 writeClassMemberIndexFiltered(ol,CMHL_Typedefs);
3301 writeClassMemberIndexFiltered(ol,CMHL_Enums);
3302 writeClassMemberIndexFiltered(ol,CMHL_EnumValues);
3303 writeClassMemberIndexFiltered(ol,CMHL_Properties);
3304 writeClassMemberIndexFiltered(ol,CMHL_Events);
3305 writeClassMemberIndexFiltered(ol,CMHL_Related);
3306 if (documentedClassMembers[CMHL_All]>0 && addToIndex)
3308 Doxygen::indexList->decContentsDepth();
3313 //----------------------------------------------------------------------------
3315 /** Helper class representing a file member in the navigation menu. */
3318 FmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
3323 static const FmhlInfo *getFmhlInfo(int hl)
3325 static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3326 static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3327 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3328 static FmhlInfo fmhlInfo[] =
3330 FmhlInfo("globals", theTranslator->trAll()),
3331 FmhlInfo("globals_func",
3332 fortranOpt ? theTranslator->trSubprograms() :
3333 vhdlOpt ? theTranslator->trFunctionAndProc() :
3334 theTranslator->trFunctions()),
3335 FmhlInfo("globals_vars",sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables()),
3336 FmhlInfo("globals_type",theTranslator->trTypedefs()),
3337 FmhlInfo("globals_sequ",theTranslator->trSequences()),
3338 FmhlInfo("globals_dict",theTranslator->trDictionaries()),
3339 FmhlInfo("globals_enum",theTranslator->trEnumerations()),
3340 FmhlInfo("globals_eval",theTranslator->trEnumerationValues()),
3341 FmhlInfo("globals_defs",theTranslator->trDefines())
3343 return &fmhlInfo[hl];
3346 static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
3348 if (documentedFileMembers[hl]==0) return;
3350 static bool disableIndex = Config_getBool(DISABLE_INDEX);
3352 bool multiPageIndex=FALSE;
3353 if (documentedFileMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3355 multiPageIndex=TRUE;
3358 ol.pushGeneratorState();
3359 ol.disableAllBut(OutputGenerator::Html);
3361 QCString extension=Doxygen::htmlFileExtension;
3362 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
3363 QCString title = lne ? lne->title() : theTranslator->trFileMembers();
3364 bool addToIndex = lne==0 || lne->visible();
3368 Doxygen::indexList->addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,0,
3369 getFmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
3370 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3374 SIntDict<MemberIndexList>::Iterator it(g_fileIndexLetterUsed[hl]);
3375 MemberIndexList *ml;
3376 for (it.toFirst();(ml=it.current());++it)
3378 uint page = ml->letter();
3379 QCString fileName = getFmhlInfo(hl)->fname;
3384 fileName+="_"+letterToLabel(page);
3386 QCString cs = QString(QChar(page)).utf8();
3389 Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
3392 bool quickIndex = documentedFileMembers[hl]>maxItemsBeforeQuickIndex;
3394 ol.startFile(fileName+extension,0,title);
3395 ol.startQuickIndices();
3398 ol.writeQuickLinks(TRUE,HLI_Globals,0);
3399 if (!Config_getBool(HTML_DYNAMIC_MENUS))
3401 startQuickIndexList(ol);
3403 // index item for all file member lists
3404 startQuickIndexItem(ol,
3405 getFmhlInfo(0)->fname+Doxygen::htmlFileExtension,hl==FMHL_All,TRUE,first);
3406 ol.writeString(fixSpaces(getFmhlInfo(0)->title));
3407 endQuickIndexItem(ol);
3410 // index items for per category member lists
3411 for (i=1;i<FMHL_Total;i++)
3413 if (documentedFileMembers[i]>0)
3415 startQuickIndexItem(ol,
3416 getFmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
3417 ol.writeString(fixSpaces(getFmhlInfo(i)->title));
3418 endQuickIndexItem(ol);
3422 endQuickIndexList(ol);
3426 writeQuickMemberIndex(ol,g_fileIndexLetterUsed[hl],page,
3427 getFmhlInfo(hl)->fname,multiPageIndex);
3431 ol.endQuickIndices();
3432 ol.writeSplitBar(fileName);
3433 ol.writeSearchInfo();
3439 ol.startTextBlock();
3440 ol.parseText(lne ? lne->intro() : theTranslator->trFileMembersDescription(Config_getBool(EXTRACT_ALL)));
3445 // hack to work around a mozilla bug, which refuses to switch to
3446 // normal lists otherwise
3447 ol.writeString(" ");
3450 writeMemberList(ol,quickIndex,
3451 multiPageIndex?page:-1,
3452 g_fileIndexLetterUsed[hl],
3453 Definition::TypeFile);
3457 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3458 ol.popGeneratorState();
3461 static void writeFileMemberIndex(OutputList &ol)
3463 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
3464 bool addToIndex = lne==0 || lne->visible();
3465 if (documentedFileMembers[FMHL_All]>0 && addToIndex)
3467 Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trFileMembers(),0,"globals",0);
3468 Doxygen::indexList->incContentsDepth();
3470 writeFileMemberIndexFiltered(ol,FMHL_All);
3471 writeFileMemberIndexFiltered(ol,FMHL_Functions);
3472 writeFileMemberIndexFiltered(ol,FMHL_Variables);
3473 writeFileMemberIndexFiltered(ol,FMHL_Typedefs);
3474 writeFileMemberIndexFiltered(ol,FMHL_Sequences);
3475 writeFileMemberIndexFiltered(ol,FMHL_Dictionaries);
3476 writeFileMemberIndexFiltered(ol,FMHL_Enums);
3477 writeFileMemberIndexFiltered(ol,FMHL_EnumValues);
3478 writeFileMemberIndexFiltered(ol,FMHL_Defines);
3479 if (documentedFileMembers[FMHL_All]>0 && addToIndex)
3481 Doxygen::indexList->decContentsDepth();
3486 //----------------------------------------------------------------------------
3488 /** Helper class representing a namespace member in the navigation menu. */
3491 NmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
3496 static const NmhlInfo *getNmhlInfo(int hl)
3498 static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3499 static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3500 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
3501 static NmhlInfo nmhlInfo[] =
3503 NmhlInfo("namespacemembers", theTranslator->trAll()),
3504 NmhlInfo("namespacemembers_func",
3505 fortranOpt ? theTranslator->trSubprograms() :
3506 vhdlOpt ? theTranslator->trFunctionAndProc() :
3507 theTranslator->trFunctions()),
3508 NmhlInfo("namespacemembers_vars",sliceOpt ? theTranslator->trConstants() : theTranslator->trVariables()),
3509 NmhlInfo("namespacemembers_type",theTranslator->trTypedefs()),
3510 NmhlInfo("namespacemembers_sequ",theTranslator->trSequences()),
3511 NmhlInfo("namespacemembers_dict",theTranslator->trDictionaries()),
3512 NmhlInfo("namespacemembers_enum",theTranslator->trEnumerations()),
3513 NmhlInfo("namespacemembers_eval",theTranslator->trEnumerationValues())
3515 return &nmhlInfo[hl];
3518 //----------------------------------------------------------------------------
3520 static void writeNamespaceMemberIndexFiltered(OutputList &ol,
3521 NamespaceMemberHighlight hl)
3523 if (documentedNamespaceMembers[hl]==0) return;
3525 static bool disableIndex = Config_getBool(DISABLE_INDEX);
3528 bool multiPageIndex=FALSE;
3529 if (documentedNamespaceMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
3531 multiPageIndex=TRUE;
3534 ol.pushGeneratorState();
3535 ol.disableAllBut(OutputGenerator::Html);
3537 QCString extension=Doxygen::htmlFileExtension;
3538 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
3539 QCString title = lne ? lne->title() : theTranslator->trNamespaceMembers();
3540 bool addToIndex = lne==0 || lne->visible();
3544 Doxygen::indexList->addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,0,
3545 getNmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
3546 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
3550 SIntDict<MemberIndexList>::Iterator it(g_namespaceIndexLetterUsed[hl]);
3551 MemberIndexList *ml;
3552 for (it.toFirst();(ml=it.current());++it)
3554 uint page = ml->letter();
3555 QCString fileName = getNmhlInfo(hl)->fname;
3560 fileName+="_"+letterToLabel(page);
3562 QCString cs = QString(QChar(page)).utf8();
3565 Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
3568 bool quickIndex = documentedNamespaceMembers[hl]>maxItemsBeforeQuickIndex;
3570 ol.startFile(fileName+extension,0,title);
3571 ol.startQuickIndices();
3574 ol.writeQuickLinks(TRUE,HLI_NamespaceMembers,0);
3575 if (!Config_getBool(HTML_DYNAMIC_MENUS))
3577 startQuickIndexList(ol);
3579 // index item for all namespace member lists
3580 startQuickIndexItem(ol,
3581 getNmhlInfo(0)->fname+Doxygen::htmlFileExtension,hl==NMHL_All,TRUE,first);
3582 ol.writeString(fixSpaces(getNmhlInfo(0)->title));
3583 endQuickIndexItem(ol);
3586 // index items per category member lists
3587 for (i=1;i<NMHL_Total;i++)
3589 if (documentedNamespaceMembers[i]>0)
3591 startQuickIndexItem(ol,
3592 getNmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
3593 ol.writeString(fixSpaces(getNmhlInfo(i)->title));
3594 endQuickIndexItem(ol);
3598 endQuickIndexList(ol);
3602 writeQuickMemberIndex(ol,g_namespaceIndexLetterUsed[hl],page,
3603 getNmhlInfo(hl)->fname,multiPageIndex);
3607 ol.endQuickIndices();
3608 ol.writeSplitBar(fileName);
3609 ol.writeSearchInfo();
3615 ol.startTextBlock();
3616 ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceMemberDescription(Config_getBool(EXTRACT_ALL)));
3621 // hack to work around a mozilla bug, which refuses to switch to
3622 // normal lists otherwise
3623 ol.writeString(" ");
3626 writeMemberList(ol,quickIndex,
3627 multiPageIndex?page:-1,
3628 g_namespaceIndexLetterUsed[hl],
3629 Definition::TypeNamespace);
3633 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
3634 ol.popGeneratorState();
3637 static void writeNamespaceMemberIndex(OutputList &ol)
3639 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
3640 bool addToIndex = lne==0 || lne->visible();
3641 if (documentedNamespaceMembers[NMHL_All]>0 && addToIndex)
3643 Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trNamespaceMembers(),0,"namespacemembers",0);
3644 Doxygen::indexList->incContentsDepth();
3646 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3647 writeNamespaceMemberIndexFiltered(ol,NMHL_All);
3648 writeNamespaceMemberIndexFiltered(ol,NMHL_Functions);
3649 writeNamespaceMemberIndexFiltered(ol,NMHL_Variables);
3650 writeNamespaceMemberIndexFiltered(ol,NMHL_Typedefs);
3651 writeNamespaceMemberIndexFiltered(ol,NMHL_Sequences);
3652 writeNamespaceMemberIndexFiltered(ol,NMHL_Dictionaries);
3653 writeNamespaceMemberIndexFiltered(ol,NMHL_Enums);
3654 writeNamespaceMemberIndexFiltered(ol,NMHL_EnumValues);
3655 if (documentedNamespaceMembers[NMHL_All]>0 && addToIndex)
3657 Doxygen::indexList->decContentsDepth();
3662 //----------------------------------------------------------------------------
3664 //----------------------------------------------------------------------------
3666 static void writeExampleIndex(OutputList &ol)
3668 if (Doxygen::exampleSDict->count()==0) return;
3669 ol.pushGeneratorState();
3670 ol.disable(OutputGenerator::Man);
3671 ol.disable(OutputGenerator::Docbook);
3672 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Examples);
3673 QCString title = lne ? lne->title() : theTranslator->trExamples();
3674 bool addToIndex = lne==0 || lne->visible();
3676 startFile(ol,"examples",0,title,HLI_Examples);
3679 ol.parseText(title);
3686 Doxygen::indexList->addContentsItem(TRUE,title,0,"examples",0,TRUE,TRUE);
3687 Doxygen::indexList->incContentsDepth();
3690 ol.startTextBlock();
3691 ol.parseText(lne ? lne->intro() : theTranslator->trExamplesDescription());
3695 PageSDict::Iterator pdi(*Doxygen::exampleSDict);
3697 for (pdi.toFirst();(pd=pdi.current());++pdi)
3699 ol.startItemListItem();
3700 QCString n=pd->getOutputFileBase();
3701 if (!pd->title().isEmpty())
3703 ol.writeObjectLink(0,n,0,pd->title());
3706 Doxygen::indexList->addContentsItem(FALSE,filterTitle(pd->title()),pd->getReference(),n,0,FALSE,TRUE);
3711 ol.writeObjectLink(0,n,0,pd->name());
3714 Doxygen::indexList->addContentsItem(FALSE,pd->name(),pd->getReference(),n,0,FALSE,TRUE);
3717 ol.endItemListItem();
3718 ol.writeString("\n");
3724 Doxygen::indexList->decContentsDepth();
3727 ol.popGeneratorState();
3731 //----------------------------------------------------------------------------
3733 static void countRelatedPages(int &docPages,int &indexPages)
3735 docPages=indexPages=0;
3736 PageSDict::Iterator pdi(*Doxygen::pageSDict);
3738 for (pdi.toFirst();(pd=pdi.current());++pdi)
3740 if ( pd->visibleInIndex())
3744 if ( pd->documentedPage())
3751 //----------------------------------------------------------------------------
3753 static bool mainPageHasOwnTitle()
3755 static QCString projectName = Config_getString(PROJECT_NAME);
3757 if (Doxygen::mainPage)
3759 title = filterTitle(Doxygen::mainPage->title());
3761 return !projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0;
3764 static void writePages(PageDef *pd,FTVHelp *ftv)
3766 //printf("writePages()=%s pd=%p mainpage=%p\n",pd->name().data(),pd,Doxygen::mainPage);
3767 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
3768 bool addToIndex = lne==0 || lne->visible();
3769 if (!addToIndex) return;
3771 bool hasSubPages = pd->hasSubPages();
3772 bool hasSections = pd->hasSections();
3774 if (pd->visibleInIndex())
3778 if (pd->title().isEmpty())
3779 pageTitle=pd->name();
3781 pageTitle=filterTitle(pd->title());
3785 //printf("*** adding %s hasSubPages=%d hasSections=%d\n",pageTitle.data(),hasSubPages,hasSections);
3786 ftv->addContentsItem(
3787 hasSubPages,pageTitle,
3788 pd->getReference(),pd->getOutputFileBase(),
3789 0,hasSubPages,TRUE,pd);
3791 if (addToIndex && pd!=Doxygen::mainPage)
3793 Doxygen::indexList->addContentsItem(
3794 hasSubPages || hasSections,pageTitle,
3795 pd->getReference(),pd->getOutputFileBase(),
3796 0,hasSubPages,TRUE);
3799 if (hasSubPages && ftv) ftv->incContentsDepth();
3800 bool doIndent = (hasSections || hasSubPages) &&
3801 (pd!=Doxygen::mainPage || mainPageHasOwnTitle());
3804 Doxygen::indexList->incContentsDepth();
3808 pd->addSectionsToIndex();
3810 PageSDict *subPages = pd->getSubPages();
3813 PageSDict::Iterator pi(*subPages);
3815 for (pi.toFirst();(subPage=pi.current());++pi)
3817 writePages(subPage,ftv);
3820 if (hasSubPages && ftv) ftv->decContentsDepth();
3823 Doxygen::indexList->decContentsDepth();
3825 //printf("end writePages()=%s\n",pd->title().data());
3828 //----------------------------------------------------------------------------
3830 static void writePageIndex(OutputList &ol)
3832 if (indexedPages==0) return;
3833 ol.pushGeneratorState();
3834 ol.disableAllBut(OutputGenerator::Html);
3835 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
3836 QCString title = lne ? lne->title() : theTranslator->trRelatedPages();
3837 startFile(ol,"pages",0,title,HLI_Pages);
3839 ol.parseText(title);
3842 ol.startTextBlock();
3843 ol.parseText(lne ? lne->intro() : theTranslator->trRelatedPagesDescription());
3847 FTVHelp* ftv = new FTVHelp(FALSE);
3848 PageSDict::Iterator pdi(*Doxygen::pageSDict);
3850 for (pdi.toFirst();(pd=pdi.current());++pdi)
3852 if ((pd->getOuterScope()==0 ||
3853 pd->getOuterScope()->definitionType()!=Definition::TypePage) && // not a sub page
3854 !pd->isReference() // not an external page
3861 FTextStream t(&outStr);
3862 ftv->generateTreeViewInline(t);
3863 ol.writeString(outStr);
3867 // ol.popGeneratorState();
3871 ol.popGeneratorState();
3874 //----------------------------------------------------------------------------
3876 static int countGroups()
3879 GroupSDict::Iterator gli(*Doxygen::groupSDict);
3881 for (gli.toFirst();(gd=gli.current());++gli)
3883 if (!gd->isReference())
3892 //----------------------------------------------------------------------------
3894 static int countDirs()
3897 SDict<DirDef>::Iterator dli(*Doxygen::directories);
3899 for (dli.toFirst();(dd=dli.current());++dli)
3901 if (dd->isLinkableInProject())
3911 //----------------------------------------------------------------------------
3913 void writeGraphInfo(OutputList &ol)
3915 if (!Config_getBool(HAVE_DOT) || !Config_getBool(GENERATE_HTML)) return;
3916 ol.pushGeneratorState();
3917 ol.disableAllBut(OutputGenerator::Html);
3918 generateGraphLegend(Config_getString(HTML_OUTPUT));
3920 bool &stripCommentsStateRef = Config_getBool(STRIP_CODE_COMMENTS);
3921 bool oldStripCommentsState = stripCommentsStateRef;
3922 bool &createSubdirs = Config_getBool(CREATE_SUBDIRS);
3923 bool oldCreateSubdirs = createSubdirs;
3924 // temporarily disable the stripping of comments for our own code example!
3925 stripCommentsStateRef = FALSE;
3926 // temporarily disable create subdirs for linking to our example
3927 createSubdirs = FALSE;
3929 startFile(ol,"graph_legend",0,theTranslator->trLegendTitle().data());
3931 ol.parseText(theTranslator->trLegendTitle());
3934 QCString legendDocs = theTranslator->trLegendDocs();
3935 int s = legendDocs.find("<center>");
3936 int e = legendDocs.find("</center>");
3937 QCString imgExt = getDotImageExtension();
3938 if (imgExt=="svg" && s!=-1 && e!=-1)
3940 legendDocs = legendDocs.left(s+8) + "[!-- SVG 0 --]\n" + legendDocs.mid(e);
3941 //printf("legendDocs=%s\n",legendDocs.data());
3943 FileDef fd("","graph_legend");
3944 ol.generateDoc("graph_legend",1,&fd,0,legendDocs,FALSE,FALSE);
3946 // restore config settings
3947 stripCommentsStateRef = oldStripCommentsState;
3948 createSubdirs = oldCreateSubdirs;
3951 ol.popGeneratorState();
3956 //----------------------------------------------------------------------------
3958 * write groups as hierarchical trees
3960 static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv, bool addToIndex)
3962 //bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
3963 //bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
3966 warn(gd->getDefFileName(),gd->getDefLine(),
3967 "maximum nesting level exceeded for group %s: check for possible recursive group relation!\n",gd->name().data()
3972 /* Some groups should appear twice under different parent-groups.
3973 * That is why we should not check if it was visited
3975 if (/*!gd->visited &&*/ (!gd->isASubGroup() || level>0) &&
3977 (!gd->isReference() || Config_getBool(EXTERNAL_GROUPS)) // hide external groups by default
3980 //printf("gd->name()=%s #members=%d\n",gd->name().data(),gd->countMembers());
3982 bool hasSubGroups = gd->getSubGroups()->count()>0;
3983 bool hasSubPages = gd->getPages()->count()>0;
3984 int numSubItems = 0;
3985 if (1 /*Config_getBool(TOC_EXPAND)*/)
3987 QListIterator<MemberList> mli(gd->getMemberLists());
3989 for (mli.toFirst();(ml=mli.current());++mli)
3991 if (ml->listType()&MemberListType_documentationLists)
3993 numSubItems += ml->count();
3996 numSubItems += gd->getNamespaces()->count();
3997 numSubItems += gd->getClasses()->count();
3998 numSubItems += gd->getFiles()->count();
3999 numSubItems += gd->getDirs()->count();
4000 numSubItems += gd->getPages()->count();
4003 bool isDir = hasSubGroups || hasSubPages || numSubItems>0;
4004 //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
4007 Doxygen::indexList->addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0,isDir,TRUE);
4008 Doxygen::indexList->incContentsDepth();
4012 ftv->addContentsItem(hasSubGroups,gd->groupTitle(),
4013 gd->getReference(),gd->getOutputFileBase(),0,
4015 ftv->incContentsDepth();
4018 //ol.writeListItem();
4019 //ol.startTextLink(gd->getOutputFileBase(),0);
4020 //parseText(ol,gd->groupTitle());
4023 ol.startIndexListItem();
4024 ol.startIndexItem(gd->getReference(),gd->getOutputFileBase());
4025 ol.parseText(gd->groupTitle());
4026 ol.endIndexItem(gd->getReference(),gd->getOutputFileBase());
4027 if (gd->isReference())
4029 ol.startTypewriter();
4030 ol.docify(" [external]");
4034 QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Group));
4035 LayoutDocEntry *lde;
4036 for (eli.toFirst();(lde=eli.current());++eli)
4038 if (lde->kind()==LayoutDocEntry::MemberDef && addToIndex)
4040 LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
4041 MemberList *ml = gd->getMemberList(lmd->type);
4044 MemberListIterator mi(*ml);
4046 for (mi.toFirst();(md=mi.current());++mi)
4048 MemberList *enumList = md->enumFieldList();
4049 bool isDir = enumList!=0 && md->isEnumerate();
4050 if (md->isVisible() && md->name().find('@')==-1)
4052 Doxygen::indexList->addContentsItem(isDir,
4053 md->name(),md->getReference(),
4054 md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
4058 Doxygen::indexList->incContentsDepth();
4059 MemberListIterator emli(*enumList);
4061 for (emli.toFirst();(emd=emli.current());++emli)
4063 if (emd->isVisible())
4065 Doxygen::indexList->addContentsItem(FALSE,
4066 emd->name(),emd->getReference(),emd->getOutputFileBase(),
4067 emd->anchor(),FALSE,addToIndex);
4070 Doxygen::indexList->decContentsDepth();
4075 else if (lde->kind()==LayoutDocEntry::GroupClasses && addToIndex)
4077 ClassSDict::Iterator it(*gd->getClasses());
4079 for (;(cd=it.current());++it)
4081 //bool nestedClassInSameGroup =
4082 // cd->getOuterScope() && cd->getOuterScope()->definitionType()==Definition::TypeClass &&
4083 // cd->getOuterScope()->partOfGroups()!=0 && cd->getOuterScope()->partOfGroups()->contains(gd);
4084 //printf("===== GroupClasses: %s visible=%d nestedClassInSameGroup=%d\n",cd->name().data(),cd->isVisible(),nestedClassInSameGroup);
4085 if (cd->isVisible() /*&& !nestedClassInSameGroup*/)
4087 //if (cd->isEmbeddedInOuterScope())
4089 //printf("add class & members %d\n",addToIndex);
4090 addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(FALSE),cd->anchor(),addToIndex,TRUE);
4092 //else // only index the class, not its members
4094 // printf("%s: add class only\n",cd->name().data());
4095 // Doxygen::indexList->addContentsItem(FALSE,
4096 // cd->displayName(TRUE),cd->getReference(),
4097 // cd->getOutputFileBase(),cd->anchor(),addToIndex,TRUE);
4102 else if (lde->kind()==LayoutDocEntry::GroupNamespaces && addToIndex)
4104 NamespaceSDict::Iterator it(*gd->getNamespaces());
4106 for (;(nd=it.current());++it)
4108 if (nd->isVisible())
4110 Doxygen::indexList->addContentsItem(FALSE,
4111 nd->localName(),nd->getReference(),
4112 nd->getOutputFileBase(),0,FALSE,FALSE);
4116 else if (lde->kind()==LayoutDocEntry::GroupFiles && addToIndex)
4118 QListIterator<FileDef> it(*gd->getFiles());
4120 for (;(fd=it.current());++it)
4122 if (fd->isVisible())
4124 Doxygen::indexList->addContentsItem(FALSE,
4125 fd->displayName(),fd->getReference(),
4126 fd->getOutputFileBase(),0,FALSE,FALSE);
4130 else if (lde->kind()==LayoutDocEntry::GroupDirs && addToIndex)
4132 QListIterator<DirDef> it(*gd->getDirs());
4134 for (;(dd=it.current());++it)
4136 if (dd->isVisible())
4138 Doxygen::indexList->addContentsItem(FALSE,
4139 dd->shortName(),dd->getReference(),
4140 dd->getOutputFileBase(),0,FALSE,FALSE);
4144 else if (lde->kind()==LayoutDocEntry::GroupPageDocs && addToIndex)
4146 SDict<PageDef>::Iterator it(*gd->getPages());
4148 for (;(pd=it.current());++it)
4151 if (!pd->name().isEmpty()) si=Doxygen::sectionDict->find(pd->name());
4152 bool hasSubPages = pd->hasSubPages();
4153 bool hasSections = pd->hasSections();
4154 Doxygen::indexList->addContentsItem(
4155 hasSubPages || hasSections,
4156 convertToHtml(pd->title(),TRUE),
4158 gd->getOutputFileBase(),
4159 si ? si->label.data() : 0,
4160 hasSubPages || hasSections,
4161 TRUE); // addToNavIndex
4162 if (hasSections || hasSubPages)
4164 Doxygen::indexList->incContentsDepth();
4168 pd->addSectionsToIndex();
4171 if (hasSections || hasSubPages)
4173 Doxygen::indexList->decContentsDepth();
4177 else if (lde->kind()==LayoutDocEntry::GroupNestedGroups)
4179 if (gd->getSubGroups()->count()>0)
4181 startIndexHierarchy(ol,level+1);
4182 QListIterator<GroupDef> gli(*gd->getSubGroups());
4183 GroupDef *subgd = 0;
4184 for (gli.toFirst();(subgd=gli.current());++gli)
4186 writeGroupTreeNode(ol,subgd,level+1,ftv,addToIndex);
4188 endIndexHierarchy(ol,level+1);
4193 ol.endIndexListItem();
4197 Doxygen::indexList->decContentsDepth();
4201 ftv->decContentsDepth();
4207 static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
4211 ol.pushGeneratorState();
4212 ol.disable(OutputGenerator::Html);
4214 startIndexHierarchy(ol,0);
4215 GroupSDict::Iterator gli(*Doxygen::groupSDict);
4217 for (gli.toFirst();(gd=gli.current());++gli)
4219 writeGroupTreeNode(ol,gd,0,ftv,addToIndex);
4221 endIndexHierarchy(ol,0);
4224 ol.popGeneratorState();
4229 static void writeGroupTree(GroupDef *gd,FTVHelp *ftv,int level,bool addToIndex)
4231 static bool externalGroups = Config_getBool(EXTERNAL_GROUPS);
4232 /* Some groups should appear twice under different parent-groups.
4233 * That is why we should not check if it was visited
4235 if ((!gd->isASubGroup() || level>0) &&
4237 (!gd->isReference() || externalGroups) // hide external groups by default
4242 ftv->addContentsItem(hasSubGroups,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0);
4243 ftv->incContentsDepth();
4247 ftv->decContentsDepth();
4252 static void writeGroupTree(FTVHelp *ftv,bool addToIndex)
4254 GroupSDict::Iterator gli(*Doxygen::groupSDict);
4256 for (gli.toFirst();(gd=gli.current());++gli)
4258 writeGroupTree(gd,ftv,0,addToIndex);
4263 //----------------------------------------------------------------------------
4265 static void writeGroupIndex(OutputList &ol)
4267 if (documentedGroups==0) return;
4268 ol.pushGeneratorState();
4270 ol.disable(OutputGenerator::Man);
4271 ol.disable(OutputGenerator::Docbook);
4272 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Modules);
4273 QCString title = lne ? lne->title() : theTranslator->trModules();
4274 bool addToIndex = lne==0 || lne->visible();
4276 startFile(ol,"modules",0,title,HLI_Modules);
4278 ol.parseText(title);
4281 ol.startTextBlock();
4282 ol.parseText(lne ? lne->intro() : theTranslator->trModulesDescription());
4286 // Normal group index for Latex/RTF
4289 ol.pushGeneratorState();
4290 ol.disable(OutputGenerator::Html);
4291 Doxygen::indexList->disable();
4293 writeGroupHierarchy(ol,0,FALSE);
4295 Doxygen::indexList->enable();
4296 ol.popGeneratorState();
4300 // interactive group index for HTML
4303 ol.pushGeneratorState();
4304 ol.disableAllBut(OutputGenerator::Html);
4309 Doxygen::indexList->addContentsItem(TRUE,title,0,"modules",0,TRUE,TRUE);
4310 Doxygen::indexList->incContentsDepth();
4312 FTVHelp* ftv = new FTVHelp(FALSE);
4313 writeGroupHierarchy(ol,ftv,addToIndex);
4315 FTextStream t(&outStr);
4316 ftv->generateTreeViewInline(t);
4317 ol.disableAllBut(OutputGenerator::Html);
4318 ol.writeString(outStr);
4322 Doxygen::indexList->decContentsDepth();
4325 ol.popGeneratorState();
4329 ol.popGeneratorState();
4333 //----------------------------------------------------------------------------
4336 static void writeDirIndex(OutputList &ol)
4338 if (documentedDirs==0) return;
4339 ol.pushGeneratorState();
4340 ol.disable(OutputGenerator::Man);
4341 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Dirs);
4342 QCString title = lne ? lne->title() : theTranslator->trDirectories();
4343 bool addToIndex=FALSE; //lne==0 || lne->visible();
4345 startFile(ol,"dirs",0,title,HLI_Directories);
4347 ol.parseText(title);
4350 ol.startTextBlock();
4354 Doxygen::indexList->addContentsItem(TRUE,title,0,"dirs",0,TRUE,TRUE);
4355 Doxygen::indexList->incContentsDepth();
4357 ol.parseText(lne ? lne->intro() : theTranslator->trDirDescription());
4361 bool treeView=Config_getBool(USE_INLINE_TREES);
4364 ftv = new FTVHelp(FALSE);
4367 writeDirHierarchy(ol,ftv,addToIndex);
4372 FTextStream t(&outStr);
4373 ftv->generateTreeViewInline(t);
4374 ol.pushGeneratorState();
4375 ol.disableAllBut(OutputGenerator::Html);
4376 ol.writeString(outStr);
4377 ol.popGeneratorState();
4382 Doxygen::indexList->decContentsDepth();
4385 ol.popGeneratorState();
4389 //----------------------------------------------------------------------------
4391 static void writeUserGroupStubPage(OutputList &ol,LayoutNavEntry *lne)
4393 if (lne->baseFile().left(9)=="usergroup")
4395 ol.pushGeneratorState();
4396 ol.disableAllBut(OutputGenerator::Html);
4397 startFile(ol,lne->baseFile(),0,lne->title(),HLI_UserGroup);
4399 ol.parseText(lne->title());
4402 QListIterator<LayoutNavEntry> li(lne->children());
4403 LayoutNavEntry *entry;
4405 for (li.toFirst();(entry=li.current());++li)
4407 if (entry->visible()) count++;
4411 ol.writeString("<ul>\n");
4412 for (li.toFirst();(entry=li.current());++li)
4414 if (entry->visible())
4416 ol.writeString("<li><a href=\""+entry->url()+"\"><span>"+
4417 fixSpaces(entry->title())+"</span></a></li>\n");
4420 ol.writeString("</ul>\n");
4423 ol.popGeneratorState();
4427 //----------------------------------------------------------------------------
4430 static void writeIndex(OutputList &ol)
4432 static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN);
4433 static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
4434 static QCString projectName = Config_getString(PROJECT_NAME);
4435 // save old generator state
4436 ol.pushGeneratorState();
4438 QCString projPrefix;
4439 if (!projectName.isEmpty())
4441 projPrefix=projectName+" ";
4444 //--------------------------------------------------------------------
4446 //--------------------------------------------------------------------
4447 ol.disableAllBut(OutputGenerator::Html);
4449 QCString defFileName =
4450 Doxygen::mainPage ? Doxygen::mainPage->docFile().data() : "[generated]";
4452 Doxygen::mainPage ? Doxygen::mainPage->docLine() : -1;
4455 if (!mainPageHasTitle())
4457 title = theTranslator->trMainPage();
4459 else if (Doxygen::mainPage)
4461 title = filterTitle(Doxygen::mainPage->title());
4464 QCString indexName="index";
4465 ol.startFile(indexName,0,title);
4467 if (Doxygen::mainPage)
4470 (!projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0)
4471 ) // to avoid duplicate entries in the treeview
4473 Doxygen::indexList->addContentsItem(Doxygen::mainPage->hasSubPages(),title,0,indexName,0,Doxygen::mainPage->hasSubPages(),TRUE);
4475 if (Doxygen::mainPage->hasSubPages() || Doxygen::mainPage->hasSections())
4477 writePages(Doxygen::mainPage,0);
4481 ol.startQuickIndices();
4482 if (!Config_getBool(DISABLE_INDEX))
4484 ol.writeQuickLinks(TRUE,HLI_Main,0);
4486 ol.endQuickIndices();
4487 ol.writeSplitBar(indexName);
4488 ol.writeSearchInfo();
4489 bool headerWritten=FALSE;
4490 if (Doxygen::mainPage)
4492 if (!Doxygen::mainPage->title().isEmpty())
4494 if (Doxygen::mainPage->title().lower() != "notitle")
4495 ol.startPageDoc(Doxygen::mainPage->title());
4497 ol.startPageDoc("");
4500 ol.startPageDoc(projectName);
4502 if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty())
4504 if (Doxygen::mainPage->title().lower()!="notitle")
4506 ol.startHeaderSection();
4507 ol.startTitleHead(0);
4508 ol.generateDoc(Doxygen::mainPage->docFile(),Doxygen::mainPage->docLine(),
4509 Doxygen::mainPage,0,Doxygen::mainPage->title(),
4510 TRUE,FALSE,0,TRUE,FALSE);
4511 headerWritten = TRUE;
4516 if (!projectName.isEmpty())
4518 ol.startHeaderSection();
4519 ol.startTitleHead(0);
4520 ol.parseText(projPrefix+theTranslator->trDocumentation());
4521 headerWritten = TRUE;
4526 ol.endTitleHead(0,0);
4527 ol.endHeaderSection();
4531 if (Config_getBool(DISABLE_INDEX) && Doxygen::mainPage==0)
4533 ol.writeQuickLinks(FALSE,HLI_Main,0);
4536 if (Doxygen::mainPage)
4538 Doxygen::insideMainPage=TRUE;
4539 if (Doxygen::mainPage->localToc().isHtmlEnabled() && Doxygen::mainPage->hasSections())
4541 Doxygen::mainPage->writeToc(ol,Doxygen::mainPage->localToc());
4544 ol.startTextBlock();
4545 ol.generateDoc(defFileName,defLine,Doxygen::mainPage,0,
4546 Doxygen::mainPage->documentation(),TRUE,FALSE
4547 /*,Doxygen::mainPage->sectionDict*/);
4551 Doxygen::insideMainPage=FALSE;
4555 ol.disable(OutputGenerator::Html);
4557 //--------------------------------------------------------------------
4558 // write LaTeX/RTF index
4559 //--------------------------------------------------------------------
4560 ol.enable(OutputGenerator::Latex);
4561 ol.enable(OutputGenerator::Docbook);
4562 ol.enable(OutputGenerator::RTF);
4564 ol.startFile("refman",0,0);
4565 ol.startIndexSection(isTitlePageStart);
4566 if (!Config_getString(LATEX_HEADER).isEmpty())
4568 ol.disable(OutputGenerator::Latex);
4570 ol.disable(OutputGenerator::Docbook);
4572 if (projPrefix.isEmpty())
4574 ol.parseText(theTranslator->trReferenceManual());
4578 ol.parseText(projPrefix);
4581 if (!Config_getString(PROJECT_NUMBER).isEmpty())
4583 ol.startProjectNumber();
4584 ol.generateDoc(defFileName,defLine,Doxygen::mainPage,0,Config_getString(PROJECT_NUMBER),FALSE,FALSE);
4585 ol.endProjectNumber();
4587 ol.endIndexSection(isTitlePageStart);
4588 ol.startIndexSection(isTitlePageAuthor);
4589 ol.parseText(theTranslator->trGeneratedBy());
4590 ol.endIndexSection(isTitlePageAuthor);
4591 ol.enable(OutputGenerator::Latex);
4592 ol.enable(OutputGenerator::Docbook);
4595 if (Doxygen::mainPage)
4597 ol.startIndexSection(isMainPage);
4598 if (mainPageHasTitle())
4600 ol.parseText(Doxygen::mainPage->title());
4604 ol.parseText(/*projPrefix+*/theTranslator->trMainPage());
4606 ol.endIndexSection(isMainPage);
4608 if (documentedPages>0)
4610 //ol.parseText(projPrefix+theTranslator->trPageDocumentation());
4611 //ol.endIndexSection(isPageDocumentation);
4612 PageSDict::Iterator pdi(*Doxygen::pageSDict);
4613 PageDef *pd=pdi.toFirst();
4614 bool first=Doxygen::mainPage==0;
4615 for (pdi.toFirst();(pd=pdi.current());++pdi)
4617 if (!pd->getGroupDef() && !pd->isReference() &&
4618 (!pd->hasParentPage() || // not inside other page
4619 (Doxygen::mainPage==pd->getOuterScope())) // or inside main page
4622 bool isCitationPage = pd->name()=="citelist";
4625 // For LaTeX the bibliograph is already written by \bibliography
4626 ol.pushGeneratorState();
4627 ol.disable(OutputGenerator::Latex);
4629 QCString title = pd->title();
4630 if (title.isEmpty()) title=pd->name();
4632 ol.disable(OutputGenerator::Docbook);
4633 ol.startIndexSection(isPageDocumentation);
4634 ol.parseText(title);
4635 ol.endIndexSection(isPageDocumentation);
4636 ol.enable(OutputGenerator::Docbook);
4638 ol.pushGeneratorState(); // write TOC title (RTF only)
4639 ol.disableAllBut(OutputGenerator::RTF);
4640 ol.startIndexSection(isPageDocumentation2);
4641 ol.parseText(title);
4642 ol.endIndexSection(isPageDocumentation2);
4643 ol.popGeneratorState();
4645 ol.writeAnchor(0,pd->getOutputFileBase());
4647 ol.writePageLink(pd->getOutputFileBase(),first);
4652 ol.popGeneratorState();
4658 ol.disable(OutputGenerator::Docbook);
4659 if (!Config_getBool(LATEX_HIDE_INDICES))
4661 //if (indexedPages>0)
4663 // ol.startIndexSection(isPageIndex);
4664 // ol.parseText(/*projPrefix+*/ theTranslator->trPageIndex());
4665 // ol.endIndexSection(isPageIndex);
4667 if (documentedGroups>0)
4669 ol.startIndexSection(isModuleIndex);
4670 ol.parseText(/*projPrefix+*/ theTranslator->trModuleIndex());
4671 ol.endIndexSection(isModuleIndex);
4673 if (documentedNamespaces>0)
4675 ol.startIndexSection(isNamespaceIndex);
4676 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModulesIndex():theTranslator->trNamespaceIndex()));
4677 ol.endIndexSection(isNamespaceIndex);
4679 if (hierarchyInterfaces>0)
4681 ol.startIndexSection(isClassHierarchyIndex);
4682 ol.parseText(/*projPrefix+*/theTranslator->trHierarchicalIndex());
4683 ol.endIndexSection(isClassHierarchyIndex);
4685 if (hierarchyClasses>0)
4687 ol.startIndexSection(isClassHierarchyIndex);
4688 ol.parseText(/*projPrefix+*/
4689 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
4690 vhdlOpt ? theTranslator->trHierarchicalIndex() :
4691 theTranslator->trHierarchicalIndex()
4693 ol.endIndexSection(isClassHierarchyIndex);
4695 if (hierarchyExceptions>0)
4697 ol.startIndexSection(isClassHierarchyIndex);
4698 ol.parseText(/*projPrefix+*/theTranslator->trHierarchicalIndex());
4699 ol.endIndexSection(isClassHierarchyIndex);
4701 if (annotatedInterfacesPrinted>0)
4703 ol.startIndexSection(isCompoundIndex);
4704 ol.parseText(/*projPrefix+*/theTranslator->trInterfaceIndex());
4705 ol.endIndexSection(isCompoundIndex);
4707 if (annotatedClassesPrinted>0)
4709 ol.startIndexSection(isCompoundIndex);
4710 ol.parseText(/*projPrefix+*/
4711 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
4712 vhdlOpt ? theTranslator->trDesignUnitIndex() :
4713 theTranslator->trCompoundIndex()
4715 ol.endIndexSection(isCompoundIndex);
4717 if (annotatedStructsPrinted>0)
4719 ol.startIndexSection(isCompoundIndex);
4720 ol.parseText(/*projPrefix+*/theTranslator->trStructIndex());
4721 ol.endIndexSection(isCompoundIndex);
4723 if (annotatedExceptionsPrinted>0)
4725 ol.startIndexSection(isCompoundIndex);
4726 ol.parseText(/*projPrefix+*/theTranslator->trExceptionIndex());
4727 ol.endIndexSection(isCompoundIndex);
4729 if (documentedFiles>0)
4731 ol.startIndexSection(isFileIndex);
4732 ol.parseText(/*projPrefix+*/theTranslator->trFileIndex());
4733 ol.endIndexSection(isFileIndex);
4736 ol.enable(OutputGenerator::Docbook);
4738 if (documentedGroups>0)
4740 ol.startIndexSection(isModuleDocumentation);
4741 ol.parseText(/*projPrefix+*/theTranslator->trModuleDocumentation());
4742 ol.endIndexSection(isModuleDocumentation);
4744 if (documentedNamespaces>0)
4746 ol.startIndexSection(isNamespaceDocumentation);
4747 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModuleDocumentation():theTranslator->trNamespaceDocumentation()));
4748 ol.endIndexSection(isNamespaceDocumentation);
4750 if (annotatedInterfacesPrinted>0)
4752 ol.startIndexSection(isClassDocumentation);
4753 ol.parseText(/*projPrefix+*/theTranslator->trInterfaceDocumentation());
4754 ol.endIndexSection(isClassDocumentation);
4756 if (annotatedClassesPrinted>0)
4758 ol.startIndexSection(isClassDocumentation);
4759 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trTypeDocumentation():theTranslator->trClassDocumentation()));
4760 ol.endIndexSection(isClassDocumentation);
4762 if (annotatedStructsPrinted>0)
4764 ol.startIndexSection(isClassDocumentation);
4765 ol.parseText(/*projPrefix+*/theTranslator->trStructDocumentation());
4766 ol.endIndexSection(isClassDocumentation);
4768 if (annotatedExceptionsPrinted>0)
4770 ol.startIndexSection(isClassDocumentation);
4771 ol.parseText(/*projPrefix+*/theTranslator->trExceptionDocumentation());
4772 ol.endIndexSection(isClassDocumentation);
4774 if (documentedFiles>0)
4776 ol.startIndexSection(isFileDocumentation);
4777 ol.parseText(/*projPrefix+*/theTranslator->trFileDocumentation());
4778 ol.endIndexSection(isFileDocumentation);
4780 if (Doxygen::exampleSDict->count()>0)
4782 ol.startIndexSection(isExampleDocumentation);
4783 ol.parseText(/*projPrefix+*/theTranslator->trExampleDocumentation());
4784 ol.endIndexSection(isExampleDocumentation);
4786 ol.endIndexSection(isEndIndex);
4789 if (Doxygen::mainPage)
4791 Doxygen::insideMainPage=TRUE;
4792 ol.disable(OutputGenerator::Man);
4793 startFile(ol,Doxygen::mainPage->name(),0,Doxygen::mainPage->title());
4795 ol.startTextBlock();
4796 ol.generateDoc(defFileName,defLine,Doxygen::mainPage,0,
4797 Doxygen::mainPage->documentation(),FALSE,FALSE
4801 ol.enable(OutputGenerator::Man);
4802 Doxygen::insideMainPage=FALSE;
4805 ol.popGeneratorState();
4808 static QArray<bool> indexWritten;
4810 static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry> &entries)
4812 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
4813 QListIterator<LayoutNavEntry> li(entries);
4814 LayoutNavEntry *lne;
4815 for (li.toFirst();(lne=li.current());++li)
4817 LayoutNavEntry::Kind kind = lne->kind();
4818 uint index = (uint)kind;
4819 if (index>=indexWritten.size())
4822 uint oldSize = indexWritten.size();
4823 uint newSize = index+1;
4824 indexWritten.resize(newSize);
4825 for (i=oldSize;i<newSize;i++) indexWritten.at(i)=FALSE;
4827 //printf("starting %s kind=%d\n",lne->title().data(),lne->kind());
4828 bool addToIndex=lne->visible();
4829 bool needsClosing=FALSE;
4830 if (!indexWritten.at(index))
4834 case LayoutNavEntry::MainPage:
4835 msg("Generating index page...\n");
4838 case LayoutNavEntry::Pages:
4839 msg("Generating page index...\n");
4842 case LayoutNavEntry::Modules:
4843 msg("Generating module index...\n");
4844 writeGroupIndex(ol);
4846 case LayoutNavEntry::Namespaces:
4848 static bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
4851 if (documentedNamespaces>0 && addToIndex)
4853 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
4854 Doxygen::indexList->incContentsDepth();
4857 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne) // for backward compatibility with old layout file
4859 msg("Generating namespace index...\n");
4860 writeNamespaceIndex(ol);
4865 case LayoutNavEntry::NamespaceList:
4867 static bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
4870 msg("Generating namespace index...\n");
4871 writeNamespaceIndex(ol);
4875 case LayoutNavEntry::NamespaceMembers:
4876 msg("Generating namespace member index...\n");
4877 writeNamespaceMemberIndex(ol);
4879 case LayoutNavEntry::Classes:
4880 if (annotatedClasses>0 && addToIndex)
4882 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
4883 Doxygen::indexList->incContentsDepth();
4886 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne) // for backward compatibility with old layout file
4888 msg("Generating annotated compound index...\n");
4889 writeAnnotatedIndex(ol);
4892 case LayoutNavEntry::ClassList:
4893 msg("Generating annotated compound index...\n");
4894 writeAnnotatedIndex(ol);
4896 case LayoutNavEntry::ClassIndex:
4897 msg("Generating alphabetical compound index...\n");
4898 writeAlphabeticalIndex(ol);
4900 case LayoutNavEntry::ClassHierarchy:
4901 msg("Generating hierarchical class index...\n");
4902 writeHierarchicalIndex(ol);
4903 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
4905 msg("Generating graphical class hierarchy...\n");
4906 writeGraphicalClassHierarchy(ol);
4909 case LayoutNavEntry::ClassMembers:
4912 msg("Generating member index...\n");
4913 writeClassMemberIndex(ol);
4916 case LayoutNavEntry::Interfaces:
4917 if (sliceOpt && annotatedInterfaces>0 && addToIndex)
4919 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
4920 Doxygen::indexList->incContentsDepth();
4924 case LayoutNavEntry::InterfaceList:
4927 msg("Generating annotated interface index...\n");
4928 writeAnnotatedInterfaceIndex(ol);
4931 case LayoutNavEntry::InterfaceIndex:
4934 msg("Generating alphabetical interface index...\n");
4935 writeAlphabeticalInterfaceIndex(ol);
4938 case LayoutNavEntry::InterfaceHierarchy:
4941 msg("Generating hierarchical interface index...\n");
4942 writeHierarchicalInterfaceIndex(ol);
4943 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
4945 msg("Generating graphical interface hierarchy...\n");
4946 writeGraphicalInterfaceHierarchy(ol);
4950 case LayoutNavEntry::Structs:
4951 if (sliceOpt && annotatedStructs>0 && addToIndex)
4953 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
4954 Doxygen::indexList->incContentsDepth();
4958 case LayoutNavEntry::StructList:
4961 msg("Generating annotated struct index...\n");
4962 writeAnnotatedStructIndex(ol);
4965 case LayoutNavEntry::StructIndex:
4968 msg("Generating alphabetical struct index...\n");
4969 writeAlphabeticalStructIndex(ol);
4972 case LayoutNavEntry::Exceptions:
4973 if (sliceOpt && annotatedExceptions>0 && addToIndex)
4975 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
4976 Doxygen::indexList->incContentsDepth();
4980 case LayoutNavEntry::ExceptionList:
4983 msg("Generating annotated exception index...\n");
4984 writeAnnotatedExceptionIndex(ol);
4987 case LayoutNavEntry::ExceptionIndex:
4990 msg("Generating alphabetical exception index...\n");
4991 writeAlphabeticalExceptionIndex(ol);
4994 case LayoutNavEntry::ExceptionHierarchy:
4997 msg("Generating hierarchical exception index...\n");
4998 writeHierarchicalExceptionIndex(ol);
4999 if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY))
5001 msg("Generating graphical exception hierarchy...\n");
5002 writeGraphicalExceptionHierarchy(ol);
5006 case LayoutNavEntry::Files:
5008 static bool showFiles = Config_getBool(SHOW_FILES);
5011 if (documentedHtmlFiles>0 && addToIndex)
5013 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
5014 Doxygen::indexList->incContentsDepth();
5017 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne) // for backward compatibility with old layout file
5019 msg("Generating file index...\n");
5025 case LayoutNavEntry::FileList:
5027 static bool showFiles = Config_getBool(SHOW_FILES);
5030 msg("Generating file index...\n");
5035 case LayoutNavEntry::FileGlobals:
5036 msg("Generating file member index...\n");
5037 writeFileMemberIndex(ol);
5039 case LayoutNavEntry::Examples:
5040 msg("Generating example index...\n");
5041 writeExampleIndex(ol);
5043 case LayoutNavEntry::User:
5045 // prepend a ! or ^ marker to the URL to avoid tampering with it
5046 QCString url = correctURL(lne->url(),"!"); // add ! to relative URL
5047 bool isRelative=url.at(0)=='!';
5048 if (!url.isEmpty() && !isRelative) // absolute URL
5050 url.prepend("^"); // prepend ^ to absolute URL
5052 bool isRef = lne->baseFile().left(4)=="@ref" || lne->baseFile().left(4)=="\\ref";
5053 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,url,0,FALSE,isRef || isRelative);
5056 case LayoutNavEntry::UserGroup:
5059 QCString url = correctURL(lne->url(),"!"); // add ! to relative URL
5064 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,0,0,FALSE,FALSE);
5068 bool isRelative=url.at(0)=='!';
5069 if (!isRelative) // absolute URL
5071 url.prepend("^"); // prepend ^ to absolute URL
5073 bool isRef = lne->baseFile().left(4)=="@ref" || lne->baseFile().left(4)=="\\ref";
5074 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,url,0,FALSE,isRef || isRelative);
5079 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0,TRUE,TRUE);
5081 Doxygen::indexList->incContentsDepth();
5084 writeUserGroupStubPage(ol,lne);
5086 case LayoutNavEntry::None:
5087 assert(kind != LayoutNavEntry::None); // should never happen, means not properly initialized
5090 if (kind!=LayoutNavEntry::User && kind!=LayoutNavEntry::UserGroup) // User entry may appear multiple times
5092 indexWritten.at(index)=TRUE;
5095 writeIndexHierarchyEntries(ol,lne->children());
5100 case LayoutNavEntry::Namespaces:
5101 case LayoutNavEntry::Classes:
5102 case LayoutNavEntry::Files:
5103 case LayoutNavEntry::UserGroup:
5104 Doxygen::indexList->decContentsDepth();
5110 //printf("ending %s kind=%d\n",lne->title().data(),lne->kind());
5114 static bool quickLinkVisible(LayoutNavEntry::Kind kind)
5116 static bool showFiles = Config_getBool(SHOW_FILES);
5117 static bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
5118 static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
5121 case LayoutNavEntry::MainPage: return TRUE;
5122 case LayoutNavEntry::User: return TRUE;
5123 case LayoutNavEntry::UserGroup: return TRUE;
5124 case LayoutNavEntry::Pages: return indexedPages>0;
5125 case LayoutNavEntry::Modules: return documentedGroups>0;
5126 case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces;
5127 case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces;
5128 case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0;
5129 case LayoutNavEntry::Classes: return annotatedClasses>0;
5130 case LayoutNavEntry::ClassList: return annotatedClasses>0;
5131 case LayoutNavEntry::ClassIndex: return annotatedClasses>0;
5132 case LayoutNavEntry::ClassHierarchy: return hierarchyClasses>0;
5133 case LayoutNavEntry::ClassMembers: return documentedClassMembers[CMHL_All]>0 && !sliceOpt;
5134 case LayoutNavEntry::Interfaces: return annotatedInterfaces>0;
5135 case LayoutNavEntry::InterfaceList: return annotatedInterfaces>0;
5136 case LayoutNavEntry::InterfaceIndex: return annotatedInterfaces>0;
5137 case LayoutNavEntry::InterfaceHierarchy: return hierarchyInterfaces>0;
5138 case LayoutNavEntry::Structs: return annotatedStructs>0;
5139 case LayoutNavEntry::StructList: return annotatedStructs>0;
5140 case LayoutNavEntry::StructIndex: return annotatedStructs>0;
5141 case LayoutNavEntry::Exceptions: return annotatedExceptions>0;
5142 case LayoutNavEntry::ExceptionList: return annotatedExceptions>0;
5143 case LayoutNavEntry::ExceptionIndex: return annotatedExceptions>0;
5144 case LayoutNavEntry::ExceptionHierarchy: return hierarchyExceptions>0;
5145 case LayoutNavEntry::Files: return documentedHtmlFiles>0 && showFiles;
5146 case LayoutNavEntry::FileList: return documentedHtmlFiles>0 && showFiles;
5147 case LayoutNavEntry::FileGlobals: return documentedFileMembers[FMHL_All]>0;
5148 case LayoutNavEntry::Examples: return Doxygen::exampleSDict->count()>0;
5149 case LayoutNavEntry::None: // should never happen, means not properly initialized
5150 assert(kind != LayoutNavEntry::None);
5157 void renderMemberIndicesAsJs(FTextStream &t,
5158 int total,const int *numDocumented,const LetterToIndexMap<MemberIndexList> *memberLists,
5159 const T *(*getInfo)(int hl))
5161 // index items per category member lists
5162 bool firstMember=TRUE;
5163 for (int i=0;i<total;i++)
5165 if (numDocumented[i]>0)
5173 t << endl << "{text:\"" << convertToJSString(getInfo(i)->title) << "\",url:\""
5174 << convertToJSString(getInfo(i)->fname+Doxygen::htmlFileExtension, false) << "\"";
5176 // Check if we have many members, then add sub entries per letter...
5177 // quick alphabetical index
5178 bool quickIndex = numDocumented[i]>maxItemsBeforeQuickIndex;
5181 bool multiPageIndex=FALSE;
5182 if (numDocumented[i]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
5184 multiPageIndex=TRUE;
5186 t << ",children:[" << endl;
5187 bool firstLetter=TRUE;
5188 SIntDict<MemberIndexList>::Iterator it(memberLists[i]);
5189 MemberIndexList *ml;
5190 for (it.toFirst();(ml=it.current());++it)
5192 if (!firstLetter) t << "," << endl;
5193 uint letter = ml->letter();
5194 QCString is = letterToLabel(letter);
5195 QCString ci = QString(QChar(letter)).utf8();
5197 QCString extension=Doxygen::htmlFileExtension;
5198 QCString fullName = getInfo(i)->fname;
5199 if (!multiPageIndex || firstLetter)
5200 anchor=fullName+extension+"#index_";
5201 else // other pages of multi page index
5202 anchor=fullName+"_"+is+extension+"#index_";
5203 t << "{text:\"" << convertToJSString(ci) << "\",url:\""
5204 << convertToJSString(anchor+convertToId(is), false) << "\"}";
5218 static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
5220 QListIterator<LayoutNavEntry> li(root->children());
5221 LayoutNavEntry *entry;
5223 for (li.toFirst();(entry=li.current());++li)
5225 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
5227 if (count>0) // at least one item is visible
5229 bool firstChild = TRUE;
5230 if (!first) t << ",";
5231 t << "children:[" << endl;
5232 for (li.toFirst();(entry=li.current());++li)
5234 if (entry->visible() && quickLinkVisible(entry->kind()))
5236 if (!firstChild) t << "," << endl;
5238 QCString url = entry->url();
5239 t << "{text:\"" << convertToJSString(entry->title()) << "\",url:\""
5240 << convertToJSString(url, false) << "\"";
5241 bool hasChildren=FALSE;
5242 if (entry->kind()==LayoutNavEntry::NamespaceMembers)
5244 renderMemberIndicesAsJs(t,NMHL_Total,documentedNamespaceMembers,
5245 g_namespaceIndexLetterUsed,getNmhlInfo);
5247 else if (entry->kind()==LayoutNavEntry::ClassMembers)
5249 renderMemberIndicesAsJs(t,CMHL_Total,documentedClassMembers,
5250 g_memberIndexLetterUsed,getCmhlInfo);
5252 else if (entry->kind()==LayoutNavEntry::FileGlobals)
5254 renderMemberIndicesAsJs(t,FMHL_Total,documentedFileMembers,
5255 g_fileIndexLetterUsed,getFmhlInfo);
5257 else // recursive into child list
5259 hasChildren = renderQuickLinksAsJs(t,entry,FALSE);
5261 if (hasChildren) t << "]";
5269 static void writeMenuData()
5271 if (!Config_getBool(GENERATE_HTML) || Config_getBool(DISABLE_INDEX)) return;
5272 QCString outputDir = Config_getBool(HTML_OUTPUT);
5273 QFile f(outputDir+"/menudata.js");
5274 LayoutNavEntry *root = LayoutDocManager::instance().rootNavEntry();
5275 if (f.open(IO_WriteOnly))
5278 t << "/*\n@ @licstart The following is the entire license notice for the\n"
5279 "JavaScript code in this file.\n\nCopyright (C) 1997-2017 by Dimitri van Heesch\n\n"
5280 "This program is free software; you can redistribute it and/or modify\n"
5281 "it under the terms of the GNU General Public License as published by\n"
5282 "the Free Software Foundation; either version 2 of the License, or\n"
5283 "(at your option) any later version.\n\n"
5284 "This program is distributed in the hope that it will be useful,\n"
5285 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
5286 " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
5287 " GNU General Public License for more details.\n\n"
5288 "You should have received a copy of the GNU General Public License along\n"
5289 "with this program; if not, write to the Free Software Foundation, Inc.,\n"
5290 "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n"
5291 "@licend The above is the entire license notice\n"
5292 "for the JavaScript code in this file\n"
5294 t << "var menudata={";
5295 bool hasChildren = renderQuickLinksAsJs(t,root,TRUE);
5296 if (hasChildren) t << "]";
5301 void writeIndexHierarchy(OutputList &ol)
5304 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry();
5307 writeIndexHierarchyEntries(ol,lne->children());