diff options
Diffstat (limited to 'src/htmlgen.cpp')
-rw-r--r-- | src/htmlgen.cpp | 352 |
1 files changed, 184 insertions, 168 deletions
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 12b71e1..0cb7ab9 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1,12 +1,12 @@ /****************************************************************************** * - * + * * * 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. * @@ -62,7 +62,7 @@ static void writeClientSearchBox(FTextStream &t,const char *relPath) t << " onmouseover=\"return searchBox.OnSearchSelectShow()\"\n"; t << " onmouseout=\"return searchBox.OnSearchSelectHide()\"\n"; t << " alt=\"\"/>\n"; - t << " <input type=\"text\" id=\"MSearchField\" value=\"" + t << " <input type=\"text\" id=\"MSearchField\" value=\"" << theTranslator->trSearch() << "\" accesskey=\"S\"\n"; t << " onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n"; t << " onblur=\"searchBox.OnSearchFieldFocus(false)\" \n"; @@ -200,7 +200,7 @@ static QCString removeEmptyLines(const QCString &s) { const char *e = p; while (*e==' ' || *e=='\t') e++; - if (*e=='\n') + if (*e=='\n') { p=e; } @@ -279,11 +279,11 @@ static QCString substituteHtmlKeywords(const QCString &s, } } - if (timeStamp) + if (timeStamp) { generatedBy = theTranslator->trGeneratedAt(dateToString(TRUE), convertToHtml(Config_getString(PROJECT_NAME))); } - else + else { generatedBy = theTranslator->trGeneratedBy(); } @@ -291,12 +291,14 @@ static QCString substituteHtmlKeywords(const QCString &s, if (treeView) { treeViewCssJs = "<link href=\"$relpath^navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n" - "<script type=\"text/javascript\" src=\"$relpath^resize.js\"></script>\n" - "<script type=\"text/javascript\" src=\"$relpath^navtreedata.js\"></script>\n" - "<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n" - "<script type=\"text/javascript\">\n" - " $(document).ready(initResizable);\n" - "</script>"; + "<script type=\"text/javascript\" src=\"$relpath^resize.js\"></script>\n" + "<script type=\"text/javascript\" src=\"$relpath^navtreedata.js\"></script>\n" + "<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n" + "<script type=\"text/javascript\">\n" + "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n" + " $(document).ready(initResizable);\n" + "/* @license-end */" + "</script>"; } if (searchEngine) @@ -313,8 +315,10 @@ static QCString substituteHtmlKeywords(const QCString &s, if (disableIndex || !Config_getBool(HTML_DYNAMIC_MENUS)) { searchCssJs += "<script type=\"text/javascript\">\n" - " $(document).ready(function() { init_search(); });\n" - "</script>"; + "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; + " $(document).ready(function() { init_search(); });\n" + "/* @license-end */\n" + "</script>"; } } else @@ -322,17 +326,19 @@ static QCString substituteHtmlKeywords(const QCString &s, if (disableIndex || !Config_getBool(HTML_DYNAMIC_MENUS)) { searchCssJs += "<script type=\"text/javascript\">\n" - " $(document).ready(function() {\n" - " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n" - " });\n" - "</script>\n"; + "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n" + " $(document).ready(function() {\n" + " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n" + " });\n" + " /* @license-end */\n" + "</script>\n"; } // OPENSEARCH_PROVIDER { searchCssJs += "<link rel=\"search\" href=\"" + relPath + "search_opensearch.php?v=opensearch.xml\" " "type=\"application/opensearchdescription+xml\" title=\"" + - (hasProjectName ? projectName : QCString("Doxygen")) + + (hasProjectName ? projectName : QCString("Doxygen")) + "\"/>"; // OPENSEARCH_PROVIDER } } @@ -341,11 +347,11 @@ static QCString substituteHtmlKeywords(const QCString &s, if (mathJax) { - QCString path = Config_getString(MATHJAX_RELPATH); - if (path.isEmpty() || path.left(2)=="..") // relative path - { - path.prepend(relPath); - } + QCString path = Config_getString(MATHJAX_RELPATH); + if (path.isEmpty() || path.left(2)=="..") // relative path + { + path.prepend(relPath); + } mathJaxJs = "<script type=\"text/x-mathjax-config\">\n" " MathJax.Hub.Config({\n" " extensions: [\"tex2jax.js\""; @@ -389,7 +395,7 @@ static QCString substituteHtmlKeywords(const QCString &s, result = substitute(result,"$extrastylesheet",extraCssText); result = substitute(result,"$relpath$",relPath); //<-- obsolete: for backwards compatibility only result = substitute(result,"$relpath^",relPath); //<-- must be last - + // additional HTML only conditional blocks result = selectBlock(result,"DISABLE_INDEX",disableIndex); result = selectBlock(result,"GENERATE_TREEVIEW",treeView); @@ -412,7 +418,7 @@ HtmlCodeGenerator::HtmlCodeGenerator() { } -HtmlCodeGenerator::HtmlCodeGenerator(FTextStream &t,const QCString &relPath) +HtmlCodeGenerator::HtmlCodeGenerator(FTextStream &t,const QCString &relPath) : m_col(0), m_relPath(relPath) { setTextStream(t); @@ -433,7 +439,7 @@ void HtmlCodeGenerator::codify(const char *str) { static int tabSize = Config_getInt(TAB_SIZE); if (str && m_streamSet) - { + { const char *p=str; char c; int spacesToNextTabStop; @@ -442,19 +448,19 @@ void HtmlCodeGenerator::codify(const char *str) c=*p++; switch(c) { - case '\t': spacesToNextTabStop = - tabSize - (m_col%tabSize); - m_t << Doxygen::spaces.left(spacesToNextTabStop); - m_col+=spacesToNextTabStop; - break; - case '\n': m_t << "\n"; m_col=0; + case '\t': spacesToNextTabStop = + tabSize - (m_col%tabSize); + m_t << Doxygen::spaces.left(spacesToNextTabStop); + m_col+=spacesToNextTabStop; + break; + case '\n': m_t << "\n"; m_col=0; break; case '\r': break; - case '<': m_t << "<"; m_col++; + case '<': m_t << "<"; m_col++; break; - case '>': m_t << ">"; m_col++; + case '>': m_t << ">"; m_col++; break; - case '&': m_t << "&"; m_col++; + case '&': m_t << "&"; m_col++; break; case '\'': m_t << "'"; m_col++; // ' is not valid XHTML break; @@ -469,8 +475,8 @@ void HtmlCodeGenerator::codify(const char *str) m_t << "\\"; m_col++; break; - default: p=writeUtf8Char(m_t,p-1); - m_col++; + default: p=writeUtf8Char(m_t,p-1); + m_col++; break; } } @@ -500,7 +506,7 @@ void HtmlCodeGenerator::docify(const char *str) else m_t << "\\"; break; - default: m_t << c; + default: m_t << c; } } } @@ -517,7 +523,7 @@ void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename, qsnprintf(lineAnchor,maxLineNrStr,"l%05d",l); m_t << "<div class=\"line\">"; - m_t << "<a name=\"" << lineAnchor << "\"></a><span class=\"lineno\">"; + m_t << "<a name=\"" << lineAnchor << "\"></a><span class=\"lineno\">"; if (filename) { _writeCodeLink("line",ref,filename,anchor,lineNumber,0); @@ -526,7 +532,7 @@ void HtmlCodeGenerator::writeLineNumber(const char *ref,const char *filename, { codify(lineNumber); } - m_t << "</span>"; + m_t << "</span>"; m_t << " "; } @@ -544,7 +550,7 @@ void HtmlCodeGenerator::_writeCodeLink(const char *className, const char *anchor, const char *name, const char *tooltip) { - if (ref) + if (ref) { m_t << "<a class=\"" << className << "Ref\" "; m_t << externalLinkTarget() << externalRef(m_relPath,ref,FALSE); @@ -647,33 +653,33 @@ void HtmlCodeGenerator::writeTooltip(const char *id, const DocLinkInfo &docInfo, } -void HtmlCodeGenerator::startCodeLine(bool hasLineNumbers) -{ +void HtmlCodeGenerator::startCodeLine(bool hasLineNumbers) +{ if (m_streamSet) { if (!hasLineNumbers) m_t << "<div class=\"line\">"; - m_col=0; + m_col=0; } } -void HtmlCodeGenerator::endCodeLine() -{ +void HtmlCodeGenerator::endCodeLine() +{ if (m_streamSet) m_t << "</div>"; } -void HtmlCodeGenerator::startFontClass(const char *s) -{ - if (m_streamSet) m_t << "<span class=\"" << s << "\">"; +void HtmlCodeGenerator::startFontClass(const char *s) +{ + if (m_streamSet) m_t << "<span class=\"" << s << "\">"; } -void HtmlCodeGenerator::endFontClass() -{ - if (m_streamSet) m_t << "</span>"; +void HtmlCodeGenerator::endFontClass() +{ + if (m_streamSet) m_t << "</span>"; } -void HtmlCodeGenerator::writeCodeAnchor(const char *anchor) -{ - if (m_streamSet) m_t << "<a name=\"" << anchor << "\"></a>"; +void HtmlCodeGenerator::writeCodeAnchor(const char *anchor) +{ + if (m_streamSet) m_t << "<a name=\"" << anchor << "\"></a>"; } //-------------------------------------------------------------------------- @@ -699,29 +705,29 @@ void HtmlGenerator::init() exit(1); } //writeLogo(dname); - if (!Config_getString(HTML_HEADER).isEmpty()) + if (!Config_getString(HTML_HEADER).isEmpty()) { g_header=fileToString(Config_getString(HTML_HEADER)); //printf("g_header='%s'\n",g_header.data()); } - else + else { g_header = ResourceMgr::instance().getAsString("header.html"); } - if (!Config_getString(HTML_FOOTER).isEmpty()) + if (!Config_getString(HTML_FOOTER).isEmpty()) { g_footer=fileToString(Config_getString(HTML_FOOTER)); //printf("g_footer='%s'\n",g_footer.data()); } - else + else { g_footer = ResourceMgr::instance().getAsString("footer.html"); } if (Config_getBool(USE_MATHJAX)) { - if (!Config_getString(MATHJAX_CODEFILE).isEmpty()) + if (!Config_getString(MATHJAX_CODEFILE).isEmpty()) { g_mathjax_code=fileToString(Config_getString(MATHJAX_CODEFILE)); //printf("g_mathjax_code='%s'\n",g_mathjax_code.data()); @@ -875,7 +881,7 @@ void HtmlGenerator::startFile(const char *name,const char *, lastTitle=title; relPath = relativePathToRoot(fileName); - if (fileName.right(Doxygen::htmlFileExtension.length())!=Doxygen::htmlFileExtension) + if (fileName.right(Doxygen::htmlFileExtension.length())!=Doxygen::htmlFileExtension) { fileName+=Doxygen::htmlFileExtension; } @@ -883,19 +889,21 @@ void HtmlGenerator::startFile(const char *name,const char *, m_codeGen.setTextStream(t); m_codeGen.setRelativePath(relPath); Doxygen::indexList->addIndexFile(fileName); - + lastFile = fileName; t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(title)),relPath); - t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " + t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " << versionString << " -->" << endl; //static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); static bool searchEngine = Config_getBool(SEARCHENGINE); if (searchEngine /*&& !generateTreeView*/) { t << "<script type=\"text/javascript\">\n"; - t << "var searchBox = new SearchBox(\"searchBox\", \"" + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; + t << "var searchBox = new SearchBox(\"searchBox\", \"" << relPath<< "search\",false,'" << theTranslator->trSearch() << "');\n"; + t << "/* @license-end */\n"; t << "</script>\n"; } //generateDynamicSections(t,relPath); @@ -995,8 +1003,8 @@ void HtmlGenerator::writeStyleInfo(int part) if (Config_getString(HTML_STYLESHEET).isEmpty()) // write default style sheet { //printf("write doxygen.css\n"); - startPlainFile("doxygen.css"); - + startPlainFile("doxygen.css"); + // alternative, cooler looking titles //t << "H1 { text-align: center; border-width: thin none thin none;" << endl; //t << " border-style : double; border-color : blue; padding-left : 1em; padding-right : 1em }" << endl; @@ -1096,7 +1104,7 @@ void HtmlGenerator::startIndexItem(const char *ref,const char *f) //printf("HtmlGenerator::startIndexItem(%s,%s)\n",ref,f); if (ref || f) { - if (ref) + if (ref) { t << "<a class=\"elRef\" "; t << externalLinkTarget() << externalRef(relPath,ref,FALSE); @@ -1141,7 +1149,7 @@ void HtmlGenerator::writeStartAnnoItem(const char *,const char *f, void HtmlGenerator::writeObjectLink(const char *ref,const char *f, const char *anchor, const char *name) { - if (ref) + if (ref) { t << "<a class=\"elRef\" "; t << externalLinkTarget() << externalRef(relPath,ref,FALSE); @@ -1164,7 +1172,7 @@ void HtmlGenerator::startTextLink(const char *f,const char *anchor) t << "<a href=\""; if (f) t << relPath << f << Doxygen::htmlFileExtension; if (anchor) t << "#" << anchor; - t << "\">"; + t << "\">"; } void HtmlGenerator::endTextLink() @@ -1179,7 +1187,7 @@ void HtmlGenerator::startHtmlLink(const char *url) if (generateTreeView) t << "target=\"top\" "; t << "href=\""; if (url) t << url; - t << "\">"; + t << "\">"; } void HtmlGenerator::endHtmlLink() @@ -1275,7 +1283,7 @@ void HtmlGenerator::docify(const char *str,bool inHtmlComment) else t << "\\"; break; - default: t << c; + default: t << c; } } } @@ -1302,7 +1310,7 @@ static void startSectionHeader(FTextStream &t, "onclick=\"return toggleVisibility(this)\" " "class=\"dynheader closed\" " "style=\"cursor:pointer;\">" << endl; - t << " <img id=\"dynsection-" << sectionCount << "-trigger\" src=\"" + t << " <img id=\"dynsection-" << sectionCount << "-trigger\" src=\"" << relPath << "closed.png\" alt=\"+\"/> "; } else @@ -1390,13 +1398,13 @@ void HtmlGenerator::endClassDiagram(const ClassDiagram &d, } -void HtmlGenerator::startMemberList() -{ +void HtmlGenerator::startMemberList() +{ DBG_HTML(t << "<!-- startMemberList -->" << endl) } -void HtmlGenerator::endMemberList() -{ +void HtmlGenerator::endMemberList() +{ DBG_HTML(t << "<!-- endMemberList -->" << endl) } @@ -1404,8 +1412,8 @@ void HtmlGenerator::endMemberList() // 0 = single column right aligned // 1 = double column left aligned // 2 = single column left aligned -void HtmlGenerator::startMemberItem(const char *anchor,int annoType,const char *inheritId) -{ +void HtmlGenerator::startMemberItem(const char *anchor,int annoType,const char *inheritId) +{ DBG_HTML(t << "<!-- startMemberItem() -->" << endl) if (m_emptySection) { @@ -1427,10 +1435,10 @@ void HtmlGenerator::startMemberItem(const char *anchor,int annoType,const char * } } -void HtmlGenerator::endMemberItem() -{ - t << "</td></tr>"; - t << endl; +void HtmlGenerator::endMemberItem() +{ + t << "</td></tr>"; + t << endl; } void HtmlGenerator::startMemberTemplateParams() @@ -1449,15 +1457,15 @@ void HtmlGenerator::endMemberTemplateParams(const char *anchor,const char *inher } -void HtmlGenerator::insertMemberAlign(bool templ) -{ +void HtmlGenerator::insertMemberAlign(bool templ) +{ DBG_HTML(t << "<!-- insertMemberAlign -->" << endl) QCString className = templ ? "memTemplItemRight" : "memItemRight"; - t << " </td><td class=\"" << className << "\" valign=\"bottom\">"; + t << " </td><td class=\"" << className << "\" valign=\"bottom\">"; } -void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheritId) -{ +void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheritId) +{ DBG_HTML(t << "<!-- startMemberDescription -->" << endl) if (m_emptySection) { @@ -1469,20 +1477,20 @@ void HtmlGenerator::startMemberDescription(const char *anchor,const char *inheri { t << " inherit " << inheritId; } - t << "\"><td class=\"mdescLeft\"> </td><td class=\"mdescRight\">"; + t << "\"><td class=\"mdescLeft\"> </td><td class=\"mdescRight\">"; } -void HtmlGenerator::endMemberDescription() -{ +void HtmlGenerator::endMemberDescription() +{ DBG_HTML(t << "<!-- endMemberDescription -->" << endl) - t << "<br /></td></tr>" << endl; + t << "<br /></td></tr>" << endl; } void HtmlGenerator::startMemberSections() { DBG_HTML(t << "<!-- startMemberSections -->" << endl) m_emptySection=TRUE; // we postpone writing <table> until we actually - // write a row to prevent empty tables, which + // write a row to prevent empty tables, which // are not valid XHTML! } @@ -1533,9 +1541,9 @@ void HtmlGenerator::endMemberSubtitle() t << "</td></tr>" << endl; } -void HtmlGenerator::startIndexList() -{ - t << "<table>" << endl; +void HtmlGenerator::startIndexList() +{ + t << "<table>" << endl; } void HtmlGenerator::endIndexList() @@ -1543,10 +1551,10 @@ void HtmlGenerator::endIndexList() t << "</table>" << endl; } -void HtmlGenerator::startIndexKey() -{ +void HtmlGenerator::startIndexKey() +{ // inserted 'class = ...', 02 jan 2002, jh - t << " <tr><td class=\"indexkey\">"; + t << " <tr><td class=\"indexkey\">"; } void HtmlGenerator::endIndexKey() @@ -1554,10 +1562,10 @@ void HtmlGenerator::endIndexKey() t << "</td>"; } -void HtmlGenerator::startIndexValue(bool) -{ +void HtmlGenerator::startIndexValue(bool) +{ // inserted 'class = ...', 02 jan 2002, jh - t << "<td class=\"indexvalue\">"; + t << "<td class=\"indexvalue\">"; } void HtmlGenerator::endIndexValue(const char *,bool) @@ -1576,7 +1584,7 @@ void HtmlGenerator::endMemberDocList() } void HtmlGenerator::startMemberDoc( const char *clName, const char *memName, - const char *anchor, const char *title, + const char *anchor, const char *title, int memCount, int memTotal, bool showInline) { DBG_HTML(t << "<!-- startMemberDoc -->" << endl;) @@ -1610,7 +1618,7 @@ void HtmlGenerator::startMemberDocName(bool /*align*/) DBG_HTML(t << "<!-- startMemberDocName -->" << endl;) t << " <table class=\"memname\">" << endl; - + t << " <tr>" << endl; t << " <td class=\"memname\">"; } @@ -1713,8 +1721,8 @@ void HtmlGenerator::exceptionEntry(const char* prefix,bool closeBracket) t << "</td><td></td><td colspan=\"2\">"; } -void HtmlGenerator::endMemberDoc(bool hasArgs) -{ +void HtmlGenerator::endMemberDoc(bool hasArgs) +{ DBG_HTML(t << "<!-- endMemberDoc -->" << endl;) if (!hasArgs) { @@ -1857,17 +1865,17 @@ void HtmlGenerator::endMemberGroup(bool) { } -void HtmlGenerator::startIndent() -{ +void HtmlGenerator::startIndent() +{ DBG_HTML(t << "<!-- startIndent -->" << endl;) t << "<div class=\"memdoc\">\n"; } -void HtmlGenerator::endIndent() -{ +void HtmlGenerator::endIndent() +{ DBG_HTML(t << "<!-- endIndent -->" << endl;) - t << endl << "</div>" << endl << "</div>" << endl; + t << endl << "</div>" << endl << "</div>" << endl; } void HtmlGenerator::addIndexItem(const char *,const char *) @@ -1941,7 +1949,7 @@ void HtmlGenerator::startSimpleSect(SectionTypes, void HtmlGenerator::endSimpleSect() { - t << "</dl>"; + t << "</dl>"; } void HtmlGenerator::startParamList(ParamListTypes, @@ -1954,21 +1962,21 @@ void HtmlGenerator::startParamList(ParamListTypes, void HtmlGenerator::endParamList() { - t << "</dl>"; + t << "</dl>"; } void HtmlGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) { HtmlDocVisitor *visitor = new HtmlDocVisitor(t,m_codeGen,ctx); n->accept(visitor); - delete visitor; + delete visitor; } //---------------- helpers for index generation ----------------------------- static void startQuickIndexList(FTextStream &t,bool compact,bool topLevel=TRUE) { - if (compact) + if (compact) { if (topLevel) { @@ -1978,9 +1986,9 @@ static void startQuickIndexList(FTextStream &t,bool compact,bool topLevel=TRUE) { t << " <div id=\"navrow2\" class=\"tabs2\">\n"; } - t << " <ul class=\"tablist\">\n"; + t << " <ul class=\"tablist\">\n"; } - else + else { t << "<ul>"; } @@ -1988,12 +1996,12 @@ static void startQuickIndexList(FTextStream &t,bool compact,bool topLevel=TRUE) static void endQuickIndexList(FTextStream &t,bool compact) { - if (compact) + if (compact) { t << " </ul>\n"; t << " </div>\n"; } - else + else { t << "</ul>\n"; } @@ -2003,8 +2011,8 @@ static void startQuickIndexItem(FTextStream &t,const char *l, bool hl,bool /*compact*/, const QCString &relPath) { - t << " <li"; - if (hl) + t << " <li"; + if (hl) { t << " class=\"current\""; } @@ -2026,17 +2034,17 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind) static bool showNamespaces = Config_getBool(SHOW_NAMESPACES); switch (kind) { - case LayoutNavEntry::MainPage: return TRUE; - case LayoutNavEntry::User: return TRUE; - case LayoutNavEntry::UserGroup: return TRUE; + case LayoutNavEntry::MainPage: return TRUE; + case LayoutNavEntry::User: return TRUE; + case LayoutNavEntry::UserGroup: return TRUE; case LayoutNavEntry::Pages: return indexedPages>0; case LayoutNavEntry::Modules: return documentedGroups>0; case LayoutNavEntry::Namespaces: return documentedNamespaces>0 && showNamespaces; case LayoutNavEntry::NamespaceList: return documentedNamespaces>0 && showNamespaces; case LayoutNavEntry::NamespaceMembers: return documentedNamespaceMembers[NMHL_All]>0; case LayoutNavEntry::Classes: return annotatedClasses>0; - case LayoutNavEntry::ClassList: return annotatedClasses>0; - case LayoutNavEntry::ClassIndex: return annotatedClasses>0; + case LayoutNavEntry::ClassList: return annotatedClasses>0; + case LayoutNavEntry::ClassIndex: return annotatedClasses>0; case LayoutNavEntry::ClassHierarchy: return hierarchyClasses>0; case LayoutNavEntry::ClassMembers: return documentedClassMembers[CMHL_All]>0; case LayoutNavEntry::Files: return documentedHtmlFiles>0 && showFiles; @@ -2107,8 +2115,8 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath, { QCString url = entry->url(); startQuickIndexItem(t,url, - entry==hlEntry && - (entry->children().count()>0 || + entry==hlEntry && + (entry->children().count()>0 || (entry->kind()==kind && !highlightParent) ), TRUE,relPath); @@ -2179,11 +2187,11 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, case HLI_Pages: kind = LayoutNavEntry::Pages; break; case HLI_Examples: kind = LayoutNavEntry::Examples; break; case HLI_UserGroup: kind = LayoutNavEntry::UserGroup; break; - case HLI_ClassVisible: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes; + case HLI_ClassVisible: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes; highlightParent = TRUE; break; - case HLI_NamespaceVisible: kind = LayoutNavEntry::NamespaceList; altKind = LayoutNavEntry::Namespaces; + case HLI_NamespaceVisible: kind = LayoutNavEntry::NamespaceList; altKind = LayoutNavEntry::Namespaces; highlightParent = TRUE; break; - case HLI_FileVisible: kind = LayoutNavEntry::FileList; altKind = LayoutNavEntry::Files; + case HLI_FileVisible: kind = LayoutNavEntry::FileList; altKind = LayoutNavEntry::Files; highlightParent = TRUE; break; case HLI_None: break; case HLI_Search: break; @@ -2203,6 +2211,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, t << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>" << endl; t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>" << endl; t << "<script type=\"text/javascript\">" << endl; + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; t << "$(function() {" << endl; t << " initMenu('" << relPath << "'," << (searchEngine?"true":"false") << "," @@ -2217,12 +2226,14 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, } else { + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; t << " $(document).ready(function() {\n" << " if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }\n" << " });\n"; } } t << "});" << endl; + t << "/* @license-end */"; t << "</script>" << endl; t << "<div id=\"main-nav\"></div>" << endl; } @@ -2235,7 +2246,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, { highlightParent=TRUE; hlEntry = root->children().getFirst(); - if (hlEntry==0) + if (hlEntry==0) { return; // argl, empty index! } @@ -2245,7 +2256,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, LayoutNavEntry *e = hlEntry->children().getFirst(); if (e) { - hlEntry = e; + hlEntry = e; } } renderQuickLinksAsTabs(t,relPath,hlEntry,kind,highlightParent,hli==HLI_Search); @@ -2269,23 +2280,25 @@ QCString HtmlGenerator::writeSplitBarAsString(const char *name,const char *relpa if (generateTreeView) { result = QCString( - "<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n" - " <div id=\"nav-tree\">\n" - " <div id=\"nav-tree-contents\">\n" - " <div id=\"nav-sync\" class=\"sync\"></div>\n" - " </div>\n" - " </div>\n" - " <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n" - " class=\"ui-resizable-handle\">\n" - " </div>\n" - "</div>\n" - "<script type=\"text/javascript\">\n" - "$(document).ready(function(){initNavTree('") + - QCString(name) + Doxygen::htmlFileExtension + - QCString("','") + relpath + - QCString("');});\n" - "</script>\n" - "<div id=\"doc-content\">\n"); + "<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n" + " <div id=\"nav-tree\">\n" + " <div id=\"nav-tree-contents\">\n" + " <div id=\"nav-sync\" class=\"sync\"></div>\n" + " </div>\n" + " </div>\n" + " <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n" + " class=\"ui-resizable-handle\">\n" + " </div>\n" + "</div>\n" + "<script type=\"text/javascript\">\n" + "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n" + "$(document).ready(function(){initNavTree('") + + QCString(name) + Doxygen::htmlFileExtension + + QCString("','") + relpath + + QCString("');});\n" + "/* @license-end */\n" + "</script>\n" + "<div id=\"doc-content\">\n"); } return result; } @@ -2337,10 +2350,10 @@ void HtmlGenerator::writeSearchPage() t << ");\n\n"; t << "$translator = array(\n"; t << " 'search_results_title' => \"" << theTranslator->trSearchResultsTitle() << "\",\n"; - t << " 'search_results' => array(\n"; - t << " 0 => \"" << theTranslator->trSearchResults(0) << "\",\n"; - t << " 1 => \"" << theTranslator->trSearchResults(1) << "\",\n"; - t << " 2 => \"" << substitute(theTranslator->trSearchResults(2), "$", "\\$") << "\",\n"; + t << " 'search_results' => array(\n"; + t << " 0 => \"" << theTranslator->trSearchResults(0) << "\",\n"; + t << " 1 => \"" << theTranslator->trSearchResults(1) << "\",\n"; + t << " 2 => \"" << substitute(theTranslator->trSearchResults(2), "$", "\\$") << "\",\n"; t << " ),\n"; t << " 'search_matches' => \"" << theTranslator->trSearchMatches() << "\",\n"; t << " 'search' => \"" << theTranslator->trSearch() << "\",\n"; @@ -2361,11 +2374,13 @@ void HtmlGenerator::writeSearchPage() FTextStream t(&f); t << substituteHtmlKeywords(g_header,"Search",""); - t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " + t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " << versionString << " -->" << endl; t << "<script type=\"text/javascript\">\n"; - t << "var searchBox = new SearchBox(\"searchBox\", \"" + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; + t << "var searchBox = new SearchBox(\"searchBox\", \"" << "search\",false,'" << theTranslator->trSearch() << "');\n"; + t << "/* @license-end */\n"; t << "</script>\n"; if (!Config_getBool(DISABLE_INDEX)) { @@ -2413,11 +2428,13 @@ void HtmlGenerator::writeExternalSearchPage() FTextStream t(&f); t << substituteHtmlKeywords(g_header,"Search",""); - t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " + t << "<!-- " << theTranslator->trGeneratedBy() << " Doxygen " << versionString << " -->" << endl; t << "<script type=\"text/javascript\">\n"; - t << "var searchBox = new SearchBox(\"searchBox\", \"" + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; + t << "var searchBox = new SearchBox(\"searchBox\", \"" << "search\",false,'" << theTranslator->trSearch() << "');\n"; + t << "/* @license-end */\n"; t << "</script>\n"; if (!Config_getBool(DISABLE_INDEX)) { @@ -2568,15 +2585,15 @@ void HtmlGenerator::startHeaderSection() t << "<div class=\"header\">" << endl; } -void HtmlGenerator::startTitleHead(const char *) -{ +void HtmlGenerator::startTitleHead(const char *) +{ t << " <div class=\"headertitle\">" << endl; - startTitle(); + startTitle(); } -void HtmlGenerator::endTitleHead(const char *,const char *) -{ - endTitle(); +void HtmlGenerator::endTitleHead(const char *,const char *) +{ + endTitle(); t << " </div>" << endl; } @@ -2672,7 +2689,7 @@ void HtmlGenerator::endLabels() } void HtmlGenerator::writeInheritedSectionTitle( - const char *id, const char *ref, + const char *id, const char *ref, const char *file, const char *anchor, const char *title, const char *name) { @@ -2692,7 +2709,7 @@ void HtmlGenerator::writeInheritedSectionTitle( classLink+=QCString("\">")+convertToHtml(name,FALSE)+"</a>"; t << "<tr class=\"inherit_header " << id << "\">" << "<td colspan=\"2\" onclick=\"javascript:toggleInherit('" << id << "')\">" - << "<img src=\"" << relPath << "closed.png\" alt=\"-\"/> " + << "<img src=\"" << relPath << "closed.png\" alt=\"-\"/> " << theTranslator->trInheritedFrom(convertToHtml(title,FALSE),classLink) << "</td></tr>" << endl; } @@ -2748,4 +2765,3 @@ void HtmlGenerator::addWord(const char *word,bool hiPriority) Doxygen::searchIndex->addWord(word,hiPriority); } } - |