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