Commit 31198c21 authored by Dimitri van Heesch's avatar Dimitri van Heesch

More template and context updates

parent 7cda115a
This diff is collapsed.
...@@ -31,6 +31,7 @@ class ClassList; ...@@ -31,6 +31,7 @@ class ClassList;
class ClassSDict; class ClassSDict;
class OutputList; class OutputList;
class FileDef; class FileDef;
class FileList;
class BaseClassList; class BaseClassList;
class NamespaceDef; class NamespaceDef;
class MemberDef; class MemberDef;
...@@ -125,9 +126,6 @@ class ClassDef : public Definition ...@@ -125,9 +126,6 @@ class ClassDef : public Definition
/** returns TRUE if this class has documentation */ /** returns TRUE if this class has documentation */
bool hasDocumentation() const; bool hasDocumentation() const;
/** returns TRUE if this class has a brief description */
bool hasBriefDescription() const;
/** returns TRUE if this class has a non-empty detailed description */ /** returns TRUE if this class has a non-empty detailed description */
bool hasDetailedDescription() const; bool hasDetailedDescription() const;
...@@ -310,6 +308,11 @@ class ClassDef : public Definition ...@@ -310,6 +308,11 @@ class ClassDef : public Definition
const ClassSDict *innerClasses() const; const ClassSDict *innerClasses() const;
QCString title() const; QCString title() const;
QCString generatedFromFiles() const;
const FileList &usedFiles() const;
QCString includeStatement() const;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// --- setters ---- // --- setters ----
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
...@@ -318,7 +321,7 @@ class ClassDef : public Definition ...@@ -318,7 +321,7 @@ class ClassDef : public Definition
void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0); void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0);
void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force); void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force);
void insertMember(MemberDef *); void insertMember(MemberDef *);
void insertUsedFile(const char *); void insertUsedFile(FileDef *);
bool addExample(const char *anchor,const char *name, const char *file); bool addExample(const char *anchor,const char *name, const char *file);
void mergeCategory(ClassDef *category); void mergeCategory(ClassDef *category);
void setNamespace(NamespaceDef *nd); void setNamespace(NamespaceDef *nd);
...@@ -375,6 +378,7 @@ class ClassDef : public Definition ...@@ -375,6 +378,7 @@ class ClassDef : public Definition
void addGroupedInheritedMembers(OutputList &ol,MemberListType lt, void addGroupedInheritedMembers(OutputList &ol,MemberListType lt,
ClassDef *inheritedFrom,const QCString &inheritId); ClassDef *inheritedFrom,const QCString &inheritId);
int countMembersIncludingGrouped(MemberListType lt,ClassDef *inheritedFrom,bool additional); int countMembersIncludingGrouped(MemberListType lt,ClassDef *inheritedFrom,bool additional);
int countInheritanceNodes();
bool visited; bool visited;
......
/****************************************************************************** /******************************************************************************
* *
* *
* *
* Copyright (C) 1997-2013 by Dimitri van Heesch. * Copyright (C) 1997-2013 by Dimitri van Heesch.
* *
* Permission to use, copy, modify, and distribute this software and its * Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby * documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty. * for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* *
...@@ -39,8 +39,8 @@ static int compItems(void *item1,void *item2) ...@@ -39,8 +39,8 @@ static int compItems(void *item1,void *item2)
ClassDef *c2=(ClassDef *)item2; ClassDef *c2=(ClassDef *)item2;
static bool b = Config_getBool("SORT_BY_SCOPE_NAME"); static bool b = Config_getBool("SORT_BY_SCOPE_NAME");
//printf("compItems: %d %s<->%s\n",b,c1->name().data(),c2->name().data()); //printf("compItems: %d %s<->%s\n",b,c1->name().data(),c2->name().data());
if (b) if (b)
{ {
return qstricmp(c1->name(), return qstricmp(c1->name(),
c2->name()); c2->name());
} }
...@@ -76,13 +76,13 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const ...@@ -76,13 +76,13 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const
ClassDef *cd=0; ClassDef *cd=0;
for (sdi.toFirst();(cd=sdi.current());++sdi) for (sdi.toFirst();(cd=sdi.current());++sdi)
{ {
if (cd->name().find('@')==-1 && if (cd->name().find('@')==-1 &&
(filter==0 || *filter==cd->compoundType()) (filter==0 || *filter==cd->compoundType())
) )
{ {
bool isLink = cd->isLinkable(); bool isLink = cd->isLinkable();
if (isLink || if (isLink ||
(!hideUndocClasses && (!hideUndocClasses &&
(!cd->isLocal() || extractLocalClasses) (!cd->isLocal() || extractLocalClasses)
) )
) )
...@@ -107,8 +107,8 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f ...@@ -107,8 +107,8 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
for (sdi.toFirst();(cd=sdi.current());++sdi) for (sdi.toFirst();(cd=sdi.current());++sdi)
{ {
//printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data()); //printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data());
if (cd->name().find('@')==-1 && if (cd->name().find('@')==-1 &&
!cd->isExtension() && !cd->isExtension() &&
(cd->protection()!=Private || extractPrivate) && (cd->protection()!=Private || extractPrivate) &&
(filter==0 || *filter==cd->compoundType()) (filter==0 || *filter==cd->compoundType())
) )
...@@ -119,7 +119,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f ...@@ -119,7 +119,7 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
if (found) ol.endMemberList(); if (found) ol.endMemberList();
} }
} }
void ClassSDict::writeDocumentation(OutputList &ol,Definition * container) void ClassSDict::writeDocumentation(OutputList &ol,Definition * container)
{ {
static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN");
...@@ -140,7 +140,7 @@ void ClassSDict::writeDocumentation(OutputList &ol,Definition * container) ...@@ -140,7 +140,7 @@ void ClassSDict::writeDocumentation(OutputList &ol,Definition * container)
// cd->name().data(),cd->getOuterScope(),cd->isEmbeddedInOuterScope(), // cd->name().data(),cd->getOuterScope(),cd->isEmbeddedInOuterScope(),
// container); // container);
if (cd->name().find('@')==-1 && if (cd->name().find('@')==-1 &&
cd->isLinkableInProject() && cd->isLinkableInProject() &&
cd->isEmbeddedInOuterScope() && cd->isEmbeddedInOuterScope() &&
(container==0 || cd->partOfGroups()==0) // if container==0 -> show as part of the group docs, otherwise only show if not part of a group (container==0 || cd->partOfGroups()==0) // if container==0 -> show as part of the group docs, otherwise only show if not part of a group
......
This diff is collapsed.
#ifndef CONTEXT_H #ifndef CONTEXT_H
#define CONTEXT_H #define CONTEXT_H
#include "types.h"
#include "template.h" #include "template.h"
class Definition; class Definition;
class ClassDef; class ClassDef;
class ClassSDict; class ClassSDict;
class BaseClassList;
class PageDef; class PageDef;
class GroupDef; class GroupDef;
class NamespaceDef; class NamespaceDef;
...@@ -21,6 +23,11 @@ class PageSDict; ...@@ -21,6 +23,11 @@ class PageSDict;
class GroupSDict; class GroupSDict;
class GroupDef; class GroupDef;
class GroupList; class GroupList;
struct IncludeInfo;
class MemberList;
class MemberDef;
struct Argument;
class ArgumentList;
//---------------------------------------------------- //----------------------------------------------------
...@@ -72,6 +79,42 @@ class TranslateContext : public TemplateStructIntf ...@@ -72,6 +79,42 @@ class TranslateContext : public TemplateStructIntf
//---------------------------------------------------- //----------------------------------------------------
class UsedFilesContext : public TemplateListIntf
{
public:
UsedFilesContext(ClassDef *cd);
~UsedFilesContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
void addFile(FileDef *fd);
private:
class Private;
Private *p;
};
//----------------------------------------------------
class IncludeInfoContext : public TemplateStructIntf
{
public:
IncludeInfoContext(IncludeInfo *,SrcLangExt lang);
~IncludeInfoContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ClassContext : public TemplateStructIntf class ClassContext : public TemplateStructIntf
{ {
public: public:
...@@ -150,6 +193,23 @@ class PageContext : public TemplateStructIntf ...@@ -150,6 +193,23 @@ class PageContext : public TemplateStructIntf
Private *p; Private *p;
}; };
//----------------------------------------------------
class MemberContext : public TemplateStructIntf
{
public:
MemberContext(MemberDef *);
~MemberContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//---------------------------------------------------- //----------------------------------------------------
class ModuleContext : public TemplateStructIntf class ModuleContext : public TemplateStructIntf
...@@ -168,6 +228,26 @@ class ModuleContext : public TemplateStructIntf ...@@ -168,6 +228,26 @@ class ModuleContext : public TemplateStructIntf
//---------------------------------------------------- //----------------------------------------------------
class NestedClassListContext : public TemplateListIntf
{
public:
NestedClassListContext();
~NestedClassListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
void append(ClassDef *cd);
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ClassListContext : public TemplateListIntf class ClassListContext : public TemplateListIntf
{ {
public: public:
...@@ -530,6 +610,109 @@ class ExampleListContext : public TemplateStructIntf ...@@ -530,6 +610,109 @@ class ExampleListContext : public TemplateStructIntf
//---------------------------------------------------- //----------------------------------------------------
class InheritanceNodeContext : public TemplateStructIntf
{
public:
InheritanceNodeContext(ClassDef *cd,const QCString &name);
~InheritanceNodeContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class InheritanceListContext : public TemplateListIntf
{
public:
InheritanceListContext(const BaseClassList *list,bool baseClasses);
~InheritanceListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class MemberListContext : public TemplateListIntf
{
public:
MemberListContext(const MemberList *ml);
~MemberListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class MemberListInfoContext : public TemplateStructIntf
{
public:
MemberListInfoContext(const MemberList *ml,const QCString &title,
const QCString &subtitle=QCString());
~MemberListInfoContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ArgumentContext : public TemplateStructIntf
{
public:
ArgumentContext(const Argument *arg);
~ArgumentContext();
// TemplateStructIntf methods
virtual TemplateVariant get(const char *name) const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
class ArgumentListContext : public TemplateListIntf
{
public:
ArgumentListContext(const ArgumentList *al);
~ArgumentListContext();
// TemplateListIntf
virtual int count() const;
virtual TemplateVariant at(int index) const;
virtual TemplateListIntf::ConstIterator *createIterator() const;
private:
class Private;
Private *p;
};
//----------------------------------------------------
void generateOutputViaTemplate(); void generateOutputViaTemplate();
#endif #endif
...@@ -1876,4 +1876,10 @@ void Definition::_setSymbolName(const QCString &name) ...@@ -1876,4 +1876,10 @@ void Definition::_setSymbolName(const QCString &name)
m_symbolName=name; m_symbolName=name;
} }
bool Definition::hasBriefDescription() const
{
static bool briefMemberDesc = Config_getBool("BRIEF_MEMBER_DESC");
return !briefDescription().isEmpty() && briefMemberDesc;
}
...@@ -260,6 +260,9 @@ class Definition : public DefinitionIntf ...@@ -260,6 +260,9 @@ class Definition : public DefinitionIntf
bool hasSections() const; bool hasSections() const;
/** returns TRUE if this class has a brief description */
bool hasBriefDescription() const;
QCString id() const; QCString id() const;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
......
...@@ -1336,8 +1336,7 @@ static void addClassToContext(EntryNav *rootNav) ...@@ -1336,8 +1336,7 @@ static void addClassToContext(EntryNav *rootNav)
// see if the class is found inside a namespace // see if the class is found inside a namespace
//bool found=addNamespace(root,cd); //bool found=addNamespace(root,cd);
// the empty string test is needed for extract all case cd->insertUsedFile(fd);
cd->insertUsedFile(root->fileName);
// add class to the list // add class to the list
//printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data()); //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
...@@ -1537,7 +1536,6 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC ...@@ -1537,7 +1536,6 @@ static ClassDef *createTagLessInstance(ClassDef *rootCd,ClassDef *templ,const QC
gd->addClass(cd); gd->addClass(cd);
} }
} }
//cd->insertUsedFile(root->fileName);
//printf("** adding class %s based on %s\n",fullName.data(),templ->name().data()); //printf("** adding class %s based on %s\n",fullName.data(),templ->name().data());
Doxygen::classSDict->append(fullName,cd); Doxygen::classSDict->append(fullName,cd);
...@@ -1776,7 +1774,7 @@ static void buildNamespaceList(EntryNav *rootNav) ...@@ -1776,7 +1774,7 @@ static void buildNamespaceList(EntryNav *rootNav)
// the empty string test is needed for extract all case // the empty string test is needed for extract all case
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->insertUsedFile(root->fileName); nd->insertUsedFile(fd);
nd->setBodySegment(root->bodyLine,root->endBodyLine); nd->setBodySegment(root->bodyLine,root->endBodyLine);
nd->setBodyDef(fd); nd->setBodyDef(fd);
// add class to the list // add class to the list
...@@ -1954,7 +1952,7 @@ static void findUsingDirectives(EntryNav *rootNav) ...@@ -1954,7 +1952,7 @@ static void findUsingDirectives(EntryNav *rootNav)
// the empty string test is needed for extract all case // the empty string test is needed for extract all case
nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
nd->insertUsedFile(root->fileName); nd->insertUsedFile(fd);
// add class to the list // add class to the list
Doxygen::namespaceSDict->inSort(name,nd); Doxygen::namespaceSDict->inSort(name,nd);
nd->setRefItems(root->sli); nd->setRefItems(root->sli);
...@@ -2373,7 +2371,7 @@ static MemberDef *addVariableToClass( ...@@ -2373,7 +2371,7 @@ static MemberDef *addVariableToClass(
md->setRefItems(root->sli); md->setRefItems(root->sli);
//TODO: insert FileDef instead of filename strings. //TODO: insert FileDef instead of filename strings.
cd->insertUsedFile(root->fileName); cd->insertUsedFile(rootNav->fileDef());
rootNav->changeSection(Entry::EMPTY_SEC); rootNav->changeSection(Entry::EMPTY_SEC);
return md; return md;
} }
...@@ -3114,7 +3112,7 @@ static void addInterfaceOrServiceToServiceOrSingleton( ...@@ -3114,7 +3112,7 @@ static void addInterfaceOrServiceToServiceOrSingleton(
findClassRelation(rootNav,cd,cd,&base,0,DocumentedOnly,true) findClassRelation(rootNav,cd,cd,&base,0,DocumentedOnly,true)
|| findClassRelation(rootNav,cd,cd,&base,0,Undocumented,true); || findClassRelation(rootNav,cd,cd,&base,0,Undocumented,true);
// add file to list of used files // add file to list of used files
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
addMemberToGroups(root,md); addMemberToGroups(root,md);
rootNav->changeSection(Entry::EMPTY_SEC); rootNav->changeSection(Entry::EMPTY_SEC);
...@@ -3357,7 +3355,7 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd, ...@@ -3357,7 +3355,7 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd,
// add member to the class cd // add member to the class cd
cd->insertMember(md); cd->insertMember(md);
// add file to list of used files // add file to list of used files
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
addMemberToGroups(root,md); addMemberToGroups(root,md);
rootNav->changeSection(Entry::EMPTY_SEC); rootNav->changeSection(Entry::EMPTY_SEC);
...@@ -4831,7 +4829,7 @@ static bool findClassRelation( ...@@ -4831,7 +4829,7 @@ static bool findClassRelation(
// add this class as super class to the base class // add this class as super class to the base class
baseClass->insertSubClass(cd,bi->prot,bi->virt,templSpec); baseClass->insertSubClass(cd,bi->prot,bi->virt,templSpec);
// the undocumented base was found in this file // the undocumented base was found in this file
baseClass->insertUsedFile(root->fileName); baseClass->insertUsedFile(rootNav->fileDef());
baseClass->setOuterScope(Doxygen::globalScope); baseClass->setOuterScope(Doxygen::globalScope);
if (baseClassName.right(2)=="-p") if (baseClassName.right(2)=="-p")
{ {
...@@ -5344,7 +5342,7 @@ static void addMemberDocs(EntryNav *rootNav, ...@@ -5344,7 +5342,7 @@ static void addMemberDocs(EntryNav *rootNav,
md->mergeMemberSpecifiers(root->spec); md->mergeMemberSpecifiers(root->spec);
md->addSectionsToDefinition(root->anchors); md->addSectionsToDefinition(root->anchors);
addMemberToGroups(root,md); addMemberToGroups(root,md);
if (cd) cd->insertUsedFile(root->fileName); if (cd) cd->insertUsedFile(rfd);
//printf("root->mGrpId=%d\n",root->mGrpId); //printf("root->mGrpId=%d\n",root->mGrpId);
if (root->mGrpId!=-1) if (root->mGrpId!=-1)
{ {
...@@ -6424,7 +6422,7 @@ static void findMember(EntryNav *rootNav, ...@@ -6424,7 +6422,7 @@ static void findMember(EntryNav *rootNav,
md->setMemberGroupId(root->mGrpId); md->setMemberGroupId(root->mGrpId);
mn->append(md); mn->append(md);
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
md->setRefItems(root->sli); md->setRefItems(root->sli);
} }
} }
...@@ -6621,7 +6619,7 @@ static void findMember(EntryNav *rootNav, ...@@ -6621,7 +6619,7 @@ static void findMember(EntryNav *rootNav,
//md->setMemberDefTemplateArguments(root->mtArgList); //md->setMemberDefTemplateArguments(root->mtArgList);
mn->append(md); mn->append(md);
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
md->setRefItems(root->sli); md->setRefItems(root->sli);
if (root->relatesType == Duplicate) md->setRelatedAlso(cd); if (root->relatesType == Duplicate) md->setRelatedAlso(cd);
if (!isDefine) if (!isDefine)
...@@ -6693,7 +6691,7 @@ localObjCMethod: ...@@ -6693,7 +6691,7 @@ localObjCMethod:
md->setMemberSpecifiers(root->spec); md->setMemberSpecifiers(root->spec);
md->setMemberGroupId(root->mGrpId); md->setMemberGroupId(root->mGrpId);
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
md->setRefItems(root->sli); md->setRefItems(root->sli);
if ((mn=Doxygen::memberNameSDict->find(root->name))) if ((mn=Doxygen::memberNameSDict->find(root->name)))
{ {
...@@ -7077,7 +7075,7 @@ static void findEnums(EntryNav *rootNav) ...@@ -7077,7 +7075,7 @@ static void findEnums(EntryNav *rootNav)
md->setDefinition(cd->name()+"::"+name+baseType); md->setDefinition(cd->name()+"::"+name+baseType);
} }
cd->insertMember(md); cd->insertMember(md);
cd->insertUsedFile(root->fileName); cd->insertUsedFile(fd);
} }
md->setDocumentation(root->doc,root->docFile,root->docLine); md->setDocumentation(root->doc,root->docFile,root->docLine);
md->setDocsForDefinition(!root->proto); md->setDocsForDefinition(!root->proto);
......
This diff is collapsed.
...@@ -241,6 +241,7 @@ class MemberDef : public Definition ...@@ -241,6 +241,7 @@ class MemberDef : public Definition
MemberDef *categoryRelation() const; MemberDef *categoryRelation() const;
QCString displayName(bool=TRUE) const; QCString displayName(bool=TRUE) const;
QCString getDeclType() const;
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// ---- setters ----- // ---- setters -----
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment