24 #include <qtextstream.h>
25 #include <qdatetime.h>
51 #define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX 200
52 #define MAX_ITEMS_BEFORE_QUICK_INDEX 30
127 int result = qstricmp(md1->
name(),md2->
name());
151 bool fancyTabs = TRUE;
156 ol.
writeString(
" <div id=\"navrow4\" class=\"tabs3\">\n");
160 ol.
writeString(
" <div id=\"navrow3\" class=\"tabs2\">\n");
172 bool fancyTabs = TRUE;
181 bool hl,
bool compact,
bool &first)
183 bool fancyTabs = TRUE;
184 if (!first && compact && !fancyTabs) ol.
writeString(
" | ");
246 const char *altSidebarName)
255 if (!additionalIndices)
265 const QCString &navPath)
273 if (generateTreeView)
287 if (generateTreeView)
295 endFile(ol,generateTreeView,TRUE,navPath);
301 const QCString &name,
const QCString &anchor,
302 bool addToIndex=TRUE,
bool preventSeparateIndex=FALSE)
304 bool hasMembers = def->getMemberLists().count()>0 || def->getMemberGroupSDict()!=0;
306 def->getReference(),def->getOutputFileBase(),anchor,
307 hasMembers && !preventSeparateIndex,
316 for (;(cd=it.current());++it)
322 if (hasMembers || numClasses>0)
327 for (eli.toFirst();(lde=eli.current());++eli)
337 for (mi.toFirst();(md=mi.current());++mi)
341 bool isAnonymous = md->
name().find(
'@')!=-1;
342 static bool hideUndocMembers =
Config_getBool(HIDE_UNDOC_MEMBERS);
357 md->
name(),def->getReference(),def->getOutputFileBase(),md->
anchor(),FALSE,addToIndex);
368 for (emli.toFirst();(emd=emli.current());++emli)
380 emd->
name(),def->getReference(),def->getOutputFileBase(),emd->
anchor(),FALSE,addToIndex);
401 for (;(cd=it.current());++it)
405 static bool inlineSimpleStructs =
Config_getBool(INLINE_SIMPLE_STRUCTS);
408 addToIndex && (isNestedClass || (cd->
isSimple() && inlineSimpleStructs)),
429 for ( ; bcli.current() ; ++bcli)
431 ClassDef *cd=bcli.current()->classDef;
545 QListIterator<FileDef> fli(*dd->
getFiles());
547 for (fli.toFirst();(fd=fli.current());++fli)
560 QListIterator<DirDef> dli(dd->
subDirs());
562 for (dli.toFirst();(subdd=dli.current());++dli)
578 "maximum nesting level exceeded for directory %s: "
579 "check for possible recursive directory relation!\n",dd->
name().data()
589 static bool tocExpand = TRUE;
590 bool isDir = dd->
subDirs().count()>0 ||
622 QListIterator<DirDef> dli(dd->
subDirs());
624 for (dli.toFirst();(subdd=dli.current());++dli)
633 if (fileList && fileList->count()>0)
635 QListIterator<FileDef> it(*fileList);
637 for (;(fd=it.current());++it)
649 else if (genSourceFile)
657 for (it.toFirst();(fd=it.current());++it)
675 if (ftv && (src || doc))
679 reference,outputBase,
688 if (tocExpand && addToIndex)
693 QListIterator<FileDef> it(*fileList);
695 for (;(fd=it.current());++it)
739 for (dli.toFirst();(dd=dli.current());++dli)
751 for (fnli.toFirst();(fn=fnli.current());++fnli)
755 for (;(fd=fni.current());++fni)
758 if (!fullPathNames || fd->
getDirDef()==0)
762 QCString reference, outputBase;
771 reference, outputBase, 0,
805 for (;(cd=cli.current());++cli)
884 else if (hasChildren)
928 for (;(cd=cli.current());++cli)
965 bool addToIndex = lne==0 || lne->
visible();
1069 for (;(fn=fnli.current());++fnli)
1073 for (;(fd=fni.current());++fni)
1102 QCString fullName=fd->
name();
1103 if (!path.isEmpty())
1105 if (path.at(path.length()-1)!=
'/') fullName.prepend(
"/");
1106 fullName.prepend(path);
1178 bool addToIndex = lne==0 || lne->
visible();
1210 outputNameList.setAutoDelete(TRUE);
1217 for (fnli.toFirst();(fn=fnli.current());++fnli)
1221 for (;(fd=fni.current());++fni)
1224 if (path.isEmpty()) path=
"[external]";
1225 FileList *fl = outputNameDict.find(path);
1236 outputNameList.append(fl);
1237 outputNameDict.insert(path,fl);
1246 outputNameList.sort();
1247 QListIterator<FileList> fnli(outputNameList);
1249 for (fnli.toFirst();(fl=fnli.current());++fnli)
1252 QListIterator<FileDef> it(*fl);
1254 for (;(fd=it.current());++it)
1264 for (fnli.toFirst();(fn=fnli.current());++fnli)
1268 for (;(fd=fni.current());++fni)
1311 for (;(nd=nli.current());++nli)
1326 for (;(cd=cli.current());++cli)
1338 QCString n=cd->
name();
1353 for (;(ccd=ccit.current());++ccit)
1355 if (ccd->isLinkableInProject() && ccd->templateMaster()==0)
1390 bool rootOnly,
bool showClasses,
bool addToIndex)
1396 for (nli.toFirst();(nd=nli.current());++nli)
1413 file=file.replace(0,qstrlen(
"namespace"),
"class");
1417 if ((isLinkable && !showClasses) || hasChildren)
1424 hasChildren && !file.isEmpty(),addToIndex);
1456 bool addToIndex = lne==0 || lne->
visible();
1476 for (nli.toFirst();(nd=nli.current());++nli)
1562 for (;(cd=cli.current());++cli)
1587 for (cli.toFirst();(cd=cli.current());++cli)
1644 if (
isId(startLetter))
1646 s[0]=(char)startLetter;
1651 const char hex[]=
"0123456789abcdef";
1655 if (startLetter>(1<<24))
1657 s[i++]=hex[(startLetter>>28)&0xf];
1658 s[i++]=hex[(startLetter>>24)&0xf];
1660 if (startLetter>(1<<16))
1662 s[i++]=hex[(startLetter>>20)&0xf];
1663 s[i++]=hex[(startLetter>>16)&0xf];
1665 if (startLetter>(1<<8))
1667 s[i++]=hex[(startLetter>>12)&0xf];
1668 s[i++]=hex[(startLetter>>8)&0xf];
1671 s[i++]=hex[(startLetter>>4)&0xf];
1672 s[i++]=hex[(startLetter>>0)&0xf];
1747 uint *v =
find(letter);
1750 append(letter,
new uint(letter));
1756 return (
int)*p1 - (int)*p2;
1771 for (;(cd=cli.current());++cli)
1781 indexLettersUsed.
add(startLetter);
1784 indexLettersUsed.
sort();
1787 QCString alphaLinks =
"<div class=\"qindex\">";
1790 for (it.toFirst();(pLetter=it.current());++it)
1792 if (headerItems) alphaLinks +=
" | ";
1795 QCString ls = QString(QChar(*pLetter)).utf8();
1796 alphaLinks += (QCString)
"<a class=\"qindex\" href=\"#letter_" +
1800 alphaLinks +=
"</div>\n";
1809 int rows = (totalItems + columns - 1)/columns;
1823 for (cli.toFirst();(cd=cli.current());++cli)
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); \
1863 tableColumns.append(tableRows);
1864 int col=0,row=0,maxRows=0;
1882 for (;(cd=cit.current()); ++cit)
1893 for (i=0;i<columns;i++)
1895 if (i<(
int)tableColumns.count())
1901 colIterators[i] = 0;
1907 for (i=0;i<=maxRows;i++)
1915 for (j=0;j<columns;j++)
1917 if (colIterators[j])
1927 ol.
writeString(
"<td rowspan=\"2\" valign=\"bottom\">");
1931 ol.
writeString(
"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
1933 "<td><div class=\"ah\">  ");
1944 QCString namesp,cname;
1948 QCString nsDispName;
1963 if (!namesp.isEmpty())
1980 ++(*colIterators[j]);
2000 for (i=0;i<columns;i++)
2002 delete colIterators[i];
2004 delete[] colIterators;
2016 bool addToIndex = lne==0 || lne->
visible();
2054 bool addToIndex = lne==0 || lne->
visible();
2116 QCString &prevClassName)
2130 QCString &prevFileName)
2133 if (fd && prevFileName!=fd->
name())
2139 prevFileName = fd->
name();
2144 QCString &prevNamespaceName)
2161 int index = (int)type;
2165 QCString &prevNamespaceName);
2168 static writeLinkForMember_t writeLinkForMemberMap[3] =
2175 QCString prevDefName;
2177 bool firstSection=TRUE;
2178 bool firstItem=TRUE;
2185 ml = memberLists[page];
2188 if (ml==0 || ml->count()==0)
continue;
2190 QListIterator<MemberDef> mli(*ml);
2192 for (mli.toFirst();(md=mli.current());++mli)
2197 QCString name=md->
name();
2199 if (QCString(name.data()+startIndex)!=prevName)
2201 if ((prevName.isEmpty() ||
2202 tolower(name.at(startIndex))!=tolower(prevName.at(0))) &&
2205 if (!firstItem) ol.endItemListItem();
2206 if (!firstSection) ol.endItemList();
2208 QCString cl = QString(QChar(ml->
letter())).utf8();
2209 QCString anchor=(QCString)
"index_"+cs;
2210 QCString title=(QCString)
"- "+cl+
" -";
2218 else if (!useSections && first)
2225 if (!firstItem) ol.endItemListItem();
2226 ol.startItemListItem();
2229 if (isFunc) ol.docify(
"()");
2230 ol.writeString(
"\n");
2235 prevName = name.data()+startIndex;
2245 writeLinkForMemberMap[index](ol,md,sep,prevDefName);
2249 if (!firstItem) ol.endItemListItem();
2261 g_memberIndexLetterUsed[j].
clear();
2267 static bool hideFriendCompounds =
Config_getBool(HIDE_FRIEND_COMPOUNDS);
2277 QCString n = md->
name();
2282 bool isFriendToHide = hideFriendCompounds &&
2283 (QCString(md->
typeString())==
"friend class" ||
2284 QCString(md->
typeString())==
"friend struct" ||
2286 if (!(md->
isFriend() && isFriendToHide) &&
2329 (md->
isFriend() && !isFriendToHide))
2346 g_namespaceIndexLetterUsed[j].
clear();
2355 QCString n = md->
name();
2403 g_fileIndexLetterUsed[j].
clear();
2412 QCString n = md->
name();
2461 QCString fullName,
bool multiPage)
2471 QCString ci = QString(QChar(i)).utf8();
2477 anchor=fullName+extension+
"#index_";
2517 return &cmhlInfo[hl];
2526 bool multiPageIndex=FALSE;
2529 multiPageIndex=TRUE;
2539 bool addToIndex = lne==0 || lne->
visible();
2553 uint page = ml->
letter();
2561 QCString cs = QString(QChar(page)).utf8();
2569 ol.
startFile(fileName+extension,0,title);
2627 multiPageIndex?page:-1,
2628 g_memberIndexLetterUsed[hl],
2642 bool addToIndex = lne==0 || lne->
visible();
2692 return &fmhlInfo[hl];
2701 bool multiPageIndex=FALSE;
2704 multiPageIndex=TRUE;
2713 bool addToIndex = lne==0 || lne->
visible();
2727 uint page = ml->
letter();
2735 QCString cs = QString(QChar(page)).utf8();
2743 ol.
startFile(fileName+extension,0,title);
2799 multiPageIndex?page:-1,
2800 g_fileIndexLetterUsed[hl],
2812 bool addToIndex = lne==0 || lne->
visible();
2858 return &nmhlInfo[hl];
2871 bool multiPageIndex=FALSE;
2874 multiPageIndex=TRUE;
2883 bool addToIndex = lne==0 || lne->
visible();
2897 uint page = ml->
letter();
2905 QCString cs = QString(QChar(page)).utf8();
2913 ol.
startFile(fileName+extension,0,title);
2969 multiPageIndex?page:-1,
2970 g_namespaceIndexLetterUsed[hl],
2981 bool addToIndex = lne==0 || lne->
visible();
3012 bool addToIndex = lne==0 || lne->
visible();
3035 for (pdi.toFirst();(pd=pdi.current());++pdi)
3039 if (!pd->
title().isEmpty())
3073 docPages=indexPages=0;
3076 for (pdi.toFirst();(pd=pdi.current());++pdi)
3099 return !projectName.isEmpty() &&
mainPageHasTitle() && qstricmp(title,projectName)!=0;
3106 bool addToIndex = lne==0 || lne->
visible();
3107 if (!addToIndex)
return;
3116 if (pd->
title().isEmpty())
3117 pageTitle=pd->
name();
3125 hasSubPages,pageTitle,
3127 0,hasSubPages,TRUE,pd);
3132 hasSubPages || hasSections,pageTitle,
3134 0,hasSubPages,TRUE);
3138 bool doIndent = (hasSections || hasSubPages) &&
3153 for (pi.toFirst();(subPage=pi.current());++pi)
3188 for (pdi.toFirst();(pd=pdi.current());++pdi)
3219 for (gli.toFirst();(gd=gli.current());++gli)
3237 for (dli.toFirst();(dd=dli.current());++dli)
3258 bool &stripCommentsStateRef =
Config_getBool(STRIP_CODE_COMMENTS);
3259 bool oldStripCommentsState = stripCommentsStateRef;
3261 bool oldCreateSubdirs = createSubdirs;
3263 stripCommentsStateRef = FALSE;
3265 createSubdirs = FALSE;
3273 int s = legendDocs.find(
"<center>");
3274 int e = legendDocs.find(
"</center>");
3276 if (imgExt==
"svg" && s!=-1 && e!=-1)
3278 legendDocs = legendDocs.left(s+8) +
"[!-- SVG 0 --]\n" + legendDocs.mid(e);
3281 FileDef fd(
"",
"graph_legend");
3282 ol.
generateDoc(
"graph_legend",1,&fd,0,legendDocs,FALSE,FALSE);
3285 stripCommentsStateRef = oldStripCommentsState;
3286 createSubdirs = oldCreateSubdirs;
3305 "maximum nesting level exceeded for group %s: check for possible recursive group relation!\n",gd->
name().data()
3322 int numSubItems = 0;
3327 for (mli.toFirst();(ml=mli.current());++mli)
3331 numSubItems += ml->
count();
3336 numSubItems += gd->
getFiles()->count();
3337 numSubItems += gd->
getDirs()->count();
3341 bool isDir = hasSubGroups || hasSubPages || numSubItems>0;
3368 ol.
docify(
" [external]");
3374 for (eli.toFirst();(lde=eli.current());++eli)
3384 for (mi.toFirst();(md=mi.current());++mi)
3399 for (emli.toFirst();(emd=emli.current());++emli)
3405 emd->
anchor(),FALSE,addToIndex);
3417 for (;(cd=it.current());++it)
3423 if (cd->isVisible() )
3444 for (;(nd=it.current());++it)
3446 if (nd->isVisible())
3449 nd->localName(),nd->getReference(),
3450 nd->getOutputFileBase(),0,FALSE,FALSE);
3456 QListIterator<FileDef> it(*gd->
getFiles());
3458 for (;(fd=it.current());++it)
3460 if (fd->isVisible())
3463 fd->displayName(),fd->getReference(),
3464 fd->getOutputFileBase(),0,FALSE,FALSE);
3470 QListIterator<DirDef> it(*gd->
getDirs());
3472 for (;(dd=it.current());++it)
3474 if (dd->isVisible())
3477 dd->shortName(),dd->getReference(),
3478 dd->getOutputFileBase(),0,FALSE,FALSE);
3486 for (;(pd=it.current());++it)
3490 bool hasSubPages = pd->hasSubPages();
3491 bool hasSections = pd->hasSections();
3493 hasSubPages || hasSections,
3497 si ? si->
label.data() : 0,
3498 hasSubPages || hasSections,
3500 if (hasSections || hasSubPages)
3506 pd->addSectionsToIndex();
3509 if (hasSections || hasSubPages)
3522 for (gli.toFirst();(subgd=gli.current());++gli)
3555 for (gli.toFirst();(gd=gli.current());++gli)
3567 static void writeGroupTree(
GroupDef *gd,
FTVHelp *ftv,
int level,
bool addToIndex)
3590 static void writeGroupTree(
FTVHelp *ftv,
bool addToIndex)
3594 for (gli.toFirst();(gd=gli.current());++gli)
3596 writeGroupTree(gd,ftv,0,addToIndex);
3611 bool addToIndex = lne==0 || lne->
visible();
3680 bool addToIndex=FALSE;
3682 startFile(ol,
"dirs",0,title,HLI_Directories);
3730 if (lne->
baseFile().left(9)==
"usergroup")
3739 QListIterator<LayoutNavEntry> li(lne->
children());
3742 for (li.toFirst();(entry=li.current());++li)
3744 if (entry->visible()) count++;
3749 for (li.toFirst();(entry=li.current());++li)
3751 if (entry->visible())
3753 ol.
writeString(
"<li><a href=\""+entry->url()+
"\"><span>"+
3754 fixSpaces(entry->title())+
"</span></a></li>\n");
3775 QCString projPrefix;
3776 if (!projectName.isEmpty())
3778 projPrefix=projectName+
" ";
3786 QCString defFileName =
3801 QCString indexName=
"index";
3807 (!projectName.isEmpty() &&
mainPageHasTitle() && qstricmp(title,projectName)!=0)
3826 bool headerWritten=FALSE;
3835 TRUE,FALSE,0,TRUE,FALSE);
3836 headerWritten = TRUE;
3841 if (!projectName.isEmpty())
3846 headerWritten = TRUE;
3894 if (projPrefix.isEmpty())
3936 for (pdi.toFirst();(pd=pdi.current());++pdi)
3943 bool isCitationPage = pd->
name()==
"citelist";
3950 QCString title = pd->
title();
3951 if (title.isEmpty()) title=pd->
name();
4080 QListIterator<LayoutNavEntry> li(entries);
4082 for (li.toFirst();(lne=li.current());++li)
4085 uint index = (uint)kind;
4086 if (index>=indexWritten.size())
4089 uint oldSize = indexWritten.size();
4090 uint newSize = index+1;
4091 indexWritten.resize(newSize);
4092 for (i=oldSize;i<newSize;i++) indexWritten.at(i)=FALSE;
4095 bool addToIndex=lne->
visible();
4096 bool needsClosing=FALSE;
4097 if (!indexWritten.at(index))
4102 msg(
"Generating index page...\n");
4106 msg(
"Generating page index...\n");
4110 msg(
"Generating module index...\n");
4126 msg(
"Generating namespace index...\n");
4137 msg(
"Generating namespace index...\n");
4143 msg(
"Generating namespace member index...\n");
4155 msg(
"Generating annotated compound index...\n");
4160 msg(
"Generating annotated compound index...\n");
4164 msg(
"Generating alphabetical compound index...\n");
4168 msg(
"Generating hierarchical class index...\n");
4172 msg(
"Generating graphical class hierarchy...\n");
4177 msg(
"Generating member index...\n");
4193 msg(
"Generating file index...\n");
4204 msg(
"Generating file index...\n");
4210 msg(
"Generating file member index...\n");
4214 msg(
"Generating example index...\n");
4221 bool isRelative=url.at(0)==
'!';
4222 if (!url.isEmpty() && !isRelative)
4226 bool isRef = lne->
baseFile().left(4)==
"@ref" || lne->
baseFile().left(4)==
"\\ref";
4242 bool isRelative=url.at(0)==
'!';
4247 bool isRef = lne->
baseFile().left(4)==
"@ref" || lne->
baseFile().left(4)==
"\\ref";
4263 indexWritten.at(index)=TRUE;
4316 const T *(*getInfo)(
int hl))
4319 bool firstMember=TRUE;
4320 for (
int i=0;i<total;i++)
4322 if (numDocumented[i]>0)
4338 bool multiPageIndex=FALSE;
4341 multiPageIndex=TRUE;
4343 t <<
",children:[" <<
endl;
4344 bool firstLetter=TRUE;
4349 if (!firstLetter) t <<
"," <<
endl;
4350 uint letter = ml->
letter();
4352 QCString ci = QString(QChar(letter)).utf8();
4355 QCString fullName = getInfo(i)->fname;
4356 if (!multiPageIndex || firstLetter)
4357 anchor=fullName+extension+
"#index_";
4359 anchor=fullName+
"_"+is+extension+
"#index_";
4377 QListIterator<LayoutNavEntry> li(root->
children());
4380 for (li.toFirst();(entry=li.current());++li)
4386 bool firstChild = TRUE;
4387 if (!first) t <<
",";
4388 t <<
"children:[" <<
endl;
4389 for (li.toFirst();(entry=li.current());++li)
4393 if (!firstChild) t <<
"," <<
endl;
4395 QCString url = entry->url();
4398 bool hasChildren=FALSE;
4418 if (hasChildren) t <<
"]";
4430 QFile f(outputDir+
"/menudata.js");
4432 if (f.open(IO_WriteOnly))
4435 t <<
"var menudata={";
4437 if (hasChildren) t <<
"]";