From 55e5055cfbb6f8e013a894c0ec8b10771231e3ba Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 19 May 2012 12:11:23 +0000 Subject: Release-1.8.1 --- Doxyfile | 1 - INSTALL | 4 +- README | 4 +- configure | 4 +- doc/doxygen_manual.css | 61 ++- doc/markdown.doc | 3 +- doc/preprocessing.doc | 4 +- qtools/Doxyfile | 5 +- src/classdef.cpp | 161 ++++---- src/classdef.h | 11 +- src/code.l | 2 +- src/commentscan.l | 9 + src/config.xml | 10 + src/configoptions.cpp | 13 + src/dot.cpp | 67 +++- src/doxygen.cpp | 14 + src/doxygen.css | 75 ++-- src/doxygen_css.h | 75 ++-- src/dynsections.js | 4 +- src/dynsections_js.h | 4 +- src/filedef.cpp | 14 +- src/formula.cpp | 2 +- src/fortrancode.l | 74 ++-- src/fortranscanner.l | 33 +- src/ftvhelp.cpp | 232 +++++++++--- src/ftvhelp.h | 4 +- src/htmldocvisitor.cpp | 8 +- src/htmlgen.cpp | 72 ++-- src/htmlgen.h | 14 +- src/index.cpp | 277 +++++++------- src/latexdocvisitor.cpp | 2 +- src/latexgen.cpp | 6 +- src/latexgen.h | 2 +- src/mangen.h | 2 +- src/markdown.cpp | 26 +- src/memberdef.cpp | 964 +++++++++++++++++++++++++----------------------- src/memberdef.h | 12 +- src/membergroup.cpp | 15 +- src/membergroup.h | 6 +- src/memberlist.cpp | 79 +++- src/memberlist.h | 3 +- src/navtree.css | 2 + src/navtree.js | 54 ++- src/navtree_css.h | 2 + src/navtree_js.h | 54 ++- src/outputgen.h | 2 +- src/outputlist.h | 4 +- src/pagedef.cpp | 19 +- src/pycode.l | 2 +- src/resize.js | 12 + src/resize_js.h | 12 + src/rtfgen.h | 2 +- src/sortdict.h | 2 +- src/util.cpp | 50 ++- src/util.h | 2 +- src/vhdlcode.l | 2 +- src/vhdlparser.y | 7 +- src/vhdlscanner.l | 4 +- src/xmlgen.cpp | 12 +- 59 files changed, 1643 insertions(+), 979 deletions(-) diff --git a/Doxyfile b/Doxyfile index cf5d7c9..e8ece5c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -188,7 +188,6 @@ HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = YES -HTML_ALIGN_MEMBERS = YES HTML_DYNAMIC_SECTIONS = YES GENERATE_DOCSET = YES DOCSET_FEEDNAME = "Doxygen docs" diff --git a/INSTALL b/INSTALL index 267599d..82c2869 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.8.0-20120429 +DOXYGEN Version 1.8.1 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (29 April 2012) +Dimitri van Heesch (19 May 2012) diff --git a/README b/README index 4881010..6b2b775 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.8.0_20120429 +DOXYGEN Version 1.8.1 Please read INSTALL for compilation instructions. @@ -26,4 +26,4 @@ forum. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (29 April 2012) +Dimitri van Heesch (dimitri@stack.nl) (19 May 2012) diff --git a/configure b/configure index 60926d8..2a578ad 100755 --- a/configure +++ b/configure @@ -17,10 +17,10 @@ doxygen_version_major=1 doxygen_version_minor=8 -doxygen_version_revision=0 +doxygen_version_revision=1 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=20120429 +doxygen_version_mmn=NO bin_dirs=`echo $PATH | sed -e "s/:/ /g"` diff --git a/doc/doxygen_manual.css b/doc/doxygen_manual.css index eea5d47..c2b0029 100644 --- a/doc/doxygen_manual.css +++ b/doc/doxygen_manual.css @@ -149,20 +149,55 @@ dl.el { margin-left: -1cm; } -.fragment { - font-family: monospace, fixed; - font-size: 105%; -} - pre.fragment { - border: 1px solid #D5D5D5; - background-color: #FCFCFC; - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; +} + +div.fragment { + padding: 4px; + margin: 4px; + background-color: #FCFCFC; + border: 1px solid #D5D5D5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; +} + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; } div.ah { diff --git a/doc/markdown.doc b/doc/markdown.doc index 30fca62..8bb972e 100644 --- a/doc/markdown.doc +++ b/doc/markdown.doc @@ -72,7 +72,8 @@ Level 1 or 2 headers can be made as the follows ------------------------- A header is followed by a line containing only ='s or -'s. -Note that the exact amount of ='s or -'s is not important. +Note that the exact amount of ='s or -'s is not important as long as +there are at least two. Alternatively, you can use #'s at the start of a line to make a header. The number of #'s at the start of the line determines the level (up to 6 levels are supported). diff --git a/doc/preprocessing.doc b/doc/preprocessing.doc index 49dd0f1..db5418f 100644 --- a/doc/preprocessing.doc +++ b/doc/preprocessing.doc @@ -75,8 +75,8 @@ the \ref cfg_predefined "PREDEFINED" or \ref cfg_expand_as_defined "EXPAND_AS_DEFINED" tag. A typically example where some help from the preprocessor is needed is -when dealing with Microsoft's __declspec language extension. Here is an -example function. +when dealing with Microsoft's __declspec language extension. The same goes +for GNU's __attribute__ extension. Here is an example function. \verbatim extern "C" void __declspec(dllexport) ErrorMsg( String aMessage,...); diff --git a/qtools/Doxyfile b/qtools/Doxyfile index 13f4d0e..65efcf4 100644 --- a/qtools/Doxyfile +++ b/qtools/Doxyfile @@ -9,7 +9,7 @@ PROJECT_NUMBER = PROJECT_BRIEF = PROJECT_LOGO = OUTPUT_DIRECTORY = ../qtools_docs -CREATE_SUBDIRS = NO +CREATE_SUBDIRS = YES OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES @@ -117,7 +117,7 @@ FILTER_SOURCE_PATTERNS = #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- -SOURCE_BROWSER = NO +SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES @@ -145,7 +145,6 @@ HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = YES -HTML_ALIGN_MEMBERS = YES HTML_DYNAMIC_SECTIONS = YES GENERATE_DOCSET = YES DOCSET_FEEDNAME = "Doxygen generated docs" diff --git a/src/classdef.cpp b/src/classdef.cpp index ad33bd7..43ffdb5 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -990,7 +990,6 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &/*pageTy ol.endGroupHeader(); writeDetailedDocumentationBody(ol); - } else { @@ -1022,7 +1021,6 @@ void ClassDef::showUsedFiles(OutputList &ol) m_impl->files.count()==1)); } - bool first=TRUE; const char *file = m_impl->files.first(); while (file) @@ -2082,13 +2080,16 @@ void ClassDef::writeMemberList(OutputList &ol) ol.parseText(displayName()+" "+theTranslator->trMemberList()); endTitle(ol,0,0); ol.startContents(); + ol.startParagraph(); ol.parseText(theTranslator->trThisIsTheListOfAllMembers()); ol.writeObjectLink(getReference(),getOutputFileBase(),anchor(),displayName()); ol.parseText(theTranslator->trIncludingInheritedMembers()); + ol.endParagraph(); //ol.startItemList(); - ol.writeString("\n"); + ol.writeString("
\n"); + int idx=0; //MemberNameInfo *mni=m_impl->allMemberNameInfoList->first(); MemberNameInfoSDict::Iterator mnii(*m_impl->allMemberNameInfoSDict); MemberNameInfo *mni; @@ -2105,7 +2106,6 @@ void ClassDef::writeMemberList(OutputList &ol) //printf("%s: Member %s of class %s md->protection()=%d mi->prot=%d prot=%d inherited=%d\n", // name().data(),md->name().data(),cd->name().data(),md->protection(),mi->prot,prot,mi->inherited); - if (cd && !md->name().isEmpty() && md->name()[0]!='@') { bool memberWritten=FALSE; @@ -2114,7 +2114,10 @@ void ClassDef::writeMemberList(OutputList &ol) { QCString name=mi->ambiguityResolutionScope+md->name(); //ol.writeListItem(); - ol.writeString(" "); - ol.writeString("=maxLevel) // item invisible by default + t << " style=\"display:none;\""; + else // item visible by default + index++; t << ">" << endl; folderId++; - generateTree(t,n->children,level+1,index); - //t << spaces << "\n"; + generateTree(t,n->children,level+1,maxLevel,index); } - else + else // leaf node { FileDef *srcRef=0; if (n->def && n->def->definitionType()==Definition::TypeFile && @@ -926,9 +959,11 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in } if (n->def && n->def->definitionType()==Definition::TypeGroup) { - //t << ""; + // no icon + } + else if (n->def && n->def->definitionType()==Definition::TypePage) + { + // no icon } else if (n->def && n->def->definitionType()==Definition::TypeNamespace) { @@ -948,7 +983,6 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in t << FTV_IMGATTRIBS(doc); t << "/>"; } - //t << "

