From 3112d709e3decbb6931f9484725a35e0630af9b8 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 12 May 2021 20:30:38 +0200 Subject: Some fixes for template.cpp and improve the template output --- src/context.cpp | 114 ++++++++++------ src/htmlgen.cpp | 13 +- src/resourcemgr.cpp | 10 +- src/resourcemgr.h | 2 +- src/template.cpp | 235 ++++++++++++++++++++++++-------- src/template.h | 5 +- templates/html/dynsections_tooltips.js | 6 + templates/html/header.html | 6 +- templates/html/htmlannotated.tpl | 2 +- templates/html/htmlbase.tpl | 98 +++++++------ templates/html/htmlclass.tpl | 6 +- templates/html/htmlclasses.tpl | 37 ++--- templates/html/htmljsmenudata.tpl | 64 ++++----- templates/html/htmljsmenuletterdata.tpl | 15 +- templates/html/htmljsnavtree.tpl | 24 ++++ templates/html/htmljssearchdata.tpl | 27 ++-- templates/html/htmljssearchindex.tpl | 10 +- templates/html/htmllayout.tpl | 37 ++++- templates/html/htmlmemberindex.tpl | 13 +- templates/html/htmlmemdecl.tpl | 2 +- templates/html/htmlpage.tpl | 2 +- templates/html/htmlsearchresult.tpl | 7 +- 22 files changed, 466 insertions(+), 269 deletions(-) create mode 100644 templates/html/dynsections_tooltips.js diff --git a/src/context.cpp b/src/context.cpp index 2ae62a0..fc7a586 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -9377,61 +9377,82 @@ class SymbolContext::Private const Definition *prevScope = prev ? prev->getOuterScope() : 0; const MemberDef *md = toMemberDef(m_def); bool isFunctionLike = md && (md->isFunction() || md->isSlot() || md->isSignal()); - bool overloadedFunction = isFunctionLike && - ((prevScope!=0 && scope==prevScope) || (scope && scope==nextScope)); - QCString prefix; - if (md) prefix=md->localName(); - if (overloadedFunction) // overloaded member function - { - prefix+=md->argsString(); - // show argument list to disambiguate overloaded functions - } - else if (md && isFunctionLike) // unique member function - { - prefix+="()"; // only to show it is a function - } - bool found=FALSE; + bool overloadedFunction = ((prevScope!=0 && scope==prevScope) || (scope && scope==nextScope)) && + md && (md->isFunction() || md->isSlot()); + QCString name; - if (m_def->definitionType()==Definition::TypeClass) + if (prev==0 && next==0) // unique name { - name = m_def->displayName(); - found = TRUE; - } - else if (m_def->definitionType()==Definition::TypeNamespace) - { - name = m_def->displayName(); - found = TRUE; - } - else if (scope==0 || scope==Doxygen::globalScope) // in global scope - { - if (md) + if (scope!=Doxygen::globalScope) + { + name = scope->name(); + } + else if (md) { const FileDef *fd = md->getBodyDef(); if (fd==0) fd = md->getFileDef(); if (fd) { - if (!prefix.isEmpty()) prefix+=": "; - name = prefix + convertToXML(fd->localName()); - found = TRUE; + name = fd->localName(); } } } - else if (md && (md->getClassDef() || md->getNamespaceDef())) - // member in class or namespace scope - { - SrcLangExt lang = md->getLanguage(); - name = m_def->getOuterScope()->qualifiedName() - + getLanguageSpecificSeparator(lang) + prefix; - found = TRUE; - } - else if (scope) // some thing else? -> show scope - { - name = prefix + convertToXML(scope->name()); - found = TRUE; - } - if (!found) // fallback + else { - name = prefix + "("+theTranslator->trGlobalNamespace()+")"; + + QCString prefix; + if (md) prefix=md->localName(); + if (overloadedFunction) // overloaded member function + { + prefix+=md->argsString(); + // show argument list to disambiguate overloaded functions + } + else if (md && isFunctionLike) // unique member function + { + prefix+="()"; // only to show it is a function + } + bool found=FALSE; + if (m_def->definitionType()==Definition::TypeClass) + { + name = m_def->displayName(); + found = TRUE; + } + else if (m_def->definitionType()==Definition::TypeNamespace) + { + name = m_def->displayName(); + found = TRUE; + } + else if (scope==0 || scope==Doxygen::globalScope) // in global scope + { + if (md) + { + const FileDef *fd = md->getBodyDef(); + if (fd==0) fd = md->getFileDef(); + if (fd) + { + if (!prefix.isEmpty()) prefix+=": "; + name = prefix + convertToXML(fd->localName()); + found = TRUE; + } + } + } + else if (md && (md->resolveAlias()->getClassDef() || md->resolveAlias()->getNamespaceDef())) + // member in class or namespace scope + { + SrcLangExt lang = md->getLanguage(); + name = m_def->getOuterScope()->qualifiedName() + + getLanguageSpecificSeparator(lang) + prefix; + found = TRUE; + } + else if (scope) // some thing else? -> show scope + { + name = prefix + convertToXML(scope->name()); + found = TRUE; + } + if (!found) // fallback + { + name = prefix + "("+theTranslator->trGlobalNamespace()+")"; + } } return name; } @@ -9600,7 +9621,10 @@ class SymbolGroupListContext::Private : public GenericNodeListContext QCString name = searchName(*it); if (name!=lastName) { - append(SymbolGroupContext::alloc(it_begin,it)); + if (it!=it_begin) + { + append(SymbolGroupContext::alloc(it_begin,it)); + } it_begin = it; lastName = name; } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index ad8782b..cde7ef2 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -999,13 +999,7 @@ void HtmlGenerator::init() t << mgr.getAsString("dynsections.js"); if (Config_getBool(SOURCE_BROWSER) && Config_getBool(SOURCE_TOOLTIPS)) { - t << - "\n$(document).ready(function() {\n" - " $('.code,.codeRef').each(function() {\n" - " $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());\n" - " $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });\n" - " });\n" - "});\n"; + t << mgr.getAsString("dynsections_tooltips.js"); } } } @@ -2501,7 +2495,7 @@ static void writeDefaultQuickLinks(TextStream &t,bool compact, t << "\n"; t << "\n"; t << "\n"; t << "
\n"; } diff --git a/src/resourcemgr.cpp b/src/resourcemgr.cpp index 161e480..fb52d99 100644 --- a/src/resourcemgr.cpp +++ b/src/resourcemgr.cpp @@ -76,9 +76,11 @@ bool ResourceMgr::writeCategory(const QCString &categoryName,const QCString &tar return TRUE; } -bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName) const +bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName,bool append) const { std::string pathName = targetDir.str()+"/"+targetName.str(); + std::ios_base::openmode mode = std::ofstream::out | std::ofstream::binary; + if (append) mode |= std::ofstream::app; const Resource *res = get(name); if (res) { @@ -86,7 +88,7 @@ bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir, { case Resource::Verbatim: { - std::ofstream f(pathName,std::ofstream::out | std::ofstream::binary); + std::ofstream f(pathName,mode); bool ok=false; if (f.is_open()) { @@ -137,7 +139,7 @@ bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir, break; case Resource::CSS: { - std::ofstream t(pathName,std::ofstream::out | std::ofstream::binary); + std::ofstream t(pathName,mode); if (t.is_open()) { QCString buf(res->size+1); @@ -157,7 +159,7 @@ bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir, break; case Resource::SVG: { - std::ofstream t(pathName,std::ostream::out | std::ofstream::binary); + std::ofstream t(pathName,mode); if (t.is_open()) { QCString buf(res->size+1); diff --git a/src/resourcemgr.h b/src/resourcemgr.h index 7978e09..3c4c1b3 100644 --- a/src/resourcemgr.h +++ b/src/resourcemgr.h @@ -48,7 +48,7 @@ class ResourceMgr bool copyResource(const QCString &name,const QCString &targetDir) const; /** Copies a registered resource to a given target directory under a given target name */ - bool copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName) const; + bool copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName, bool append=false) const; /** Gets the resource data as a C string */ QCString getAsString(const QCString &name) const; diff --git a/src/template.cpp b/src/template.cpp index 82b35f7..13ce7ef 100755 --- a/src/template.cpp +++ b/src/template.cpp @@ -98,30 +98,33 @@ static std::vector split(const QCString &str,const QCString &sep, /** Strips spaces surrounding `=` from string \a in, so * `foo = 10 bar=5 baz= 'hello'` will become `foo=10 bar=5 baz='hello'` */ -static QCString removeSpacesAroundEquals(const QCString &s) +static void removeSpacesAroundEquals(QCString &s) { - if (s.isEmpty()) return s; - QCString result(s); - const char *p=s.data(); - char *q = result.rawData(); - char c; - while ((c=*p++)) + //printf(">removeSpacesAroundEquals(%s)\n",qPrint(s)); + uint i=0, dstIdx=0, l=s.length(); + while (i(q-result.data())+1); - return result; + s.resize(dstIdx+1); + //printf("keyToLabel(%s)\n",qPrint(startLetter)); + const char *p = startLetter; char c = *p; QCString result; if (c<127 && c>31) // printable ASCII character @@ -1102,16 +1106,14 @@ class FilterAlphaIndex result+=hex[((unsigned char)c)&0xf]; } } + //printf("get(attribName); int index = getPrefixIndex(v.toString()); - return getUnicodeForUTF8CharAt( - convertUTF8ToUpper( - getUTF8CharAt(v.toString().str(),index) - ),0); + return convertUTF8ToUpper(getUTF8CharAt(v.toString().str(),index)); } public: @@ -1134,7 +1136,7 @@ class FilterAlphaIndex TemplateStructIntf *s = item.toStruct(); if (s) { - uint sortKey = determineSortKey(s,args.toString()); + std::string sortKey = determineSortKey(s,args.toString()); sortList.emplace_back(sortKey,item); //printf("sortKey=%s\n",qPrint(sortKey)); } @@ -1147,7 +1149,7 @@ class FilterAlphaIndex [](const auto &lhs,const auto &rhs) { return lhs.key < rhs.key; }); // create an index from the sorted list - QCString letter; + std::string letter; TemplateStruct *indexNode = 0; TemplateList *indexList = 0; for (const auto &elem : sortList) @@ -1158,7 +1160,7 @@ class FilterAlphaIndex indexNode = TemplateStruct::alloc(); indexList = TemplateList::alloc(); indexNode->set("letter", elem.key); - indexNode->set("label", keyToLabel(elem.key)); + indexNode->set("label", keyToLabel(elem.key.c_str())); indexNode->set("items",indexList); result->append(indexNode); letter=elem.key; @@ -1282,6 +1284,55 @@ class FilterIsAbsoluteURL //-------------------------------------------------------------------- +/** @brief The implementation of the "lower" filter */ +class FilterLower +{ + public: + static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &) + { + if (v.isValid() && v.type()==TemplateVariant::String) + { + return v.toString().lower(); + } + return v; + } +}; + +//-------------------------------------------------------------------- + +/** @brief The implementation of the "upper" filter */ +class FilterUpper +{ + public: + static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &) + { + if (v.isValid() && v.type()==TemplateVariant::String) + { + return v.toString().upper(); + } + return v; + } +}; + +//-------------------------------------------------------------------- + +/** @brief The implementation of the "e" filter */ +class FilterHtmlEscape +{ + public: + static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &) + { + if (v.isValid() && v.type()==TemplateVariant::String) + { + return convertToHtml(v.toString()); + } + return v; + } +}; + + +//-------------------------------------------------------------------- + /** @brief The implementation of the "decodeURL" filter * The leading character is removed from the value in case it is a ^ or !. * - ^ is used to encode a absolute URL @@ -1359,7 +1410,10 @@ static TemplateFilterFactory::AutoRegister fAdd("add") static TemplateFilterFactory::AutoRegister fGet("get"); static TemplateFilterFactory::AutoRegister fRaw("raw"); static TemplateFilterFactory::AutoRegister fList("list"); +static TemplateFilterFactory::AutoRegister fLower("lower"); +static TemplateFilterFactory::AutoRegister fUpper("upper"); static TemplateFilterFactory::AutoRegister fAppend("append"); +static TemplateFilterFactory::AutoRegister fEscape("e"); static TemplateFilterFactory::AutoRegister fLength("length"); static TemplateFilterFactory::AutoRegister fNoWrap("nowrap"); static TemplateFilterFactory::AutoRegister fFlatten("flatten"); @@ -1409,7 +1463,7 @@ class ExprAstVariable : public ExprAst { public: ExprAstVariable(const QCString &name) : m_name(name) - { TRACE(("ExprAstVariable(%s)\n",name)); } + { TRACE(("ExprAstVariable(%s)\n",name.data())); } const QCString &name() const { return m_name; } virtual TemplateVariant resolve(TemplateContext *c) { @@ -1461,7 +1515,7 @@ class ExprAstFilter : public ExprAst { public: ExprAstFilter(const QCString &name,ExprAst *arg) : m_name(name), m_arg(arg) - { TRACE(("ExprAstFilter(%s)\n",name)); } + { TRACE(("ExprAstFilter(%s)\n",name.data())); } ~ExprAstFilter() { delete m_arg; } const QCString &name() const { return m_name; } TemplateVariant apply(const TemplateVariant &v,TemplateContext *c) @@ -1506,7 +1560,7 @@ class ExprAstLiteral : public ExprAst { public: ExprAstLiteral(const QCString &lit) : m_literal(lit) - { TRACE(("ExprAstLiteral(%s)\n",lit)); } + { TRACE(("ExprAstLiteral(%s)\n",lit.data())); } const QCString &literal() const { return m_literal; } virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(m_literal); } private: @@ -1969,6 +2023,7 @@ class ExpressionParser { warn(m_parser->templateName(),m_line,"unexpected operator '%s' in expression", Operator::toString(m_curToken.op)); + abort(); } break; default: @@ -2261,8 +2316,8 @@ class ExpressionParser m_curToken.id = s; p++; } - //TRACE(("token type=%d op=%d num=%d id=%s\n", - // m_curToken.type,m_curToken.op,m_curToken.num,qPrint(m_curToken.id))); + TRACE(("token type=%d op=%d num=%d id=%s\n", + m_curToken.type,m_curToken.op,m_curToken.num,qPrint(m_curToken.id))); m_tokenStream = p; return TRUE; @@ -2382,6 +2437,23 @@ void TemplateContextImpl::set(const QCString &name,const TemplateVariant &v) ctx.insert(std::make_pair(name.str(),v)); } +void TemplateContextImpl::update(const QCString &name,const TemplateVariant &v) +{ + int depth=0; + for (auto &ctx : m_contextStack) + { + auto it = ctx.find(name.str()); + if (it!=ctx.end()) + { + ctx.erase(it); + ctx.insert(std::make_pair(name.str(),v)); + return; + } + depth++; + } + warn(m_templateName,m_line,"requesting update for non-existing variable '%s'",qPrint(name)); +} + TemplateVariant TemplateContextImpl::get(const QCString &name) const { int i=name.find('.'); @@ -3544,21 +3616,16 @@ class TemplateNodeInclude : public TemplateNodeCreator static void stripLeadingWhiteSpace(QCString &s) { - const char *src = s.data(); - if (src) + uint i=0, dstIdx=0, l=s.length(); + bool skipSpaces=true; + while (i { TRACE(("{TemplateNodeWith(%s)\n",qPrint(data))); ExpressionParser expParser(parser,line); - QCString filteredData = removeSpacesAroundEquals(data); + QCString filteredData = data; + removeSpacesAroundEquals(filteredData); std::vector args = split(filteredData," "); auto it = args.begin(); while (it!=args.end()) @@ -4114,6 +4182,52 @@ class TemplateNodeSet : public TemplateNodeCreator //---------------------------------------------------------- +/** @brief Class representing an 'update' tag in a template */ +class TemplateNodeUpdate : public TemplateNodeCreator +{ + struct Mapping + { + Mapping(const QCString &n,ExprAst *e) : name(n), value(e) {} + ~Mapping() { } + QCString name; + ExprAst *value = 0; + }; + public: + TemplateNodeUpdate(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) + : TemplateNodeCreator(parser,parent,line) + { + TRACE(("{TemplateNodeUpdate(%s)\n",qPrint(data))); + ExpressionParser expParser(parser,line); + // data format: name=expression + int j=data.find('='); + ExprAst *expr = 0; + if (j>0 && (expr = expParser.parse(data.mid(j+1)))) + { + m_mapping = std::make_unique(data.left(j),expr); + } + TRACE(("}TemplateNodeUpdate(%s)\n",qPrint(data))); + } + ~TemplateNodeUpdate() + { + } + void render(TextStream &, TemplateContext *c) + { + TemplateContextImpl *ci = dynamic_cast(c); + if (ci==0) return; // should not happen + ci->setLocation(m_templateName,m_line); + if (m_mapping) + { + TemplateVariant value = m_mapping->value->resolve(c); + ci->update(m_mapping->name,value); + } + } + private: + std::unique_ptr m_mapping; +}; + + +//---------------------------------------------------------- + /** @brief Class representing an 'spaceless' tag in a template */ class TemplateNodeSpaceless : public TemplateNodeCreator { @@ -4313,6 +4427,12 @@ class TemplateNodeResource : public TemplateNodeCreator m_resExpr = ep.parse(data.left(i)); // part before as m_asExpr = ep.parse(data.mid(i+4)); // part after as } + else if ((i=data.find(" append "))!=-1) // resource a appends to b + { + m_resExpr = ep.parse(data.left(i)); // part before append + m_asExpr = ep.parse(data.mid(i+8)); // part after append + m_append = true; + } else // resource a { m_resExpr = ep.parse(data); @@ -4345,11 +4465,12 @@ class TemplateNodeResource : public TemplateNodeCreator QCString targetFile = m_asExpr->resolve(c).toString(); mkpath(ci,targetFile.str()); if (targetFile.isEmpty()) - { ci->warn(m_templateName,m_line,"invalid parameter at right side of 'as' for resource command\n"); + { + ci->warn(m_templateName,m_line,"invalid parameter at right side of '%s' for resource command\n", m_append ? "append" : "as"); } else { - ResourceMgr::instance().copyResourceAs(resourceFile,outputDirectory,targetFile); + ResourceMgr::instance().copyResourceAs(resourceFile,outputDirectory,targetFile,m_append); } } else @@ -4362,6 +4483,7 @@ class TemplateNodeResource : public TemplateNodeCreator private: ExprAst *m_resExpr = 0; ExprAst *m_asExpr = 0; + bool m_append = false; }; //---------------------------------------------------------- @@ -4477,6 +4599,7 @@ static TemplateNodeFactory::AutoRegister autoRefRange static TemplateNodeFactory::AutoRegister autoRefExtend("extend"); static TemplateNodeFactory::AutoRegister autoRefCreate("create"); static TemplateNodeFactory::AutoRegister autoRefRepeat("repeat"); +static TemplateNodeFactory::AutoRegister autoRefUpdate("update"); static TemplateNodeFactory::AutoRegister autoRefInclude("include"); static TemplateNodeFactory::AutoRegister autoRefMarkers("markers"); static TemplateNodeFactory::AutoRegister autoRefTabbing("tabbing"); @@ -4797,7 +4920,7 @@ void TemplateLexer::addToken(TemplateTokenStream &tokens, { if (startPos(type,text,line)); @@ -4822,8 +4945,8 @@ void TemplateParser::parse( while (hasNextToken()) { auto tok = takeNextToken(); - //printf("%p:Token type=%d data='%s' line=%d\n", - // parent,tok->type,qPrint(tok->data),tok->line); + TRACE(("%p:Token type=%d data='%s' line=%d\n", + (void*)parent,tok->type,qPrint(tok->data),tok->line)); switch(tok->type) { case TemplateToken::Text: diff --git a/src/template.h b/src/template.h index dee063d..18e8b06 100644 --- a/src/template.h +++ b/src/template.h @@ -28,7 +28,7 @@ class TextStream; /** @defgroup template_api Template API * * This is the API for a - * Django + * Django * compatible template system written in C++. * It is somewhat inspired by Stephen Kelly's * Grantlee. @@ -175,6 +175,9 @@ class TemplateVariant /** Constructs a new variant with a string value \a s. */ TemplateVariant(const QCString &s,bool raw=FALSE) : m_type(String), m_strVal(s), m_strukt(0), m_raw(raw) {} + /** Constructs a new variant with a string value \a s. */ + TemplateVariant(const std::string &s,bool raw=FALSE) : m_type(String), m_strVal(s), m_strukt(0), m_raw(raw) {} + /** Constructs a new variant with a struct value \a s. * @note. The variant will hold a reference to the object. */ diff --git a/templates/html/dynsections_tooltips.js b/templates/html/dynsections_tooltips.js new file mode 100644 index 0000000..ddc333a --- /dev/null +++ b/templates/html/dynsections_tooltips.js @@ -0,0 +1,6 @@ +$(document).ready(function() { + $('.code,.codeRef').each(function() { + $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); + $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true }); + }); +}); diff --git a/templates/html/header.html b/templates/html/header.html index c3bcc04..628b61e 100644 --- a/templates/html/header.html +++ b/templates/html/header.html @@ -22,9 +22,11 @@ $mathjax $extrastylesheet - + +
- + +
diff --git a/templates/html/htmlannotated.tpl b/templates/html/htmlannotated.tpl index c5faa14..2e4d40d 100644 --- a/templates/html/htmlannotated.tpl +++ b/templates/html/htmlannotated.tpl @@ -4,7 +4,7 @@
{{ tr.classListDescription }}
-{% indexentry nav name=tr.classes file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.classList file=page.fileName anchor='' isReference=False %} {% opensubindex nav %} {% with tree=classTree %} {% include 'htmldirtree.tpl' %} diff --git a/templates/html/htmlbase.tpl b/templates/html/htmlbase.tpl index f021ddd..11cb054 100644 --- a/templates/html/htmlbase.tpl +++ b/templates/html/htmlbase.tpl @@ -6,8 +6,11 @@ -{{ config.PROJECT_NAME }}: {{ page.title }} +{% if config.PROJECT_NAME %}{{ config.PROJECT_NAME }}: {% endif %}{{ page.title }} +{% if config.DISABLE_INDEX and config.FULL_SIDEBAR %} + +{% endif %} {% if config.GENERATE_TREEVIEW %} @@ -15,22 +18,6 @@ - -{% endif %} -{% if not config.DISABLE_INDEX %} - - - {% endif %} {% if config.SEARCHENGINE %} @@ -40,18 +27,18 @@ $(function() { {% if config.SERVER_BASED_SEARCH %} - {% else %} + {% elif config.DISABLE_INDEX or not config.HTML_DYNAMIC_MENUS %} {% endif %} {% endif %} @@ -72,6 +59,9 @@ $(function() { {% endblock %} +{% if config.DISABLE_INDEX and config.FULL_SIDEBAR %} +
+{% endif %}
{% block titlearea %} {% if config.PROJECT_NAME or config.PROJECT_BRIEF or config.PROJECT_LOGO or config.DISABLE_INDEX and config.SEARCHENGINE %} @@ -82,7 +72,7 @@ $(function() { {% if config.PROJECT_LOGO %} Logo {% endif %} - + {% if config.PROJECT_NAME %}
{{ config.PROJECT_NAME }} {% if config.PROJECT_NUMBER %} @@ -95,7 +85,13 @@ $(function() { {% endif %} {% if config.DISABLE_INDEX and config.SEARCHENGINE %}{# search box is part of title area #} + {% if config.GENERATE_TREEVIEW and config.FULL_SIDEBAR %}{# search box separate row #} + + + + {% else %} + {% endif %} {% if config.SERVER_BASED_SEARCH %}
@@ -139,27 +135,45 @@ $(function() { {% block search %} {% if config.SEARCHENGINE %} {% endif %} {% endblock %} {% block tabs %} -{% if not config.DISABLE_INDEX %} +{% if config.HTML_DYNAMIC_MENUS %} + + + {% endif %} + +{% if not config.DISABLE_INDEX and not config.HTML_DYNAMIC_MENUS %} +{% include 'htmltabs.tpl' %} +{% endif %} +
+ {% endblock %} {% block navpath %} {% endblock %} - -
{% block splitbar %} {% if config.GENERATE_TREEVIEW %} +{% if not config.DISABLE_INDEX or not config.FULL_SIDEBAR %}
+{% endif %}
@@ -181,13 +195,15 @@ $(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix {% block searchInfo %} {% if config.SEARCHENGINE and not config.SERVER_BASED_SEARCH %} -
-
{% endif %} @@ -195,20 +211,22 @@ $(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix
{% block title %} -
{{ page.title }}
+
+
{{ page.title }}
{% endblock %} -
+
{% block content %} {% endblock %} {% block endsplitbar %} {% if config.GENERATE_TREEVIEW %} -
+
{% endif %} {% endblock %} {% block footer %} + {% if config.GENERATE_TREEVIEW %} {% else %} +{% if config.HTML_TIMESTAMP %}{{ tr.generatedAt:doxygen.date,config.PROJECT_NAME }}{% else %}{{ tr.generatedBy }}{% endif %} doxygen {{ doxygen.version }} + {% endif %} diff --git a/templates/html/htmlclass.tpl b/templates/html/htmlclass.tpl index 9a2b494..d5175af 100644 --- a/templates/html/htmlclass.tpl +++ b/templates/html/htmlclass.tpl @@ -429,7 +429,7 @@ {{ compound.generatedFromFiles }} {% endif %} -
+
{% endblock %} diff --git a/templates/html/htmlclasses.tpl b/templates/html/htmlclasses.tpl index c00ce32..372d72d 100644 --- a/templates/html/htmlclasses.tpl +++ b/templates/html/htmlclasses.tpl @@ -1,9 +1,6 @@ {% extend 'htmlbase.tpl' %} {% block content %}
-
-{% indexentry nav name=tr.classIndex file=page.fileName anchor='' isReference=False %} -
{% with index=classIndex.list|alphaIndex:'name' %} {# quick index at top #}
@@ -15,32 +12,20 @@ {% endfor %}
{# multi column index #} -
+
{% for section in index %} -
    +
    {% for cls in section.items %} -
  • - - {% if forloop.first %} - -   {{ section.letter }}  
    - {% endif %} - {% with obj=cls text=cls.name %} - {% include 'htmlobjlink.tpl' %} - {% endwith %} -
    -
  • + {% if forloop.first %} +
    {{ section.letter }}
    + {% endif %} +
    + {% with obj=cls text=cls.name %} + {% include 'htmlobjlink.tpl' %} + {% endwith %} +
    {% endfor %} -
- {% endfor %} -
- {# quick index at bottom #} -
- {% for section in index %} - {{ section.letter }} - {% if not forloop.last %} -  |  - {% endif %} + {% endfor %}
{% endwith %} diff --git a/templates/html/htmljsmenudata.tpl b/templates/html/htmljsmenudata.tpl index 3db8bd4..e795918 100644 --- a/templates/html/htmljsmenudata.tpl +++ b/templates/html/htmljsmenudata.tpl @@ -1,39 +1,40 @@ /* - @licstart The following is the entire license notice for the - JavaScript code in this file. + @licstart The following is the entire license notice for the JavaScript code in this file. - Copyright (C) 1997-2017 by Dimitri van Heesch + The MIT License (MIT) - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + Copyright (C) 1997-2020 by Dimitri van Heesch - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + 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: - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. - @licend The above is the entire license notice - for the JavaScript code in this file - */ + 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 +*/ var menudata={children:[ -{text:'{{ tr.mainPage }}',url:'index{{ config.HTML_FILE_EXTENSION }}'} +{text:"{{ tr.mainPage }}",url:"index{{ config.HTML_FILE_EXTENSION }}"} {% if pageTree.tree %} -,{text:'{{ tr.pages }}',url:'pages{{ config.HTML_FILE_EXTENSION }}'} +,{text:"{{ tr.pages }}",url:"pages{{ config.HTML_FILE_EXTENSION }}"} {% endif %} {% if moduleTree.tree %} -,{text:'{{ tr.modules }}',url:'modules{{ config.HTML_FILE_EXTENSION }}'} +,{text:"{{ tr.modules }}",url:"modules{{ config.HTML_FILE_EXTENSION }}"} {% endif %} {% if namespaceList %} -,{text:'{{ tr.namespaces }}',url:'namespaces{{ config.HTML_FILE_EXTENSION }}',children:[ - {text:'{{ tr.namespaceList }}',url:'namespaces{{ config.HTML_FILE_EXTENSION }}'} +,{text:"{{ tr.namespaces }}",url:'namespaces{{ config.HTML_FILE_EXTENSION }}",children:[ + {text:"{{ tr.namespaceList }}",url:'namespaces{{ config.HTML_FILE_EXTENSION }}"} {% if namespaceMembersIndex.all %} -,{text:'{{ tr.namespaceMembers }}',url:'namespacemembers{{ config.HTML_FILE_EXTENSION }}',children:[ +,{text:"{{ tr.namespaceMembers }}",url:'namespacemembers{{ config.HTML_FILE_EXTENSION }}",children:[ {% with page=namespaceMembersIndex %} {% include 'htmljsmenumembersdata.tpl' %} {% endwith %} @@ -42,13 +43,14 @@ var menudata={children:[ ]} {% endif %} {% if classList %} -,{text:'{{ tr.classes }}',url:'annotated{{ config.HTML_FILE_EXTENSION }}',children:[ - {text:'{{ tr.classList }}',url:'annotated{{ config.HTML_FILE_EXTENSION }}'} +,{text:"{{ tr.classes }}",url:"annotated{{ config.HTML_FILE_EXTENSION }}",children:[ + {text:"{{ tr.classList }}",url:"annotated{{ config.HTML_FILE_EXTENSION }}"} +,{text:"{{ tr.classIndex }}",url:"classes{{ config.HTML_FILE_EXTENSION }}"} {% if classHierarchy.tree %} -,{text:'{{ tr.classHierarchy }}',url:'hierarchy{{ config.HTML_FILE_EXTENSION }}'} +,{text:"{{ tr.classHierarchy }}",url:"hierarchy{{ config.HTML_FILE_EXTENSION }}"} {% endif %} {% if classMembersIndex.all %} -,{text:'{{ tr.classMembers }}',url:'functions{{ config.HTML_FILE_EXTENSION }}',children:[ +,{text:"{{ tr.classMembers }}",url:"functions{{ config.HTML_FILE_EXTENSION }}",children:[ {% with page=classMembersIndex %} {% include 'htmljsmenumembersdata.tpl' %} {% endwith %} @@ -57,10 +59,10 @@ var menudata={children:[ ]} {% endif %} {% if fileList %} -,{text:'{{ tr.files }}',url:'files{{ config.HTML_FILE_EXTENSION }}',children[ - {text:'{{ tr.fileList }}',url:'files{{ config.HTML_FILE_EXTENSION }}'} +,{text:"{{ tr.files }}",url:"files{{ config.HTML_FILE_EXTENSION }}",children:[ + {text:"{{ tr.fileList }}",url:"files{{ config.HTML_FILE_EXTENSION }}"} {% if globalsIndex.all %} -,{text:'{{ tr.fileMembers }}',url'globals{{ config.HTML_FILE_EXTENSION }}',children:[ +,{text:"{{ tr.fileMembers }}",url:"globals{{ config.HTML_FILE_EXTENSION }}",children:[ {% with page=globalsIndex %} {% include 'htmljsmenumembersdata.tpl' %} {% endwith %} @@ -69,6 +71,6 @@ var menudata={children:[ ]} {% endif %} {% if exampleTree.tree %} -,{text:'{{ tr.examples }}',url:'examples{{ config.HTML_FILE_EXTENSION }}'} +,{text:"{{ tr.examples }}",url:"examples{{ config.HTML_FILE_EXTENSION }}"} {% endif %} ]} diff --git a/templates/html/htmljsmenuletterdata.tpl b/templates/html/htmljsmenuletterdata.tpl index ded3402..e1c5679 100644 --- a/templates/html/htmljsmenuletterdata.tpl +++ b/templates/html/htmljsmenuletterdata.tpl @@ -1,10 +1,19 @@ {# inputs: page, list, section, text #} -{text:'{{ text }}',url:'{{ page.fileName }}{{ section }}{{ config.HTML_FILE_EXTENSION }}' -{% if list|length>maxItemsForMultiPageList %} +{text:"{{ text }}",url:"{{ page.fileName }}{{ section }}{{ config.HTML_FILE_EXTENSION }}" +{% if list|length>maxItemsForFlatList %} ,children:[ {% with index=list|alphaIndex:'name' %} {% for sect in index %} - {text:'{{ sect.letter }}',url:'{{ page.fileName }}{{ section }}_{{ sect.label }}{{ config.HTML_FILE_EXTENSION }}'}{% if not forloop.last %},{% endif %} + {% spaceless %} + {text:"{{ sect.letter }}",url:" + {% if list|length<=maxItemsForMultiPageList %} + {{ page.fileName }}{{ section }}{{ config.HTML_FILE_EXTENSION }}#index_{{ sect.label }}" + {% else %} + {{ page.fileName }}{{ section }}_{{ sect.label }}{{ config.HTML_FILE_EXTENSION }}" + {% endif %} + } + {% endspaceless %} + {% if not forloop.last %},{% endif %} {% endfor %} {% endwith %} ] diff --git a/templates/html/htmljsnavtree.tpl b/templates/html/htmljsnavtree.tpl index 947b980..3d11175 100644 --- a/templates/html/htmljsnavtree.tpl +++ b/templates/html/htmljsnavtree.tpl @@ -1,3 +1,27 @@ +/* + @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 +*/ var NAVTREE = [ {% recursetree index.nav %} diff --git a/templates/html/htmljssearchdata.tpl b/templates/html/htmljssearchdata.tpl index 802795e..5146bae 100644 --- a/templates/html/htmljssearchdata.tpl +++ b/templates/html/htmljssearchdata.tpl @@ -2,30 +2,21 @@ var indexSectionsWithContent = { {% set count=0 %} -{% for idx in searchIndices %} - {% if idx.symbolIndices %} - {{ count }}:"{% for si in idx.symbolIndices %}{{ si.letter }}{% endfor %}"{%if not forloop.last %},{% endif %} - {% set count=count+1 %} - {% endif %} -{% endfor %} +{% for idx in searchIndices %}{% if idx.symbolIndices %}{% if count>0 %}, +{% endif %} {{ count }}:"{% for si in idx.symbolIndices %}{{ si.letter }}{% endfor %}"{% set count=count+1 %}{% endif %}{% endfor %} }; + var indexSectionNames = { {% set count=0 %} -{% for idx in searchIndices %} - {% if idx.symbolIndices %} - {{ count }}:"{{ idx.name }}"{% if not forloop.last %},{% endif %} - {% set count=count+1 %} - {% endif %} -{% endfor %} +{% for idx in searchIndices %}{% if idx.symbolIndices %}{% if count>0 %}, +{% endif %} {{ count }}:"{{ idx.name }}"{% set count=count+1 %}{% endif %}{% endfor %} }; + var indexSectionLabels = { {% set count=0 %} -{% for idx in searchIndices %} - {% if idx.symbolIndices %} - {{ count }}:"{{ idx.text }}"{% if not forloop.last %},{% endif %} - {% set count=count+1 %} - {% endif %} -{% endfor %} +{% for idx in searchIndices %}{% if idx.symbolIndices %}{% if count>0 %}, +{% endif %} {{ count }}:"{{ idx.text }}"{% set count=count+1 %}{% endif %}{% endfor %} }; + diff --git a/templates/html/htmljssearchindex.tpl b/templates/html/htmljssearchindex.tpl index a16fa4f..b23e19e 100644 --- a/templates/html/htmljssearchindex.tpl +++ b/templates/html/htmljssearchindex.tpl @@ -1,15 +1,13 @@ {# input: si symbolIndex #} var searchData = [ -{% for group in si.symbolGroups %}['{{ group.id }}',['{{ group.name }}', -{% for sym in group.symbols %} -{% spaceless %} -['{{ sym.relPath }}{{ sym.fileName }}{{ config.HTML_FILE_EXTENSION }}{% if sym.anchor %}#{{ sym.anchor }}{% endif %}', +{% for group in si.symbolGroups %} ['{{ group.id }}_{{ symbolCount }}',['{{ group.name }}',{% spaceless %}{% for sym in group.symbols %}['{{ sym.relPath }}{{ sym.fileName }}{{ config.HTML_FILE_EXTENSION }}{% if sym.anchor %}#{{ sym.anchor }}{% endif %}', {% if not config.EXT_LINKS_IN_WINDOW %}1{% else %}0{% endif %}, -'{{ sym.scope|nowrap }}'] -{% endspaceless %} +'{{ sym.scope|nowrap|e }}'] {% if not forloop.last %},{% endif %} {% endfor %} +{% update symbolCount=symbolCount+1 %} +{% endspaceless %} ]]{% if not forloop.last %},{% endif %} {% endfor %} ]; diff --git a/templates/html/htmllayout.tpl b/templates/html/htmllayout.tpl index b79f835..736a624 100644 --- a/templates/html/htmllayout.tpl +++ b/templates/html/htmllayout.tpl @@ -3,9 +3,16 @@ {# ---- copy fixed resources to the output ----- #} {% resource 'doxygen.css' %} -{% resource 'tabs.css' %} +{% if config.HTML_DYNAMIC_MENUS %} + {% resource 'tabs.css' %} +{% else %} + {% resource 'fixed_tabs.css' as 'tabs.css' %} +{% endif %} {% resource 'jquery.js' %} -{% resource 'dynsections.js %} +{% resource 'dynsections.js' %} +{% if config.SOURCE_BROWSER and config.SOURCE_TOOLTIPS %} +{% resource 'dynsections_tooltips.js' append 'dynsections.js' %} +{% endif %} {% resource 'tab_a.lum' %} {% resource 'tab_b.lum' %} {% resource 'tab_h.lum' %} @@ -37,10 +44,19 @@ {% resource 'search_m.png' as 'search/search_m.png' %} {% resource 'search_r.png' as 'search/search_r.png' %} {% if config.DISABLE_INDEX %} - {% resource 'search_noidx.css' as 'search/search.css' %} + {% if config.GENERATE_TREEVIEW and config.FULL_SIDEBAR %} + {% resource 'search_sidebar.css' as 'search/search.css' %} + {% else %} + {% resource 'search_nomenu.css' as 'search/search.css' %} + {% endif %} {% else %} - {% resource 'search.css' as 'search/search.css' %} + {% if not config.HTML_DYNAMIC_MENUS %} + {% resource 'search_fixedtabs.css' as 'search/search.css' %} + {% else %} + {% resource 'search.css' as 'search/search.css' %} + {% endif %} {% endif %} +{% resource 'search_common.css' append 'search/search.css' %} {% if config.SERVER_BASED_SEARCH %} {# server side search resources #} @@ -56,7 +72,9 @@ {% endif %} {# interactive SVGs #} -{% resource 'svgpan.js' %} +{% if config.INTERACTIVE_SVG %} + {% resource 'svgpan.js' %} +{% endif %} {# -------------------------------------------------- #} @@ -68,7 +86,11 @@ {% set page_postfix='' %} {# open the global navigation index #} -{% indexentry nav name=tr.mainPage file='index' anchor='' isReference=False %} +{% if config.PROJECT_NAME %} + {% indexentry nav name=config.PROJECT_NAME file='index' anchor='' isReference=False %} +{% else %} + {% indexentry nav name=tr.mainPage file='index' anchor='' isReference=False %} +{% endif %} {% opensubindex nav %} {# ----------- HTML DOCUMENTATION PAGES ------------ #} @@ -180,7 +202,7 @@ {# --- classes --- #} {% if classList %} - {% indexentry nav name=tr.classes file='' anchor='' isReference=False %} + {% indexentry nav name=tr.classes file='annotated'|append:config.HTML_FILE_EXTENSION anchor='' isReference=False %} {% opensubindex nav %} {# write the annotated class list #} @@ -256,6 +278,7 @@ {# write search data #} {% if config.SEARCHENGINE and not config.SERVER_BASED_SEARCH %} {% create 'search/searchdata.js' from 'htmljssearchdata.tpl' %} + {% set symbolCount=0 %} {% for idx in searchIndices %} {% for si in idx.symbolIndices %} {% with baseName=si.name|append:'_'|append:forloop.counter0 %} diff --git a/templates/html/htmlmemberindex.tpl b/templates/html/htmlmemberindex.tpl index 216dd31..7de92b9 100644 --- a/templates/html/htmlmemberindex.tpl +++ b/templates/html/htmlmemberindex.tpl @@ -7,24 +7,23 @@ {% for section in index %} {% if not singleList or letter=='' or section.letter==letter %} {% if not singleList %} -

- {{ section.letter }} -

+

- {{ section.letter }} -

    {% endif %} {% for nameList in section.items|groupBy:'name' %} - {% spaceless %} {% for item in nameList|listsort:'{{item.file.name}}' %} {% if forloop.first %} -
  • {{ item.name }}{% if (item.isFunction or item.isSignal or item.isSlot) and not item.isObjCMethod %}(){% endif %} :  +
  • {{ item.name }}{% if (item.isFunction or item.isSignal or item.isSlot) and not item.isObjCMethod %}(){% endif %} : {% endif %} + {% spaceless %} {% with obj=item scope=item|get:scope text=scope.name %} {% include 'htmlobjlink.tpl' %} {% endwith %} - {% if not forloop.last %},  - {% else %} -
  • + {% endspaceless %} + {% if not forloop.last %}, + {% else %} {% endif %} {% endfor %} - {% endspaceless %} {% endfor %} {% if not singleList %}
diff --git a/templates/html/htmlmemdecl.tpl b/templates/html/htmlmemdecl.tpl index c7894d8..4f859f7 100644 --- a/templates/html/htmlmemdecl.tpl +++ b/templates/html/htmlmemdecl.tpl @@ -64,7 +64,7 @@ {% spaceless %} template< {% for targ in member.templateArgs %} - {{ targ.type }} {{ targ.name }}{% if targ.defVal %} = {{ targ.defval }}{% endif %}{% if not forloop.last %}, {% endif %} + {{ targ.type }} {{ targ.name }}{% if targ.defVal %} = {{ targ.defVal }}{% endif %}{% if not forloop.last %}, {% endif %} {% endfor %} {% endspaceless %} > diff --git a/templates/html/htmlpage.tpl b/templates/html/htmlpage.tpl index 7547ed5..449f601 100644 --- a/templates/html/htmlpage.tpl +++ b/templates/html/htmlpage.tpl @@ -50,7 +50,7 @@ {% endif %} -{% if exampleList.items %} +{% if exampleList %}
  • {{ tr.examples }} {% endif %} diff --git a/templates/html/htmlsearchresult.tpl b/templates/html/htmlsearchresult.tpl index 139faf2..9174196 100644 --- a/templates/html/htmlsearchresult.tpl +++ b/templates/html/htmlsearchresult.tpl @@ -1,6 +1,7 @@ {# input: baseName #} - + + @@ -12,14 +13,14 @@
    {{ tr.loading }}
    {{ tr.searching }}
    {{ tr.noMatches }}