summaryrefslogtreecommitdiffstats
path: root/src/ftvhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ftvhelp.cpp')
-rw-r--r--src/ftvhelp.cpp71
1 files changed, 46 insertions, 25 deletions
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index 7249574..b04da62 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -4,8 +4,8 @@
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -99,11 +99,11 @@ int FTVNode::numNodesAtLevel(int level,int maxLevel) const
//----------------------------------------------------------------------------
-/*! Constructs an ftv help object.
- * The object has to be \link initialize() initialized\endlink before it can
+/*! Constructs an ftv help object.
+ * The object has to be \link initialize() initialized\endlink before it can
* be used.
*/
-FTVHelp::FTVHelp(bool TLI)
+FTVHelp::FTVHelp(bool TLI)
{
/* initial depth */
m_indentNodes = new QList<FTVNode>[MAX_INDENT];
@@ -134,7 +134,7 @@ void FTVHelp::finalize()
generateTreeView();
}
-/*! Increase the level of the contents hierarchy.
+/*! Increase the level of the contents hierarchy.
* This will start a new sublist in contents file.
* \sa decContentsDepth()
*/
@@ -204,7 +204,7 @@ void FTVHelp::addContentsItem(bool isDir,
QList<FTVNode> *pnl = &m_indentNodes[m_indent-1];
newNode->parent = pnl->getLast();
}
-
+
}
static QCString node2URL(FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE)
@@ -257,7 +257,7 @@ void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,bool opened)
while (p) { indent++; p=p->parent; }
if (n->isDir)
{
- QCString dir = opened ? "&#9660;" : "&#9658;";
+ QCString dir = opened ? "&#9660;" : "&#9654;";
t << "<span style=\"width:" << (indent*16) << "px;display:inline-block;\">&#160;</span>"
<< "<span id=\"arr_" << generateIndentLabel(n,0) << "\" class=\"arrow\" ";
t << "onclick=\"toggleFolder('" << generateIndentLabel(n,0) << "')\"";
@@ -274,6 +274,7 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
{
//printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n",
// n->ref.data(),n->file.data(),n->anchor.data());
+ bool setTarget = FALSE;
if (n->file.isEmpty()) // no link
{
t << "<b>" << convertToHtml(n->name) << "</b>";
@@ -283,7 +284,9 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
if (!n->ref.isEmpty()) // link to entity imported via tag file
{
t << "<a class=\"elRef\" ";
- t << externalLinkTarget() << externalRef("",n->ref,FALSE);
+ QCString result = externalLinkTarget();
+ if (result != "") setTarget = TRUE;
+ t << result << externalRef("",n->ref,FALSE);
}
else // local link
{
@@ -292,10 +295,13 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
t << "href=\"";
t << externalRef("",n->ref,TRUE);
t << node2URL(n);
- if (m_topLevelIndex)
- t << "\" target=\"basefrm\">";
- else
- t << "\" target=\"_self\">";
+ if (!setTarget)
+ {
+ if (m_topLevelIndex)
+ t << "\" target=\"basefrm\">";
+ else
+ t << "\" target=\"_self\">";
+ }
t << convertToHtml(n->name);
t << "</a>";
if (!n->ref.isEmpty())
@@ -385,7 +391,7 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
if (srcRef)
{
t << "<a href=\"" << srcRef->getSourceFileBase()
- << Doxygen::htmlFileExtension
+ << Doxygen::htmlFileExtension
<< "\">";
}
if (n->def && n->def->definitionType()==Definition::TypeGroup)
@@ -487,7 +493,7 @@ static QCString convertFileId2Var(const QCString &fileId)
return substitute(varId,"-","_");
}
-static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
+static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
const QList<FTVNode> &nl,int level,bool &first)
{
static QCString htmlOutput = Config_getString(HTML_OUTPUT);
@@ -543,7 +549,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
{
fileId+="_"+n->anchor;
}
- if (dupOfParent(n))
+ if (dupOfParent(n))
{
fileId+="_dup";
}
@@ -553,7 +559,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
FTextStream tt(&f);
tt << "var " << convertFileId2Var(fileId) << " =" << endl;
generateJSTree(navIndex,tt,n->children,1,firstChild);
- tt << endl << "];";
+ tt << endl << "];";
}
t << "\"" << fileId << "\" ]";
}
@@ -571,7 +577,7 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
if (emptySection)
t << "null ]";
else
- t << endl << indentStr << " ] ]";
+ t << endl << indentStr << " ] ]";
}
}
return found;
@@ -588,6 +594,22 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
//tidx << "var NAVTREEINDEX =" << endl;
//tidx << "{" << endl;
FTextStream t(&f);
+ t << "/*\n@ @licstart The following is the entire license notice for the\n"
+ "JavaScript code in this file.\n\nCopyright (C) 1997-2017 by Dimitri van Heesch\n\n"
+ "This program is free software; you can redistribute it and/or modify\n"
+ "it under the terms of the GNU General Public License as published by\n"
+ "the Free Software Foundation; either version 2 of the License, or\n"
+ "(at your option) any later version.\n\n"
+ "This program is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ " GNU General Public License for more details.\n\n"
+ "You should have received a copy of the GNU General Public License along\n"
+ "with this program; if not, write to the Free Software Foundation, Inc.,\n"
+ "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n"
+ "@licend The above is the entire license notice\n"
+ "for the JavaScript code in this file\n"
+ "*/\n";
t << "var NAVTREE =" << endl;
t << "[" << endl;
t << " [ ";
@@ -618,9 +640,9 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
bool first=TRUE;
generateJSTree(navIndex,t,nodeList,1,first);
- if (first)
+ if (first)
t << "]" << endl;
- else
+ else
t << endl << " ] ]" << endl;
t << "];" << endl << endl;
@@ -660,7 +682,7 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
++li;
if (li.current() && elemCount<maxElemCount-1) tsidx << ","; // not last entry
tsidx << endl;
-
+
elemCount++;
if (li.current() && elemCount>=maxElemCount) // switch to new sub-index
{
@@ -678,8 +700,8 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
tsidx << "};" << endl;
t << endl << "];" << endl;
}
- t << endl << "var SYNCONMSG = '" << theTranslator->trPanelSynchronisationTooltip(FALSE) << "';";
- t << endl << "var SYNCOFFMSG = '" << theTranslator->trPanelSynchronisationTooltip(TRUE) << "';";
+ t << endl << "var SYNCONMSG = '" << theTranslator->trPanelSynchronisationTooltip(FALSE) << "';";
+ t << endl << "var SYNCOFFMSG = '" << theTranslator->trPanelSynchronisationTooltip(TRUE) << "';";
}
ResourceMgr::instance().copyResource("navtree.js",htmlOutput);
}
@@ -731,7 +753,7 @@ void FTVHelp::generateTreeViewInline(FTextStream &t)
if (depth>1)
{
t << "<div class=\"levels\">[";
- t << theTranslator->trDetailLevel();
+ t << theTranslator->trDetailLevel();
t << " ";
int i;
for (i=1;i<=depth;i++)
@@ -779,4 +801,3 @@ void FTVHelp::generateTreeView()
generateTreeViewImages();
generateTreeViewScripts();
}
-