From e58fb0a46f73f37d16859f43fda1eb5ba4a15c5d Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 8 Sep 2015 16:10:32 +0200 Subject: Template enhancements and various other small fixes --- src/context.cpp | 386 ++++++++++++++++++++++++++++++++---- src/context.h | 38 +++- src/definition.cpp | 23 +++ src/definition.h | 3 + src/diagram.cpp | 2 +- src/doxygen.cpp | 8 +- src/htmldocvisitor.cpp | 2 +- src/htmlgen.cpp | 8 +- src/index.cpp | 6 +- src/latexgen.cpp | 2 +- src/memberdef.cpp | 16 +- src/memberdef.h | 1 + src/memberlist.cpp | 4 +- src/template.cpp | 39 +++- src/translator_br.h | 4 +- src/translator_cn.h | 4 +- src/translator_cz.h | 4 +- src/translator_de.h | 4 +- src/translator_en.h | 4 +- src/translator_eo.h | 4 +- src/translator_es.h | 4 +- src/translator_fr.h | 4 +- src/translator_gr.h | 4 +- src/translator_it.h | 4 +- src/translator_jp.h | 4 +- src/translator_kr.h | 4 +- src/translator_lv.h | 4 +- src/translator_nl.h | 4 +- src/translator_pt.h | 4 +- src/translator_ro.h | 4 +- src/translator_ru.h | 4 +- src/translator_sk.h | 4 +- src/translator_sv.h | 4 +- src/translator_tw.h | 4 +- src/translator_ua.h | 4 +- src/util.cpp | 35 +++- src/util.h | 2 + templates/html/htmlannotated.tpl | 2 +- templates/html/htmlbase.tpl | 9 + templates/html/htmlclass.tpl | 10 +- templates/html/htmlclasses.tpl | 2 +- templates/html/htmldeclcomp.tpl | 1 - templates/html/htmldir.tpl | 16 +- templates/html/htmldirtree.tpl | 8 +- templates/html/htmlexample.tpl | 17 ++ templates/html/htmlexamples.tpl | 15 ++ templates/html/htmlfile.tpl | 8 +- templates/html/htmlfiles.tpl | 2 +- templates/html/htmlhierarchy.tpl | 2 +- templates/html/htmlindexpages.tpl | 2 +- templates/html/htmljsnavtree.tpl | 2 +- templates/html/htmllayout.tpl | 55 +++-- templates/html/htmlmembersindex.tpl | 20 +- templates/html/htmlmemdecl.tpl | 20 +- templates/html/htmlmemdef.tpl | 45 ++++- templates/html/htmlmodule.tpl | 8 +- templates/html/htmlmodules.tpl | 2 +- templates/html/htmlnamespace.tpl | 8 +- templates/html/htmlnamespaces.tpl | 2 +- templates/html/htmlnavtree.tpl | 2 +- templates/html/htmlobjlink.tpl | 6 +- templates/html/htmlpage.tpl | 8 +- templates/html/htmlpages.tpl | 2 +- templates/html/htmlsource.tpl | 16 +- templates/html/htmltabs.tpl | 2 +- templates/latex/latexclass.tpl | 4 +- templates/latex/latexfiles.tpl | 1 + templates/latex/latexmodules.tpl | 1 + templates/latex/latexnamespaces.tpl | 1 + 69 files changed, 739 insertions(+), 219 deletions(-) create mode 100644 templates/html/htmlexample.tpl create mode 100644 templates/html/htmlexamples.tpl diff --git a/src/context.cpp b/src/context.cpp index 8f9200e..c1cc57f 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -976,6 +976,18 @@ class TranslateContext::Private : public PropertyMapper { return theTranslator->trPanelSynchronisationTooltip(TRUE); } + TemplateVariant providedByCategory() const + { + return theTranslator->trProvidedByCategory(); + } + TemplateVariant extendsClass() const + { + return theTranslator->trExtendsClass(); + } + TemplateVariant examplesDescription() const + { + return theTranslator->trExamplesDescription(); + } Private() { //%% string generatedBy @@ -1156,6 +1168,12 @@ class TranslateContext::Private : public PropertyMapper addProperty("panelSyncOff", this,&Private::panelSyncOff); //%% string dirDependencyGraph addProperty("dirDependencyGraphFor", this,&Private::dirDependencyGraphFor); + //%% string providedByCategory + addProperty("providedByCategory", this,&Private::providedByCategory); + //%% string extendsClass + addProperty("extendsClass", this,&Private::extendsClass); + //%% string examplesDescription + addProperty("examplesDescription",this,&Private::examplesDescription); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); @@ -1349,6 +1367,12 @@ class DefinitionContext : public PropertyMapper addProperty("sourceDef",this,&DefinitionContext::sourceDef); //%% list[Definition] navigationPath: Breadcrumb navigation path to this item addProperty("navigationPath",this,&DefinitionContext::navigationPath); + //%% string kind: Kind of compound object: class, namespace, module, package, page, dir + addProperty("compoundKind",this,&DefinitionContext::compoundKind); + //%% bool isReference: is this definition imported via a tag file + addProperty("isReference",this,&DefinitionContext::isReference); + //%% string externalReference: the link to the element in the remote documentation + addProperty("externalReference",this,&DefinitionContext::externalReference); m_cache.sourceDef.reset(TemplateList::alloc()); m_cache.lineLink.reset(TemplateStruct::alloc()); @@ -1360,6 +1384,8 @@ class DefinitionContext : public PropertyMapper m_cache.lineLink->set("isLinkable",TRUE); m_cache.lineLink->set("fileName",m_def->getSourceFileBase()); m_cache.lineLink->set("anchor",m_def->getSourceAnchor()); + m_cache.lineLink->set("isReference",FALSE); + m_cache.lineLink->set("externalReference",""); if (m_def->definitionType()==Definition::TypeFile) { m_cache.fileLink->set("text",m_def->name()); @@ -1375,6 +1401,8 @@ class DefinitionContext : public PropertyMapper m_cache.fileLink->set("isLinkable",TRUE); m_cache.fileLink->set("fileName",m_def->getSourceFileBase()); m_cache.fileLink->set("anchor",QCString()); + m_cache.fileLink->set("isReference",FALSE); + m_cache.fileLink->set("externalReference",""); m_cache.sourceDef->append(m_cache.lineLink.get()); m_cache.sourceDef->append(m_cache.fileLink.get()); } @@ -1488,6 +1516,24 @@ class DefinitionContext : public PropertyMapper } return result; } + TemplateVariant compoundKind() const + { + QCString result = "unspecified"; + switch (m_def->definitionType()) + { + case DefinitionIntf::TypeClass: result="class"; break; + case DefinitionIntf::TypeFile: result="file"; break; + case DefinitionIntf::TypeNamespace: result="namespace"; break; + case DefinitionIntf::TypeGroup: result="module"; break; + case DefinitionIntf::TypePackage: result="package"; break; + case DefinitionIntf::TypePage: result="page"; break; + case DefinitionIntf::TypeDir: result="dir"; break; + case DefinitionIntf::TypeMember: // fall through + case DefinitionIntf::TypeSymbolList: + break; + } + return result; + } TemplateVariant sourceDef() const { if (m_cache.sourceDef->count()==2) @@ -1530,12 +1576,22 @@ class DefinitionContext : public PropertyMapper } return m_cache.navPath.get(); } + TemplateVariant isReference() const + { + return m_def->isReference(); + } + TemplateVariant externalReference() const + { + return m_def->externalReference(relPathAsString()); + } private: Definition *m_def; struct Cachable { - Cachable() { } + Cachable() : detailsOutputFormat(ContextOutputFormat_Unspecified), + briefOutputFormat(ContextOutputFormat_Unspecified), + inbodyDocsOutputFormat(ContextOutputFormat_Unspecified) { } ScopedPtr details; ContextOutputFormat detailsOutputFormat; ScopedPtr brief; @@ -1577,7 +1633,7 @@ class IncludeInfoContext::Private : public PropertyMapper } TemplateVariant isImport() const { - return m_info->imported; + return m_info->imported || m_lang==SrcLangExt_ObjC; } TemplateVariant file() const { @@ -1730,6 +1786,7 @@ class ClassContext::Private : public DefinitionContext addProperty("detailedProperties", this,&Private::detailedProperties); addProperty("detailedEvents", this,&Private::detailedEvents); addProperty("classes", this,&Private::classes); + addProperty("innerClasses", this,&Private::innerClasses); addProperty("compoundType", this,&Private::compoundType); addProperty("templateDecls", this,&Private::templateDecls); addProperty("typeConstraints", this,&Private::typeConstraints); @@ -1740,6 +1797,7 @@ class ClassContext::Private : public DefinitionContext addProperty("memberGroups", this,&Private::memberGroups); addProperty("additionalInheritedMembers",this,&Private::additionalInheritedMembers); addProperty("isSimple", this,&Private::isSimple); + addProperty("categoryOf", this,&Private::categoryOf); } virtual ~Private() {} TemplateVariant title() const @@ -1852,8 +1910,8 @@ class ClassContext::Private : public DefinitionContext t << "
" << endl; t << "getOutputFileBase(); - t << ".png\" usemap=\"#" << name << "_map\" alt=\"\"/>" << endl; - t << "" << endl; + t << ".png\" usemap=\"#" << convertToId(name) << "_map\" alt=\"\"/>" << endl; + t << "" << endl; d.writeImage(t,g_globals.outputDir, relPathAsString(), m_classDef->getOutputFileBase()); @@ -2161,6 +2219,31 @@ class ClassContext::Private : public DefinitionContext } return m_cache.classes.get(); } + TemplateVariant innerClasses() const + { + if (!m_cache.innerClasses) + { + TemplateList *classList = TemplateList::alloc(); + if (m_classDef->getClassSDict()) + { + ClassSDict::Iterator sdi(*m_classDef->getClassSDict()); + ClassDef *cd; + for (sdi.toFirst();(cd=sdi.current());++sdi) + { + if (cd->name().find('@')==-1 && + cd->isLinkableInProject() && + cd->isEmbeddedInOuterScope() && + cd->partOfGroups()==0 + ) + { + classList->append(ClassContext::alloc(cd)); + } + } + } + m_cache.innerClasses.reset(classList); + } + return m_cache.innerClasses.get(); + } TemplateVariant compoundType() const { return m_classDef->compoundTypeString(); @@ -2197,6 +2280,8 @@ class ClassContext::Private : public DefinitionContext s->set("isLinkable",TRUE); s->set("anchor",ex->anchor); s->set("fileName",ex->file); + s->set("isReference",FALSE); + s->set("externalReference",""); list->append(s); } } @@ -2367,6 +2452,21 @@ class ClassContext::Private : public DefinitionContext { return m_classDef->isSimple(); } + TemplateVariant categoryOf() const + { + if (!m_cache.categoryOf && m_classDef->categoryOf()) + { + m_cache.categoryOf.reset(ClassContext::alloc(m_classDef->categoryOf())); + } + if (m_cache.categoryOf) + { + return m_cache.categoryOf.get(); + } + else + { + return TemplateVariant(FALSE); + } + } private: ClassDef *m_classDef; @@ -2379,6 +2479,7 @@ class ClassContext::Private : public DefinitionContext ScopedPtr classGraph; ScopedPtr collaborationGraph; SharedPtr classes; + SharedPtr innerClasses; SharedPtr publicTypes; SharedPtr publicMethods; SharedPtr publicStaticMethods; @@ -2428,6 +2529,7 @@ class ClassContext::Private : public DefinitionContext SharedPtr members; SharedPtr usedFiles; SharedPtr exampleList; + SharedPtr categoryOf; int inheritanceNodes; MemberList allMembers; }; @@ -3302,12 +3404,14 @@ TemplateVariant DirContext::get(const char *n) const class PageContext::Private : public DefinitionContext { public: - Private(PageDef *pd,bool isMainPage) - : DefinitionContext(pd) , m_pageDef(pd), m_isMainPage(isMainPage) + Private(PageDef *pd,bool isMainPage,bool isExample) + : DefinitionContext(pd) , m_pageDef(pd), m_isMainPage(isMainPage), + m_isExample(isExample) { addProperty("title",this,&Private::title); addProperty("highlight",this,&Private::highlight); addProperty("subhighlight",this,&Private::subHighlight); + addProperty("example",this,&Private::example); } virtual ~Private() {} TemplateVariant title() const @@ -3323,6 +3427,10 @@ class PageContext::Private : public DefinitionContext return theTranslator->trMainPage(); } } + else if (m_isExample) + { + return m_pageDef->name(); + } else { return m_pageDef->title(); @@ -3354,15 +3462,41 @@ class PageContext::Private : public DefinitionContext { return ""; } + TemplateVariant example() const + { + if (m_isExample) + { + if (!m_cache.example || g_globals.outputFormat!=m_cache.exampleOutputFormat) + { + m_cache.example.reset(new TemplateVariant( + parseDoc(m_pageDef,m_pageDef->docFile(),m_pageDef->docLine(), + relPathAsString(),"\\include "+m_pageDef->name(),FALSE))); + m_cache.exampleOutputFormat = g_globals.outputFormat; + } + return *m_cache.example; + } + else + { + return TemplateVariant(""); + } + } private: PageDef *m_pageDef; + struct Cachable + { + Cachable() : exampleOutputFormat(ContextOutputFormat_Unspecified) { } + ScopedPtr example; + ContextOutputFormat exampleOutputFormat; + }; + mutable Cachable m_cache; bool m_isMainPage; + bool m_isExample; }; //%% } -PageContext::PageContext(PageDef *pd,bool isMainPage) : RefCountedContext("PageContext") +PageContext::PageContext(PageDef *pd,bool isMainPage,bool isExample) : RefCountedContext("PageContext") { - p = new Private(pd,isMainPage); + p = new Private(pd,isMainPage,isExample); } PageContext::~PageContext() @@ -3623,6 +3757,7 @@ class MemberContext::Private : public DefinitionContext addProperty("propertyAttrs", this,&Private::propertyAttrs); addProperty("eventAttrs", this,&Private::eventAttrs); addProperty("category", this,&Private::category); + addProperty("categoryRelation", this,&Private::categoryRelation); addProperty("class", this,&Private::getClass); addProperty("file", this,&Private::getFile); addProperty("namespace", this,&Private::getNamespace); @@ -3654,6 +3789,8 @@ class MemberContext::Private : public DefinitionContext addProperty("callerGraph", this,&Private::callerGraph); addProperty("fieldType", this,&Private::fieldType); addProperty("type", this,&Private::type); + addProperty("detailsVisibleFor", this,&Private::detailsVisibleFor); + addProperty("nameWithContextFor", this,&Private::nameWithContextFor); m_cache.propertyAttrs.reset(TemplateList::alloc()); if (md && md->isProperty()) @@ -4106,6 +4243,21 @@ class MemberContext::Private : public DefinitionContext return TemplateVariant(FALSE); } } + TemplateVariant categoryRelation() const + { + if (!m_cache.categoryRelation && m_memberDef->categoryRelation()) + { + m_cache.categoryRelation.reset(MemberContext::alloc(m_memberDef->categoryRelation())); + } + if (m_cache.categoryRelation) + { + return m_cache.categoryRelation.get(); + } + else + { + return TemplateVariant(FALSE); + } + } TemplateVariant getFile() const { if (!m_cache.fileDef && m_memberDef->getFileDef()) @@ -4388,6 +4540,8 @@ class MemberContext::Private : public DefinitionContext s->set("isLinkable",TRUE); s->set("anchor",ex->anchor); s->set("fileName",ex->file); + s->set("isReference",FALSE); + s->set("externalReference",""); list->append(s); } } @@ -4598,6 +4752,54 @@ class MemberContext::Private : public DefinitionContext { return m_memberDef->typeString(); } + TemplateVariant handleDetailsVisibleFor(const QValueList &args) const + { + if (args.count()==1) + { + return m_memberDef->isDetailedSectionVisible(args[0].toString()=="module",args[0].toString()=="file"); + } + else + { + err(".detailsVisibleFor should take one string argument, got %d\n",args.count()); + } + return TemplateVariant(); + } + TemplateVariant detailsVisibleFor() const + { + return TemplateVariant::Delegate::fromMethod(this); + } + TemplateVariant handleNameWithContextFor(const QValueList &args) const + { + if (args.count()==1) + { + SrcLangExt lang = m_memberDef->getLanguage(); + QCString n = m_memberDef->name(); + QCString ctx = args[0].toString(); + QCString sep = getLanguageSpecificSeparator(lang,TRUE); + if (m_memberDef->getEnumScope() && m_memberDef->livesInsideEnum()) + { + n.prepend(m_memberDef->getEnumScope()->displayName()+sep); + } + if (ctx=="module" && m_memberDef->getClassDef() && !m_memberDef->isRelated()) + { + n.prepend(m_memberDef->getClassDef()->displayName()+sep); + } + else if ((ctx=="module" || ctx=="file") && m_memberDef->getNamespaceDef()) + { + n.prepend(m_memberDef->getNamespaceDef()->displayName()+sep); + } + return n; + } + else + { + err(".nameWithContextFor should take one string argument, got %d\n",args.count()); + } + return TemplateVariant(); + } + TemplateVariant nameWithContextFor() const + { + return TemplateVariant::Delegate::fromMethod(this); + } private: MemberDef *m_memberDef; struct Cachable @@ -4611,6 +4813,7 @@ class MemberContext::Private : public DefinitionContext SharedPtr fileDef; SharedPtr namespaceDef; SharedPtr category; + SharedPtr categoryRelation; SharedPtr classDef; SharedPtr anonymousType; SharedPtr templateDecls; @@ -4818,7 +5021,7 @@ class ModuleContext::Private : public DefinitionContext PageDef *ex; for (eli.toFirst();(ex=eli.current());++eli) { - exampleList->append(PageContext::alloc(ex)); + exampleList->append(PageContext::alloc(ex,FALSE,TRUE)); } } m_cache.examples.reset(exampleList); @@ -4836,7 +5039,7 @@ class ModuleContext::Private : public DefinitionContext PageDef *ex; for (eli.toFirst();(ex=eli.current());++eli) { - pageList->append(PageContext::alloc(ex)); + pageList->append(PageContext::alloc(ex,FALSE,TRUE)); } } m_cache.pages.reset(pageList); @@ -5582,6 +5785,8 @@ class NestingNodeContext::Private : public PropertyMapper addProperty("isLinkable",this,&Private::isLinkable); addProperty("anchor",this,&Private::anchor); addProperty("fileName",this,&Private::fileName); + addProperty("isReference",this,&Private::isReference); + addProperty("externalReference",this,&Private::externalReference); addNamespaces(addCls); addClasses(inherit,hideSuper); @@ -5661,7 +5866,7 @@ class NestingNodeContext::Private : public PropertyMapper { if (!m_cache.pageContext && m_def->definitionType()==Definition::TypePage) { - m_cache.pageContext.reset(PageContext::alloc((PageDef*)m_def)); + m_cache.pageContext.reset(PageContext::alloc((PageDef*)m_def,FALSE,FALSE)); } if (m_cache.pageContext) { @@ -5735,6 +5940,14 @@ class NestingNodeContext::Private : public PropertyMapper { return m_def->getOutputFileBase(); } + TemplateVariant isReference() const + { + return m_def->isReference(); + } + TemplateVariant externalReference() const + { + return m_def->externalReference(relPathAsString()); + } //------------------------------------------------------------------ @@ -6680,13 +6893,13 @@ TemplateVariant FileTreeContext::get(const char *name) const class PageTreeContext::Private : public PropertyMapper { public: - Private() + Private(const PageSDict *pages) { m_pageTree.reset(NestingContext::alloc(0,0)); // Add pages - if (Doxygen::pageSDict) + if (pages) { - m_pageTree->addPages(*Doxygen::pageSDict,TRUE); + m_pageTree->addPages(*pages,TRUE); } //%% PageNodeList tree: @@ -6755,9 +6968,9 @@ class PageTreeContext::Private : public PropertyMapper }; //%% } -PageTreeContext::PageTreeContext() : RefCountedContext("PageTreeContext") +PageTreeContext::PageTreeContext(const PageSDict *pages) : RefCountedContext("PageTreeContext") { - p = new Private; + p = new Private(pages); } PageTreeContext::~PageTreeContext() @@ -6784,7 +6997,7 @@ class PageListContext::Private : public GenericNodeListContext { if (!pd->getGroupDef() && !pd->isReference()) { - append(PageContext::alloc(pd)); + append(PageContext::alloc(pd,FALSE,FALSE)); } } } @@ -6819,6 +7032,55 @@ TemplateListIntf::ConstIterator *PageListContext::createIterator() const //------------------------------------------------------------------------ +//%% list ExampleList[Page]: list of pages +class ExampleListContext::Private : public GenericNodeListContext +{ + public: + Private() + { + if (Doxygen::exampleSDict) + { + PageSDict::Iterator pdi(*Doxygen::exampleSDict); + PageDef *pd=0; + for (pdi.toFirst();(pd=pdi.current());++pdi) + { + if (!pd->getGroupDef() && !pd->isReference()) + { + append(PageContext::alloc(pd,FALSE,TRUE)); + } + } + } + } +}; + +ExampleListContext::ExampleListContext() : RefCountedContext("ExampleListContext") +{ + p = new Private; +} + +ExampleListContext::~ExampleListContext() +{ + delete p; +} + +// TemplateListIntf +int ExampleListContext::count() const +{ + return p->count(); +} + +TemplateVariant ExampleListContext::at(int index) const +{ + return p->at(index); +} + +TemplateListIntf::ConstIterator *ExampleListContext::createIterator() const +{ + return p->createIterator(); +} + +//------------------------------------------------------------------------ + //%% list ModuleList[ModuleNode]: list of directories and/or files class ModuleListContext::Private : public GenericNodeListContext { @@ -6974,6 +7236,8 @@ class NavPathElemContext::Private : public PropertyMapper addProperty("fileName",this,&Private::fileName); addProperty("anchor",this,&Private::anchor); addProperty("text",this,&Private::text); + addProperty("isReference",this,&Private::isReference); + addProperty("externalReference",this,&Private::externalReference); } TemplateVariant isLinkable() const { @@ -7008,6 +7272,19 @@ class NavPathElemContext::Private : public PropertyMapper } return text; } + TemplateVariant isReference() const + { + return m_def->isReference(); + } + QCString relPathAsString() const + { + static bool createSubdirs = Config_getBool("CREATE_SUBDIRS"); + return createSubdirs ? QCString("../../") : QCString(""); + } + TemplateVariant externalReference() const + { + return m_def->externalReference(relPathAsString()); + } private: Definition *m_def; }; @@ -7033,12 +7310,30 @@ TemplateVariant NavPathElemContext::get(const char *name) const //%% struct ExampleList: list of examples page //%% { -class ExampleListContext::Private : public PropertyMapper +class ExampleTreeContext::Private : public PropertyMapper { public: - TemplateVariant items() const + Private() { - return m_pageList.get(); + m_exampleTree.reset(NestingContext::alloc(0,0)); + // Add pages + if (Doxygen::exampleSDict) + { + m_exampleTree->addPages(*Doxygen::exampleSDict,TRUE); + } + + addProperty("tree",this,&Private::tree); + addProperty("fileName",this,&Private::fileName); + addProperty("relPath",this,&Private::relPath); + addProperty("highlight",this,&Private::highlight); + addProperty("subhighlight",this,&Private::subhighlight); + addProperty("title",this,&Private::title); + addProperty("preferredDepth",this,&Private::preferredDepth); + addProperty("maxDepth",this,&Private::maxDepth); + } + TemplateVariant tree() const + { + return m_exampleTree.get(); } TemplateVariant fileName() const { @@ -7060,33 +7355,49 @@ class ExampleListContext::Private : public PropertyMapper { return theTranslator->trExamples(); } - Private() + TemplateVariant maxDepth() const { - m_pageList.reset(PageListContext::alloc(Doxygen::exampleSDict)); - - addProperty("items",this,&Private::items); - addProperty("fileName",this,&Private::fileName); - addProperty("relPath",this,&Private::relPath); - addProperty("highlight",this,&Private::highlight); - addProperty("subhighlight",this,&Private::subhighlight); - addProperty("title",this,&Private::title); + if (!m_cache.maxDepthComputed) + { + m_cache.maxDepth = computeMaxDepth(m_exampleTree.get()); + m_cache.maxDepthComputed=TRUE; + } + return m_cache.maxDepth; + } + TemplateVariant preferredDepth() const + { + if (!m_cache.preferredDepthComputed) + { + m_cache.preferredDepth = computePreferredDepth(m_exampleTree.get(),maxDepth().toInt()); + m_cache.preferredDepthComputed=TRUE; + } + return m_cache.preferredDepth; } private: - SharedPtr m_pageList; + SharedPtr m_exampleTree; + struct Cachable + { + Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + int maxDepth; + bool maxDepthComputed; + int preferredDepth; + bool preferredDepthComputed; + }; + mutable Cachable m_cache; }; //%% } -ExampleListContext::ExampleListContext() : RefCountedContext("ExampleListContext") +ExampleTreeContext::ExampleTreeContext() : RefCountedContext("ExampleTreeContext") { p = new Private; } -ExampleListContext::~ExampleListContext() +ExampleTreeContext::~ExampleTreeContext() { delete p; } -TemplateVariant ExampleListContext::get(const char *name) const +TemplateVariant ExampleTreeContext::get(const char *name) const { return p->get(name); } @@ -9201,8 +9512,9 @@ void generateOutputViaTemplate() SharedPtr dirList (DirListContext::alloc()); SharedPtr fileList (FileListContext::alloc()); SharedPtr fileTree (FileTreeContext::alloc()); - SharedPtr pageTree (PageTreeContext::alloc()); + SharedPtr pageTree (PageTreeContext::alloc(Doxygen::pageSDict)); SharedPtr pageList (PageListContext::alloc(Doxygen::pageSDict)); + SharedPtr exampleTree (ExampleTreeContext::alloc()); SharedPtr exampleList (ExampleListContext::alloc()); SharedPtr moduleTree (ModuleTreeContext::alloc()); SharedPtr moduleList (ModuleListContext::alloc()); @@ -9237,6 +9549,8 @@ void generateOutputViaTemplate() ctx->set("pageList",pageList.get()); //%% PageTree pageTree ctx->set("pageTree",pageTree.get()); + //%% ExampleTree exampleTree + ctx->set("exampleTree",exampleTree.get()); //%% ExampleList exampleList ctx->set("exampleList",exampleList.get()); //%% ModuleTree moduleTree @@ -9248,7 +9562,7 @@ void generateOutputViaTemplate() //%% Page mainPage if (Doxygen::mainPage) { - SharedPtr mainPage(PageContext::alloc(Doxygen::mainPage,TRUE)); + SharedPtr mainPage(PageContext::alloc(Doxygen::mainPage,TRUE,FALSE)); ctx->set("mainPage",mainPage.get()); } else @@ -9256,7 +9570,7 @@ void generateOutputViaTemplate() // TODO: for LaTeX output index should be main... => solve in template Doxygen::mainPage = new PageDef("[generated]",1,"index","",theTranslator->trMainPage()); Doxygen::mainPage->setFileName("index",TRUE); - SharedPtr mainPage(PageContext::alloc(Doxygen::mainPage,TRUE)); + SharedPtr mainPage(PageContext::alloc(Doxygen::mainPage,TRUE,FALSE)); ctx->set("mainPage",mainPage.get()); } //%% GlobalsIndex globalsIndex: diff --git a/src/context.h b/src/context.h index 77a3a95..66b1634 100644 --- a/src/context.h +++ b/src/context.h @@ -329,7 +329,7 @@ class DirContext : public RefCountedContext, public TemplateStructIntf class PageContext : public RefCountedContext, public TemplateStructIntf { public: - static PageContext *alloc(PageDef *pd,bool isMainPage=FALSE) { return new PageContext(pd,isMainPage); } + static PageContext *alloc(PageDef *pd,bool isMainPage,bool isExample) { return new PageContext(pd,isMainPage,isExample); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -337,7 +337,7 @@ class PageContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - PageContext(PageDef *,bool isMainPage); + PageContext(PageDef *,bool isMainPage,bool isExample); ~PageContext(); class Private; Private *p; @@ -710,7 +710,7 @@ class PageListContext : public RefCountedContext, public TemplateListIntf class PageTreeContext : public RefCountedContext, public TemplateStructIntf { public: - static PageTreeContext *alloc() { return new PageTreeContext; } + static PageTreeContext *alloc(const PageSDict *pages) { return new PageTreeContext(pages); } // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -718,7 +718,7 @@ class PageTreeContext : public RefCountedContext, public TemplateStructIntf virtual int release() { return RefCountedContext::release(); } private: - PageTreeContext(); + PageTreeContext(const PageSDict *pages); ~PageTreeContext(); class Private; Private *p; @@ -788,13 +788,15 @@ class ModuleTreeContext : public RefCountedContext, public TemplateStructIntf //---------------------------------------------------- -class ExampleListContext : public RefCountedContext, public TemplateStructIntf +class ExampleListContext : public RefCountedContext, public TemplateListIntf { public: - static ExampleListContext *alloc() { return new ExampleListContext(); } + static ExampleListContext *alloc() { return new ExampleListContext; } - // TemplateStructIntf methods - virtual TemplateVariant get(const char *name) const; + // TemplateListIntf methods + virtual int count() const; + virtual TemplateVariant at(int index) const; + virtual TemplateListIntf::ConstIterator *createIterator() const; virtual int addRef() { return RefCountedContext::addRef(); } virtual int release() { return RefCountedContext::release(); } @@ -807,6 +809,26 @@ class ExampleListContext : public RefCountedContext, public TemplateStructIntf //---------------------------------------------------- + +class ExampleTreeContext : public RefCountedContext, public TemplateStructIntf +{ + public: + static ExampleTreeContext *alloc() { return new ExampleTreeContext; } + + // TemplateStructIntf methods + virtual TemplateVariant get(const char *name) const; + virtual int addRef() { return RefCountedContext::addRef(); } + virtual int release() { return RefCountedContext::release(); } + + private: + ExampleTreeContext(); + ~ExampleTreeContext(); + class Private; + Private *p; +}; + +//---------------------------------------------------- + class GlobalsIndexContext : public RefCountedContext, public TemplateStructIntf { public: diff --git a/src/definition.cpp b/src/definition.cpp index 457c6ea..a210295 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -1943,4 +1943,27 @@ bool Definition::hasBriefDescription() const return !briefDescription().isEmpty() && briefMemberDesc; } +QCString Definition::externalReference(const QCString &relPath) const +{ + QCString ref = getReference(); + if (!ref.isEmpty()) + { + QCString *dest = Doxygen::tagDestinationDict[ref]; + if (dest) + { + QCString result = *dest; + int l = result.length(); + if (!relPath.isEmpty() && l>0 && result.at(0)=='.') + { // relative path -> prepend relPath. + result.prepend(relPath); + l+=relPath.length(); + } + if (l>0 && result.at(l-1)!='/') result+='/'; + return result; + } + } + return relPath; +} + + diff --git a/src/definition.h b/src/definition.h index 5905a55..4fe953b 100644 --- a/src/definition.h +++ b/src/definition.h @@ -231,6 +231,9 @@ class Definition : public DefinitionIntf /*! Returns TRUE if this definition is imported via a tag file. */ virtual bool isReference() const; + /*! Convenience method to return a resolved external link */ + QCString externalReference(const QCString &relPath) const; + /*! Returns the first line of the body of this item (applicable to classes and * functions). */ diff --git a/src/diagram.cpp b/src/diagram.cpp index 994c1a4..8a6ccf6 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -274,7 +274,7 @@ static void writeMapArea(FTextStream &t,ClassDef *cd,QCString relPath, QCString tooltip = cd->briefDescriptionAsTooltip(); if (!tooltip.isEmpty()) { - t << "title=\"" << tooltip << "\" "; + t << "title=\"" << convertToHtml(tooltip) << "\" "; } t << "alt=\"" << convertToXML(cd->displayName()); t << "\" shape=\"rect\" coords=\"" << x << "," << y << ","; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 51b9341..841ad56 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -7847,7 +7847,7 @@ static void generateFileSources() QStrList filesInSameTu; fd->getAllIncludeFilesRecursively(filesInSameTu); fd->startParsing(); - if (fd->generateSourceFile()) // sources need to be shown in the output + if (fd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { msg("Generating code for file %s...\n",fd->docName().data()); fd->writeSource(*g_outputList,FALSE,filesInSameTu); @@ -7870,7 +7870,7 @@ static void generateFileSources() FileDef *ifd=findFileDef(Doxygen::inputNameDict,incFile,ambig); if (ifd && !ifd->isReference()) { - if (ifd->generateSourceFile()) // sources need to be shown in the output + if (ifd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { msg(" Generating code for file %s...\n",ifd->docName().data()); ifd->writeSource(*g_outputList,TRUE,moreFiles); @@ -7903,7 +7903,7 @@ static void generateFileSources() { QStrList filesInSameTu; fd->startParsing(); - if (fd->generateSourceFile()) // sources need to be shown in the output + if (fd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { msg("Generating code for file %s...\n",fd->docName().data()); fd->writeSource(*g_outputList,FALSE,filesInSameTu); @@ -7933,7 +7933,7 @@ static void generateFileSources() { QStrList filesInSameTu; fd->startParsing(); - if (fd->generateSourceFile()) // sources need to be shown in the output + if (fd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { msg("Generating code for file %s...\n",fd->docName().data()); fd->writeSource(*g_outputList,FALSE,filesInSameTu); diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 2e9795e..d1e4ffb 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -1927,7 +1927,7 @@ void HtmlDocVisitor::startLink(const QCString &ref,const QCString &file, if (!file.isEmpty()) m_t << file << Doxygen::htmlFileExtension; if (!anchor.isEmpty()) m_t << "#" << anchor; m_t << "\""; - if (!tooltip.isEmpty()) m_t << " title=\"" << substitute(tooltip,"\"",""") << "\""; + if (!tooltip.isEmpty()) m_t << " title=\"" << convertToHtml(tooltip) << "\""; m_t << ">"; } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 7e9c806..1b72661 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -549,7 +549,7 @@ void HtmlCodeGenerator::_writeCodeLink(const char *className, if (f) m_t << f << Doxygen::htmlFileExtension; if (anchor) m_t << "#" << anchor; m_t << "\""; - if (tooltip) m_t << " title=\"" << tooltip << "\""; + if (tooltip) m_t << " title=\"" << convertToHtml(tooltip) << "\""; m_t << ">"; docify(name); m_t << ""; @@ -1340,11 +1340,9 @@ void HtmlGenerator::endClassDiagram(const ClassDiagram &d, startSectionContent(t,m_sectionCount); t << "
" << endl; t << " \"\"/" << endl; - t << " " << endl; diff --git a/src/index.cpp b/src/index.cpp index 06d2185..272e86f 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1640,7 +1640,7 @@ static void writeAnnotatedClassList(OutputList &ol) static QCString letterToLabel(uint startLetter) { char s[11]; // max 0x12345678 + '\0' - if (startLetter>0x20 && startLetter<=0x7f) // printable ASCII character + if (isId(startLetter)) // printable ASCII character { s[0]=(char)startLetter; s[1]=0; @@ -2476,8 +2476,8 @@ static void writeQuickMemberIndex(OutputList &ol, anchor=fullName+extension+"#index_"; else anchor=fullName+"_"+letterToLabel(i)+extension+"#index_"; - startQuickIndexItem(ol,anchor+ci,i==page,TRUE,first); - ol.writeString(is); + startQuickIndexItem(ol,anchor+is,i==page,TRUE,first); + ol.writeString(ci); endQuickIndexItem(ol); first=FALSE; } diff --git a/src/latexgen.cpp b/src/latexgen.cpp index ad4cc89..681b575 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -47,7 +47,7 @@ LatexCodeGenerator::LatexCodeGenerator(FTextStream &t,const QCString &relPath,co setTextStream(t); } -LatexCodeGenerator::LatexCodeGenerator() : m_col(0) +LatexCodeGenerator::LatexCodeGenerator() : m_col(0), m_streamSet(FALSE) { m_prettyCode=Config_getBool("LATEX_SOURCE_CODE"); } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 7f93b51..9fcc2a2 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -967,7 +967,7 @@ QCString MemberDef::getOutputFileBase() const return baseName; } } - else if (m_impl->nspace) + else if (m_impl->nspace && m_impl->nspace->isLinkableInProject()) { baseName=m_impl->nspace->getOutputFileBase(); } @@ -1092,7 +1092,8 @@ void MemberDef::_computeLinkableInProject() m_isLinkableCached = 1; // in class but class not linkable return; } - if (!m_impl->group && m_impl->nspace && !m_impl->related && !m_impl->nspace->isLinkableInProject()) + if (!m_impl->group && m_impl->nspace && !m_impl->related && !m_impl->nspace->isLinkableInProject() + && (m_impl->fileDef==0 || !m_impl->fileDef->isLinkableInProject())) { //printf("in a namespace but namespace not linkable!\n"); m_isLinkableCached = 1; // in namespace but namespace not linkable @@ -1914,7 +1915,7 @@ bool MemberDef::isDetailedSectionVisible(bool inGroup,bool inFile) const static bool inlineSimpleStructs = Config_getBool("INLINE_SIMPLE_STRUCTS"); static bool hideUndocMembers = Config_getBool("HIDE_UNDOC_MEMBERS"); bool groupFilter = getGroupDef()==0 || inGroup || separateMemPages; - bool fileFilter = getNamespaceDef()==0 || !inFile; + bool fileFilter = getNamespaceDef()==0 || !getNamespaceDef()->isLinkable() || !inFile; bool simpleFilter = (hasBriefDescription() || !hideUndocMembers) && inlineSimpleStructs && getClassDef()!=0 && getClassDef()->isSimple(); @@ -2261,7 +2262,7 @@ void MemberDef::_writeCategoryRelation(OutputList &ol) text = theTranslator->trExtendsClass(); name = m_impl->classDef->categoryOf()->displayName(); } - i=text.find("@1"); + i=text.find("@0"); if (i!=-1) { MemberDef *md = m_impl->categoryRelation; @@ -2495,7 +2496,7 @@ void MemberDef::_writeGroupInclude(OutputList &ol,bool inGroup) if (isIDLorJava) ol.docify("\""); else ol.docify("<"); - if (fd && fd->isLinkable()) + if (fd->isLinkable()) { ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),fd->anchor(),nm); } @@ -4481,6 +4482,11 @@ MemberDef *MemberDef::getEnumScope() const return m_impl->enumScope; } +bool MemberDef::livesInsideEnum() const +{ + return m_impl->livesInsideEnum; +} + MemberList *MemberDef::enumFieldList() const { return m_impl->enumFields; diff --git a/src/memberdef.h b/src/memberdef.h index f60fb54..19a37ea 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -176,6 +176,7 @@ class MemberDef : public Definition bool protectionVisible() const; bool showInCallGraph() const; bool isStrongEnumValue() const; + bool livesInsideEnum() const; // derived getters bool isFriendToHide() const; diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 64fe44a..75e9785 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -435,8 +435,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, } delete rootNode; } - ol.endMemberDeclaration(md->anchor(),inheritId); ol.endMemberItem(); + ol.endMemberDeclaration(md->anchor(),inheritId); } md->warnIfUndocumented(); break; @@ -681,7 +681,7 @@ void MemberList::writeDocumentation(OutputList &ol, } if (memberGroupList) { - //printf("MemberList::writeDocumentation() -- member groups\n"); + printf("MemberList::writeDocumentation() -- member groups %d\n",memberGroupList->count()); MemberGroupListIterator mgli(*memberGroupList); MemberGroup *mg; for (;(mg=mgli.current());++mgli) diff --git a/src/template.cpp b/src/template.cpp index debd8fa..6ce187b 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -839,6 +839,31 @@ class FilterRaw //----------------------------------------------------------------------------- +/** @brief The implementation of the "list" filter */ +class FilterList +{ + public: + static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &) + { + if (v.isValid()) + { + if (v.type()==TemplateVariant::List) // input is already a list + { + return v; + } + // create a list with v as the only element + TemplateList *list = TemplateList::alloc(); + list->append(v); + return list; + } + else + { + return v; + } + } +}; + +//----------------------------------------------------------------------------- /** @brief The implementation of the "texlabel" filter */ class FilterTexLabel { @@ -1268,16 +1293,19 @@ class FilterAlphaIndex static QCString keyToLabel(uint startLetter) { char s[11]; // 0x12345678 + '\0' - if (startLetter>0x20 && startLetter<=0x7f) // printable ASCII character + if ((startLetter>='0' && startLetter<='9') || + (startLetter>='a' && startLetter<='z') || + (startLetter>='A' && startLetter<='Z')) { - s[0]=tolower((char)startLetter); - s[1]=0; + int i=0; + if (startLetter>='0' && startLetter<='9') s[i++] = 'x'; + s[i++]=tolower((char)startLetter); + s[i++]=0; } else { const char hex[]="0123456789abcdef"; int i=0; - s[i++]='0'; s[i++]='x'; if (startLetter>(1<<24)) // 4 byte character { @@ -1492,6 +1520,7 @@ class TemplateFilterFactory static TemplateFilterFactory::AutoRegister fAdd("add"); static TemplateFilterFactory::AutoRegister fGet("get"); static TemplateFilterFactory::AutoRegister fRaw("raw"); +static TemplateFilterFactory::AutoRegister fList("list"); static TemplateFilterFactory::AutoRegister fAppend("append"); static TemplateFilterFactory::AutoRegister fLength("length"); static TemplateFilterFactory::AutoRegister fNoWrap("nowrap"); @@ -2429,7 +2458,7 @@ class TemplateImpl : public TemplateNode, public Template TemplateContextImpl::TemplateContextImpl(const TemplateEngine *e) : m_engine(e), m_templateName(""), m_line(1), m_activeEscapeIntf(0), - m_spacelessIntf(0), m_spacelessEnabled(FALSE), m_indices(TemplateStruct::alloc()) + m_spacelessIntf(0), m_spacelessEnabled(FALSE), m_tabbingEnabled(FALSE), m_indices(TemplateStruct::alloc()) { m_indexStacks.setAutoDelete(TRUE); m_contextStack.setAutoDelete(TRUE); diff --git a/src/translator_br.h b/src/translator_br.h index 6a7966f..f9fe664 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -1903,7 +1903,7 @@ class TranslatorBrazilian : public Translator */ virtual QCString trProvidedByCategory() { - return "Provido pela categoria @1."; + return "Provido pela categoria @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1912,7 +1912,7 @@ class TranslatorBrazilian : public Translator */ virtual QCString trExtendsClass() { - return "estende a classe @1."; + return "estende a classe @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_cn.h b/src/translator_cn.h index 26160d4..8d8e4ae 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -1815,7 +1815,7 @@ class TranslatorChinese : public Translator */ virtual QCString trProvidedByCategory() { - return "由 category @1 提供."; + return "由 category @0 提供."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1824,7 +1824,7 @@ class TranslatorChinese : public Translator */ virtual QCString trExtendsClass() { - return "扩展类 @1."; + return "扩展类 @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_cz.h b/src/translator_cz.h index 2ddc029..e4a5692 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -1936,7 +1936,7 @@ class TranslatorCzech : public Translator */ virtual QCString trProvidedByCategory() { - return "Deklarováno v kategorii @1."; + return "Deklarováno v kategorii @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1945,7 +1945,7 @@ class TranslatorCzech : public Translator */ virtual QCString trExtendsClass() { - return "Rozšiřuje třídu @1."; + return "Rozšiřuje třídu @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_de.h b/src/translator_de.h index f2ca676..7d3d63a 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -1995,7 +1995,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_4 */ virtual QCString trProvidedByCategory() { - return "Bestandteil der Kategorie @1."; + return "Bestandteil der Kategorie @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -2004,7 +2004,7 @@ class TranslatorGerman : public TranslatorAdapter_1_8_4 */ virtual QCString trExtendsClass() { - return "Erweitert Klasse @1."; + return "Erweitert Klasse @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_en.h b/src/translator_en.h index ba89726..a72c05a 100644 --- a/src/translator_en.h +++ b/src/translator_en.h @@ -1893,7 +1893,7 @@ class TranslatorEnglish : public Translator */ virtual QCString trProvidedByCategory() { - return "Provided by category @1."; + return "Provided by category @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1902,7 +1902,7 @@ class TranslatorEnglish : public Translator */ virtual QCString trExtendsClass() { - return "Extends class @1."; + return "Extends class @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_eo.h b/src/translator_eo.h index 65f7e82..5415e81 100644 --- a/src/translator_eo.h +++ b/src/translator_eo.h @@ -1898,7 +1898,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4 */ virtual QCString trProvidedByCategory() { - return "Provizita de kategorio @1."; + return "Provizita de kategorio @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1907,7 +1907,7 @@ class TranslatorEsperanto : public TranslatorAdapter_1_8_4 */ virtual QCString trExtendsClass() { - return "Etendi klason @1."; + return "Etendi klason @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_es.h b/src/translator_es.h index 97d1d26..1b75465 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -1957,7 +1957,7 @@ class TranslatorSpanish : public Translator */ virtual QCString trProvidedByCategory() { - return "Proporcionado por categoría @1."; + return "Proporcionado por categoría @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1966,7 +1966,7 @@ class TranslatorSpanish : public Translator */ virtual QCString trExtendsClass() { - return "Extiende la clase @1."; + return "Extiende la clase @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_fr.h b/src/translator_fr.h index e1fb5e6..65e77df 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -1954,7 +1954,7 @@ class TranslatorFrench : public Translator */ virtual QCString trProvidedByCategory() { - return "Déclarée dans la catégorie @1."; + return "Déclarée dans la catégorie @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1963,7 +1963,7 @@ class TranslatorFrench : public Translator */ virtual QCString trExtendsClass() { - return "Dérive la classe @1."; + return "Dérive la classe @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_gr.h b/src/translator_gr.h index e264deb..97eebc4 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -1864,7 +1864,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_4 */ virtual QCString trProvidedByCategory() { - return "Παρέχεται από την κατηγορία @1."; + return "Παρέχεται από την κατηγορία @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1873,7 +1873,7 @@ class TranslatorGreek : public TranslatorAdapter_1_8_4 */ virtual QCString trExtendsClass() { - return "Κληρονομει την κλάση @1."; + return "Κληρονομει την κλάση @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_it.h b/src/translator_it.h index d27c9dd..e2c51c7 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -1877,7 +1877,7 @@ class TranslatorItalian : public Translator */ virtual QCString trProvidedByCategory() { - return "Fornito dalla categoria @1."; + return "Fornito dalla categoria @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1886,7 +1886,7 @@ class TranslatorItalian : public Translator */ virtual QCString trExtendsClass() { - return "Estende la classe @1."; + return "Estende la classe @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_jp.h b/src/translator_jp.h index 66f1ac6..4dc9cba 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -1878,7 +1878,7 @@ class TranslatorJapanese : public Translator */ virtual QCString trProvidedByCategory() { - return "@1 カテゴリーから提供されています。"; + return "@0 カテゴリーから提供されています。"; } /*! Used in a method of an Objective-C category that extends a class. @@ -1887,7 +1887,7 @@ class TranslatorJapanese : public Translator */ virtual QCString trExtendsClass() { - return "@1 を拡張しています。"; + return "@0 を拡張しています。"; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_kr.h b/src/translator_kr.h index 7d669a5..2ef50e8 100644 --- a/src/translator_kr.h +++ b/src/translator_kr.h @@ -1903,7 +1903,7 @@ class TranslatorKorean : public Translator */ virtual QCString trProvidedByCategory() { - return "카테고리 @1에 의해 제공됨."; + return "카테고리 @0에 의해 제공됨."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1912,7 +1912,7 @@ class TranslatorKorean : public Translator */ virtual QCString trExtendsClass() { - return "클래스 @1 확장."; + return "클래스 @0 확장."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_lv.h b/src/translator_lv.h index 20b2a38..35aab0f 100644 --- a/src/translator_lv.h +++ b/src/translator_lv.h @@ -1901,7 +1901,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4 */ virtual QCString trProvidedByCategory() { - return "Nodrošina kategorija @1."; + return "Nodrošina kategorija @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1910,7 +1910,7 @@ class TranslatorLatvian : public TranslatorAdapter_1_8_4 */ virtual QCString trExtendsClass() { - return "Paplašina klasi @1."; + return "Paplašina klasi @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_nl.h b/src/translator_nl.h index ab811a5..241cf97 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -1488,7 +1488,7 @@ class TranslatorDutch : public Translator */ virtual QCString trProvidedByCategory() { - return "Wordt aangeboden door category @1."; + return "Wordt aangeboden door category @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1497,7 +1497,7 @@ class TranslatorDutch : public Translator */ virtual QCString trExtendsClass() { - return "Uitbereiding van klasse @1."; + return "Uitbereiding van klasse @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_pt.h b/src/translator_pt.h index 5edfdf6..5df58d7 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -1903,7 +1903,7 @@ class TranslatorPortuguese : public Translator */ virtual QCString trProvidedByCategory() { - return "Provido pela categoria @1."; + return "Provido pela categoria @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1912,7 +1912,7 @@ class TranslatorPortuguese : public Translator */ virtual QCString trExtendsClass() { - return "estende a classe @1."; + return "estende a classe @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_ro.h b/src/translator_ro.h index 394e570..eba7d47 100644 --- a/src/translator_ro.h +++ b/src/translator_ro.h @@ -1908,7 +1908,7 @@ class TranslatorRomanian : public Translator */ virtual QCString trProvidedByCategory() { - return "Furnizat de categoria @1."; + return "Furnizat de categoria @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1917,7 +1917,7 @@ class TranslatorRomanian : public Translator */ virtual QCString trExtendsClass() { - return "Extinde clasa @1."; + return "Extinde clasa @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_ru.h b/src/translator_ru.h index c06027c..2162a34 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -1869,7 +1869,7 @@ class TranslatorRussian : public Translator */ virtual QCString trProvidedByCategory() { - return "По группам @1."; + return "По группам @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1878,7 +1878,7 @@ class TranslatorRussian : public Translator */ virtual QCString trExtendsClass() { - return "Расширяет класс @1."; + return "Расширяет класс @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_sk.h b/src/translator_sk.h index 875e92c..d6d94a6 100644 --- a/src/translator_sk.h +++ b/src/translator_sk.h @@ -1866,7 +1866,7 @@ class TranslatorSlovak : public Translator */ virtual QCString trProvidedByCategory() { - return "Deklarované v kategórii @1."; + return "Deklarované v kategórii @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1875,7 +1875,7 @@ class TranslatorSlovak : public Translator */ virtual QCString trExtendsClass() { - return "Rozširuje triedu @1."; + return "Rozširuje triedu @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_sv.h b/src/translator_sv.h index 68b8a1b..d491632 100644 --- a/src/translator_sv.h +++ b/src/translator_sv.h @@ -1764,7 +1764,7 @@ class TranslatorSwedish : public Translator */ virtual QCString trProvidedByCategory() { - return "Tillhandahålls av kategori @1."; + return "Tillhandahålls av kategori @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1773,7 +1773,7 @@ class TranslatorSwedish : public Translator */ virtual QCString trExtendsClass() { - return "Utökar klass @1."; + return "Utökar klass @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_tw.h b/src/translator_tw.h index 31aeede..79bf6f5 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -1866,7 +1866,7 @@ class TranslatorChinesetraditional : public Translator */ virtual QCString trProvidedByCategory() { - return "由 @1 分類所提供."; + return "由 @0 分類所提供."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1875,7 +1875,7 @@ class TranslatorChinesetraditional : public Translator */ virtual QCString trExtendsClass() { - return "延伸 @1 類別 ."; + return "延伸 @0 類別 ."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/translator_ua.h b/src/translator_ua.h index 871acd1..964285b 100644 --- a/src/translator_ua.h +++ b/src/translator_ua.h @@ -1866,7 +1866,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4 */ virtual QCString trProvidedByCategory() { - return "Забезпечено категорією @1."; + return "Забезпечено категорією @0."; } /*! Used in a method of an Objective-C category that extends a class. @@ -1875,7 +1875,7 @@ class TranslatorUkrainian : public TranslatorAdapter_1_8_4 */ virtual QCString trExtendsClass() { - return "Розширює клас @1."; + return "Розширює клас @0."; } /*! Used as the header of a list of class methods in Objective-C. diff --git a/src/util.cpp b/src/util.cpp index 1a94830..432a76f 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -5676,6 +5676,37 @@ QCString stripScope(const char *name) return name; } +/*! Converts a string to a HTML id string */ +QCString convertToId(const char *s) +{ + static const char hex[] = "0123456789ABCDEF"; + static GrowBuf growBuf; + growBuf.clear(); + if (s==0) return ""; + const char *p=s; + char c; + bool first=TRUE; + while ((c=*p++)) + { + char encChar[4]; + if ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z') || c=='-' || c==':' || c=='.') + { // any permissive character except _ + if (first && c>='0' && c<='9') growBuf.addChar('a'); // don't start with a digit + growBuf.addChar(c); + } + else + { + encChar[0]='_'; + encChar[1]=hex[((unsigned char)c)>>4]; + encChar[2]=hex[((unsigned char)c)&0xF]; + encChar[3]=0; + growBuf.addStr(encChar); + } + first=FALSE; + } + growBuf.addChar(0); + return growBuf.get(); +} /*! Converts a string to an XML-encoded string */ QCString convertToXML(const char *s) @@ -6519,8 +6550,10 @@ void filterLatexString(FTextStream &t,const char *str, case '}': t << "\\}"; break; case '_': t << "\\_"; break; case ' ': if (keepSpaces) t << "~"; else t << ' '; - default: + break; + default: t << (char)c; + break; } } else diff --git a/src/util.h b/src/util.h index acb3e92..6c72594 100755 --- a/src/util.h +++ b/src/util.h @@ -274,6 +274,8 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te QCString stripScope(const char *name); +QCString convertToId(const char *s); + QCString convertToHtml(const char *s,bool keepEntities=TRUE); QCString convertToLaTeX(const QCString &s,bool insideTabbing=FALSE,bool keepSpaces=FALSE); diff --git a/templates/html/htmlannotated.tpl b/templates/html/htmlannotated.tpl index dd72ac9..c5faa14 100644 --- a/templates/html/htmlannotated.tpl +++ b/templates/html/htmlannotated.tpl @@ -4,7 +4,7 @@
{{ tr.classListDescription }}
-{% indexentry nav name=tr.classes file=page.fileName anchor='' %} +{% indexentry nav name=tr.classes file=page.fileName anchor='' isReference=False %} {% opensubindex nav %} {% with tree=classTree %} {% include 'htmldirtree.tpl' %} diff --git a/templates/html/htmlbase.tpl b/templates/html/htmlbase.tpl index 84807ec..aacaf92 100644 --- a/templates/html/htmlbase.tpl +++ b/templates/html/htmlbase.tpl @@ -192,6 +192,15 @@ $(document).ready(function(){initNavTree('{{ page.fileName }}{% if page_postfix