diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2012-04-29 17:51:51 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2012-04-29 17:51:51 (GMT) |
commit | 44ca9512aaeb19f7fbd07afda88ec4cfe53ce831 (patch) | |
tree | a8d7cbd0da612bb0b1fa97dcc1bac1838f845338 /src/memberlist.cpp | |
parent | f3e0c94b327d47e5c3d3a36a9a6300cee8d2a537 (diff) | |
download | Doxygen-44ca9512aaeb19f7fbd07afda88ec4cfe53ce831.zip Doxygen-44ca9512aaeb19f7fbd07afda88ec4cfe53ce831.tar.gz Doxygen-44ca9512aaeb19f7fbd07afda88ec4cfe53ce831.tar.bz2 |
Release-1.8.0-20120429
Diffstat (limited to 'src/memberlist.cpp')
-rw-r--r-- | src/memberlist.cpp | 176 |
1 files changed, 107 insertions, 69 deletions
diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 8cfad19..3a06aeb 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -30,6 +30,9 @@ MemberList::MemberList() { + memberGroupList=0; + m_numDecMembers=-1; // special value indicating that value needs to be computed + m_numDocMembers=-1; // special value indicating that value needs to be computed } MemberList::MemberList(ListType lt) : m_listType(lt) @@ -248,7 +251,8 @@ bool MemberList::declVisible() const } void MemberList::writePlainDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + const char *inheritId ) { //printf("----- writePlainDeclaration() ----\n"); @@ -286,7 +290,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, case MemberDef::Event: { if (first) ol.startMemberList(),first=FALSE; - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritId); break; } case MemberDef::Enumeration: @@ -319,7 +323,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, ol.startMemberList(); first=FALSE; } - ol.startMemberItem(md->anchor(),0); + ol.startMemberItem(md->anchor(),0,inheritId); ol.writeString("enum "); ol.insertMemberAlign(); md->writeEnumDeclaration(ol,cd,nd,fd,gd); @@ -356,7 +360,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, ol.startMemberList(); first=FALSE; } - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritId); break; } case MemberDef::EnumValue: @@ -365,7 +369,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, { //printf("EnumValue!\n"); if (first) ol.startMemberList(),first=FALSE; - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritId); } } break; @@ -410,10 +414,11 @@ void MemberList::writePlainDeclarations(OutputList &ol, void MemberList::writeDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, const char *title,const char *subtitle, bool showEnumValues, - bool showInline) + bool showInline,ClassDef *inheritedFrom) { - //printf("----- writeDeclaration() this=%p ----\n",this); + //printf("----- writeDeclaration() this=%p ---- inheritedFrom=%p\n",this,inheritedFrom); static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); + QCString inheritId; countDecMembers(showEnumValues,gd); // count members shown in this section Definition *ctx = cd; @@ -421,87 +426,120 @@ void MemberList::writeDeclarations(OutputList &ol, if (ctx==0 && gd) ctx = gd; if (ctx==0 && fd) ctx = fd; - if (numDecMembers()==0) return; //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n", - // this,title,subtitle,numDecMembers()); - if (title) + // this,title,subtitle,numDecMembers()); + + int num = numDecMembers(); + if (inheritedFrom) { - if (showInline) - { - ol.startInlineHeader(); - } - else + if (cd && !optimizeVhdl) { - ol.startMemberHeader(listTypeAsString()); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + inheritId = substitute(listTypeAsString(),"-","_")+"_"+ + stripPath(cd->getOutputFileBase()); + if (title) + { + ol.writeInheritedSectionTitle(inheritId,cd->getOutputFileBase(), + cd->anchor(),title,cd->displayName()); + } + ol.popGeneratorState(); } - ol.parseText(title); - if (showInline) + } + else if (num>0) + { + if (title) { - ol.endInlineHeader(); + if (showInline) + { + ol.startInlineHeader(); + } + else + { + ol.startMemberHeader(listTypeAsString()); + } + ol.parseText(title); + if (showInline) + { + ol.endInlineHeader(); + } + else + { + ol.endMemberHeader(); + } } - else + if (subtitle) { - ol.endMemberHeader(); + QCString st=subtitle; + st = st.stripWhiteSpace(); + if (!st.isEmpty()) + { + ol.startMemberSubtitle(); + ol.parseDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,0,FALSE,FALSE); + ol.endMemberSubtitle(); + } } } - if (subtitle) + if (num>0) { - QCString st=subtitle; - st = st.stripWhiteSpace(); - if (!st.isEmpty()) + // TODO: Two things need to be worked out for proper VHDL output: + // 1. Signals and types under the group need to be + // formatted to associate them with the group somehow + // indentation, or at the very least, extra space after + // the group is done + // 2. This might need to be repeated below for memberGroupLists + if (optimizeVhdl) // use specific declarations function { - ol.startMemberSubtitle(); - ol.parseDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,0,FALSE,FALSE); - ol.endMemberSubtitle(); + VhdlDocGen::writeVhdlDeclarations(this,ol,0,cd,0,0); + } + else + { + writePlainDeclarations(ol,cd,nd,fd,gd,inheritId); } - } - // TODO: Two things need to be worked out for proper VHDL output: - // 1. Signals and types under the group need to be - // formatted to associate them with the group somehow - // indentation, or at the very least, extra space after - // the group is done - // 2. This might need to be repeated below for memberGroupLists - if (optimizeVhdl) // use specific declarations function - { - VhdlDocGen::writeVhdlDeclarations(this,ol,0,cd,0,0); - } - else - { - writePlainDeclarations(ol,cd,nd,fd,gd); - } - - //printf("memberGroupList=%p\n",memberGroupList); - if (memberGroupList) - { - MemberGroupListIterator mgli(*memberGroupList); - MemberGroup *mg; - while ((mg=mgli.current())) + //printf("memberGroupList=%p\n",memberGroupList); + if (memberGroupList) { - bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]"; - //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader); - ol.startMemberGroupHeader(hasHeader); - if (hasHeader) + MemberGroupListIterator mgli(*memberGroupList); + MemberGroup *mg; + while ((mg=mgli.current())) { - ol.parseText(mg->header()); - } - ol.endMemberGroupHeader(); - if (!mg->documentation().isEmpty()) - { - //printf("Member group has docs!\n"); - ol.startMemberGroupDocs(); - ol.parseDoc("[generated]",-1,ctx,0,mg->documentation()+"\n",FALSE,FALSE); - ol.endMemberGroupDocs(); + bool hasHeader=!mg->header().isEmpty() && mg->header()!="[NOHEADER]"; + if (inheritId.isEmpty()) + { + //printf("mg->header=%s hasHeader=%d\n",mg->header().data(),hasHeader); + ol.startMemberGroupHeader(hasHeader); + if (hasHeader) + { + ol.parseText(mg->header()); + } + ol.endMemberGroupHeader(); + if (!mg->documentation().isEmpty()) + { + //printf("Member group has docs!\n"); + ol.startMemberGroupDocs(); + ol.parseDoc("[generated]",-1,ctx,0,mg->documentation()+"\n",FALSE,FALSE); + ol.endMemberGroupDocs(); + } + ol.startMemberGroup(); + } + //printf("--- mg->writePlainDeclarations ---\n"); + mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritId); + if (inheritId.isEmpty()) + { + ol.endMemberGroup(hasHeader); + } + ++mgli; } - ol.startMemberGroup(); - //printf("--- mg->writePlainDeclarations ---\n"); - mg->writePlainDeclarations(ol,cd,nd,fd,gd); - ol.endMemberGroup(hasHeader); - ++mgli; } } + if (inheritedFrom && cd) + { + // also add members that of this list type, that are grouped together + // in a separate list in class 'inheritedFrom' + cd->addGroupedInheritedMembers(ol,m_listType,inheritId); + } //printf("----- end writeDeclaration() ----\n"); - } void MemberList::writeDocumentation(OutputList &ol, |