25 #include <qfileinfo.h>
41 #define MAX_INDENT 1024
47 FTVNode(
bool dir,
const char *r,
const char *f,
const char *a,
48 const char *n,
bool sepIndex,
bool navIndex,
Definition *df)
73 for (;(n=li.current());++li)
78 if (d>maxDepth) maxDepth=d;
92 for (;(n=li.current());++li)
160 FTVNode *parent = nl->getLast();
164 while (!children->isEmpty())
166 parent->
children.append(children->take(0));
195 FTVNode *newNode =
new FTVNode(isDir,ref,file,anchor,name,separateIndex,addToNavIndex,def);
198 nl->getLast()->isLast=FALSE;
201 newNode->
index = nl->count()-1;
205 newNode->
parent = pnl->getLast();
212 QCString url = n->
file;
213 if (!url.isEmpty() && url.at(0)==
'!')
218 else if (!url.isEmpty() && url.at(0)==
'^')
249 result+=QCString().setNum(n->
index)+
"_";
257 while (p) { indent++; p=p->
parent; }
260 QCString dir = opened ?
"▼" :
"►";
261 t <<
"<span style=\"width:" << (indent*16) <<
"px;display:inline-block;\"> </span>"
269 t <<
"<span style=\"width:" << ((indent+1)*16) <<
"px;display:inline-block;\"> </span>";
277 if (n->
file.isEmpty())
283 if (!n->
ref.isEmpty())
285 t <<
"<a class=\"elRef\" ";
290 t <<
"<a class=\"el\" ";
296 t <<
"\" target=\"basefrm\">";
298 t <<
"\" target=\"_self\">";
301 if (!n->
ref.isEmpty())
303 t <<
" [external]";
312 if (!brief.isEmpty())
315 def,0,
brief,FALSE,FALSE,0,TRUE,TRUE);
327 QListIterator<FTVNode> nli(nl);
329 for (nli.toFirst();(n=nli.current());++nli)
333 t <<
" class=\"even\"";
335 t <<
" style=\"display:none;\"";
338 t <<
"><td class=\"entry\">";
339 bool nodeOpened = level+1<maxLevel;
353 t <<
"<span class=\"icona\"><span class=\"icon\">N</span></span>";
357 t <<
"<span class=\"icona\"><span class=\"icon\">C</span></span>";
362 <<
"\" class=\"iconf"
363 << (nodeOpened?
"open":
"closed")
365 <<
"')\"> </span>";
368 t <<
"</td><td class=\"desc\">";
373 t <<
"</td></tr>" <<
endl;
401 t <<
"<span class=\"icona\"><span class=\"icon\">N</span></span>";
405 t <<
"<span class=\"icona\"><span class=\"icon\">C</span></span>";
409 t <<
"<span class=\"icondoc\"></span>";
416 t <<
"</td><td class=\"desc\">";
421 t <<
"</td></tr>" <<
endl;
444 return qstrcmp(item1->
url,item2->
url);
455 result+=QCString().setNum(n->
index);
456 if (leaf!=n) result+=
",";
462 if (n->
parent==0)
return FALSE;
469 if (n->
file.isEmpty())
484 QCString varId = fileId;
485 int i=varId.findRev(
'/');
486 if (i>=0) varId = varId.mid(i+1);
491 const QList<FTVNode> &nl,
int level,
bool &first)
495 indentStr.fill(
' ',level*2);
497 QListIterator<FTVNode> nli(nl);
499 for (nli.toFirst();(n=nli.current());++nli)
502 if (!first) t <<
"," <<
endl;
536 bool firstChild=TRUE;
537 t << indentStr <<
" [ ";
541 QCString fileId = n->
file;
550 QFile f(htmlOutput+
"/"+fileId+
".js");
551 if (f.open(IO_WriteOnly))
558 t <<
"\"" << fileId <<
"\" ]";
567 bool firstChild=TRUE;
568 t << indentStr <<
" [ ";
574 t << endl << indentStr <<
" ] ]";
583 QFile f(htmlOutput+
"/navtreedata.js");
585 if (f.open(IO_WriteOnly) )
591 t <<
"var NAVTREE =" <<
endl;
595 if (projName.isEmpty())
614 navIndex.append(
new NavIndexEntry(
"index"+Doxygen::htmlFileExtension,
""));
616 navIndex.append(
new NavIndexEntry(
"pages"+Doxygen::htmlFileExtension,
""));
624 t << endl <<
" ] ]" <<
endl;
625 t <<
"];" << endl <<
endl;
631 const int maxElemCount=250;
633 QFile fsidx(htmlOutput+
"/navtreeindex0.js");
634 if ( fsidx.open(IO_WriteOnly))
638 t <<
"var NAVTREEINDEX =" <<
endl;
640 tsidx <<
"var NAVTREEINDEX" << subIndex <<
" =" <<
endl;
641 tsidx <<
"{" <<
endl;
642 QListIterator<NavIndexEntry> li(navIndex);
645 for (li.toFirst();(e=li.current());)
657 t <<
"\"" << e->
url <<
"\"";
659 tsidx <<
"\"" << e->
url <<
"\":[" << e->
path <<
"]";
661 if (li.current() && elemCount<maxElemCount-1) tsidx <<
",";
665 if (li.current() && elemCount>=maxElemCount)
667 tsidx <<
"};" <<
endl;
671 fsidx.setName(htmlOutput+
"/navtreeindex"+QCString().setNum(subIndex)+
".js");
672 if (!fsidx.open(IO_WriteOnly))
break;
674 tsidx <<
"var NAVTREEINDEX" << subIndex <<
" =" <<
endl;
675 tsidx <<
"{" <<
endl;
678 tsidx <<
"};" <<
endl;
679 t << endl <<
"];" <<
endl;
716 int preferredNumEntries =
Config_getInt(HTML_INDEX_NUM_ENTRIES);
717 t <<
"<div class=\"directory\">\n";
721 for (;(n=li.current());++li)
726 if (d>depth) depth=d;
729 int preferredDepth = depth;
733 t <<
"<div class=\"levels\">[";
737 for (i=1;i<=depth;i++)
739 t <<
"<span onclick=\"javascript:toggleLevel(" << i <<
");\">" << i <<
"</span>";
743 if (preferredNumEntries>0)
746 for (
int i=1;i<=depth;i++)
751 for (;(n=li.current());++li)
755 if (num<=preferredNumEntries)
768 t <<
"<table class=\"directory\">\n";
773 t <<
"</div><!-- directory -->\n";