summaryrefslogtreecommitdiffstats
path: root/src/ftvhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ftvhelp.cpp')
-rw-r--r--src/ftvhelp.cpp62
1 files changed, 45 insertions, 17 deletions
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index 149f43c..c8edeb2 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -43,6 +43,32 @@
static int folderId=1;
+const char *JAVASCRIPT_LICENSE_TEXT = R"LIC(/*
+ @licstart The following is the entire license notice for the JavaScript code in this file.
+
+ The MIT License (MIT)
+
+ Copyright (C) 1997-2020 by Dimitri van Heesch
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+ and associated documentation files (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or
+ substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ @licend The above is the entire license notice for the JavaScript code in this file
+*/
+)LIC";
+
struct FTVNode
{
FTVNode(bool dir,const char *r,const char *f,const char *a,
@@ -141,7 +167,7 @@ void FTVHelp::finalize()
*/
void FTVHelp::incContentsDepth()
{
- //printf("incContentsDepth() indent=%d\n",m_indent);
+ //printf("%p: incContentsDepth() indent=%d\n",this,m_indent);
m_indent++;
ASSERT(m_indent<MAX_INDENT);
}
@@ -152,7 +178,7 @@ void FTVHelp::incContentsDepth()
*/
void FTVHelp::decContentsDepth()
{
- //printf("decContentsDepth() indent=%d\n",m_indent);
+ //printf("%p: decContentsDepth() indent=%d\n",this,m_indent);
ASSERT(m_indent>0);
if (m_indent>0)
{
@@ -223,7 +249,7 @@ static QCString node2URL(const FTVNode *n,bool overruleFile=FALSE,bool srcLink=F
{
if (overruleFile && n->def && n->def->definitionType()==Definition::TypeFile)
{
- const FileDef *fd = dynamic_cast<const FileDef*>(n->def);
+ const FileDef *fd = toFileDef(n->def);
if (srcLink)
{
url = fd->getSourceFileBase();
@@ -233,7 +259,7 @@ static QCString node2URL(const FTVNode *n,bool overruleFile=FALSE,bool srcLink=F
url = fd->getOutputFileBase();
}
}
- url+=Doxygen::htmlFileExtension;
+ url = addHtmlExtensionIfMissing(url);
if (!n->anchor.isEmpty()) url+="#"+n->anchor;
}
return url;
@@ -322,7 +348,8 @@ static void generateBriefDoc(FTextStream &t,const Definition *def)
if (!brief.isEmpty())
{
DocNode *root = validatingParseDoc(def->briefFile(),def->briefLine(),
- def,0,brief,FALSE,FALSE,0,TRUE,TRUE);
+ def,0,brief,FALSE,FALSE,
+ 0,TRUE,TRUE,Config_getBool(MARKDOWN_SUPPORT));
QCString relPath = relativePathToRoot(def->getOutputFileBase());
HtmlCodeGenerator htmlGen(t,relPath);
HtmlDocVisitor *visitor = new HtmlDocVisitor(t,htmlGen,def);
@@ -392,7 +419,7 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
}
else if (n->def && n->def->definitionType()==Definition::TypeClass)
{
- char icon=compoundIcon(dynamic_cast<const ClassDef*>(n->def));
+ char icon=compoundIcon(toClassDef(n->def));
t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
else
@@ -417,9 +444,9 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
{
const FileDef *srcRef=0;
if (n->def && n->def->definitionType()==Definition::TypeFile &&
- (dynamic_cast<const FileDef*>(n->def))->generateSourceFile())
+ (toFileDef(n->def))->generateSourceFile())
{
- srcRef = dynamic_cast<const FileDef*>(n->def);
+ srcRef = toFileDef(n->def);
}
if (srcRef)
{
@@ -448,9 +475,13 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
}
else if (n->def && n->def->definitionType()==Definition::TypeClass)
{
- char icon=compoundIcon(dynamic_cast<const ClassDef*>(n->def));
+ char icon=compoundIcon(toClassDef(n->def));
t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
+ else if (n->def && n->def->definitionType()==Definition::TypeDir)
+ {
+ t << "<span class=\"iconfclosed\"></span>";
+ }
else
{
t << "<span class=\"icondoc\"></span>";
@@ -560,7 +591,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
{
if (n->def && n->def->definitionType()==Definition::TypeFile)
{
- const FileDef *fd = dynamic_cast<const FileDef*>(n->def);
+ const FileDef *fd = toFileDef(n->def);
bool doc,src;
doc = fileVisibleInIndex(fd,src);
if (doc)
@@ -639,7 +670,7 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
t << "var NAVTREE =" << endl;
t << "[" << endl;
t << " [ ";
- QCString &projName = Config_getString(PROJECT_NAME);
+ QCString projName = Config_getString(PROJECT_NAME);
if (projName.isEmpty())
{
if (mainPageHasTitle()) // Use title of main page as root
@@ -689,7 +720,7 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
tsidx << "{" << endl;
QListIterator<NavIndexEntry> li(navIndex);
NavIndexEntry *e;
- bool first=TRUE;
+ first=TRUE;
for (li.toFirst();(e=li.current());) // for each entry
{
if (elemCount==0)
@@ -781,8 +812,7 @@ void FTVHelp::generateTreeViewInline(FTextStream &t)
t << "<div class=\"levels\">[";
t << theTranslator->trDetailLevel();
t << " ";
- int i;
- for (i=1;i<=depth;i++)
+ for (int i=1;i<=depth;i++)
{
t << "<span onclick=\"javascript:toggleLevel(" << i << ");\">" << i << "</span>";
}
@@ -794,9 +824,7 @@ void FTVHelp::generateTreeViewInline(FTextStream &t)
for (int i=1;i<=depth;i++)
{
int num=0;
- QListIterator<FTVNode> li(m_indentNodes[0]);
- FTVNode *n;
- for (;(n=li.current());++li)
+ for (li.toFirst();(n=li.current());++li)
{
num+=n->numNodesAtLevel(0,i);
}