1 /******************************************************************************
5 * Copyright (C) 1997-2014 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.
24 #include <qtextstream.h>
25 #include <qdatetime.h>
34 #include "outputlist.h"
44 #include "vhdldocgen.h"
46 #include "memberlist.h"
47 #include "classlist.h"
48 #include "namespacedef.h"
51 #define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX 200
52 #define MAX_ITEMS_BEFORE_QUICK_INDEX 30
56 int annotatedClassesPrinted;
60 int documentedNamespaces;
62 int documentedClassMembers[CMHL_Total];
63 int documentedFileMembers[FMHL_Total];
64 int documentedNamespaceMembers[NMHL_Total];
65 int documentedHtmlFiles;
69 static int countClassHierarchy();
70 static void countFiles(int &htmlFiles,int &files);
71 static int countGroups();
72 static int countDirs();
73 static int countNamespaces();
74 static int countAnnotatedClasses(int *cp);
75 static void countRelatedPages(int &docPages,int &indexPages);
77 void countDataStructures()
79 annotatedClasses = countAnnotatedClasses(&annotatedClassesPrinted); // "classes" + "annotated"
80 hierarchyClasses = countClassHierarchy(); // "hierarchy"
81 countFiles(documentedHtmlFiles,documentedFiles); // "files"
82 countRelatedPages(documentedPages,indexedPages); // "pages"
83 documentedGroups = countGroups(); // "modules"
84 documentedNamespaces = countNamespaces(); // "namespaces"
85 documentedDirs = countDirs(); // "dirs"
91 static void startIndexHierarchy(OutputList &ol,int level)
93 ol.pushGeneratorState();
94 ol.disable(OutputGenerator::Man);
95 ol.disable(OutputGenerator::Html);
96 if (level<6) ol.startIndexList();
98 ol.disable(OutputGenerator::Latex);
99 ol.disable(OutputGenerator::RTF);
101 ol.popGeneratorState();
104 static void endIndexHierarchy(OutputList &ol,int level)
106 ol.pushGeneratorState();
107 ol.disable(OutputGenerator::Man);
108 ol.disable(OutputGenerator::Html);
109 if (level<6) ol.endIndexList();
111 ol.disable(OutputGenerator::Latex);
112 ol.disable(OutputGenerator::RTF);
114 ol.popGeneratorState();
117 //----------------------------------------------------------------------------
119 class MemberIndexList : public QList<MemberDef>
122 typedef MemberDef ElementType;
123 MemberIndexList(uint letter) : QList<MemberDef>(), m_letter(letter) {}
124 ~MemberIndexList() {}
125 int compareValues(const MemberDef *md1, const MemberDef *md2) const
127 int result = qstricmp(md1->name(),md2->name());
130 result = qstricmp(md1->qualifiedName(),md2->qualifiedName());
134 uint letter() const { return m_letter; }
139 static LetterToIndexMap<MemberIndexList> g_memberIndexLetterUsed[CMHL_Total];
140 static LetterToIndexMap<MemberIndexList> g_fileIndexLetterUsed[FMHL_Total];
141 static LetterToIndexMap<MemberIndexList> g_namespaceIndexLetterUsed[NMHL_Total];
143 const int maxItemsBeforeQuickIndex = MAX_ITEMS_BEFORE_QUICK_INDEX;
145 //----------------------------------------------------------------------------
147 //----------------------------------------------------------------------------
149 static void startQuickIndexList(OutputList &ol,bool letterTabs=FALSE)
151 bool fancyTabs = TRUE;
156 ol.writeString(" <div id=\"navrow4\" class=\"tabs3\">\n");
160 ol.writeString(" <div id=\"navrow3\" class=\"tabs2\">\n");
162 ol.writeString(" <ul class=\"tablist\">\n");
166 ol.writeString(" <div class=\"qindex\">");
170 static void endQuickIndexList(OutputList &ol)
172 bool fancyTabs = TRUE;
175 ol.writeString(" </ul>\n");
177 ol.writeString(" </div>\n");
180 static void startQuickIndexItem(OutputList &ol,const char *l,
181 bool hl,bool compact,bool &first)
183 bool fancyTabs = TRUE;
184 if (!first && compact && !fancyTabs) ol.writeString(" | ");
188 ol.writeString(" <li");
189 if (hl) ol.writeString(" class=\"current\"");
190 ol.writeString("><a ");
194 if (!compact) ol.writeString("<li>");
197 ol.writeString("<a class=\"qindexHL\" ");
201 ol.writeString("<a class=\"qindex\" ");
204 ol.writeString("href=\"");
206 ol.writeString("\">");
209 ol.writeString("<span>");
213 static void endQuickIndexItem(OutputList &ol)
216 if (fancyTabs) ol.writeString("</span>");
217 ol.writeString("</a>");
218 if (fancyTabs) ol.writeString("</li>\n");
221 // don't make this static as it is called from a template function and some
222 // old compilers don't support calls to static functions from a template.
223 QCString fixSpaces(const QCString &s)
225 return substitute(s," "," ");
228 void startTitle(OutputList &ol,const char *fileName,Definition *def)
230 ol.startHeaderSection();
231 if (def) def->writeSummaryLinks(ol);
232 ol.startTitleHead(fileName);
233 ol.pushGeneratorState();
234 ol.disable(OutputGenerator::Man);
237 void endTitle(OutputList &ol,const char *fileName,const char *name)
239 ol.popGeneratorState();
240 ol.endTitleHead(fileName,name);
241 ol.endHeaderSection();
244 void startFile(OutputList &ol,const char *name,const char *manName,
245 const char *title,HighlightedItem hli,bool additionalIndices,
246 const char *altSidebarName)
248 static bool disableIndex = Config_getBool("DISABLE_INDEX");
249 ol.startFile(name,manName,title);
250 ol.startQuickIndices();
253 ol.writeQuickLinks(TRUE,hli,name);
255 if (!additionalIndices)
257 ol.endQuickIndices();
259 ol.writeSplitBar(altSidebarName ? altSidebarName : name);
260 ol.writeSearchInfo();
263 void endFile(OutputList &ol,bool skipNavIndex,bool skipEndContents,
264 const QCString &navPath)
266 static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
267 ol.pushGeneratorState();
268 ol.disableAllBut(OutputGenerator::Html);
271 if (!skipEndContents) ol.endContents();
272 if (generateTreeView)
274 ol.writeString("</div><!-- doc-content -->\n");
277 ol.writeFooter(navPath); // write the footer
278 ol.popGeneratorState();
282 void endFileWithNavPath(Definition *d,OutputList &ol)
284 static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");
286 if (generateTreeView)
288 ol.pushGeneratorState();
289 ol.disableAllBut(OutputGenerator::Html);
290 ol.writeString("</div><!-- doc-content -->\n");
291 ol.popGeneratorState();
292 navPath = d->navigationPathAsString();
294 endFile(ol,generateTreeView,TRUE,navPath);
297 //----------------------------------------------------------------------
299 void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
300 const QCString &name,const QCString &anchor,
301 bool addToIndex=TRUE,bool preventSeparateIndex=FALSE)
303 bool hasMembers = def->getMemberLists().count()>0 || def->getMemberGroupSDict()!=0;
304 Doxygen::indexList->addContentsItem(hasMembers,name,
305 def->getReference(),def->getOutputFileBase(),anchor,
306 hasMembers && !preventSeparateIndex,
310 ClassSDict *classes = def->getClassSDict();
314 ClassSDict::Iterator it(*classes);
315 for (;(cd=it.current());++it)
317 if (cd->isLinkable()) numClasses++;
320 //printf("addMembersToIndex(def=%s hasMembers=%d numClasses=%d)\n",def->name().data(),hasMembers,numClasses);
321 if (hasMembers || numClasses>0)
323 Doxygen::indexList->incContentsDepth();
324 QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(part));
326 for (eli.toFirst();(lde=eli.current());++eli)
328 if (lde->kind()==LayoutDocEntry::MemberDef)
330 LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
331 MemberList *ml = def->getMemberList(lmd->type);
334 MemberListIterator mi(*ml);
336 for (mi.toFirst();(md=mi.current());++mi)
338 MemberList *enumList = md->enumFieldList();
339 bool isDir = enumList!=0 && md->isEnumerate();
340 bool isAnonymous = md->name().find('@')!=-1;
341 static bool hideUndocMembers = Config_getBool("HIDE_UNDOC_MEMBERS");
342 static bool extractStatic = Config_getBool("EXTRACT_STATIC");
344 (!hideUndocMembers || md->hasDocumentation()) &&
345 (!md->isStatic() || extractStatic)
348 if (md->getOuterScope()==def || md->getOuterScope()==Doxygen::globalScope)
350 Doxygen::indexList->addContentsItem(isDir,
351 md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
353 else // inherited member
355 Doxygen::indexList->addContentsItem(isDir,
356 md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
363 Doxygen::indexList->incContentsDepth();
365 MemberListIterator emli(*enumList);
367 for (emli.toFirst();(emd=emli.current());++emli)
369 if (!hideUndocMembers || emd->hasDocumentation())
371 if (emd->getOuterScope()==def || emd->getOuterScope()==Doxygen::globalScope)
373 Doxygen::indexList->addContentsItem(FALSE,
374 emd->name(),emd->getReference(),emd->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
376 else // inherited member
378 Doxygen::indexList->addContentsItem(FALSE,
379 emd->name(),def->getReference(),def->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
385 Doxygen::indexList->decContentsDepth();
391 else if (lde->kind()==LayoutDocEntry::NamespaceClasses ||
392 lde->kind()==LayoutDocEntry::FileClasses ||
393 lde->kind()==LayoutDocEntry::ClassNestedClasses
399 ClassSDict::Iterator it(*classes);
400 for (;(cd=it.current());++it)
402 if (cd->isLinkable() && (cd->partOfGroups()==0 || def->definitionType()==Definition::TypeGroup))
404 static bool inlineSimpleStructs = Config_getBool("INLINE_SIMPLE_STRUCTS");
405 bool isNestedClass = def->definitionType()==Definition::TypeClass;
406 addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(FALSE),cd->anchor(),
407 addToIndex && (isNestedClass || (cd->isSimple() && inlineSimpleStructs)),
408 preventSeparateIndex || cd->isEmbeddedInOuterScope());
415 Doxygen::indexList->decContentsDepth();
420 //----------------------------------------------------------------------------
421 /*! Generates HTML Help tree of classes */
423 static void writeClassTree(OutputList &ol,const BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex)
426 BaseClassListIterator bcli(*bcl);
428 for ( ; bcli.current() ; ++bcli)
430 ClassDef *cd=bcli.current()->classDef;
431 if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
437 if (cd->getLanguage()==SrcLangExt_VHDL)
439 b=hasVisibleRoot(cd->subClasses());
443 b=hasVisibleRoot(cd->baseClasses());
446 if (cd->isVisibleInHierarchy() && b) // hasVisibleRoot(cd->baseClasses()))
450 startIndexHierarchy(ol,level);
453 Doxygen::indexList->incContentsDepth();
457 ftv->incContentsDepth();
461 ol.startIndexListItem();
462 //printf("Passed...\n");
463 bool hasChildren = !cd->visited && !hideSuper && classHasVisibleChildren(cd);
464 //printf("tree4: Has children %s: %d\n",cd->name().data(),hasChildren);
465 if (cd->isLinkable())
467 //printf("Writing class %s\n",cd->displayName().data());
468 ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
469 ol.parseText(cd->displayName());
470 ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
471 if (cd->isReference())
473 ol.startTypewriter();
474 ol.docify(" [external]");
479 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor());
483 if (cd->getLanguage()==SrcLangExt_VHDL)
485 ftv->addContentsItem(hasChildren,bcli.current()->usedName,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
489 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
495 ol.startIndexItem(0,0);
496 ol.parseText(cd->name());
497 ol.endIndexItem(0,0);
500 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),0,0,0);
504 ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE,cd);
509 //printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited);
510 bool wasVisited=cd->visited;
512 if (cd->getLanguage()==SrcLangExt_VHDL)
514 writeClassTree(ol,cd->baseClasses(),wasVisited,level+1,ftv,addToIndex);
518 writeClassTree(ol,cd->subClasses(),wasVisited,level+1,ftv,addToIndex);
521 ol.endIndexListItem();
526 endIndexHierarchy(ol,level);
529 Doxygen::indexList->decContentsDepth();
533 ftv->decContentsDepth();
538 //----------------------------------------------------------------------------
540 static bool dirHasVisibleChildren(DirDef *dd)
542 if (dd->hasDocumentation()) return TRUE;
544 QListIterator<FileDef> fli(*dd->getFiles());
546 for (fli.toFirst();(fd=fli.current());++fli)
549 if (fileVisibleInIndex(fd,genSourceFile))
559 QListIterator<DirDef> dli(dd->subDirs());
561 for (dli.toFirst();(subdd=dli.current());++dli)
563 if (dirHasVisibleChildren(subdd))
571 //----------------------------------------------------------------------------
572 static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv,bool addToIndex)
576 warn(dd->getDefFileName(),dd->getDefLine(),
577 "maximum nesting level exceeded for directory %s: "
578 "check for possible recursive directory relation!\n",dd->name().data()
583 if (!dirHasVisibleChildren(dd))
588 static bool tocExpand = TRUE; //Config_getBool("TOC_EXPAND");
589 bool isDir = dd->subDirs().count()>0 || // there are subdirs
590 (tocExpand && // or toc expand and
591 dd->getFiles() && dd->getFiles()->count()>0 // there are files
593 //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
596 Doxygen::indexList->addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0,TRUE,TRUE);
597 Doxygen::indexList->incContentsDepth();
601 ftv->addContentsItem(isDir,dd->shortName(),dd->getReference(),
602 dd->getOutputFileBase(),0,FALSE,TRUE,dd);
603 ftv->incContentsDepth();
606 ol.startIndexListItem();
607 ol.startIndexItem(dd->getReference(),dd->getOutputFileBase());
608 ol.parseText(dd->shortName());
609 ol.endIndexItem(dd->getReference(),dd->getOutputFileBase());
610 if (dd->isReference())
612 ol.startTypewriter();
613 ol.docify(" [external]");
617 // write sub directories
618 if (dd->subDirs().count()>0)
620 startIndexHierarchy(ol,level+1);
621 QListIterator<DirDef> dli(dd->subDirs());
623 for (dli.toFirst();(subdd=dli.current());++dli)
625 writeDirTreeNode(ol,subdd,level+1,ftv,addToIndex);
627 endIndexHierarchy(ol,level+1);
630 FileList *fileList=dd->getFiles();
632 if (fileList && fileList->count()>0)
634 QListIterator<FileDef> it(*fileList);
636 for (;(fd=it.current());++it)
638 //static bool allExternals = Config_getBool("ALLEXTERNALS");
639 //if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
644 if (fileVisibleInIndex(fd,genSourceFile))
648 else if (genSourceFile)
655 startIndexHierarchy(ol,level+1);
656 for (it.toFirst();(fd=it.current());++it)
659 doc = fileVisibleInIndex(fd,src);
664 reference = fd->getReference();
665 outputBase = fd->getOutputFileBase();
669 ol.startIndexListItem();
670 ol.startIndexItem(reference,outputBase);
671 ol.parseText(fd->displayName());
672 ol.endIndexItem(reference,outputBase);
673 ol.endIndexListItem();
674 if (ftv && (src || doc))
676 ftv->addContentsItem(FALSE,
678 reference,outputBase,
683 endIndexHierarchy(ol,level+1);
687 if (tocExpand && addToIndex)
689 // write files of this directory
692 QListIterator<FileDef> it(*fileList);
694 for (;(fd=it.current());++it)
696 //static bool allExternals = Config_getBool("ALLEXTERNALS");
697 //if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
699 doc = fileVisibleInIndex(fd,src);
702 addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString(),TRUE);
706 Doxygen::indexList->addContentsItem(
707 FALSE, convertToHtml(fd->name(),TRUE), 0,
708 fd->getSourceFileBase(), 0, FALSE, TRUE, fd);
713 ol.endIndexListItem();
717 Doxygen::indexList->decContentsDepth();
721 ftv->decContentsDepth();
725 static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
729 ol.pushGeneratorState();
730 ol.disable(OutputGenerator::Html);
732 static bool fullPathNames = Config_getBool("FULL_PATH_NAMES");
733 startIndexHierarchy(ol,0);
736 SDict<DirDef>::Iterator dli(*Doxygen::directories);
738 for (dli.toFirst();(dd=dli.current());++dli)
740 if (dd->getOuterScope()==Doxygen::globalScope)
742 writeDirTreeNode(ol,dd,0,ftv,addToIndex);
748 FileNameListIterator fnli(*Doxygen::inputNameList);
750 for (fnli.toFirst();(fn=fnli.current());++fnli)
752 FileNameIterator fni(*fn);
754 for (;(fd=fni.current());++fni)
756 static bool fullPathNames = Config_getBool("FULL_PATH_NAMES");
757 if (!fullPathNames || fd->getDirDef()==0) // top level file
760 doc = fileVisibleInIndex(fd,src);
761 QCString reference, outputBase;
764 reference = fd->getReference();
765 outputBase = fd->getOutputFileBase();
769 ftv->addContentsItem(FALSE,fd->displayName(),
770 reference, outputBase, 0,
777 addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString(),TRUE);
781 Doxygen::indexList->addContentsItem(
782 FALSE, convertToHtml(fd->name(),TRUE), 0,
783 fd->getSourceFileBase(), 0, FALSE, TRUE, fd);
790 endIndexHierarchy(ol,0);
793 ol.popGeneratorState();
798 //----------------------------------------------------------------------------
800 static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FTVHelp* ftv,bool addToIndex)
802 ClassSDict::Iterator cli(*cl);
803 for (;cli.current(); ++cli)
805 ClassDef *cd=cli.current();
806 //printf("class %s hasVisibleRoot=%d isVisibleInHierarchy=%d\n",
807 // cd->name().data(),
808 // hasVisibleRoot(cd->baseClasses()),
809 // cd->isVisibleInHierarchy()
812 if (cd->getLanguage()==SrcLangExt_VHDL)
814 if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
818 b=!hasVisibleRoot(cd->subClasses());
822 b=!hasVisibleRoot(cd->baseClasses());
825 if (b) //filter on root classes
827 if (cd->isVisibleInHierarchy()) // should it be visible
831 startIndexHierarchy(ol,0);
834 Doxygen::indexList->incContentsDepth();
838 ol.startIndexListItem();
839 bool hasChildren = !cd->visited && classHasVisibleChildren(cd);
840 //printf("list: Has children %s: %d\n",cd->name().data(),hasChildren);
841 if (cd->isLinkable())
843 //printf("Writing class %s isLinkable()=%d isLinkableInProject()=%d cd->templateMaster()=%p\n",
844 // cd->displayName().data(),cd->isLinkable(),cd->isLinkableInProject(),cd->templateMaster());
845 ol.startIndexItem(cd->getReference(),cd->getOutputFileBase());
846 ol.parseText(cd->displayName());
847 ol.endIndexItem(cd->getReference(),cd->getOutputFileBase());
848 if (cd->isReference())
850 ol.startTypewriter();
851 ol.docify(" [external]");
856 if (cd->getLanguage()!=SrcLangExt_VHDL) // prevents double insertion in Design Unit List
857 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE);
861 ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
866 ol.startIndexItem(0,0);
867 ol.parseText(cd->displayName());
868 ol.endIndexItem(0,0);
871 Doxygen::indexList->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE);
875 ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE,cd);
878 if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren)
880 writeClassTree(ol,cd->baseClasses(),cd->visited,1,ftv,addToIndex);
883 else if (hasChildren)
885 writeClassTree(ol,cd->subClasses(),cd->visited,1,ftv,addToIndex);
888 ol.endIndexListItem();
894 static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
896 initClassHierarchy(Doxygen::classSDict);
897 initClassHierarchy(Doxygen::hiddenClasses);
900 ol.pushGeneratorState();
901 ol.disable(OutputGenerator::Html);
904 writeClassTreeForList(ol,Doxygen::classSDict,started,ftv,addToIndex);
905 writeClassTreeForList(ol,Doxygen::hiddenClasses,started,ftv,addToIndex);
908 endIndexHierarchy(ol,0);
911 Doxygen::indexList->decContentsDepth();
916 ol.popGeneratorState();
920 //----------------------------------------------------------------------------
922 static int countClassesInTreeList(const ClassSDict &cl)
925 ClassSDict::Iterator cli(cl);
926 for (;cli.current(); ++cli)
928 ClassDef *cd=cli.current();
929 if (!hasVisibleRoot(cd->baseClasses())) // filter on root classes
931 if (cd->isVisibleInHierarchy()) // should it be visible
933 if (cd->subClasses()) // should have sub classes
943 static int countClassHierarchy()
946 initClassHierarchy(Doxygen::classSDict);
947 initClassHierarchy(Doxygen::hiddenClasses);
948 count+=countClassesInTreeList(*Doxygen::classSDict);
949 count+=countClassesInTreeList(*Doxygen::hiddenClasses);
953 //----------------------------------------------------------------------------
955 static void writeHierarchicalIndex(OutputList &ol)
957 if (hierarchyClasses==0) return;
958 ol.pushGeneratorState();
960 ol.disable(OutputGenerator::Man);
962 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
963 QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
964 bool addToIndex = lne==0 || lne->visible();
966 startFile(ol,"hierarchy",0, title, HLI_Hierarchy);
973 if (Config_getBool("HAVE_DOT") && Config_getBool("GRAPHICAL_HIERARCHY"))
975 ol.disable(OutputGenerator::Latex);
976 ol.disable(OutputGenerator::RTF);
978 ol.startTextLink("inherits",0);
979 ol.parseText(theTranslator->trGotoGraphicalHierarchy());
982 ol.enable(OutputGenerator::Latex);
983 ol.enable(OutputGenerator::RTF);
985 ol.parseText(lne ? lne->intro() : theTranslator->trClassHierarchyDescription());
989 // Static class hierarchy for Latex/RTF
991 ol.pushGeneratorState();
993 ol.disable(OutputGenerator::Html);
994 Doxygen::indexList->disable();
996 writeClassHierarchy(ol,0,addToIndex);
998 Doxygen::indexList->enable();
999 ol.popGeneratorState();
1003 // Dynamic class hierarchical index for HTML
1005 ol.pushGeneratorState();
1007 ol.disableAllBut(OutputGenerator::Html);
1012 Doxygen::indexList->addContentsItem(TRUE,title,0,"hierarchy",0,TRUE,TRUE);
1014 FTVHelp* ftv = new FTVHelp(FALSE);
1015 writeClassHierarchy(ol,ftv,addToIndex);
1017 FTextStream t(&outStr);
1018 ftv->generateTreeViewInline(t);
1019 ol.pushGeneratorState();
1020 ol.disableAllBut(OutputGenerator::Html);
1021 ol.writeString(outStr);
1022 ol.popGeneratorState();
1025 ol.popGeneratorState();
1030 ol.popGeneratorState();
1034 //----------------------------------------------------------------------------
1036 static void writeGraphicalClassHierarchy(OutputList &ol)
1038 if (hierarchyClasses==0) return;
1039 ol.disableAllBut(OutputGenerator::Html);
1040 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy);
1041 QCString title = lne ? lne->title() : theTranslator->trClassHierarchy();
1042 startFile(ol,"inherits",0,title,HLI_Hierarchy,FALSE,"hierarchy");
1044 ol.parseText(title);
1047 ol.startTextBlock();
1048 ol.startParagraph();
1049 ol.startTextLink("hierarchy",0);
1050 ol.parseText(theTranslator->trGotoTextualHierarchy());
1054 DotGfxHierarchyTable g;
1055 ol.writeGraphicalHierarchy(g);
1060 //----------------------------------------------------------------------------
1062 static void countFiles(int &htmlFiles,int &files)
1066 FileNameListIterator fnli(*Doxygen::inputNameList);
1068 for (;(fn=fnli.current());++fnli)
1070 FileNameIterator fni(*fn);
1072 for (;(fd=fni.current());++fni)
1075 doc = fileVisibleInIndex(fd,src);
1088 static void writeSingleFileIndex(OutputList &ol,FileDef *fd)
1090 //printf("Found filedef %s\n",fd->name().data());
1091 bool doc = fd->isLinkableInProject();
1092 bool src = fd->generateSourceFile();
1093 bool nameOk = !fd->isDocumentationFile();
1094 if (nameOk && (doc || src) && !fd->isReference())
1097 if (Config_getBool("FULL_PATH_NAMES"))
1099 path=stripFromPath(fd->getPath().copy());
1101 QCString fullName=fd->name();
1102 if (!path.isEmpty())
1104 if (path.at(path.length()-1)!='/') fullName.prepend("/");
1105 fullName.prepend(path);
1112 ol.writeObjectLink(0,fd->getOutputFileBase(),0,fd->name());
1115 // addMembersToIndex(fd,LayoutDocManager::File,fullName,QCString());
1121 ol.docify(fd->name());
1125 // Doxygen::indexList->addContentsItem(FALSE,fullName,0,0,0);
1130 ol.pushGeneratorState();
1131 ol.disableAllBut(OutputGenerator::Html);
1133 ol.startTextLink(fd->includeName(),0);
1135 ol.parseText(theTranslator->trCode());
1138 ol.popGeneratorState();
1141 bool hasBrief = !fd->briefDescription().isEmpty();
1142 ol.startIndexValue(hasBrief);
1147 fd->briefFile(),fd->briefLine(),
1149 fd->briefDescription(TRUE),
1150 FALSE, // index words
1153 TRUE, // single line
1154 TRUE // link from index
1158 ol.endIndexValue(fd->getOutputFileBase(),hasBrief);
1159 //ol.popGeneratorState();
1160 // --------------------------------------------------------
1164 //----------------------------------------------------------------------------
1166 static void writeFileIndex(OutputList &ol)
1168 if (documentedHtmlFiles==0) return;
1170 ol.pushGeneratorState();
1171 ol.disable(OutputGenerator::Man);
1172 if (documentedFiles==0) ol.disableAllBut(OutputGenerator::Html);
1174 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileList);
1175 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files); // fall back
1176 QCString title = lne ? lne->title() : theTranslator->trFileList();
1177 bool addToIndex = lne==0 || lne->visible();
1179 startFile(ol,"files",0,title,HLI_Files);
1181 //if (!Config_getString("PROJECT_NAME").isEmpty())
1183 // title.prepend(Config_getString("PROJECT_NAME")+" ");
1185 ol.parseText(title);
1188 ol.startTextBlock();
1192 Doxygen::indexList->addContentsItem(TRUE,title,0,"files",0,TRUE,TRUE);
1193 Doxygen::indexList->incContentsDepth();
1196 ol.parseText(lne ? lne->intro() : theTranslator->trFileListDescription(Config_getBool("EXTRACT_ALL")));
1204 ol.pushGeneratorState();
1205 ol.disable(OutputGenerator::Html);
1207 OutputNameDict outputNameDict(1009);
1208 OutputNameList outputNameList;
1209 outputNameList.setAutoDelete(TRUE);
1211 if (Config_getBool("FULL_PATH_NAMES"))
1213 // re-sort input files in (dir,file) output order instead of (file,dir) input order
1214 FileNameListIterator fnli(*Doxygen::inputNameList);
1216 for (fnli.toFirst();(fn=fnli.current());++fnli)
1218 FileNameIterator fni(*fn);
1220 for (;(fd=fni.current());++fni)
1222 QCString path=fd->getPath();
1223 if (path.isEmpty()) path="[external]";
1224 FileList *fl = outputNameDict.find(path);
1228 //printf("+ inserting %s---%s\n",fd->getPath().data(),fd->name().data());
1232 //printf("o inserting %s---%s\n",fd->getPath().data(),fd->name().data());
1233 fl = new FileList(path);
1235 outputNameList.append(fl);
1236 outputNameDict.insert(path,fl);
1242 ol.startIndexList();
1243 if (Config_getBool("FULL_PATH_NAMES"))
1245 outputNameList.sort();
1246 QListIterator<FileList> fnli(outputNameList);
1248 for (fnli.toFirst();(fl=fnli.current());++fnli)
1251 QListIterator<FileDef> it(*fl);
1253 for (;(fd=it.current());++it)
1255 writeSingleFileIndex(ol,fd);
1261 FileNameListIterator fnli(*Doxygen::inputNameList);
1263 for (fnli.toFirst();(fn=fnli.current());++fnli)
1265 FileNameIterator fni(*fn);
1267 for (;(fd=fni.current());++fni)
1269 writeSingleFileIndex(ol,fd);
1276 ol.popGeneratorState();
1279 // Hierarchical file index for HTML
1281 ol.pushGeneratorState();
1282 ol.disableAllBut(OutputGenerator::Html);
1284 FTVHelp* ftv = new FTVHelp(FALSE);
1285 writeDirHierarchy(ol,ftv,addToIndex);
1287 FTextStream t(&outStr);
1288 ftv->generateTreeViewInline(t);
1289 ol.writeString(outStr);
1292 ol.popGeneratorState();
1297 Doxygen::indexList->decContentsDepth();
1301 ol.popGeneratorState();
1304 //----------------------------------------------------------------------------
1305 static int countNamespaces()
1308 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
1310 for (;(nd=nli.current());++nli)
1312 if (nd->isLinkableInProject()) count++;
1317 //----------------------------------------------------------------------------
1319 void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalOnly)
1323 ClassSDict::Iterator cli(*clDict);
1325 for (;(cd=cli.current());++cli)
1327 if (cd->getLanguage()==SrcLangExt_VHDL)
1329 if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS ||
1330 (VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS
1335 if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ARCHITECTURECLASS)
1337 QCString n=cd->name();
1338 cd->setClassName(n.data());
1343 cd->getOuterScope()==0 ||
1344 cd->getOuterScope()==Doxygen::globalScope
1348 if (cd->getClassSDict())
1350 ClassSDict::Iterator ccit(*cd->getClassSDict());
1352 for (;(ccd=ccit.current());++ccit)
1354 if (ccd->isLinkableInProject() && ccd->templateMaster()==0)
1360 if (classVisibleInIndex(cd) && cd->templateMaster()==0)
1362 ftv->addContentsItem(count>0,cd->displayName(FALSE),cd->getReference(),
1363 cd->getOutputFileBase(),cd->anchor(),FALSE,TRUE,cd);
1365 /*cd->partOfGroups()==0 &&*/
1366 (cd->getOuterScope()==0 ||
1367 cd->getOuterScope()->definitionType()!=Definition::TypeClass
1371 addMembersToIndex(cd,LayoutDocManager::Class,
1372 cd->displayName(FALSE),
1374 cd->partOfGroups()==0 && !cd->isSimple());
1378 ftv->incContentsDepth();
1379 writeClassTree(cd->getClassSDict(),ftv,addToIndex,FALSE);
1380 ftv->decContentsDepth();
1388 static void writeNamespaceTree(NamespaceSDict *nsDict,FTVHelp *ftv,
1389 bool rootOnly,bool showClasses,bool addToIndex)
1393 NamespaceSDict::Iterator nli(*nsDict);
1395 for (nli.toFirst();(nd=nli.current());++nli)
1397 if (nd->localName().find('@')==-1 &&
1398 (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
1401 bool hasChildren = namespaceHasVisibleChild(nd,showClasses);
1402 bool isLinkable = nd->isLinkableInProject();
1408 ref = nd->getReference();
1409 file = nd->getOutputFileBase();
1410 if (nd->getLanguage()==SrcLangExt_VHDL) // UGLY HACK
1412 file=file.replace(0,qstrlen("namespace"),"class");
1416 if ((isLinkable && !showClasses) || hasChildren)
1418 ftv->addContentsItem(hasChildren,nd->localName(),ref,file,0,FALSE,TRUE,nd);
1422 Doxygen::indexList->addContentsItem(hasChildren,nd->localName(),ref,file,QCString(),
1423 hasChildren && !file.isEmpty(),addToIndex);
1426 //printf("*** writeNamespaceTree count=%d addToIndex=%d showClasses=%d classCount=%d\n",
1427 // count,addToIndex,showClasses,classCount);
1430 if (addToIndex) Doxygen::indexList->incContentsDepth();
1431 ftv->incContentsDepth();
1432 writeNamespaceTree(nd->getNamespaceSDict(),ftv,FALSE,showClasses,addToIndex);
1435 writeClassTree(nd->getClassSDict(),ftv,addToIndex,FALSE);
1437 ftv->decContentsDepth();
1438 if (addToIndex) Doxygen::indexList->decContentsDepth();
1447 static void writeNamespaceIndex(OutputList &ol)
1449 if (documentedNamespaces==0) return;
1450 ol.pushGeneratorState();
1451 ol.disable(OutputGenerator::Man);
1452 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceList);
1453 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces); // fall back
1454 QCString title = lne ? lne->title() : theTranslator->trNamespaceList();
1455 bool addToIndex = lne==0 || lne->visible();
1456 startFile(ol,"namespaces",0,title,HLI_Namespaces);
1458 ol.parseText(title);
1461 ol.startTextBlock();
1462 ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceListDescription(Config_getBool("EXTRACT_ALL")));
1468 // Linear namespace index for Latex/RTF
1470 ol.pushGeneratorState();
1471 ol.disable(OutputGenerator::Html);
1473 NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
1475 for (nli.toFirst();(nd=nli.current());++nli)
1477 if (nd->isLinkableInProject())
1481 ol.startIndexList();
1484 //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name());
1486 if (nd->getLanguage()==SrcLangExt_VHDL)
1488 ol.writeObjectLink(0, nd->getOutputFileBase().replace(0,qstrlen("namespace"),"class"),0,nd->displayName());
1492 ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->displayName());
1496 bool hasBrief = !nd->briefDescription().isEmpty();
1497 ol.startIndexValue(hasBrief);
1502 nd->briefFile(),nd->briefLine(),
1504 nd->briefDescription(TRUE),
1505 FALSE, // index words
1508 TRUE, // single line
1509 TRUE // link from index
1513 ol.endIndexValue(nd->getOutputFileBase(),hasBrief);
1517 if (!first) ol.endIndexList();
1519 ol.popGeneratorState();
1522 // Hierarchical namespace index for HTML
1524 ol.pushGeneratorState();
1525 ol.disableAllBut(OutputGenerator::Html);
1530 Doxygen::indexList->addContentsItem(TRUE,title,0,"namespaces",0,TRUE,TRUE);
1531 Doxygen::indexList->incContentsDepth();
1533 FTVHelp* ftv = new FTVHelp(FALSE);
1534 writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,FALSE,addToIndex);
1536 FTextStream t(&outStr);
1537 ftv->generateTreeViewInline(t);
1538 ol.writeString(outStr);
1542 Doxygen::indexList->decContentsDepth();
1546 ol.popGeneratorState();
1550 ol.popGeneratorState();
1553 //----------------------------------------------------------------------------
1555 static int countAnnotatedClasses(int *cp)
1559 ClassSDict::Iterator cli(*Doxygen::classSDict);
1561 for (;(cd=cli.current());++cli)
1563 if (cd->isLinkableInProject() && cd->templateMaster()==0)
1565 if (!cd->isEmbeddedInOuterScope())
1577 static void writeAnnotatedClassList(OutputList &ol)
1579 //LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
1580 //bool addToIndex = lne==0 || lne->visible();
1582 ol.startIndexList();
1583 ClassSDict::Iterator cli(*Doxygen::classSDict);
1586 for (cli.toFirst();(cd=cli.current());++cli)
1588 if (cd->getLanguage()==SrcLangExt_VHDL &&
1589 ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS ||
1590 (VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS)
1591 ) // no architecture
1596 ol.pushGeneratorState();
1597 if (cd->isEmbeddedInOuterScope())
1599 ol.disable(OutputGenerator::Latex);
1600 ol.disable(OutputGenerator::RTF);
1602 if (cd->isLinkableInProject() && cd->templateMaster()==0)
1604 QCString type=cd->compoundTypeString();
1606 if (cd->getLanguage()==SrcLangExt_VHDL)
1608 QCString prot= VhdlDocGen::getProtectionName((VhdlDocGen::VhdlClasses)cd->protection());
1609 ol.docify(prot.data());
1610 ol.writeString(" ");
1612 ol.writeObjectLink(0,cd->getOutputFileBase(),cd->anchor(),cd->displayName());
1614 bool hasBrief = !cd->briefDescription().isEmpty();
1615 ol.startIndexValue(hasBrief);
1619 cd->briefFile(),cd->briefLine(),
1621 cd->briefDescription(TRUE),
1622 FALSE, // indexWords
1625 TRUE, // single line
1626 TRUE // link from index
1629 ol.endIndexValue(cd->getOutputFileBase(),hasBrief);
1633 // addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(),cd->anchor());
1636 ol.popGeneratorState();
1641 static QCString letterToLabel(uint startLetter)
1644 if (startLetter>0x20 && startLetter<=0x7f) // printable ASCII character
1646 s[0]=(char)startLetter;
1651 const char hex[]="0123456789abcdef";
1655 if (startLetter>(1<<24)) // 4 byte character
1657 s[i++]=hex[(startLetter>>28)&0xf];
1658 s[i++]=hex[(startLetter>>24)&0xf];
1660 if (startLetter>(1<<16)) // 3 byte character
1662 s[i++]=hex[(startLetter>>20)&0xf];
1663 s[i++]=hex[(startLetter>>16)&0xf];
1665 if (startLetter>(1<<8)) // 2 byte character
1667 s[i++]=hex[(startLetter>>12)&0xf];
1668 s[i++]=hex[(startLetter>>8)&0xf];
1670 // one byte character
1671 s[i++]=hex[(startLetter>>4)&0xf];
1672 s[i++]=hex[(startLetter>>0)&0xf];
1678 //----------------------------------------------------------------------------
1680 /** Special class list where sorting takes IGNORE_PREFIX into account. */
1681 class PrefixIgnoreClassList : public ClassList
1684 typedef ClassDef ElementType;
1685 PrefixIgnoreClassList(uint letter) : m_letter(letter) {}
1686 uint letter() const { return m_letter; }
1688 virtual int compareValue(const ClassDef *c1, const ClassDef *c2) const
1690 QCString n1 = c1->className();
1691 QCString n2 = c2->className();
1692 return qstricmp (n1.data()+getPrefixIndex(n1), n2.data()+getPrefixIndex(n2));
1697 /** Class representing a cell in the alphabetical class index. */
1698 class AlphaIndexTableCell
1701 AlphaIndexTableCell(int row,int col,uint letter,ClassDef *cd) :
1702 m_letter(letter), m_class(cd), m_row(row), m_col(col)
1703 { //printf("AlphaIndexTableCell(%d,%d,%c,%s)\n",row,col,letter!=0 ? letter: '-',
1704 // cd!=(ClassDef*)0x8 ? cd->name().data() : "<null>");
1707 ClassDef *classDef() const { return m_class; }
1708 uint letter() const { return m_letter; }
1709 int row() const { return m_row; }
1710 int column() const { return m_col; }
1719 /** Class representing a row in the alphabetical class index. */
1720 class AlphaIndexTableRows : public QList<AlphaIndexTableCell>
1723 AlphaIndexTableRows() { setAutoDelete(TRUE); }
1726 /** Iterator for the cells in a row of the alphabetical class index. */
1727 class AlphaIndexTableRowsIterator : public QListIterator<AlphaIndexTableCell>
1730 AlphaIndexTableRowsIterator(const AlphaIndexTableRows &list) :
1731 QListIterator<AlphaIndexTableCell>(list) {}
1734 /** Class representing the columns in the alphabetical class index. */
1735 class AlphaIndexTableColumns : public QList<AlphaIndexTableRows>
1738 AlphaIndexTableColumns() { setAutoDelete(TRUE); }
1741 class UsedIndexLetters : public SIntDict<uint>
1744 UsedIndexLetters() : SIntDict<uint>(257) { setAutoDelete(TRUE); }
1745 void add(uint letter)
1747 uint *v = find(letter);
1750 append(letter,new uint(letter));
1754 int compareValues( const uint *p1, const uint *p2) const
1756 return (int)*p1 - (int)*p2; // subtracting is done by int not uint.
1760 // write an alphabetical index of all class with a header for each letter
1761 static void writeAlphabeticalClassList(OutputList &ol)
1763 // What starting letters are used
1764 UsedIndexLetters indexLettersUsed;
1766 // first count the number of headers
1767 ClassSDict::Iterator cli(*Doxygen::classSDict);
1771 for (;(cd=cli.current());++cli)
1773 if (cd->isLinkableInProject() && cd->templateMaster()==0)
1775 if (cd->getLanguage()==SrcLangExt_VHDL && !((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS ))// no architecture
1778 int index = getPrefixIndex(cd->className());
1779 //printf("name=%s index=%d %d\n",cd->className().data(),index,cd->protection());
1780 startLetter=getUtf8CodeToUpper(cd->className(),index);
1781 indexLettersUsed.add(startLetter);
1784 indexLettersUsed.sort();
1786 // write quick link index (row of letters)
1787 QCString alphaLinks = "<div class=\"qindex\">";
1788 SIntDict<uint>::Iterator it(indexLettersUsed);
1790 for (it.toFirst();(pLetter=it.current());++it)
1792 if (headerItems) alphaLinks += " | ";
1794 QCString li = letterToLabel(*pLetter);
1795 QCString ls = QString(QChar(*pLetter)).utf8();
1796 alphaLinks += (QCString)"<a class=\"qindex\" href=\"#letter_" +
1800 alphaLinks += "</div>\n";
1801 ol.writeString(alphaLinks);
1804 // the number of columns in the table
1805 const int columns = Config_getInt("COLS_IN_ALPHA_INDEX");
1808 int totalItems = headerItems*2 + annotatedClasses; // number of items in the table (headers span 2 items)
1809 int rows = (totalItems + columns - 1)/columns; // number of rows in the table
1811 //printf("headerItems=%d totalItems=%d columns=%d rows=%d itemsInLastRow=%d\n",
1812 // headerItems,totalItems,columns,rows,itemsInLastRow);
1814 // Keep a list of classes for each starting letter
1815 LetterToIndexMap<PrefixIgnoreClassList> classesByLetter;
1816 AlphaIndexTableColumns tableColumns;
1818 // fill the columns with the class list (row elements in each column,
1819 // expect for the columns with number >= itemsInLastRow, which get one
1823 for (cli.toFirst();(cd=cli.current());++cli)
1825 if (cd->getLanguage()==SrcLangExt_VHDL && !((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS ))// no architecture
1828 if (cd->isLinkableInProject() && cd->templateMaster()==0)
1830 int index = getPrefixIndex(cd->className());
1831 startLetter=getUtf8Code(cd->className(),index);
1832 // Do some sorting again, since the classes are sorted by name with
1833 // prefix, which should be ignored really.
1834 if (cd->getLanguage()==SrcLangExt_VHDL)
1836 if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS )// no architecture
1838 classesByLetter.append(startLetter,cd);
1843 classesByLetter.append(startLetter,cd);
1848 #define NEXT_ROW() \
1851 if (row>maxRows) maxRows=row; \
1852 if (row>=rows && col<columns) \
1856 tableRows = new AlphaIndexTableRows; \
1857 tableColumns.append(tableRows); \
1862 AlphaIndexTableRows *tableRows = new AlphaIndexTableRows;
1863 tableColumns.append(tableRows);
1864 int col=0,row=0,maxRows=0;
1865 PrefixIgnoreClassList *cl;
1866 SIntDict<PrefixIgnoreClassList>::Iterator lit(classesByLetter);
1867 for (lit.toFirst();(cl=lit.current());++lit)
1869 uint l = cl->letter();
1870 // add special header cell
1871 tableRows->append(new AlphaIndexTableCell(row,col,l,(ClassDef*)0x8));
1873 tableRows->append(new AlphaIndexTableCell(row,col,0,(ClassDef*)0x8));
1875 ClassListIterator cit(*cl);
1877 ClassDef *cd = cit.current();
1879 tableRows->append(new AlphaIndexTableCell(row,col,0,cd));
1882 for (;(cd=cit.current()); ++cit)
1885 tableRows->append(new AlphaIndexTableCell(row,col,0,cd));
1891 // create row iterators for each column
1892 AlphaIndexTableRowsIterator **colIterators = new AlphaIndexTableRowsIterator*[columns];
1893 for (i=0;i<columns;i++)
1895 if (i<(int)tableColumns.count())
1897 colIterators[i] = new AlphaIndexTableRowsIterator(*tableColumns.at(i));
1899 else // empty column
1901 colIterators[i] = 0;
1905 ol.writeString("<table style=\"margin: 10px; white-space: nowrap;\" align=\"center\" width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
1907 for (i=0;i<=maxRows;i++) // foreach table row
1909 //printf("writing row %d\n",i);
1910 //ol.nextTableRow();
1911 ol.writeString("<tr>");
1912 // the last column may contain less items then the others
1913 //int colsInRow = (i<rows-1) ? columns : itemsInLastRow;
1914 //printf("row [%d]\n",i);
1915 for (j=0;j<columns;j++) // foreach table column
1917 if (colIterators[j])
1919 AlphaIndexTableCell *cell = colIterators[j]->current();
1924 if (cell->letter()!=0)
1926 QCString s = letterToLabel(cell->letter());
1927 ol.writeString("<td rowspan=\"2\" valign=\"bottom\">");
1928 ol.writeString("<a name=\"letter_");
1930 ol.writeString("\"></a>");
1931 ol.writeString("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
1933 "<td><div class=\"ah\">  ");
1934 ol.writeString(QString(QChar(cell->letter())).utf8());
1935 ol.writeString( "  </div>"
1940 else if (cell->classDef()!=(ClassDef*)0x8)
1942 cd = cell->classDef();
1943 ol.writeString("<td valign=\"top\">");
1944 QCString namesp,cname;
1945 //if (cd->getNamespaceDef()) namesp=cd->getNamespaceDef()->displayName();
1946 //QCString cname=cd->className();
1947 extractNamespaceName(cd->name(),cname,namesp);
1948 QCString nsDispName;
1949 SrcLangExt lang = cd->getLanguage();
1950 QCString sep = getLanguageSpecificSeparator(lang);
1953 nsDispName=substitute(namesp,"::",sep);
1954 cname=substitute(cname,"::",sep);
1961 ol.writeObjectLink(cd->getReference(),
1962 cd->getOutputFileBase(),cd->anchor(),cname);
1963 if (!namesp.isEmpty())
1966 NamespaceDef *nd = getResolvedNamespace(namesp);
1967 if (nd && nd->isLinkable())
1969 ol.writeObjectLink(nd->getReference(),
1970 nd->getOutputFileBase(),0,nsDispName);
1974 ol.docify(nsDispName);
1978 ol.writeNonBreakableSpace(3);
1980 ++(*colIterators[j]);
1981 if (cell->letter()!=0 || cell->classDef()!=(ClassDef*)0x8)
1983 ol.writeString("</td>");
1989 ol.writeString("<td></td>");
1993 ol.writeString("</tr>\n");
1995 ol.writeString("</table>\n");
1997 ol.writeString(alphaLinks);
1999 // release the temporary memory
2000 for (i=0;i<columns;i++)
2002 delete colIterators[i];
2004 delete[] colIterators;
2007 //----------------------------------------------------------------------------
2009 static void writeAlphabeticalIndex(OutputList &ol)
2011 if (annotatedClasses==0) return;
2012 ol.pushGeneratorState();
2013 ol.disableAllBut(OutputGenerator::Html);
2014 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassIndex);
2015 QCString title = lne ? lne->title() : theTranslator->trCompoundIndex();
2016 bool addToIndex = lne==0 || lne->visible();
2018 startFile(ol,"classes",0,title,HLI_Classes);
2021 ol.parseText(title);
2026 Doxygen::indexList->addContentsItem(FALSE,title,0,"classes",0,FALSE,TRUE);
2030 writeAlphabeticalClassList(ol);
2031 endFile(ol); // contains ol.endContents()
2033 ol.popGeneratorState();
2036 //----------------------------------------------------------------------------
2038 static void writeAnnotatedIndex(OutputList &ol)
2040 //printf("writeAnnotatedIndex: count=%d printed=%d\n",
2041 // annotatedClasses,annotatedClassesPrinted);
2042 if (annotatedClasses==0) return;
2044 ol.pushGeneratorState();
2045 ol.disable(OutputGenerator::Man);
2046 if (annotatedClassesPrinted==0)
2048 ol.disable(OutputGenerator::Latex);
2049 ol.disable(OutputGenerator::RTF);
2051 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
2052 if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes); // fall back
2053 QCString title = lne ? lne->title() : theTranslator->trCompoundList();
2054 bool addToIndex = lne==0 || lne->visible();
2057 startFile(ol,"annotated",0,title,HLI_Annotated);
2060 ol.parseText(title);
2065 ol.startTextBlock();
2066 ol.parseText(lne ? lne->intro() : theTranslator->trCompoundListDescription());
2070 // Linear class index for Latex/RTF
2072 ol.pushGeneratorState();
2073 ol.disable(OutputGenerator::Html);
2074 Doxygen::indexList->disable();
2076 writeAnnotatedClassList(ol);
2078 Doxygen::indexList->enable();
2079 ol.popGeneratorState();
2082 // Hierarchical class index for HTML
2084 ol.pushGeneratorState();
2085 ol.disableAllBut(OutputGenerator::Html);
2090 Doxygen::indexList->addContentsItem(TRUE,title,0,"annotated",0,TRUE,TRUE);
2091 Doxygen::indexList->incContentsDepth();
2093 FTVHelp* ftv = new FTVHelp(FALSE);
2094 writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex);
2095 writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE);
2097 FTextStream t(&outStr);
2098 ftv->generateTreeViewInline(t);
2099 ol.writeString(outStr);
2103 Doxygen::indexList->decContentsDepth();
2107 ol.popGeneratorState();
2110 endFile(ol); // contains ol.endContents()
2111 ol.popGeneratorState();
2114 //----------------------------------------------------------------------------
2115 static void writeClassLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
2116 QCString &prevClassName)
2118 ClassDef *cd=md->getClassDef();
2119 if ( cd && prevClassName!=cd->displayName())
2121 ol.docify(separator);
2122 ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(),
2124 ol.writeString("\n");
2125 prevClassName = cd->displayName();
2129 static void writeFileLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
2130 QCString &prevFileName)
2132 FileDef *fd=md->getFileDef();
2133 if (fd && prevFileName!=fd->name())
2135 ol.docify(separator);
2136 ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(),
2138 ol.writeString("\n");
2139 prevFileName = fd->name();
2143 static void writeNamespaceLinkForMember(OutputList &ol,MemberDef *md,const char *separator,
2144 QCString &prevNamespaceName)
2146 NamespaceDef *nd=md->getNamespaceDef();
2147 if (nd && prevNamespaceName!=nd->name())
2149 ol.docify(separator);
2150 ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(),
2152 ol.writeString("\n");
2153 prevNamespaceName = nd->name();
2157 static void writeMemberList(OutputList &ol,bool useSections,int page,
2158 const LetterToIndexMap<MemberIndexList> &memberLists,
2159 DefinitionIntf::DefType type)
2161 ASSERT((int)type<3);
2163 typedef void (*writeLinkForMember_t)(OutputList &ol,MemberDef *md,const char *separator,
2164 QCString &prevNamespaceName);
2166 // each index tab has its own write function
2167 static writeLinkForMember_t writeLinkForMemberMap[3] =
2169 &writeClassLinkForMember,
2170 &writeFileLinkForMember,
2171 &writeNamespaceLinkForMember
2174 QCString prevDefName;
2176 bool firstSection=TRUE;
2177 bool firstItem=TRUE;
2178 MemberIndexList *ml;
2179 SIntDict<MemberIndexList>::Iterator it(memberLists);
2180 for (it.toFirst();(ml=it.current());++it)
2184 ml = memberLists[page];
2187 if (ml==0 || ml->count()==0) continue;
2189 QListIterator<MemberDef> mli(*ml);
2191 for (mli.toFirst();(md=mli.current());++mli)
2194 bool isFunc=!md->isObjCMethod() &&
2195 (md->isFunction() || md->isSlot() || md->isSignal());
2196 QCString name=md->name();
2197 int startIndex = getPrefixIndex(name);
2198 if (QCString(name.data()+startIndex)!=prevName) // new entry
2200 if ((prevName.isEmpty() ||
2201 tolower(name.at(startIndex))!=tolower(prevName.at(0))) &&
2202 useSections) // new section
2204 if (!firstItem) ol.endItemListItem();
2205 if (!firstSection) ol.endItemList();
2206 QCString cs = letterToLabel(ml->letter());
2207 QCString cl = QString(QChar(ml->letter())).utf8();
2208 QCString anchor=(QCString)"index_"+cs;
2209 QCString title=(QCString)"- "+cl+" -";
2210 ol.startSection(anchor,title,SectionInfo::Subsection);
2212 ol.endSection(anchor,SectionInfo::Subsection);
2217 else if (!useSections && first)
2224 if (!firstItem) ol.endItemListItem();
2225 ol.startItemListItem();
2228 if (isFunc) ol.docify("()");
2229 ol.writeString("\n");
2234 prevName = name.data()+startIndex;
2239 // link to class for other members with the same name
2241 // write the link for the specific list type
2242 writeLinkForMemberMap[(int)type](ol,md,sep,prevDefName);
2245 if (!firstItem) ol.endItemListItem();
2249 //----------------------------------------------------------------------------
2251 void initClassMemberIndices()
2254 for (j=0;j<CMHL_Total;j++)
2256 documentedClassMembers[j]=0;
2257 g_memberIndexLetterUsed[j].clear();
2261 void addClassMemberNameToIndex(MemberDef *md)
2263 static bool hideFriendCompounds = Config_getBool("HIDE_FRIEND_COMPOUNDS");
2268 if (md->isLinkableInProject() &&
2269 (cd=md->getClassDef()) &&
2270 cd->isLinkableInProject() &&
2271 cd->templateMaster()==0)
2273 QCString n = md->name();
2274 int index = getPrefixIndex(n);
2275 uint letter = getUtf8CodeToLower(n,index);
2278 bool isFriendToHide = hideFriendCompounds &&
2279 (QCString(md->typeString())=="friend class" ||
2280 QCString(md->typeString())=="friend struct" ||
2281 QCString(md->typeString())=="friend union");
2282 if (!(md->isFriend() && isFriendToHide) &&
2283 (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2286 g_memberIndexLetterUsed[CMHL_All].append(letter,md);
2287 documentedClassMembers[CMHL_All]++;
2289 if (md->isFunction() || md->isSlot() || md->isSignal())
2291 g_memberIndexLetterUsed[CMHL_Functions].append(letter,md);
2292 documentedClassMembers[CMHL_Functions]++;
2294 else if (md->isVariable())
2296 g_memberIndexLetterUsed[CMHL_Variables].append(letter,md);
2297 documentedClassMembers[CMHL_Variables]++;
2299 else if (md->isTypedef())
2301 g_memberIndexLetterUsed[CMHL_Typedefs].append(letter,md);
2302 documentedClassMembers[CMHL_Typedefs]++;
2304 else if (md->isEnumerate())
2306 g_memberIndexLetterUsed[CMHL_Enums].append(letter,md);
2307 documentedClassMembers[CMHL_Enums]++;
2309 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2311 g_memberIndexLetterUsed[CMHL_EnumValues].append(letter,md);
2312 documentedClassMembers[CMHL_EnumValues]++;
2314 else if (md->isProperty())
2316 g_memberIndexLetterUsed[CMHL_Properties].append(letter,md);
2317 documentedClassMembers[CMHL_Properties]++;
2319 else if (md->isEvent())
2321 g_memberIndexLetterUsed[CMHL_Events].append(letter,md);
2322 documentedClassMembers[CMHL_Events]++;
2324 else if (md->isRelated() || md->isForeign() ||
2325 (md->isFriend() && !isFriendToHide))
2327 g_memberIndexLetterUsed[CMHL_Related].append(letter,md);
2328 documentedClassMembers[CMHL_Related]++;
2334 //----------------------------------------------------------------------------
2336 void initNamespaceMemberIndices()
2339 for (j=0;j<NMHL_Total;j++)
2341 documentedNamespaceMembers[j]=0;
2342 g_namespaceIndexLetterUsed[j].clear();
2346 void addNamespaceMemberNameToIndex(MemberDef *md)
2348 NamespaceDef *nd=md->getNamespaceDef();
2349 if (nd && nd->isLinkableInProject() && md->isLinkableInProject())
2351 QCString n = md->name();
2352 int index = getPrefixIndex(n);
2353 uint letter = getUtf8CodeToLower(n,index);
2356 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2358 g_namespaceIndexLetterUsed[NMHL_All].append(letter,md);
2359 documentedNamespaceMembers[NMHL_All]++;
2362 if (md->isFunction())
2364 g_namespaceIndexLetterUsed[NMHL_Functions].append(letter,md);
2365 documentedNamespaceMembers[NMHL_Functions]++;
2367 else if (md->isVariable())
2369 g_namespaceIndexLetterUsed[NMHL_Variables].append(letter,md);
2370 documentedNamespaceMembers[NMHL_Variables]++;
2372 else if (md->isTypedef())
2374 g_namespaceIndexLetterUsed[NMHL_Typedefs].append(letter,md);
2375 documentedNamespaceMembers[NMHL_Typedefs]++;
2377 else if (md->isEnumerate())
2379 g_namespaceIndexLetterUsed[NMHL_Enums].append(letter,md);
2380 documentedNamespaceMembers[NMHL_Enums]++;
2382 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2384 g_namespaceIndexLetterUsed[NMHL_EnumValues].append(letter,md);
2385 documentedNamespaceMembers[NMHL_EnumValues]++;
2391 //----------------------------------------------------------------------------
2393 void initFileMemberIndices()
2396 for (j=0;j<NMHL_Total;j++)
2398 documentedFileMembers[j]=0;
2399 g_fileIndexLetterUsed[j].clear();
2403 void addFileMemberNameToIndex(MemberDef *md)
2405 FileDef *fd=md->getFileDef();
2406 if (fd && fd->isLinkableInProject() && md->isLinkableInProject())
2408 QCString n = md->name();
2409 int index = getPrefixIndex(n);
2410 uint letter = getUtf8CodeToLower(n,index);
2413 if (!md->isEnumValue() || (md->getEnumScope() && !md->getEnumScope()->isStrong()))
2415 g_fileIndexLetterUsed[FMHL_All].append(letter,md);
2416 documentedFileMembers[FMHL_All]++;
2419 if (md->isFunction())
2421 g_fileIndexLetterUsed[FMHL_Functions].append(letter,md);
2422 documentedFileMembers[FMHL_Functions]++;
2424 else if (md->isVariable())
2426 g_fileIndexLetterUsed[FMHL_Variables].append(letter,md);
2427 documentedFileMembers[FMHL_Variables]++;
2429 else if (md->isTypedef())
2431 g_fileIndexLetterUsed[FMHL_Typedefs].append(letter,md);
2432 documentedFileMembers[FMHL_Typedefs]++;
2434 else if (md->isEnumerate())
2436 g_fileIndexLetterUsed[FMHL_Enums].append(letter,md);
2437 documentedFileMembers[FMHL_Enums]++;
2439 else if (md->isEnumValue() && md->getEnumScope() && !md->getEnumScope()->isStrong())
2441 g_fileIndexLetterUsed[FMHL_EnumValues].append(letter,md);
2442 documentedFileMembers[FMHL_EnumValues]++;
2444 else if (md->isDefine())
2446 g_fileIndexLetterUsed[FMHL_Defines].append(letter,md);
2447 documentedFileMembers[FMHL_Defines]++;
2453 //----------------------------------------------------------------------------
2455 static void writeQuickMemberIndex(OutputList &ol,
2456 const LetterToIndexMap<MemberIndexList> &charUsed,uint page,
2457 QCString fullName,bool multiPage)
2460 startQuickIndexList(ol,TRUE);
2461 SIntDict<MemberIndexList>::Iterator it(charUsed);
2462 MemberIndexList *ml;
2463 for (it.toFirst();(ml=it.current());++it)
2465 uint i = ml->letter();
2466 QCString is = letterToLabel(i);
2467 QCString ci = QString(QChar(i)).utf8();
2469 QCString extension=Doxygen::htmlFileExtension;
2473 anchor=fullName+extension+"#index_";
2475 anchor=fullName+"_"+letterToLabel(i)+extension+"#index_";
2476 startQuickIndexItem(ol,anchor+ci,i==page,TRUE,first);
2478 endQuickIndexItem(ol);
2481 endQuickIndexList(ol);
2484 //----------------------------------------------------------------------------
2486 /** Helper class representing a class member in the navigation menu. */
2489 CmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
2494 static const CmhlInfo *getCmhlInfo(int hl)
2496 static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
2497 static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
2498 static CmhlInfo cmhlInfo[] =
2500 CmhlInfo("functions", theTranslator->trAll()),
2501 CmhlInfo("functions_func",
2502 fortranOpt ? theTranslator->trSubprograms() :
2503 vhdlOpt ? VhdlDocGen::trFunctionAndProc() :
2504 theTranslator->trFunctions()),
2505 CmhlInfo("functions_vars",theTranslator->trVariables()),
2506 CmhlInfo("functions_type",theTranslator->trTypedefs()),
2507 CmhlInfo("functions_enum",theTranslator->trEnumerations()),
2508 CmhlInfo("functions_eval",theTranslator->trEnumerationValues()),
2509 CmhlInfo("functions_prop",theTranslator->trProperties()),
2510 CmhlInfo("functions_evnt",theTranslator->trEvents()),
2511 CmhlInfo("functions_rela",theTranslator->trRelatedFunctions())
2513 return &cmhlInfo[hl];
2516 static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight hl)
2518 if (documentedClassMembers[hl]==0) return;
2520 static bool disableIndex = Config_getBool("DISABLE_INDEX");
2522 bool multiPageIndex=FALSE;
2523 if (documentedClassMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
2525 multiPageIndex=TRUE;
2528 ol.pushGeneratorState();
2529 ol.disableAllBut(OutputGenerator::Html);
2531 QCString extension=Doxygen::htmlFileExtension;
2532 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
2533 QCString title = lne ? lne->title() : theTranslator->trCompoundMembers();
2534 if (hl!=CMHL_All) title+=(QCString)" - "+getCmhlInfo(hl)->title;
2535 bool addToIndex = lne==0 || lne->visible();
2539 Doxygen::indexList->addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,0,
2540 getCmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
2541 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
2545 SIntDict<MemberIndexList>::Iterator it(g_memberIndexLetterUsed[hl]);
2546 MemberIndexList *ml;
2547 for (it.toFirst();(ml=it.current());++it)
2549 uint page = ml->letter();
2550 QCString fileName = getCmhlInfo(hl)->fname;
2555 fileName+="_"+letterToLabel(page);
2557 QCString cs = QString(QChar(page)).utf8();
2560 Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
2563 bool quickIndex = documentedClassMembers[hl]>maxItemsBeforeQuickIndex;
2565 ol.startFile(fileName+extension,0,title);
2566 ol.startQuickIndices();
2569 ol.writeQuickLinks(TRUE,HLI_Functions,0);
2570 startQuickIndexList(ol);
2572 // index item for global member list
2573 startQuickIndexItem(ol,
2574 getCmhlInfo(0)->fname+Doxygen::htmlFileExtension,hl==CMHL_All,TRUE,first);
2575 ol.writeString(fixSpaces(getCmhlInfo(0)->title));
2576 endQuickIndexItem(ol);
2579 // index items per category member lists
2580 for (i=1;i<CMHL_Total;i++)
2582 if (documentedClassMembers[i]>0)
2584 startQuickIndexItem(ol,getCmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
2585 ol.writeString(fixSpaces(getCmhlInfo(i)->title));
2586 //printf("multiPageIndex=%d first=%d fileName=%s file=%s title=%s\n",
2587 // multiPageIndex,first,fileName.data(),getCmhlInfo(i)->fname,getCmhlInfo(i)->title.data());
2588 endQuickIndexItem(ol);
2592 endQuickIndexList(ol);
2594 // quick alphabetical index
2597 writeQuickMemberIndex(ol,g_memberIndexLetterUsed[hl],page,
2598 getCmhlInfo(hl)->fname,multiPageIndex);
2601 ol.endQuickIndices();
2602 ol.writeSplitBar(fileName);
2603 ol.writeSearchInfo();
2609 ol.startTextBlock();
2610 ol.parseText(lne ? lne->intro() : theTranslator->trCompoundMembersDescription(Config_getBool("EXTRACT_ALL")));
2615 // hack to work around a mozilla bug, which refuses to switch to
2616 // normal lists otherwise
2617 ol.writeString(" ");
2620 writeMemberList(ol,quickIndex,
2621 multiPageIndex?page:-1,
2622 g_memberIndexLetterUsed[hl],
2623 Definition::TypeClass);
2628 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
2630 ol.popGeneratorState();
2633 static void writeClassMemberIndex(OutputList &ol)
2635 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers);
2636 bool addToIndex = lne==0 || lne->visible();
2638 if (documentedClassMembers[CMHL_All]>0 && addToIndex)
2640 Doxygen::indexList->addContentsItem(TRUE,lne ? lne->title() : theTranslator->trCompoundMembers(),0,"functions",0);
2641 Doxygen::indexList->incContentsDepth();
2643 writeClassMemberIndexFiltered(ol,CMHL_All);
2644 writeClassMemberIndexFiltered(ol,CMHL_Functions);
2645 writeClassMemberIndexFiltered(ol,CMHL_Variables);
2646 writeClassMemberIndexFiltered(ol,CMHL_Typedefs);
2647 writeClassMemberIndexFiltered(ol,CMHL_Enums);
2648 writeClassMemberIndexFiltered(ol,CMHL_EnumValues);
2649 writeClassMemberIndexFiltered(ol,CMHL_Properties);
2650 writeClassMemberIndexFiltered(ol,CMHL_Events);
2651 writeClassMemberIndexFiltered(ol,CMHL_Related);
2652 if (documentedClassMembers[CMHL_All]>0 && addToIndex)
2654 Doxygen::indexList->decContentsDepth();
2659 //----------------------------------------------------------------------------
2661 /** Helper class representing a file member in the navigation menu. */
2664 FmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
2669 static const FmhlInfo *getFmhlInfo(int hl)
2671 static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
2672 static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
2673 static FmhlInfo fmhlInfo[] =
2675 FmhlInfo("globals", theTranslator->trAll()),
2676 FmhlInfo("globals_func",
2677 fortranOpt ? theTranslator->trSubprograms() :
2678 vhdlOpt ? VhdlDocGen::trFunctionAndProc() :
2679 theTranslator->trFunctions()),
2680 FmhlInfo("globals_vars",theTranslator->trVariables()),
2681 FmhlInfo("globals_type",theTranslator->trTypedefs()),
2682 FmhlInfo("globals_enum",theTranslator->trEnumerations()),
2683 FmhlInfo("globals_eval",theTranslator->trEnumerationValues()),
2684 FmhlInfo("globals_defs",theTranslator->trDefines())
2686 return &fmhlInfo[hl];
2689 static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl)
2691 if (documentedFileMembers[hl]==0) return;
2693 static bool disableIndex = Config_getBool("DISABLE_INDEX");
2695 bool multiPageIndex=FALSE;
2696 if (documentedFileMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
2698 multiPageIndex=TRUE;
2701 ol.pushGeneratorState();
2702 ol.disableAllBut(OutputGenerator::Html);
2704 QCString extension=Doxygen::htmlFileExtension;
2705 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
2706 QCString title = lne ? lne->title() : theTranslator->trFileMembers();
2707 bool addToIndex = lne==0 || lne->visible();
2711 Doxygen::indexList->addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,0,
2712 getFmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
2713 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
2717 SIntDict<MemberIndexList>::Iterator it(g_fileIndexLetterUsed[hl]);
2718 MemberIndexList *ml;
2719 for (it.toFirst();(ml=it.current());++it)
2721 uint page = ml->letter();
2722 QCString fileName = getFmhlInfo(hl)->fname;
2727 fileName+="_"+letterToLabel(page);
2729 QCString cs = QString(QChar(page)).utf8();
2732 Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
2735 bool quickIndex = documentedFileMembers[hl]>maxItemsBeforeQuickIndex;
2737 ol.startFile(fileName+extension,0,title);
2738 ol.startQuickIndices();
2741 ol.writeQuickLinks(TRUE,HLI_Globals,0);
2742 startQuickIndexList(ol);
2744 // index item for all file member lists
2745 startQuickIndexItem(ol,
2746 getFmhlInfo(0)->fname+Doxygen::htmlFileExtension,hl==FMHL_All,TRUE,first);
2747 ol.writeString(fixSpaces(getFmhlInfo(0)->title));
2748 endQuickIndexItem(ol);
2751 // index items for per category member lists
2752 for (i=1;i<FMHL_Total;i++)
2754 if (documentedFileMembers[i]>0)
2756 startQuickIndexItem(ol,
2757 getFmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
2758 ol.writeString(fixSpaces(getFmhlInfo(i)->title));
2759 endQuickIndexItem(ol);
2763 endQuickIndexList(ol);
2767 writeQuickMemberIndex(ol,g_fileIndexLetterUsed[hl],page,
2768 getFmhlInfo(hl)->fname,multiPageIndex);
2771 ol.endQuickIndices();
2772 ol.writeSplitBar(fileName);
2773 ol.writeSearchInfo();
2779 ol.startTextBlock();
2780 ol.parseText(lne ? lne->intro() : theTranslator->trFileMembersDescription(Config_getBool("EXTRACT_ALL")));
2785 // hack to work around a mozilla bug, which refuses to switch to
2786 // normal lists otherwise
2787 ol.writeString(" ");
2790 writeMemberList(ol,quickIndex,
2791 multiPageIndex?page:-1,
2792 g_fileIndexLetterUsed[hl],
2793 Definition::TypeFile);
2797 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
2798 ol.popGeneratorState();
2801 static void writeFileMemberIndex(OutputList &ol)
2803 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals);
2804 bool addToIndex = lne==0 || lne->visible();
2805 if (documentedFileMembers[FMHL_All]>0 && addToIndex)
2807 Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trFileMembers(),0,"globals",0);
2808 Doxygen::indexList->incContentsDepth();
2810 writeFileMemberIndexFiltered(ol,FMHL_All);
2811 writeFileMemberIndexFiltered(ol,FMHL_Functions);
2812 writeFileMemberIndexFiltered(ol,FMHL_Variables);
2813 writeFileMemberIndexFiltered(ol,FMHL_Typedefs);
2814 writeFileMemberIndexFiltered(ol,FMHL_Enums);
2815 writeFileMemberIndexFiltered(ol,FMHL_EnumValues);
2816 writeFileMemberIndexFiltered(ol,FMHL_Defines);
2817 if (documentedFileMembers[FMHL_All]>0 && addToIndex)
2819 Doxygen::indexList->decContentsDepth();
2824 //----------------------------------------------------------------------------
2826 /** Helper class representing a namespace member in the navigation menu. */
2829 NmhlInfo(const char *fn,const char *t) : fname(fn), title(t) {}
2834 static const NmhlInfo *getNmhlInfo(int hl)
2836 static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
2837 static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
2838 static NmhlInfo nmhlInfo[] =
2840 NmhlInfo("namespacemembers", theTranslator->trAll()),
2841 NmhlInfo("namespacemembers_func",
2842 fortranOpt ? theTranslator->trSubprograms() :
2843 vhdlOpt ? VhdlDocGen::trFunctionAndProc() :
2844 theTranslator->trFunctions()),
2845 NmhlInfo("namespacemembers_vars",theTranslator->trVariables()),
2846 NmhlInfo("namespacemembers_type",theTranslator->trTypedefs()),
2847 NmhlInfo("namespacemembers_enum",theTranslator->trEnumerations()),
2848 NmhlInfo("namespacemembers_eval",theTranslator->trEnumerationValues())
2850 return &nmhlInfo[hl];
2853 //----------------------------------------------------------------------------
2855 static void writeNamespaceMemberIndexFiltered(OutputList &ol,
2856 NamespaceMemberHighlight hl)
2858 if (documentedNamespaceMembers[hl]==0) return;
2860 static bool disableIndex = Config_getBool("DISABLE_INDEX");
2863 bool multiPageIndex=FALSE;
2864 if (documentedNamespaceMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX)
2866 multiPageIndex=TRUE;
2869 ol.pushGeneratorState();
2870 ol.disableAllBut(OutputGenerator::Html);
2872 QCString extension=Doxygen::htmlFileExtension;
2873 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
2874 QCString title = lne ? lne->title() : theTranslator->trNamespaceMembers();
2875 bool addToIndex = lne==0 || lne->visible();
2879 Doxygen::indexList->addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,0,
2880 getNmhlInfo(hl)->fname,0,multiPageIndex,TRUE);
2881 if (multiPageIndex) Doxygen::indexList->incContentsDepth();
2885 SIntDict<MemberIndexList>::Iterator it(g_namespaceIndexLetterUsed[hl]);
2886 MemberIndexList *ml;
2887 for (it.toFirst();(ml=it.current());++it)
2889 uint page = ml->letter();
2890 QCString fileName = getNmhlInfo(hl)->fname;
2895 fileName+="_"+letterToLabel(page);
2897 QCString cs = QString(QChar(page)).utf8();
2900 Doxygen::indexList->addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE);
2903 bool quickIndex = documentedNamespaceMembers[hl]>maxItemsBeforeQuickIndex;
2905 ol.startFile(fileName+extension,0,title);
2906 ol.startQuickIndices();
2909 ol.writeQuickLinks(TRUE,HLI_NamespaceMembers,0);
2910 startQuickIndexList(ol);
2912 // index item for all namespace member lists
2913 startQuickIndexItem(ol,
2914 getNmhlInfo(0)->fname+Doxygen::htmlFileExtension,hl==NMHL_All,TRUE,first);
2915 ol.writeString(fixSpaces(getNmhlInfo(0)->title));
2916 endQuickIndexItem(ol);
2919 // index items per category member lists
2920 for (i=1;i<NMHL_Total;i++)
2922 if (documentedNamespaceMembers[i]>0)
2924 startQuickIndexItem(ol,
2925 getNmhlInfo(i)->fname+Doxygen::htmlFileExtension,hl==i,TRUE,first);
2926 ol.writeString(fixSpaces(getNmhlInfo(i)->title));
2927 endQuickIndexItem(ol);
2931 endQuickIndexList(ol);
2935 writeQuickMemberIndex(ol,g_namespaceIndexLetterUsed[hl],page,
2936 getNmhlInfo(hl)->fname,multiPageIndex);
2940 ol.endQuickIndices();
2941 ol.writeSplitBar(fileName);
2942 ol.writeSearchInfo();
2948 ol.startTextBlock();
2949 ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceMemberDescription(Config_getBool("EXTRACT_ALL")));
2954 // hack to work around a mozilla bug, which refuses to switch to
2955 // normal lists otherwise
2956 ol.writeString(" ");
2959 writeMemberList(ol,quickIndex,
2960 multiPageIndex?page:-1,
2961 g_namespaceIndexLetterUsed[hl],
2962 Definition::TypeNamespace);
2965 if (multiPageIndex && addToIndex) Doxygen::indexList->decContentsDepth();
2966 ol.popGeneratorState();
2969 static void writeNamespaceMemberIndex(OutputList &ol)
2971 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers);
2972 bool addToIndex = lne==0 || lne->visible();
2973 if (documentedNamespaceMembers[NMHL_All]>0 && addToIndex)
2975 Doxygen::indexList->addContentsItem(FALSE,lne ? lne->title() : theTranslator->trNamespaceMembers(),0,"namespacemembers",0);
2976 Doxygen::indexList->incContentsDepth();
2978 //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
2979 writeNamespaceMemberIndexFiltered(ol,NMHL_All);
2980 writeNamespaceMemberIndexFiltered(ol,NMHL_Functions);
2981 writeNamespaceMemberIndexFiltered(ol,NMHL_Variables);
2982 writeNamespaceMemberIndexFiltered(ol,NMHL_Typedefs);
2983 writeNamespaceMemberIndexFiltered(ol,NMHL_Enums);
2984 writeNamespaceMemberIndexFiltered(ol,NMHL_EnumValues);
2985 if (documentedNamespaceMembers[NMHL_All]>0 && addToIndex)
2987 Doxygen::indexList->decContentsDepth();
2992 //----------------------------------------------------------------------------
2994 //----------------------------------------------------------------------------
2996 static void writeExampleIndex(OutputList &ol)
2998 if (Doxygen::exampleSDict->count()==0) return;
2999 ol.pushGeneratorState();
3000 ol.disable(OutputGenerator::Man);
3001 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Examples);
3002 QCString title = lne ? lne->title() : theTranslator->trExamples();
3003 bool addToIndex = lne==0 || lne->visible();
3005 startFile(ol,"examples",0,title,HLI_Examples);
3008 ol.parseText(title);
3015 Doxygen::indexList->addContentsItem(TRUE,title,0,"examples",0,TRUE,TRUE);
3016 Doxygen::indexList->incContentsDepth();
3019 ol.startTextBlock();
3020 ol.parseText(lne ? lne->intro() : theTranslator->trExamplesDescription());
3024 PageSDict::Iterator pdi(*Doxygen::exampleSDict);
3026 for (pdi.toFirst();(pd=pdi.current());++pdi)
3028 ol.startItemListItem();
3029 QCString n=pd->getOutputFileBase();
3030 if (!pd->title().isEmpty())
3032 ol.writeObjectLink(0,n,0,pd->title());
3035 Doxygen::indexList->addContentsItem(FALSE,filterTitle(pd->title()),pd->getReference(),n,0,FALSE,TRUE);
3040 ol.writeObjectLink(0,n,0,pd->name());
3043 Doxygen::indexList->addContentsItem(FALSE,pd->name(),pd->getReference(),n,0,FALSE,TRUE);
3046 ol.endItemListItem();
3047 ol.writeString("\n");
3053 Doxygen::indexList->decContentsDepth();
3056 ol.popGeneratorState();
3060 //----------------------------------------------------------------------------
3062 static void countRelatedPages(int &docPages,int &indexPages)
3064 docPages=indexPages=0;
3065 PageSDict::Iterator pdi(*Doxygen::pageSDict);
3067 for (pdi.toFirst();(pd=pdi.current());++pdi)
3069 if ( pd->visibleInIndex())
3073 if ( pd->documentedPage())
3080 //----------------------------------------------------------------------------
3082 static void writePages(PageDef *pd,FTVHelp *ftv)
3084 //printf("writePages()=%s pd=%p mainpage=%p\n",pd->name().data(),pd,Doxygen::mainPage);
3085 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
3086 bool addToIndex = lne==0 || lne->visible();
3087 if (!addToIndex) return;
3089 bool hasSubPages = pd->hasSubPages();
3090 bool hasSections = pd->hasSections();
3092 if (pd->visibleInIndex())
3096 if (pd->title().isEmpty())
3097 pageTitle=pd->name();
3099 pageTitle=filterTitle(pd->title());
3103 //printf("*** adding %s\n",pageTitle.data());
3104 ftv->addContentsItem(
3105 hasSubPages,pageTitle,
3106 pd->getReference(),pd->getOutputFileBase(),
3107 0,hasSubPages,TRUE,pd);
3109 if (addToIndex && pd!=Doxygen::mainPage)
3111 Doxygen::indexList->addContentsItem(
3112 hasSubPages,pageTitle,
3113 pd->getReference(),pd->getOutputFileBase(),
3114 0,hasSubPages,TRUE);
3117 if (hasSubPages && ftv) ftv->incContentsDepth();
3118 bool doIndent = (hasSections || hasSubPages) &&
3119 (pd!=Doxygen::mainPage || mainPageHasTitle());
3122 Doxygen::indexList->incContentsDepth();
3126 pd->addSectionsToIndex();
3128 PageSDict *subPages = pd->getSubPages();
3131 PageSDict::Iterator pi(*subPages);
3133 for (pi.toFirst();(subPage=pi.current());++pi)
3135 writePages(subPage,ftv);
3138 if (hasSubPages && ftv) ftv->decContentsDepth();
3141 Doxygen::indexList->decContentsDepth();
3143 //printf("end writePages()=%s\n",pd->title().data());
3146 //----------------------------------------------------------------------------
3148 static void writePageIndex(OutputList &ol)
3150 if (indexedPages==0) return;
3151 ol.pushGeneratorState();
3152 ol.disableAllBut(OutputGenerator::Html);
3153 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages);
3154 QCString title = lne ? lne->title() : theTranslator->trRelatedPages();
3155 startFile(ol,"pages",0,title,HLI_Pages);
3157 ol.parseText(title);
3160 ol.startTextBlock();
3161 ol.parseText(lne ? lne->intro() : theTranslator->trRelatedPagesDescription());
3165 FTVHelp* ftv = new FTVHelp(FALSE);
3166 PageSDict::Iterator pdi(*Doxygen::pageSDict);
3168 for (pdi.toFirst();(pd=pdi.current());++pdi)
3170 if ((pd->getOuterScope()==0 ||
3171 pd->getOuterScope()->definitionType()!=Definition::TypePage) && // not a sub page
3172 !pd->isReference() // not an external page
3179 FTextStream t(&outStr);
3180 ftv->generateTreeViewInline(t);
3181 ol.writeString(outStr);
3185 // ol.popGeneratorState();
3189 ol.popGeneratorState();
3192 //----------------------------------------------------------------------------
3194 static int countGroups()
3197 GroupSDict::Iterator gli(*Doxygen::groupSDict);
3199 for (gli.toFirst();(gd=gli.current());++gli)
3201 if (!gd->isReference())
3210 //----------------------------------------------------------------------------
3212 static int countDirs()
3215 SDict<DirDef>::Iterator dli(*Doxygen::directories);
3217 for (dli.toFirst();(dd=dli.current());++dli)
3219 if (dd->isLinkableInProject())
3229 //----------------------------------------------------------------------------
3231 void writeGraphInfo(OutputList &ol)
3233 if (!Config_getBool("HAVE_DOT") || !Config_getBool("GENERATE_HTML")) return;
3234 ol.pushGeneratorState();
3235 ol.disableAllBut(OutputGenerator::Html);
3236 generateGraphLegend(Config_getString("HTML_OUTPUT"));
3238 bool &stripCommentsStateRef = Config_getBool("STRIP_CODE_COMMENTS");
3239 bool oldStripCommentsState = stripCommentsStateRef;
3240 bool &createSubdirs = Config_getBool("CREATE_SUBDIRS");
3241 bool oldCreateSubdirs = createSubdirs;
3242 // temporarily disable the stripping of comments for our own code example!
3243 stripCommentsStateRef = FALSE;
3244 // temporarily disable create subdirs for linking to our example
3245 createSubdirs = FALSE;
3247 startFile(ol,"graph_legend",0,theTranslator->trLegendTitle().data());
3249 ol.parseText(theTranslator->trLegendTitle());
3252 QCString legendDocs = theTranslator->trLegendDocs();
3253 int s = legendDocs.find("<center>");
3254 int e = legendDocs.find("</center>");
3255 if (Config_getEnum("DOT_IMAGE_FORMAT")=="svg" && s!=-1 && e!=-1)
3257 legendDocs = legendDocs.left(s+8) + "[!-- SVG 0 --]\n" + legendDocs.mid(e);
3258 //printf("legendDocs=%s\n",legendDocs.data());
3260 FileDef fd("","graph_legend");
3261 ol.generateDoc("graph_legend",1,&fd,0,legendDocs,FALSE,FALSE);
3263 // restore config settings
3264 stripCommentsStateRef = oldStripCommentsState;
3265 createSubdirs = oldCreateSubdirs;
3268 ol.popGeneratorState();
3273 //----------------------------------------------------------------------------
3275 * write groups as hierarchical trees
3277 static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv, bool addToIndex)
3279 //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
3280 //bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
3283 warn(gd->getDefFileName(),gd->getDefLine(),
3284 "maximum nesting level exceeded for group %s: check for possible recursive group relation!\n",gd->name().data()
3289 /* Some groups should appear twice under different parent-groups.
3290 * That is why we should not check if it was visited
3292 if (/*!gd->visited &&*/ (!gd->isASubGroup() || level>0) &&
3294 (!gd->isReference() || Config_getBool("EXTERNAL_GROUPS")) // hide external groups by default
3297 //printf("gd->name()=%s #members=%d\n",gd->name().data(),gd->countMembers());
3299 bool hasSubGroups = gd->getSubGroups()->count()>0;
3300 bool hasSubPages = gd->getPages()->count()>0;
3301 int numSubItems = 0;
3302 if (1 /*Config_getBool("TOC_EXPAND")*/)
3304 QListIterator<MemberList> mli(gd->getMemberLists());
3306 for (mli.toFirst();(ml=mli.current());++mli)
3308 if (ml->listType()&MemberListType_documentationLists)
3310 numSubItems += ml->count();
3313 numSubItems += gd->getNamespaces()->count();
3314 numSubItems += gd->getClasses()->count();
3315 numSubItems += gd->getFiles()->count();
3316 numSubItems += gd->getDirs()->count();
3317 numSubItems += gd->getPages()->count();
3320 bool isDir = hasSubGroups || hasSubPages || numSubItems>0;
3321 //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
3324 Doxygen::indexList->addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0,isDir,TRUE);
3325 Doxygen::indexList->incContentsDepth();
3329 ftv->addContentsItem(hasSubGroups,gd->groupTitle(),
3330 gd->getReference(),gd->getOutputFileBase(),0,
3332 ftv->incContentsDepth();
3335 //ol.writeListItem();
3336 //ol.startTextLink(gd->getOutputFileBase(),0);
3337 //parseText(ol,gd->groupTitle());
3340 ol.startIndexListItem();
3341 ol.startIndexItem(gd->getReference(),gd->getOutputFileBase());
3342 ol.parseText(gd->groupTitle());
3343 ol.endIndexItem(gd->getReference(),gd->getOutputFileBase());
3344 if (gd->isReference())
3346 ol.startTypewriter();
3347 ol.docify(" [external]");
3351 QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Group));
3352 LayoutDocEntry *lde;
3353 for (eli.toFirst();(lde=eli.current());++eli)
3355 if (lde->kind()==LayoutDocEntry::MemberDef && addToIndex)
3357 LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
3358 MemberList *ml = gd->getMemberList(lmd->type);
3361 MemberListIterator mi(*ml);
3363 for (mi.toFirst();(md=mi.current());++mi)
3365 MemberList *enumList = md->enumFieldList();
3366 bool isDir = enumList!=0 && md->isEnumerate();
3367 if (md->isVisible() && md->name().find('@')==-1)
3369 Doxygen::indexList->addContentsItem(isDir,
3370 md->name(),md->getReference(),
3371 md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
3375 Doxygen::indexList->incContentsDepth();
3376 MemberListIterator emli(*enumList);
3378 for (emli.toFirst();(emd=emli.current());++emli)
3380 if (emd->isVisible())
3382 Doxygen::indexList->addContentsItem(FALSE,
3383 emd->name(),emd->getReference(),emd->getOutputFileBase(),
3384 emd->anchor(),FALSE,addToIndex);
3387 Doxygen::indexList->decContentsDepth();
3392 else if (lde->kind()==LayoutDocEntry::GroupClasses && addToIndex)
3394 ClassSDict::Iterator it(*gd->getClasses());
3396 for (;(cd=it.current());++it)
3398 //bool nestedClassInSameGroup =
3399 // cd->getOuterScope() && cd->getOuterScope()->definitionType()==Definition::TypeClass &&
3400 // cd->getOuterScope()->partOfGroups()!=0 && cd->getOuterScope()->partOfGroups()->contains(gd);
3401 //printf("===== GroupClasses: %s visible=%d nestedClassInSameGroup=%d\n",cd->name().data(),cd->isVisible(),nestedClassInSameGroup);
3402 if (cd->isVisible() /*&& !nestedClassInSameGroup*/)
3404 //if (cd->isEmbeddedInOuterScope())
3406 //printf("add class & members %d\n",addToIndex);
3407 addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(FALSE),cd->anchor(),addToIndex,TRUE);
3409 //else // only index the class, not its members
3411 // printf("%s: add class only\n",cd->name().data());
3412 // Doxygen::indexList->addContentsItem(FALSE,
3413 // cd->displayName(TRUE),cd->getReference(),
3414 // cd->getOutputFileBase(),cd->anchor(),addToIndex,TRUE);
3419 else if (lde->kind()==LayoutDocEntry::GroupNamespaces && addToIndex)
3421 NamespaceSDict::Iterator it(*gd->getNamespaces());
3423 for (;(nd=it.current());++it)
3425 if (nd->isVisible())
3427 Doxygen::indexList->addContentsItem(FALSE,
3428 nd->localName(),nd->getReference(),
3429 nd->getOutputFileBase(),0,FALSE,FALSE);
3433 else if (lde->kind()==LayoutDocEntry::GroupFiles && addToIndex)
3435 QListIterator<FileDef> it(*gd->getFiles());
3437 for (;(fd=it.current());++it)
3439 if (fd->isVisible())
3441 Doxygen::indexList->addContentsItem(FALSE,
3442 fd->displayName(),fd->getReference(),
3443 fd->getOutputFileBase(),0,FALSE,FALSE);
3447 else if (lde->kind()==LayoutDocEntry::GroupDirs && addToIndex)
3449 QListIterator<DirDef> it(*gd->getDirs());
3451 for (;(dd=it.current());++it)
3453 if (dd->isVisible())
3455 Doxygen::indexList->addContentsItem(FALSE,
3456 dd->shortName(),dd->getReference(),
3457 dd->getOutputFileBase(),0,FALSE,FALSE);
3461 else if (lde->kind()==LayoutDocEntry::GroupPageDocs && addToIndex)
3463 SDict<PageDef>::Iterator it(*gd->getPages());
3465 for (;(pd=it.current());++it)
3468 if (!pd->name().isEmpty()) si=Doxygen::sectionDict->find(pd->name());
3469 bool hasSubPages = pd->hasSubPages();
3470 bool hasSections = pd->hasSections();
3471 Doxygen::indexList->addContentsItem(
3472 hasSubPages || hasSections,
3473 convertToHtml(pd->title(),TRUE),
3475 gd->getOutputFileBase(),
3476 si ? si->label.data() : 0,
3477 hasSubPages || hasSections,
3478 TRUE); // addToNavIndex
3479 if (hasSections || hasSubPages)
3481 Doxygen::indexList->incContentsDepth();
3485 pd->addSectionsToIndex();
3488 if (hasSections || hasSubPages)
3490 Doxygen::indexList->decContentsDepth();
3494 else if (lde->kind()==LayoutDocEntry::GroupNestedGroups)
3496 if (gd->getSubGroups()->count()>0)
3498 startIndexHierarchy(ol,level+1);
3499 QListIterator<GroupDef> gli(*gd->getSubGroups());
3500 GroupDef *subgd = 0;
3501 for (gli.toFirst();(subgd=gli.current());++gli)
3503 writeGroupTreeNode(ol,subgd,level+1,ftv,addToIndex);
3505 endIndexHierarchy(ol,level+1);
3510 ol.endIndexListItem();
3514 Doxygen::indexList->decContentsDepth();
3518 ftv->decContentsDepth();
3524 static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
3528 ol.pushGeneratorState();
3529 ol.disable(OutputGenerator::Html);
3531 startIndexHierarchy(ol,0);
3532 GroupSDict::Iterator gli(*Doxygen::groupSDict);
3534 for (gli.toFirst();(gd=gli.current());++gli)
3536 writeGroupTreeNode(ol,gd,0,ftv,addToIndex);
3538 endIndexHierarchy(ol,0);
3541 ol.popGeneratorState();
3546 static void writeGroupTree(GroupDef *gd,FTVHelp *ftv,int level,bool addToIndex)
3548 static bool externalGroups = Config_getBool("EXTERNAL_GROUPS");
3549 /* Some groups should appear twice under different parent-groups.
3550 * That is why we should not check if it was visited
3552 if ((!gd->isASubGroup() || level>0) &&
3554 (!gd->isReference() || externalGroups) // hide external groups by default
3559 ftv->addContentsItem(hasSubGroups,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0);
3560 ftv->incContentsDepth();
3564 ftv->decContentsDepth();
3569 static void writeGroupTree(FTVHelp *ftv,bool addToIndex)
3571 GroupSDict::Iterator gli(*Doxygen::groupSDict);
3573 for (gli.toFirst();(gd=gli.current());++gli)
3575 writeGroupTree(gd,ftv,0,addToIndex);
3580 //----------------------------------------------------------------------------
3582 static void writeGroupIndex(OutputList &ol)
3584 if (documentedGroups==0) return;
3585 ol.pushGeneratorState();
3587 ol.disable(OutputGenerator::Man);
3588 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Modules);
3589 QCString title = lne ? lne->title() : theTranslator->trModules();
3590 bool addToIndex = lne==0 || lne->visible();
3592 startFile(ol,"modules",0,title,HLI_Modules);
3594 ol.parseText(title);
3597 ol.startTextBlock();
3598 ol.parseText(lne ? lne->intro() : theTranslator->trModulesDescription());
3602 // Normal group index for Latex/RTF
3605 ol.pushGeneratorState();
3606 ol.disable(OutputGenerator::Html);
3607 Doxygen::indexList->disable();
3609 writeGroupHierarchy(ol,0,FALSE);
3611 Doxygen::indexList->enable();
3612 ol.popGeneratorState();
3616 // interactive group index for HTML
3619 ol.pushGeneratorState();
3620 ol.disableAllBut(OutputGenerator::Html);
3625 Doxygen::indexList->addContentsItem(TRUE,title,0,"modules",0,TRUE,TRUE);
3626 Doxygen::indexList->incContentsDepth();
3628 FTVHelp* ftv = new FTVHelp(FALSE);
3629 writeGroupHierarchy(ol,ftv,addToIndex);
3631 FTextStream t(&outStr);
3632 ftv->generateTreeViewInline(t);
3633 ol.disableAllBut(OutputGenerator::Html);
3634 ol.writeString(outStr);
3638 Doxygen::indexList->decContentsDepth();
3641 ol.popGeneratorState();
3645 ol.popGeneratorState();
3649 //----------------------------------------------------------------------------
3652 static void writeDirIndex(OutputList &ol)
3654 if (documentedDirs==0) return;
3655 ol.pushGeneratorState();
3656 ol.disable(OutputGenerator::Man);
3657 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Dirs);
3658 QCString title = lne ? lne->title() : theTranslator->trDirectories();
3659 bool addToIndex=FALSE; //lne==0 || lne->visible();
3661 startFile(ol,"dirs",0,title,HLI_Directories);
3663 ol.parseText(title);
3666 ol.startTextBlock();
3670 Doxygen::indexList->addContentsItem(TRUE,title,0,"dirs",0,TRUE,TRUE);
3671 Doxygen::indexList->incContentsDepth();
3673 ol.parseText(lne ? lne->intro() : theTranslator->trDirDescription());
3677 bool treeView=Config_getBool("USE_INLINE_TREES");
3680 ftv = new FTVHelp(FALSE);
3683 writeDirHierarchy(ol,ftv,addToIndex);
3688 FTextStream t(&outStr);
3689 ftv->generateTreeViewInline(t);
3690 ol.pushGeneratorState();
3691 ol.disableAllBut(OutputGenerator::Html);
3692 ol.writeString(outStr);
3693 ol.popGeneratorState();
3698 Doxygen::indexList->decContentsDepth();
3701 ol.popGeneratorState();
3705 //----------------------------------------------------------------------------
3707 static void writeUserGroupStubPage(OutputList &ol,LayoutNavEntry *lne)
3709 if (lne->baseFile().left(9)=="usergroup")
3711 ol.pushGeneratorState();
3712 ol.disableAllBut(OutputGenerator::Html);
3713 startFile(ol,lne->baseFile(),0,lne->title(),HLI_UserGroup);
3715 ol.parseText(lne->title());
3718 QListIterator<LayoutNavEntry> li(lne->children());
3719 LayoutNavEntry *entry;
3721 for (li.toFirst();(entry=li.current());++li)
3723 if (entry->visible()) count++;
3727 ol.writeString("<ul>\n");
3728 for (li.toFirst();(entry=li.current());++li)
3730 if (entry->visible())
3732 ol.writeString("<li><a href=\""+entry->url()+"\"><span>"+
3733 fixSpaces(entry->title())+"</span></a></li>\n");
3736 ol.writeString("</ul>\n");
3739 ol.popGeneratorState();
3743 //----------------------------------------------------------------------------
3746 static void writeIndex(OutputList &ol)
3748 static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
3749 static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL");
3750 static QCString projectName = Config_getString("PROJECT_NAME");
3751 // save old generator state
3752 ol.pushGeneratorState();
3754 QCString projPrefix;
3755 if (!projectName.isEmpty())
3757 projPrefix=projectName+" ";
3760 //--------------------------------------------------------------------
3762 //--------------------------------------------------------------------
3763 ol.disableAllBut(OutputGenerator::Html);
3765 QCString defFileName =
3766 Doxygen::mainPage ? Doxygen::mainPage->docFile().data() : "[generated]";
3768 Doxygen::mainPage ? Doxygen::mainPage->docLine() : -1;
3771 if (!mainPageHasTitle())
3773 title = theTranslator->trMainPage();
3777 title = filterTitle(Doxygen::mainPage->title());
3780 QCString indexName="index";
3781 ol.startFile(indexName,0,title);
3783 if (Doxygen::mainPage)
3786 (!projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0)
3787 ) // to avoid duplicate entries in the treeview
3789 Doxygen::indexList->addContentsItem(Doxygen::mainPage->hasSubPages(),title,0,indexName,0,Doxygen::mainPage->hasSubPages(),TRUE);
3791 if (Doxygen::mainPage->hasSubPages() || Doxygen::mainPage->hasSections())
3793 writePages(Doxygen::mainPage,0);
3797 ol.startQuickIndices();
3798 if (!Config_getBool("DISABLE_INDEX"))
3800 ol.writeQuickLinks(TRUE,HLI_Main,0);
3802 ol.endQuickIndices();
3803 ol.writeSplitBar(indexName);
3804 ol.writeSearchInfo();
3805 bool headerWritten=FALSE;
3806 if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty())
3808 if (Doxygen::mainPage->title().lower()!="notitle")
3810 ol.startHeaderSection();
3811 ol.startTitleHead(0);
3812 ol.generateDoc(Doxygen::mainPage->docFile(),Doxygen::mainPage->docLine(),
3813 Doxygen::mainPage,0,Doxygen::mainPage->title(),
3814 TRUE,FALSE,0,TRUE,FALSE);
3815 headerWritten = TRUE;
3820 if (!projectName.isEmpty())
3822 ol.startHeaderSection();
3823 ol.startTitleHead(0);
3824 ol.parseText(projPrefix+theTranslator->trDocumentation());
3825 headerWritten = TRUE;
3830 ol.endTitleHead(0,0);
3831 ol.endHeaderSection();
3835 if (Config_getBool("DISABLE_INDEX") && Doxygen::mainPage==0)
3837 ol.writeQuickLinks(FALSE,HLI_Main,0);
3840 if (Doxygen::mainPage)
3842 Doxygen::insideMainPage=TRUE;
3843 if (Doxygen::mainPage->showToc() && Doxygen::mainPage->hasSections())
3845 Doxygen::mainPage->writeToc(ol);
3848 ol.startTextBlock();
3849 ol.generateDoc(defFileName,defLine,Doxygen::mainPage,0,
3850 Doxygen::mainPage->documentation(),TRUE,FALSE
3851 /*,Doxygen::mainPage->sectionDict*/);
3854 Doxygen::insideMainPage=FALSE;
3858 ol.disable(OutputGenerator::Html);
3860 //--------------------------------------------------------------------
3861 // write LaTeX/RTF index
3862 //--------------------------------------------------------------------
3863 ol.enable(OutputGenerator::Latex);
3864 ol.enable(OutputGenerator::RTF);
3866 ol.startFile("refman",0,0);
3867 ol.startIndexSection(isTitlePageStart);
3868 if (!Config_getString("LATEX_HEADER").isEmpty())
3870 ol.disable(OutputGenerator::Latex);
3873 if (projPrefix.isEmpty())
3875 ol.parseText(theTranslator->trReferenceManual());
3879 ol.parseText(projPrefix);
3882 if (!Config_getString("PROJECT_NUMBER").isEmpty())
3884 ol.startProjectNumber();
3885 ol.generateDoc(defFileName,defLine,Doxygen::mainPage,0,Config_getString("PROJECT_NUMBER"),FALSE,FALSE);
3886 ol.endProjectNumber();
3888 ol.endIndexSection(isTitlePageStart);
3889 ol.startIndexSection(isTitlePageAuthor);
3890 ol.parseText(theTranslator->trGeneratedBy());
3891 ol.endIndexSection(isTitlePageAuthor);
3892 ol.enable(OutputGenerator::Latex);
3895 if (Doxygen::mainPage)
3897 ol.startIndexSection(isMainPage);
3898 if (mainPageHasTitle())
3900 ol.parseText(Doxygen::mainPage->title());
3904 ol.parseText(/*projPrefix+*/theTranslator->trMainPage());
3906 ol.endIndexSection(isMainPage);
3908 if (documentedPages>0)
3910 //ol.parseText(projPrefix+theTranslator->trPageDocumentation());
3911 //ol.endIndexSection(isPageDocumentation);
3912 PageSDict::Iterator pdi(*Doxygen::pageSDict);
3913 PageDef *pd=pdi.toFirst();
3914 bool first=Doxygen::mainPage==0;
3915 for (pdi.toFirst();(pd=pdi.current());++pdi)
3917 if (!pd->getGroupDef() && !pd->isReference() &&
3918 (!pd->hasParentPage() || // not inside other page
3919 (Doxygen::mainPage==pd->getOuterScope())) // or inside main page
3922 bool isCitationPage = pd->name()=="citelist";
3925 // For LaTeX the bibliograph is already written by \bibliography
3926 ol.pushGeneratorState();
3927 ol.disable(OutputGenerator::Latex);
3929 QCString title = pd->title();
3930 if (title.isEmpty()) title=pd->name();
3932 ol.startIndexSection(isPageDocumentation);
3933 ol.parseText(title);
3934 ol.endIndexSection(isPageDocumentation);
3936 ol.pushGeneratorState(); // write TOC title (RTF only)
3937 ol.disableAllBut(OutputGenerator::RTF);
3938 ol.startIndexSection(isPageDocumentation2);
3939 ol.parseText(title);
3940 ol.endIndexSection(isPageDocumentation2);
3941 ol.popGeneratorState();
3943 ol.writeAnchor(0,pd->getOutputFileBase());
3945 ol.writePageLink(pd->getOutputFileBase(),first);
3950 ol.popGeneratorState();
3956 if (!Config_getBool("LATEX_HIDE_INDICES"))
3958 //if (indexedPages>0)
3960 // ol.startIndexSection(isPageIndex);
3961 // ol.parseText(/*projPrefix+*/ theTranslator->trPageIndex());
3962 // ol.endIndexSection(isPageIndex);
3964 if (documentedGroups>0)
3966 ol.startIndexSection(isModuleIndex);
3967 ol.parseText(/*projPrefix+*/ theTranslator->trModuleIndex());
3968 ol.endIndexSection(isModuleIndex);
3970 if (documentedNamespaces>0)
3972 ol.startIndexSection(isNamespaceIndex);
3973 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModulesIndex():theTranslator->trNamespaceIndex()));
3974 ol.endIndexSection(isNamespaceIndex);
3976 if (hierarchyClasses>0)
3978 ol.startIndexSection(isClassHierarchyIndex);
3979 ol.parseText(/*projPrefix+*/
3980 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
3981 vhdlOpt ? VhdlDocGen::trDesignUnitIndex() :
3982 theTranslator->trHierarchicalIndex()
3984 ol.endIndexSection(isClassHierarchyIndex);
3986 if (annotatedClassesPrinted>0)
3988 ol.startIndexSection(isCompoundIndex);
3989 ol.parseText(/*projPrefix+*/
3990 (fortranOpt ? theTranslator->trCompoundIndexFortran() :
3991 vhdlOpt ? VhdlDocGen::trDesignUnitIndex() :
3992 theTranslator->trCompoundIndex()
3994 ol.endIndexSection(isCompoundIndex);
3996 if (documentedFiles>0)
3998 ol.startIndexSection(isFileIndex);
3999 ol.parseText(/*projPrefix+*/theTranslator->trFileIndex());
4000 ol.endIndexSection(isFileIndex);
4003 if (documentedGroups>0)
4005 ol.startIndexSection(isModuleDocumentation);
4006 ol.parseText(/*projPrefix+*/theTranslator->trModuleDocumentation());
4007 ol.endIndexSection(isModuleDocumentation);
4009 if (documentedNamespaces>0)
4011 ol.startIndexSection(isNamespaceDocumentation);
4012 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trModuleDocumentation():theTranslator->trNamespaceDocumentation()));
4013 ol.endIndexSection(isNamespaceDocumentation);
4015 if (annotatedClassesPrinted>0)
4017 ol.startIndexSection(isClassDocumentation);
4018 ol.parseText(/*projPrefix+*/(fortranOpt?theTranslator->trTypeDocumentation():theTranslator->trClassDocumentation()));
4019 ol.endIndexSection(isClassDocumentation);
4021 if (documentedFiles>0)
4023 ol.startIndexSection(isFileDocumentation);
4024 ol.parseText(/*projPrefix+*/theTranslator->trFileDocumentation());
4025 ol.endIndexSection(isFileDocumentation);
4027 if (Doxygen::exampleSDict->count()>0)
4029 ol.startIndexSection(isExampleDocumentation);
4030 ol.parseText(/*projPrefix+*/theTranslator->trExampleDocumentation());
4031 ol.endIndexSection(isExampleDocumentation);
4033 ol.endIndexSection(isEndIndex);
4036 if (Doxygen::mainPage)
4038 Doxygen::insideMainPage=TRUE;
4039 ol.disable(OutputGenerator::Man);
4040 startFile(ol,Doxygen::mainPage->name(),0,Doxygen::mainPage->title());
4042 ol.startTextBlock();
4043 ol.generateDoc(defFileName,defLine,Doxygen::mainPage,0,
4044 Doxygen::mainPage->documentation(),FALSE,FALSE
4048 ol.enable(OutputGenerator::Man);
4049 Doxygen::insideMainPage=FALSE;
4052 ol.popGeneratorState();
4055 static QArray<bool> indexWritten;
4057 static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry> &entries)
4059 QListIterator<LayoutNavEntry> li(entries);
4060 LayoutNavEntry *lne;
4061 for (li.toFirst();(lne=li.current());++li)
4063 LayoutNavEntry::Kind kind = lne->kind();
4064 uint index = (uint)kind;
4065 if (index>=indexWritten.size())
4068 uint oldSize = indexWritten.size();
4069 uint newSize = index+1;
4070 indexWritten.resize(newSize);
4071 for (i=oldSize;i<newSize;i++) indexWritten.at(i)=FALSE;
4073 //printf("starting %s kind=%d\n",lne->title().data(),lne->kind());
4074 bool addToIndex=lne==0 || lne->visible();
4075 bool needsClosing=FALSE;
4076 if (!indexWritten.at(index))
4080 case LayoutNavEntry::MainPage:
4081 msg("Generating index page...\n");
4084 case LayoutNavEntry::Pages:
4085 msg("Generating page index...\n");
4088 case LayoutNavEntry::Modules:
4089 msg("Generating module index...\n");
4090 writeGroupIndex(ol);
4092 case LayoutNavEntry::Namespaces:
4094 static bool showNamespaces = Config_getBool("SHOW_NAMESPACES");
4097 if (documentedNamespaces>0 && addToIndex)
4099 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,0,0);
4100 Doxygen::indexList->incContentsDepth();
4103 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne) // for backward compatibility with old layout file
4105 msg("Generating namespace index...\n");
4106 writeNamespaceIndex(ol);
4111 case LayoutNavEntry::NamespaceList:
4113 static bool showNamespaces = Config_getBool("SHOW_NAMESPACES");
4116 msg("Generating namespace index...\n");
4117 writeNamespaceIndex(ol);
4121 case LayoutNavEntry::NamespaceMembers:
4122 msg("Generating namespace member index...\n");
4123 writeNamespaceMemberIndex(ol);
4125 case LayoutNavEntry::Classes:
4126 if (annotatedClasses>0 && addToIndex)
4128 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,0,0);
4129 Doxygen::indexList->incContentsDepth();
4132 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne) // for backward compatibility with old layout file
4134 msg("Generating annotated compound index...\n");
4135 writeAnnotatedIndex(ol);
4138 case LayoutNavEntry::ClassList:
4139 msg("Generating annotated compound index...\n");
4140 writeAnnotatedIndex(ol);
4142 case LayoutNavEntry::ClassIndex:
4143 msg("Generating alphabetical compound index...\n");
4144 writeAlphabeticalIndex(ol);
4146 case LayoutNavEntry::ClassHierarchy:
4147 msg("Generating hierarchical class index...\n");
4148 writeHierarchicalIndex(ol);
4149 if (Config_getBool("HAVE_DOT") && Config_getBool("GRAPHICAL_HIERARCHY"))
4151 msg("Generating graphical class hierarchy...\n");
4152 writeGraphicalClassHierarchy(ol);
4155 case LayoutNavEntry::ClassMembers:
4156 msg("Generating member index...\n");
4157 writeClassMemberIndex(ol);
4159 case LayoutNavEntry::Files:
4161 static bool showFiles = Config_getBool("SHOW_FILES");
4164 if (documentedHtmlFiles>0 && addToIndex)
4166 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,0,0);
4167 Doxygen::indexList->incContentsDepth();
4170 if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne) // for backward compatibility with old layout file
4172 msg("Generating file index...\n");
4178 case LayoutNavEntry::FileList:
4180 static bool showFiles = Config_getBool("SHOW_FILES");
4183 msg("Generating file index...\n");
4188 case LayoutNavEntry::FileGlobals:
4189 msg("Generating file member index...\n");
4190 writeFileMemberIndex(ol);
4192 case LayoutNavEntry::Examples:
4193 msg("Generating example index...\n");
4194 writeExampleIndex(ol);
4196 case LayoutNavEntry::User:
4198 // prepend a ! or ^ marker to the URL to avoid tampering with it
4199 QCString url = correctURL(lne->url(),"!"); // add ! to relative URL
4200 bool isRelative=url.at(0)=='!';
4201 if (!url.isEmpty() && !isRelative) // absolute URL
4203 url.prepend("^"); // prepend ^ to absolute URL
4205 bool isRef = lne->baseFile().left(4)=="@ref" || lne->baseFile().left(4)=="\\ref";
4206 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,url,0,FALSE,isRef || isRelative);
4209 case LayoutNavEntry::UserGroup:
4212 QCString url = correctURL(lne->url(),"!"); // add ! to relative URL
4217 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,0,0,FALSE,FALSE);
4221 bool isRelative=url.at(0)=='!';
4222 if (!isRelative) // absolute URL
4224 url.prepend("^"); // prepend ^ to absolute URL
4226 bool isRef = lne->baseFile().left(4)=="@ref" || lne->baseFile().left(4)=="\\ref";
4227 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,url,0,FALSE,isRef || isRelative);
4232 Doxygen::indexList->addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0,TRUE,TRUE);
4234 Doxygen::indexList->incContentsDepth();
4237 writeUserGroupStubPage(ol,lne);
4240 if (kind!=LayoutNavEntry::User && kind!=LayoutNavEntry::UserGroup) // User entry may appear multiple times
4242 indexWritten.at(index)=TRUE;
4245 writeIndexHierarchyEntries(ol,lne->children());
4250 case LayoutNavEntry::Namespaces:
4251 case LayoutNavEntry::Classes:
4252 case LayoutNavEntry::Files:
4253 case LayoutNavEntry::UserGroup:
4254 Doxygen::indexList->decContentsDepth();
4260 //printf("ending %s kind=%d\n",lne->title().data(),lne->kind());
4264 void writeIndexHierarchy(OutputList &ol)
4266 LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry();
4269 writeIndexHierarchyEntries(ol,lne->children());