summaryrefslogtreecommitdiffstats
path: root/src/index.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.cpp')
-rw-r--r--src/index.cpp660
1 files changed, 322 insertions, 338 deletions
diff --git a/src/index.cpp b/src/index.cpp
index 12f35f2..dbd9770 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -254,7 +254,7 @@ QCString fixSpaces(const QCString &s)
return substitute(s," "," ");
}
-void startTitle(OutputList &ol,const char *fileName,const Definition *def)
+void startTitle(OutputList &ol,const char *fileName,const DefinitionMutable *def)
{
ol.startHeaderSection();
if (def) def->writeSummaryLinks(ol);
@@ -307,7 +307,6 @@ void endFile(OutputList &ol,bool skipNavIndex,bool skipEndContents,
ol.writeFooter(navPath); // write the footer
ol.popGeneratorState();
ol.endFile();
- TooltipManager::instance()->clearTooltips(); // Only clear after the last is written
}
void endFileWithNavPath(const Definition *d,OutputList &ol)
@@ -326,6 +325,66 @@ void endFileWithNavPath(const Definition *d,OutputList &ol)
}
//----------------------------------------------------------------------
+
+static bool memberVisibleInIndex(const MemberDef *md)
+{
+ bool isAnonymous = md->isAnonymous();
+ bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
+ bool extractStatic = Config_getBool(EXTRACT_STATIC);
+ return (!isAnonymous &&
+ (!hideUndocMembers || md->hasDocumentation()) &&
+ (!md->isStatic() || extractStatic)
+ );
+}
+
+static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool addToIndex)
+{
+ bool isAnonymous = md->isAnonymous();
+ bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
+ const MemberList *enumList = md->enumFieldList();
+ bool isDir = enumList!=0 && md->isEnumerate();
+ if (md->getOuterScope()==def || md->getOuterScope()==Doxygen::globalScope)
+ {
+ Doxygen::indexList->addContentsItem(isDir,
+ md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
+ }
+ else // inherited member
+ {
+ Doxygen::indexList->addContentsItem(isDir,
+ md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
+ }
+ if (isDir)
+ {
+ if (!isAnonymous)
+ {
+ Doxygen::indexList->incContentsDepth();
+ }
+ MemberListIterator emli(*enumList);
+ MemberDef *emd;
+ for (emli.toFirst();(emd=emli.current());++emli)
+ {
+ if (!hideUndocMembers || emd->hasDocumentation())
+ {
+ if (emd->getOuterScope()==def || emd->getOuterScope()==Doxygen::globalScope)
+ {
+ Doxygen::indexList->addContentsItem(FALSE,
+ emd->name(),emd->getReference(),emd->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
+ }
+ else // inherited member
+ {
+ Doxygen::indexList->addContentsItem(FALSE,
+ emd->name(),def->getReference(),def->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
+ }
+ }
+ }
+ if (!isAnonymous)
+ {
+ Doxygen::indexList->decContentsDepth();
+ }
+ }
+}
+
+//----------------------------------------------------------------------
template<class T>
void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
const QCString &name,const QCString &anchor,
@@ -366,55 +425,9 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
MemberDef *md;
for (mi.toFirst();(md=mi.current());++mi)
{
- const MemberList *enumList = md->enumFieldList();
- bool isDir = enumList!=0 && md->isEnumerate();
- bool isAnonymous = md->isAnonymous();
- static bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
- static bool extractStatic = Config_getBool(EXTRACT_STATIC);
- if (!isAnonymous &&
- (!hideUndocMembers || md->hasDocumentation()) &&
- (!md->isStatic() || extractStatic)
- )
+ if (memberVisibleInIndex(md))
{
- if (md->getOuterScope()==def || md->getOuterScope()==Doxygen::globalScope)
- {
- Doxygen::indexList->addContentsItem(isDir,
- md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
- }
- else // inherited member
- {
- Doxygen::indexList->addContentsItem(isDir,
- md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex);
- }
- }
- if (isDir)
- {
- if (!isAnonymous)
- {
- Doxygen::indexList->incContentsDepth();
- }
- MemberListIterator emli(*enumList);
- MemberDef *emd;
- for (emli.toFirst();(emd=emli.current());++emli)
- {
- if (!hideUndocMembers || emd->hasDocumentation())
- {
- if (emd->getOuterScope()==def || emd->getOuterScope()==Doxygen::globalScope)
- {
- Doxygen::indexList->addContentsItem(FALSE,
- emd->name(),emd->getReference(),emd->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
- }
- else // inherited member
- {
- Doxygen::indexList->addContentsItem(FALSE,
- emd->name(),def->getReference(),def->getOutputFileBase(),emd->anchor(),FALSE,addToIndex);
- }
- }
- }
- if (!isAnonymous)
- {
- Doxygen::indexList->decContentsDepth();
- }
+ writeMemberToIndex(def,md,addToIndex);
}
}
}
@@ -451,14 +464,13 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part,
//----------------------------------------------------------------------------
/*! Generates HTML Help tree of classes */
-static void writeClassTree(OutputList &ol,const BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex)
+static void writeClassTreeToOutput(OutputList &ol,const BaseClassList &bcl,int level,FTVHelp* ftv,bool addToIndex,ClassDefSet &visitedClasses)
{
- if (bcl==0) return;
- BaseClassListIterator bcli(*bcl);
+ if (bcl.empty()) return;
bool started=FALSE;
- for ( ; bcli.current() ; ++bcli)
+ for (const auto &bcd : bcl)
{
- ClassDef *cd=bcli.current()->classDef;
+ ClassDef *cd=bcd.classDef;
if (cd->getLanguage()==SrcLangExt_VHDL && (VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS)
{
continue;
@@ -491,7 +503,8 @@ static void writeClassTree(OutputList &ol,const BaseClassList *bcl,bool hideSupe
}
ol.startIndexListItem();
//printf("Passed...\n");
- bool hasChildren = !cd->isVisited() && !hideSuper && classHasVisibleChildren(cd);
+ bool hasChildren = visitedClasses.find(cd)==visitedClasses.end() &&
+ classHasVisibleChildren(cd);
//printf("tree4: Has children %s: %d\n",cd->name().data(),hasChildren);
if (cd->isLinkable())
{
@@ -513,7 +526,7 @@ static void writeClassTree(OutputList &ol,const BaseClassList *bcl,bool hideSupe
{
if (cd->getLanguage()==SrcLangExt_VHDL)
{
- ftv->addContentsItem(hasChildren,bcli.current()->usedName,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
+ ftv->addContentsItem(hasChildren,bcd.usedName,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd);
}
else
{
@@ -538,15 +551,14 @@ static void writeClassTree(OutputList &ol,const BaseClassList *bcl,bool hideSupe
if (hasChildren)
{
//printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited);
- bool wasVisited=cd->isVisited();
- cd->setVisited(TRUE);
+ visitedClasses.insert(cd);
if (cd->getLanguage()==SrcLangExt_VHDL)
{
- writeClassTree(ol,cd->baseClasses(),wasVisited,level+1,ftv,addToIndex);
+ writeClassTreeToOutput(ol,cd->baseClasses(),level+1,ftv,addToIndex,visitedClasses);
}
else
{
- writeClassTree(ol,cd->subClasses(),wasVisited,level+1,ftv,addToIndex);
+ writeClassTreeToOutput(ol,cd->subClasses(),level+1,ftv,addToIndex,visitedClasses);
}
}
ol.endIndexListItem();
@@ -820,7 +832,7 @@ static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex)
//----------------------------------------------------------------------------
static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FTVHelp* ftv,bool addToIndex,
- ClassDef::CompoundType ct)
+ ClassDef::CompoundType ct,ClassDefSet &visitedClasses)
{
static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
ClassSDict::Iterator cli(*cl);
@@ -864,7 +876,8 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT
started=TRUE;
}
ol.startIndexListItem();
- bool hasChildren = !cd->isVisited() && classHasVisibleChildren(cd);
+ bool hasChildren = visitedClasses.find(cd)==visitedClasses.end() &&
+ classHasVisibleChildren(cd);
//printf("list: Has children %s: %d\n",cd->name().data(),hasChildren);
if (cd->isLinkable())
{
@@ -905,13 +918,13 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT
}
if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren)
{
- writeClassTree(ol,cd->baseClasses(),cd->isVisited(),1,ftv,addToIndex);
- cd->setVisited(TRUE);
+ writeClassTreeToOutput(ol,cd->baseClasses(),1,ftv,addToIndex,visitedClasses);
+ visitedClasses.insert(cd);
}
else if (hasChildren)
{
- writeClassTree(ol,cd->subClasses(),cd->isVisited(),1,ftv,addToIndex);
- cd->setVisited(TRUE);
+ writeClassTreeToOutput(ol,cd->subClasses(),1,ftv,addToIndex,visitedClasses);
+ visitedClasses.insert(cd);
}
ol.endIndexListItem();
}
@@ -921,16 +934,15 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT
static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex,ClassDef::CompoundType ct)
{
- initClassHierarchy(Doxygen::classSDict);
- initClassHierarchy(Doxygen::hiddenClasses);
+ ClassDefSet visitedClasses;
if (ftv)
{
ol.pushGeneratorState();
ol.disable(OutputGenerator::Html);
}
bool started=FALSE;
- writeClassTreeForList(ol,Doxygen::classSDict,started,ftv,addToIndex,ct);
- writeClassTreeForList(ol,Doxygen::hiddenClasses,started,ftv,addToIndex,ct);
+ writeClassTreeForList(ol,Doxygen::classSDict,started,ftv,addToIndex,ct,visitedClasses);
+ writeClassTreeForList(ol,Doxygen::hiddenClasses,started,ftv,addToIndex,ct,visitedClasses);
if (started)
{
endIndexHierarchy(ol,0);
@@ -963,7 +975,7 @@ static int countClassesInTreeList(const ClassSDict &cl, ClassDef::CompoundType c
{
if (cd->isVisibleInHierarchy()) // should it be visible
{
- if (cd->subClasses()) // should have sub classes
+ if (!cd->subClasses().empty()) // should have sub classes
{
count++;
}
@@ -976,8 +988,6 @@ static int countClassesInTreeList(const ClassSDict &cl, ClassDef::CompoundType c
static int countClassHierarchy(ClassDef::CompoundType ct)
{
int count=0;
- initClassHierarchy(Doxygen::classSDict);
- initClassHierarchy(Doxygen::hiddenClasses);
count+=countClassesInTreeList(*Doxygen::classSDict, ct);
count+=countClassesInTreeList(*Doxygen::hiddenClasses, ct);
return count;
@@ -1555,7 +1565,7 @@ static int countNamespaces()
//----------------------------------------------------------------------------
-void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalOnly,ClassDef::CompoundType ct)
+static void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalOnly,ClassDef::CompoundType ct)
{
static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
if (clDict)
@@ -1564,7 +1574,8 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
- if (cd->getLanguage()==SrcLangExt_VHDL)
+ ClassDefMutable *cdm = toClassDefMutable(cd);
+ if (cdm && cd->getLanguage()==SrcLangExt_VHDL)
{
if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKAGECLASS ||
(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::PACKBODYCLASS
@@ -1575,7 +1586,7 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO
if ((VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ARCHITECTURECLASS)
{
QCString n=cd->name();
- cd->setClassName(n.data());
+ cdm->setClassName(n.data());
}
}
@@ -1606,9 +1617,7 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO
{
ftv->addContentsItem(count>0,cd->displayName(FALSE),cd->getReference(),
cd->getOutputFileBase(),cd->anchor(),FALSE,TRUE,cd);
- if (addToIndex &&
- /*cd->partOfGroups()==0 &&*/
- (cd->getOuterScope()==0 ||
+ if ((cd->getOuterScope()==0 ||
cd->getOuterScope()->definitionType()!=Definition::TypeClass
)
)
@@ -1616,7 +1625,7 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO
addMembersToIndex(cd,LayoutDocManager::Class,
cd->displayName(FALSE),
cd->anchor(),
- cd->partOfGroups()==0 && !cd->isSimple());
+ addToIndex && cd->partOfGroups()==0 && !cd->isSimple());
}
if (count>0)
{
@@ -1630,10 +1639,64 @@ void writeClassTree(ClassSDict *clDict,FTVHelp *ftv,bool addToIndex,bool globalO
}
}
+static int countVisibleMembers(const NamespaceDef *nd)
+{
+ int count=0;
+ QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
+ LayoutDocEntry *lde;
+ for (eli.toFirst();(lde=eli.current());++eli)
+ {
+ if (lde->kind()==LayoutDocEntry::MemberDef)
+ {
+ LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ MemberList *ml = nd->getMemberList(lmd->type);
+ if (ml)
+ {
+ MemberListIterator mi(*ml);
+ MemberDef *md;
+ for (mi.toFirst();(md=mi.current());++mi)
+ {
+ if (memberVisibleInIndex(md))
+ {
+ count++;
+ }
+ }
+ }
+ }
+ }
+ return count;
+}
+
+static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex)
+{
+ QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
+ LayoutDocEntry *lde;
+ for (eli.toFirst();(lde=eli.current());++eli)
+ {
+ if (lde->kind()==LayoutDocEntry::MemberDef)
+ {
+ LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ MemberList *ml = nd->getMemberList(lmd->type);
+ if (ml)
+ {
+ MemberListIterator mi(*ml);
+ MemberDef *md;
+ for (mi.toFirst();(md=mi.current());++mi)
+ {
+ //printf(" member %s visible=%d\n",md->name().data(),memberVisibleInIndex(md));
+ if (memberVisibleInIndex(md))
+ {
+ writeMemberToIndex(nd,md,addToIndex);
+ }
+ }
+ }
+ }
+ }
+}
+
static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv,
- bool rootOnly,bool showClasses,bool addToIndex,ClassDef::CompoundType ct)
+ bool rootOnly,bool addToIndex)
{
- static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
if (nsDict)
{
NamespaceSDict::Iterator nli(*nsDict);
@@ -1644,8 +1707,12 @@ static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv,
(!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
{
- bool hasChildren = namespaceHasVisibleChild(nd,showClasses,sliceOpt,ct);
+ bool hasChildren = namespaceHasNestedNamespace(nd) ||
+ namespaceHasNestedClass(nd,false,ClassDef::Class);
bool isLinkable = nd->isLinkableInProject();
+ int visibleMembers = countVisibleMembers(nd);
+
+ //printf("namespace %s hasChildren=%d visibleMembers=%d\n",nd->name().data(),hasChildren,visibleMembers);
QCString ref;
QCString file;
@@ -1659,45 +1726,114 @@ static void writeNamespaceTree(const NamespaceSDict *nsDict,FTVHelp *ftv,
}
}
- if ((isLinkable && !showClasses) || hasChildren)
+ bool isDir = hasChildren || visibleMembers>0;
+ if ((isLinkable) || isDir)
{
ftv->addContentsItem(hasChildren,nd->localName(),ref,file,0,FALSE,TRUE,nd);
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(hasChildren,nd->localName(),ref,file,QCString(),
+ Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
hasChildren && !file.isEmpty(),addToIndex);
}
+ if (addToIndex && isDir)
+ {
+ Doxygen::indexList->incContentsDepth();
+ }
- //printf("*** writeNamespaceTree count=%d addToIndex=%d showClasses=%d classCount=%d\n",
- // count,addToIndex,showClasses,classCount);
- if (hasChildren)
+ //printf("*** writeNamespaceTree count=%d addToIndex=%d false=%d classCount=%d\n",
+ // count,addToIndex,false,classCount);
+ if (isDir)
{
- if (addToIndex) Doxygen::indexList->incContentsDepth();
ftv->incContentsDepth();
- writeNamespaceTree(nd->getNamespaceSDict(),ftv,FALSE,showClasses,addToIndex,ct);
- if (showClasses)
+ writeNamespaceTree(nd->getNamespaceSDict(),ftv,FALSE,addToIndex);
+ writeClassTree(nd->getClassSDict(),ftv,FALSE,FALSE,ClassDef::Class);
+ writeNamespaceMembers(nd,addToIndex);
+ ftv->decContentsDepth();
+ }
+ if (addToIndex && isDir)
+ {
+ Doxygen::indexList->decContentsDepth();
+ }
+ }
+ }
+ }
+ }
+}
+
+static void writeClassTreeInsideNamespace(const NamespaceSDict *nsDict,FTVHelp *ftv,
+ bool rootOnly,bool addToIndex,ClassDef::CompoundType ct)
+{
+ static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
+ if (nsDict)
+ {
+ NamespaceSDict::Iterator nli(*nsDict);
+ const NamespaceDef *nd;
+ for (nli.toFirst();(nd=nli.current());++nli)
+ {
+ if (!nd->isAnonymous() &&
+ (!rootOnly || nd->getOuterScope()==Doxygen::globalScope))
+ {
+ bool isDir = namespaceHasNestedClass(nd,sliceOpt,ct);
+ bool isLinkable = nd->isLinkableInProject();
+
+ //printf("namespace %s isDir=%d\n",nd->name().data(),isDir);
+
+ QCString ref;
+ QCString file;
+ if (isLinkable)
+ {
+ ref = nd->getReference();
+ file = nd->getOutputFileBase();
+ if (nd->getLanguage()==SrcLangExt_VHDL) // UGLY HACK
+ {
+ file=file.replace(0,qstrlen("namespace"),"class");
+ }
+ }
+
+ if (isDir)
+ {
+ ftv->addContentsItem(isDir,nd->localName(),ref,file,0,FALSE,TRUE,nd);
+
+ if (addToIndex)
+ {
+ // the namespace entry is already shown under the namespace list so don't
+ // add it to the nav index and don't create a separate index file for it otherwise
+ // it will overwrite the one written for the namespace list.
+ Doxygen::indexList->addContentsItem(isDir,nd->localName(),ref,file,QCString(),
+ false, // separateIndex
+ false // addToNavIndex
+ );
+ }
+ if (addToIndex)
+ {
+ Doxygen::indexList->incContentsDepth();
+ }
+
+ ftv->incContentsDepth();
+ writeClassTreeInsideNamespace(nd->getNamespaceSDict(),ftv,FALSE,addToIndex,ct);
+ ClassSDict *d = nd->getClassSDict();
+ if (sliceOpt)
+ {
+ if (ct == ClassDef::Interface)
{
- ClassSDict *d = nd->getClassSDict();
- if (sliceOpt)
- {
- if (ct == ClassDef::Interface)
- {
- d = nd->getInterfaceSDict();
- }
- else if (ct == ClassDef::Struct)
- {
- d = nd->getStructSDict();
- }
- else if (ct == ClassDef::Exception)
- {
- d = nd->getExceptionSDict();
- }
- }
- writeClassTree(d,ftv,addToIndex,FALSE,ct);
+ d = nd->getInterfaceSDict();
+ }
+ else if (ct == ClassDef::Struct)
+ {
+ d = nd->getStructSDict();
+ }
+ else if (ct == ClassDef::Exception)
+ {
+ d = nd->getExceptionSDict();
}
- ftv->decContentsDepth();
- if (addToIndex) Doxygen::indexList->decContentsDepth();
+ }
+ writeClassTree(d,ftv,addToIndex,FALSE,ct);
+ ftv->decContentsDepth();
+
+ if (addToIndex)
+ {
+ Doxygen::indexList->decContentsDepth();
}
}
}
@@ -1795,7 +1931,7 @@ static void writeNamespaceIndex(OutputList &ol)
Doxygen::indexList->incContentsDepth();
}
FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,FALSE,addToIndex,ClassDef::Class);
+ writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,addToIndex);
QGString outStr;
FTextStream t(&outStr);
ftv->generateTreeViewInline(t);
@@ -2425,26 +2561,50 @@ static void writeAlphabeticalExceptionIndex(OutputList &ol)
//----------------------------------------------------------------------------
-static void writeAnnotatedIndex(OutputList &ol)
+struct AnnotatedIndexContext
+{
+ AnnotatedIndexContext(int numAnno,int numPrint,
+ LayoutNavEntry::Kind lk,LayoutNavEntry::Kind fk,
+ const QCString &title,const QCString &intro,
+ ClassDef::CompoundType ct,
+ const QCString &fn,
+ HighlightedItem hi) :
+ numAnnotated(numAnno), numPrinted(numPrint),
+ listKind(lk), fallbackKind(fk),
+ listDefaultTitleText(title), listDefaultIntroText(intro),
+ compoundType(ct),fileBaseName(fn),
+ hiItem(hi) { }
+
+ const int numAnnotated;
+ const int numPrinted;
+ const LayoutNavEntry::Kind listKind;
+ const LayoutNavEntry::Kind fallbackKind;
+ const QCString listDefaultTitleText;
+ const QCString listDefaultIntroText;
+ const ClassDef::CompoundType compoundType;
+ const QCString fileBaseName;
+ const HighlightedItem hiItem;
+};
+
+static void writeAnnotatedIndexGeneric(OutputList &ol,const AnnotatedIndexContext ctx)
{
//printf("writeAnnotatedIndex: count=%d printed=%d\n",
// annotatedClasses,annotatedClassesPrinted);
- if (annotatedClasses==0) return;
+ if (ctx.numAnnotated==0) return;
ol.pushGeneratorState();
ol.disable(OutputGenerator::Man);
- if (annotatedClassesPrinted==0)
+ if (ctx.numPrinted==0)
{
ol.disable(OutputGenerator::Latex);
ol.disable(OutputGenerator::RTF);
}
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes); // fall back
- QCString title = lne ? lne->title() : theTranslator->trCompoundList();
+ LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(ctx.listKind);
+ if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(ctx.fallbackKind); // fall back
+ QCString title = lne ? lne->title() : ctx.listDefaultTitleText;
bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotated",0,title,HLI_AnnotatedClasses);
+ startFile(ol,ctx.fileBaseName,0,title,ctx.hiItem);
startTitle(ol,0);
ol.parseText(title);
@@ -2453,7 +2613,7 @@ static void writeAnnotatedIndex(OutputList &ol)
ol.startContents();
ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trCompoundListDescription());
+ ol.parseText(lne ? lne->intro() : ctx.listDefaultIntroText);
ol.endTextBlock();
// ---------------
@@ -2463,7 +2623,7 @@ static void writeAnnotatedIndex(OutputList &ol)
ol.disable(OutputGenerator::Html);
Doxygen::indexList->disable();
- writeAnnotatedClassList(ol, ClassDef::Class);
+ writeAnnotatedClassList(ol, ctx.compoundType);
Doxygen::indexList->enable();
ol.popGeneratorState();
@@ -2477,17 +2637,16 @@ static void writeAnnotatedIndex(OutputList &ol)
{
if (addToIndex)
{
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotated",0,TRUE,TRUE);
+ Doxygen::indexList->addContentsItem(TRUE,title,0,ctx.fileBaseName,0,TRUE,TRUE);
Doxygen::indexList->incContentsDepth();
}
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Class);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Class);
+ FTVHelp ftv(false);
+ writeClassTreeInsideNamespace(Doxygen::namespaceSDict,&ftv,TRUE,addToIndex,ctx.compoundType);
+ writeClassTree(Doxygen::classSDict,&ftv,addToIndex,TRUE,ctx.compoundType);
QGString outStr;
FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
+ ftv.generateTreeViewInline(t);
ol.writeString(outStr);
- delete ftv;
if (addToIndex)
{
Doxygen::indexList->decContentsDepth();
@@ -2503,233 +2662,58 @@ static void writeAnnotatedIndex(OutputList &ol)
//----------------------------------------------------------------------------
-static void writeAnnotatedInterfaceIndex(OutputList &ol)
+static void writeAnnotatedIndex(OutputList &ol)
{
- //printf("writeAnnotatedInterfaceIndex: count=%d printed=%d\n",
- // annotatedInterfaces,annotatedInterfacesPrinted);
- if (annotatedInterfaces==0) return;
-
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- if (annotatedInterfacesPrinted==0)
- {
- ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::RTF);
- }
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::InterfaceList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Interfaces); // fall back
- QCString title = lne ? lne->title() : theTranslator->trInterfaceList();
- bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotatedinterfaces",0,title,HLI_AnnotatedInterfaces);
-
- startTitle(ol,0);
- ol.parseText(title);
- endTitle(ol,0,0);
-
- ol.startContents();
-
- ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trInterfaceListDescription());
- ol.endTextBlock();
-
- // ---------------
- // Linear interface index for Latex/RTF
- // ---------------
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
- Doxygen::indexList->disable();
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedClasses,annotatedClassesPrinted,
+ LayoutNavEntry::ClassList,LayoutNavEntry::Classes,
+ theTranslator->trCompoundList(),theTranslator->trCompoundListDescription(),
+ ClassDef::Class,
+ "annotated",
+ HLI_AnnotatedClasses));
- writeAnnotatedClassList(ol, ClassDef::Interface);
-
- Doxygen::indexList->enable();
- ol.popGeneratorState();
-
- // ---------------
- // Hierarchical interface index for HTML
- // ---------------
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
+}
- {
- if (addToIndex)
- {
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedinterfaces",0,TRUE,TRUE);
- Doxygen::indexList->incContentsDepth();
- }
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Interface);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Interface);
- QGString outStr;
- FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
- delete ftv;
- if (addToIndex)
- {
- Doxygen::indexList->decContentsDepth();
- }
- }
+//----------------------------------------------------------------------------
- ol.popGeneratorState();
- // ------
+static void writeAnnotatedInterfaceIndex(OutputList &ol)
+{
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedInterfaces,annotatedInterfacesPrinted,
+ LayoutNavEntry::InterfaceList,LayoutNavEntry::Interfaces,
+ theTranslator->trInterfaceList(),theTranslator->trInterfaceListDescription(),
+ ClassDef::Interface,
+ "annotatedinterfaces",
+ HLI_AnnotatedInterfaces));
- endFile(ol); // contains ol.endContents()
- ol.popGeneratorState();
}
//----------------------------------------------------------------------------
static void writeAnnotatedStructIndex(OutputList &ol)
{
- //printf("writeAnnotatedStructIndex: count=%d printed=%d\n",
- // annotatedStructs,annotatedStructsPrinted);
- if (annotatedStructs==0) return;
-
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- if (annotatedStructsPrinted==0)
- {
- ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::RTF);
- }
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::StructList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Structs); // fall back
- QCString title = lne ? lne->title() : theTranslator->trStructList();
- bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotatedstructs",0,title,HLI_AnnotatedStructs);
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedStructs,annotatedStructsPrinted,
+ LayoutNavEntry::StructList,LayoutNavEntry::Structs,
+ theTranslator->trStructList(),theTranslator->trStructListDescription(),
+ ClassDef::Struct,
+ "annotatedstructs",
+ HLI_AnnotatedStructs));
- startTitle(ol,0);
- ol.parseText(title);
- endTitle(ol,0,0);
-
- ol.startContents();
-
- ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trStructListDescription());
- ol.endTextBlock();
-
- // ---------------
- // Linear struct index for Latex/RTF
- // ---------------
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
- Doxygen::indexList->disable();
-
- writeAnnotatedClassList(ol, ClassDef::Struct);
-
- Doxygen::indexList->enable();
- ol.popGeneratorState();
-
- // ---------------
- // Hierarchical struct index for HTML
- // ---------------
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
-
- {
- if (addToIndex)
- {
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedstructs",0,TRUE,TRUE);
- Doxygen::indexList->incContentsDepth();
- }
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Struct);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Struct);
- QGString outStr;
- FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
- delete ftv;
- if (addToIndex)
- {
- Doxygen::indexList->decContentsDepth();
- }
- }
-
- ol.popGeneratorState();
- // ------
-
- endFile(ol); // contains ol.endContents()
- ol.popGeneratorState();
}
//----------------------------------------------------------------------------
static void writeAnnotatedExceptionIndex(OutputList &ol)
{
- //printf("writeAnnotatedExceptionIndex: count=%d printed=%d\n",
- // annotatedExceptions,annotatedExceptionsPrinted);
- if (annotatedExceptions==0) return;
-
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- if (annotatedExceptionsPrinted==0)
- {
- ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::RTF);
- }
- LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ExceptionList);
- if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Exceptions); // fall back
- QCString title = lne ? lne->title() : theTranslator->trExceptionList();
- bool addToIndex = lne==0 || lne->visible();
-
- startFile(ol,"annotatedexceptions",0,title,HLI_AnnotatedExceptions);
-
- startTitle(ol,0);
- ol.parseText(title);
- endTitle(ol,0,0);
-
- ol.startContents();
-
- ol.startTextBlock();
- ol.parseText(lne ? lne->intro() : theTranslator->trExceptionListDescription());
- ol.endTextBlock();
-
- // ---------------
- // Linear interface index for Latex/RTF
- // ---------------
- ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
- Doxygen::indexList->disable();
-
- writeAnnotatedClassList(ol, ClassDef::Exception);
+ writeAnnotatedIndexGeneric(ol,
+ AnnotatedIndexContext(annotatedExceptions,annotatedExceptionsPrinted,
+ LayoutNavEntry::ExceptionList,LayoutNavEntry::Exceptions,
+ theTranslator->trExceptionList(),theTranslator->trExceptionListDescription(),
+ ClassDef::Exception,
+ "annotatedexceptions",
+ HLI_AnnotatedExceptions));
- Doxygen::indexList->enable();
- ol.popGeneratorState();
-
- // ---------------
- // Hierarchical interface index for HTML
- // ---------------
- ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
-
- {
- if (addToIndex)
- {
- Doxygen::indexList->addContentsItem(TRUE,title,0,"annotatedexceptions",0,TRUE,TRUE);
- Doxygen::indexList->incContentsDepth();
- }
- FTVHelp* ftv = new FTVHelp(FALSE);
- writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,TRUE,addToIndex,ClassDef::Exception);
- writeClassTree(Doxygen::classSDict,ftv,addToIndex,TRUE,ClassDef::Exception);
- QGString outStr;
- FTextStream t(&outStr);
- ftv->generateTreeViewInline(t);
- ol.writeString(outStr);
- delete ftv;
- if (addToIndex)
- {
- Doxygen::indexList->decContentsDepth();
- }
- }
-
- ol.popGeneratorState();
- // ------
-
- endFile(ol); // contains ol.endContents()
- ol.popGeneratorState();
}
//----------------------------------------------------------------------------
@@ -2777,7 +2761,7 @@ static void writeNamespaceLinkForMember(OutputList &ol,MemberDef *md,const char
static void writeMemberList(OutputList &ol,bool useSections,int page,
const LetterToIndexMap<MemberIndexList> &memberLists,
- DefinitionIntf::DefType type)
+ Definition::DefType type)
{
int index = (int)type;
ASSERT(index<3);
@@ -4499,7 +4483,7 @@ static void writeIndex(OutputList &ol)
{
ol.startHeaderSection();
ol.startTitleHead(0);
- ol.generateDoc(Doxygen::mainPage->docFile(),Doxygen::mainPage->docLine(),
+ ol.generateDoc(Doxygen::mainPage->docFile(),Doxygen::mainPage->getStartBodyLine(),
Doxygen::mainPage,0,Doxygen::mainPage->title(),TRUE,FALSE,
0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
headerWritten = TRUE;