Hi,

On Thu, 2009-02-05 at 09:17 +0100, Marcus Lindblom wrote:
> Gerrit Voss wrote:
> > Hi,
> >
> > On Thu, 2009-02-05 at 15:26 +0800, Gerrit Voss wrote:
> >   
> >> Hi,
> >>
> >> On Wed, 2009-02-04 at 17:58 -0600, Dirk Reiners wrote:
> >>     
> >>>   Hi Marcus,
> >>>
> >>> Marcus Lindblom wrote:
> >>>       
> >>>> I can't come up with a good solution here, at least not of top of my 
> >>>> head. Naming the macro similarly in all classes and #undeffing it after 
> >>>> the class's definition is hackish. So is using #include (which may not 
> >>>> work either).
> >>>>         
> >>> given that you're using doxygen anyway, what's wrong with just using 
> >>> INLINE_INHERITED_MEMB = YES? That will insert all the base members into 
> >>> the 
> >>> derived class' documentation. We had that for a while, but it tends to 
> >>> make the 
> >>> classes fairly big, so it's not currently active (at least in 2).
> >>>
> >>> That would work without any code changes! ;)
> >>>
> >>>       
> >> but result in a quite bloated doc, the compromise would be to modify
> >> doxygen to only include *Base class members. I'm anyway tempted to do
> >> it to get all the helpers out of the class hierarchy ;-)
> >>     
> >
> >
> > http://www.cgmt.org/user/gerrit/Doc/html/ is what it would look like
> > with only the base doc merged in.
> >   
> Cool! How did you do that?
> 

modify doxygen ;-), attached the patch against their latest svn, in case
you are interested in it. I just added 2 new commands

\notinhierarchy and \includebasedoc so the transform comment looks like


/*! \brief Transform provides one matrix to transform objects.
    \ingroup GrpSystemNodeCoresMisc
    \includebasedoc
*/

to get the TransformBase doc merged. It might not be very robust though.

I have to see if I can make it a global option so one does not have to 
modify the comments.

It was just a quick try this afternoon to see if it is possible with
a  reasonable amount of work ;-)

kind regards,
  gerrit

diff --git a/src/classdef.cpp b/src/classdef.cpp
index b20a222..fcbbed8 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -170,6 +170,9 @@ class ClassDefImpl
     bool subGrouping; 
 
     bool usedOnly;
+
+    bool notInHierarchy;
+    bool includeBaseDocs;
 };
 
 void ClassDefImpl::init(const char *defFileName, const char *name,
@@ -209,6 +212,9 @@ void ClassDefImpl::init(const char *defFileName, const char *name,
   membersMerged = FALSE;
   categoryOf = 0;
   usedOnly = FALSE;
+  notInHierarchy = false;
+  includeBaseDocs = false;
+
   //QCString ns;
   //extractNamespaceName(name,className,ns);
   //printf("m_name=%s m_className=%s ns=%s\n",m_name.data(),m_className.data(),ns.data());
@@ -2086,7 +2092,8 @@ bool ClassDef::isVisibleInHierarchy()
        isReference()
       ) &&
       // is not part of an unnamed namespace or shown anyway
-      (!m_impl->isStatic || extractStatic);
+      (!m_impl->isStatic || extractStatic) &&
+      (!m_impl->notInHierarchy);
 }
 
 bool ClassDef::hasDocumentation() const
@@ -2152,7 +2159,6 @@ void ClassDef::mergeMembers()
   int sepLen = sep.length();
 
   m_impl->membersMerged=TRUE;
