1 /****************************************************************************** |
1 /****************************************************************************** |
2 * |
2 * |
3 * |
3 * |
4 * |
4 * |
5 * Copyright (C) 1997-2008 by Dimitri van Heesch. |
5 * Copyright (C) 1997-2010 by Dimitri van Heesch. |
6 * |
6 * |
7 * Permission to use, copy, modify, and distribute this software and its |
7 * Permission to use, copy, modify, and distribute this software and its |
8 * documentation under the terms of the GNU General Public License is hereby |
8 * documentation under the terms of the GNU General Public License is hereby |
9 * granted. No representations are made about the suitability of this software |
9 * granted. No representations are made about the suitability of this software |
10 * for any purpose. It is provided "as is" without express or implied warranty. |
10 * for any purpose. It is provided "as is" without express or implied warranty. |
178 } |
178 } |
179 |
179 |
180 MemberListIterator::MemberListIterator(const QList<MemberDef> &l) : |
180 MemberListIterator::MemberListIterator(const QList<MemberDef> &l) : |
181 QListIterator<MemberDef>(l) |
181 QListIterator<MemberDef>(l) |
182 { |
182 { |
|
183 } |
|
184 |
|
185 bool MemberList::declVisible() const |
|
186 { |
|
187 MemberListIterator mli(*this); |
|
188 MemberDef *md; |
|
189 for ( ; (md=mli.current()); ++mli ) |
|
190 { |
|
191 if (md->isBriefSectionVisible()) |
|
192 { |
|
193 switch (md->memberType()) |
|
194 { |
|
195 case MemberDef::Define: // fall through |
|
196 case MemberDef::Typedef: // fall through |
|
197 case MemberDef::Variable: // fall through |
|
198 case MemberDef::Function: // fall through |
|
199 case MemberDef::Signal: // fall through |
|
200 case MemberDef::Slot: // fall through |
|
201 case MemberDef::DCOP: // fall through |
|
202 case MemberDef::Property: // fall through |
|
203 case MemberDef::Event: |
|
204 return TRUE; |
|
205 case MemberDef::Enumeration: |
|
206 { |
|
207 int enumVars=0; |
|
208 MemberListIterator vmli(*this); |
|
209 MemberDef *vmd; |
|
210 QCString name(md->name()); |
|
211 int i=name.findRev("::"); |
|
212 if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) |
|
213 if (name[0]=='@') // anonymous enum => append variables |
|
214 { |
|
215 for ( ; (vmd=vmli.current()) ; ++vmli) |
|
216 { |
|
217 QCString vtype=vmd->typeString(); |
|
218 if ((vtype.find(name))!=-1) |
|
219 { |
|
220 enumVars++; |
|
221 } |
|
222 } |
|
223 } |
|
224 // if this is an anoymous enum and there are variables of this |
|
225 // enum type (i.e. enumVars>0), then we do not show the enum here. |
|
226 if (enumVars==0) // show enum here |
|
227 { |
|
228 return TRUE; |
|
229 } |
|
230 } |
|
231 break; |
|
232 case MemberDef::Friend: |
|
233 return TRUE; |
|
234 case MemberDef::EnumValue: |
|
235 { |
|
236 if (m_inGroup) |
|
237 { |
|
238 return TRUE; |
|
239 } |
|
240 } |
|
241 break; |
|
242 } |
|
243 } |
|
244 } |
|
245 return FALSE; |
183 } |
246 } |
184 |
247 |
185 void MemberList::writePlainDeclarations(OutputList &ol, |
248 void MemberList::writePlainDeclarations(OutputList &ol, |
186 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd |
249 ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd |
187 ) |
250 ) |
345 if (numDecMembers()==0) return; |
408 if (numDecMembers()==0) return; |
346 //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n", |
409 //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n", |
347 // this,title,subtitle,numDecMembers()); |
410 // this,title,subtitle,numDecMembers()); |
348 if (title) |
411 if (title) |
349 { |
412 { |
350 ol.startMemberHeader(); |
413 ol.startMemberHeader(listTypeAsString()); |
351 ol.parseText(title); |
414 ol.parseText(title); |
352 ol.endMemberHeader(); |
415 ol.endMemberHeader(); |
353 } |
416 } |
354 if (subtitle) |
417 if (subtitle) |
355 { |
418 { |
457 { |
520 { |
458 QCString diskName=md->getOutputFileBase(); |
521 QCString diskName=md->getOutputFileBase(); |
459 QCString title=md->qualifiedName(); |
522 QCString title=md->qualifiedName(); |
460 startFile(ol,diskName,md->name(),title); |
523 startFile(ol,diskName,md->name(),title); |
461 container->writeNavigationPath(ol); |
524 container->writeNavigationPath(ol); |
|
525 ol.startContents(); |
462 |
526 |
463 ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n" |
527 ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n" |
464 " <tr>\n" |
528 " <tr>\n" |
465 " <td valign=\"top\">\n"); |
529 " <td valign=\"top\">\n"); |
466 |
530 |
509 { |
573 { |
510 md->addListReference(def); |
574 md->addListReference(def); |
511 LockingPtr<MemberList> enumFields = md->enumFieldList(); |
575 LockingPtr<MemberList> enumFields = md->enumFieldList(); |
512 if (md->memberType()==MemberDef::Enumeration && enumFields!=0) |
576 if (md->memberType()==MemberDef::Enumeration && enumFields!=0) |
513 { |
577 { |
|
578 //printf(" Adding enum values!\n"); |
514 MemberListIterator vmli(*enumFields); |
579 MemberListIterator vmli(*enumFields); |
515 MemberDef *vmd; |
580 MemberDef *vmd; |
516 for ( ; (vmd=vmli.current()) ; ++vmli) |
581 for ( ; (vmd=vmli.current()) ; ++vmli) |
517 { |
582 { |
|
583 //printf(" adding %s\n",vmd->name().data()); |
518 vmd->addListReference(def); |
584 vmd->addListReference(def); |
519 } |
585 } |
520 } |
586 } |
521 } |
587 } |
522 } |
588 } |
611 memberGroupList->append(mg); |
677 memberGroupList->append(mg); |
612 } |
678 } |
613 } |
679 } |
614 } |
680 } |
615 |
681 |
|
682 QCString MemberList::listTypeAsString() const |
|
683 { |
|
684 switch(m_listType) |
|
685 { |
|
686 case pubMethods: return "pub-methods"; |
|
687 case proMethods: return "pro-methods"; |
|
688 case pacMethods: return "pac-methods"; |
|
689 case priMethods: return "pri-methods"; |
|
690 case pubStaticMethods: return "pub-static-methods"; |
|
691 case proStaticMethods: return "pro-static-methods"; |
|
692 case pacStaticMethods: return "pac-static-methods"; |
|
693 case priStaticMethods: return "pri-static-methods"; |
|
694 case pubSlots: return "pub-slots"; |
|
695 case proSlots: return "pro-slots"; |
|
696 case priSlots: return "pri-slots"; |
|
697 case pubAttribs: return "pub-attribs"; |
|
698 case proAttribs: return "pro-attribs"; |
|
699 case pacAttribs: return "pac-attribs"; |
|
700 case priAttribs: return "pri-attribs"; |
|
701 case pubStaticAttribs: return "pub-static-attribs"; |
|
702 case proStaticAttribs: return "pro-static-attribs"; |
|
703 case pacStaticAttribs: return "pac-static-attribs"; |
|
704 case priStaticAttribs: return "pri-static-attribs"; |
|
705 case pubTypes: return "pub-types"; |
|
706 case proTypes: return "pro-types"; |
|
707 case pacTypes: return "pac-types"; |
|
708 case priTypes: return "pri-types"; |
|
709 case related: return "related"; |
|
710 case signals: return "signals"; |
|
711 case friends: return "friends"; |
|
712 case dcopMethods: return "dcop-methods"; |
|
713 case properties: return "properties"; |
|
714 case events: return "events"; |
|
715 case decDefineMembers: return "define-members"; |
|
716 case decProtoMembers: return "proto-members"; |
|
717 case decTypedefMembers: return "typedef-members"; |
|
718 case decEnumMembers: return "enum-members"; |
|
719 case decFuncMembers: return "func-members"; |
|
720 case decVarMembers: return "var-members"; |
|
721 case decEnumValMembers: return "enumval-members"; |
|
722 case decPubSlotMembers: return "pub-slot-members"; |
|
723 case decProSlotMembers: return "pro-slot-members"; |
|
724 case decPriSlotMembers: return "pri-slot-members"; |
|
725 case decSignalMembers: return "signal-members"; |
|
726 case decEventMembers: return "event-members"; |
|
727 case decFriendMembers: return "friend-members"; |
|
728 case decPropMembers: return "prop-members"; |
|
729 case enumFields: return "enum-fields"; |
|
730 case memberGroup: return "member-group"; |
|
731 default: break; |
|
732 } |
|
733 return ""; |
|
734 } |
|
735 |
616 //-------------------------------------------------------------------------- |
736 //-------------------------------------------------------------------------- |
617 |
737 |
618 int MemberSDict::compareItems(GCI item1, GCI item2) |
738 int MemberSDict::compareItems(GCI item1, GCI item2) |
619 { |
739 { |
620 MemberDef *c1=(MemberDef *)item1; |
740 MemberDef *c1=(MemberDef *)item1; |
621 MemberDef *c2=(MemberDef *)item2; |
741 MemberDef *c2=(MemberDef *)item2; |
622 return stricmp(c1->name(),c2->name()); |
742 return stricmp(c1->name(),c2->name()); |
623 } |
743 } |
624 |
744 |
|
745 |