41 #define MAX_INDENT 1024 48 const char *
n,
bool sepIndex,
bool navIndex,
Definition *df)
78 if (d>maxDepth) maxDepth=
d;
112 m_topLevelIndex = TLI;
118 delete[] m_indentNodes;
195 FTVNode *newNode =
new FTVNode(isDir,ref,file,anchor,name,separateIndex,addToNavIndex,def);
218 else if (!url.
isEmpty() && url.
at(0)==
'^')
247 result=generateIndentLabel(n->
parent,level+1);
257 while (p) { indent++; p=p->
parent; }
261 t <<
"<span style=\"width:" << (indent*16) <<
"px;display:inline-block;\"> </span>" 262 <<
"<span id=\"arr_" << generateIndentLabel(n,0) <<
"\" class=\"arrow\" ";
263 t <<
"onclick=\"toggleFolder('" << generateIndentLabel(n,0) <<
"')\"";
269 t <<
"<span style=\"width:" << ((indent+1)*16) <<
"px;display:inline-block;\"> </span>";
285 t <<
"<a class=\"elRef\" ";
290 t <<
"<a class=\"el\" ";
296 t <<
"\" target=\"basefrm\">";
298 t <<
"\" target=\"_self\">";
303 t <<
" [external]";
331 t <<
"<tr id=\"row_" << generateIndentLabel(n,0) <<
"\"";
333 t <<
" class=\"even\"";
335 t <<
" style=\"display:none;\"";
338 t <<
"><td class=\"entry\">";
339 bool nodeOpened = level+1<maxLevel;
340 generateIndent(t,n,nodeOpened);
353 t <<
"<span class=\"icona\"><span class=\"icon\">N</span></span>";
357 t <<
"<span class=\"icona\"><span class=\"icon\">C</span></span>";
361 t <<
"<span id=\"img_" << generateIndentLabel(n,0)
362 <<
"\" class=\"iconf" 363 << (nodeOpened?
"open":
"closed")
364 <<
"\" onclick=\"toggleFolder('" << generateIndentLabel(n,0)
365 <<
"')\"> </span>";
368 t <<
"</td><td class=\"desc\">";
373 t <<
"</td></tr>" <<
endl;
375 generateTree(t,n->
children,level+1,maxLevel,index);
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;
456 if (leaf!=n) result+=
",";
486 if (i>=0) varId = varId.
mid(i+1);
495 indentStr.
fill(
' ',level*2);
502 if (!first) t <<
"," <<
endl;
536 bool firstChild=
TRUE;
537 t << indentStr <<
" [ ";
550 QFile f(htmlOutput+
"/"+fileId+
".js");
558 t <<
"\"" << fileId <<
"\" ]";
567 bool firstChild=
TRUE;
568 t << indentStr <<
" [ ";
574 t << endl << indentStr <<
" ] ]";
583 QFile f(htmlOutput+
"/navtreedata.js");
591 t <<
"var NAVTREE =" <<
endl;
624 t << endl <<
" ] ]" <<
endl;
625 t <<
"];" << endl <<
endl;
631 const int maxElemCount=250;
633 QFile fsidx(htmlOutput+
"/navtreeindex0.js");
638 t <<
"var NAVTREEINDEX =" <<
endl;
640 tsidx <<
"var NAVTREEINDEX" << subIndex <<
" =" <<
endl;
641 tsidx <<
"{" <<
endl;
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");
674 tsidx <<
"var NAVTREEINDEX" << subIndex <<
" =" <<
endl;
675 tsidx <<
"{" <<
endl;
678 tsidx <<
"};" <<
endl;
679 t << endl <<
"];" <<
endl;
718 int preferredNumEntries =
Config_getInt(
"HTML_INDEX_NUM_ENTRIES");
719 t <<
"<div class=\"directory\">\n";
728 if (d>depth) depth=
d;
731 int preferredDepth = depth;
735 t <<
"<div class=\"levels\">[";
739 for (i=1;i<=depth;i++)
741 t <<
"<span onclick=\"javascript:toggleLevel(" << i <<
");\">" << i <<
"</span>";
745 if (preferredNumEntries>0)
748 for (
int i=1;i<=depth;i++)
757 if (num<=preferredNumEntries)
770 t <<
"<table class=\"directory\">\n";
772 generateTree(t,m_indentNodes[0],0,preferredDepth,index);
775 t <<
"</div><!-- directory -->\n";
781 generateTreeViewImages();
782 generateTreeViewScripts();
int numNodesAtLevel(int level, int maxLevel) const
void generateIndent(FTextStream &t, FTVNode *n, bool opened)
LayoutNavEntry * find(LayoutNavEntry::Kind k, const char *file=0) const
static void generateLink(CodeOutputInterface &ol, char *lname)
static void generateJSLink(FTextStream &t, FTVNode *n)
bool fileVisibleInIndex(FileDef *fd, bool &genSourceFile)
void append(const type *d)
static QCString htmlFileExtension
Concrete visitor implementation for HTML output.
void generateTree(FTextStream &t, const QList< FTVNode > &nl, int level, int maxLevel, int &index)
int computeTreeDepth(int level) const
void setDevice(QIODevice *)
bool copyResource(const char *name, const char *targetDir) const
static LayoutDocManager & instance()
static ResourceMgr & instance()
DocRoot * validatingParseDoc(const char *fileName, int startLine, Definition *ctx, MemberDef *md, const char *input, bool indexWords, bool isExample, const char *exampleName, bool singleLine, bool linkFromIndex)
QCString relativePathToRoot(const char *name)
Simplified and optimized version of QTextStream.
static QCString pathToNode(FTVNode *leaf, FTVNode *n)
void generateTreeViewInline(FTextStream &t)
void setName(const QString &name)
virtual QCString getOutputFileBase() const =0
static bool dupOfParent(const FTVNode *n)
virtual QCString trDetailLevel()=0
int findRev(char c, int index=-1, bool cs=TRUE) const
Base class for the layout of a navigation item at the top of the HTML pages.
#define Config_getInt(val)
virtual DefType definitionType() const =0
QList< FTVNode > children
FTVNode(bool dir, const char *r, const char *f, const char *a, const char *n, bool sepIndex, bool navIndex, Definition *df)
static void generateBriefDoc(FTextStream &t, Definition *def)
static bool generateJSTree(NavIndexEntryList &navIndex, FTextStream &t, const QList< FTVNode > &nl, int level, bool &first)
Singleton for managing resources compiled into an executable.
static QCString convertFileId2Var(const QCString &fileId)
QCString convertToHtml(const char *s, bool keepEntities)
QCString getSourceFileBase() const
QCString convertToJSString(const char *s)
static void generateJSNavTree(const QList< FTVNode > &nodeList)
QCString generateIndentLabel(FTVNode *n, int level)
void generateTreeViewScripts()
A bunch of utility functions.
void generateLink(FTextStream &t, FTVNode *n)
#define Config_getString(val)
virtual QCString trPanelSynchronisationTooltip(bool enable)=0
void addContentsItem(bool isDir, const char *name, const char *ref, const char *file, const char *anchor, bool separateIndex, bool addToNavIndex, Definition *def)
QCString briefFile() const
virtual QCString briefDescription(bool abbreviate=FALSE) const
static void generateTreeViewImages()
QCString mid(uint index, uint len=0xffffffff) const
QCString getOutputFileBase() const
The QFile class is an I/O device that operates on files.
LayoutNavEntry * rootNavEntry() const
QCString & setNum(short n)
NavIndexEntry(const QCString &u, const QCString &p)
static QCString node2URL(FTVNode *n, bool overruleFile=FALSE, bool srcLink=FALSE)
bool fill(char c, int len=-1)
Translator * theTranslator
Q_EXPORT int qstrcmp(const char *str1, const char *str2)
void setAutoDelete(bool enable)
QCString externalLinkTarget()
static PageDef * mainPage
std::string nl(std::size_t i=1)
int compareValues(const NavIndexEntry *item1, const NavIndexEntry *item2) const
virtual void accept(DocVisitor *v)=0
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
QTextStream & endl(QTextStream &s)
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)