diff options
47 files changed, 1237 insertions, 403 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 9f2fe12..c3a3160 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -2893,7 +2893,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const first = false; } ol.writeString(" <tr"); - if ((idx&1)==0) ol.writeString(" class=\"even\""); + if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\""); idx++; ol.writeString("><td class=\"entry\">"); if (cd->isObjectiveC()) @@ -2951,7 +2951,7 @@ void ClassDefImpl::writeMemberList(OutputList &ol) const first = false; } ol.writeString(" <tr bgcolor=\"#f0f0f0\""); - if ((idx&1)==0) ol.writeString(" class=\"even\""); + if ((idx&1)==0) ol.writeString(" class=\"even\""); else ol.writeString(" class=\"odd\""); idx++; ol.writeString("><td class=\"entry\">"); if (cd->isObjectiveC()) diff --git a/src/commentcnv.l b/src/commentcnv.l index d331fa4..aaf1162 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -134,6 +134,7 @@ MAILADR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z %x SkipChar %x SComment %x CComment +%x CNComment %x Verbatim %x VerbatimCode %x ReadLine @@ -346,7 +347,10 @@ SLASHopt [/]* yyextra->nestingCount=1; clearCommentStack(yyscanner); /* to be on the save side */ copyToOutput(yyscanner,yytext,(int)yyleng); - BEGIN(CComment); + if (yyextra->specialComment) + BEGIN(CComment); + else + BEGIN(CNComment); yyextra->commentStack.push(yyextra->lineNr); } <Scan>"#"("#")? { @@ -402,8 +406,8 @@ SLASHopt [/]* yyextra->commentStack.push(yyextra->lineNr); } } -<CComment,ReadLine>{MAILADR} | -<CComment,ReadLine>"<"{MAILADR}">" { // Mail address, to prevent seeing e.g x@code-factory.org as start of a code block +<CComment,CNComment,ReadLine>{MAILADR} | +<CComment,CNComment,ReadLine>"<"{MAILADR}">" { // Mail address, to prevent seeing e.g x@code-factory.org as start of a code block copyToOutput(yyscanner,yytext,(int)yyleng); } <CComment>"{@code"/[ \t\n] { @@ -618,10 +622,10 @@ SLASHopt [/]* copyToOutput(yyscanner,yytext,(int)yyleng); } -<CComment>[^ `~<\\!@*\n{\"\/]* { /* anything that is not a '*' or command */ +<CComment,CNComment>[^ `~<\\!@*\n{\"\/]* { /* anything that is not a '*' or command */ copyToOutput(yyscanner,yytext,(int)yyleng); } -<CComment>"*"+[^*\/\\@\n{\"]* { /* stars without slashes */ +<CComment,CNComment>"*"+[^*\/\\@\n{\"]* { /* stars without slashes */ copyToOutput(yyscanner,yytext,(int)yyleng); } <CComment>"\"\"\"" { /* end of Python docstring */ @@ -637,7 +641,7 @@ SLASHopt [/]* BEGIN(Scan); } } -<CComment>\n { /* new line in comment */ +<CComment,CNComment>\n { /* new line in comment */ copyToOutput(yyscanner,yytext,(int)yyleng); /* in case of Fortran always end of comment */ if (yyextra->lang==SrcLangExt_Fortran) @@ -645,7 +649,7 @@ SLASHopt [/]* BEGIN(Scan); } } -<CComment>"/"+"*" { /* nested C comment */ +<CComment,CNComment>"/"+"*" { /* nested C comment */ if (yyextra->lang==SrcLangExt_Python || yyextra->lang==SrcLangExt_Markdown) { @@ -655,7 +659,7 @@ SLASHopt [/]* yyextra->commentStack.push(yyextra->lineNr); copyToOutput(yyscanner,yytext,(int)yyleng); } -<CComment>"*"+"/" { /* end of C comment */ +<CComment,CNComment>"*"+"/" { /* end of C comment */ if (yyextra->lang==SrcLangExt_Python || yyextra->lang==SrcLangExt_Markdown) { @@ -676,8 +680,8 @@ SLASHopt [/]* } } } - /* Python an VHDL share CComment, so special attention for ending comments is required */ -<CComment>"\n"/[ \t]*"#" { + /* Python an VHDL share CComment,CNComment, so special attention for ending comments is required */ +<CComment,CNComment>"\n"/[ \t]*"#" { if (yyextra->lang!=SrcLangExt_VHDL) { REJECT; @@ -696,7 +700,7 @@ SLASHopt [/]* } } } -<CComment>"\n"/[ \t]*"-" { +<CComment,CNComment>"\n"/[ \t]*"-" { if (yyextra->lang!=SrcLangExt_Python || yyextra->pythonDocString) { REJECT; @@ -707,7 +711,7 @@ SLASHopt [/]* BEGIN(Scan); } } -<CComment>"\n"/[ \t]*[^ \t#\-] { +<CComment,CNComment>"\n"/[ \t]*[^ \t#\-] { if (yyextra->lang==SrcLangExt_Python) { if (yyextra->pythonDocString) @@ -739,18 +743,18 @@ SLASHopt [/]* } } /* removed for bug 674842 (bug was introduced in rev 768) -<CComment>"'" { +<CComment,CNComment>"'" { yyextra->charContext = YY_START; copyToOutput(yyscanner,yytext,(int)yyleng); BEGIN(SkipChar); } -<CComment>"\"" { +<CComment,CNComment>"\"" { yyextra->stringContext = YY_START; copyToOutput(yyscanner,yytext,(int)yyleng); BEGIN(SkipString); } */ -<CComment>. { +<CComment,CNComment>. { copyToOutput(yyscanner,yytext,(int)yyleng); } <SComment>^[ \t]*{CPPC}"/"{SLASHopt}/\n { @@ -838,7 +842,7 @@ SLASHopt [/]* copyToOutput(yyscanner,yytext,(int)yyleng); BEGIN(yyextra->readLineCtx); } -<CComment,ReadLine>[\\@][\\@][~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command +<CComment,CNComment,ReadLine>[\\@][\\@][~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command copyToOutput(yyscanner,yytext,(int)yyleng); } <CComment,ReadLine>[\\@]"cond"/[^a-z_A-Z0-9] { // conditional section diff --git a/src/configgen.py b/src/configgen.py index 5c4c39a..b7736c4 100755 --- a/src/configgen.py +++ b/src/configgen.py @@ -696,34 +696,35 @@ def main(): print(" static ConfigValues &instance() { static ConfigValues theInstance; return theInstance; }") for n in elem.childNodes: if n.nodeType == Node.ELEMENT_NODE: - if (n.nodeName == "group"): + if n.nodeName == "group": parseGroupMapGetter(n) for n in elem.childNodes: if n.nodeType == Node.ELEMENT_NODE: - if (n.nodeName == "group"): + if n.nodeName == "group": parseGroupMapSetter(n) print(" void init();") - print(" struct Info"); - print(" {"); - print(" enum Type { Bool, Int, String, List, Unknown };"); - print(" Info(Type t,bool ConfigValues::*b) : type(t), value(b) {}"); - print(" Info(Type t,int ConfigValues::*i) : type(t), value(i) {}"); - print(" Info(Type t,QCString ConfigValues::*s) : type(t), value(s) {}"); - print(" Info(Type t,StringVector ConfigValues::*l) : type(t), value(l) {}"); - print(" Type type;"); - print(" union Item"); - print(" {"); - print(" Item(bool ConfigValues::*v) : b(v) {}"); - print(" Item(int ConfigValues::*v) : i(v) {}"); - print(" Item(QCString ConfigValues::*v) : s(v) {}"); - print(" Item(StringVector ConfigValues::*v) : l(v) {}"); - print(" bool ConfigValues::*b;"); - print(" int ConfigValues::*i;"); - print(" QCString ConfigValues::*s;"); - print(" StringVector ConfigValues::*l;"); - print(" } value;"); - print(" };"); - print(" const Info *get(const QCString &tag) const;"); + print(" StringVector fields() const;") + print(" struct Info") + print(" {") + print(" enum Type { Bool, Int, String, List, Unknown };") + print(" Info(Type t,bool ConfigValues::*b) : type(t), value(b) {}") + print(" Info(Type t,int ConfigValues::*i) : type(t), value(i) {}") + print(" Info(Type t,QCString ConfigValues::*s) : type(t), value(s) {}") + print(" Info(Type t,StringVector ConfigValues::*l) : type(t), value(l) {}") + print(" Type type;") + print(" union Item") + print(" {") + print(" Item(bool ConfigValues::*v) : b(v) {}") + print(" Item(int ConfigValues::*v) : i(v) {}") + print(" Item(QCString ConfigValues::*v) : s(v) {}") + print(" Item(StringVector ConfigValues::*v) : l(v) {}") + print(" bool ConfigValues::*b;") + print(" int ConfigValues::*i;") + print(" QCString ConfigValues::*s;") + print(" StringVector ConfigValues::*l;") + print(" } value;") + print(" };") + print(" const Info *get(const QCString &tag) const;") print(" private:") for n in elem.childNodes: if n.nodeType == Node.ELEMENT_NODE: @@ -765,6 +766,26 @@ def main(): if (n.nodeName == "group"): parseGroupInit(n) print("}") + print("") + print("StringVector ConfigValues::fields() const") + print("{") + print(" return {"); + first=True + for n in elem.childNodes: + if n.nodeType == Node.ELEMENT_NODE: + if (n.nodeName == "group"): + for c in n.childNodes: + if c.nodeType == Node.ELEMENT_NODE: + name = c.getAttribute('id') + type = c.getAttribute('type') + if type!='obsolete': + if not first: + print(",") + first=False + sys.stdout.write(' "'+name+'"') + print("") + print(" };") + print("}") elif (sys.argv[1] == "-cpp"): print("/* WARNING: This file is generated!") print(" * Do not edit this file, but edit config.xml instead and run") diff --git a/src/context.cpp b/src/context.cpp index 2ae62a0..7d1c6a7 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -279,6 +279,17 @@ class PropertyMapper return it!=m_map.end() ? (*it->second)(obj) : TemplateVariant(); } + StringVector fields() const + { + StringVector result; + for (const auto &kv : m_map) + { + result.push_back(kv.first); + } + std::sort(result.begin(),result.end()); + return result; + } + private: std::unordered_map<std::string,std::unique_ptr<PropertyFuncIntf>> m_map; }; @@ -364,6 +375,11 @@ TemplateVariant ConfigContext::get(const QCString &name) const return result; } +StringVector ConfigContext::fields() const +{ + return ConfigValues::instance().fields(); +} + //------------------------------------------------------------------------ //%% struct Doxygen: global information @@ -401,6 +417,10 @@ class DoxygenContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } private: struct Cachable { @@ -430,6 +450,11 @@ TemplateVariant DoxygenContext::get(const QCString &n) const return p->get(n); } +StringVector DoxygenContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct Translator: translation methods @@ -1019,6 +1044,10 @@ class TranslateContext::Private { return HtmlHelp::getLanguageString(); } + TemplateVariant code() const + { + return theTranslator->trCode(); + } Private() { static bool init=FALSE; @@ -1214,6 +1243,8 @@ class TranslateContext::Private s_inst.addProperty("examplesDescription",&Private::examplesDescription); //%% string langstring s_inst.addProperty("langString", &Private::langString); + //%% string code + s_inst.addProperty("code", &Private::code); init=TRUE; } @@ -1227,6 +1258,10 @@ class TranslateContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } private: bool m_javaOpt; bool m_fortranOpt; @@ -1253,6 +1288,11 @@ TemplateVariant TranslateContext::get(const QCString &n) const return p->get(n); } +StringVector TranslateContext::fields() const +{ + return p->fields(); +} + static TemplateVariant parseDoc(const Definition *def,const QCString &file,int line, const QCString &relPath,const QCString &docStr,bool isBrief) { @@ -1698,6 +1738,10 @@ class IncludeInfoContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant isLocal() const { bool isIDLorJava = m_lang==SrcLangExt_IDL || m_lang==SrcLangExt_Java; @@ -1749,6 +1793,12 @@ TemplateVariant IncludeInfoContext::get(const QCString &n) const { return p->get(n); } + +StringVector IncludeInfoContext::fields() const +{ + return p->fields(); +} + //%% } //------------------------------------------------------------------------ @@ -1881,6 +1931,10 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant title() const { return TemplateVariant(m_classDef->title()); @@ -2652,6 +2706,11 @@ TemplateVariant ClassContext::get(const QCString &n) const return p->get(n); } +StringVector ClassContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct Namespace(Symbol): namespace information @@ -2698,6 +2757,10 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant title() const { return TemplateVariant(m_namespaceDef->title()); @@ -2943,6 +3006,11 @@ TemplateVariant NamespaceContext::get(const QCString &n) const return p->get(n); } +StringVector NamespaceContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct File(Symbol): file information @@ -2999,6 +3067,10 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant title() const { return m_fileDef->title(); @@ -3395,6 +3467,11 @@ TemplateVariant FileContext::get(const QCString &n) const return p->get(n); } +StringVector FileContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct Dir(Symbol): directory information @@ -3427,6 +3504,10 @@ class DirContext::Private : public DefinitionContext<DirContext::Private> { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant title() const { return TemplateVariant(m_dirDef->shortTitle()); @@ -3584,6 +3665,11 @@ TemplateVariant DirContext::get(const QCString &n) const return p->get(n); } +StringVector DirContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct Page(Symbol): page information @@ -3612,6 +3698,10 @@ class PageContext::Private : public DefinitionContext<PageContext::Private> { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant title() const { if (m_isMainPage) @@ -3717,6 +3807,11 @@ TemplateVariant PageContext::get(const QCString &n) const return p->get(n); } +StringVector PageContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ class TextGeneratorHtml : public TextGeneratorIntf @@ -4063,6 +4158,10 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private> { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant fieldType() const { return createLinkedText(m_memberDef,relPathAsString(),m_memberDef->fieldType()); @@ -5164,6 +5263,10 @@ TemplateVariant MemberContext::get(const QCString &n) const return p->get(n); } +StringVector MemberContext::fields() const +{ + return p->fields(); +} //------------------------------------------------------------------------ @@ -5229,6 +5332,10 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant title() const { return TemplateVariant(m_groupDef->groupTitle()); @@ -5675,6 +5782,11 @@ TemplateVariant ModuleContext::get(const QCString &n) const return p->get(n); } +StringVector ModuleContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list ClassList[Class] : list of classes @@ -5753,6 +5865,10 @@ class ClassIndexContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant list() const { if (!m_cache.classes) @@ -5840,6 +5956,11 @@ TemplateVariant ClassIndexContext::get(const QCString &n) const return p->get(n); } +StringVector ClassIndexContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ static int computeMaxDepth(const TemplateListIntf *list) @@ -5945,6 +6066,10 @@ class ClassHierarchyContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant tree() const { return m_classTree.get(); @@ -6053,6 +6178,11 @@ TemplateVariant ClassHierarchyContext::get(const QCString &name) const return p->get(name); } +StringVector ClassHierarchyContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct NestingNode: node is a nesting relation tree @@ -6066,6 +6196,7 @@ class NestingNodeContext::Private : m_parent(parent), m_def(d), m_level(level), m_index(index) { m_children.reset(NestingContext::alloc(thisNode,level+1)); + m_members.reset(NestingContext::alloc(thisNode,level+1)); static bool init=FALSE; if (!init) { @@ -6073,6 +6204,8 @@ class NestingNodeContext::Private s_inst.addProperty("is_leaf_node",&Private::isLeafNode); //%% Nesting children: list of nested classes/namespaces s_inst.addProperty("children",&Private::children); + //%% Nesting children: list of nested classes/namespaces + s_inst.addProperty("members",&Private::members); //%% [optional] Class class: class info (if this node represents a class) s_inst.addProperty("class",&Private::getClass); //%% [optional] Namespace namespace: namespace info (if this node represents a namespace) @@ -6085,6 +6218,8 @@ class NestingNodeContext::Private s_inst.addProperty("page",&Private::getPage); //%% [optional] Module module: module info (if this node represents a module) s_inst.addProperty("module",&Private::getModule); + //%% [optional] Member member: member info (if this node represents a member) + s_inst.addProperty("member",&Private::getMember); //%% int id s_inst.addProperty("id",&Private::id); //%% string level @@ -6107,11 +6242,16 @@ class NestingNodeContext::Private addDirFiles(visitedClasses); addPages(visitedClasses); addModules(visitedClasses); + addMembers(visitedClasses); } TemplateVariant get(const QCString &n) const { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant isLeafNode() const { return m_children->count()==0; @@ -6120,6 +6260,10 @@ class NestingNodeContext::Private { return m_children.get(); } + TemplateVariant members() const + { + return m_members.get(); + } TemplateVariant getClass() const { if (!m_cache.classContext && m_def->definitionType()==Definition::TypeClass) @@ -6210,6 +6354,21 @@ class NestingNodeContext::Private return TemplateVariant(FALSE); } } + TemplateVariant getMember() const + { + if (!m_cache.memberContext && m_def->definitionType()==Definition::TypeMember) + { + m_cache.memberContext.reset(MemberContext::alloc(toMemberDef(m_def))); + } + if (m_cache.memberContext) + { + return m_cache.memberContext.get(); + } + else + { + return TemplateVariant(FALSE); + } + } TemplateVariant level() const { return m_level; @@ -6272,26 +6431,26 @@ class NestingNodeContext::Private void addClasses(bool inherit, bool hideSuper,ClassDefSet &visitedClasses) { const ClassDef *cd = toClassDef(m_def); - if (cd && inherit) + if (cd) { - bool hasChildren = visitedClasses.find(cd)==visitedClasses.end() && - !hideSuper && classHasVisibleChildren(cd); - if (hasChildren) + if (inherit) { - visitedClasses.insert(cd); - if (cd->getLanguage()==SrcLangExt_VHDL) + bool hasChildren = visitedClasses.find(cd)==visitedClasses.end() && + !hideSuper && classHasVisibleChildren(cd); + if (hasChildren) { - m_children->addDerivedClasses(cd->baseClasses(),false,visitedClasses); - } - else - { - m_children->addDerivedClasses(cd->subClasses(),false,visitedClasses); + visitedClasses.insert(cd); + if (cd->getLanguage()==SrcLangExt_VHDL) + { + m_children->addDerivedClasses(cd->baseClasses(),false,visitedClasses); + } + else + { + m_children->addDerivedClasses(cd->subClasses(),false,visitedClasses); + } } } - } - else - { - if (cd) + else { m_children->addClasses(cd->getClasses(),FALSE,visitedClasses); } @@ -6300,13 +6459,16 @@ class NestingNodeContext::Private void addNamespaces(bool addClasses,ClassDefSet &visitedClasses) { const NamespaceDef *nd = toNamespaceDef(m_def); - if (nd && !nd->getNamespaces().empty()) + if (nd) { - m_children->addNamespaces(nd->getNamespaces(),FALSE,addClasses,visitedClasses); - } - if (addClasses && nd) - { - m_children->addClasses(nd->getClasses(),FALSE,visitedClasses); + if (!nd->getNamespaces().empty()) + { + m_children->addNamespaces(nd->getNamespaces(),FALSE,addClasses,visitedClasses); + } + if (addClasses) + { + m_children->addClasses(nd->getClasses(),FALSE,visitedClasses); + } } } void addDirFiles(ClassDefSet &visitedClasses) @@ -6334,10 +6496,53 @@ class NestingNodeContext::Private m_children->addModules(gd->getSubGroups(),visitedClasses); } } + void addMembers(ClassDefSet &visitedClasses) + { + if (m_def->definitionType()==Definition::TypeNamespace) + { + // add namespace members + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)) + { + if (lde->kind()==LayoutDocEntry::MemberDef) + { + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); + const MemberList *ml = toNamespaceDef(m_def)->getMemberList(lmd->type); + m_members->addMembers(ml,visitedClasses); + } + } + } + else if (m_def->definitionType()==Definition::TypeClass) + { + // add class members + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) + { + if (lde->kind()==LayoutDocEntry::MemberDef) + { + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); + const MemberList *ml = toClassDef(m_def)->getMemberList(lmd->type); + m_members->addMembers(ml,visitedClasses); + } + } + } + else if (m_def->definitionType()==Definition::TypeFile) + { + // add class members + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File)) + { + if (lde->kind()==LayoutDocEntry::MemberDef) + { + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); + const MemberList *ml = toFileDef(m_def)->getMemberList(lmd->type); + m_members->addMembers(ml,visitedClasses); + } + } + } + } private: const NestingNodeContext *m_parent; const Definition *m_def; SharedPtr<NestingContext> m_children; + SharedPtr<NestingContext> m_members; int m_level; int m_index; struct Cachable @@ -6348,6 +6553,7 @@ class NestingNodeContext::Private SharedPtr<FileContext> fileContext; SharedPtr<PageContext> pageContext; SharedPtr<ModuleContext> moduleContext; + SharedPtr<MemberContext> memberContext; ScopedPtr<TemplateVariant> brief; }; mutable Cachable m_cache; @@ -6375,6 +6581,11 @@ TemplateVariant NestingNodeContext::get(const QCString &n) const return p->get(n); } +StringVector NestingNodeContext::fields() const +{ + return p->fields(); +} + QCString NestingNodeContext::id() const { return p->id().toString(); @@ -6485,7 +6696,8 @@ class NestingContext::Private : public GenericNodeListContext { if (fd->getDirDef()==0) // top level file { - append(NestingNodeContext::alloc(m_parent,fd.get(),m_index,m_level,FALSE,FALSE,FALSE,visitedClasses)); + NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,fd.get(),m_index,m_level,FALSE,FALSE,FALSE,visitedClasses); + append(nnc); m_index++; } } @@ -6495,7 +6707,8 @@ class NestingContext::Private : public GenericNodeListContext { for (const auto &fd : fList) { - append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE,visitedClasses)); + NestingNodeContext *nnc=NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE,visitedClasses); + append(nnc); m_index++; } } @@ -6605,6 +6818,21 @@ class NestingContext::Private : public GenericNodeListContext } } } + void addMembers(const MemberList *ml,ClassDefSet &visitedClasses) + { + if (ml) + { + for (const auto &md : *ml) + { + if (md->visibleInIndex()) + { + NestingNodeContext *nnc = NestingNodeContext::alloc(m_parent,md,m_index,m_level+1,TRUE,TRUE,FALSE,visitedClasses); + append(nnc); + m_index++; + } + } + } + } private: const NestingNodeContext *m_parent; @@ -6708,6 +6936,11 @@ void NestingContext::addDerivedClasses(const BaseClassList &bcl,bool hideSuper,C p->addDerivedClasses(bcl,hideSuper,visitedClasses); } +void NestingContext::addMembers(const MemberList *ml,ClassDefSet &visitedClasses) +{ + p->addMembers(ml,visitedClasses); +} + //------------------------------------------------------------------------ //%% struct ClassTree: Class nesting relations @@ -6740,6 +6973,10 @@ class ClassTreeContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant tree() const { return m_classTree.get(); @@ -6828,6 +7065,11 @@ TemplateVariant ClassTreeContext::get(const QCString &name) const return p->get(name); } +StringVector ClassTreeContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list NamespaceList[Namespace] : list of namespaces @@ -6904,6 +7146,10 @@ class NamespaceTreeContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant tree() const { return m_namespaceTree.get(); @@ -6994,6 +7240,12 @@ TemplateVariant NamespaceTreeContext::get(const QCString &name) const return p->get(name); } +StringVector NamespaceTreeContext::fields() const +{ + return p->fields(); +} + + //------------------------------------------------------------------------ //%% list FileList[File] : list of files @@ -7174,6 +7426,10 @@ class FileTreeContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant tree() const { return m_dirFileTree.get(); @@ -7249,6 +7505,11 @@ TemplateVariant FileTreeContext::get(const QCString &name) const return p->get(name); } +StringVector FileTreeContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct PageTree: tree of related pages @@ -7282,6 +7543,10 @@ class PageTreeContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant tree() const { return m_pageTree.get(); @@ -7357,6 +7622,11 @@ TemplateVariant PageTreeContext::get(const QCString &name) const return p->get(name); } +StringVector PageTreeContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list PageList[Page]: list of pages @@ -7524,6 +7794,10 @@ class ModuleTreeContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant tree() const { return m_moduleTree.get(); @@ -7599,6 +7873,11 @@ TemplateVariant ModuleTreeContext::get(const QCString &name) const return p->get(name); } +StringVector ModuleTreeContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct NavPathElem: list of examples page @@ -7624,6 +7903,10 @@ class NavPathElemContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant isLinkable() const { return m_def->isLinkable(); @@ -7693,6 +7976,10 @@ TemplateVariant NavPathElemContext::get(const QCString &name) const return p->get(name); } +StringVector NavPathElemContext::fields() const +{ + return p->fields(); +} //------------------------------------------------------------------------ @@ -7726,6 +8013,10 @@ class ExampleTreeContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant tree() const { return m_exampleTree.get(); @@ -7801,6 +8092,11 @@ TemplateVariant ExampleTreeContext::get(const QCString &name) const return p->get(name); } +StringVector ExampleTreeContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct GlobalsIndex: list of examples page @@ -7835,6 +8131,10 @@ class GlobalsIndexContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } typedef bool (MemberDef::*MemberFunc)() const; TemplateVariant getMembersFiltered(SharedPtr<TemplateList> &listRef,MemberFunc filter) const { @@ -7954,6 +8254,12 @@ TemplateVariant GlobalsIndexContext::get(const QCString &name) const return p->get(name); } +StringVector GlobalsIndexContext::fields() const +{ + return p->fields(); +} + + //------------------------------------------------------------------------ //%% struct ClassMembersIndex: list of examples page @@ -7988,6 +8294,10 @@ class ClassMembersIndexContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } typedef bool (MemberDef::*MemberFunc)() const; TemplateVariant getMembersFiltered(SharedPtr<TemplateList> &listRef,MemberFunc filter) const { @@ -8109,6 +8419,11 @@ TemplateVariant ClassMembersIndexContext::get(const QCString &name) const return p->get(name); } +StringVector ClassMembersIndexContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct NamespaceMembersIndex: list of examples page @@ -8143,6 +8458,10 @@ class NamespaceMembersIndexContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } typedef bool (MemberDef::*MemberFunc)() const; TemplateVariant getMembersFiltered(SharedPtr<TemplateList> &listRef,MemberFunc filter) const { @@ -8261,6 +8580,11 @@ TemplateVariant NamespaceMembersIndexContext::get(const QCString &name) const return p->get(name); } +StringVector NamespaceMembersIndexContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct InheritanceGraph: a connected graph representing part of the overall inheritance tree @@ -8281,6 +8605,10 @@ class InheritanceGraphContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant graph() const { TextStream t; @@ -8322,6 +8650,10 @@ TemplateVariant InheritanceGraphContext::get(const QCString &name) const return p->get(name); } +StringVector InheritanceGraphContext::fields() const +{ + return p->fields(); +} //------------------------------------------------------------------------ @@ -8344,6 +8676,10 @@ class InheritanceNodeContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant getClass() const { if (!m_classContext) @@ -8381,6 +8717,11 @@ TemplateVariant InheritanceNodeContext::get(const QCString &name) const return p->get(name); } +StringVector InheritanceNodeContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list InheritanceList[InheritanceNode] : list of inherited classes @@ -8528,6 +8869,10 @@ class MemberInfoContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant protection() const { switch (m_memberInfo->prot()) @@ -8592,6 +8937,10 @@ TemplateVariant MemberInfoContext::get(const QCString &name) const return p->get(name); } +StringVector MemberInfoContext::fields() const +{ + return p->fields(); +} //------------------------------------------------------------------------ @@ -8680,6 +9029,10 @@ class MemberGroupInfoContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant members() const { if (!m_cache.memberListContext) @@ -8764,6 +9117,11 @@ TemplateVariant MemberGroupInfoContext::get(const QCString &name) const return p->get(name); } +StringVector MemberGroupInfoContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list MemberGroupList[MemberGroupInfo] : list of member groups @@ -8854,6 +9212,10 @@ class MemberListInfoContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant members() const { if (!m_cache.memberListContext) @@ -8936,6 +9298,11 @@ TemplateVariant MemberListInfoContext::get(const QCString &name) const return p->get(name); } +StringVector MemberListInfoContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% struct InheritedMemberInfo: inherited member information @@ -8961,6 +9328,10 @@ class InheritedMemberInfoContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } virtual ~Private() { delete m_memberList; @@ -9030,6 +9401,11 @@ TemplateVariant InheritedMemberInfoContext::get(const QCString &name) const return p->get(name); } +StringVector InheritedMemberInfoContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list InheritedMemberList[InheritedMemberInfo] : list of inherited classes @@ -9193,6 +9569,10 @@ class ArgumentContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant type() const { return createLinkedText(m_def,m_relPath,m_argument.type); @@ -9271,6 +9651,11 @@ TemplateVariant ArgumentContext::get(const QCString &name) const return p->get(name); } +StringVector ArgumentContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list ArgumentList[Argument] : list of inherited classes @@ -9360,6 +9745,10 @@ class SymbolContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant fileName() const { return m_def->getOutputFileBase(); @@ -9377,61 +9766,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; } @@ -9465,6 +9875,11 @@ TemplateVariant SymbolContext::get(const QCString &name) const return p->get(name); } +StringVector SymbolContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list SymbolList[Symbol] : list of search symbols with the same name @@ -9537,6 +9952,10 @@ class SymbolGroupContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant id() const { return searchId(*m_start); @@ -9584,6 +10003,11 @@ TemplateVariant SymbolGroupContext::get(const QCString &name) const return p->get(name); } +StringVector SymbolGroupContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list SymbolGroupList[SymbolGroup] : list of search groups one per by name @@ -9600,7 +10024,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; } @@ -9664,6 +10091,10 @@ class SymbolIndexContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant name() const { return m_name; @@ -9711,6 +10142,11 @@ TemplateVariant SymbolIndexContext::get(const QCString &name) const return p->get(name); } +StringVector SymbolIndexContext::fields() const +{ + return p->fields(); +} + //------------------------------------------------------------------------ //%% list SymbolIndices[SymbolIndex] : list of search indices one per by type @@ -9775,6 +10211,10 @@ class SearchIndexContext::Private { return s_inst.get(this,n); } + StringVector fields() const + { + return s_inst.fields(); + } TemplateVariant name() const { return m_info.name; @@ -9820,6 +10260,12 @@ TemplateVariant SearchIndexContext::get(const QCString &name) const return p->get(name); } +StringVector SearchIndexContext::fields() const +{ + return p->fields(); +} + + //------------------------------------------------------------------------ //%% list SearchIndices[SearchIndex] : list of search indices one per by type diff --git a/src/context.h b/src/context.h index 1fb934e..bff4903 100644 --- a/src/context.h +++ b/src/context.h @@ -135,6 +135,7 @@ class ConfigContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -154,6 +155,7 @@ class DoxygenContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -173,6 +175,7 @@ class TranslateContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -217,6 +220,7 @@ class IncludeInfoContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -259,6 +263,7 @@ class ClassContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -278,6 +283,7 @@ class NamespaceContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -297,6 +303,7 @@ class FileContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -315,6 +322,7 @@ class DirContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -335,6 +343,7 @@ class PageContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -354,6 +363,7 @@ class MemberContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -374,6 +384,7 @@ class ModuleContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -414,6 +425,7 @@ class ClassIndexContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -434,6 +446,7 @@ class InheritanceGraphContext : public RefCountedContext, public TemplateStructI // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -454,6 +467,7 @@ class ClassInheritanceNodeContext : public RefCountedContext, public TemplateStr // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -496,6 +510,7 @@ class ClassHierarchyContext : public RefCountedContext, public TemplateStructInt // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -520,6 +535,7 @@ class NestingNodeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -562,6 +578,7 @@ class NestingContext : public RefCountedContext, public TemplateListIntf void addModules(const GroupList &modules,ClassDefSet &visitedClasses); void addClassHierarchy(const ClassLinkedMap &clLinkedMap,ClassDefSet &visitedClasses); void addDerivedClasses(const BaseClassList &bcl,bool hideSuper,ClassDefSet &visitedClasses); + void addMembers(const MemberList *ml,ClassDefSet &visitedClasses); private: NestingContext(const NestingNodeContext *parent,int level); @@ -579,6 +596,7 @@ class ClassTreeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -619,6 +637,7 @@ class NamespaceTreeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -680,6 +699,7 @@ class FileTreeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -722,6 +742,7 @@ class PageTreeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -741,6 +762,7 @@ class ModuleNodeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -784,6 +806,7 @@ class ModuleTreeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -825,6 +848,7 @@ class ExampleTreeContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -844,6 +868,7 @@ class GlobalsIndexContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -863,6 +888,7 @@ class ClassMembersIndexContext : public RefCountedContext, public TemplateStruct // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -882,6 +908,7 @@ class NamespaceMembersIndexContext : public RefCountedContext, public TemplateSt // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -901,6 +928,7 @@ class NavPathElemContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -922,6 +950,7 @@ class InheritanceNodeContext : public RefCountedContext, public TemplateStructIn // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -992,6 +1021,7 @@ class MemberGroupInfoContext : public RefCountedContext, public TemplateStructIn // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1043,6 +1073,7 @@ class MemberListInfoContext : public RefCountedContext, public TemplateStructInt // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1064,6 +1095,7 @@ class MemberInfoContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1084,6 +1116,7 @@ class InheritedMemberInfoContext : public RefCountedContext, public TemplateStru // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1148,6 +1181,7 @@ class ArgumentContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1192,6 +1226,7 @@ class SymbolContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1237,6 +1272,7 @@ class SymbolGroupContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1281,6 +1317,7 @@ class SymbolIndexContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -1323,6 +1360,7 @@ class SearchIndexContext : public RefCountedContext, public TemplateStructIntf // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 1814b51..f4354a4 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -341,7 +341,7 @@ void DirDefImpl::writeSubDirList(OutputList &ol) if (dd->hasDocumentation() || dd->getFiles().empty()) { ol.startMemberDeclaration(); - ol.startMemberItem(dd->getOutputFileBase(),0); + ol.startMemberItem(dd->anchor(),0); ol.parseText(theTranslator->trDir(FALSE,TRUE)+" "); ol.insertMemberAlign(); ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),QCString(),dd->shortName()); @@ -359,7 +359,7 @@ void DirDefImpl::writeSubDirList(OutputList &ol) ); ol.endMemberDescription(); } - ol.endMemberDeclaration(QCString(),QCString()); + ol.endMemberDeclaration(dd->anchor(),QCString()); } } @@ -390,7 +390,7 @@ void DirDefImpl::writeFileList(OutputList &ol) if (fd->hasDocumentation()) { ol.startMemberDeclaration(); - ol.startMemberItem(fd->getOutputFileBase(),0); + ol.startMemberItem(fd->anchor(),0); ol.docify(theTranslator->trFile(FALSE,TRUE)+" "); ol.insertMemberAlign(); if (fd->isLinkable()) @@ -429,7 +429,7 @@ void DirDefImpl::writeFileList(OutputList &ol) ); ol.endMemberDescription(); } - ol.endMemberDeclaration(QCString(),QCString()); + ol.endMemberDeclaration(fd->anchor(),QCString()); } } ol.endMemberList(); diff --git a/src/docparser.cpp b/src/docparser.cpp index 331355f..4e316a8 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -6771,6 +6771,7 @@ reparsetoken: } else { + m_children.push_back(std::make_unique<DocWord>(this,g_token->name)); warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unsupported symbol %s found", qPrint(g_token->name)); } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 51fcd16..d589555 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1671,6 +1671,7 @@ static void buildNamespaceList(const Entry *root) nd->setName(fullName); // change name to match docs nd->addSectionsToDefinition(root->anchors); nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); + nd->setArtificial(FALSE); // found namespace explicitly, so cannot be artificial if (nd->getLanguage()==SrcLangExt_Unknown) { nd->setLanguage(root->lang); diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index ad8782b..ee9560a 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 << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>\n"; t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>\n"; t << "<script type=\"text/javascript\">\n"; - t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; + t << "/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n"; t << "$(function() {\n"; t << " initMenu('" << relPath << "'," << (searchEngine?"true":"false") << "," @@ -2516,14 +2510,13 @@ static void writeDefaultQuickLinks(TextStream &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 << "});\n"; - t << "/* @license-end */"; + t << "/* @license-end */\n"; t << "</script>\n"; t << "<div id=\"main-nav\"></div>\n"; } @@ -2894,14 +2887,14 @@ void HtmlGenerator::startHeaderSection() void HtmlGenerator::startTitleHead(const QCString &) { - m_t << " <div class=\"headertitle\">\n"; + m_t << " <div class=\"headertitle\">"; startTitle(); } void HtmlGenerator::endTitleHead(const QCString &,const QCString &) { endTitle(); - m_t << " </div>\n"; + m_t << "</div>\n"; } void HtmlGenerator::endHeaderSection() diff --git a/src/index.cpp b/src/index.cpp index 99942f1..de50cc5 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -289,18 +289,6 @@ void endFileWithNavPath(const Definition *d,OutputList &ol) //---------------------------------------------------------------------- -static bool memberVisibleInIndex(const MemberDef *md) -{ - bool isAnonymous = md->isAnonymous(); - bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS); - bool extractStatic = Config_getBool(EXTRACT_STATIC); - return (!isAnonymous && - (!hideUndocMembers || md->hasDocumentation()) && - (!md->isStatic() || extractStatic) && - md->isLinkable() - ); -} - static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool addToIndex) { bool isAnonymous = md->isAnonymous(); @@ -388,7 +376,7 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part, { for (const auto &md : *ml) { - if (memberVisibleInIndex(md)) + if (md->visibleInIndex()) { writeMemberToIndex(def,md,addToIndex); } @@ -1611,7 +1599,7 @@ static int countVisibleMembers(const NamespaceDef *nd) { for (const auto &md : *ml) { - if (memberVisibleInIndex(md)) + if (md->visibleInIndex()) { count++; } @@ -1634,8 +1622,8 @@ static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex) { for (const auto &md : *ml) { - //printf(" member %s visible=%d\n",qPrint(md->name()),memberVisibleInIndex(md)); - if (memberVisibleInIndex(md)) + //printf(" member %s visible=%d\n",qPrint(md->name()),md->visibleInIndex()); + if (md->visibleInIndex()) { writeMemberToIndex(nd,md,addToIndex); } @@ -2180,7 +2168,9 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct // write character heading ol.writeString("<dt class=\"alphachar\">"); QCString s = letterToLabel(cl.first.c_str()); - ol.writeString("<a name=\"letter_"); + ol.writeString("<a id=\"letter_"); + ol.writeString(s); + ol.writeString("\" name=\"letter_"); ol.writeString(s); ol.writeString("\">"); ol.writeString(cl.first.c_str()); @@ -2511,10 +2501,10 @@ static void writeClassLinkForMember(OutputList &ol,const MemberDef *md,const QCS const ClassDef *cd=md->getClassDef(); if ( cd && prevClassName!=cd->displayName()) { - ol.docify(separator); + ol.writeString(separator); ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(), cd->displayName()); - ol.writeString("\n"); + //ol.writeString("\n"); prevClassName = cd->displayName(); } } @@ -2525,10 +2515,10 @@ static void writeFileLinkForMember(OutputList &ol,const MemberDef *md,const QCSt const FileDef *fd=md->getFileDef(); if (fd && prevFileName!=fd->name()) { - ol.docify(separator); + ol.writeString(separator); ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(), fd->name()); - ol.writeString("\n"); + //ol.writeString("\n"); prevFileName = fd->name(); } } @@ -2539,10 +2529,10 @@ static void writeNamespaceLinkForMember(OutputList &ol,const MemberDef *md,const const NamespaceDef *nd=md->getNamespaceDef(); if (nd && prevNamespaceName!=nd->displayName()) { - ol.docify(separator); + ol.writeString(separator); ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(), nd->displayName()); - ol.writeString("\n"); + //ol.writeString("\n"); prevNamespaceName = nd->displayName(); } } @@ -2625,11 +2615,11 @@ static void writeMemberList(OutputList &ol,bool useSections,const std::string &p firstItem=FALSE; ol.docify(name); if (isFunc) ol.docify("()"); - ol.writeString("\n"); + //ol.writeString("\n"); // link to class prevDefName=""; - sep = ": "; + sep = " : "; prevName = name.data()+startIndex; } else // same entry @@ -3512,7 +3502,7 @@ static void writeExampleIndex(OutputList &ol) } } ol.endItemListItem(); - ol.writeString("\n"); + //ol.writeString("\n"); } ol.endItemList(); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index af05535..7133641 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -321,6 +321,7 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable> virtual void writeTagFile(TextStream &) const; virtual void warnIfUndocumented() const; virtual void warnIfUndocumentedParams() const; + virtual bool visibleInIndex() const; virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const; virtual MemberDefMutable *createTemplateInstanceMember(const ArgumentList &formalArgs, const std::unique_ptr<ArgumentList> &actualArgs) const; @@ -744,6 +745,8 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef> { return getMdAlias()->getDeclColumn(); } virtual QCString requiresClause() const { return getMdAlias()->requiresClause(); } + virtual bool visibleInIndex() const + { return getMdAlias()->visibleInIndex(); } virtual void warnIfUndocumented() const {} virtual void warnIfUndocumentedParams() const {} @@ -3844,6 +3847,18 @@ void MemberDefImpl::warnIfUndocumented() const warnIfUndocumentedParams(); } } + +bool MemberDefImpl::visibleInIndex() const +{ + bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS); + bool extractStatic = Config_getBool(EXTRACT_STATIC); + return (!isAnonymous() && + (!hideUndocMembers || hasDocumentation()) && + (!isStatic() || extractStatic) && + isLinkable() + ); +} + static QCString stripTrailingReturn(const QCString &trailRet) { QCString ret = trailRet; diff --git a/src/memberdef.h b/src/memberdef.h index 1d1e744..ca745a0 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -285,9 +285,11 @@ class MemberDef : public Definition virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const = 0; virtual void warnIfUndocumented() const = 0; virtual void warnIfUndocumentedParams() const = 0; + virtual bool visibleInIndex() const = 0; // TODO: this is not a getter, should be passed at construction virtual void setMemberGroup(MemberGroup *grp) = 0; + }; class MemberDefMutable : public DefinitionMutable, public MemberDef 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/scanner.l b/src/scanner.l index 00fa3b4..4fb625f 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -1955,7 +1955,7 @@ NONLopt [^\n]* //printf("Found %s\n",qPrint(yyextra->current->name)); BEGIN( ReadFuncArgType ) ; } - else if (yyextra->sharpCount<=0) + else { yyextra->current->name+="("; yyextra->roundCount++; diff --git a/src/searchindex.cpp b/src/searchindex.cpp index cf09e67..f87cd33 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -1214,6 +1214,7 @@ void writeJavaScriptSearchIndex() t << "</html>\n"; } } + Doxygen::indexList->addStyleSheetFile("search/search.js"); } diff --git a/src/template.cpp b/src/template.cpp index 82b35f7..e1d9c79 100755 --- a/src/template.cpp +++ b/src/template.cpp @@ -98,30 +98,33 @@ static std::vector<QCString> 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<l) { - if (c==' ') // found a space, see if there is a = as well + char c = s[i++]; + if (c==' ') { - const char *t = p; - bool found=FALSE; - while (*t==' ' || *t=='=') { if (*t++=='=') found=TRUE; } - if (found) + bool found=false; + // look ahead for space or '=' + uint j=i; + while (j<l && (s[j]==' '|| s[j]=='=')) + { + if (s[j]=='=') found=true; + j++; + } + if (found) // found a '=', write it without spaces { - c='='; - p=t; // move p to end of '\s*=\s*' sequence + c = '='; + i=j; } } - *q++=c; + s[dstIdx++]=c; } - if (q<p) result.resize(static_cast<uint>(q-result.data())+1); - return result; + s.resize(dstIdx+1); + //printf("<removeSpacesAroundEquals(%s)\n",qPrint(s)); } //---------------------------------------------------------------------------- @@ -130,9 +133,9 @@ static QCString removeSpacesAroundEquals(const QCString &s) static QCString replace(const QCString &s,char csrc,char cdst) { QCString result = s; - for (char *p=result.data();*p;p++) + for (uint i=0;i<result.length();i++) { - if (*p==csrc) *p=cdst; + if (result[i]==csrc) result[i]=cdst; } return result; } @@ -288,6 +291,17 @@ TemplateVariant TemplateStruct::get(const QCString &name) const return it!=p->fields.end() ? it->second : TemplateVariant(); } +StringVector TemplateStruct::fields() const +{ + StringVector result; + for (const auto &kv : p->fields) + { + result.push_back(kv.first); + } + std::sort(result.begin(),result.end()); + return result; +} + TemplateStruct *TemplateStruct::alloc() { return new TemplateStruct; @@ -514,6 +528,7 @@ class TemplateContextImpl : public TemplateContext void push(); void pop(); void set(const QCString &name,const TemplateVariant &v); + void update(const QCString &name,const TemplateVariant &v); TemplateVariant get(const QCString &name) const; const TemplateVariant *getRef(const QCString &name) const; void setOutputDirectory(const QCString &dir) @@ -1078,14 +1093,14 @@ class FilterAlphaIndex private: struct ListElem { - ListElem(uint k,const TemplateVariant &v) : key(k), value(v) {} - QCString key; + ListElem(std::string k,const TemplateVariant &v) : key(k), value(v) {} + std::string key; TemplateVariant value; }; - static QCString keyToLabel(const QCString &startLetter) + static QCString keyToLabel(const char *startLetter) { - if (startLetter.isEmpty()) return startLetter; - const char *p = startLetter.data(); + //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 +1117,14 @@ class FilterAlphaIndex result+=hex[((unsigned char)c)&0xf]; } } + //printf("<keyToLabel(%s)\n",qPrint(result)); return result; } - static uint determineSortKey(TemplateStructIntf *s,const QCString &attribName) + static std::string determineSortKey(TemplateStructIntf *s,const QCString &attribName) { TemplateVariant v = s->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 +1147,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 +1160,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 +1171,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 +1295,72 @@ 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 "upper" filter */ +class FilterHex +{ + public: + static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &) + { + if (v.isValid()) + { + return QCString().sprintf("%x",v.toInt()); + } + return v; + } +}; + + +//-------------------------------------------------------------------- + +/** @brief The implementation of the "e" filter */ +class FilterEscape +{ + 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 @@ -1357,9 +1436,13 @@ class TemplateFilterFactory // register a handlers for each filter we support static TemplateFilterFactory::AutoRegister<FilterAdd> fAdd("add"); static TemplateFilterFactory::AutoRegister<FilterGet> fGet("get"); +static TemplateFilterFactory::AutoRegister<FilterHex> fHex("hex"); static TemplateFilterFactory::AutoRegister<FilterRaw> fRaw("raw"); static TemplateFilterFactory::AutoRegister<FilterList> fList("list"); +static TemplateFilterFactory::AutoRegister<FilterLower> fLower("lower"); +static TemplateFilterFactory::AutoRegister<FilterUpper> fUpper("upper"); static TemplateFilterFactory::AutoRegister<FilterAppend> fAppend("append"); +static TemplateFilterFactory::AutoRegister<FilterEscape> fEscape("escape"); static TemplateFilterFactory::AutoRegister<FilterLength> fLength("length"); static TemplateFilterFactory::AutoRegister<FilterNoWrap> fNoWrap("nowrap"); static TemplateFilterFactory::AutoRegister<FilterFlatten> fFlatten("flatten"); @@ -1409,7 +1492,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 +1544,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 +1589,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 +2052,7 @@ class ExpressionParser { warn(m_parser->templateName(),m_line,"unexpected operator '%s' in expression", Operator::toString(m_curToken.op)); + abort(); } break; default: @@ -2261,8 +2345,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; @@ -2305,6 +2389,7 @@ class TemplateStructWeakRef : public TemplateStructIntf public: TemplateStructWeakRef(TemplateStructIntf *ref) : m_ref(ref), m_refCount(0) {} virtual TemplateVariant get(const QCString &name) const { return m_ref->get(name); } + virtual StringVector fields() const { return m_ref->fields(); } virtual int addRef() { return ++m_refCount; } virtual int release() { int count=--m_refCount; if (count<=0) { delete this; } return count; } private: @@ -2382,6 +2467,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 +3646,16 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude> 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<l) { - char *dst = s.rawData(); - char c; - bool skipSpaces=TRUE; - while ((c=*src++)) - { - if (c=='\n') { *dst++=c; skipSpaces=TRUE; } - else if (c==' ' && skipSpaces) {} - else { *dst++=c; skipSpaces=FALSE; } - } - *dst='\0'; - s.resize( (int)(dst - src) + 1 ); + char c = s[i++]; + if (c=='\n') { s[dstIdx++]=c; skipSpaces=true; } + else if (c==' ' && skipSpaces) {} + else { s[dstIdx++] = c; skipSpaces=false; } } + s.resize(dstIdx+1); } /** @brief Class representing an 'create' tag in a template */ @@ -3945,7 +4042,8 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith> { TRACE(("{TemplateNodeWith(%s)\n",qPrint(data))); ExpressionParser expParser(parser,line); - QCString filteredData = removeSpacesAroundEquals(data); + QCString filteredData = data; + removeSpacesAroundEquals(filteredData); std::vector<QCString> args = split(filteredData," "); auto it = args.begin(); while (it!=args.end()) @@ -4114,6 +4212,52 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet> //---------------------------------------------------------- +/** @brief Class representing an 'update' tag in a template */ +class TemplateNodeUpdate : public TemplateNodeCreator<TemplateNodeUpdate> +{ + 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<TemplateNodeUpdate>(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<Mapping>(data.left(j),expr); + } + TRACE(("}TemplateNodeUpdate(%s)\n",qPrint(data))); + } + ~TemplateNodeUpdate() + { + } + void render(TextStream &, TemplateContext *c) + { + TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(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<Mapping> m_mapping; +}; + + +//---------------------------------------------------------- + /** @brief Class representing an 'spaceless' tag in a template */ class TemplateNodeSpaceless : public TemplateNodeCreator<TemplateNodeSpaceless> { @@ -4313,6 +4457,12 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource> 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 +4495,12 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource> 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 +4513,7 @@ class TemplateNodeResource : public TemplateNodeCreator<TemplateNodeResource> private: ExprAst *m_resExpr = 0; ExprAst *m_asExpr = 0; + bool m_append = false; }; //---------------------------------------------------------- @@ -4477,6 +4629,7 @@ static TemplateNodeFactory::AutoRegister<TemplateNodeRange> autoRefRange static TemplateNodeFactory::AutoRegister<TemplateNodeExtend> autoRefExtend("extend"); static TemplateNodeFactory::AutoRegister<TemplateNodeCreate> autoRefCreate("create"); static TemplateNodeFactory::AutoRegister<TemplateNodeRepeat> autoRefRepeat("repeat"); +static TemplateNodeFactory::AutoRegister<TemplateNodeUpdate> autoRefUpdate("update"); static TemplateNodeFactory::AutoRegister<TemplateNodeInclude> autoRefInclude("include"); static TemplateNodeFactory::AutoRegister<TemplateNodeMarkers> autoRefMarkers("markers"); static TemplateNodeFactory::AutoRegister<TemplateNodeTabbing> autoRefTabbing("tabbing"); @@ -4797,7 +4950,7 @@ void TemplateLexer::addToken(TemplateTokenStream &tokens, { if (startPos<endPos) { - int len = endPos-startPos+1; + int len = endPos-startPos; QCString text = data.mid(startPos,len); if (type!=TemplateToken::Text) text = text.stripWhiteSpace(); tokens.push_back(std::make_unique<TemplateToken>(type,text,line)); @@ -4822,8 +4975,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: @@ -5178,4 +5331,50 @@ void TemplateEngine::setTemplateDir(const QCString &dirName) p->setTemplateDir(dirName); } +//----------------------------------------------------------------------------------------- + +QCString TemplateVariant::listToString() const +{ + QCString result="["; + TemplateListIntf *list = toList(); + if (list) + { + bool first=true; + TemplateVariant ve; + TemplateListIntf::ConstIterator *it = list->createIterator(); + for (it->toFirst();it->current(ve);it->toNext()) + { + if (!first) result+=",\n"; + result+="'"+ve.toString()+"'"; + first=false; + } + delete it; + } + result+="]"; + return result; +} + +QCString TemplateVariant::structToString() const +{ + QCString result="{"; + TemplateStructIntf *strukt = toStruct(); + if (strukt) + { + bool first=true; + for (const auto &s : strukt->fields()) + { + if (!first) result+=","; + result+=s; + if (dynamic_cast<TemplateStructWeakRef*>(strukt)==0) // avoid endless recursion + { + result+=":'"; + result+=strukt->get(QCString(s)).toString(); + result+="'"; + } + first=false; + } + } + result+="}"; + return result; +} diff --git a/src/template.h b/src/template.h index dee063d..7d803a3 100644 --- a/src/template.h +++ b/src/template.h @@ -19,6 +19,7 @@ #include <vector> #include "qcstring.h" +#include "containers.h" class TemplateListIntf; class TemplateStructIntf; @@ -28,7 +29,7 @@ class TextStream; /** @defgroup template_api Template API * * This is the API for a - * <a href="https://docs.djangoproject.com/en/1.6/topics/templates/">Django</a> + * <a href="https://www.djangoproject.com/">Django</a> * compatible template system written in C++. * It is somewhat inspired by Stephen Kelly's * <a href="http://www.gitorious.org/grantlee/pages/Home">Grantlee</a>. @@ -175,6 +176,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. */ @@ -228,6 +232,9 @@ class TemplateVariant } } + QCString listToString() const; + QCString structToString() const; + /** Returns the variant as a string. */ QCString toString() const { @@ -237,8 +244,8 @@ class TemplateVariant case Bool: return m_boolVal ? "true" : "false"; case Integer: return QCString().setNum(m_intVal); case String: return m_strVal; - case Struct: return "[struct]"; - case List: return "[list]"; + case Struct: return structToString(); + case List: return listToString(); case Function: return "[function]"; } return QCString(); @@ -414,6 +421,9 @@ class TemplateStructIntf */ virtual TemplateVariant get(const QCString &name) const = 0; + /** Return the list of fields. */ + virtual StringVector fields() const = 0; + /** Increase object's reference count */ virtual int addRef() = 0; @@ -428,6 +438,7 @@ class TemplateStruct : public TemplateStructIntf public: // TemplateStructIntf methods virtual TemplateVariant get(const QCString &name) const; + virtual StringVector fields() const; virtual int addRef(); virtual int release(); 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 </head> <body> -<!--BEGIN FULL_SIDEBAR--> +<!--BEGIN DISABLE_INDEX--> + <!--BEGIN FULL_SIDEBAR--> <div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! --> -<!--END FULL_SIDEBAR--> + <!--END FULL_SIDEBAR--> +<!--END DISABLE_INDEX--> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> diff --git a/templates/html/htmlallmembers.tpl b/templates/html/htmlallmembers.tpl index b44110d..ed34131 100644 --- a/templates/html/htmlallmembers.tpl +++ b/templates/html/htmlallmembers.tpl @@ -9,8 +9,7 @@ <p>{{ tr.theListOfAllMembers }} <a class="el" href="{{ compound.fileName }}{{ config.HTML_FILE_EXTENSION }}">{{ compound.name }}</a>{{ tr.incInheritedMembers }}</p> <table class="directory"> {% for mi in compound.allMembersList %} - <tr class="{% cycle 'even' 'odd' %}"> - {% spaceless %} + <tr class="{% cycle 'even' 'odd' %}">{% spaceless %} {% with member=mi.member %} {% if member.language=='objc' %} <td class="entry"> diff --git a/templates/html/htmlannotated.tpl b/templates/html/htmlannotated.tpl index c5faa14..e3b8442 100644 --- a/templates/html/htmlannotated.tpl +++ b/templates/html/htmlannotated.tpl @@ -4,7 +4,7 @@ <div class="textblock"> {{ tr.classListDescription }} </div> -{% indexentry nav name=tr.classes file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.classList file=page.fileName anchor='' isReference=False separateIndex=True %} {% opensubindex nav %} {% with tree=classTree %} {% include 'htmldirtree.tpl' %} diff --git a/templates/html/htmlbase.tpl b/templates/html/htmlbase.tpl index f021ddd..6727da0 100644 --- a/templates/html/htmlbase.tpl +++ b/templates/html/htmlbase.tpl @@ -6,8 +6,11 @@ <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen {{ doxygen.version }}"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> -<title>{{ config.PROJECT_NAME }}: {{ page.title }}</title> +<title>{% if config.PROJECT_NAME %}{{ config.PROJECT_NAME }}: {% endif %}{{ page.title }}</title> <link href="{{ page.relPath }}tabs.css" rel="stylesheet" type="text/css"/> +{% if config.DISABLE_INDEX and config.FULL_SIDEBAR %} +<script type="text/javascript">var page_layout=1;</script> +{% endif %} <script type="text/javascript" src="{{ page.relPath }}jquery.js"></script> <script type="text/javascript" src="{{ page.relPath }}dynsections.js"></script> {% if config.GENERATE_TREEVIEW %} @@ -15,22 +18,6 @@ <script type="text/javascript" src="{{ page.relPath }}resize.js"></script> <script type="text/javascript" src="{{ page.relPath }}navtreedata.js"></script> <script type="text/javascript" src="{{ page.relPath }}navtree.js"></script> -<script type="text/javascript"> - /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ - $(document).ready(initResizable); - /* @license-end */ -</script> -{% endif %} -{% if not config.DISABLE_INDEX %} -<script type="text/javascript" src="menudata.js"></script> -<script type="text/javascript" src="menu.js"></script> -<script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ -$(function() { - initMenu('',{% if config.SEARCHENGINE %}true{% else %}false{% endif %},'{{ tr.search }}'); -}); -/* @license-end */ -</script> {% endif %} {% if config.SEARCHENGINE %} <link href="{{ page.relPath }}search/search.css" rel="stylesheet" type="text/css"/> @@ -40,18 +27,18 @@ $(function() { <script type="text/javascript" src="{{ page.relPath }}search/search.js"></script> {% if config.SERVER_BASED_SEARCH %} <script type="text/javascript"> - /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ + /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function() { if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); } }); - /* @license-end */ + /* @license-end */ </script> <link rel="search" href="{{ page.relPath }}search-opensearch.php?v=opensearch.xml" type="application/opensearchdescription+xml" title="{{ config.PROJECT_NAME }}"/> - {% else %} + {% elif config.DISABLE_INDEX or not config.HTML_DYNAMIC_MENUS %} <script type="text/javascript"> - /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ + /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(document).ready(function() { init_search(); }); - /* @license-end */ + /* @license-end */ </script> {% endif %} {% endif %} @@ -72,6 +59,9 @@ $(function() { </head> <body> {% endblock %} +{% if config.DISABLE_INDEX and config.FULL_SIDEBAR %} +<div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! --> +{% endif %} <div id="top"><!-- do not remove this div, it is closed by doxygen! --> {% block titlearea %} {% if config.PROJECT_NAME or config.PROJECT_BRIEF or config.PROJECT_LOGO or config.DISABLE_INDEX and config.SEARCHENGINE %} @@ -82,12 +72,9 @@ $(function() { {% if config.PROJECT_LOGO %} <td id="projectlogo"><img alt="Logo" src="{{ page.relPath }}{{ config.PROJECT_LOGO|stripPath }}"/></td> {% endif %} - <td style="padding-left: 0.5em;"> + <td id="projectalign" style="padding-left: 0.5em;"> {% if config.PROJECT_NAME %} - <div id="projectname">{{ config.PROJECT_NAME }} - {% if config.PROJECT_NUMBER %} - <span id="projectnumber">{{ config.PROJECT_NUMBER }}</span> - {% endif %} + <div id="projectname">{{ config.PROJECT_NAME }}{% if config.PROJECT_NUMBER %}<span id="projectnumber"> {{ config.PROJECT_NUMBER }}</span>{% endif %} </div> {% endif %} {% if config.PROJECT_BRIEF %} @@ -95,7 +82,13 @@ $(function() { {% endif %} </td> {% 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 #} + </tr> + <tr> + <td colspan="2"> + {% else %} <td> + {% endif %} {% if config.SERVER_BASED_SEARCH %} <div id="MSearchBox" class="MSearchBoxInactive"> <div class="left"> @@ -139,27 +132,45 @@ $(function() { {% block search %} {% if config.SEARCHENGINE %} <script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ -var searchBox = new SearchBox("searchBox", "{{ page.relPath }}search",false,'{{ tr.search }}'); +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ + var searchBox = new SearchBox("searchBox", "{{ page.relPath }}search",false,'{{ tr.search }}','{{ config.HTML_FILE_EXTENSION }}'); /* @license-end */ </script> {% endif %} {% endblock %} {% block tabs %} -{% if not config.DISABLE_INDEX %} +{% if config.HTML_DYNAMIC_MENUS %} +<script type="text/javascript" src="menudata.js"></script> +<script type="text/javascript" src="menu.js"></script> +<script type="text/javascript"> +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ +$(function() { + initMenu('{{ page.relPath }}',{% if config.SEARCHENGINE %}true{% else %}false{% endif %},{% if config.SERVER_BASED_SEARCH %}true{% else %}false{% endif %},{% if config.EXTERNAL_SEARCH %}'search{{ config.HTML_FILE_EXTENSION }}'{% else %}'search.php'{% endif %},'{{ tr.search }}'); + {% if config.SEARCHENGINE %} + $(document).ready(function() { {% if not config.SERVER_BASED_SEARCH %}init_search();{% else %}if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); } {% endif %}}); + {% endif %} +}); +/* @license-end */ +</script> <div id="main-nav"></div> {% endif %} + +{% if not config.DISABLE_INDEX and not config.HTML_DYNAMIC_MENUS %} +{% include 'htmltabs.tpl' %} +{% endif %} +</div><!-- top --> + {% endblock %} {% block navpath %} {% endblock %} - -</div><!-- top --> {% block splitbar %} {% if config.GENERATE_TREEVIEW %} +{% if not config.DISABLE_INDEX or not config.FULL_SIDEBAR %} <div id="side-nav" class="ui-resizable side-nav-resizable"> +{% endif %} <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> @@ -170,8 +181,8 @@ var searchBox = new SearchBox("searchBox", "{{ page.relPath }}search",false,'{{ </div> </div> <script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ -$(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix %}{{ page_postfix }}{% endif %}{{ config.HTML_FILE_EXTENSION }}','{{ page.relPath }}');}); +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ +$(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix %}{{ page_postfix }}{% endif %}{{ config.HTML_FILE_EXTENSION }}','{{ page.relPath }}'); initResizable(); }); /* @license-end */ </script> <div id="doc-content"> @@ -181,13 +192,15 @@ $(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix {% block searchInfo %} {% if config.SEARCHENGINE and not config.SERVER_BASED_SEARCH %} <!-- window showing the filter options --> -<div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" +<div id="MSearchSelectWindow" + onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> -<iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> +<iframe src="javascript:void(0)" frameborder="0" + name="MSearchResults" id="MSearchResults"> </iframe> </div> {% endif %} @@ -195,20 +208,22 @@ $(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix <div class="header"> {% block title %} - <div class="headertitle"><div class="title">{{ page.title }}</div></div> +<div class="headertitle"> +<div class="title">{{ page.title }}</div></div> {% endblock %} -</div> +</div><!-- header --> {% block content %} {% endblock %} {% block endsplitbar %} {% if config.GENERATE_TREEVIEW %} -</div><!-- content --> +</div><!-- doc-content --> {% endif %} {% endblock %} {% block footer %} +<!-- start footer part --> {% if config.GENERATE_TREEVIEW %} <div id="nav-path" class="navpath">{# id is needed for treeview function! #} <ul> @@ -233,14 +248,8 @@ $(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix </div> {% else %} <hr class="footer"/><address class="footer"><small> -{% if config.HTML_TIMESTAMP %} -{{ tr.generatedAt:doxygen.date,config.PROJECT_NAME }} -{% else %} -{{ tr.generatedBy }} -{% endif %} - <a href="https://www.doxygen.org/index.html"><img class="footer" src="{{ page.relPath }}doxygen.svg" width="104" height="31" alt="doxygen"/></a> - {{ doxygen.version }} - </small></address> +{% if config.HTML_TIMESTAMP %}{{ tr.generatedAt:doxygen.date,config.PROJECT_NAME }}{% else %}{{ tr.generatedBy }}{% endif %} <a href="https://www.doxygen.org/index.html"><img class="footer" src="{{ page.relPath }}doxygen.svg" width="104" height="31" alt="doxygen"/></a> {{ doxygen.version }} +</small></address> {% endif %} </body> </html> 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 }} <ul> {% for file in compound.usedFiles %} - <li>{% if file.sourceFileName %} + <li>{% if file.sourceFileName and file.isLinkable %} <a class="el" href="{{ file.sourceFileName }}{{ config.HTML_FILE_EXTENSION }}"> {% endif %} {% if not file.sourceFileName and file.isLinkable %} @@ -440,7 +440,7 @@ {% else %} {{ file.name|stripPath }} {% endif %} - {% if file.sourceFileName or file.isLinkable %} + {% if file.isLinkable %} </a> {% endif %} {% if file.versionInfo %} {{ file.versionInfo }}{% endif %} @@ -448,6 +448,6 @@ {% endfor %} </ul> {% endif %} -</div> +</div><!-- contents --> {% endblock %} diff --git a/templates/html/htmlclasses.tpl b/templates/html/htmlclasses.tpl index c00ce32..3e556a2 100644 --- a/templates/html/htmlclasses.tpl +++ b/templates/html/htmlclasses.tpl @@ -1,9 +1,6 @@ {% extend 'htmlbase.tpl' %} {% block content %} <div class="contents"> -<div class="textblock"> -{% indexentry nav name=tr.classIndex file=page.fileName anchor='' isReference=False %} -</div> {% with index=classIndex.list|alphaIndex:'name' %} {# quick index at top #} <div class="qindex"> @@ -14,33 +11,22 @@ {% endif %} {% endfor %} </div> + {% indexentry nav name=tr.classIndex file=page.fileName anchor='' isReference=False separateIndex=False %} {# multi column index #} - <div class="classindex" style="column-count:{{ config.COLS_IN_ALPHA_INDEX }};-moz-column-count:{{ config.COLS_IN_ALPHA_INDEX }};-webkit-column-count:{{ config.COLS_IN_ALPHA_INDEX}}"> + <div class="classindex"> {% for section in index %} - <ul> + <dl class="classindex {% cycle 'even' 'odd' %}"> {% for cls in section.items %} - <li> - <span class="ai"> - {% if forloop.first %} - <a name="letter_{{ section.label }}"></a> - <span class="ah">  {{ section.letter }}  </span><br/> - {% endif %} - {% with obj=cls text=cls.name %} - {% include 'htmlobjlink.tpl' %} - {% endwith %} - </span> - </li> + {% if forloop.first %} + <dt class="alphachar"><a id="letter_{{ section.label }}" name="letter_{{ section.label }}">{{ section.letter }}</a></dt> + {% endif %} + <dd> + {% with obj=cls text=cls.name %} + {% include 'htmlobjlink.tpl' %} + {% endwith %} + </dd> {% endfor %} - </ul> - {% endfor %} - </div><!-- classindex --> - {# quick index at bottom #} - <div class="qindex"> - {% for section in index %} - <a class="qindex" href="#letter_{{ section.label }}">{{ section.letter }}</a> - {% if not forloop.last %} -  |  - {% endif %} + </dl> {% endfor %} </div> {% endwith %} diff --git a/templates/html/htmldeclcomp.tpl b/templates/html/htmldeclcomp.tpl index 3ae90b8..5f6fe60 100644 --- a/templates/html/htmldeclcomp.tpl +++ b/templates/html/htmldeclcomp.tpl @@ -15,6 +15,7 @@ {% include 'htmlobjlink.tpl' %} {% endwith %} {% endif %} + {% if nc.sourceFileName and nc.isLinkable %}<a class="el" href="{{ nc.sourceFileName }}{{ config.HTML_FILE_EXTENSION }}">[{{ tr.code }}]</a>{% endif %} </td></tr> {# brief description #} {% if nc.brief %} @@ -25,7 +26,7 @@ {% endif %} <br/></td></tr> {% endif %} - <tr class="separator:{{ nc.anchor}}"><td class="memSeparator" colspan="2"> </td></tr> + <tr class="separator:{{ nc.anchor }}"><td class="memSeparator" colspan="2"> </td></tr> {% endfor %} </table> {% endif %} diff --git a/templates/html/htmldirtree.tpl b/templates/html/htmldirtree.tpl index a6b9b21..f1b4fcf 100644 --- a/templates/html/htmldirtree.tpl +++ b/templates/html/htmldirtree.tpl @@ -11,7 +11,12 @@ {# the table with entries #} <table class="directory"> {% recursetree tree.tree %} - {% indexentry nav name=node.name file=node.fileName anchor=node.anchor isReference=node.isReference externalReference=node.externalReference %} + {% if node.isLinkable %} + {% indexentry nav name=node.name file=node.fileName anchor=node.anchor isReference=node.isReference externalReference=node.externalReference separateIndex=True %} + {% else %} + {% indexentry nav name=node.name file='' anchor=node.anchor isReference=False separateIndex=False %} + {% endif %} + {% if not node.member %} {% spaceless %} <tr id="row_{{ node.id }}" class="{% cycle 'even' 'odd' %}"{%if node.level>tree.preferredDepth %} style="display:none;"{% endif %}> <td class="entry"> @@ -47,6 +52,16 @@ {% opensubindex nav %} {{ children }} {% closesubindex nav %} + {% spaceless %} + {% if node.members %} + {% opensubindex nav %} + {% for member in node.members %} + {% indexentry nav name=member.name file=member.fileName anchor=member.anchor isReference=member.isReference externalReference=member.externalReference separateIndex=False %} + {% endfor %} + {% closesubindex nav %} + {% endif %} + {% endspaceless %} + {% endif %} {% endrecursetree %} </table> </div><!-- directory --> diff --git a/templates/html/htmlexamples.tpl b/templates/html/htmlexamples.tpl index 58392df..18384e2 100644 --- a/templates/html/htmlexamples.tpl +++ b/templates/html/htmlexamples.tpl @@ -4,7 +4,7 @@ <div class="textblock"> {{ tr.examplesDescription }} </div> -{% indexentry nav name=tr.examples file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.examples file=page.fileName anchor='' isReference=False separateIndex=False %} {% opensubindex nav %} {% with tree=exampleTree %} {% include 'htmldirtree.tpl' %} diff --git a/templates/html/htmlfiles.tpl b/templates/html/htmlfiles.tpl index 55799ca..1c784dc 100644 --- a/templates/html/htmlfiles.tpl +++ b/templates/html/htmlfiles.tpl @@ -4,7 +4,7 @@ <div class="textblock"> {{ tr.fileListDescription }} </div> -{% indexentry nav name=tr.fileList file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.fileList file=page.fileName anchor='' isReference=False separateIndex=True %} {% opensubindex nav %} {% with tree=fileTree %} {% include 'htmldirtree.tpl' %} diff --git a/templates/html/htmlhierarchy.tpl b/templates/html/htmlhierarchy.tpl index ff10172..df01709 100644 --- a/templates/html/htmlhierarchy.tpl +++ b/templates/html/htmlhierarchy.tpl @@ -7,7 +7,7 @@ <p><a href="inherits{{ config.HTML_FILE_EXTENSION }}">{{ tr.gotoGraphicalHierarchy }}</a></p> {% endif %} </div> -{% indexentry nav name=tr.classHierarchy file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.classHierarchy file=page.fileName anchor='' isReference=False separateIndex=True %} {% opensubindex nav %} {% with tree=classHierarchy %} {% include 'htmldirtree.tpl' %} diff --git a/templates/html/htmlindexpages.tpl b/templates/html/htmlindexpages.tpl index 2886a69..eacf122 100644 --- a/templates/html/htmlindexpages.tpl +++ b/templates/html/htmlindexpages.tpl @@ -9,7 +9,7 @@ {% for sect in index %} {% with letter=sect.letter %} {% set page_postfix=section|append:'_'|append:sect.label %} - {% indexentry nav name=letter file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=letter file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {# create index pages for all globals starting with a specific letter #} {% create page.fileName|append:page_postfix|append:config.HTML_FILE_EXTENSION from template %} {% 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/htmljsnavpage.tpl b/templates/html/htmljsnavpage.tpl new file mode 100644 index 0000000..9d9881d --- /dev/null +++ b/templates/html/htmljsnavpage.tpl @@ -0,0 +1,20 @@ +var {{ varName }} = +[ +{% recursetree node.children %} + {% set varName=node.file %} + {% if node.anchor %} + {% update varName=varName|append:'_'|append:node.anchor %} + {% endif %} + {% if node.parent %} + {% if node.parent.file==node.file %} + {% update varName=varName|append:'_dup' %} + {% endif %} + {% endif %} +[ "{{ node.name }}",{% if node.file %}"{% if node.isReference %}{{ node.externalReference }}{% endif %}{{ node.file|decodeURL }}{{ config.HTML_FILE_EXTENSION }}{% if node.anchor %}#{{ node.anchor }}{% endif %}"{% else %}null{% endif %},{% if not node.is_leaf_node %}{% if node.separateIndex %}"{{ varName }}"{% else %} [ + {{ children }} + ]{% endif %}{% else %} null{% endif %} ]{% if not node.last %},{% endif %} + {% if node.separateIndex %} + {% create varName|append:'.js' from 'htmljsnavpage.tpl' %} + {% endif %} +{% endrecursetree %} +]; diff --git a/templates/html/htmljsnavtree.tpl b/templates/html/htmljsnavtree.tpl index 947b980..fef1819 100644 --- a/templates/html/htmljsnavtree.tpl +++ b/templates/html/htmljsnavtree.tpl @@ -1,9 +1,45 @@ +/* + @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 %} - [ "{{ node.name }}", {% if node.file %}"{% if node.isReference %}{{ node.externalReference }}{% endif %}{{ node.file|decodeURL }}{{ config.HTML_FILE_EXTENSION }}{% if node.anchor %}#{{ node.anchor }}{% endif %}"{% else %}null{% endif %},{% if not node.is_leaf_node %} [ + {% set varName=node.file %} + {% if node.anchor %} + {% update varName=varName|append:'_'|append:node.anchor %} + {% endif %} + {% if node.parent %} + {% if node.parent.file==node.file %} + {% update varName=varName|append:'_dup' %} + {% endif %} + {% endif %} +[ "{{ node.name }}",{% if node.file %}"{% if node.isReference %}{{ node.externalReference }}{% endif %}{{ node.file|decodeURL }}{{ config.HTML_FILE_EXTENSION }}{% if node.anchor %}#{{ node.anchor }}{% endif %}"{% else %}null{% endif %},{% if not node.is_leaf_node %}{% if node.separateIndex %}"{{ varName }}"{% else %} [ {{ children }} - ]{% else %} null{% endif %} ]{% if not node.last %},{% endif %} + ]{% endif %}{% else %} null{% endif %} ]{% if not node.last %},{% endif %} + {% if node.separateIndex %} + {% create varName|append:'.js' from 'htmljsnavpage.tpl' %} + {% endif %} {% endrecursetree %} ]; 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..c963434 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|escape }}'] {% 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..0fbe458 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,20 @@ {% 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' %} +{% create 'search/nomatches.html' from 'nomatches.tpl' %} {% if config.SERVER_BASED_SEARCH %} {# server side search resources #} @@ -56,7 +73,9 @@ {% endif %} {# interactive SVGs #} -{% resource 'svgpan.js' %} +{% if config.INTERACTIVE_SVG %} + {% resource 'svgpan.js' %} +{% endif %} {# -------------------------------------------------- #} @@ -68,7 +87,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 separateIndex=False %} +{% else %} + {% indexentry nav name=tr.mainPage file='index' anchor='' isReference=False separateIndex=False %} +{% endif %} {% opensubindex nav %} {# ----------- HTML DOCUMENTATION PAGES ------------ #} @@ -158,7 +181,7 @@ {# --- namespaces --- #} {% if namespaceList %} - {% indexentry nav name=tr.namespaces file='' anchor='' isReference=False %} + {% indexentry nav name=tr.namespaces file='namespaces' anchor='' isReference=False separateIndex=False %} {% opensubindex nav %} {% if namespaceTree.tree %} @@ -170,7 +193,7 @@ {# write symbol indices for namespace members #} {% if namespaceMembersIndex.all %} {% with page=namespaceMembersIndex scope='namespace' template='htmlnsmembers.tpl' %} - {% indexentry nav name=tr.namespaceMembers file=page.fileName anchor='' isReference=False %} + {% indexentry nav name=tr.namespaceMembers file=page.fileName anchor='' isReference=False separateIndex=False %} {% include 'htmlmembersindex.tpl' %} {% endwith %} {% endif %} @@ -180,7 +203,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 separateIndex=False %} {% opensubindex nav %} {# write the annotated class list #} @@ -212,7 +235,7 @@ {# write symbol indices for class members #} {% if classMembersIndex.all %} {% with page=classMembersIndex scope='class' template='htmlclmembers.tpl' %} - {% indexentry nav name=tr.classMembers file=page.fileName anchor='' isReference=False %} + {% indexentry nav name=tr.classMembers file=page.fileName anchor='' isReference=False separateIndex=False %} {% include 'htmlmembersindex.tpl' %} {% endwith %} {% endif %} @@ -222,7 +245,7 @@ {# --- files --- #} {% if fileList %} - {% indexentry nav name=tr.files file='' anchor='' isReference=False %} + {% indexentry nav name=tr.files file='files' anchor='' isReference=False separateIndex=False %} {% opensubindex nav %} {# write the directory/file hierarchy #} @@ -235,7 +258,7 @@ {# write symbol indices for global namespace #} {% if globalsIndex.all %} {% with page=globalsIndex scope='file' template='htmlflmembers.tpl' %} - {% indexentry nav name=tr.fileMembers file=page.fileName anchor='' isReference=False %} + {% indexentry nav name=tr.fileMembers file=page.fileName anchor='' isReference=False separateIndex=False %} {% include 'htmlmembersindex.tpl' %} {% endwith %} {% endif %} @@ -256,9 +279,10 @@ {# 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 %} + {% with hexCount=forloop.counter0|hex baseName=si.name|append:'_'|append:hexCount %} {% create baseName|prepend:'search/'|append:config.HTML_FILE_EXTENSION from 'htmlsearchresult.tpl' %} {% create baseName|prepend:'search/'|append:'.js' from 'htmljssearchindex.tpl' %} {% endwith %} diff --git a/templates/html/htmlmemberindex.tpl b/templates/html/htmlmemberindex.tpl index 216dd31..504219c 100644 --- a/templates/html/htmlmemberindex.tpl +++ b/templates/html/htmlmemberindex.tpl @@ -7,24 +7,22 @@ {% for section in index %} {% if not singleList or letter=='' or section.letter==letter %} {% if not singleList %} - <a class="anchor" id="{{ section.label }}"></a><h3>- {{ section.letter }} -</h3> + <a class="anchor" id="index_{{ section.label|lower }}"></a><h3>- {{ section.letter|lower }} -</h3> <ul> {% endif %} {% for nameList in section.items|groupBy:'name' %} - {% spaceless %} {% for item in nameList|listsort:'{{item.file.name}}' %} + {% spaceless %} {% if forloop.first %} - <li>{{ item.name }}{% if (item.isFunction or item.isSignal or item.isSlot) and not item.isObjCMethod %}(){% endif %} :  - {% endif %} + <li>{{ item.name }}{% if (item.isFunction or item.isSignal or item.isSlot) and not item.isObjCMethod %}(){% endif %} : {% endif %} {% with obj=item scope=item|get:scope text=scope.name %} {% include 'htmlobjlink.tpl' %} {% endwith %} - {% if not forloop.last %},  - {% else %} - </li> - {% endif %} + {% if not forloop.last %}, + {% else %}</li>{% endif %} + {% endspaceless %} + {% endfor %} - {% endspaceless %} {% endfor %} {% if not singleList %} </ul> diff --git a/templates/html/htmlmembersindex.tpl b/templates/html/htmlmembersindex.tpl index 700bce2..46a3cfd 100644 --- a/templates/html/htmlmembersindex.tpl +++ b/templates/html/htmlmembersindex.tpl @@ -2,13 +2,13 @@ {% opensubindex nav %} {# all members #} {% with list=page.all section='' %} - {% indexentry nav name=tr.all file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.all file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% include 'htmlindexpages.tpl' %} {% endwith %} {# functions #} {% if page.functions %} {% set page_postfix='_func' %} - {% indexentry nav name=tr.functions file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.functions file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.functions section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -16,7 +16,7 @@ {# variables #} {% if page.variables %} {% set page_postfix='_vars' %} - {% indexentry nav name=tr.variables file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.variables file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.variables section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -24,7 +24,7 @@ {# typedefs #} {% if page.typedefs %} {% set page_postfix='_type' %} - {% indexentry nav name=tr.typedefs file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.typedefs file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.typedefs section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -32,7 +32,7 @@ {# enums #} {% if page.enums %} {% set page_postfix='_enum' %} - {% indexentry nav name=tr.enums file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.enums file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.enums section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -40,7 +40,7 @@ {# enumValues #} {% if page.enumValues %} {% set page_postfix='_eval' %} - {% indexentry nav name=tr.enumValues file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.enumValues file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.enumValues section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -48,7 +48,7 @@ {# macros #} {% if page.macros %} {% set page_postfix='_defs' %} - {% indexentry nav name=tr.macros file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.macros file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.macros section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -56,7 +56,7 @@ {# properties #} {% if page.properties %} {% set page_postfix='_prop' %} - {% indexentry nav name=tr.properties file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.properties file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.properties section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -64,7 +64,7 @@ {# events #} {% if page.events %} {% set page_postfix='_evnt' %} - {% indexentry nav name=tr.events file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.events file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.events section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} @@ -72,7 +72,7 @@ {# related #} {% if page.related %} {% set page_postfix='_rela' %} - {% indexentry nav name=tr.related file=page.fileName|append:page_postfix anchor='' isReference=False %} + {% indexentry nav name=tr.related file=page.fileName|append:page_postfix anchor='' isReference=False separateIndex=False %} {% with list=page.related section=page_postfix %} {% include 'htmlindexpages.tpl' %} {% endwith %} 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 %} > </td></tr><tr class="memitem:{{ member.anchor }}{% if inheritId %} inherit {{ inheritId }}{% endif %}"><td class="memTemplItemLeft" align="right" valign="top"> diff --git a/templates/html/htmlmodules.tpl b/templates/html/htmlmodules.tpl index 5431032..c4e84fd 100644 --- a/templates/html/htmlmodules.tpl +++ b/templates/html/htmlmodules.tpl @@ -4,7 +4,7 @@ <div class="textblock"> {{ tr.modulesDescription }} </div> -{% indexentry nav name=tr.modules file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.modules file=page.fileName anchor='' isReference=False separateIndex=False %} {% opensubindex nav %} {% with tree=moduleTree %} {% include 'htmldirtree.tpl' %} diff --git a/templates/html/htmlnamespaces.tpl b/templates/html/htmlnamespaces.tpl index b7e7b9d..c3b8b3b 100644 --- a/templates/html/htmlnamespaces.tpl +++ b/templates/html/htmlnamespaces.tpl @@ -4,7 +4,7 @@ <div class="textblock"> {{ tr.namespaceListDescription }} </div> -{% indexentry nav name=tr.namespaceList file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.namespaceList file=page.fileName anchor='' isReference=False separateIndex=False %} {% opensubindex nav %} {% with tree=namespaceTree %} {% include 'htmldirtree.tpl' %} 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 @@ </ul> </li> {% endif %} -{% if exampleList.items %} +{% if exampleList %} <li><a href="{{ page.relPath }}examples{{ config.HTML_FILE_EXTENSION }}"><span>{{ tr.examples }}</span></a> {% endif %} </ul> diff --git a/templates/html/htmlpages.tpl b/templates/html/htmlpages.tpl index 5e3778d..0f12603 100644 --- a/templates/html/htmlpages.tpl +++ b/templates/html/htmlpages.tpl @@ -4,7 +4,7 @@ <div class="textblock"> {{ tr.relatedPagesDesc }} </div> -{% indexentry nav name=tr.pages file=page.fileName anchor='' isReference=False %} +{% indexentry nav name=tr.pages file=page.fileName anchor='' isReference=False separateIndex=False %} {% opensubindex nav %} {% with tree=pageTree %} {% include 'htmldirtree.tpl' %} 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 #} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html><head><title></title> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen {{ doxygen.version }}"/> <link rel="stylesheet" type="text/css" href="search.css"/> @@ -12,14 +13,14 @@ <div class="SRStatus" id="Loading">{{ tr.loading }}</div> <div id="SRResults"></div> <script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ createResults(); /* @license-end */ </script> <div class="SRStatus" id="Searching">{{ tr.searching }}</div> <div class="SRStatus" id="NoMatches">{{ tr.noMatches }}</div> <script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); diff --git a/templates/html/nomatches.tpl b/templates/html/nomatches.tpl new file mode 100644 index 0000000..94af265 --- /dev/null +++ b/templates/html/nomatches.tpl @@ -0,0 +1,13 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head><title></title> +<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> +<link rel="stylesheet" type="text/css" href="search.css"/> +<script type="text/javascript" src="search.js"></script> +</head> +<body class="SRPage"> +<div id="SRIndex"> +<div class="SRStatus" id="NoMatches">{{ tr.noMatches }}</div> +</div> +</body> +</html> |