summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-02-08 22:33:01 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-02-08 22:33:01 (GMT)
commit9434ecb13e1f3e2901b78d3e41e7f1d7d9469434 (patch)
tree2bfe20210fbbcf2f05bca002eca960061ecf1b66
parentae3a22ba276a2e446a460274e0bff8a9bdf4af7d (diff)
downloadDoxygen-9434ecb13e1f3e2901b78d3e41e7f1d7d9469434.zip
Doxygen-9434ecb13e1f3e2901b78d3e41e7f1d7d9469434.tar.gz
Doxygen-9434ecb13e1f3e2901b78d3e41e7f1d7d9469434.tar.bz2
Add template context for annotated class index
-rw-r--r--src/context.cpp57
-rw-r--r--src/namespacedef.cpp18
-rw-r--r--src/namespacedef.h1
3 files changed, 65 insertions, 11 deletions
diff --git a/src/context.cpp b/src/context.cpp
index 055e653..d741f48 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -1990,6 +1990,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
addProperty("highlight",this,&Private::highlight);
addProperty("subhighlight",this,&Private::subHighlight);
addProperty("compoundType",this,&Private::compoundType);
+ addProperty("hasDetails",this,&Private::hasDetails);
}
TemplateVariant title() const
{
@@ -2007,6 +2008,10 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri
{
return m_namespaceDef->compoundTypeString();
}
+ TemplateVariant hasDetails() const
+ {
+ return m_namespaceDef->hasDetailedDescription();
+ }
private:
NamespaceDef *m_namespaceDef;
};
@@ -4074,11 +4079,18 @@ class NestingNodeContext::Private : public PropertyMapper
addProperty("class",this,&Private::getClass);
//%% [optional] Namespace namespace: namespace info (if this node represents a namespace)
addProperty("namespace",this,&Private::getNamespace);
- //%% [optional] file
- //%% id
+ //%% int id
addProperty("id",this,&Private::id);
- //%% level
+ //%% string level
addProperty("level",this,&Private::level);
+ //%% string name
+ addProperty("name",this,&Private::name);
+ //%% string brief
+ addProperty("brief",this,&Private::brief);
+ //%% bool isLinkable
+ addProperty("isLinkable",this,&Private::isLinkable);
+ addProperty("anchor",this,&Private::anchor);
+ addProperty("fileName",this,&Private::fileName);
addNamespaces(addCls);
addClasses();
@@ -4132,7 +4144,43 @@ class NestingNodeContext::Private : public PropertyMapper
result+=QCString().setNum(m_index)+"_";
return result;
}
-
+ TemplateVariant name() const
+ {
+ return m_def->name();
+ }
+ QCString relPathAsString() const
+ {
+ static bool createSubdirs = Config_getBool("CREATE_SUBDIRS");
+ return createSubdirs ? QCString("../../") : QCString("");
+ }
+ TemplateVariant brief() const
+ {
+ if (!m_cache.brief)
+ {
+ if (m_def->hasBriefDescription())
+ {
+ m_cache.brief.reset(new TemplateVariant(parseDoc(m_def,m_def->briefFile(),m_def->briefLine(),
+ "",m_def->briefDescription(),TRUE)));
+ }
+ else
+ {
+ m_cache.brief.reset(new TemplateVariant(""));
+ }
+ }
+ return *m_cache.brief;
+ }
+ TemplateVariant isLinkable() const
+ {
+ return m_def->isLinkable();
+ }
+ TemplateVariant anchor() const
+ {
+ return m_def->anchor();
+ }
+ TemplateVariant fileName() const
+ {
+ return m_def->getOutputFileBase();
+ }
void addClasses()
{
@@ -4164,6 +4212,7 @@ class NestingNodeContext::Private : public PropertyMapper
{
ScopedPtr<ClassContext> classContext;
ScopedPtr<NamespaceContext> namespaceContext;
+ ScopedPtr<TemplateVariant> brief;
};
mutable Cachable m_cache;
};
diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp
index 146e8da..777eb46 100644
--- a/src/namespacedef.cpp
+++ b/src/namespacedef.cpp
@@ -248,11 +248,17 @@ void NamespaceDef::computeAnchors()
if (allMemberList) setAnchors(allMemberList);
}
+bool NamespaceDef::hasDetailedDescription() const
+{
+ static bool repeatBrief = Config_getBool("REPEAT_BRIEF");
+ return ((!briefDescription().isEmpty() && repeatBrief) ||
+ !documentation().isEmpty());
+}
+
+
void NamespaceDef::writeDetailedDescription(OutputList &ol,const QCString &title)
{
- if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) ||
- !documentation().isEmpty()
- )
+ if (hasDetailedDescription())
{
ol.pushGeneratorState();
ol.disable(OutputGenerator::Html);
@@ -294,7 +300,7 @@ void NamespaceDef::writeDetailedDescription(OutputList &ol,const QCString &title
void NamespaceDef::writeBriefDescription(OutputList &ol)
{
- if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
+ if (hasBriefDescription())
{
DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0,
briefDescription(),TRUE,FALSE,0,TRUE,FALSE);
@@ -307,9 +313,7 @@ void NamespaceDef::writeBriefDescription(OutputList &ol)
ol.writeString(" \n");
ol.enable(OutputGenerator::RTF);
- if (Config_getBool("REPEAT_BRIEF") ||
- !documentation().isEmpty()
- )
+ if (hasDetailedDescription())
{
ol.disableAllBut(OutputGenerator::Html);
ol.startTextLink(0,"details");
diff --git a/src/namespacedef.h b/src/namespacedef.h
index c4afac9..a68d2d8 100644
--- a/src/namespacedef.h
+++ b/src/namespacedef.h
@@ -71,6 +71,7 @@ class NamespaceDef : public Definition
bool isLinkableInProject() const;
bool isLinkable() const;
+ bool hasDetailedDescription() const;
void addMembersToMemberGroup();
void distributeMemberGroupDocumentation();
void findSectionsInDocumentation();