-  //printf("  mergeMembers for %s\n",name().data());
   bool inlineInheritedMembers = Config_getBool("INLINE_INHERITED_MEMB" );
   if (baseClasses())
   {
@@ -2166,6 +2172,11 @@ void ClassDef::mergeMembers()
       // merge the members in the base class of this inheritance branch first
       bClass->mergeMembers();
 
+      if(m_impl->includeBaseDocs == false)
+      {
+          continue;
+      }
+
       MemberNameInfoSDict *srcMnd  = bClass->memberNameInfoSDict();
       MemberNameInfoSDict *dstMnd  = m_impl->allMemberNameInfoSDict;
 
@@ -2277,7 +2288,7 @@ void ClassDef::mergeMembers()
                 if (bcd->prot==Protected && prot==Public)       prot=bcd->prot;
                 else if (bcd->prot==Private)                    prot=bcd->prot;
 
-                if (inlineInheritedMembers)
+                if (inlineInheritedMembers || m_impl->includeBaseDocs == true)
                 {
                   if (!isStandardFunc(srcMd))
                   {
@@ -2352,7 +2363,7 @@ void ClassDef::mergeMembers()
                 Specifier virt=mi->virt;
                 if (mi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt;
 
-                if (inlineInheritedMembers)
+                if (inlineInheritedMembers || m_impl->includeBaseDocs == true)
                 {
                   if (!isStandardFunc(mi->memberDef))
                   {
@@ -3391,6 +3402,16 @@ bool ClassDef::isUsedOnly() const
   return m_impl->usedOnly;
 }
 
+void ClassDef::setNotInHierarchy(bool b)
+{
+    m_impl->notInHierarchy = b;
+}
+
+void ClassDef::setIncludeBaseDocs(bool b)
+{
+    m_impl->includeBaseDocs = b;
+}
+
 void ClassDef::reclassifyMember(MemberDef *md,MemberDef::MemberType t)
 {
   md->setMemberType(t);
diff --git a/src/classdef.h b/src/classdef.h
index 7c390c6..c57aeca 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -295,6 +295,9 @@ class ClassDef : public Definition
     void setCategoryOf(ClassDef *cd);
     void setUsedOnly(bool b);
 
+    void setNotInHierarchy (bool b);
+    void setIncludeBaseDocs(bool b);
+
     //-----------------------------------------------------------------------------------
     // --- actions ----
     //-----------------------------------------------------------------------------------
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 125cd99..0f562f9 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -1193,11 +1193,12 @@ static void addClassToContext(EntryNav *rootNav)
     // see if the class is found inside a namespace 
     //bool found=addNamespace(root,cd);
 
+    cd->setNotInHierarchy (root->notInHierarchy);
+    cd->setIncludeBaseDocs(root->includeBaseDocs);
 
     // the empty string test is needed for extract all case
     cd->setBriefDescription(root->brief,root->briefFile,root->briefLine);
     cd->insertUsedFile(root->fileName);
-
     // add class to the list
     //printf("ClassDict.insert(%s)\n",resolveDefines(fullName).data());
     Doxygen::classSDict->append(fullName,cd);
@@ -7204,7 +7205,7 @@ static void generateClassList(ClassSDict &classSDict)
       // template instances 
       if ( cd->isLinkableInProject() && cd->templateMaster()==0)
       {
-        msg("Generating docs for compound %s...\n",cd->name().data());
+        msg("Generating docs for compound 1 %s...\n",cd->name().data());
 
         cd->writeDocumentation(*g_outputList);
         cd->writeMemberList(*g_outputList);
@@ -8109,7 +8110,7 @@ static void generateNamespaceDocs()
            && !cd->isHidden()
          )
       {
-        msg("Generating docs for compound %s...\n",cd->name().data());
+        msg("Generating docs for compound 2 %s...\n",cd->name().data());
 
         cd->writeDocumentation(*g_outputList);
         cd->writeMemberList(*g_outputList);
diff --git a/src/entry.cpp b/src/entry.cpp
index 79cb9c8..cbb7fab 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -72,6 +72,8 @@ Entry::Entry()
   relatesType = Simple;
   hidden = FALSE;
   groupDocType = GROUPDOC_NORMAL;
+  notInHierarchy  = false; 
+  includeBaseDocs = false;
   reset();
 }
 
@@ -136,6 +138,9 @@ Entry::Entry(const Entry &e)
   tArgLists = 0;
   groupDocType = e.groupDocType;
 
+  notInHierarchy  = e.notInHierarchy; 
+  includeBaseDocs = e.includeBaseDocs;
+
   // deep copy of the child entry list
   QListIterator<Entry> eli(*e.m_sublist);
   Entry *cur;
@@ -286,6 +291,9 @@ void Entry::reset()
   subGrouping = TRUE;
   protection = Public;
   groupDocType = GROUPDOC_NORMAL;
+  notInHierarchy  = false; 
+  includeBaseDocs = false;
+
   m_sublist->clear();
   extends->clear();
   groups->clear();
diff --git a/src/entry.h b/src/entry.h
index bf3ed40..dcf762b 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -363,6 +363,9 @@ class Entry
     bool        artificial;   //!< Artificially introduced item
     GroupDocType groupDocType;
 
+    bool        notInHierarchy; 
+    bool        includeBaseDocs;
+
     static int  num;          //!< counts the total number of entries
 
     /// return the command name used to define GROUPDOC_SEC
diff --git a/src/marshal.cpp b/src/marshal.cpp
index 803c53b..cf3baf1 100644
--- a/src/marshal.cpp
+++ b/src/marshal.cpp
@@ -414,6 +414,8 @@ void marshalEntry(StorageIntf *s,Entry *e)
   marshalBool(s,e->hidden);
   marshalBool(s,e->artificial);
   marshalInt(s,(int)e->groupDocType);
+  marshalBool(s, e->notInHierarchy);
+  marshalBool(s, e->includeBaseDocs);
 }
 
 void marshalEntryTree(StorageIntf *s,Entry *e)
@@ -810,6 +812,8 @@ Entry * unmarshalEntry(StorageIntf *s)
   e->hidden           = unmarshalBool(s);
   e->artificial       = unmarshalBool(s);
   e->groupDocType     = (Entry::GroupDocType)unmarshalInt(s);
+  e->notInHierarchy   = unmarshalBool(s);
+  e->includeBaseDocs  = unmarshalBool(s);
   return e;
 }
 
diff --git a/src/scanner.l b/src/scanner.l
index 5ec6b54..a0a8d3a 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -5106,6 +5106,8 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
 					    REJECT;
 					  }
   					}
+<DocBlock>{CMD}("nohierarchy")	  { current->notInHierarchy  = true; }
+<DocBlock>{CMD}("includebasedoc") { current->includeBaseDocs = true; }
 <DocBlock>[...@*\/\\\n]+			{ // any character that isn't special
   					  docBlock+=yytext;
   					}
@@ -5541,7 +5543,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
     yyLineNr= 1 ; 
     yyFileName = fileName;
     setContext();
-    msg("Parsing file %s...\n",yyFileName.data());
+    msg("Parsing file 1 %s...\n",yyFileName.data());
 
     current_root  = rt ;
     initParser();
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to