summaryrefslogtreecommitdiff
path: root/src/groupdef.cpp
diff options
context:
space:
mode:
authorTizenOpenSource <tizenopensrc@samsung.com>2023-12-22 18:14:24 +0900
committerTizenOpenSource <tizenopensrc@samsung.com>2023-12-22 18:14:24 +0900
commit14adf159fc9eb1212b2e61ea78e94c135abde0fe (patch)
tree759368bce8b58bc20ffbb70cff0c19736f5bef22 /src/groupdef.cpp
parentcfd886868fa8595b045007a2ad673c18c5f222b3 (diff)
downloaddoxygen-14adf159fc9eb1212b2e61ea78e94c135abde0fe.tar.gz
doxygen-14adf159fc9eb1212b2e61ea78e94c135abde0fe.tar.bz2
doxygen-14adf159fc9eb1212b2e61ea78e94c135abde0fe.zip
Imported Upstream version 1.9.8upstream/1.9.8upstream
Diffstat (limited to 'src/groupdef.cpp')
-rw-r--r--src/groupdef.cpp381
1 files changed, 264 insertions, 117 deletions
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index c6d3fc0..32d9de4 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -46,6 +46,7 @@
#include "config.h"
#include "definitionimpl.h"
#include "regex.h"
+#include "moduledef.h"
//---------------------------------------------------------------------------
@@ -55,67 +56,74 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
GroupDefImpl(const QCString &fileName,int line,const QCString &name,const QCString &title,const QCString &refFileName=QCString());
virtual ~GroupDefImpl();
- virtual DefType definitionType() const { return TypeGroup; }
- virtual CodeSymbolType codeSymbolType() const { return CodeSymbolType::Default; }
- virtual QCString getOutputFileBase() const;
- virtual QCString anchor() const { return QCString(); }
- virtual QCString displayName(bool=TRUE) const { return hasGroupTitle() ? m_title : DefinitionMixin::name(); }
- virtual QCString groupTitle() const { return m_title; }
- virtual void setGroupTitle( const QCString &newtitle );
- virtual bool hasGroupTitle( ) const { return m_titleSet; }
- virtual void addFile(const FileDef *def);
- virtual bool addClass(const ClassDef *def);
- virtual bool addConcept(const ConceptDef *def);
- virtual bool addNamespace(const NamespaceDef *def);
- virtual void addGroup(const GroupDef *def);
- virtual void addPage(const PageDef *def);
- virtual void addExample(const PageDef *def);
- virtual void addDir(DirDef *dd);
- virtual bool insertMember(const MemberDef *def,bool docOnly=FALSE);
- virtual void removeMember(MemberDef *md);
- virtual bool findGroup(const GroupDef *def) const; // true if def is a subgroup of this group
- virtual void writeDocumentation(OutputList &ol);
- virtual void writeMemberPages(OutputList &ol);
- virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const;
- virtual void writeTagFile(TextStream &);
- virtual size_t numDocMembers() const;
- virtual bool isLinkableInProject() const;
- virtual bool isLinkable() const;
- virtual bool isASubGroup() const;
- virtual void computeAnchors();
- virtual void countMembers();
-
- virtual void addMembersToMemberGroup();
- virtual void distributeMemberGroupDocumentation();
- virtual void findSectionsInDocumentation();
-
- virtual void addListReferences();
- virtual void sortMemberLists();
- virtual bool subGrouping() const { return m_subGrouping; }
-
- virtual void setGroupScope(Definition *d) { m_groupScope = d; }
- virtual Definition *getGroupScope() const { return m_groupScope; }
-
- virtual MemberList *getMemberList(MemberListType lt) const;
- virtual const MemberLists &getMemberLists() const { return m_memberLists; }
+ virtual DefType definitionType() const override { return TypeGroup; }
+ virtual CodeSymbolType codeSymbolType() const override { return CodeSymbolType::Default; }
+ virtual QCString getOutputFileBase() const override;
+ virtual QCString anchor() const override { return QCString(); }
+ virtual QCString displayName(bool=TRUE) const override { return hasGroupTitle() ? m_title : DefinitionMixin::name(); }
+ virtual QCString groupTitle() const override { return m_title; }
+ virtual void setGroupTitle( const QCString &newtitle ) override;
+ virtual bool hasGroupTitle( ) const override { return m_titleSet; }
+ virtual void addFile(FileDef *def) override;
+ virtual bool containsFile(const FileDef *def) const override;
+ virtual bool addClass(ClassDef *def) override;
+ virtual bool addConcept(ConceptDef *def) override;
+ virtual bool addModule(ModuleDef *def) override;
+ virtual bool addNamespace(NamespaceDef *def) override;
+ virtual void addGroup(GroupDef *def) override;
+ virtual void addPage(PageDef *def) override;
+ virtual void addExample(PageDef *def) override;
+ virtual void addDir(DirDef *dd) override;
+ virtual bool insertMember(MemberDef *def,bool docOnly=FALSE) override;
+ virtual void removeMember(MemberDef *md) override;
+ virtual bool findGroup(const GroupDef *def) const override; // true if def is a subgroup of this group
+ virtual void writeDocumentation(OutputList &ol) override;
+ virtual void writeMemberPages(OutputList &ol, int hierarchyLevel) override;
+ virtual void writeQuickMemberLinks(OutputList &ol,const MemberDef *currentMd) const override;
+ virtual void writeTagFile(TextStream &) override;
+ virtual size_t numDocMembers() const override;
+ virtual bool isLinkableInProject() const override;
+ virtual bool isLinkable() const override;
+ virtual bool isVisibleInHierarchy() const override;
+ virtual bool isASubGroup() const override;
+ virtual void computeAnchors() override;
+ virtual void countMembers() override;
+
+ virtual void addMembersToMemberGroup() override;
+ virtual void distributeMemberGroupDocumentation() override;
+ virtual void findSectionsInDocumentation() override;
+
+ virtual void addListReferences() override;
+ virtual void sortMemberLists() override;
+ virtual bool subGrouping() const override { return m_subGrouping; }
+
+ virtual void setGroupScope(Definition *d) override { m_groupScope = d; }
+ virtual Definition *getGroupScope() const override { return m_groupScope; }
+
+ virtual MemberList *getMemberList(MemberListType lt) const override;
+ virtual const MemberLists &getMemberLists() const override { return m_memberLists; }
/* user defined member groups */
- virtual const MemberGroupList &getMemberGroups() const { return m_memberGroups; }
-
- virtual const FileList &getFiles() const { return m_fileList; }
- virtual const ClassLinkedRefMap &getClasses() const { return m_classes; }
- virtual const ConceptLinkedRefMap &getConcepts() const { return m_concepts; }
- virtual const NamespaceLinkedRefMap &getNamespaces() const { return m_namespaces; }
- virtual const GroupList &getSubGroups() const { return m_groups; }
- virtual const PageLinkedRefMap &getPages() const { return m_pages; }
- virtual const DirList & getDirs() const { return m_dirList; }
- virtual const PageLinkedRefMap &getExamples() const { return m_examples; }
- virtual bool hasDetailedDescription() const;
- virtual void sortSubGroups();
-
+ virtual const MemberGroupList &getMemberGroups() const override { return m_memberGroups; }
+
+ virtual const FileList &getFiles() const override { return m_fileList; }
+ virtual const ClassLinkedRefMap &getClasses() const override { return m_classes; }
+ virtual const ConceptLinkedRefMap &getConcepts() const override { return m_concepts; }
+ virtual const ModuleLinkedRefMap &getModules() const override { return m_modules; }
+ virtual const NamespaceLinkedRefMap &getNamespaces() const override { return m_namespaces; }
+ virtual const GroupList &getSubGroups() const override { return m_groups; }
+ virtual const PageLinkedRefMap &getPages() const override { return m_pages; }
+ virtual const DirList & getDirs() const override { return m_dirList; }
+ virtual const PageLinkedRefMap &getExamples() const override { return m_examples; }
+ virtual bool hasDetailedDescription() const override;
+ virtual void sortSubGroups() override;
+ virtual void writeSummaryLinks(OutputList &ol) const override;
+
+ virtual bool hasGroupGraph() const override;
+ virtual void enableGroupGraph(bool e) override;
private:
void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
- void addMemberToList(MemberListType lt,const MemberDef *md);
+ void addMemberToList(MemberListType lt,MemberDef *md);
void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title);
void removeMemberFromList(MemberListType lt,MemberDef *md);
@@ -126,6 +134,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
void writeDirs(OutputList &ol,const QCString &title);
void writeClasses(OutputList &ol,const QCString &title);
void writeConcepts(OutputList &ol,const QCString &title);
+ void writeModules(OutputList &ol,const QCString &title);
void writeInlineClasses(OutputList &ol);
void writePageDocumentation(OutputList &ol);
void writeDetailedDescription(OutputList &ol,const QCString &title);
@@ -136,8 +145,8 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
void startMemberDocumentation(OutputList &ol);
void endMemberDocumentation(OutputList &ol);
void writeAuthorSection(OutputList &ol);
- void writeSummaryLinks(OutputList &ol) const;
void updateLanguage(const Definition *);
+ void setGroupTitleLocal( const QCString &title);
QCString m_title; // title of the group
bool m_titleSet; // true if title is not the same as the name
@@ -145,6 +154,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
FileList m_fileList; // list of files in the group
ClassLinkedRefMap m_classes; // list of classes in the group
ConceptLinkedRefMap m_concepts; // list of concepts in the group
+ ModuleLinkedRefMap m_modules; // list of modules in the group
NamespaceLinkedRefMap m_namespaces; // list of namespaces in the group
GroupList m_groups; // list of sub groups.
PageLinkedRefMap m_pages; // list of pages in the group
@@ -156,13 +166,14 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
MemberLists m_memberLists;
MemberGroupList m_memberGroups;
bool m_subGrouping;
+ bool m_hasGroupGraph = false;
};
-GroupDef *createGroupDef(const QCString &fileName,int line,const QCString &name,
+std::unique_ptr<GroupDef> createGroupDef(const QCString &fileName,int line,const QCString &name,
const QCString &title,const QCString &refFileName)
{
- return new GroupDefImpl(fileName,line,name,title,refFileName);
+ return std::make_unique<GroupDefImpl>(fileName,line,name,title,refFileName);
}
@@ -180,18 +191,19 @@ GroupDefImpl::GroupDefImpl(const QCString &df,int dl,const QCString &na,const QC
{
m_fileName = convertNameToFile(QCString("group_")+na);
}
- setGroupTitle( t );
+ setGroupTitleLocal( t );
//visited = 0;
m_groupScope = 0;
m_subGrouping=Config_getBool(SUBGROUPING);
+ m_hasGroupGraph=Config_getBool(GROUP_GRAPHS);
}
GroupDefImpl::~GroupDefImpl()
{
}
-void GroupDefImpl::setGroupTitle( const QCString &t )
+void GroupDefImpl::setGroupTitleLocal( const QCString &t )
{
if ( !t.isEmpty())
{
@@ -206,6 +218,11 @@ void GroupDefImpl::setGroupTitle( const QCString &t )
}
}
+void GroupDefImpl::setGroupTitle( const QCString &t )
+{
+ setGroupTitleLocal(t);
+}
+
void GroupDefImpl::distributeMemberGroupDocumentation()
{
@@ -234,7 +251,7 @@ void GroupDefImpl::findSectionsInDocumentation()
}
}
-void GroupDefImpl::addFile(const FileDef *def)
+void GroupDefImpl::addFile(FileDef *def)
{
bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
if (def->isHidden()) return;
@@ -248,7 +265,12 @@ void GroupDefImpl::addFile(const FileDef *def)
m_fileList.push_back(def);
}
-bool GroupDefImpl::addClass(const ClassDef *cd)
+bool GroupDefImpl::containsFile(const FileDef *def) const
+{
+ return std::find(m_fileList.cbegin(),m_fileList.cend(), def) != m_fileList.cend();
+}
+
+bool GroupDefImpl::addClass(ClassDef *cd)
{
if (cd->isHidden()) return FALSE;
updateLanguage(cd);
@@ -261,7 +283,7 @@ bool GroupDefImpl::addClass(const ClassDef *cd)
return FALSE;
}
-bool GroupDefImpl::addConcept(const ConceptDef *cd)
+bool GroupDefImpl::addConcept(ConceptDef *cd)
{
if (cd->isHidden()) return FALSE;
QCString qn = cd->name();
@@ -273,7 +295,19 @@ bool GroupDefImpl::addConcept(const ConceptDef *cd)
return FALSE;
}
-bool GroupDefImpl::addNamespace(const NamespaceDef *def)
+bool GroupDefImpl::addModule(ModuleDef *mod)
+{
+ if (mod->isHidden()) return false;
+ QCString qn = mod->name();
+ if (m_modules.find(qn)==0)
+ {
+ m_modules.add(qn,mod);
+ return true;
+ }
+ return false;
+}
+
+bool GroupDefImpl::addNamespace(NamespaceDef *def)
{
//printf("adding namespace hidden=%d\n",def->isHidden());
if (def->isHidden()) return false;
@@ -292,15 +326,15 @@ void GroupDefImpl::addDir(DirDef *def)
m_dirList.push_back(def);
}
-void GroupDefImpl::addPage(const PageDef *def)
+void GroupDefImpl::addPage(PageDef *def)
{
if (def->isHidden()) return;
//printf("Making page %s part of a group\n",qPrint(def->name));
m_pages.add(def->name(),def);
- const_cast<PageDef*>(def)->makePartOfGroup(this);
+ def->makePartOfGroup(this);
}
-void GroupDefImpl::addExample(const PageDef *def)
+void GroupDefImpl::addExample(PageDef *def)
{
if (def->isHidden()) return;
m_examples.add(def->name(),def);
@@ -319,7 +353,7 @@ void GroupDefImpl::addMembersToMemberGroup()
}
-bool GroupDefImpl::insertMember(const MemberDef *md,bool docOnly)
+bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly)
{
if (md->isHidden()) return FALSE;
updateLanguage(md);
@@ -416,7 +450,7 @@ bool GroupDefImpl::insertMember(const MemberDef *md,bool docOnly)
addMemberToList(MemberListType_docSignalMembers,md);
break;
case MemberType_Slot:
- if (md->protection()==Public)
+ if (md->protection()==Protection::Public)
{
if (!docOnly)
{
@@ -424,7 +458,7 @@ bool GroupDefImpl::insertMember(const MemberDef *md,bool docOnly)
}
addMemberToList(MemberListType_docPubSlotMembers,md);
}
- else if (md->protection()==Protected)
+ else if (md->protection()==Protection::Protected)
{
if (!docOnly)
{
@@ -512,12 +546,12 @@ void GroupDefImpl::removeMember(MemberDef *md)
removeMemberFromList(MemberListType_docSignalMembers,md);
break;
case MemberType_Slot:
- if (md->protection()==Public)
+ if (md->protection()==Protection::Public)
{
removeMemberFromList(MemberListType_decPubSlotMembers,md);
removeMemberFromList(MemberListType_docPubSlotMembers,md);
}
- else if (md->protection()==Protected)
+ else if (md->protection()==Protection::Protected)
{
removeMemberFromList(MemberListType_decProSlotMembers,md);
removeMemberFromList(MemberListType_docProSlotMembers,md);
@@ -562,7 +596,7 @@ bool GroupDefImpl::findGroup(const GroupDef *def) const
return FALSE;
}
-void GroupDefImpl::addGroup(const GroupDef *def)
+void GroupDefImpl::addGroup(GroupDef *def)
{
//printf("adding group '%s' to group '%s'\n",qPrint(def->name()),qPrint(name()));
//if (Config_getBool(SORT_MEMBER_DOCS))
@@ -610,10 +644,12 @@ void GroupDefImpl::computeAnchors()
void GroupDefImpl::writeTagFile(TextStream &tagFile)
{
+ QCString fn = getOutputFileBase();
+ addHtmlExtensionIfMissing(fn);
tagFile << " <compound kind=\"group\">\n";
tagFile << " <name>" << convertToXML(name()) << "</name>\n";
tagFile << " <title>" << convertToXML(m_title) << "</title>\n";
- tagFile << " <filename>" << addHtmlExtensionIfMissing(getOutputFileBase()) << "</filename>\n";
+ tagFile << " <filename>" << fn << "</filename>\n";
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
{
switch (lde->kind())
@@ -642,6 +678,18 @@ void GroupDefImpl::writeTagFile(TextStream &tagFile)
}
}
break;
+ case LayoutDocEntry::GroupModules:
+ {
+ for (const auto &mod : m_modules)
+ {
+ if (mod->isLinkableInProject())
+ {
+ tagFile << " <module>" << convertToXML(mod->name())
+ << "</module>\n";
+ }
+ }
+ }
+ break;
case LayoutDocEntry::GroupNamespaces:
{
for (const auto &nd : m_namespaces)
@@ -738,17 +786,17 @@ void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title
if (m_pages.size()!=numDocMembers()) // not only pages -> classical layout
{
ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
+ ol.disable(OutputType::Html);
ol.writeRuler();
ol.popGeneratorState();
ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
+ ol.disableAllBut(OutputType::Html);
ol.writeAnchor(QCString(),"details");
ol.popGeneratorState();
}
else
{
- ol.disableAllBut(OutputGenerator::Man); // always print title for man page
+ ol.disableAllBut(OutputType::Man); // always print title for man page
}
ol.startGroupHeader();
ol.parseText(title);
@@ -766,12 +814,11 @@ void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title
!documentation().isEmpty())
{
ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
- ol.disable(OutputGenerator::RTF);
- // ol.newParagraph(); // FIXME:PARA
+ ol.disable(OutputType::Man);
+ ol.disable(OutputType::RTF);
ol.enableAll();
- ol.disableAllBut(OutputGenerator::Man);
- ol.enable(OutputGenerator::Latex);
+ ol.disableAllBut(OutputType::Man);
+ ol.enable(OutputType::Latex);
ol.writeString("\n\n");
ol.popGeneratorState();
}
@@ -805,18 +852,18 @@ void GroupDefImpl::writeBriefDescription(OutputList &ol)
{
ol.startParagraph();
ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Man);
+ ol.disableAllBut(OutputType::Man);
ol.writeString(" - ");
ol.popGeneratorState();
ol.writeDoc(ast.get(),this,0);
ol.pushGeneratorState();
- ol.disable(OutputGenerator::RTF);
+ ol.disable(OutputType::RTF);
ol.writeString(" \n");
- ol.enable(OutputGenerator::RTF);
+ ol.enable(OutputType::RTF);
if (hasDetailedDescription())
{
- ol.disableAllBut(OutputGenerator::Html);
+ ol.disableAllBut(OutputType::Html);
ol.startTextLink(QCString(),"details");
ol.parseText(theTranslator->trMore());
ol.endTextLink();
@@ -830,14 +877,19 @@ void GroupDefImpl::writeBriefDescription(OutputList &ol)
void GroupDefImpl::writeGroupGraph(OutputList &ol)
{
- if (Config_getBool(HAVE_DOT) /*&& Config_getBool(GROUP_GRAPHS)*/ )
+ if (Config_getBool(HAVE_DOT) && m_hasGroupGraph /*&& Config_getBool(GROUP_GRAPHS)*/)
{
DotGroupCollaboration graph(this);
- if (!graph.isTrivial())
+ if (graph.isTooBig())
+ {
+ warn_uncond("Group dependency graph for '%s' not generated, too many nodes (%d), threshold is %d. Consider increasing DOT_GRAPH_MAX_NODES.\n",
+ qPrint(name()), graph.numNodes(), Config_getInt(DOT_GRAPH_MAX_NODES));
+ }
+ else if (!graph.isTrivial())
{
msg("Generating dependency graph for group %s\n",qPrint(qualifiedName()));
ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
+ ol.disable(OutputType::Man);
//ol.startParagraph();
ol.startGroupCollaboration();
ol.parseText(theTranslator->trCollaborationDiagram(m_title));
@@ -861,11 +913,11 @@ void GroupDefImpl::writeFiles(OutputList &ol,const QCString &title)
{
if (!fd->hasDocumentation()) continue;
ol.startMemberDeclaration();
- ol.startMemberItem(fd->getOutputFileBase(),0);
+ ol.startMemberItem(fd->getOutputFileBase(),OutputGenerator::MemberItemType::Normal);
ol.docify(theTranslator->trFile(FALSE,TRUE)+" ");
ol.insertMemberAlign();
- ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fd->name());
- ol.endMemberItem();
+ ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),fd->displayName());
+ ol.endMemberItem(OutputGenerator::MemberItemType::Normal);
if (!fd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.startMemberDescription(fd->getOutputFileBase());
@@ -905,12 +957,12 @@ void GroupDefImpl::writeNestedGroups(OutputList &ol,const QCString &title)
{
if (!gd->hasDocumentation()) continue;
ol.startMemberDeclaration();
- ol.startMemberItem(gd->getOutputFileBase(),0);
+ ol.startMemberItem(gd->getOutputFileBase(),OutputGenerator::MemberItemType::Normal);
//ol.docify(theTranslator->trGroup(FALSE,TRUE));
//ol.docify(" ");
ol.insertMemberAlign();
ol.writeObjectLink(gd->getReference(),gd->getOutputFileBase(),QCString(),gd->groupTitle());
- ol.endMemberItem();
+ ol.endMemberItem(OutputGenerator::MemberItemType::Normal);
if (!gd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.startMemberDescription(gd->getOutputFileBase());
@@ -938,11 +990,11 @@ void GroupDefImpl::writeDirs(OutputList &ol,const QCString &title)
{
if (!dd->hasDocumentation()) continue;
ol.startMemberDeclaration();
- ol.startMemberItem(dd->getOutputFileBase(),0);
+ ol.startMemberItem(dd->getOutputFileBase(),OutputGenerator::MemberItemType::Normal);
ol.parseText(theTranslator->trDir(FALSE,TRUE));
ol.insertMemberAlign();
ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),QCString(),dd->shortName());
- ol.endMemberItem();
+ ol.endMemberItem(OutputGenerator::MemberItemType::Normal);
if (!dd->briefDescription().isEmpty() && Config_getBool(BRIEF_MEMBER_DESC))
{
ol.startMemberDescription(dd->getOutputFileBase());
@@ -969,6 +1021,13 @@ void GroupDefImpl::writeConcepts(OutputList &ol,const QCString &title)
m_concepts.writeDeclaration(ol,title,FALSE);
}
+void GroupDefImpl::writeModules(OutputList &ol,const QCString &title)
+{
+ // write list of modules
+ m_modules.writeDeclaration(ol,title,FALSE);
+}
+
+
void GroupDefImpl::writeInlineClasses(OutputList &ol)
{
m_classes.writeDocumentation(ol);
@@ -1001,7 +1060,7 @@ void GroupDefImpl::writeMemberGroups(OutputList &ol)
/* write user defined member groups */
for (const auto &mg : m_memberGroups)
{
- mg->writeDeclarations(ol,0,0,0,this);
+ mg->writeDeclarations(ol,0,0,0,this,0);
}
}
@@ -1021,7 +1080,7 @@ void GroupDefImpl::startMemberDocumentation(OutputList &ol)
if (Config_getBool(SEPARATE_MEMBER_PAGES))
{
ol.pushGeneratorState();
- ol.disable(OutputGenerator::Html);
+ ol.disable(OutputType::Html);
Doxygen::suppressDocWarnings = TRUE;
}
}
@@ -1040,7 +1099,7 @@ void GroupDefImpl::writeAuthorSection(OutputList &ol)
{
// write Author section (Man only)
ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Man);
+ ol.disableAllBut(OutputType::Man);
ol.startGroupHeader();
ol.parseText(theTranslator->trAuthor(TRUE,TRUE));
ol.endGroupHeader();
@@ -1051,13 +1110,14 @@ void GroupDefImpl::writeAuthorSection(OutputList &ol)
void GroupDefImpl::writeSummaryLinks(OutputList &ol) const
{
ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
+ ol.disableAllBut(OutputType::Html);
bool first=TRUE;
SrcLangExt lang = getLanguage();
for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
{
if ((lde->kind()==LayoutDocEntry::GroupClasses && m_classes.declVisible()) ||
(lde->kind()==LayoutDocEntry::GroupConcepts && m_concepts.declVisible()) ||
+ (lde->kind()==LayoutDocEntry::GroupModules && m_modules.declVisible()) ||
(lde->kind()==LayoutDocEntry::GroupNamespaces && m_namespaces.declVisible(false)) ||
(lde->kind()==LayoutDocEntry::GroupFiles && !m_fileList.empty()) ||
(lde->kind()==LayoutDocEntry::GroupNestedGroups && !m_groups.empty()) ||
@@ -1069,10 +1129,11 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const
{
QCString label = lde->kind()==LayoutDocEntry::GroupClasses ? "nested-classes" :
lde->kind()==LayoutDocEntry::GroupConcepts ? "concepts" :
+ lde->kind()==LayoutDocEntry::GroupModules ? "modules" :
lde->kind()==LayoutDocEntry::GroupNamespaces ? "namespaces" :
lde->kind()==LayoutDocEntry::GroupFiles ? "files" :
lde->kind()==LayoutDocEntry::GroupNestedGroups ? "groups" :
- "dirs";
+ "dirs";
ol.writeSummaryLink(QCString(),label,ls->title(lang),first);
first=FALSE;
}
@@ -1102,22 +1163,33 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
{
//bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
ol.pushGeneratorState();
- startFile(ol,getOutputFileBase(),name(),m_title,HLI_Modules);
+
+ // Find out how deep this group is nested. In case of multiple parents, use the first one.
+ int hierarchyLevel = 0;
+ const GroupDef *gd = this;
+ while (!gd->partOfGroups().empty())
+ {
+ gd = gd->partOfGroups().front();
+ ++hierarchyLevel;
+ }
+
+ startFile(ol,getOutputFileBase(),name(),m_title,HighlightedItem::Topics,
+ FALSE /* additionalIndices*/, QCString() /*altSidebarName*/, hierarchyLevel);
ol.startHeaderSection();
writeSummaryLinks(ol);
ol.startTitleHead(getOutputFileBase());
ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
+ ol.disable(OutputType::Man);
ol.parseText(m_title);
ol.popGeneratorState();
addGroupListToTitle(ol,this);
ol.pushGeneratorState();
- ol.disable(OutputGenerator::Man);
+ ol.disable(OutputType::Man);
ol.endTitleHead(getOutputFileBase(),m_title);
ol.popGeneratorState();
ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Man);
+ ol.disableAllBut(OutputType::Man);
ol.endTitleHead(getOutputFileBase(),name());
if (!m_title.isEmpty())
{
@@ -1148,6 +1220,9 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::GroupConcepts:
if (ls) writeConcepts(ol,ls->title(lang));
break;
+ case LayoutDocEntry::GroupModules:
+ if (ls) writeModules(ol,ls->title(lang));
+ break;
case LayoutDocEntry::GroupInlineClasses:
writeInlineClasses(ol);
break;
@@ -1233,6 +1308,10 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
case LayoutDocEntry::FileIncludedByGraph:
case LayoutDocEntry::FileSourceLink:
case LayoutDocEntry::FileInlineClasses:
+ case LayoutDocEntry::ModuleExports:
+ case LayoutDocEntry::ModuleClasses:
+ case LayoutDocEntry::ModuleConcepts:
+ case LayoutDocEntry::ModuleUsedFiles:
case LayoutDocEntry::DirSubDirs:
case LayoutDocEntry::DirFiles:
case LayoutDocEntry::DirGraph:
@@ -1244,6 +1323,21 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
//---------------------------------------- end flexible part -------------------------------
+ for (auto &subgd : getSubGroups())
+ {
+ if (!subgd->isReference())
+ {
+ if (subgd->partOfGroups().front() == this)
+ {
+ ol.writePageLink(subgd->getOutputFileBase(), FALSE);
+ }
+ else
+ {
+ // Could write a note explaining that the subgroup belongs to another
+ // group and add a link here.
+ }
+ }
+ }
endFile(ol);
ol.popGeneratorState();
@@ -1251,21 +1345,20 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
if (Config_getBool(SEPARATE_MEMBER_PAGES))
{
m_allMemberList.sort();
- writeMemberPages(ol);
+ writeMemberPages(ol, hierarchyLevel + 1);
}
-
}
-void GroupDefImpl::writeMemberPages(OutputList &ol)
+void GroupDefImpl::writeMemberPages(OutputList &ol, int hierarchyLevel)
{
ol.pushGeneratorState();
- ol.disableAllBut(OutputGenerator::Html);
+ ol.disableAllBut(OutputType::Html);
for (const auto &ml : m_memberLists)
{
if (ml->listType()&MemberListType_documentationLists)
{
- ml->writeDocumentationPage(ol,name(),this);
+ ml->writeDocumentationPage(ol,name(),this,hierarchyLevel);
}
}
@@ -1285,6 +1378,8 @@ void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *current
{
if (md->isLinkableInProject())
{
+ QCString fn = md->getOutputFileBase();
+ addHtmlExtensionIfMissing(fn);
if (md==currentMd) // selected item => highlight
{
ol.writeString(" <tr><td class=\"navtabHL\">");
@@ -1296,7 +1391,7 @@ void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *current
ol.writeString("<a class=\"navtab\" ");
ol.writeString("href=\"");
if (createSubDirs) ol.writeString("../../");
- ol.writeString(addHtmlExtensionIfMissing(md->getOutputFileBase())+"#"+md->anchor());
+ ol.writeString(fn+"#"+md->anchor());
ol.writeString("\">");
ol.writeString(convertToHtml(md->localName()));
ol.writeString("</a>");
@@ -1346,6 +1441,19 @@ void addConceptToGroups(const Entry *root,ConceptDef *cd)
}
}
+void addModuleToGroups(const Entry *root,ModuleDef *mod)
+{
+ for (const Grouping &g : root->groups)
+ {
+ GroupDef *gd = Doxygen::groupLinkedMap->find(g.groupname);
+ if (gd && gd->addModule(mod))
+ {
+ mod->makePartOfGroup(gd);
+ //printf("Module %s: in group %s\n",qPrint(mod->name()),gd->groupTitle());
+ }
+ }
+}
+
void addNamespaceToGroups(const Entry *root,NamespaceDef *nd)
{
@@ -1398,7 +1506,7 @@ void addGroupToGroups(const Entry *root,GroupDef *subGroup)
else if (subGroup->findGroup(gd))
{
warn(root->fileName,root->startLine,"Refusing to add group %s to group %s, since the latter is already a "
- "subgroup of the former\n", qPrint(subGroup->name()),qPrint(gd->name()));
+ "subgroup of the former", qPrint(subGroup->name()),qPrint(gd->name()));
}
else if (!gd->findGroup(subGroup))
{
@@ -1574,7 +1682,7 @@ void GroupDefImpl::addListReferences()
}
}
-void GroupDefImpl::addMemberToList(MemberListType lt,const MemberDef *md)
+void GroupDefImpl::addMemberToList(MemberListType lt,MemberDef *md)
{
bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
@@ -1696,12 +1804,12 @@ void GroupDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,cons
MemberList * ml = getMemberList(lt);
if (optimizeVhdl && ml)
{
- VhdlDocGen::writeVhdlDeclarations(ml,ol,this,0,0,0);
+ VhdlDocGen::writeVhdlDeclarations(ml,ol,this,0,0,0,0);
return;
}
if (ml)
{
- ml->writeDeclarations(ol,0,0,0,this,title,QCString());
+ ml->writeDeclarations(ol,0,0,0,this,0,title,QCString());
}
}
@@ -1725,6 +1833,35 @@ void GroupDefImpl::sortSubGroups()
{ return g1->groupTitle() < g2->groupTitle(); });
}
+static bool hasNonReferenceNestedGroupRec(const GroupDef *gd,int level)
+{
+ if (level>30)
+ {
+ err("Possible recursive group relation while inside %s\n",qPrint(gd->name()));
+ return false;
+ }
+ bool found=gd->isLinkableInProject();
+ if (found)
+ {
+ return true;
+ }
+ else
+ {
+ for (const auto &igd : gd->getSubGroups())
+ {
+ found = found || hasNonReferenceNestedGroupRec(igd,level+1);
+ if (found) break;
+ }
+ }
+ return found;
+}
+
+bool GroupDefImpl::isVisibleInHierarchy() const
+{
+ bool allExternals = Config_getBool(EXTERNAL_GROUPS);
+ return (allExternals || hasNonReferenceNestedGroupRec(this,0)) && isLinkable();
+}
+
bool GroupDefImpl::isLinkableInProject() const
{
return !isReference() && isLinkable();
@@ -1754,6 +1891,16 @@ bool GroupDefImpl::hasDetailedDescription() const
(m_pages.size()!=numDocMembers());
}
+void GroupDefImpl::enableGroupGraph(bool e)
+{
+ m_hasGroupGraph=e;
+}
+
+bool GroupDefImpl::hasGroupGraph() const
+{
+ return m_hasGroupGraph;
+}
+
// --- Cast functions
GroupDef *toGroupDef(Definition *d)