diff options
Diffstat (limited to 'src')
51 files changed, 1420 insertions, 790 deletions
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("<table>\n"); + ol.writeString("<table class=\"directory\">\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(" <tr class=\"memlist\"><td>"); + ol.writeString(" <tr"); + if ((idx&1)==0) ol.writeString(" class=\"even\""); + idx++; + ol.writeString("><td class=\"entry\">"); if (cd->isObjectiveC()) { if (md->isObjCMethod()) @@ -2125,7 +2128,7 @@ void ClassDef::writeMemberList(OutputList &ol) ol.writeString("- </td><td>"); } else - ol.writeString("</td><td>"); + ol.writeString("</td><td class=\"entry\">"); } if (md->isObjCMethod()) { @@ -2163,18 +2166,21 @@ void ClassDef::writeMemberList(OutputList &ol) // generate link to the class instead. { //ol.writeListItem(); - ol.writeString(" <tr bgcolor=\"#f0f0f0\"><td>"); + ol.writeString(" <tr bgcolor=\"#f0f0f0\""); + if ((idx&1)==0) ol.writeString("class=\"even\""); + idx++; + ol.writeString("><td class=\"entry\">"); if (cd->isObjectiveC()) { if (md->isObjCMethod()) { if (md->isStatic()) - ol.writeString("+ </td><td>"); + ol.writeString("+ </td><td class=\"entry\">"); else - ol.writeString("- </td><td>"); + ol.writeString("- </td><td class=\"entry\">"); } else - ol.writeString("</td><td>"); + ol.writeString("</td><td class=\"entry\">"); } ol.startBold(); ol.docify(md->name()); @@ -2212,7 +2218,7 @@ void ClassDef::writeMemberList(OutputList &ol) } if (memberWritten) { - ol.writeString("<td>"); + ol.writeString("<td class=\"entry\">"); ol.writeObjectLink(cd->getReference(), cd->getOutputFileBase(), cd->anchor(), @@ -2220,7 +2226,7 @@ void ClassDef::writeMemberList(OutputList &ol) md->category()->displayName() : cd->displayName()); ol.writeString("</td>"); - ol.writeString("<td>"); + ol.writeString("<td class=\"entry\">"); } SrcLangExt lang = md->getLanguage(); if ( @@ -2232,8 +2238,7 @@ void ClassDef::writeMemberList(OutputList &ol) ) && memberWritten) { - ol.startTypewriter(); - ol.docify(" ["); + ol.writeString("<span class=\"mlabel\">"); 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("</span><span class=\"mlabel\">"); } - ol.docify("]"); - ol.endTypewriter(); + ol.writeString("</span>"); } 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():"<none>",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<void> *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; @@ -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); } +<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{B}*/\n { // horizontal line (dashed) + addOutput(yytext); + } +<Comment>"---" { // mdash + addOutput("—"); + } +<Comment>"--" { // ndash + addOutput("–"); + } <Comment>("."+)[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'/> + <option type='int' id='HTML_INDEX_NUM_ENTRIES' docs=' +With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +entries shown in the various tree structured indices initially; the user +can expand and collapse entries dynamically later on. Doxygen will expand +the tree to such a level that at most the specified number of entries are +visible (unless a fully collapsed tree already exceeds this amount). +So setting the number of entries 1 will produce a full collapsed tree by +default. 0 is a special value representing an infinite number of entries +and will result in a full expanded tree by default. +' minval='0' maxval='9999' defval='100'/> <option type='bool' id='GENERATE_DOCSET' docs=' If the GENERATE_DOCSET tag is set to YES, additional index files will be generated that can be used as input for Apple's Xcode 3 diff --git a/src/configoptions.cpp b/src/configoptions.cpp index e075ac0..6c6be0c 100644 --- a/src/configoptions.cpp +++ b/src/configoptions.cpp @@ -1285,6 +1285,19 @@ void addConfigOptions(Config *cfg) ); cb->addDependency("GENERATE_HTML"); //---- + ci = cfg->addInt( + "HTML_INDEX_NUM_ENTRIES", + "With HTML_INDEX_NUM_ENTRIES one can control the preferred number of\n" + "entries shown in the various tree structured indices initially; the user\n" + "can expand and collapse entries dynamically later on. Doxygen will expand\n" + "the tree to such a level that at most the specified number of entries are\n" + "visible (unless a fully collapsed tree already exceeds this amount).\n" + "So setting the number of entries 1 will produce a full collapsed tree by\n" + "default. 0 is a special value representing an infinite number of entries\n" + "and will result in a full expanded tree by default.", + 0,9999,100 + ); + //---- cb = cfg->addBool( "GENERATE_DOCSET", "If the GENERATE_DOCSET tag is set to YES, additional index files\n" diff --git a/src/dot.cpp b/src/dot.cpp index 78dc451..a33ea5f 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -115,6 +115,7 @@ static const char svgZoomFooter[] = " <path fill=\"none\" stroke=\"white\" stroke-width=\"1.5\" d=\"M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5\"/>\n" " </g>\n" " </g>\n" +/* " <svg viewBox=\"0 0 25 25\" width=\"100%\" height=\"30px\" preserveAspectRatio=\"xMaxYMin meet\"> \n" " <g id=\"printButton\" transform=\"scale(0.4 0.4)\" onmousedown=\"handlePrint(evt)\">\n" " <rect height=\"23.33753581\" id=\"paper\" rx=\"2\" style=\"fill:#f2f5e9;fill-rule:evenodd;stroke:#111111;stroke-width:3.224;stroke-linejoin:round;\" transform=\"matrix(1.000000,0.000000,-0.339266,0.940691,0.000000,0.000000)\" width=\"25.55231285\" x=\"26.69387353\" y=\"7.36162977\"/>\n" @@ -122,6 +123,18 @@ static const char svgZoomFooter[] = " <rect height=\"8.27750969\" id=\"tray\" style=\"fill:#d2d5c9;fill-rule:evenodd;stroke:#111111;stroke-width:3.125;stroke-linecap:round;stroke-linejoin:round;\" width=\"40\" x=\"10.28778839\" y=\"44.96812282\"/>\n" " </g>\n" " </svg>\n" +*/ +" <svg viewBox=\"0 0 15 15\" width=\"100%\" height=\"30px\" preserveAspectRatio=\"xMaxYMin meet\">\n" +" <g id=\"arrow_out\" transform=\"scale(0.3 0.3)\">\n" +" <a xlink:href=\"$orgname\" target=\"_base\">\n" +" <rect id=\"button\" ry=\"5\" rx=\"5\" y=\"6\" x=\"6\" height=\"38\" width=\"38\"\n" +" fill=\"#f2f5e9\" fill-opacity=\"0.5\" stroke=\"#606060\" stroke-width=\"1.0\"/>\n" +" <path id=\"arrow\"\n" +" d=\"M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z\"\n" +" style=\"fill:#404040;\"/>\n" +" </a>\n" +" </g>\n" +" </svg>\n" "</svg>\n" ; @@ -585,9 +598,9 @@ static bool writeSVGFigureLink(FTextStream &out,const QCString &relPath, if (width==-1) { if (height<=60) - height=60; + height=300; else - height+=40; // add some extra space for zooming + height+=300; // add some extra space for zooming if (height>600) height=600; // clip to maximum height of 600 pixels out << "<div class=\"zoom\">"; //out << "<object type=\"image/svg+xml\" data=\"" @@ -1065,11 +1078,42 @@ bool DotFilePatcher::run() } lineNr++; } + fi.close(); if (isSVGFile && interactiveSVG && replacedHeader) { - t << svgZoomFooter; + QCString orgName=m_patchFile.left(m_patchFile.length()-4)+"_org.svg"; + t << substitute(svgZoomFooter,"$orgname",orgName); + fo.close(); + // keep original SVG file so we can refer to it, we do need to replace + // dummy link by real ones + QFile fi(tmpName); + QFile fo(orgName); + if (!fi.open(IO_ReadOnly)) + { + err("error: problem opening file %s for reading!\n",tmpName.data()); + return FALSE; + } + if (!fo.open(IO_WriteOnly)) + { + err("error: problem opening file %s for writing!\n",orgName.data()); + return FALSE; + } + FTextStream t(&fo); + while (!fi.atEnd()) // foreach line + { + QCString line(maxLineLen); + int numBytes = fi.readLine(line.data(),maxLineLen); + if (numBytes<=0) + { + break; + } + Map *map = m_maps.at(0); // there is only one 'map' for a SVG file + t << replaceRef(line,map->relPath,map->urlOnly,map->context,"_top"); + } + fi.close(); + fo.close(); } - fi.close(); + // remove temporary file QDir::current().remove(tmpName); return TRUE; } @@ -1484,8 +1528,8 @@ void DotNode::setDistance(int distance) static QCString convertLabel(const QCString &l) { QCString result; - QCString bBefore("\\_/<({[: =-+@%#~?$"); - QCString bAfter(">]),;|"); + QCString bBefore("\\_/<({[: =-+@%#~?$"); // break before character set + QCString bAfter(">]),;|"); // break after character set const char *p=l.data(); if (p==0) return result; char c; @@ -1520,7 +1564,7 @@ static QCString convertLabel(const QCString &l) } else if (charsLeft>foldLen/3 && sinceLast>foldLen && bBefore.contains(c)) { - result+="\\n"; + result+="\\l"; result+=replacement; foldLen = (foldLen+sinceLast+1)/2; sinceLast=1; @@ -1529,14 +1573,14 @@ static QCString convertLabel(const QCString &l) !isupper(c) && isupper(*p)) { result+=replacement; - result+="\\n"; + result+="\\l"; foldLen = (foldLen+sinceLast+1)/2; sinceLast=0; } else if (charsLeft>foldLen/3 && sinceLast>foldLen && bAfter.contains(c)) { result+=replacement; - result+="\\n"; + result+="\\l"; foldLen = (foldLen+sinceLast+1)/2; sinceLast=0; } @@ -1595,7 +1639,7 @@ static void writeBoxMemberList(FTextStream &t, static int limit = Config_getInt("UML_LIMIT_NUM_FIELDS"); if (limit>0 && (totalCount>limit*3/2 && count>=limit)) { - t << theTranslator->trAndMore(QCString().sprintf("%d",totalCount-count)); + t << theTranslator->trAndMore(QCString().sprintf("%d",totalCount-count)) << "\\l"; break; } else @@ -2781,10 +2825,11 @@ DotClassGraph::DotClassGraph(ClassDef *cd,DotNode::GraphType t) bool DotClassGraph::isTrivial() const { + static bool umlLook = Config_getBool("UML_LOOK"); if (m_graphType==DotNode::Inheritance) return m_startNode->m_children==0 && m_startNode->m_parents==0; else - return m_startNode->m_children==0; + return !umlLook && m_startNode->m_children==0; } bool DotClassGraph::isTooBig() const diff --git a/src/doxygen.cpp b/src/doxygen.cpp index f375717..fad7102 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -253,11 +253,17 @@ static STLInfo g_stlinfo[] = { // className baseClass1 baseClass2 templType1 templName1 templType2 templName2 virtInheritance // iterators { "allocator", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, + { "array", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, // C++11 { "auto_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // deprecated { "smart_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 { "unique_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 { "weak_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 { "ios_base", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 + { "error_code", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 + { "error_category", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 + { "system_error", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 + { "error_condition", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 + { "thread", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 { "basic_ios", "ios_base", 0, "Char", 0, 0, 0, FALSE, FALSE }, { "basic_istream", "basic_ios<Char>", 0, "Char", 0, 0, 0, TRUE, FALSE }, { "basic_ostream", "basic_ios<Char>", 0, "Char", 0, 0, 0, TRUE, FALSE }, @@ -293,10 +299,15 @@ static STLInfo g_stlinfo[] = { "bitset", 0, 0, "Bits", 0, 0, 0, FALSE, FALSE }, { "deque", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, { "list", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, + { "forward_list", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, // C++11 { "map", 0, 0, "K", "keys", "T", "elements", FALSE, TRUE }, + { "unordered_map", 0, 0, "K", "keys", "T", "elements", FALSE, TRUE }, // C++11 { "multimap", 0, 0, "K", "keys", "T", "elements", FALSE, TRUE }, + { "unordered_multimap", 0, 0, "K", "keys", "T", "elements", FALSE, TRUE }, // C++11 { "set", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, + { "unordered_set", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, // C++11 { "multiset", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, + { "unordered_multiset", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, // C++11 { "vector", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, { "queue", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, { "priority_queue", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, @@ -507,6 +518,7 @@ static void addRelatedPage(EntryNav *rootNav) ); if (pd) { + pd->setBriefDescription(root->brief,root->briefFile,root->briefLine); pd->addSectionsToDefinition(root->anchors); pd->setShowToc(root->stat); addPageToContext(pd,rootNav); @@ -8231,6 +8243,7 @@ static void findMainPage(EntryNav *rootNav) Doxygen::mainPage = new PageDef(root->docFile,root->docLine, indexName, root->brief+root->doc+root->inbodyDocs,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); + Doxygen::mainPage->setBriefDescription(root->brief,root->briefFile,root->briefLine); Doxygen::mainPage->setFileName(indexName); Doxygen::mainPage->setShowToc(root->stat); addPageToContext(Doxygen::mainPage,rootNav); @@ -8428,6 +8441,7 @@ static void buildExampleList(EntryNav *rootNav) { PageDef *pd=new PageDef(root->fileName,root->startLine, root->name,root->brief+root->doc+root->inbodyDocs,root->args); + pd->setBriefDescription(root->brief,root->briefFile,root->briefLine); pd->setFileName(convertNameToFile(pd->name()+"-example",FALSE,TRUE)); pd->addSectionsToDefinition(root->anchors); pd->setLanguage(root->lang); diff --git a/src/doxygen.css b/src/doxygen.css index 863c2c9..23c84ee 100644 --- a/src/doxygen.css +++ b/src/doxygen.css @@ -149,20 +149,55 @@ dl.el { margin-left: -1cm; } -.fragment { +pre.fragment { + 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: ##FC; + border: 1px solid ##CC; +} + +div.line { font-family: monospace, fixed; - font-size: 105%; + 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; } -pre.fragment { - border: 1px solid ##CC; - background-color: ##FC; - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; +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 { @@ -581,8 +616,8 @@ span.mlabels { span.mlabel { background-color: ##88; - border-top:1px solid ##55; - border-left:1px solid ##55; + border-top:1px solid ##70; + border-left:1px solid ##70; border-right:1px solid ##CC; border-bottom:1px solid ##CC; text-shadow: none; @@ -622,6 +657,10 @@ div.directory { padding-right: 6px; } +.directory td.entry a { + outline:none; +} + .directory td.desc { width: 100%; padding-left: 6px; @@ -1089,15 +1128,5 @@ tr.heading h2 { overflow:inherit; display:inline; } - pre.fragment - { - overflow: visible; - 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+ */ - } } diff --git a/src/doxygen_css.h b/src/doxygen_css.h index b6e57e3..27540df 100644 --- a/src/doxygen_css.h +++ b/src/doxygen_css.h @@ -149,20 +149,55 @@ " margin-left: -1cm;\n" "}\n" "\n" -".fragment {\n" +"pre.fragment {\n" +" border: 1px solid #C4CFE5;\n" +" background-color: #FBFCFD;\n" +" padding: 4px 6px;\n" +" margin: 4px 8px 4px 2px;\n" +" overflow: auto;\n" +" word-wrap: break-word;\n" +" font-size: 9pt;\n" +" line-height: 125%;\n" +" font-family: monospace, fixed;\n" +" font-size: 105%;\n" +"}\n" +"\n" +"div.fragment {\n" +" padding: 4px;\n" +" margin: 4px;\n" +" background-color: ##FC;\n" +" border: 1px solid ##CC;\n" +"}\n" +"\n" +"div.line {\n" " font-family: monospace, fixed;\n" -" font-size: 105%;\n" +" font-size: 13px;\n" +" line-height: 1.0;\n" +" text-wrap: unrestricted;\n" +" white-space: -moz-pre-wrap; /* Moz */\n" +" white-space: -pre-wrap; /* Opera 4-6 */\n" +" white-space: -o-pre-wrap; /* Opera 7 */\n" +" white-space: pre-wrap; /* CSS3 */\n" +" word-wrap: break-word; /* IE 5.5+ */\n" +" text-indent: -53px;\n" +" padding-left: 53px;\n" +" padding-bottom: 0px;\n" +" margin: 0px;\n" "}\n" "\n" -"pre.fragment {\n" -" border: 1px solid ##CC;\n" -" background-color: ##FC;\n" -" padding: 4px 6px;\n" -" margin: 4px 8px 4px 2px;\n" -" overflow: auto;\n" -" word-wrap: break-word;\n" -" font-size: 9pt;\n" -" line-height: 125%;\n" +"span.lineno {\n" +" padding-right: 4px;\n" +" text-align: right;\n" +" border-right: 2px solid #0F0;\n" +" background-color: #E8E8E8;\n" +" white-space: pre;\n" +"}\n" +"span.lineno a {\n" +" background-color: #D8D8D8;\n" +"}\n" +"\n" +"span.lineno a:hover {\n" +" background-color: #C8C8C8;\n" "}\n" "\n" "div.ah {\n" @@ -581,8 +616,8 @@ "\n" "span.mlabel {\n" " background-color: ##88;\n" -" border-top:1px solid ##55;\n" -" border-left:1px solid ##55;\n" +" border-top:1px solid ##70;\n" +" border-left:1px solid ##70;\n" " border-right:1px solid ##CC;\n" " border-bottom:1px solid ##CC;\n" " text-shadow: none;\n" @@ -622,6 +657,10 @@ " padding-right: 6px;\n" "}\n" "\n" +".directory td.entry a {\n" +" outline:none;\n" +"}\n" +"\n" ".directory td.desc {\n" " width: 100%;\n" " padding-left: 6px;\n" @@ -1089,15 +1128,5 @@ " overflow:inherit;\n" " display:inline;\n" " }\n" -" pre.fragment\n" -" {\n" -" overflow: visible;\n" -" text-wrap: unrestricted;\n" -" white-space: -moz-pre-wrap; /* Moz */\n" -" white-space: -pre-wrap; /* Opera 4-6 */\n" -" white-space: -o-pre-wrap; /* Opera 7 */\n" -" white-space: pre-wrap; /* CSS3 */\n" -" word-wrap: break-word; /* IE 5.5+ */\n" -" }\n" "}\n" "\n" diff --git a/src/dynsections.js b/src/dynsections.js index 3c5c379..116542f 100644 --- a/src/dynsections.js +++ b/src/dynsections.js @@ -68,10 +68,10 @@ function toggleInherit(id) var img = $('tr.inherit_header.'+id+' img'); var src = $(img).attr('src'); if (rows.filter(':first').is(':visible')===true) { - rows.hide(); + rows.css('display','none'); $(img).attr('src',src.substring(0,src.length-8)+'closed.png'); } else { - rows.show(); + rows.css('display','table-row'); // using show() causes jump in firefox $(img).attr('src',src.substring(0,src.length-10)+'open.png'); } } diff --git a/src/dynsections_js.h b/src/dynsections_js.h index ac507a4..c2f5767 100644 --- a/src/dynsections_js.h +++ b/src/dynsections_js.h @@ -68,10 +68,10 @@ " var img = $('tr.inherit_header.'+id+' img');\n" " var src = $(img).attr('src');\n" " if (rows.filter(':first').is(':visible')===true) {\n" -" rows.hide();\n" +" rows.css('display','none');\n" " $(img).attr('src',src.substring(0,src.length-8)+'closed.png');\n" " } else {\n" -" rows.show();\n" +" rows.css('display','table-row'); // using show() causes jump in firefox\n" " $(img).attr('src',src.substring(0,src.length-10)+'open.png');\n" " }\n" "}\n" diff --git a/src/filedef.cpp b/src/filedef.cpp index 12a1ce8..c0aa4cf 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -49,7 +49,7 @@ class DevNullCodeDocInterface : public CodeOutputInterface const char *) {} virtual void writeLineNumber(const char *,const char *, const char *,int) {} - virtual void startCodeLine() {} + virtual void startCodeLine(bool) {} virtual void endCodeLine() {} virtual void startCodeAnchor(const char *) {} virtual void endCodeAnchor() {} @@ -341,7 +341,11 @@ void FileDef::writeIncludeGraph(OutputList &ol) { //printf("Graph for file %s\n",name().data()); DotInclDepGraph incDepGraph(this,FALSE); - if (!incDepGraph.isTrivial() && !incDepGraph.isTooBig()) + if (incDepGraph.isTooBig()) + { + err("warning: Include graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data()); + } + else if (!incDepGraph.isTrivial()) { ol.startTextBlock(); ol.disable(OutputGenerator::Man); @@ -361,7 +365,11 @@ void FileDef::writeIncludedByGraph(OutputList &ol) { //printf("Graph for file %s\n",name().data()); DotInclDepGraph incDepGraph(this,TRUE); - if (!incDepGraph.isTrivial() && !incDepGraph.isTooBig()) + if (incDepGraph.isTooBig()) + { + err("warning: Included by graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",name().data()); + } + if (!incDepGraph.isTrivial()) { ol.startTextBlock(); ol.disable(OutputGenerator::Man); diff --git a/src/formula.cpp b/src/formula.cpp index d3dddd0..9407d8a 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -211,7 +211,7 @@ void FormulaList::generateBitmaps(const char *path) err("error: ghostscript produced an illegal image format!"); else { - // assume the size if after the first line that does not start with + // assume the size is after the first line that does not start with // # excluding the first line of the file. while (!t.eof() && (s=t.readLine().utf8()) && !s.isEmpty() && s.at(0)=='#') { } sscanf(s,"%d %d",&imageX,&imageY); diff --git a/src/fortrancode.l b/src/fortrancode.l index d7b9295..4de3bf2 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -246,7 +246,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); @@ -388,11 +388,13 @@ static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName { UseEntry *use; for (UseSDict::Iterator di(*usedict); (use=di.current()); ++di) - if ((cd= Doxygen::classSDict->find(use->module+"::"+tname))) + { + if ((cd= Doxygen::classSDict->find(use->module+"::"+tname))) { //cout << "=== type found in used module" << endl; return TRUE; } + } } return FALSE; @@ -420,6 +422,10 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam // search for function MemberName *mn = Doxygen::functionNameSDict->find(memberName); + if (!mn) + { + mn = Doxygen::memberNameSDict->find(memberName); + } if (mn) // name is known { @@ -463,7 +469,9 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam { //cout << " search in only: " << moduleName << ":: " << memberName << "==" << (*it)<< endl; if (memberName == (*it).utf8()) + { return TRUE; // found in ONLY-part of use list + } } } } @@ -527,7 +535,7 @@ static void generateLink(CodeOutputInterface &ol, char *lname) { ClassDef *cd=0; QCString tmp = lname; - tmp = tmp.lower(); + tmp = removeRedundantWhiteSpace(tmp.lower()); // check if lowercase lname is a linkable type or interface if ( (getFortranTypeDefs(tmp, currentModule, cd, useMembers)) && cd->isLinkable() ) @@ -656,7 +664,7 @@ NUM_TYPE (complex|integer|logical|real) LOG_OPER (\.and\.|\.eq\.|\.eqv\.|\.ge\.|\.gt\.|\.le\.|\.lt\.|\.ne\.|\.neqv\.|\.or\.|\.not\.) KIND {ARGS} CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) -TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS_}COMPLEX|DOUBLE{BS_}PRECISION|{CHAR}|TYPE{ARGS}) +TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS_}COMPLEX|DOUBLE{BS_}PRECISION|{CHAR}) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" ATTR_SPEC (ALLOCATABLE|DIMENSION{ARGS}|EXTERNAL|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PRIVATE|PUBLIC|SAVE|TARGET|RECURSIVE|PURE|ELEMENTAL) @@ -665,6 +673,7 @@ ACCESS_SPEC (PRIVATE|PUBLIC) ATTR_STMT {ATTR_SPEC}|DIMENSION COMMANDS (DO|SELECT|CASE|WHERE|IF|THEN|ELSE|MODULE{BS_}PROCEDURE|CONTAINS|IMPLICIT{BS}NONE|CONTAINS|WRITE|READ|ALLOCATE|ALLOCATED|ASSOCIATED|DEALLOCATE|SIZE|END{BS}IF|END{BS}DO|WHILE|INQUIRE|OPEN|CLOSE|DATA) IGNORE (CALL) +PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTAL)? /* | */ @@ -687,6 +696,7 @@ IGNORE (CALL) %x DeclContLine %x Parameterlist %x String +%x Subprogend %% /*==================================================================*/ @@ -712,20 +722,27 @@ IGNORE (CALL) /*-------- use statement -------------------------------------------*/ <Start>"use"{BS_} { + startFontClass("keyword"); codifyLines(yytext); + endFontClass(); yy_push_state(YY_START); BEGIN(Use); } <Use>{ID} { - startFontClass("keywordflow"); - codifyLines(yytext); - endFontClass(); + QCString tmp = yytext; + tmp = tmp.lower(); + g_insideBody=TRUE; + generateLink(*g_code, yytext); + g_insideBody=FALSE; /* append module name to use dict */ useEntry = new UseEntry(); - useEntry->module = yytext; - useMembers->append(yytext, useEntry); - addUse(yytext); + //useEntry->module = yytext; + //useMembers->append(yytext, useEntry); + //addUse(yytext); + useEntry->module = tmp; + useMembers->append(tmp, useEntry); + addUse(tmp); } <Use>,{BS}"ONLY" { // TODO: rename codifyLines(yytext); @@ -753,7 +770,11 @@ IGNORE (CALL) if (!stricmp(yytext,"module")) currentModule="module"; } <ClassName>{ID} { - if (currentModule == "module") currentModule=yytext; + if (currentModule == "module") + { + currentModule=yytext; + currentModule = currentModule.lower(); + } generateLink(*g_code,yytext); yy_pop_state(); } @@ -765,20 +786,13 @@ IGNORE (CALL) currentModule=0; REJECT; } -<Start>^{BS}"end"({BS}("program"|"module"|"type"|"interface")({BS_}{ID})?)?{BS}/(\n|!) { // - endScope(); - startFontClass("keyword"); - codifyLines(yytext); - endFontClass(); - } - /*-------- subprog definition -------------------------------------*/ -<Start>{TYPE_SPEC}{BS}/{SUBPROG}{BS_} { // TYPE_SPEC is for old function style function result +<Start>({PREFIX}{BS_})?{TYPE_SPEC}{BS_}({PREFIX}{BS_})?{BS}/{SUBPROG}{BS_} { // TYPE_SPEC is for old function style function result startFontClass("keyword"); codifyLines(yytext); endFontClass(); } -<Start>{SUBPROG}{BS_} { // Fortran subroutine or function found +<Start>({PREFIX}{BS_})?{SUBPROG}{BS_} { // Fortran subroutine or function found startFontClass("keyword"); codifyLines(yytext); endFontClass(); @@ -793,10 +807,23 @@ IGNORE (CALL) <Subprog>"(".* { // ignore rest of line codifyLines(yytext); } -<Subprog>"\n" { codifyLines(yytext); +<Subprog,Subprogend>"\n" { codifyLines(yytext); + yy_pop_state(); + } +<Start>^{BS}"end"{BS}({SUBPROG}|"module"|"program"|"type"|"interface"){BS} { // Fortran subroutine or function ends + //cout << "===> end function " << yytext << endl; + endScope(); + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + yy_push_state(YY_START); + BEGIN(Subprogend); + } +<Subprogend>{ID}/{BS}(\n|!) { + generateLink(*g_code,yytext); yy_pop_state(); } -<Start>^{BS}"end"({BS}{SUBPROG}({BS_}{ID})?)?{BS}/(\n|!) { // Fortran subroutine or function ends +<Start>^{BS}"end"{BS}({SUBPROG}|"module"|"program"|"type"|"interface"){BS}/(\n|!) { // Fortran subroutine or function ends //cout << "===> end function " << yytext << endl; endScope(); startFontClass("keyword"); @@ -804,7 +831,7 @@ IGNORE (CALL) endFontClass(); } /*-------- variable declaration ----------------------------------*/ -<Start>"TYPE"{BS}"(" { +<Start>"type"{BS}"(" { yy_push_state(YY_START); BEGIN(TypeDecl); startFontClass("keywordtype"); @@ -861,6 +888,7 @@ IGNORE (CALL) } <Declaration>"&" { // continuation line + g_code->codify(yytext); yy_push_state(YY_START); BEGIN(DeclContLine); } diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 7ceb29f..0eb62a1 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -196,7 +196,7 @@ static int yyread(char *buf,int max_size); static void startCommentBlock(bool); static void handleCommentBlock(const QCString &doc,bool brief); static void subrHandleCommentBlock(const QCString &doc,bool brief); -static void addCurrentEntry(); +static void addCurrentEntry(int case_insens); static void addModule(const char *name, bool isModule=FALSE); static void addSubprogram(const char *text); static void addInterface(QCString name, InterfaceType type); @@ -463,9 +463,8 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA // extract generic name QCString name = QCString(yytext).stripWhiteSpace(); - name = name.right(name.length() - 9).stripWhiteSpace(); + name = name.right(name.length() - 9).stripWhiteSpace().lower(); addInterface(name, ifType); - startScope(last_entry); } } @@ -490,7 +489,7 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA current->section = Entry::FUNCTION_SEC ; current->name = yytext; moduleProcedures.append(current); - addCurrentEntry(); + addCurrentEntry(1); } <ModuleProcedure>"\n" { yyColNr -= 1; unput(*yytext); @@ -608,7 +607,7 @@ private { current->name = current_root->name + "::" + current->name; } - addCurrentEntry(); + addCurrentEntry(1); startScope(last_entry); BEGIN(TypedefBody); } @@ -639,7 +638,7 @@ private { current->name = name; current->fileName = yyFileName; current->bodyLine = yyLineNr; - addCurrentEntry(); + addCurrentEntry(1); } {BS}"=>"[^(\n|\!)]* { /* Specific bindings come after the ID. */ last_entry->args = yytext; @@ -689,7 +688,7 @@ private { addModule(NULL); yy_push_state(ModuleBody); //anon program } - argType = QCString(yytext).simplifyWhiteSpace(); + argType = QCString(yytext).simplifyWhiteSpace().lower(); yy_push_state(AttributeList); } /* Dimitri: macro expansion should already be done during preprocessing not here! @@ -781,7 +780,7 @@ private { current->type = argType; current->fileName = yyFileName; current->bodyLine = yyLineNr; // used for source reference - addCurrentEntry(); + addCurrentEntry(1); } else if (!argType.isEmpty()) { // declaration of parameter list: add type for corr. parameter @@ -925,7 +924,7 @@ private { /*------ fortran subroutine/function handling ------------------------------------------------------------*/ /* Start is initial condition */ -<Start,ModuleBody,SubprogBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains>^{BS}({PREFIX}{BS_})?{TYPE_SPEC}{BS}/{SUBPROG}{BS_} { +<Start,ModuleBody,SubprogBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains>^{BS}({PREFIX}{BS_})?{TYPE_SPEC}{BS}({PREFIX}{BS_})?/{SUBPROG}{BS_} { if (ifType == IF_ABSTRACT || ifType == IF_SPECIFIC) { addInterface("$interface$", ifType); @@ -977,7 +976,7 @@ private { <Parameterlist>")" { current->args += ")"; current->args = removeRedundantWhiteSpace(current->args); - addCurrentEntry(); + addCurrentEntry(1); startScope(last_entry); BEGIN(SubprogBody); } @@ -1003,7 +1002,7 @@ private { newLine(); //printf("3=========> without parameterlist \n"); //current->argList = ; - addCurrentEntry(); + addCurrentEntry(1); startScope(last_entry); BEGIN(SubprogBody); } @@ -1891,10 +1890,10 @@ static void initEntry() /** adds current entry to current_root and creates new current */ -static void addCurrentEntry() +static void addCurrentEntry(int case_insens) { + if (case_insens) current->name = current->name.lower(); //printf("===Adding entry %s to %s\n", current->name.data(), current_root->name.data()); - current->name = current->name.lower(); current_root->addSubEntry(current); last_entry = current; current = new Entry ; @@ -1928,7 +1927,7 @@ static void addModule(const char *name, bool isModule) current->fileName = yyFileName; current->bodyLine = yyLineNr; // used for source reference current->protection = Public ; - addCurrentEntry(); + addCurrentEntry(1); startScope(last_entry); } @@ -1992,7 +1991,7 @@ static void addInterface(QCString name, InterfaceType type) current->fileName = yyFileName; current->bodyLine = yyLineNr; - addCurrentEntry(); + addCurrentEntry(1); } @@ -2060,11 +2059,11 @@ static void handleCommentBlock(const QCString &doc,bool brief) )) { //fprintf(stderr,"parseCommentBlock position=%d [%s] needsEntry=%d\n",position,doc.data()+position,needsEntry); - if (needsEntry) addCurrentEntry(); + if (needsEntry) addCurrentEntry(0); } //fprintf(stderr,"parseCommentBlock position=%d [%s] needsEntry=%d\n",position,doc.data()+position,needsEntry); - if (needsEntry) addCurrentEntry(); + if (needsEntry) addCurrentEntry(0); } //---------------------------------------------------------------------------- diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 31c1a5b..85caa36 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -582,7 +582,8 @@ struct FTVNode : isLast(TRUE), isDir(dir),ref(r),file(f),anchor(a),name(n), index(0), parent(0), separateIndex(sepIndex), addToNavIndex(navIndex), def(df) { children.setAutoDelete(TRUE); } - int computeTreeDepth(int level); + int computeTreeDepth(int level) const; + int numNodesAtLevel(int level,int maxLevel) const; bool isLast; bool isDir; QCString ref; @@ -597,7 +598,7 @@ struct FTVNode Definition *def; }; -int FTVNode::computeTreeDepth(int level) +int FTVNode::computeTreeDepth(int level) const { int maxDepth=level; QListIterator<FTVNode> li(children); @@ -613,6 +614,22 @@ int FTVNode::computeTreeDepth(int level) return maxDepth; } +int FTVNode::numNodesAtLevel(int level,int maxLevel) const +{ + int num=0; + if (level<maxLevel) + { + num++; // this node + QListIterator<FTVNode> li(children); + FTVNode *n; + for (;(n=li.current());++li) + { + num+=n->numNodesAtLevel(level+1,maxLevel); + } + } + return num; +} + //---------------------------------------------------------------------------- /*! Constructs an ftv help object. @@ -753,11 +770,11 @@ QCString FTVHelp::generateIndentLabel(FTVNode *n,int level) return result; } -void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,int level) +void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,int level, bool opened) { if (n->parent) { - generateIndent(t,n->parent,level+1); + generateIndent(t,n->parent,level+1,opened); } // from the root up to node n do... if (level==0) // item before a dir or document @@ -767,8 +784,12 @@ void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,int level) if (n->isDir) { t << "<img id=\"arr_" << generateIndentLabel(n,0) - << "\" " << FTV_IMGATTRIBS(mlastnode) - << "onclick=\"toggleFolder('" + << "\" "; + if (opened) + t << FTV_IMGATTRIBS(mlastnode); + else + t << FTV_IMGATTRIBS(plastnode); + t << "onclick=\"toggleFolder('" << generateIndentLabel(n,0) << "')\"/>"; } @@ -782,8 +803,12 @@ void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,int level) if (n->isDir) { t << "<img id=\"arr_" << generateIndentLabel(n,0) - << "\" " << FTV_IMGATTRIBS(mnode) - << "onclick=\"toggleFolder('" + << "\" "; + if (opened) + t << FTV_IMGATTRIBS(mnode); + else + t << FTV_IMGATTRIBS(pnode); + t << "onclick=\"toggleFolder('" << generateIndentLabel(n,0) << "')\"/>"; } @@ -856,25 +881,31 @@ static void generateBriefDoc(FTextStream &t,Definition *def) } } -void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int &index) +void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int maxLevel,int &index) { - //QCString spaces; - //spaces.fill(' ',level*2+8); QListIterator<FTVNode> nli(nl); FTVNode *n; for (nli.toFirst();(n=nli.current());++nli) { - //t << spaces << "<p>"; t << "<tr id=\"row_" << generateIndentLabel(n,0) << "\""; - if ((index&1)==0) t << " class=\"even\""; + if ((index&1)==0) // even row + t << " class=\"even\""; + if (level>=maxLevel) // item invisible by default + t << " style=\"display:none;\""; + else // item visible by default + index++; t << "><td class=\"entry\">"; - index++; - generateIndent(t,n,0); + bool nodeOpened = level+1<maxLevel; + generateIndent(t,n,0,nodeOpened); if (n->isDir) { 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<FTVNode> &nl,int level,in { t << "<img "; t << "id=\"img_" << generateIndentLabel(n,0) - << "\" " << FTV_IMGATTRIBS(folderopen) << "onclick=\"toggleFolder('" + << "\" "; + if (nodeOpened) + t << FTV_IMGATTRIBS(folderopen); + else + t << FTV_IMGATTRIBS(folderclosed); + t << "onclick=\"toggleFolder('" << generateIndentLabel(n,0) << "')\""; t << "/>"; } generateLink(t,n); - //t << "</p>\n"; - //t << spaces << "<div id=\"folder" << folderId << "\">\n"; t << "</td><td class=\"desc\">"; if (n->def) { @@ -907,10 +941,9 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in } t << "</td></tr>" << endl; folderId++; - generateTree(t,n->children,level+1,index); - //t << spaces << "</div>\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<FTVNode> &nl,int level,in } if (n->def && n->def->definitionType()==Definition::TypeGroup) { - //t << "<img "; - //t << FTV_IMGATTRIBS(mo); - //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<FTVNode> &nl,int level,in t << FTV_IMGATTRIBS(doc); t << "/>"; } - //t << "</p>\n"; if (srcRef) { t << "</a>"; @@ -966,14 +1000,35 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &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<NavIndexEntry> +{ + public: + NavIndexEntryList() : QList<NavIndexEntry>() { 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<FTVNode> &nl,int level,bool &first) +static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t, + const QList<FTVNode> &nl,int level,bool &first) { QCString indentStr; indentStr.fill(' ',level*2); @@ -1019,11 +1074,9 @@ static bool generateJSTree(FTextStream &tidx,FTextStream &t, const QList<FTVNode } found=TRUE; - if (n->addToNavIndex) + 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<FTVNode int i=fileId.findRev('/'); if (i>=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 QList<FTVNode bool firstChild=TRUE; t << indentStr << " [ "; generateJSLink(t,n); - bool emptySection = !generateJSTree(tidx,t,n->children,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<FTVNode> &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<FTVNode> &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<FTVNode> &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<NavIndexEntry> 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 << "<div class=\"directory\">\n"; - QListIterator<FTVNode> 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 << "<div class=\"levels\">["; @@ -1184,18 +1284,38 @@ void FTVHelp::generateTreeViewInline(FTextStream &t) t << "<span onclick=\"javascript:toggleLevel(" << i << ");\">" << i << "</span>"; } t << "]</div>"; + + if (preferredNumEntries>0) + { + preferredDepth=1; + for (int i=1;i<=depth;i++) + { + int num=0; + QListIterator<FTVNode> 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 << " <br/>\n"; -// t << " <div style=\"display: block;\">\n"; t << "<table class=\"directory\">\n"; - int index=0; - generateTree(t,m_indentNodes[0],0,index); - + generateTree(t,m_indentNodes[0],0,preferredDepth,index); t << "</table>\n"; -// t << " </div>\n"; - t << "</div>\n"; + + t << "</div><!-- directory -->\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<FTVNode> &nl,int level,int &index); + void generateTree(FTextStream &t,const QList<FTVNode> &nl,int level,int maxLevel,int &index); //bool generateJSTree(FTextStream &tidx,FTextStream &t,const QList<FTVNode> &nl,int level,bool &first); //bool generateJSTreeTopLevel(FTextStream &tidx,FTextStream &t,const QList<FTVNode> &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<FTVNode> *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 <<*/ "<pre class=\"fragment\">"; filter(s->text()); - m_t << PREFRAG_END; + m_t << "</pre>" /*<< 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 <<*/ "<pre class=\"fragment\">"; filter(inc->text()); - m_t << PREFRAG_END; + m_t << "</pre>" /*<< 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 << "<center><span class=\"legend\">["; 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, << "</td></tr>" << endl; } +void HtmlGenerator::startCodeLine(bool hasLineNumbers) +{ + if (!hasLineNumbers) t << "<div class=\"line\">"; + col=0; +} + +void HtmlGenerator::endCodeLine() +{ + //codify("\n"); + t << "</div>\n"; +} + +void HtmlGenerator::startCodeAnchor(const char *label) +{ + t << "<div class=\"line\">"; + t << "<a name=\"" << label << "\"></a><span class=\"lineno\">"; +} + +void HtmlGenerator::endCodeAnchor() +{ + t << "</span>"; +} + +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 "<div class=\"fragment\"><pre class=\"fragment\">" -#define PREFRAG_END "</pre></div>" +//#define PREFRAG_START "<div class=\"fragment\"><pre class=\"fragment\">" +//#define PREFRAG_END "</pre></div>" +#define PREFRAG_START "<div class=\"fragment\">" +#define PREFRAG_END "</div><!-- fragment -->" 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 << "<em>"; } void endEmphasis() { t << "</em>"; } void startBold() { t << "<b>"; } @@ -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 << "<a name=\"" << label << "\"></a>"; } - 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("</div><!-- doc-content -->\n"); + ol.popGeneratorState(); navPath = d->navigationPathAsString(); } endFile(ol,generateTreeView,TRUE,navPath); @@ -300,6 +303,7 @@ template<class T> 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<class T> 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<DirDef>::Iterator dli(*Doxygen::directories); - DirDef *dd; - for (dli.toFirst();(dd=dli.current());++dli) + if (fullPathNames) { - if (dd->getOuterScope()==Doxygen::globalScope) + SDict<DirDef>::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]==' ') i++; // test of level 1 header if (data[i]=='=') { - while (i<size && data[i]=='=') i++; + while (i<size && data[i]=='=') i++,c++; while (i<size && data[i]==' ') i++; - return (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]=='-') i++; + while (i<size && data[i]=='-') i++,c++; while (i<size && data[i]==' ') i++; - return (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<size) { // find end of this line @@ -1724,12 +1725,17 @@ static int writeCodeBlock(GrowBuf &out,const char *data,int size,int refIndent) //printf("j=%d end=%d indent=%d refIndent=%d data={%s}\n",j,end,indent,refIndent,QCString(data+i).left(end-i-1).data()); if (j==end-1) // empty line { - // add empty line - out.addStr("\n"); + emptyLines++; i=end; } else if (indent>=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<MemberList> MemberDef::reimplementedBy() const return LockingPtr<MemberList>(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,6 +1869,295 @@ void MemberDef::_getLabels(QStrList &sl,Definition *container) const } } +void MemberDef::_writeCallGraph(OutputList &ol) +{ + // write call graph + if ((m_impl->hasCallGraph || Config_getBool("CALL_GRAPH")) + && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") + ) + { + DotCallGraph callGraph(this,FALSE); + if (callGraph.isTooBig()) + { + err("warning: Call graph for '%s' not generated, too many nodes. Consider increasing DOT_GRAPH_MAX_NODES.\n",qPrint(qualifiedName())); + } + else if (!callGraph.isTrivial()) + { + 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(); + } + } +} + +void MemberDef::_writeCallerGraph(OutputList &ol) +{ + if ((m_impl->hasCallerGraph || Config_getBool("CALLER_GRAPH")) + && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") + ) + { + DotCallGraph callerGraph(this, TRUE); + if (callerGraph.isTooBig()) + { + 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(); + } + } +} + +void MemberDef::_writeReimplements(OutputList &ol) +{ + 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(); + } + } +} + +void MemberDef::_writeReimplementedBy(OutputList &ol) +{ + LockingPtr<MemberList> 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(); + } + } +} + +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<MemberList> 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. */ @@ -1933,9 +2244,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.pushGeneratorState(); + bool htmlEndLabelTable=FALSE; QStrList sl; _getLabels(sl,container); - bool htmlEndLabelTable=FALSE; if ((isVariable() || isTypedef()) && (i=r.match(ldef,0,&l))!=-1) { @@ -1949,9 +2260,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, { ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef.left(i)); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.left(i)); vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef()); - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef.right(ldef.length()-i-l)); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-i-l)); found=TRUE; } @@ -1976,10 +2287,10 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, // 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)); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),this,ldef.right(ldef.length()-ei)); } } - else // not an enum value + else // not an enum value or anonymous compound { ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); ol.startMemberDoc(ciname,name(),memAnchor,title,showInline); @@ -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<maxInitLines && userInitLines==-1) // implicitly enabled @@ -2278,269 +2588,17 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } - // For enum, we also write the documented enum values - if (isEnumerate()) - { - bool first=TRUE; - LockingPtr<MemberList> 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<MemberList> 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<ListItemInfo> *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<MemberDef> 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<MemberDef> 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():"<global>"); //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; @@ -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 << "<codeline"; @@ -770,7 +770,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De QCString typeStr = md->typeString(); //replaceAnonymousScopes(md->typeString()); stripQualifiers(typeStr); t << " <type>"; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),typeStr); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,typeStr); t << "</type>" << endl; t << " <definition>" << convertToXML(md->definition()) << "</definition>" << endl; t << " <argsstring>" << convertToXML(md->argsString()) << "</argsstring>" << endl; @@ -833,7 +833,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (!a->type.isEmpty()) { t << " <type>"; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->type); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a->type); t << "</type>" << endl; } if (!a->name.isEmpty()) @@ -857,7 +857,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (!a->defval.isEmpty()) { t << " <defval>"; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),a->defval); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,a->defval); t << "</defval>" << 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 << " <initializer>"; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->initializer()); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->initializer()); t << "</initializer>" << endl; } if (md->excpString()) { t << " <exceptions>"; - linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md->name(),md->excpString()); + linkifyText(TextGeneratorXMLImpl(t),def,md->getBodyDef(),md,md->excpString()); t << "</exceptions>" << endl; } |