From f16c156065ac8bc6242870c2ae701252b5d4f9b2 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 30 Dec 2014 17:01:34 +0100 Subject: Added missing information to template version of the all members list --- src/context.cpp | 38 +++++++++++++++++++++++-- templates/html/htmlallmembers.tpl | 59 +++++++++++++++++++++++++++++++++++---- templates/html/htmlmemdef.tpl | 14 ++++++---- 3 files changed, 98 insertions(+), 13 deletions(-) diff --git a/src/context.cpp b/src/context.cpp index 7206535..17229f7 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -895,6 +895,14 @@ class TranslateContext::Private : public PropertyMapper { return theTranslator->trNoMatches(); } + TemplateVariant enumName() const + { + return theTranslator->trEnumName(); + } + TemplateVariant enumValue() const + { + return theTranslator->trEnumValue(); + } Private() { //%% string generatedBy @@ -1049,6 +1057,10 @@ class TranslateContext::Private : public PropertyMapper addProperty("searching", this,&Private::searching); //%% string noMatches addProperty("noMatches", this,&Private::noMatches); + //%% string enumValue + addProperty("enumValue", this,&Private::enumValue); + //%% string enumName + addProperty("enumName", this,&Private::enumName); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); @@ -3211,6 +3223,7 @@ class MemberContext::Private : public DefinitionContext addProperty("isObjCMethod", this,&Private::isObjCMethod); addProperty("isObjCProperty", this,&Private::isObjCProperty); addProperty("isAnonymous", this,&Private::isAnonymous); + addProperty("hasParameters", this,&Private::hasParameters); addProperty("declType", this,&Private::declType); addProperty("declArgs", this,&Private::declArgs); addProperty("anonymousType", this,&Private::anonymousType); @@ -3226,12 +3239,12 @@ class MemberContext::Private : public DefinitionContext addProperty("templateAlias", this,&Private::templateAlias); addProperty("propertyAttrs", this,&Private::propertyAttrs); addProperty("eventAttrs", this,&Private::eventAttrs); + addProperty("category", this,&Private::category); addProperty("class", this,&Private::getClass); addProperty("file", this,&Private::getFile); addProperty("namespace", this,&Private::getNamespace); addProperty("definition", this,&Private::definition); addProperty("parameters", this,&Private::parameters); - addProperty("hasParameterList", this,&Private::hasParameterList); addProperty("hasConstQualifier", this,&Private::hasConstQualifier); addProperty("hasVolatileQualifier",this,&Private::hasVolatileQualifier); addProperty("trailingReturnType", this,&Private::trailingReturnType); @@ -3257,6 +3270,7 @@ class MemberContext::Private : public DefinitionContext addProperty("hasCallerGraph", this,&Private::hasCallerGraph); addProperty("callerGraph", this,&Private::callerGraph); addProperty("fieldType", this,&Private::fieldType); + addProperty("type", this,&Private::type); m_cache.propertyAttrs.reset(TemplateList::alloc()); if (md && md->isProperty()) @@ -3694,6 +3708,21 @@ class MemberContext::Private : public DefinitionContext return TemplateVariant(FALSE); } } + TemplateVariant category() const + { + if (!m_cache.category && m_memberDef->category()) + { + m_cache.category.reset(ClassContext::alloc(m_memberDef->category())); + } + if (m_cache.category) + { + return m_cache.category.get(); + } + else + { + return TemplateVariant(FALSE); + } + } TemplateVariant getFile() const { if (!m_cache.fileDef && m_memberDef->getFileDef()) @@ -3750,7 +3779,7 @@ class MemberContext::Private : public DefinitionContext } return m_cache.arguments.get(); } - TemplateVariant hasParameterList() const + TemplateVariant hasParameters() const { return getDefArgList()!=0; } @@ -4142,6 +4171,10 @@ class MemberContext::Private : public DefinitionContext return TemplateVariant(""); } } + TemplateVariant type() const + { + return m_memberDef->typeString(); + } private: MemberDef *m_memberDef; struct Cachable @@ -4154,6 +4187,7 @@ class MemberContext::Private : public DefinitionContext SharedPtr enumValues; SharedPtr fileDef; SharedPtr namespaceDef; + SharedPtr category; SharedPtr classDef; SharedPtr anonymousType; SharedPtr templateDecls; diff --git a/templates/html/htmlallmembers.tpl b/templates/html/htmlallmembers.tpl index e4b8460..b44110d 100644 --- a/templates/html/htmlallmembers.tpl +++ b/templates/html/htmlallmembers.tpl @@ -10,13 +10,62 @@ {% for mi in compound.allMembersList %} - {# TODO: objective-C #} - + {% endif %} + {% if member.isObjCMethod %} + + {%else %} + {# name #} + + {% endif %} + {# class link #} + + {# labels #} + {% if member.labels %} + + {% endif %} + {% endwith %} + {% endspaceless %} {% endfor %}
{% with obj=mi.member text=mi.ambiguityScope|append:mi.member.name %} - {% include 'htmlobjlink.tpl' %} + {% spaceless %} + {% with member=mi.member %} + {% if member.language=='objc' %} + + {% if member.isObjCMethod %} + {% if member.isStatic %}+ {% else %}- {% endif %} + {% endif %} + + {% with obj=member text=member.name %} + {% include 'htmlobjlink.tpl' %} + {% endwith %} + + {% with obj=member text=mi.ambiguityScope|append:member.name %} + {% include 'htmlobjlink.tpl' %} {% endwith %} - {# TODO: add arguments #} - {# TODO: add column with scope #} + {% if member.isEnumeration %} +  {{ tr.enumName }} + {% elif member.isEnumValue %} +  {{ tr.enumValue }} + {% elif member.isTypedef %} +  typedef + {% elif member.isFriend and member.type=='friend class' %} +  class + {% elif member.isFunction or member.isSignal or member.isSlot or (member.isFriend and member.hasParameters) %} + {{ member.declArgs }} + {% endif %} + + {% if member.category %} + {% with obj=member.category text=member.category.name %} + {% include 'htmlobjlink.tpl' %} + {% endwith %} + {% else %} + {% with obj=member.class text=member.class.name %} + {% include 'htmlobjlink.tpl' %} + {% endwith %} + {% endif %} + {% for label in member.labels %} + {{ label }} + {% endfor %} +
diff --git a/templates/html/htmlmemdef.tpl b/templates/html/htmlmemdef.tpl index c469f1f..be4d94e 100644 --- a/templates/html/htmlmemdef.tpl +++ b/templates/html/htmlmemdef.tpl @@ -1,6 +1,6 @@ {# inputs: memberListInfo #} {% if memberListInfo %} - {% if memberListInfo.members|length>0 %} + {% if memberListInfo.members %}

{{ memberListInfo.title }}

{% for member in memberListInfo.members %} {% if member.hasDetails %} {# TODO: not the same as isDetailedSectionVisible! #} @@ -9,7 +9,7 @@
{# write template declarations #} - {% if member.language=='cpp' and member.templateDecls|length>0 %} + {% if member.language=='cpp' and member.templateDecls %} {% for targList in member.templateDecls %} {% spaceless %}
@@ -23,7 +23,7 @@ {% endfor %} {% endif %} {# start of labels if present #} - {% if member.labels|length>0 %} + {% if member.labels %}
{% endif %} @@ -31,9 +31,11 @@ {{ member.definition }} {# write argument list #} {# TODO: TCL #} - {% if member.hasParameterList %} + {% if member.hasParameters %} {% if member.isObjCMethod %} + {% if member.parameters %} + {% endif %} {% for arg in member.parameters %} {% if not forloop.first %} @@ -43,7 +45,7 @@ {% if not arg.name %}{{ arg.type }}{% else %}{{ arg.name }}{% endif %} {% endif %} {% if not forloop.last %} - , + {% endif %} {% endfor %} {% else %} @@ -109,7 +111,7 @@
{{ arg.namePart }}
{# end of labels if present #} - {% if member.labels|length>0 %} + {% if member.labels %}
{% spaceless %} {% for label in member.labels %} {{ label }} -- cgit v0.12