\n"; if (srcRef) { t << ""; @@ -966,14 +1000,35 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in //----------------------------------------------------------- -static void writePathToNode(FTextStream &tidx,FTVNode *leaf,FTVNode *n) +struct NavIndexEntry +{ + NavIndexEntry(const QCString &u,const QCString &p) : url(u), path(p) {} + QCString url; + QCString path; +}; + +class NavIndexEntryList : public QList +{ + public: + NavIndexEntryList() : QList() { setAutoDelete(TRUE); } + ~NavIndexEntryList() {} + int compareItems(GCI item1,GCI item2) + { + // sort list based on url + return qstrcmp(((NavIndexEntry*)item1)->url,((NavIndexEntry*)item2)->url); + } +}; + +static QCString pathToNode(FTVNode *leaf,FTVNode *n) { + QCString result; if (n->parent) { - writePathToNode(tidx,leaf,n->parent); + result+=pathToNode(leaf,n->parent); } - tidx << n->index; - if (leaf!=n) tidx << ","; + result+=QCString().setNum(n->index); + if (leaf!=n) result+=","; + return result; } static bool dupOfParent(const FTVNode *n) @@ -991,7 +1046,6 @@ static void generateJSLink(FTextStream &t,FTVNode *n) } else // link into other page { - // TODO: use m_topLevelIndex t << "\"" << convertToJSString(n->name) << "\", \""; t << externalRef("",n->ref,TRUE); t << node2URL(n); @@ -999,7 +1053,8 @@ static void generateJSLink(FTextStream &t,FTVNode *n) } } -static bool generateJSTree(FTextStream &tidx,FTextStream &t, const QList &nl,int level,bool &first) +static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t, + const QList &nl,int level,bool &first) { QCString indentStr; indentStr.fill(' ',level*2); @@ -1019,11 +1074,9 @@ static bool generateJSTree(FTextStream &tidx,FTextStream &t, const QListaddToNavIndex) + if (n->addToNavIndex) // add entry to the navigation index { - tidx << "," << endl << "\"" << node2URL(n) << "\":["; - writePathToNode(tidx,n,n); - tidx << "]"; + navIndex.append(new NavIndexEntry(node2URL(n),pathToNode(n,n))); } if (n->separateIndex) // store items in a separate file for dynamic loading @@ -1043,12 +1096,11 @@ static bool generateJSTree(FTextStream &tidx,FTextStream &t, const QList=0) varId = varId.mid(i+1); tt << "var " << varId << " =" << endl; - generateJSTree(tidx,tt,n->children,1,firstChild); + generateJSTree(navIndex,tt,n->children,1,firstChild); tt << endl << "];"; } // write file name without extension as marker t << "\"" << fileId << "\" ]"; - //if (n->file!="hierarchy") addFilesToIndex(tidx,n); } else // no children { @@ -1060,7 +1112,7 @@ static bool generateJSTree(FTextStream &tidx,FTextStream &t, const QListchildren,level+1,firstChild); + bool emptySection = !generateJSTree(navIndex,t,n->children,level+1,firstChild); if (emptySection) t << "null ]"; else @@ -1074,12 +1126,12 @@ static void generateJSNavTree(const QList &nodeList) { QCString htmlOutput = Config_getString("HTML_OUTPUT"); QFile f(htmlOutput+"/navtree.js"); - QFile fidx(htmlOutput+"/navtreeindex.js"); - if (f.open(IO_WriteOnly) && fidx.open(IO_WriteOnly)) + NavIndexEntryList navIndex; + if (f.open(IO_WriteOnly) /*&& fidx.open(IO_WriteOnly)*/) { - FTextStream tidx(&fidx); - tidx << "var NAVTREEINDEX =" << endl; - tidx << "{" << endl; + //FTextStream tidx(&fidx); + //tidx << "var NAVTREEINDEX =" << endl; + //tidx << "{" << endl; FTextStream t(&f); t << "var NAVTREE =" << endl; t << "[" << endl; @@ -1103,10 +1155,13 @@ static void generateJSNavTree(const QList &nodeList) } t << "\"index" << Doxygen::htmlFileExtension << "\", "; - tidx << "\"index" << Doxygen::htmlFileExtension << "\":[]"; + // add special entry for index page + navIndex.append(new NavIndexEntry("index"+Doxygen::htmlFileExtension,"")); + // related page index is written as a child of index.html, so add this as well + navIndex.append(new NavIndexEntry("pages"+Doxygen::htmlFileExtension,"")); bool first=TRUE; - generateJSTree(tidx,t,nodeList,1,first); + generateJSTree(navIndex,t,nodeList,1,first); if (first) t << "]" << endl; @@ -1114,8 +1169,52 @@ static void generateJSNavTree(const QList &nodeList) t << endl << " ] ]" << endl; t << "];" << endl; t << endl << navtree_script; + } - tidx << endl << "};" << endl; + // write the navigation index (and sub-indices) + navIndex.sort(); + int subIndex=0; + int elemCount=0; + const int maxElemCount=250; + QFile fidx(htmlOutput+"/navtreeindex.js"); + QFile fsidx(htmlOutput+"/navtreeindex0.js"); + if (fidx.open(IO_WriteOnly) && fsidx.open(IO_WriteOnly)) + { + FTextStream tidx(&fidx); + FTextStream tsidx(&fsidx); + tidx << "var NAVTREEINDEX =" << endl; + tidx << "[" << endl; + tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl; + tsidx << "{" << endl; + QListIterator li(navIndex); + NavIndexEntry *e; + for (li.toFirst();(e=li.current());) // for each entry + { + if (elemCount==0) + { + tidx << "\"" << e->url << "\"," << endl; + } + tsidx << "\"" << e->url << "\":[" << e->path << "]"; + ++li; + if (li.current()) tsidx << ","; // not last entry + tsidx << endl; + + elemCount++; + if (li.current() && elemCount>=maxElemCount) // switch to new sub-index + { + tsidx << "};" << endl; + elemCount=0; + fsidx.close(); + subIndex++; + fsidx.setName(htmlOutput+"/navtreeindex"+QCString().setNum(subIndex)+".js"); + if (!fsidx.open(IO_WriteOnly)) break; + tsidx.setDevice(&fsidx); + tsidx << "var NAVTREEINDEX" << subIndex << " =" << endl; + tsidx << "{" << endl; + } + } + tsidx << "};" << endl; + tidx << "];" << endl; } } @@ -1159,9 +1258,8 @@ void FTVHelp::generateTreeViewScripts() // write tree inside page void FTVHelp::generateTreeViewInline(FTextStream &t) { - //generateScript(t); + int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES"); t << "
\n"; - QListIterator li(m_indentNodes[0]); FTVNode *n; int d=1, depth=1; @@ -1173,6 +1271,8 @@ void FTVHelp::generateTreeViewInline(FTextStream &t) if (d>depth) depth=d; } } + int preferredDepth = depth; + // write level selector if (depth>1) { t << "
["; @@ -1184,18 +1284,38 @@ void FTVHelp::generateTreeViewInline(FTextStream &t) t << "" << i << ""; } t << "]
"; + + if (preferredNumEntries>0) + { + preferredDepth=1; + for (int i=1;i<=depth;i++) + { + int num=0; + QListIterator li(m_indentNodes[0]); + FTVNode *n; + for (;(n=li.current());++li) + { + num+=n->numNodesAtLevel(0,i); + } + if (num<=preferredNumEntries) + { + preferredDepth=i; + } + else + { + break; + } + } + } } + //printf("preferred depth=%d\n",preferredDepth); -// t << "
\n"; -// t << "
\n"; t << "
"); + ol.writeString(" "); if (cd->isObjectiveC()) { if (md->isObjCMethod()) @@ -2125,7 +2128,7 @@ void ClassDef::writeMemberList(OutputList &ol) ol.writeString("- "); } else - ol.writeString(""); + ol.writeString(""); } if (md->isObjCMethod()) { @@ -2163,18 +2166,21 @@ void ClassDef::writeMemberList(OutputList &ol) // generate link to the class instead. { //ol.writeListItem(); - ol.writeString("
"); + ol.writeString("
"); if (cd->isObjectiveC()) { if (md->isObjCMethod()) { if (md->isStatic()) - ol.writeString("+ "); + ol.writeString("+ "); else - ol.writeString("- "); + ol.writeString("- "); } else - ol.writeString(""); + ol.writeString(""); } ol.startBold(); ol.docify(md->name()); @@ -2212,7 +2218,7 @@ void ClassDef::writeMemberList(OutputList &ol) } if (memberWritten) { - ol.writeString(""); + ol.writeString(""); ol.writeObjectLink(cd->getReference(), cd->getOutputFileBase(), cd->anchor(), @@ -2220,7 +2226,7 @@ void ClassDef::writeMemberList(OutputList &ol) md->category()->displayName() : cd->displayName()); ol.writeString(""); + ol.writeString(""); } SrcLangExt lang = md->getLanguage(); if ( @@ -2232,8 +2238,7 @@ void ClassDef::writeMemberList(OutputList &ol) ) && memberWritten) { - ol.startTypewriter(); - ol.docify(" ["); + ol.writeString(""); QStrList sl; if (lang==SrcLangExt_VHDL) { @@ -2262,10 +2267,9 @@ void ClassDef::writeMemberList(OutputList &ol) { ol.docify(s); s=sl.next(); - if (s) ol.docify(", "); + if (s) ol.writeString(""); } - ol.docify("]"); - ol.endTypewriter(); + ol.writeString(""); } if (memberWritten) { @@ -2383,7 +2387,7 @@ bool ClassDef::hasNonReferenceSuperClass() * definition of an anonymous struct, union or class. */ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, - const char *inheritId) + ClassDef *inheritedFrom,const char *inheritId) { //ol.insertMemberAlign(); //printf("ClassName=`%s' inGroup=%d\n",name().data(),inGroup); @@ -2423,7 +2427,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, for (;(mg=mgli.current());++mgli) { mg->setInGroup(inGroup); - mg->writePlainDeclarations(ol,this,0,0,0,inheritId); + mg->writePlainDeclarations(ol,this,0,0,0,inheritedFrom,inheritId); } } @@ -2435,7 +2439,7 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, if (lde->kind()==LayoutDocEntry::MemberDecl) { LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; - writePlainMemberDeclaration(ol,lmd->type,inGroup,inheritId); + writePlainMemberDeclaration(ol,lmd->type,inGroup,inheritedFrom,inheritId); } } } @@ -2684,7 +2688,7 @@ void ClassDef::mergeMembers() // it seems that the member is not reachable by prefixing a // scope name either (according to my compiler). Currently, // this case is shown anyway. - if (!found && srcMd->protection()!=Private) + if (!found && srcMd->protection()!=Private && !srcMd->isFriend()) { Protection prot=srcMd->protection(); if (bcd->prot==Protected && prot==Public) prot=bcd->prot; @@ -2747,38 +2751,41 @@ void ClassDef::mergeMembers() MemberInfo *mi; for (;(mi=mnii.current());++mnii) { - Protection prot = mi->prot; - if (bcd->prot==Protected) - { - if (prot==Public) prot=Protected; - } - else if (bcd->prot==Private) - { - prot=Private; - } - //printf("%s::%s: prot=%d bcd->prot=%d result=%d\n", - // name().data(),mi->memberDef->name().data(),mi->prot, - // bcd->prot,prot); - - if (mi->prot!=Private) + if (!mi->memberDef->isFriend()) // don't inherit friends { - Specifier virt=mi->virt; - if (mi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; + Protection prot = mi->prot; + if (bcd->prot==Protected) + { + if (prot==Public) prot=Protected; + } + else if (bcd->prot==Private) + { + prot=Private; + } + //printf("%s::%s: prot=%d bcd->prot=%d result=%d\n", + // name().data(),mi->memberDef->name().data(),mi->prot, + // bcd->prot,prot); - if (inlineInheritedMembers) + if (mi->prot!=Private) { - if (!isStandardFunc(mi->memberDef)) + Specifier virt=mi->virt; + if (mi->virt==Normal && bcd->virt!=Normal) virt=bcd->virt; + + if (inlineInheritedMembers) { - //printf(" insertMember `%s'\n",mi->memberDef->name().data()); - internalInsertMember(mi->memberDef,prot,FALSE); + if (!isStandardFunc(mi->memberDef)) + { + //printf(" insertMember `%s'\n",mi->memberDef->name().data()); + internalInsertMember(mi->memberDef,prot,FALSE); + } } + //printf("Adding!\n"); + MemberInfo *newMi=new MemberInfo(mi->memberDef,prot,virt,TRUE); + newMi->scopePath=bClass->name()+sep+mi->scopePath; + newMi->ambigClass=mi->ambigClass; + newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope.copy(); + newMni->append(newMi); } - //printf("Adding!\n"); - MemberInfo *newMi=new MemberInfo(mi->memberDef,prot,virt,TRUE); - newMi->scopePath=bClass->name()+sep+mi->scopePath; - newMi->ambigClass=mi->ambigClass; - newMi->ambiguityResolutionScope=mi->ambiguityResolutionScope.copy(); - newMni->append(newMi); } } @@ -3797,7 +3804,8 @@ static void convertProtectionLevel( } } -int ClassDef::countInheritedDecMembersRec(MemberList::ListType lt) +int ClassDef::countInheritedDecMembersRec(MemberList::ListType lt, + ClassDef *inheritedFrom) { int count=0; if (m_impl->inherits) @@ -3811,18 +3819,20 @@ int ClassDef::countInheritedDecMembersRec(MemberList::ListType lt) MemberList *ml = icd->getMemberList((MemberList::ListType)lt1); if (ml) { - ml->countDecMembers(); - count+=ml->numDecMembers(); - count+=icd->countInheritedDecMembersRec((MemberList::ListType)lt1); + //ml->countDecMembers(); + //count+=ml->numDecMembers(); + count+=ml->countInheritableMembers(inheritedFrom); + count+=icd->countInheritedDecMembersRec((MemberList::ListType)lt1,inheritedFrom); } if (lt2!=-1) { ml = icd->getMemberList((MemberList::ListType)lt2); if (ml) { - ml->countDecMembers(); - count+=ml->numDecMembers(); - count+=icd->countInheritedDecMembersRec((MemberList::ListType)lt2); + //ml->countDecMembers(); + //count+=ml->numDecMembers(); + count+=ml->countInheritableMembers(inheritedFrom); + count+=icd->countInheritedDecMembersRec((MemberList::ListType)lt2,inheritedFrom); } } ibcd=m_impl->inherits->next(); @@ -3849,12 +3859,13 @@ int ClassDef::countInheritedDecMembers(MemberList::ListType lt) MemberList *ml = getMemberList(lt); if (ml) { - ml->countDecMembers(); - count = ml->numDecMembers(); + //ml->countDecMembers(); + //count = ml->numDecMembers(); + count=ml->countInheritableMembers(this); } if (count==0) // for this class the member list is empty { - count = countInheritedDecMembersRec(lt); + count = countInheritedDecMembersRec(lt,this); } else // member list is not empty, so we will add the inherited members there { @@ -3874,7 +3885,10 @@ int ClassDef::countAdditionalInheritedMembers() if (lde->kind()==LayoutDocEntry::MemberDecl) { LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; - totalCount+=countInheritedDecMembers(lmd->type); + if (lmd->type!=MemberList::friends) // friendship is not inherited + { + totalCount+=countInheritedDecMembers(lmd->type); + } } } //printf("countAdditonalInheritedMembers()=%d\n",totalCount); @@ -3902,14 +3916,16 @@ void ClassDef::writeAdditionalInheritedMembers(OutputList &ol) } } -int ClassDef::countMembersIncludingGrouped(MemberList::ListType lt) +int ClassDef::countMembersIncludingGrouped(MemberList::ListType lt, + ClassDef *inheritedFrom) { int count=0; MemberList *ml = getMemberList(lt); if (ml) { - ml->countDecMembers(); - count=ml->numDecMembers(); + //ml->countDecMembers(); + //count=ml->numDecMembers(); + count=ml->countInheritableMembers(inheritedFrom); } if (m_impl->memberGroupSDict) { @@ -3923,6 +3939,8 @@ int ClassDef::countMembersIncludingGrouped(MemberList::ListType lt) } } } + //printf("%s:countMembersIncludingGrouped(%s)=%d\n", + // name().data(),ml?ml->listTypeAsString().data():"",count); return count; } @@ -3933,13 +3951,14 @@ void ClassDef::writeInheritedMemberDeclarations(OutputList &ol, { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - bool process = countMembersIncludingGrouped(lt)>0; + bool process = countMembersIncludingGrouped(lt,inheritedFrom)>0; if (process^invert) { if (m_impl->inherits) { - BaseClassDef *ibcd=m_impl->inherits->first(); - while (ibcd) + BaseClassListIterator it(*m_impl->inherits); + BaseClassDef *ibcd; + for (it.toFirst();(ibcd=it.current());++it) { ClassDef *icd=ibcd->classDef; int lt1,lt2; @@ -3949,9 +3968,9 @@ void ClassDef::writeInheritedMemberDeclarations(OutputList &ol, visitedClasses->insert(icd,icd); if (lt1!=-1) { - icd->writeMemberDeclarations(ol,(MemberList::ListType)lt1,title,QCString(),FALSE,inheritedFrom,lt2,visitedClasses); + icd->writeMemberDeclarations(ol,(MemberList::ListType)lt1, + title,QCString(),FALSE,inheritedFrom,lt2,visitedClasses); } - ibcd=m_impl->inherits->next(); } } } @@ -3995,7 +4014,8 @@ void ClassDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,co } } -void ClassDef::addGroupedInheritedMembers(OutputList &ol,MemberList::ListType lt,const QCString &inheritId) +void ClassDef::addGroupedInheritedMembers(OutputList &ol,MemberList::ListType lt, + ClassDef *inheritedFrom,const QCString &inheritId) { //printf("** %s::addGroupedInheritedMembers(%p) inheritId=%s\n",name().data(),m_impl->memberGroupSDict,inheritId.data()); if (m_impl->memberGroupSDict) @@ -4007,7 +4027,7 @@ void ClassDef::addGroupedInheritedMembers(OutputList &ol,MemberList::ListType lt //printf(" candidate %s\n",mg->header().data()); if (!mg->allMembersInSameSection() || !m_impl->subGrouping) // group is in its own section { - mg->addGroupedInheritedMembers(ol,this,lt,inheritId); + mg->addGroupedInheritedMembers(ol,this,lt,inheritedFrom,inheritId); } } } @@ -4028,14 +4048,15 @@ void ClassDef::writeSimpleMemberDocumentation(OutputList &ol,MemberList::ListTyp } void ClassDef::writePlainMemberDeclaration(OutputList &ol, - MemberList::ListType lt,bool inGroup,const char *inheritId) + MemberList::ListType lt,bool inGroup, + ClassDef *inheritedFrom,const char *inheritId) { //printf("%s: ClassDef::writePlainMemberDeclaration()\n",name().data()); MemberList * ml = getMemberList(lt); if (ml) { ml->setInGroup(inGroup); - ml->writePlainDeclarations(ol,this,0,0,0,inheritId); + ml->writePlainDeclarations(ol,this,0,0,0,inheritedFrom,inheritId); } } diff --git a/src/classdef.h b/src/classdef.h index f73b08c..246404c 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -331,7 +331,8 @@ class ClassDef : public Definition void writeDocumentationForInnerClasses(OutputList &ol); void writeMemberPages(OutputList &ol); void writeMemberList(OutputList &ol); - void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup,const char *inheritId); + void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup, + ClassDef *inheritedFrom,const char *inheritId); void writeQuickMemberLinks(OutputList &ol,MemberDef *md) const; void writeSummaryLinks(OutputList &ol); void reclassifyMember(MemberDef *md,MemberDef::MemberType t); @@ -340,7 +341,7 @@ class ClassDef : public Definition const char *header,bool localNames); void removeMemberFromLists(MemberDef *md); void addGroupedInheritedMembers(OutputList &ol,MemberList::ListType lt, - const QCString &inheritId); + ClassDef *inheritedFrom,const QCString &inheritId); bool visited; @@ -362,7 +363,7 @@ class ClassDef : public Definition const char *subTitle=0,bool showInline=FALSE,ClassDef *inheritedFrom=0,int lt2=-1,QPtrDict *visitedClasses=0); void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title,bool showInline=FALSE); void writeSimpleMemberDocumentation(OutputList &ol,MemberList::ListType lt); - void writePlainMemberDeclaration(OutputList &ol,MemberList::ListType lt,bool inGroup,const char *inheritId); + void writePlainMemberDeclaration(OutputList &ol,MemberList::ListType lt,bool inGroup,ClassDef *inheritedFrom,const char *inheritId); void writeBriefDescription(OutputList &ol,bool exampleFlag); void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag, const QCString &title,const QCString &anchor=QCString()); @@ -381,11 +382,11 @@ class ClassDef : public Definition void writeMoreLink(OutputList &ol,const QCString &anchor); void writeDetailedDocumentationBody(OutputList &ol); - int countInheritedDecMembersRec(MemberList::ListType lt); + int countInheritedDecMembersRec(MemberList::ListType lt,ClassDef *inheritedFrom); int countInheritedDecMembers(MemberList::ListType lt); int countAdditionalInheritedMembers(); void writeAdditionalInheritedMembers(OutputList &ol); - int countMembersIncludingGrouped(MemberList::ListType lt); + int countMembersIncludingGrouped(MemberList::ListType lt,ClassDef *inheritedFrom); ClassDefImpl *m_impl; diff --git a/src/code.l b/src/code.l index 33c50c5..f91d15f 100644 --- a/src/code.l +++ b/src/code.l @@ -516,7 +516,7 @@ static void startCodeLine() g_code->writeLineNumber(0,0,0,g_yyLineNr); } } - g_code->startCodeLine(); + g_code->startCodeLine(g_sourceFileDef && g_lineNumbers); if (g_currentFontClass) { g_code->startFontClass(g_currentFontClass); diff --git a/src/commentscan.l b/src/commentscan.l index 56c0d08..c7e36a5 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1101,6 +1101,15 @@ RCSTAG "$"{ID}":"[^\n$]+"$" } addOutput(yytext); } +^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{B}*/\n { // horizontal line (dashed) + addOutput(yytext); + } +"---" { // mdash + addOutput("—"); + } +"--" { // ndash + addOutput("–"); + } ("."+)[a-z_A-Z0-9\)] { // . at start or in the middle of a word, or ellipsis addOutput(yytext); } diff --git a/src/config.xml b/src/config.xml index e42a3ae..06c08f8 100644 --- a/src/config.xml +++ b/src/config.xml @@ -895,6 +895,16 @@ page has loaded. For this to work a browser that supports JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). ' defval='0' depends='GENERATE_HTML'/> +
"; - index++; - generateIndent(t,n,0); + bool nodeOpened = level+1isDir) { if (n->def && n->def->definitionType()==Definition::TypeGroup) { - //t << FTV_IMGATTRIBS(mo); + // no icon + } + else if (n->def && n->def->definitionType()==Definition::TypePage) + { + // no icon } else if (n->def && n->def->definitionType()==Definition::TypeNamespace) { @@ -892,14 +923,17 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in { t << ""; } generateLink(t,n); - //t << "

\n"; - //t << spaces << "
\n"; t << "
"; if (n->def) { @@ -907,10 +941,9 @@ void FTVHelp::generateTree(FTextStream &t, const QList &nl,int level,in } t << "
\n"; - int index=0; - generateTree(t,m_indentNodes[0],0,index); - + generateTree(t,m_indentNodes[0],0,preferredDepth,index); t << "
\n"; -// t << " \n"; - t << "\n"; + + t << "\n"; } // write old style index.html and tree.html diff --git a/src/ftvhelp.h b/src/ftvhelp.h index e72c9e0..1169238 100644 --- a/src/ftvhelp.h +++ b/src/ftvhelp.h @@ -62,11 +62,11 @@ class FTVHelp : public IndexIntf static void generateTreeViewImages(); void generateTreeViewScripts(); private: - void generateTree(FTextStream &t,const QList &nl,int level,int &index); + void generateTree(FTextStream &t,const QList &nl,int level,int maxLevel,int &index); //bool generateJSTree(FTextStream &tidx,FTextStream &t,const QList &nl,int level,bool &first); //bool generateJSTreeTopLevel(FTextStream &tidx,FTextStream &t,const QList &nl,int level,bool &first); QCString generateIndentLabel(FTVNode *n,int level); - void generateIndent(FTextStream &t,FTVNode *n,int level); + void generateIndent(FTextStream &t,FTVNode *n,int level,bool opened); void generateLink(FTextStream &t,FTVNode *n); //void generateJSLink(FTextStream &t,FTVNode *n); QList *m_indentNodes; diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index c242aa9..c3bdd9f 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -352,9 +352,9 @@ void HtmlDocVisitor::visit(DocVerbatim *s) break; case DocVerbatim::Verbatim: forceEndParagraph(s); - m_t << PREFRAG_START; + m_t << /*PREFRAG_START <<*/ "
";
       filter(s->text());
-      m_t << PREFRAG_END;
+      m_t << "
" /*<< PREFRAG_END*/; forceStartParagraph(s); break; case DocVerbatim::HtmlOnly: @@ -477,9 +477,9 @@ void HtmlDocVisitor::visit(DocInclude *inc) break; case DocInclude::VerbInclude: forceEndParagraph(inc); - m_t << PREFRAG_START; + m_t << /*PREFRAG_START <<*/ "
";
       filter(inc->text());
-      m_t << PREFRAG_END;
+      m_t << "
" /*<< PREFRAG_END*/; forceStartParagraph(inc); break; case DocInclude::Snippet: diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index fcf821c0..63bff45 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -2234,13 +2234,15 @@ void HtmlGenerator::startDotGraph() void HtmlGenerator::endDotGraph(const DotClassGraph &g) { + bool generateLegend = Config_getBool("GENERATE_LEGEND"); + bool umlLook = Config_getBool("UML_LOOK"); endSectionHeader(t); startSectionSummary(t,m_sectionCount); endSectionSummary(t); startSectionContent(t,m_sectionCount); g.writeGraph(t,BITMAP,dir,fileName,relPath,TRUE,TRUE,m_sectionCount); - if (Config_getBool("GENERATE_LEGEND")) + if (generateLegend && !umlLook) { t << "
["; startHtmlLink(relPath+"graph_legend"+Doxygen::htmlFileExtension); @@ -2384,28 +2386,6 @@ void HtmlGenerator::writeNonBreakableSpace(int n) } } -void HtmlGenerator::writeLineNumber(const char *ref,const char *filename, - const char *anchor,int l) -{ - QCString lineNumber,lineAnchor; - lineNumber.sprintf("%05d",l); - lineAnchor.sprintf("l%05d",l); - - if (filename) - { - startCodeAnchor(lineAnchor); - writeCodeLink(ref,filename,anchor,lineNumber,0); - endCodeAnchor(); - } - else - { - startCodeAnchor(lineAnchor); - codify(lineNumber); - endCodeAnchor(); - } - codify(" "); -} - void HtmlGenerator::startSimpleSect(SectionTypes, const char *filename,const char *anchor, const char *title) @@ -3072,4 +3052,50 @@ void HtmlGenerator::writeInheritedSectionTitle(const char *id, << "" << endl; } +void HtmlGenerator::startCodeLine(bool hasLineNumbers) +{ + if (!hasLineNumbers) t << "
"; + col=0; +} + +void HtmlGenerator::endCodeLine() +{ + //codify("\n"); + t << "
\n"; +} + +void HtmlGenerator::startCodeAnchor(const char *label) +{ + t << "
"; + t << ""; +} + +void HtmlGenerator::endCodeAnchor() +{ + t << ""; +} + +void HtmlGenerator::writeLineNumber(const char *ref,const char *filename, + const char *anchor,int l) +{ + QCString lineNumber,lineAnchor; + lineNumber.sprintf("%5d",l); + lineAnchor.sprintf("l%05d",l); + + if (filename) + { + startCodeAnchor(lineAnchor); + writeCodeLink(ref,filename,anchor,lineNumber,0); + endCodeAnchor(); + } + else + { + startCodeAnchor(lineAnchor); + codify(lineNumber); + endCodeAnchor(); + } + t << " "; +} + + diff --git a/src/htmlgen.h b/src/htmlgen.h index 8667c9c..58c534c 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -21,8 +21,10 @@ #include "qtbc.h" #include "outputgen.h" -#define PREFRAG_START "
"
-#define PREFRAG_END   "
" +//#define PREFRAG_START "
"
+//#define PREFRAG_END   "
" +#define PREFRAG_START "
" +#define PREFRAG_END "
" class QFile; class FTextStream; @@ -144,8 +146,8 @@ class HtmlGenerator : public OutputGenerator void startCodeFragment() { t << PREFRAG_START; } void endCodeFragment() { t << PREFRAG_END; } void writeLineNumber(const char *,const char *,const char *,int); - void startCodeLine() { col=0; } - void endCodeLine() { codify("\n"); } + void startCodeLine(bool); + void endCodeLine(); void startEmphasis() { t << ""; } void endEmphasis() { t << ""; } void startBold() { t << ""; } @@ -164,8 +166,8 @@ class HtmlGenerator : public OutputGenerator const char *anchor,const char *name, const char *args); void endDoxyAnchor(const char *fName,const char *anchor); - void startCodeAnchor(const char *label) { t << ""; } - void endCodeAnchor() { } + void startCodeAnchor(const char *label); + void endCodeAnchor(); void writeLatexSpacing() {} void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); diff --git a/src/index.cpp b/src/index.cpp index 2dd1768..69baca9 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -278,7 +278,10 @@ void endFileWithNavPath(Definition *d,OutputList &ol) QCString navPath; if (generateTreeView) { + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); ol.writeString("
\n"); + ol.popGeneratorState(); navPath = d->navigationPathAsString(); } endFile(ol,generateTreeView,TRUE,navPath); @@ -300,6 +303,7 @@ template void addMembersToIndex(T *def,LayoutDocManager::LayoutPart par if (cd->isLinkable()) numClasses++; } } + //printf("addMembersToIndex(def=%s hasMembers=%d numClasses=%d)\n",def->name().data(),hasMembers,numClasses); if (hasMembers || numClasses>0) { Doxygen::indexList.incContentsDepth(); @@ -319,8 +323,16 @@ template void addMembersToIndex(T *def,LayoutDocManager::LayoutPart par { if (md->name().find('@')==-1) { - Doxygen::indexList.addContentsItem(FALSE, + if (md->getOuterScope()==def) + { + Doxygen::indexList.addContentsItem(FALSE, md->name(),md->getReference(),md->getOutputFileBase(),md->anchor(),FALSE,addToIndex); + } + else // inherited member + { + Doxygen::indexList.addContentsItem(FALSE, + md->name(),def->getReference(),def->getOutputFileBase(),md->anchor(),FALSE,addToIndex); + } } } } @@ -498,6 +510,23 @@ static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int } //---------------------------------------------------------------------------- + +static bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile) +{ + static bool allExternals = Config_getBool("ALLEXTERNALS"); + //static bool fullPathNames = Config_getBool("FULL_PATH_NAMES"); + //DirDef *dd = fd->getDirDef(); + bool isDocFile = fd->isDocumentationFile(); + genSourceFile = !isDocFile && fd->generateSourceFile(); + return ( //(!fullPathNames || dd==0) && + ((allExternals && fd->isLinkable()) || + fd->isLinkableInProject() + ) && + !isDocFile + ); +} + +//---------------------------------------------------------------------------- static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv,bool addToIndex) { if (level>20) @@ -558,7 +587,8 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv FileDef *fd=fileList->first(); while (fd) { - if (fd->isLinkable()) + static bool allExternals = Config_getBool("ALLEXTERNALS"); + if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject()) { fileCount++; } @@ -570,17 +600,25 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv fd=fileList->first(); while (fd) { - if (fd->isLinkable()) + bool doc,src; + doc = fileVisibleInIndex(fd,src); + if (doc || src) { ol.startIndexListItem(); - ol.startIndexItem(fd->getReference(),fd->getOutputFileBase()); + ol.startIndexItem(doc ? fd->getReference() : 0, + doc ? fd->getOutputFileBase() : 0); ol.parseText(fd->displayName()); - ol.endIndexItem(fd->getReference(),fd->getOutputFileBase()); + ol.endIndexItem(doc ? fd->getReference() : 0, + doc ? fd->getOutputFileBase() : 0); ol.endIndexListItem(); if (ftv) - ftv->addContentsItem(FALSE,fd->displayName(), - fd->getReference(),fd->getOutputFileBase(),0, + { + ftv->addContentsItem(FALSE, + fd->displayName(), + doc ? fd->getReference() : 0, + doc ? fd->getOutputFileBase() : 0,0, FALSE,FALSE,fd); + } } fd=fileList->next(); } @@ -596,7 +634,8 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv FileDef *fd=fileList->first(); while (fd) { - if (fd->isLinkable()) + static bool allExternals = Config_getBool("ALLEXTERNALS"); + if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject()) { //Doxygen::indexList.addContentsItem(FALSE, convertToHtml(fd->name(),TRUE),fd->getReference(), fd->getOutputFileBase(), 0); addMembersToIndex(fd,LayoutDocManager::File,fd->displayName(),QCString()); @@ -624,14 +663,18 @@ static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex) ol.pushGeneratorState(); ol.disable(OutputGenerator::Html); } + static bool fullPathNames = Config_getBool("FULL_PATH_NAMES"); startIndexHierarchy(ol,0); - SDict::Iterator dli(*Doxygen::directories); - DirDef *dd; - for (dli.toFirst();(dd=dli.current());++dli) + if (fullPathNames) { - if (dd->getOuterScope()==Doxygen::globalScope) + SDict::Iterator dli(*Doxygen::directories); + DirDef *dd; + for (dli.toFirst();(dd=dli.current());++dli) { - writeDirTreeNode(ol,dd,0,ftv,addToIndex); + if (dd->getOuterScope()==Doxygen::globalScope) + { + writeDirTreeNode(ol,dd,0,ftv,addToIndex); + } } } if (ftv) @@ -644,11 +687,15 @@ static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex) FileDef *fd; for (;(fd=fni.current());++fni) { - DirDef *dd = fd->getDirDef(); - if (dd==0 && fd->isLinkableInProject() && !fd->isDocumentationFile()) + bool doc,src; + doc = fileVisibleInIndex(fd,src); + static bool fullPathNames = Config_getBool("FULL_PATH_NAMES"); + if ((!fullPathNames || fd->getDirDef()==0) && (doc || src)) { ftv->addContentsItem(FALSE,fd->displayName(), - fd->getReference(),fd->getOutputFileBase(),0, + doc ? fd->getReference() : 0, + doc ? fd->getOutputFileBase() : 0, + 0, FALSE,FALSE,fd); if (addToIndex) { @@ -725,14 +772,12 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT } if (addToIndex) { - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE); + if (cd->getLanguage()!=SrcLangExt_VHDL) // prevents double insertion in Design Unit List + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE); } if (ftv) { - if (cd->getLanguage()!=SrcLangExt_VHDL) // prevents double insertion in Design Unit List - { - ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd); - } + ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE,cd); } } else @@ -943,19 +988,15 @@ static void countFiles(int &htmlFiles,int &files) FileDef *fd; for (;(fd=fni.current());++fni) { - bool doc = fd->isLinkableInProject(); - bool src = fd->generateSourceFile(); - bool nameOk = !fd->isDocumentationFile(); - if (nameOk) + bool doc,src; + doc = fileVisibleInIndex(fd,src); + if (doc || src) { - if (doc || src) - { - htmlFiles++; - } - if (doc) - { - files++; - } + htmlFiles++; + } + if (doc) + { + files++; } } } @@ -1417,11 +1458,7 @@ static void writeNamespaceIndex(OutputList &ol) Doxygen::indexList.incContentsDepth(); } FTVHelp* ftv = new FTVHelp(FALSE); - static bool optimizeOutputVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - if (!optimizeOutputVhdl) // prevents double insertions (Packages/Design Unit List) - { - writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,FALSE,addToIndex); - } + writeNamespaceTree(Doxygen::namespaceSDict,ftv,TRUE,FALSE,addToIndex); QGString outStr; FTextStream t(&outStr); ftv->generateTreeViewInline(t); @@ -3105,11 +3142,50 @@ static void countRelatedPages(int &docPages,int &indexPages) //---------------------------------------------------------------------------- -static void writeSubPages(PageDef *pd) +static void writePages(PageDef *pd,FTVHelp *ftv) { + //printf("writePages()=%s\n",pd->title().data()); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages); bool addToIndex = lne==0 || lne->visible(); - //printf("Write subpages(%s #=%d)\n",pd->name().data(),pd->getSubPages() ? pd->getSubPages()->count() : 0 ); + if (!addToIndex) return; + + bool hasSubPages = pd->hasSubPages(); + bool hasSections = pd->hasSections(); + + if (pd->visibleInIndex()) + { + QCString pageTitle; + + if (pd->title().isEmpty()) + pageTitle=pd->name(); + else + pageTitle=pd->title(); + + if (ftv) + { + //printf("*** adding %s\n",pageTitle.data()); + ftv->addContentsItem( + hasSubPages,pageTitle, + pd->getReference(),pd->getOutputFileBase(), + 0,hasSubPages,TRUE,pd); + } + if (addToIndex) + { + Doxygen::indexList.addContentsItem( + hasSubPages,pageTitle, + pd->getReference(),pd->getOutputFileBase(), + 0,hasSubPages,TRUE); + } + } + if (hasSubPages && ftv) ftv->incContentsDepth(); + if (hasSections || hasSubPages) + { + Doxygen::indexList.incContentsDepth(); + } + if (hasSections) + { + pd->addSectionsToIndex(); + } PageSDict *subPages = pd->getSubPages(); if (subPages) { @@ -3117,41 +3193,18 @@ static void writeSubPages(PageDef *pd) PageDef *subPage; for (pi.toFirst();(subPage=pi.current());++pi) { - QCString pageTitle; - - if (subPage->title().isEmpty()) - pageTitle=subPage->name(); - else - pageTitle=subPage->title(); - - bool hasSubPages = subPage->hasSubPages(); - bool hasSections = subPage->hasSections(); - - //printf("subpage %s: addToIndex=%d hasSubPages=%d hasSections=%d\n", - // pd->name().data(),addToIndex,hasSubPages,hasSections); - if (addToIndex) - { - Doxygen::indexList.addContentsItem(hasSubPages,pageTitle, - subPage->getReference(),subPage->getOutputFileBase(), - 0,hasSubPages,TRUE); - if (hasSections || hasSubPages) - { - Doxygen::indexList.incContentsDepth(); - } - if (hasSections) - { - subPage->addSectionsToIndex(); - } - } - writeSubPages(subPage); - if (addToIndex && (hasSections || hasSubPages)) - { - Doxygen::indexList.decContentsDepth(); - } + writePages(subPage,ftv); } } + if (hasSubPages && ftv) ftv->decContentsDepth(); + if (hasSections || hasSubPages) + { + Doxygen::indexList.decContentsDepth(); + } + //printf("end writePages()=%s\n",pd->title().data()); } + static void writePageIndex(OutputList &ol) { if (indexedPages==0) return; @@ -3165,74 +3218,32 @@ static void writePageIndex(OutputList &ol) endTitle(ol,0,0); ol.startContents(); ol.startTextBlock(); - bool addToIndex = lne==0 || lne->visible(); - if (0 /*addToIndex*/) // skip Related Pages section in navigation index - { - Doxygen::indexList.addContentsItem(TRUE,title,0,"pages",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); - } ol.parseText(lne ? lne->intro() : theTranslator->trRelatedPagesDescription()); ol.endTextBlock(); - startIndexHierarchy(ol,0); - PageSDict::Iterator pdi(*Doxygen::pageSDict); - PageDef *pd=0; - for (pdi.toFirst();(pd=pdi.current());++pdi) + { - if (pd->visibleInIndex()) + FTVHelp* ftv = new FTVHelp(FALSE); + PageSDict::Iterator pdi(*Doxygen::pageSDict); + PageDef *pd=0; + for (pdi.toFirst();(pd=pdi.current());++pdi) { - QCString pageTitle; - - if (pd->title().isEmpty()) - pageTitle=pd->name(); - else - pageTitle=pd->title(); - - bool hasSubPages = pd->hasSubPages(); - bool hasSections = pd->hasSections(); - - ol.startIndexListItem(); - ol.startIndexItem(pd->getReference(),pd->getOutputFileBase()); - ol.parseText(pageTitle); - ol.endIndexItem(pd->getReference(),pd->getOutputFileBase()); - if (pd->isReference()) - { - ol.startTypewriter(); - ol.docify(" [external]"); - ol.endTypewriter(); - } - ol.writeString("\n"); - if (addToIndex) - { - Doxygen::indexList.addContentsItem( - hasSubPages || hasSections, // isDir - filterTitle(pageTitle), // name - pd->getReference(), // ref - pd->getOutputFileBase(), // file - 0, // anchor - hasSubPages || hasSections, // separateIndex - TRUE); // addToNavIndex - if (hasSections || hasSubPages) - { - Doxygen::indexList.incContentsDepth(); - } - if (hasSections) - { - pd->addSectionsToIndex(); - } - } - writeSubPages(pd); - if (addToIndex && (hasSections || hasSubPages)) + if (pd->getOuterScope()==0 || + pd->getOuterScope()->definitionType()!=Definition::TypePage + ) // not a sub page { - Doxygen::indexList.decContentsDepth(); + writePages(pd,ftv); } - ol.endIndexListItem(); } + QGString outStr; + FTextStream t(&outStr); + ftv->generateTreeViewInline(t); + ol.writeString(outStr); + delete ftv; } - endIndexHierarchy(ol,0); - if (0 /*addToIndex*/) // skip Related Pages section in navigation index - { - Doxygen::indexList.decContentsDepth(); - } + +// ol.popGeneratorState(); + // ------ + endFile(ol); ol.popGeneratorState(); } @@ -3490,7 +3501,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* { pd->addSectionsToIndex(); } - writeSubPages(pd); + writePages(pd,0); if (hasSections || hasSubPages) { Doxygen::indexList.decContentsDepth(); @@ -3803,7 +3814,7 @@ static void writeIndex(OutputList &ol) } if (Doxygen::mainPage->hasSubPages()) { - writeSubPages(Doxygen::mainPage); + writePages(Doxygen::mainPage,0); } } diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 13a2182..d86b5fc 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -244,7 +244,7 @@ void LatexDocVisitor::visit(DocSymbol *s) if (m_hide) return; switch(s->symbol()) { - case DocSymbol::BSlash: m_t << "$\\backslash$"; break; + case DocSymbol::BSlash: m_t << "\\textbackslash{}"; break; case DocSymbol::At: m_t << "@"; break; case DocSymbol::Less: if (m_insidePre) m_t << "<"; else m_t << "$<$"; break; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index cdee85b..c6bafad 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1662,7 +1662,9 @@ void LatexGenerator::writeCodeLink(const char *ref,const char *f, if (f) t << stripPath(f); if (f && anchor) t << "_"; if (anchor) t << anchor; - t << "}{" << name << "}"; + t << "}{"; + codify(name); + t << "}"; } else { @@ -2516,7 +2518,7 @@ void LatexGenerator::writeLineNumber(const char *ref,const char *fileName,const } } -void LatexGenerator::startCodeLine() +void LatexGenerator::startCodeLine(bool) { col=0; } diff --git a/src/latexgen.h b/src/latexgen.h index 270fd67..254632f 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -132,7 +132,7 @@ class LatexGenerator : public OutputGenerator void startCodeFragment(); void endCodeFragment(); void writeLineNumber(const char *,const char *,const char *,int l); - void startCodeLine(); + void startCodeLine(bool hasLineNumbers); void endCodeLine(); void startEmphasis() { t << "{\\em "; } void endEmphasis() { t << "}"; } diff --git a/src/mangen.h b/src/mangen.h index cf161f5..7187e5d 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -128,7 +128,7 @@ class ManGenerator : public OutputGenerator void startCodeFragment(); void endCodeFragment(); void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; } - void startCodeLine() {} + void startCodeLine(bool) {} void endCodeLine() { codify("\n"); col=0; } void startEmphasis() { t << "\\fI"; firstCol=FALSE; } void endEmphasis() { t << "\\fP"; firstCol=FALSE; } diff --git a/src/markdown.cpp b/src/markdown.cpp index 6faeddf..bb1a5a3 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -976,22 +976,22 @@ static void processInline(GrowBuf &out,const char *data,int size) /** returns whether the line is a setext-style hdr underline */ static int isHeaderline(const char *data, int size) { - int i = 0; + int i=0, c=0; while (i=size || data[i]=='\n') ? 1 : 0; + return (c>1 && (i>=size || data[i]=='\n')) ? 1 : 0; } // test of level 2 header if (data[i]=='-') { - while (i=size || data[i]=='\n') ? 2 : 0; + return (c>1 && (i>=size || data[i]=='\n')) ? 2 : 0; } return 0; } @@ -1713,6 +1713,7 @@ static int writeCodeBlock(GrowBuf &out,const char *data,int size,int refIndent) int i=0,end; //printf("writeCodeBlock: data={%s}\n",QCString(data).left(size).data()); out.addStr("@verbatim\n"); + int emptyLines=0; while (i=refIndent+codeBlockIndent) // enough indent to contine the code block { + while (emptyLines>0) // write skipped empty lines + { + // add empty line + out.addStr("\n"); + emptyLines--; + } // add code line minus the indent out.addStr(data+i+refIndent+codeBlockIndent,end-i-refIndent-codeBlockIndent); i=end; @@ -1740,6 +1746,12 @@ static int writeCodeBlock(GrowBuf &out,const char *data,int size,int refIndent) } } out.addStr("@endverbatim\n"); + while (emptyLines>0) // write skipped empty lines + { + // add empty line + out.addStr("\n"); + emptyLines--; + } //printf("i=%d\n",i); return i; } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 052ae95..539b621 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -210,7 +210,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, if (hasFuncPtrType) n=a->type.left(wp); if (md->isObjCMethod()) { n.prepend("("); n.append(")"); } if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); - linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n); + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,n); } else // non-function pointer type { @@ -219,7 +219,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, if (a->type!="...") { if (!cName.isEmpty()) n=addTemplateNames(n,cd->name(),cName); - linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n); + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,n); } } if (!isDefine) @@ -261,7 +261,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, // that comes after the name { linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(), - md->name(),a->type.right(a->type.length()-vp)); + md,a->type.right(a->type.length()-vp)); } if (!a->defval.isEmpty()) // write the default value { @@ -270,7 +270,7 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, ol.docify(" = "); ol.startTypewriter(); - linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md->name(),n,FALSE,TRUE,TRUE); + linkifyText(TextGeneratorOLImpl(ol),cd,md->getBodyDef(),md,n,FALSE,TRUE,TRUE); ol.endTypewriter(); } @@ -740,6 +740,28 @@ LockingPtr MemberDef::reimplementedBy() const return LockingPtr(this,m_impl->redefinedBy); } +bool MemberDef::isReimplementedBy(ClassDef *cd) const +{ + makeResident(); + if (cd && m_impl->redefinedBy) + { + MemberListIterator mi(*m_impl->redefinedBy); + MemberDef *md; + for (mi.toFirst();(md=mi.current());++mi) + { + ClassDef *mcd = md->getClassDef(); + if (mcd) + { + if (cd==mcd || cd->isBaseClass(mcd,TRUE)) + { + return TRUE; + } + } + } + } + return FALSE; +} + void MemberDef::insertEnumField(MemberDef *md) { makeResident(); @@ -1229,7 +1251,7 @@ bool MemberDef::isBriefSectionVisible() const void MemberDef::writeDeclaration(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool inGroup,const char *inheritId + bool inGroup,ClassDef *inheritedFrom,const char *inheritId ) { //printf("%s MemberDef::writeDeclaration() inGroup=%d\n",name().data(),inGroup); @@ -1379,7 +1401,7 @@ void MemberDef::writeDeclaration(OutputList &ol, int ir=i+l; //printf("<<<<<<<<<<<<<<\n"); ol.startAnonTypeScope(s_indentLevel++); - annoClassDef->writeDeclaration(ol,m_impl->annMemb,inGroup,inheritId); + annoClassDef->writeDeclaration(ol,m_impl->annMemb,inGroup,inheritedFrom,inheritId); //printf(">>>>>>>>>>>>>> startMemberItem(2)\n"); ol.startMemberItem(anchor(),2,inheritId); int j; @@ -1403,13 +1425,13 @@ void MemberDef::writeDeclaration(OutputList &ol, linkifyText(TextGeneratorOLImpl(ol), // out d, // scope getBodyDef(), // fileScope - name(), // + this, // self ltype.left(i), // text TRUE // autoBreak ); getAnonymousEnumType()->writeEnumDeclaration(ol,cd,nd,fd,gd); //ol+=*getAnonymousEnumType()->enumDecl(); - linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,name(),ltype.right(ltype.length()-i-l),TRUE); + linkifyText(TextGeneratorOLImpl(ol),d,m_impl->fileDef,this,ltype.right(ltype.length()-i-l),TRUE); } else { @@ -1417,7 +1439,7 @@ void MemberDef::writeDeclaration(OutputList &ol, linkifyText(TextGeneratorOLImpl(ol), // out d, // scope getBodyDef(), // fileScope - name(), // + this, // self ltype, // text TRUE // autoBreak ); @@ -1438,7 +1460,7 @@ void MemberDef::writeDeclaration(OutputList &ol, linkifyText(TextGeneratorOLImpl(ol), // out d, // scope getBodyDef(), // fileScope - name(), // + this, // self ltype, // text TRUE // autoBreak ); @@ -1544,7 +1566,7 @@ void MemberDef::writeDeclaration(OutputList &ol, linkifyText(TextGeneratorOLImpl(ol), // out d, // scope getBodyDef(), // fileScope - name(), // + this, // self argsString(), // text m_impl->annMemb, // autoBreak TRUE, // external @@ -1563,7 +1585,7 @@ void MemberDef::writeDeclaration(OutputList &ol, // *** write bitfields if (!m_impl->bitfields.isEmpty()) // add bitfields { - linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),m_impl->bitfields.simplifyWhiteSpace()); + linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->bitfields.simplifyWhiteSpace()); } else if (hasOneLineInitializer() //!init.isEmpty() && initLines==0 && // one line initializer @@ -1573,12 +1595,12 @@ void MemberDef::writeDeclaration(OutputList &ol, if (!isDefine()) { ol.writeString(" = "); - linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),m_impl->initializer.simplifyWhiteSpace()); + linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->initializer.simplifyWhiteSpace()); } else { ol.writeNonBreakableSpace(3); - linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),name(),m_impl->initializer); + linkifyText(TextGeneratorOLImpl(ol),d,getBodyDef(),this,m_impl->initializer); } } @@ -1847,205 +1869,494 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const } } -/*! Writes the "detailed documentation" section of this member to - * all active output formats. - */ -void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, - const char *scName, - Definition *container, - bool inGroup, - bool showEnumValues, - bool showInline - ) +void MemberDef::_writeCallGraph(OutputList &ol) { - // if this member is in a group find the real scope name. - bool hasParameterList = FALSE; - bool inFile = container->definitionType()==Definition::TypeFile; - bool hasDocs = isDetailedSectionVisible(inGroup,inFile); - - //printf("MemberDef::writeDocumentation(): name=`%s' hasDocs=`%d' containerType=%d inGroup=%d\n", - // name().data(),hasDocs,container->definitionType(),inGroup); - - if ( !hasDocs ) return; - if (isEnumValue() && !showEnumValues) return; - - KEEP_RESIDENT_DURING_CALL; - - SrcLangExt lang = getLanguage(); - //printf("member=%s lang=%d\n",name().data(),lang); - bool optVhdl = lang==SrcLangExt_VHDL; - QCString sep = getLanguageSpecificSeparator(lang,TRUE); - - QCString scopeName = scName; - QCString memAnchor = anchor(); - QCString ciname = container->name(); - if (container->definitionType()==TypeGroup) - { - if (getClassDef()) scopeName=getClassDef()->displayName(); - else if (getNamespaceDef()) scopeName=getNamespaceDef()->displayName(); - else if (getFileDef()) scopeName=getFileDef()->displayName(); - ciname = ((GroupDef *)container)->groupTitle(); - } - else if (container->definitionType()==TypeFile && getNamespaceDef()) - { // member is in a namespace, but is written as part of the file documentation - // as well, so we need to make sure its label is unique. - memAnchor.prepend("file_"); - } - - QCString cname = container->name(); - QCString cfname = getOutputFileBase(); - QCString cfiname = container->getOutputFileBase(); - - // get member name - QCString doxyName=name(); - // prepend scope if there is any. TODO: make this optional for C only docs - if (!scopeName.isEmpty()) - { - doxyName.prepend(scopeName+sep); - } - QCString doxyArgs=argsString(); - - QCString ldef = definition(); - QCString title = name(); - //printf("member `%s' def=`%s'\n",name().data(),ldef.data()); - if (isEnumerate()) + // write call graph + if ((m_impl->hasCallGraph || Config_getBool("CALL_GRAPH")) + && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") + ) { - if (title.at(0)=='@') + DotCallGraph callGraph(this,FALSE); + if (callGraph.isTooBig()) { - ldef = title = "anonymous enum"; + err("warning: Call graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",qPrint(qualifiedName())); } - else + else if (!callGraph.isTrivial()) { - ldef.prepend("enum "); + msg("Generating call graph for function %s\n",qPrint(qualifiedName())); + ol.disable(OutputGenerator::Man); + ol.startParagraph(); + ol.startCallGraph(); + ol.parseText(theTranslator->trCallGraph()); + ol.endCallGraph(callGraph); + ol.endParagraph(); + ol.enableAll(); } } - else if (isEnumValue()) +} + +void MemberDef::_writeCallerGraph(OutputList &ol) +{ + if ((m_impl->hasCallerGraph || Config_getBool("CALLER_GRAPH")) + && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") + ) { - if (ldef.at(0)=='@') + DotCallGraph callerGraph(this, TRUE); + if (callerGraph.isTooBig()) { - ldef=ldef.mid(2); + err("warning: Caller graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",qPrint(qualifiedName())); + } + else if (!callerGraph.isTrivial() && !callerGraph.isTooBig()) + { + msg("Generating caller graph for function %s\n",qPrint(qualifiedName())); + ol.disable(OutputGenerator::Man); + ol.startParagraph(); + ol.startCallGraph(); + ol.parseText(theTranslator->trCallerGraph()); + ol.endCallGraph(callerGraph); + ol.endParagraph(); + ol.enableAll(); } } - int i=0,l; - static QRegExp r("@[0-9]+"); - - //---------------------------------------- - - ol.pushGeneratorState(); - - QStrList sl; - _getLabels(sl,container); - bool htmlEndLabelTable=FALSE; +} - if ((isVariable() || isTypedef()) && (i=r.match(ldef,0,&l))!=-1) +void MemberDef::_writeReimplements(OutputList &ol) +{ + MemberDef *bmd=reimplements(); + ClassDef *bcd=0; + if (bmd && (bcd=bmd->getClassDef())) { - // find enum type and insert it in the definition - QListIterator vmli(*ml); - MemberDef *vmd; - bool found=FALSE; - for ( ; (vmd=vmli.current()) && !found ; ++vmli) + // write class that contains a member that is reimplemented by this one + if (bcd->isLinkable()) { - if (vmd->isEnumerate() && ldef.mid(i,l)==vmd->name()) + ol.startParagraph(); + QCString reimplFromLine; + if (bmd->virtualness()!=Pure && bcd->compoundType()!=ClassDef::Interface) { - ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); - ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef.left(i)); - vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef()); - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef.right(ldef.length()-i-l)); - - found=TRUE; + reimplFromLine = theTranslator->trReimplementedFromList(1); } - } - if (!found) // anonymous compound - { - //printf("Anonymous compound `%s'\n",cname.data()); - ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); - ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); - // search for the last anonymous compound name in the definition - int si=ldef.find(' '),pi,ei=i+l; - if (si==-1) si=0; - while ((pi=r.match(ldef,i+l,&l))!=-1) + else { - i=pi; - ei=i+l; + reimplFromLine = theTranslator->trImplementedFromList(1); } - // first si characters of ldef contain compound type name - ol.startMemberDocName(isObjCMethod()); - ol.docify(ldef.left(si)); - ol.docify(" { ... } "); - // last ei characters of ldef contain pointer/reference specifiers - int ni=ldef.find("::",si); - if (ni>=ei) ei=ni+2; - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef.right(ldef.length()-ei)); - } - } - else // not an enum value - { - ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); - ol.startMemberDoc(ciname,name(),memAnchor,title,showInline); - - ClassDef *cd=getClassDef(); - if (!Config_getBool("HIDE_SCOPE_NAMES")) - { - bool first=TRUE; - if (m_impl->defTmpArgLists) - // definition has explicit template parameter declarations + int markerPos = reimplFromLine.find("@0"); + if (markerPos!=-1) // should always pass this. { - QListIterator ali(*m_impl->defTmpArgLists); - ArgumentList *tal; - for (ali.toFirst();(tal=ali.current());++ali) + ol.parseText(reimplFromLine.left(markerPos)); //text left from marker + if (bmd->isLinkable()) // replace marker with link { - if (tal->count()>0) + //Definition *bd=bmd->group; + //if (bd==0) bd=bcd; + ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(), + bmd->anchor(),bcd->displayName()); + + //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), + // bmd->anchor(),bcd->name()); + if ( bmd->isLinkableInProject() ) { - if (!first) ol.docify(" "); - ol.startMemberDocPrefixItem(); - writeTemplatePrefix(ol,tal); - ol.endMemberDocPrefixItem(); + writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor()); } } - } - else // definition gets it template parameters from its class - // (since no definition was found) - { - if (cd && !isTemplateSpecialization()) + else { - QList tempParamLists; - cd->getTemplateParameterLists(tempParamLists); - //printf("#tempParamLists=%d\n",tempParamLists.count()); - QListIterator ali(tempParamLists); - ArgumentList *tal; - for (ali.toFirst();(tal=ali.current());++ali) + ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), + 0,bcd->displayName()); + if (bcd->isLinkableInProject()/* && !Config_getBool("PDF_HYPERLINKS")*/ ) { - if (tal->count()>0) - { - if (!first) ol.docify(" "); - ol.startMemberDocPrefixItem(); - writeTemplatePrefix(ol,tal); - ol.endMemberDocPrefixItem(); - } + writePageRef(ol,bcd->getOutputFileBase(),bcd->anchor()); } } - if (m_impl->tArgList) // function template prefix - { - ol.startMemberDocPrefixItem(); - writeTemplatePrefix(ol,m_impl->tArgList); - ol.endMemberDocPrefixItem(); - } + ol.parseText(reimplFromLine.right( + reimplFromLine.length()-markerPos-2)); // text right from marker + + } + else + { + err("error: translation error: no marker in trReimplementsFromList()\n"); } + ol.endParagraph(); } + } +} - if (sl.count()>0) +void MemberDef::_writeReimplementedBy(OutputList &ol) +{ + LockingPtr bml=reimplementedBy(); + if (bml!=0) + { + MemberListIterator mli(*bml); + MemberDef *bmd=0; + uint count=0; + ClassDef *bcd=0; + for (mli.toFirst();(bmd=mli.current()) && (bcd=bmd->getClassDef());++mli) { - ol.pushGeneratorState(); - ol.disableAll(); - ol.enable(OutputGenerator::Html); - ol.writeString("\n"); - ol.writeString(" \n"); - ol.writeString("
\n"); - ol.popGeneratorState(); - htmlEndLabelTable=TRUE; - } - + // count the members that directly inherit from md and for + // which the member and class are visible in the docs. + if ( bmd->isLinkable() && bcd->isLinkable() ) + { + count++; + } + } + if (count>0) + { + mli.toFirst(); + // write the list of classes that overwrite this member + ol.startParagraph(); + + QCString reimplInLine; + if (m_impl->virt==Pure || (m_impl->classDef && m_impl->classDef->compoundType()==ClassDef::Interface)) + { + reimplInLine = theTranslator->trImplementedInList(count); + } + else + { + reimplInLine = theTranslator->trReimplementedInList(count); + } + static QRegExp marker("@[0-9]+"); + int index=0,newIndex,matchLen; + // now replace all markers in reimplInLine with links to the classes + while ((newIndex=marker.match(reimplInLine,index,&matchLen))!=-1) + { + ol.parseText(reimplInLine.mid(index,newIndex-index)); + bool ok; + uint entryIndex = reimplInLine.mid(newIndex+1,matchLen-1).toUInt(&ok); + //bmd=bml->at(entryIndex); + + count=0; + // find the entryIndex-th documented entry in the inheritance list. + for (mli.toLast();(bmd=mli.current()) && (bcd=bmd->getClassDef());--mli) + { + if ( bmd->isLinkable() && bcd->isLinkable()) + { + if (count==entryIndex) break; + count++; + } + } + + if (ok && bcd && bmd) // write link for marker + { + //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), + // bmd->anchor(),bcd->name()); + ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(), + bmd->anchor(),bcd->displayName()); + + if (bmd->isLinkableInProject() ) + { + writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor()); + } + } + ++mli; + index=newIndex+matchLen; + } + ol.parseText(reimplInLine.right(reimplInLine.length()-index)); + ol.endParagraph(); + } + } +} + +void MemberDef::_writeExamples(OutputList &ol) +{ + // write the list of examples that use this member + if (hasExamples()) + { + ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": "); + ol.startDescForItem(); + writeExample(ol,m_impl->exampleSDict); + ol.endDescForItem(); + ol.endSimpleSect(); + } +} + +void MemberDef::_writeTypeConstraints(OutputList &ol) +{ + if (m_impl->typeConstraints) + { + writeTypeConstraints(ol,this,m_impl->typeConstraints); + } +} + +void MemberDef::_writeEnumValues(OutputList &ol,Definition *container, + const QCString &cfname,const QCString &ciname, + const QCString &cname) +{ + // For enum, we also write the documented enum values + if (isEnumerate()) + { + bool first=TRUE; + LockingPtr fmdl=enumFieldList(); + //printf("** %s: enum values=%d\n",name().data(),fmdl!=0 ? fmdl->count() : 0); + if (fmdl!=0) + { + MemberDef *fmd=fmdl->first(); + while (fmd) + { + //printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable()); + if (fmd->isLinkable()) + { + if (first) + { + ol.startSimpleSect(BaseOutputDocInterface::EnumValues,0,0,theTranslator->trEnumerationValues()+": "); + ol.startDescForItem(); + ol.startDescTable(); + } + + ol.addIndexItem(fmd->name(),ciname); + ol.addIndexItem(ciname,fmd->name()); + + //Doxygen::indexList.addIndexItem( + // ciname, // level1 + // fmd->name(), // level2 + // separateMemPages ? cfname : cfiname, // contRef + // cfname, // memRef + // fmd->anchor(), // anchor + // fmd); // memberdef + Doxygen::indexList.addIndexItem(container,fmd); + + //ol.writeListItem(); + ol.startDescTableTitle(); // this enables emphasis! + ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString()); + first=FALSE; + //ol.startEmphasis(); + ol.docify(fmd->name()); + //ol.endEmphasis(); + ol.disableAllBut(OutputGenerator::Man); + ol.writeString(" "); + ol.enableAll(); + ol.endDoxyAnchor(cfname,fmd->anchor()); + ol.endDescTableTitle(); + //ol.newParagraph(); + ol.startDescTableData(); + + if (!fmd->briefDescription().isEmpty()) + { + ol.parseDoc(fmd->briefFile(),fmd->briefLine(),getOuterScope()?getOuterScope():container,fmd,fmd->briefDescription(),TRUE,FALSE); + } + // FIXME:PARA + //if (!fmd->briefDescription().isEmpty() && + // !fmd->documentation().isEmpty()) + //{ + // ol.newParagraph(); + //} + if (!fmd->documentation().isEmpty()) + { + ol.parseDoc(fmd->docFile(),fmd->docLine(),getOuterScope()?getOuterScope():container,fmd,fmd->documentation()+"\n",TRUE,FALSE); + } + ol.endDescTableData(); + } + fmd=fmdl->next(); + } + } + if (!first) + { + //ol.endItemList(); + ol.endDescTable(); + ol.endDescForItem(); + ol.endSimpleSect(); + ol.writeChar('\n'); + } + } +} + + +/*! Writes the "detailed documentation" section of this member to + * all active output formats. + */ +void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, + const char *scName, + Definition *container, + bool inGroup, + bool showEnumValues, + bool showInline + ) +{ + // if this member is in a group find the real scope name. + bool hasParameterList = FALSE; + bool inFile = container->definitionType()==Definition::TypeFile; + bool hasDocs = isDetailedSectionVisible(inGroup,inFile); + + //printf("MemberDef::writeDocumentation(): name=`%s' hasDocs=`%d' containerType=%d inGroup=%d\n", + // name().data(),hasDocs,container->definitionType(),inGroup); + + if ( !hasDocs ) return; + if (isEnumValue() && !showEnumValues) return; + + KEEP_RESIDENT_DURING_CALL; + + SrcLangExt lang = getLanguage(); + //printf("member=%s lang=%d\n",name().data(),lang); + bool optVhdl = lang==SrcLangExt_VHDL; + QCString sep = getLanguageSpecificSeparator(lang,TRUE); + + QCString scopeName = scName; + QCString memAnchor = anchor(); + QCString ciname = container->name(); + if (container->definitionType()==TypeGroup) + { + if (getClassDef()) scopeName=getClassDef()->displayName(); + else if (getNamespaceDef()) scopeName=getNamespaceDef()->displayName(); + else if (getFileDef()) scopeName=getFileDef()->displayName(); + ciname = ((GroupDef *)container)->groupTitle(); + } + else if (container->definitionType()==TypeFile && getNamespaceDef()) + { // member is in a namespace, but is written as part of the file documentation + // as well, so we need to make sure its label is unique. + memAnchor.prepend("file_"); + } + + QCString cname = container->name(); + QCString cfname = getOutputFileBase(); + QCString cfiname = container->getOutputFileBase(); + + // get member name + QCString doxyName=name(); + // prepend scope if there is any. TODO: make this optional for C only docs + if (!scopeName.isEmpty()) + { + doxyName.prepend(scopeName+sep); + } + QCString doxyArgs=argsString(); + + QCString ldef = definition(); + QCString title = name(); + //printf("member `%s' def=`%s'\n",name().data(),ldef.data()); + if (isEnumerate()) + { + if (title.at(0)=='@') + { + ldef = title = "anonymous enum"; + } + else + { + ldef.prepend("enum "); + } + } + else if (isEnumValue()) + { + if (ldef.at(0)=='@') + { + ldef=ldef.mid(2); + } + } + int i=0,l; + static QRegExp r("@[0-9]+"); + + //---------------------------------------- + + ol.pushGeneratorState(); + + bool htmlEndLabelTable=FALSE; + QStrList sl; + _getLabels(sl,container); + + if ((isVariable() || isTypedef()) && (i=r.match(ldef,0,&l))!=-1) + { + // find enum type and insert it in the definition + QListIterator vmli(*ml); + MemberDef *vmd; + bool found=FALSE; + for ( ; (vmd=vmli.current()) && !found ; ++vmli) + { + if (vmd->isEnumerate() && ldef.mid(i,l)==vmd->name()) + { + ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); + ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.left(i)); + vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef()); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-i-l)); + + found=TRUE; + } + } + if (!found) // anonymous compound + { + //printf("Anonymous compound `%s'\n",cname.data()); + ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); + ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); + // search for the last anonymous compound name in the definition + int si=ldef.find(' '),pi,ei=i+l; + if (si==-1) si=0; + while ((pi=r.match(ldef,i+l,&l))!=-1) + { + i=pi; + ei=i+l; + } + // first si characters of ldef contain compound type name + ol.startMemberDocName(isObjCMethod()); + ol.docify(ldef.left(si)); + ol.docify(" { ... } "); + // last ei characters of ldef contain pointer/reference specifiers + int ni=ldef.find("::",si); + if (ni>=ei) ei=ni+2; + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-ei)); + } + } + else // not an enum value or anonymous compound + { + ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); + ol.startMemberDoc(ciname,name(),memAnchor,title,showInline); + + ClassDef *cd=getClassDef(); + if (!Config_getBool("HIDE_SCOPE_NAMES")) + { + bool first=TRUE; + if (m_impl->defTmpArgLists) + // definition has explicit template parameter declarations + { + QListIterator ali(*m_impl->defTmpArgLists); + ArgumentList *tal; + for (ali.toFirst();(tal=ali.current());++ali) + { + if (tal->count()>0) + { + if (!first) ol.docify(" "); + ol.startMemberDocPrefixItem(); + writeTemplatePrefix(ol,tal); + ol.endMemberDocPrefixItem(); + } + } + } + else // definition gets it template parameters from its class + // (since no definition was found) + { + if (cd && !isTemplateSpecialization()) + { + QList tempParamLists; + cd->getTemplateParameterLists(tempParamLists); + //printf("#tempParamLists=%d\n",tempParamLists.count()); + QListIterator ali(tempParamLists); + ArgumentList *tal; + for (ali.toFirst();(tal=ali.current());++ali) + { + if (tal->count()>0) + { + if (!first) ol.docify(" "); + ol.startMemberDocPrefixItem(); + writeTemplatePrefix(ol,tal); + ol.endMemberDocPrefixItem(); + } + } + } + if (m_impl->tArgList) // function template prefix + { + ol.startMemberDocPrefixItem(); + writeTemplatePrefix(ol,m_impl->tArgList); + ol.endMemberDocPrefixItem(); + } + } + } + + if (sl.count()>0) + { + ol.pushGeneratorState(); + ol.disableAll(); + ol.enable(OutputGenerator::Html); + ol.writeString("\n"); + ol.writeString(" \n"); + ol.writeString("
\n"); + ol.popGeneratorState(); + htmlEndLabelTable=TRUE; + } + ol.startMemberDocName(isObjCMethod()); if (cd && cd->isObjectiveC()) { @@ -2086,7 +2397,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } else { - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),substitute(ldef,"::",sep)); + linkifyText(TextGeneratorOLImpl(ol), + container, + getBodyDef(), + this, + substitute(ldef,"::",sep) + ); hasParameterList=writeDefArgumentList(ol,cd,scopeName,this); } @@ -2095,18 +2411,18 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (!isDefine()) { ol.docify(" = "); - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),m_impl->initializer.simplifyWhiteSpace()); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,m_impl->initializer.simplifyWhiteSpace()); } else { ol.writeNonBreakableSpace(3); - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),m_impl->initializer); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,m_impl->initializer); } } if (excpString()) // add exception list { ol.docify(" "); - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),excpString()); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,excpString()); } } @@ -2165,12 +2481,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.endDoxyAnchor(cfname,memAnchor); ol.startIndent(); - // FIXME:PARA - //ol.pushGeneratorState(); - //ol.disable(OutputGenerator::RTF); - //ol.newParagraph(); - //ol.popGeneratorState(); - /* write multi-line initializer (if any) */ if (hasMultiLineInitializer() //initLines>0 && ((initLines fmdl=enumFieldList(); - //printf("** %s: enum values=%d\n",name().data(),fmdl!=0 ? fmdl->count() : 0); - if (fmdl!=0) - { - MemberDef *fmd=fmdl->first(); - while (fmd) - { - //printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable()); - if (fmd->isLinkable()) - { - if (first) - { - ol.startSimpleSect(BaseOutputDocInterface::EnumValues,0,0,theTranslator->trEnumerationValues()+": "); - ol.startDescForItem(); - ol.startDescTable(); - } - - ol.addIndexItem(fmd->name(),ciname); - ol.addIndexItem(ciname,fmd->name()); - - //Doxygen::indexList.addIndexItem( - // ciname, // level1 - // fmd->name(), // level2 - // separateMemPages ? cfname : cfiname, // contRef - // cfname, // memRef - // fmd->anchor(), // anchor - // fmd); // memberdef - Doxygen::indexList.addIndexItem(container,fmd); - - //ol.writeListItem(); - ol.startDescTableTitle(); // this enables emphasis! - ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString()); - first=FALSE; - //ol.startEmphasis(); - ol.docify(fmd->name()); - //ol.endEmphasis(); - ol.disableAllBut(OutputGenerator::Man); - ol.writeString(" "); - ol.enableAll(); - ol.endDoxyAnchor(cfname,fmd->anchor()); - ol.endDescTableTitle(); - //ol.newParagraph(); - ol.startDescTableData(); - - if (!fmd->briefDescription().isEmpty()) - { - ol.parseDoc(fmd->briefFile(),fmd->briefLine(),getOuterScope()?getOuterScope():container,fmd,fmd->briefDescription(),TRUE,FALSE); - } - // FIXME:PARA - //if (!fmd->briefDescription().isEmpty() && - // !fmd->documentation().isEmpty()) - //{ - // ol.newParagraph(); - //} - if (!fmd->documentation().isEmpty()) - { - ol.parseDoc(fmd->docFile(),fmd->docLine(),getOuterScope()?getOuterScope():container,fmd,fmd->documentation()+"\n",TRUE,FALSE); - } - ol.endDescTableData(); - } - fmd=fmdl->next(); - } - } - if (!first) - { - //ol.endItemList(); - ol.endDescTable(); - ol.endDescForItem(); - ol.endSimpleSect(); - ol.writeChar('\n'); - } - } - - MemberDef *bmd=reimplements(); - ClassDef *bcd=0; - if (bmd && (bcd=bmd->getClassDef())) - { - // write class that contains a member that is reimplemented by this one - if (bcd->isLinkable()) - { - ol.startParagraph(); - QCString reimplFromLine; - if (bmd->virtualness()!=Pure && bcd->compoundType()!=ClassDef::Interface) - { - reimplFromLine = theTranslator->trReimplementedFromList(1); - } - else - { - reimplFromLine = theTranslator->trImplementedFromList(1); - } - int markerPos = reimplFromLine.find("@0"); - if (markerPos!=-1) // should always pass this. - { - ol.parseText(reimplFromLine.left(markerPos)); //text left from marker - if (bmd->isLinkable()) // replace marker with link - { - //Definition *bd=bmd->group; - //if (bd==0) bd=bcd; - ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(), - bmd->anchor(),bcd->displayName()); - - //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - // bmd->anchor(),bcd->name()); - if ( bmd->isLinkableInProject() ) - { - writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor()); - } - } - else - { - ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - 0,bcd->displayName()); - if (bcd->isLinkableInProject()/* && !Config_getBool("PDF_HYPERLINKS")*/ ) - { - writePageRef(ol,bcd->getOutputFileBase(),bcd->anchor()); - } - } - ol.parseText(reimplFromLine.right( - reimplFromLine.length()-markerPos-2)); // text right from marker - - } - else - { - err("error: translation error: no marker in trReimplementsFromList()\n"); - } - ol.endParagraph(); - } - - //ol.writeString("."); - } - - LockingPtr bml=reimplementedBy(); - if (bml!=0) - { - MemberListIterator mli(*bml); - MemberDef *bmd=0; - uint count=0; - ClassDef *bcd=0; - for (mli.toFirst();(bmd=mli.current()) && (bcd=bmd->getClassDef());++mli) - { - // count the members that directly inherit from md and for - // which the member and class are visible in the docs. - if ( bmd->isLinkable() && bcd->isLinkable() ) - { - count++; - } - } - if (count>0) - { - mli.toFirst(); - // write the list of classes that overwrite this member - ol.startParagraph(); - - QCString reimplInLine; - if (m_impl->virt==Pure || (m_impl->classDef && m_impl->classDef->compoundType()==ClassDef::Interface)) - { - reimplInLine = theTranslator->trImplementedInList(count); - } - else - { - reimplInLine = theTranslator->trReimplementedInList(count); - } - static QRegExp marker("@[0-9]+"); - int index=0,newIndex,matchLen; - // now replace all markers in reimplInLine with links to the classes - while ((newIndex=marker.match(reimplInLine,index,&matchLen))!=-1) - { - ol.parseText(reimplInLine.mid(index,newIndex-index)); - bool ok; - uint entryIndex = reimplInLine.mid(newIndex+1,matchLen-1).toUInt(&ok); - //bmd=bml->at(entryIndex); - - count=0; - // find the entryIndex-th documented entry in the inheritance list. - for (mli.toLast();(bmd=mli.current()) && (bcd=bmd->getClassDef());--mli) - { - if ( bmd->isLinkable() && bcd->isLinkable()) - { - if (count==entryIndex) break; - count++; - } - } - - if (ok && bcd && bmd) // write link for marker - { - //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), - // bmd->anchor(),bcd->name()); - ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(), - bmd->anchor(),bcd->displayName()); - - if (bmd->isLinkableInProject() ) - { - writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor()); - } - } - ++mli; - index=newIndex+matchLen; - } - ol.parseText(reimplInLine.right(reimplInLine.length()-index)); - ol.endParagraph(); - } - } - - // write the list of examples that use this member - if (hasExamples()) - { - ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": "); - ol.startDescForItem(); - writeExample(ol,m_impl->exampleSDict); - ol.endDescForItem(); - ol.endSimpleSect(); - } - - if (m_impl->typeConstraints) - { - writeTypeConstraints(ol,this,m_impl->typeConstraints); - } - - // write reference to the source + _writeEnumValues(ol,container,cfname,ciname,cname); + _writeReimplements(ol); + _writeReimplementedBy(ol); + _writeExamples(ol); + _writeTypeConstraints(ol); writeSourceDef(ol,cname); writeSourceRefs(ol,cname); writeSourceReffedBy(ol,cname); writeInlineCode(ol,cname); - - // write call graph - if ((m_impl->hasCallGraph || Config_getBool("CALL_GRAPH")) - && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") - ) - { - DotCallGraph callGraph(this,FALSE); - if (!callGraph.isTrivial() && !callGraph.isTooBig()) - { - msg("Generating call graph for function %s\n",qPrint(qualifiedName())); - ol.disable(OutputGenerator::Man); - ol.startParagraph(); - ol.startCallGraph(); - ol.parseText(theTranslator->trCallGraph()); - ol.endCallGraph(callGraph); - ol.endParagraph(); - ol.enableAll(); - } - } - if ((m_impl->hasCallerGraph || Config_getBool("CALLER_GRAPH")) - && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") - ) - { - DotCallGraph callerGraph(this, TRUE); - if (!callerGraph.isTrivial() && !callerGraph.isTooBig()) - { - msg("Generating caller graph for function %s\n",qPrint(qualifiedName())); - ol.disable(OutputGenerator::Man); - ol.startParagraph(); - ol.startCallGraph(); - ol.parseText(theTranslator->trCallerGraph()); - ol.endCallGraph(callerGraph); - ol.endParagraph(); - ol.enableAll(); - } - } + _writeCallGraph(ol); + _writeCallerGraph(ol); if (Doxygen::userComments) { @@ -2625,7 +2683,7 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container) linkifyText(TextGeneratorOLImpl(ol), // out scope, // scope getBodyDef(), // fileScope - doxyName, // + this, // self ts, // text TRUE // autoBreak ); @@ -2636,7 +2694,7 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container) ol.docify(doxyName); if (!m_impl->bitfields.isEmpty()) // add bitfields { - linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),name(),m_impl->bitfields.simplifyWhiteSpace()); + linkifyText(TextGeneratorOLImpl(ol),getOuterScope(),getBodyDef(),this,m_impl->bitfields.simplifyWhiteSpace()); } ol.endInlineMemberName(); diff --git a/src/memberdef.h b/src/memberdef.h index c7fa92f..8c916cb 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -185,6 +185,7 @@ class MemberDef : public Definition MemberDef *reimplements() const; LockingPtr< MemberList > reimplementedBy() const; + bool isReimplementedBy(ClassDef *cd) const; //int inbodyLine() const; //QCString inbodyFile() const; @@ -348,7 +349,7 @@ class MemberDef : public Definition // output generation void writeDeclaration(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - bool inGroup,const char *inheritId=0); + bool inGroup,ClassDef *inheritFrom=0,const char *inheritId=0); void writeDocumentation(MemberList *ml,OutputList &ol, const char *scopeName,Definition *container, bool inGroup,bool showEnumValues=FALSE,bool @@ -378,6 +379,15 @@ class MemberDef : public Definition void _computeIsConstructor(); void _computeIsDestructor(); void _getLabels(QStrList &sl,Definition *container) const; + void _writeCallGraph(OutputList &ol); + void _writeCallerGraph(OutputList &ol); + void _writeReimplements(OutputList &ol); + void _writeReimplementedBy(OutputList &ol); + void _writeExamples(OutputList &ol); + void _writeTypeConstraints(OutputList &ol); + void _writeEnumValues(OutputList &ol,Definition *container, + const QCString &cfname,const QCString &ciname, + const QCString &cname); static int s_indentLevel; // disable copying of member defs diff --git a/src/membergroup.cpp b/src/membergroup.cpp index f73eb6e..34253eb 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -118,11 +118,11 @@ void MemberGroup::writeDeclarations(OutputList &ol, void MemberGroup::writePlainDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - const char *inheritId + ClassDef *inheritedFrom,const char *inheritId ) { //printf("MemberGroup::writePlainDeclarations() memberList->count()=%d\n",memberList->count()); - memberList->writePlainDeclarations(ol,cd,nd,fd,gd,inheritId); + memberList->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId); } void MemberGroup::writeDocumentation(OutputList &ol,const char *scopeName, @@ -138,7 +138,8 @@ void MemberGroup::writeDocumentationPage(OutputList &ol,const char *scopeName, } void MemberGroup::addGroupedInheritedMembers(OutputList &ol,ClassDef *cd, - MemberList::ListType lt,const QCString &inheritId) + MemberList::ListType lt, + ClassDef *inheritedFrom,const QCString &inheritId) { //printf("** addGroupedInheritedMembers()\n"); MemberListIterator li(*memberList); @@ -150,7 +151,7 @@ void MemberGroup::addGroupedInheritedMembers(OutputList &ol,ClassDef *cd, { MemberList ml(lt); ml.append(md); - ml.writePlainDeclarations(ol,cd,0,0,0,inheritId); + ml.writePlainDeclarations(ol,cd,0,0,0,inheritedFrom,inheritId); } } } @@ -206,6 +207,12 @@ int MemberGroup::countDocMembers() return m_numDocMembers; } +int MemberGroup::countInheritableMembers(ClassDef *inheritedFrom) const +{ + return memberList->countInheritableMembers(inheritedFrom); +} + + void MemberGroup::distributeMemberGroupDocumentation() { //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",grpHeader.data()); diff --git a/src/membergroup.h b/src/membergroup.h index d93e90c..fdd219b 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -49,7 +49,7 @@ class MemberGroup void setAnchors(ClassDef *); void writePlainDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - const char *inheritId); + ClassDef *inheritedFrom,const char *inheritId); void writeDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, bool showInline=FALSE); @@ -58,7 +58,8 @@ class MemberGroup void writeDocumentationPage(OutputList &ol,const char *scopeName, Definition *container); void addGroupedInheritedMembers(OutputList &ol,ClassDef *cd, - MemberList::ListType lt,const QCString &inheritId); + MemberList::ListType lt, + ClassDef *inheritedFrom,const QCString &inheritId); QCString documentation() { return doc; } bool allMembersInSameSection() { return inSameSection; } @@ -78,6 +79,7 @@ class MemberGroup int friendCount() const; int numDecMembers() const; int numDocMembers() const; + int countInheritableMembers(ClassDef *inheritedFrom) const; void setInGroup(bool b); void addListReferences(Definition *d); void setRefItems(const QList *sli); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 3a06aeb..c11c6b4 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -67,6 +67,47 @@ int MemberList::compareItems(GCI item1, GCI item2) return cmp!=0 ? cmp : c1->getDefLine()-c2->getDefLine(); } +int MemberList::countInheritableMembers(ClassDef *inheritedFrom) const +{ + int count=0; + QListIterator mli(*this); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) + { + if (md->isBriefSectionVisible()) + { + if (md->memberType()!=MemberDef::Friend && + md->memberType()!=MemberDef::EnumValue) + { + //printf("member %s: isReimplementedBy(%s)=%d\n",md->name().data(), + // inheritedFrom->name().data(), + // md->isReimplementedBy(inheritedFrom)); + if (md->memberType()==MemberDef::Function) + { + if (!md->isReimplementedBy(inheritedFrom)) count++; + } + else + { + count++; + } + } + } + } + if (memberGroupList) + { + MemberGroupListIterator mgli(*memberGroupList); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + count+=mg->countInheritableMembers(inheritedFrom); + } + } + //printf("%s::countInheritableMembers(%s)=%d\n", + // listTypeAsString().data(), + // inheritedFrom->name().data(),count); + return count; +} + /*! Count the number of members in this list that are visible in * the declaration part of a compound's documentation page. */ @@ -252,7 +293,7 @@ bool MemberList::declVisible() const void MemberList::writePlainDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - const char *inheritId + ClassDef *inheritedFrom,const char *inheritId ) { //printf("----- writePlainDeclaration() ----\n"); @@ -274,7 +315,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, { //printf(">>> Member `%s' type=%d visible=%d\n", // md->name().data(),md->memberType(),md->isBriefSectionVisible()); - if (md->isBriefSectionVisible()) + if ((inheritedFrom==0 || !md->isReimplementedBy(inheritedFrom)) && + md->isBriefSectionVisible()) { switch(md->memberType()) { @@ -290,7 +332,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, case MemberDef::Event: { if (first) ol.startMemberList(),first=FALSE; - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritId); + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId); break; } case MemberDef::Enumeration: @@ -354,13 +396,14 @@ void MemberList::writePlainDeclarations(OutputList &ol, break; } case MemberDef::Friend: + if (inheritedFrom==0) { if (first) { ol.startMemberList(); first=FALSE; } - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritId); + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId); break; } case MemberDef::EnumValue: @@ -369,7 +412,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, { //printf("EnumValue!\n"); if (first) ol.startMemberList(),first=FALSE; - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritId); + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup,inheritedFrom,inheritId); } } break; @@ -411,16 +454,32 @@ void MemberList::writePlainDeclarations(OutputList &ol, //printf("----- end writePlainDeclaration() ----\n"); } +/** Writes the list of members to the output. + * @param ol Output list to write to + * @param cd non-null if this list is part of class documentation. + * @param nd non-null if this list is part of namespace documentation. + * @param fd non-null if this list is part of file documentation. + * @param gd non-null if this list is part of group documentation. + * @param title Title to use for the member list. + * @param subtitle Sub title to use for the member list. + * @param showEnumValues Obsolete, always set to FALSE. + * @param showInline if set to TRUE if title is rendered differently + * @param inheritedFrom if not 0, the list is shown inside the + * given class as inherited members, parameter cd points to the + * class containing the members. + */ void MemberList::writeDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, const char *title,const char *subtitle, bool showEnumValues, bool showInline,ClassDef *inheritedFrom) { + (void)showEnumValues; // unused + //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 + countDecMembers(/*showEnumValues*/FALSE,gd); // count members shown in this section Definition *ctx = cd; if (ctx==0 && nd) ctx = nd; if (ctx==0 && gd) ctx = gd; @@ -432,7 +491,7 @@ void MemberList::writeDeclarations(OutputList &ol, int num = numDecMembers(); if (inheritedFrom) { - if (cd && !optimizeVhdl) + if ( cd && !optimizeVhdl && countInheritableMembers(inheritedFrom)>0 ) { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -494,7 +553,7 @@ void MemberList::writeDeclarations(OutputList &ol, } else { - writePlainDeclarations(ol,cd,nd,fd,gd,inheritId); + writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId); } //printf("memberGroupList=%p\n",memberGroupList); @@ -524,7 +583,7 @@ void MemberList::writeDeclarations(OutputList &ol, ol.startMemberGroup(); } //printf("--- mg->writePlainDeclarations ---\n"); - mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritId); + mg->writePlainDeclarations(ol,cd,nd,fd,gd,inheritedFrom,inheritId); if (inheritId.isEmpty()) { ol.endMemberGroup(hasHeader); @@ -537,7 +596,7 @@ void MemberList::writeDeclarations(OutputList &ol, { // 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); + cd->addGroupedInheritedMembers(ol,m_listType,inheritedFrom,inheritId); } //printf("----- end writeDeclaration() ----\n"); } diff --git a/src/memberlist.h b/src/memberlist.h index 1fa66d3..facf54f 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -136,9 +136,10 @@ class MemberList : public QList bool needsSorting() const { return m_needsSorting; } void countDecMembers(bool countEnumValues=FALSE,GroupDef *gd=0); void countDocMembers(bool countEnumValues=FALSE); + int countInheritableMembers(ClassDef *inheritedFrom) const; void writePlainDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - const char *inheritId); + ClassDef *inheritedFrom,const char *inheritId); void writeDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, const char *title,const char *subtitle, diff --git a/src/navtree.css b/src/navtree.css index a72869c..435168a 100644 --- a/src/navtree.css +++ b/src/navtree.css @@ -76,6 +76,7 @@ display:block; padding:0px; margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ } #side-nav { @@ -115,6 +116,7 @@ background-image:url('nav_h.png'); background-repeat:repeat-x; background-color: ##FA; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ } @media print diff --git a/src/navtree.js b/src/navtree.js index a70e854..edaaee3 100644 --- a/src/navtree.js +++ b/src/navtree.js @@ -1,5 +1,5 @@ - var navTreeIndex; +var navTreeSubIndices = new Array(); function getData(varName) { @@ -13,6 +13,14 @@ function stripPath(uri) return uri.substring(uri.lastIndexOf('/')+1); } +function stripPath2(uri) +{ + var i = uri.lastIndexOf('/'); + var s = uri.substring(i+1); + var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; +} + function getScript(scriptName,func,show) { var head = document.getElementsByTagName("head")[0]; @@ -297,7 +305,8 @@ function showNode(o, node, index) showNode(o,node,index); // retry with child node expanded },true); } else { - if (o.toroot=="index.html" /*|| n.childrenData*/) { + var rootBase = o.toroot.replace(/\..+$/, ''); + if (rootBase=="index" || rootBase=="pages") { expandNode(o, n, true, true); } selectAndHighlight(n); @@ -320,24 +329,47 @@ function getNode(o, po) } } -function gotoNode(o,root,hash) +function gotoNode(o,subIndex,root,hash) { - var nti = navTreeIndex[root+hash]; - o.breadcrumbs = nti ? nti : navTreeIndex[root]; - if (o.breadcrumbs==null) o.breadcrumbs = navTreeIndex["index.html"]; - o.breadcrumbs.unshift(0); - showNode(o, o.node, 0); + var nti = navTreeSubIndices[subIndex][root+hash]; + o.breadcrumbs = nti ? nti : navTreeSubIndices[subIndex][root]; + if (o.breadcrumbs) + { + o.breadcrumbs.unshift(0); // add 0 for root node + showNode(o, o.node, 0); + } +} + +function gotoSubIndex(o,root,hash,relpath) +{ + if (hash.match(/^#l\d+$/)) + { + hash=''; // strip line number anchors + } + var url=root+hash; + var i=-1; + while (navTreeIndex[i+1]<=url) i++; + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash) + } else { + getScript(relpath+'navtreeindex'+i,function(){ + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash); + } + },true); + } } function navTo(o,root,hash,relpath) { if (navTreeIndex){ - gotoNode(o,root,hash); + gotoSubIndex(o,root,hash,relpath); } else { getScript(relpath+"navtreeindex",function(){ navTreeIndex = eval('NAVTREEINDEX'); if (navTreeIndex){ - gotoNode(o,root,hash); + gotoSubIndex(o,root,hash,relpath); } },true); } @@ -377,7 +409,7 @@ function initNavTree(toroot,relpath) $('.item').removeClass('selected'); $('.item').removeAttr('id'); } - var link=stripPath($(location).attr('pathname')); + var link=stripPath2($(location).attr('pathname')); navTo(o,link,$(location).attr('hash'),relpath); } }) diff --git a/src/navtree_css.h b/src/navtree_css.h index 957ffe6..99bcb24 100644 --- a/src/navtree_css.h +++ b/src/navtree_css.h @@ -76,6 +76,7 @@ " display:block;\n" " padding:0px;\n" " margin:0px;\n" +" -webkit-overflow-scrolling : touch; /* iOS 5+ */\n" "}\n" "\n" "#side-nav {\n" @@ -115,6 +116,7 @@ " background-image:url('nav_h.png');\n" " background-repeat:repeat-x;\n" " background-color: ##FA;\n" +" -webkit-overflow-scrolling : touch; /* iOS 5+ */\n" "}\n" "\n" "@media print\n" diff --git a/src/navtree_js.h b/src/navtree_js.h index 8c513d2..9f9e996 100644 --- a/src/navtree_js.h +++ b/src/navtree_js.h @@ -1,5 +1,5 @@ -"\n" "var navTreeIndex;\n" +"var navTreeSubIndices = new Array();\n" "\n" "function getData(varName)\n" "{\n" @@ -13,6 +13,14 @@ " return uri.substring(uri.lastIndexOf('/')+1);\n" "}\n" "\n" +"function stripPath2(uri)\n" +"{\n" +" var i = uri.lastIndexOf('/');\n" +" var s = uri.substring(i+1);\n" +" var m = uri.substring(0,i+1).match(/\\/d\\w\\/d\\w\\w\\/$/);\n" +" return m ? uri.substring(i-6) : s;\n" +"}\n" +"\n" "function getScript(scriptName,func,show)\n" "{\n" " var head = document.getElementsByTagName(\"head\")[0]; \n" @@ -297,7 +305,8 @@ " showNode(o,node,index); // retry with child node expanded\n" " },true);\n" " } else {\n" -" if (o.toroot==\"index.html\" /*|| n.childrenData*/) {\n" +" var rootBase = o.toroot.replace(/\\..+$/, '');\n" +" if (rootBase==\"index\" || rootBase==\"pages\") {\n" " expandNode(o, n, true, true);\n" " }\n" " selectAndHighlight(n);\n" @@ -320,24 +329,47 @@ " }\n" "}\n" "\n" -"function gotoNode(o,root,hash)\n" +"function gotoNode(o,subIndex,root,hash)\n" "{\n" -" var nti = navTreeIndex[root+hash];\n" -" o.breadcrumbs = nti ? nti : navTreeIndex[root];\n" -" if (o.breadcrumbs==null) o.breadcrumbs = navTreeIndex[\"index.html\"];\n" -" o.breadcrumbs.unshift(0);\n" -" showNode(o, o.node, 0);\n" +" var nti = navTreeSubIndices[subIndex][root+hash];\n" +" o.breadcrumbs = nti ? nti : navTreeSubIndices[subIndex][root];\n" +" if (o.breadcrumbs)\n" +" {\n" +" o.breadcrumbs.unshift(0); // add 0 for root node\n" +" showNode(o, o.node, 0);\n" +" }\n" +"}\n" +"\n" +"function gotoSubIndex(o,root,hash,relpath)\n" +"{\n" +" if (hash.match(/^#l\\d+$/)) \n" +" {\n" +" hash=''; // strip line number anchors\n" +" }\n" +" var url=root+hash;\n" +" var i=-1;\n" +" while (navTreeIndex[i+1]<=url) i++;\n" +" if (navTreeSubIndices[i]) {\n" +" gotoNode(o,i,root,hash)\n" +" } else {\n" +" getScript(relpath+'navtreeindex'+i,function(){\n" +" navTreeSubIndices[i] = eval('NAVTREEINDEX'+i);\n" +" if (navTreeSubIndices[i]) {\n" +" gotoNode(o,i,root,hash);\n" +" }\n" +" },true);\n" +" }\n" "}\n" "\n" "function navTo(o,root,hash,relpath)\n" "{\n" " if (navTreeIndex){\n" -" gotoNode(o,root,hash);\n" +" gotoSubIndex(o,root,hash,relpath);\n" " } else {\n" " getScript(relpath+\"navtreeindex\",function(){\n" " navTreeIndex = eval('NAVTREEINDEX');\n" " if (navTreeIndex){\n" -" gotoNode(o,root,hash);\n" +" gotoSubIndex(o,root,hash,relpath);\n" " }\n" " },true);\n" " } \n" @@ -377,7 +409,7 @@ " $('.item').removeClass('selected');\n" " $('.item').removeAttr('id');\n" " }\n" -" var link=stripPath($(location).attr('pathname'));\n" +" var link=stripPath2($(location).attr('pathname'));\n" " navTo(o,link,$(location).attr('hash'),relpath);\n" " }\n" " })\n" diff --git a/src/outputgen.h b/src/outputgen.h index 9d1c5de..7493a60 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -65,7 +65,7 @@ class CodeOutputInterface virtual void writeLineNumber(const char *ref,const char *file, const char *anchor,int lineNumber) = 0; - virtual void startCodeLine() = 0; + virtual void startCodeLine(bool hasLineNumbers) = 0; virtual void endCodeLine() = 0; virtual void startCodeAnchor(const char *label) = 0; virtual void endCodeAnchor() = 0; diff --git a/src/outputlist.h b/src/outputlist.h index 863b4aa..a7a4f84 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -231,8 +231,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startCodeFragment); } void endCodeFragment() { forall(&OutputGenerator::endCodeFragment); } - void startCodeLine() - { forall(&OutputGenerator::startCodeLine); } + void startCodeLine(bool hasLineNumbers) + { forall(&OutputGenerator::startCodeLine,hasLineNumbers); } void endCodeLine() { forall(&OutputGenerator::endCodeLine); } void writeLineNumber(const char *ref,const char *file,const char *anchor, diff --git a/src/pagedef.cpp b/src/pagedef.cpp index 7d7ac01..1442ce1 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -248,14 +248,17 @@ void PageDef::writePageDocumentation(OutputList &ol) bool PageDef::visibleInIndex() const { - return // not part of a group - !getGroupDef() && - // not an externally defined page - (!isReference() || Config_getBool("ALLEXTERNALS")) && - // not a subpage - (getOuterScope()==0 || - getOuterScope()->definitionType()!=Definition::TypePage - ); + static bool allExternals = Config_getBool("ALLEXTERNALS"); + return // not part of a group + !getGroupDef() && + // not an externally defined page + (!isReference() || allExternals) + // && + // not a subpage + //(getOuterScope()==0 || + // getOuterScope()->definitionType()!=Definition::TypePage + //) + ; } bool PageDef::documentedPage() const diff --git a/src/pycode.l b/src/pycode.l index e24c8f9..c2720cf 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -382,7 +382,7 @@ static void startCodeLine() } //g_code->endLineNumber(); } - g_code->startCodeLine(); + g_code->startCodeLine(g_sourceFileDef); if (g_currentFontClass) { g_code->startFontClass(g_currentFontClass); diff --git a/src/resize.js b/src/resize.js index 04fa95c..9fe82ba 100644 --- a/src/resize.js +++ b/src/resize.js @@ -76,6 +76,18 @@ function initResizable() if (i>=0) window.location.hash=url.substr(i); var _preventDefault = function(evt) { evt.preventDefault(); }; $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(document).bind('touchmove',function(e){ + try { + var target = e.target; + while (target) { + if ($(target).css('-webkit-overflow-scrolling')=='touch') return; + target = target.parentNode; + } + e.preventDefault(); + } catch(err) { + e.preventDefault(); + } + }); } diff --git a/src/resize_js.h b/src/resize_js.h index 7e627cc..ec50059 100644 --- a/src/resize_js.h +++ b/src/resize_js.h @@ -76,6 +76,18 @@ " if (i>=0) window.location.hash=url.substr(i);\n" " var _preventDefault = function(evt) { evt.preventDefault(); };\n" " $(\"#splitbar\").bind(\"dragstart\", _preventDefault).bind(\"selectstart\", _preventDefault);\n" +" $(document).bind('touchmove',function(e){\n" +" try {\n" +" var target = e.target;\n" +" while (target) {\n" +" if ($(target).css('-webkit-overflow-scrolling')=='touch') return;\n" +" target = target.parentNode;\n" +" }\n" +" e.preventDefault();\n" +" } catch(err) {\n" +" e.preventDefault();\n" +" }\n" +" });\n" "}\n" "\n" "\n" diff --git a/src/rtfgen.h b/src/rtfgen.h index 3a16763..7f92b26 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -123,7 +123,7 @@ class RTFGenerator : public OutputGenerator void startCodeFragment(); void endCodeFragment(); void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; } - void startCodeLine() { col=0; } + void startCodeLine(bool) { col=0; } void endCodeLine() { lineBreak(); } void startEmphasis() { t << "{\\i "; } void endEmphasis() { t << "}"; } diff --git a/src/sortdict.h b/src/sortdict.h index 40f23f7..088d5ef 100644 --- a/src/sortdict.h +++ b/src/sortdict.h @@ -353,7 +353,7 @@ class SDict class IteratorDict; // first forward declare friend class IteratorDict; // then make it a friend - /*! Simple iterator for SDict. It iterates in over the dictionary elements + /*! Simple iterator for SDict. It iterates over the dictionary elements * in an unsorted way, but does provide information about the element's key. */ class IteratorDict diff --git a/src/util.cpp b/src/util.cpp index 56dd787..76aea95 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1799,7 +1799,7 @@ bool leftScopeMatch(const QCString &scope, const QCString &name) void linkifyText(const TextGeneratorIntf &out,Definition *scope, - FileDef *fileScope,const char *, + FileDef *fileScope,Definition *self, const char *text, bool autoBreak,bool external, bool keepSpaces,int indentLevel) { @@ -1882,11 +1882,14 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, //printf("Found typedef %s\n",typeDef->name().data()); if (external ? typeDef->isLinkable() : typeDef->isLinkableInProject()) { - out.writeLink(typeDef->getReference(), - typeDef->getOutputFileBase(), - typeDef->anchor(), - word); - found=TRUE; + if (typeDef->getOuterScope()!=self) + { + out.writeLink(typeDef->getReference(), + typeDef->getOutputFileBase(), + typeDef->anchor(), + word); + found=TRUE; + } } } if (!found && cd) @@ -1895,8 +1898,11 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, // add link to the result if (external ? cd->isLinkable() : cd->isLinkableInProject()) { - out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); - found=TRUE; + if (cd!=self) + { + out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); + found=TRUE; + } } } else if ((cd=getClass(matchWord+"-p"))) // search for Obj-C protocols as well @@ -1904,8 +1910,11 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, // add link to the result if (external ? cd->isLinkable() : cd->isLinkableInProject()) { - out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); - found=TRUE; + if (cd!=self) + { + out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); + found=TRUE; + } } } else if ((cd=getClass(matchWord+"-g"))) // C# generic as well @@ -1913,8 +1922,11 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, // add link to the result if (external ? cd->isLinkable() : cd->isLinkableInProject()) { - out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); - found=TRUE; + if (cd!=self) + { + out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); + found=TRUE; + } } } else @@ -1951,10 +1963,14 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, //printf("Found ref scope=%s\n",d?d->name().data():""); //ol.writeObjectLink(d->getReference(),d->getOutputFileBase(), // md->anchor(),word); - out.writeLink(md->getReference(),md->getOutputFileBase(), - md->anchor(),word); - //printf("found symbol %s\n",matchWord.data()); - found=TRUE; + if (md!=self && (self==0 || md->name()!=self->name())) + // name check is needed for overloaded members, where getDefs just returns one + { + out.writeLink(md->getReference(),md->getOutputFileBase(), + md->anchor(),word); + //printf("found symbol %s\n",matchWord.data()); + found=TRUE; + } } } @@ -6123,7 +6139,7 @@ void filterLatexString(FTextStream &t,const char *str, else if (*p=='>') { t << "$>$"; p++; } else - { t << "$\\backslash$"; } + { t << "\\textbackslash{}"; } break; case '"': { t << "\\char`\\\"{}"; } break; diff --git a/src/util.h b/src/util.h index 1c4197b..a93d5b3 100644 --- a/src/util.h +++ b/src/util.h @@ -96,7 +96,7 @@ QCString getLanguageSpecificSeparator(SrcLangExt lang,bool classScope=FALSE); void linkifyText(const TextGeneratorIntf &ol, Definition *scope, FileDef *fileScope, - const char *name, + Definition *self, const char *text, bool autoBreak=FALSE, bool external=TRUE, diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 10efb4d..ab2f3b6 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -225,7 +225,7 @@ static void startCodeLine() g_code->writeLineNumber(0,0,0,g_yyLineNr); } } - g_code->startCodeLine(); + g_code->startCodeLine(g_sourceFileDef); if (g_currentFontClass) { g_code->startFontClass(g_currentFontClass); diff --git a/src/vhdlparser.y b/src/vhdlparser.y index d4223c0..cda97a4 100644 --- a/src/vhdlparser.y +++ b/src/vhdlparser.y @@ -2119,8 +2119,11 @@ static void addCompInst(char *n, char* instName, char* comp,int iLine) initEntry(current); instFiles.append(new Entry(*current)); } - delete current; - current=new Entry; + + Entry *temp=current; // hold current pointer (temp=oldEntry) + current=new Entry; // (oldEntry != current) + delete temp; + } else { diff --git a/src/vhdlscanner.l b/src/vhdlscanner.l index d757ea2..fb9b9c3 100644 --- a/src/vhdlscanner.l +++ b/src/vhdlscanner.l @@ -1016,9 +1016,9 @@ void isVhdlDocPending() { if (!str_doc.pending) return; - + str_doc.pending=FALSE; + oldEntry=0; // prevents endless recursion iDocLine=str_doc.iDocLine; handleCommentBlock(str_doc.doc,str_doc.brief); iDocLine=-1; - str_doc.pending=FALSE; } diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 13e8413..b75a2f0 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -298,7 +298,7 @@ class XMLCodeGenerator : public CodeOutputInterface writeXMLLink(m_t,ref,file,anchor,name,tooltip); col+=strlen(name); } - void startCodeLine() + void startCodeLine(bool) { XML_DB(("(startCodeLine)\n")); m_t << "typeString(); //replaceAnonymousScopes(md->typeString()); stripQualifiers(typeStr); t << " "; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),typeStr); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr); t << "" << endl; t << " " << convertToXML(md->definition()) << "" << endl; t << " " << convertToXML(md->argsString()) << "" << endl; @@ -833,7 +833,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (!a->type.isEmpty()) { t << " "; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->type); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a->type); t << "" << endl; } if (!a->name.isEmpty()) @@ -857,7 +857,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (!a->defval.isEmpty()) { t << " "; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->defval); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a->defval); t << "" << endl; } if (defArg && defArg->hasDocumentation()) @@ -895,14 +895,14 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (!md->initializer().isEmpty() && md->initializer().length()<2000) { t << " "; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->initializer()); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->initializer()); t << "" << endl; } if (md->excpString()) { t << " "; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->excpString()); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->excpString()); t << "" << endl; } -- cgit v0.12