Orb/Doxygen/src/memberlist.cpp
changeset 4 468f4c8d3d5b
parent 0 42188c7ea2d9
--- a/Orb/Doxygen/src/memberlist.cpp	Fri Apr 23 20:47:58 2010 +0100
+++ b/Orb/Doxygen/src/memberlist.cpp	Wed Aug 11 14:49:30 2010 +0100
@@ -2,7 +2,7 @@
  *
  * 
  *
- * Copyright (C) 1997-2008 by Dimitri van Heesch.
+ * Copyright (C) 1997-2010 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 
@@ -182,6 +182,69 @@
 {
 }
 
+bool MemberList::declVisible() const
+{
+  MemberListIterator mli(*this);
+  MemberDef *md;
+  for ( ; (md=mli.current()); ++mli )
+  {
+    if (md->isBriefSectionVisible())
+    {
+      switch (md->memberType())
+      {
+        case MemberDef::Define:    // fall through
+        case MemberDef::Typedef:   // fall through
+        case MemberDef::Variable:  // fall through
+        case MemberDef::Function:  // fall through
+        case MemberDef::Signal:    // fall through
+        case MemberDef::Slot:      // fall through
+        case MemberDef::DCOP:      // fall through
+        case MemberDef::Property:  // fall through
+        case MemberDef::Event:  
+          return TRUE;
+        case MemberDef::Enumeration: 
+          {
+            int enumVars=0;
+            MemberListIterator vmli(*this);
+            MemberDef *vmd;
+            QCString name(md->name());
+            int i=name.findRev("::");
+            if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?)
+            if (name[0]=='@') // anonymous enum => append variables
+            {
+              for ( ; (vmd=vmli.current()) ; ++vmli)
+              {
+                QCString vtype=vmd->typeString();
+                if ((vtype.find(name))!=-1) 
+                {
+                  enumVars++;
+                }
+              }
+            }
+            // if this is an anoymous enum and there are variables of this
+            // enum type (i.e. enumVars>0), then we do not show the enum here.
+            if (enumVars==0) // show enum here
+            {
+              return TRUE;
+            }
+          }
+          break;
+        case MemberDef::Friend:
+          return TRUE;
+        case MemberDef::EnumValue: 
+          {
+            if (m_inGroup)
+            {
+              return TRUE;
+            }
+          }
+          break;
+      }
+    }
+  }
+  return FALSE;
+}
+
 void MemberList::writePlainDeclarations(OutputList &ol,
                        ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd
                       )
@@ -347,7 +410,7 @@
   //    this,title,subtitle,numDecMembers());
   if (title) 
   {
-    ol.startMemberHeader();
+    ol.startMemberHeader(listTypeAsString());
     ol.parseText(title);
     ol.endMemberHeader();
   }
@@ -459,6 +522,7 @@
     QCString title=md->qualifiedName();
     startFile(ol,diskName,md->name(),title);
     container->writeNavigationPath(ol);
+    ol.startContents();
 
     ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n"
                    "  <tr>\n"
@@ -511,10 +575,12 @@
       LockingPtr<MemberList> enumFields = md->enumFieldList();
       if (md->memberType()==MemberDef::Enumeration && enumFields!=0)
       {
+        //printf("  Adding enum values!\n");
         MemberListIterator vmli(*enumFields);
         MemberDef *vmd;
         for ( ; (vmd=vmli.current()) ; ++vmli)
         {
+          //printf("   adding %s\n",vmd->name().data());  
           vmd->addListReference(def);
         }
       }
@@ -613,6 +679,60 @@
   }
 }
 
+QCString MemberList::listTypeAsString() const
+{
+  switch(m_listType)
+  {
+    case pubMethods: return "pub-methods";
+    case proMethods: return "pro-methods";
+    case pacMethods: return "pac-methods";
+    case priMethods: return "pri-methods";
+    case pubStaticMethods: return "pub-static-methods";
+    case proStaticMethods: return "pro-static-methods";
+    case pacStaticMethods: return "pac-static-methods";
+    case priStaticMethods: return "pri-static-methods";
+    case pubSlots: return "pub-slots";
+    case proSlots: return "pro-slots";
+    case priSlots: return "pri-slots";
+    case pubAttribs: return "pub-attribs";
+    case proAttribs: return "pro-attribs";
+    case pacAttribs: return "pac-attribs";
+    case priAttribs: return "pri-attribs";
+    case pubStaticAttribs: return "pub-static-attribs";
+    case proStaticAttribs: return "pro-static-attribs";
+    case pacStaticAttribs: return "pac-static-attribs";
+    case priStaticAttribs: return "pri-static-attribs";
+    case pubTypes: return "pub-types";
+    case proTypes: return "pro-types";
+    case pacTypes: return "pac-types";
+    case priTypes: return "pri-types";
+    case related: return "related";
+    case signals: return "signals";
+    case friends: return "friends";
+    case dcopMethods: return "dcop-methods";
+    case properties: return "properties";
+    case events: return "events";
+    case decDefineMembers: return "define-members";
+    case decProtoMembers: return "proto-members";
+    case decTypedefMembers: return "typedef-members";
+    case decEnumMembers: return "enum-members";
+    case decFuncMembers: return "func-members";
+    case decVarMembers: return "var-members";
+    case decEnumValMembers: return "enumval-members";
+    case decPubSlotMembers: return "pub-slot-members";
+    case decProSlotMembers: return "pro-slot-members";
+    case decPriSlotMembers: return "pri-slot-members";
+    case decSignalMembers: return "signal-members";
+    case decEventMembers: return "event-members";
+    case decFriendMembers: return "friend-members";
+    case decPropMembers: return "prop-members";
+    case enumFields: return "enum-fields";
+    case memberGroup: return "member-group";
+    default: break;
+  }
+  return "";
+}
+
 //--------------------------------------------------------------------------
 
 int MemberSDict::compareItems(GCI item1, GCI item2)
@@ -622,3 +742,4 @@
   return stricmp(c1->name(),c2->name());
 }
 
+