diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-09-23 17:28:38 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-09-23 17:28:38 (GMT) |
commit | 86502f97ecaea3254217d723b5f10b6405495184 (patch) | |
tree | 66859557d84fe96d692e8d6ee0a72d639a25b283 /src | |
parent | 4ce0e4344711a79781e2f6d64f2553ab4b45c4a5 (diff) | |
download | Doxygen-86502f97ecaea3254217d723b5f10b6405495184.zip Doxygen-86502f97ecaea3254217d723b5f10b6405495184.tar.gz Doxygen-86502f97ecaea3254217d723b5f10b6405495184.tar.bz2 |
Release-1.2.10-20010923
Diffstat (limited to 'src')
-rw-r--r-- | src/bufstr.h | 8 | ||||
-rw-r--r-- | src/classdef.cpp | 11 | ||||
-rw-r--r-- | src/code.l | 7 | ||||
-rw-r--r-- | src/diagram.cpp | 4 | ||||
-rw-r--r-- | src/dot.cpp | 6 | ||||
-rw-r--r-- | src/doxygen.cpp | 6 | ||||
-rw-r--r-- | src/htmlgen.cpp | 37 | ||||
-rw-r--r-- | src/htmlgen.h | 6 | ||||
-rw-r--r-- | src/image.cpp | 2 | ||||
-rw-r--r-- | src/image.h | 1 | ||||
-rw-r--r-- | src/index.cpp | 105 | ||||
-rw-r--r-- | src/latexgen.cpp | 22 | ||||
-rw-r--r-- | src/latexgen.h | 4 | ||||
-rw-r--r-- | src/mangen.h | 4 | ||||
-rw-r--r-- | src/memberdef.cpp | 11 | ||||
-rw-r--r-- | src/memberdef.h | 5 | ||||
-rw-r--r-- | src/outputgen.h | 4 | ||||
-rw-r--r-- | src/outputlist.h | 8 | ||||
-rw-r--r-- | src/rtfgen.cpp | 46 | ||||
-rw-r--r-- | src/rtfgen.h | 6 | ||||
-rw-r--r-- | src/scanner.l | 63 | ||||
-rw-r--r-- | src/util.cpp | 2 | ||||
-rw-r--r-- | src/xmlgen.cpp | 15 |
23 files changed, 255 insertions, 128 deletions
diff --git a/src/bufstr.h b/src/bufstr.h index 576dac7..550ec4d 100644 --- a/src/bufstr.h +++ b/src/bufstr.h @@ -53,6 +53,14 @@ class BufStr : public QCString } offset+=s; } + void resize( uint newlen ) + { + QCString::resize(newlen); + if (offset>newlen) + { + offset=newlen; + } + } private: uint offset; const int spareRoom; // 10Kb extra room to avoid frequent resizing diff --git a/src/classdef.cpp b/src/classdef.cpp index cb453ec..59a53d7 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -700,6 +700,7 @@ void ClassDef::writeDocumentation(OutputList &ol) //printf("Class %s brief=`%s' doc=`%s'\n",name().data(),briefDescription().data(),documentation().data()); + bool exampleFlag=hasExamples(); // write brief description OutputList briefOutput(&ol); if (!briefDescription().isEmpty()) @@ -710,7 +711,14 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); ol.startTextLink(0,"_details"); - parseText(ol,theTranslator->trMore()); + + if (Config_getBool("REPEAT_BRIEF") || + !documentation().isEmpty() || + exampleFlag + ) + { + parseText(ol,theTranslator->trMore()); + } ol.endTextLink(); ol.popGeneratorState(); ol.disable(OutputGenerator::Man); @@ -1032,7 +1040,6 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.endMemberSections(); // write detailed description - bool exampleFlag=hasExamples(); if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || !documentation().isEmpty() || /*(Config_getBool("SOURCE_BROWSER") && startBodyLine!=-1 && bodyDef) ||*/ @@ -228,9 +228,10 @@ static void startCodeLine() } +static void endFontClass(); static void endCodeLine() { - if (g_currentFontClass) { g_code->endFontClass(); } + endFontClass(); g_code->endCodeLine(); } @@ -1720,6 +1721,10 @@ void parseCode(OutputDocInterface &od,const char *className,const QCString &s, BEGIN( Body ); codeYYlex(); endFontClass(); + if (g_inputLines==1) + { + g_code->endCodeLine(); + } od.append(g_code); delete g_code; return; diff --git a/src/diagram.cpp b/src/diagram.cpp index e50766e..9b82bd4 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -126,7 +126,7 @@ static void writeBitmapBox(DiagramItem *di,Image *image, { int colFill = hasDocs ? (firstRow ? 0 : 2) : 7; int colBorder = (firstRow || !hasDocs) ? 1 : 3; - int l = stringLength(di->label()); + int l = Image::stringLength(di->label()); uint mask=virtToMask(di->virtualness()); image->fillRect(x+1,y+1,w-2,h-2,colFill,mask); image->drawRect(x,y,w,h,colBorder,mask); @@ -463,7 +463,7 @@ void TreeDiagram::computeExtremes(uint *maxLabelLen,uint *maxXPos) { if (di->isInList()) done=TRUE; if (maxXPos) mx=QMAX(mx,(uint)di->xPos()); - if (maxLabelLen) ml=QMAX(ml,stringLength(di->label())); + if (maxLabelLen) ml=QMAX(ml,Image::stringLength(di->label())); di=dr->next(); } dr=next(); diff --git a/src/dot.cpp b/src/dot.cpp index 4e43b2d..1b1bc96 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -431,7 +431,7 @@ void DotNode::write(QTextStream &t, void DotNode::writeXML(QTextStream &t) { t << " <node id=\"" << m_number << "\">" << endl; - t << " <label>" << m_label << "</label>" << endl; + t << " <label>" << convertToXML(m_label) << "</label>" << endl; if (!m_url.isEmpty()) { QCString url(m_url); @@ -475,12 +475,12 @@ void DotNode::writeXML(QTextStream &t) while ((ni=edgeInfo->m_label.find("\\n",p))!=-1) { t << " <edgelabel>" - << edgeInfo->m_label.mid(p,ni-p) + << convertToXML(edgeInfo->m_label.mid(p,ni-p)) << "</edgelabel>" << endl; p=ni+2; } t << " <edgelabel>" - << edgeInfo->m_label.right(edgeInfo->m_label.length()-p) + << convertToXML(edgeInfo->m_label.right(edgeInfo->m_label.length()-p)) << "</edgelabel>" << endl; } t << " </childnode>" << endl; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index d6c5911..f350cc8 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1281,13 +1281,14 @@ static MemberDef *addVariableToClass( { Debug::print(Debug::Variables,0, " class variable:\n" - " %s' %s'::`%s' `%s' prot=`%d ann=%d\n", + " %s' %s'::`%s' `%s' prot=`%d ann=%d init=%s\n", root->type.data(), scope.data(), name.data(), root->args.data(), root->protection, - fromAnnScope + fromAnnScope, + root->initializer.data() ); // class friends may be templatized @@ -6132,6 +6133,7 @@ static void copyAndFilterFile(const char *fileName,BufStr &dest) for (i=0;i<size;i++,p++) *p=conv[*p]; // and translate CR's int newSize=filterCRLF(dest.data()+oldPos,size); + //printf("filter char at %p size=%d newSize=%d\n",dest.data()+oldPos,size,newSize); if (newSize!=size) // we removed chars { dest.resize(newSize); // resize the array diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 2320473..286b35d 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -49,8 +49,8 @@ static const char *defaultStyleSheet = "DIV.fragment { width: 100%; border: none; background-color: #eeeeee }\n" "DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }\n" "TD.md { background-color: #f2f2ff; font-weight: bold; }\n" - "TD.mdname1 { background-color: #f2f2ff; font-weight: bold; font-style: italic; }\n" - "TD.mdname { background-color: #f2f2ff; font-weight: bold; font-style: italic; width: 600px; }\n" + "TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }\n" + "TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }\n" "DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }\n" "DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }\n" "FONT.keyword { color: #008000 }\n" @@ -801,21 +801,32 @@ void HtmlGenerator::endMemberSubtitle() void HtmlGenerator::startIndexList() { - t << "<ul>" << endl; - //if (Config_getBool("GENERATE_HTMLHELP")) - //{ - // if (htmlHelp->depth()==0) htmlHelp->addItem(lastTitle,lastFile); - // htmlHelp->incDepth(); - //} + t << "<table>" << endl; } void HtmlGenerator::endIndexList() { - t << "</ul>" << endl; - //if (Config_getBool("GENERATE_HTMLHELP")) - //{ - // htmlHelp->decDepth(); - //} + t << "</table>" << endl; +} + +void HtmlGenerator::startIndexKey() +{ + t << " <tr bgcolor=\"#f0f0f0\"><td>"; +} + +void HtmlGenerator::endIndexKey() +{ + t << "</td>"; +} + +void HtmlGenerator::startIndexValue() +{ + t << "<td>"; +} + +void HtmlGenerator::endIndexValue(const char *) +{ + t << "</td></tr>" << endl; } void HtmlGenerator::startAlphabeticalIndexList() diff --git a/src/htmlgen.h b/src/htmlgen.h index caed87f..c220473 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -66,6 +66,10 @@ class HtmlGenerator : public OutputGenerator void writeString(const char *text); void startIndexList(); void endIndexList(); + void startIndexKey(); + void endIndexKey(); + void startIndexValue(); + void endIndexValue(const char *); void startItemList() { t << "<ul>" << endl; } void endItemList() { t << "</ul>" << endl; } void startEnumList() { t << "<ol>" << endl; } @@ -215,7 +219,7 @@ class HtmlGenerator : public OutputGenerator void startDescTableTitle() { t << "<tr><td valign=top><em>"; } void endDescTableTitle() - { t << endl << "</em> </td>"; } + { t << "</em> </td>"; } void startDescTableData() { t << "<td>" << endl; } void endDescTableData() diff --git a/src/image.cpp b/src/image.cpp index ccfa65f..bbbcfc8 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -250,7 +250,7 @@ void Image::writeString(int x,int y,const char *s,uchar fg) } } -uint stringLength(const char *s) +uint Image::stringLength(const char *s) { int w=0; if (s) diff --git a/src/image.h b/src/image.h index 178996b..8cd1e65 100644 --- a/src/image.h +++ b/src/image.h @@ -41,6 +41,7 @@ class Image uint getWidth() const { return width; } uint getHeight() const { return height; } uchar *getData() const { return data; } + static uint stringLength(const char *s); private: int width; diff --git a/src/index.cpp b/src/index.cpp index 5124dd9..79cc8cc 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -347,7 +347,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper) { if (!started) { - ol.startIndexList(); + ol.startItemList(); if (hasHtmlHelp) htmlHelp->incContentsDepth(); if (hasFtvHelp) ftvHelp->incContentsDepth(); started=TRUE; @@ -396,7 +396,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper) } if (started) { - ol.endIndexList(); + ol.endItemList(); if (hasHtmlHelp) htmlHelp->decContentsDepth(); if (hasFtvHelp) ftvHelp->decContentsDepth(); } @@ -550,7 +550,7 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started) { if (!started) { - ol.startIndexList(); + ol.startItemList(); if (hasHtmlHelp) htmlHelp->incContentsDepth(); if (hasFtvHelp) ftvHelp->incContentsDepth(); started=TRUE; @@ -621,7 +621,7 @@ void writeClassHierarchy(OutputList &ol) writeClassTreeForList(ol,&Doxygen::hiddenClasses,started); if (started) { - ol.endIndexList(); + ol.endItemList(); if (hasHtmlHelp) htmlHelp->decContentsDepth(); if (hasFtvHelp) ftvHelp->decContentsDepth(); } @@ -875,6 +875,7 @@ void writeFileIndex(OutputList &ol) if (!path.isEmpty()) fullName.prepend(path+"/"); // --------------- LaTeX/RTF only ------------------------- +#if 0 if (doc) { ol.pushGeneratorState(); @@ -887,22 +888,22 @@ void writeFileIndex(OutputList &ol) if (!fd->briefDescription().isEmpty()) { ol.docify(" ("); - OutputList briefOutput(&ol); - parseDoc(briefOutput,fd->absFilePath(),1, + parseDoc(ol,fd->absFilePath(),1, 0,0, abbreviate(fd->briefDescription(),fd->name())); - ol+=briefOutput; ol.docify(")"); } ol.writeEndAnnoItem(fd->getOutputFileBase()); ol.popGeneratorState(); } +#endif // -------------------------------------------------------- // ----------------- HTML only ---------------------------- - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - ol.writeListItem(); + //ol.pushGeneratorState(); + //ol.disableAllBut(OutputGenerator::Html); + //ol.writeListItem(); + ol.startIndexKey(); ol.docify(path); if (doc) { @@ -932,25 +933,29 @@ void writeFileIndex(OutputList &ol) } if (src) { + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); ol.docify(" "); ol.startTextLink(fd->includeName(),0); ol.docify("["); parseText(ol,theTranslator->trCode()); ol.docify("]"); ol.endTextLink(); + ol.popGeneratorState(); } + ol.endIndexKey(); + ol.startIndexValue(); if (!fd->briefDescription().isEmpty()) { - ol.docify(" ("); - OutputList briefOutput(&ol); - parseDoc(briefOutput, + //ol.docify(" ("); + parseDoc(ol, fd->absFilePath(),1, 0,0, abbreviate(fd->briefDescription(),fd->name())); - ol+=briefOutput; - ol.docify(")"); + //ol.docify(")"); } - ol.popGeneratorState(); + ol.endIndexValue(fd->getOutputFileBase()); + //ol.popGeneratorState(); // -------------------------------------------------------- } fd=fl->next(); @@ -1039,19 +1044,22 @@ void writeNamespaceIndex(OutputList &ol) ol.startIndexList(); first=FALSE; } - ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name()); + //ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name()); + ol.startIndexKey(); + ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->name()); + ol.endIndexKey(); + ol.startIndexValue(); if (!nd->briefDescription().isEmpty()) { - ol.docify(" ("); - OutputList briefOutput(&ol); - parseDoc(briefOutput, + //ol.docify(" ("); + parseDoc(ol, nd->getDefFileName(),nd->getDefLine(), nd->name(),0, abbreviate(nd->briefDescription(),nd->name())); - ol+=briefOutput; - ol.docify(")"); + //ol.docify(")"); } - ol.writeEndAnnoItem(nd->getOutputFileBase()); + ol.endIndexValue(nd->getOutputFileBase()); + //ol.writeEndAnnoItem(nd->getOutputFileBase()); if (hasHtmlHelp) { htmlHelp->addContentsItem(FALSE,nd->name(),nd->getOutputFileBase()); @@ -1112,19 +1120,22 @@ void writeAnnotatedClassList(OutputList &ol) if (cd->isLinkableInProject() && cd->templateMaster()==0) { QCString type=cd->compoundTypeString(); - ol.writeStartAnnoItem(type,cd->getOutputFileBase(),0,cd->displayName()); + //ol.writeStartAnnoItem(type,cd->getOutputFileBase(),0,cd->displayName()); + ol.startIndexKey(); + ol.writeObjectLink(0,cd->getOutputFileBase(),0,cd->displayName()); + ol.endIndexKey(); + ol.startIndexValue(); if (!cd->briefDescription().isEmpty()) { - ol.docify(" ("); - OutputList briefOutput(&ol); - parseDoc(briefOutput, + //ol.docify(" ("); + parseDoc(ol, cd->getDefFileName(),cd->getDefLine(), cd->name(),0, abbreviate(cd->briefDescription(),cd->name())); - ol+=briefOutput; - ol.docify(")"); + //ol.docify(")"); } - ol.writeEndAnnoItem(cd->getOutputFileBase()); + ol.endIndexValue(cd->getOutputFileBase()); + //ol.writeEndAnnoItem(cd->getOutputFileBase()); if (hasHtmlHelp) { HtmlHelp::getInstance()->addContentsItem(FALSE,cd->name(),cd->getOutputFileBase()); @@ -1152,19 +1163,23 @@ void writePackageList(OutputList &ol) { if (!pd->isReference()) { - ol.writeStartAnnoItem("package",pd->getOutputFileBase(),0,pd->name()); + //ol.writeStartAnnoItem("package",pd->getOutputFileBase(),0,pd->name()); + ol.startIndexKey(); + ol.writeObjectLink(0,pd->getOutputFileBase(),0,pd->name()); + ol.endIndexKey(); + ol.startIndexValue(); if (!pd->briefDescription().isEmpty()) { - ol.docify(" ("); - OutputList briefOutput(&ol); - parseDoc(briefOutput, + //ol.docify(" ("); + parseDoc(ol, pd->getDefFileName(),pd->getDefLine(), pd->name(),0, abbreviate(pd->briefDescription(),pd->name())); - ol+=briefOutput; - ol.docify(")"); + //ol.docify(")"); } - ol.writeEndAnnoItem(pd->getOutputFileBase()); + ol.endIndexValue(pd->getOutputFileBase()); + + //ol.writeEndAnnoItem(pd->getOutputFileBase()); if (hasHtmlHelp) { HtmlHelp::getInstance()->addContentsItem(FALSE,pd->name(),pd->getOutputFileBase()); @@ -1967,7 +1982,7 @@ void writeExampleIndex(OutputList &ol) parseText(ol,theTranslator->trExamplesDescription()); //ol.newParagraph(); ol.endTextBlock(); - ol.startIndexList(); + ol.startItemList(); PageSDictIterator pdi(*Doxygen::exampleSDict); PageInfo *pi=0; for (pdi.toFirst();(pi=pdi.current());++pdi) @@ -1988,7 +2003,7 @@ void writeExampleIndex(OutputList &ol) } ol.writeString("\n"); } - ol.endIndexList(); + ol.endItemList(); if (hasHtmlHelp) { htmlHelp->decContentsDepth(); @@ -2071,7 +2086,7 @@ void writePageIndex(OutputList &ol) parseText(ol,theTranslator->trRelatedPagesDescription()); //ol.newParagraph(); ol.endTextBlock(); - ol.startIndexList(); + ol.startItemList(); PageSDictIterator pdi(*Doxygen::pageSDict); PageInfo *pi=0; for (pdi.toFirst();(pi=pdi.current());++pdi) @@ -2105,7 +2120,7 @@ void writePageIndex(OutputList &ol) if (hasFtvHelp) ftvHelp->addContentsItem(FALSE,0,pageName,0,pageTitle); } } - ol.endIndexList(); + ol.endItemList(); if (hasHtmlHelp) { htmlHelp->decContentsDepth(); @@ -2258,12 +2273,12 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel) // write subgroups if (hasSubGroups) { - ol.startIndexList(); + ol.startItemList(); for (gli.toLast();(subgd=gli.current());--gli) { writeGroupTreeNode(ol,subgd,TRUE); } - ol.endIndexList(); + ol.endItemList(); } @@ -2463,14 +2478,14 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel) void writeGroupHierarchy(OutputList &ol) { - ol.startIndexList(); + ol.startItemList(); GroupListIterator gli(Doxygen::groupList); GroupDef *gd; for (;(gd=gli.current());++gli) { writeGroupTreeNode(ol,gd,FALSE); } - ol.endIndexList(); + ol.endItemList(); } //---------------------------------------------------------------------------- diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 7bdfbdf..d310ea3 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -906,6 +906,26 @@ void LatexGenerator::writeEndAnnoItem(const char *name) t << "}{\\pageref{" << name << "}}{}" << endl; } +void LatexGenerator::startIndexKey() +{ + t << "\\item\\contentsline{section}{"; +} + +void LatexGenerator::endIndexKey() +{ +} + +void LatexGenerator::startIndexValue() +{ + t << " ("; +} + +void LatexGenerator::endIndexValue(const char *name) +{ + t << ")"; + t << "}{\\pageref{" << name << "}}{}" << endl; +} + //void LatexGenerator::writeClassLink(const char *,const char *, // const char *,const char *name) //{ @@ -1530,7 +1550,7 @@ void LatexGenerator::startImage(const char *name,const char *size,bool hasCaptio { if (hasCaption) { - t << "\\begin{figure}[h]" << endl; + t << "\\begin{figure}[H]" << endl; t << "\\begin{center}" << endl; } else diff --git a/src/latexgen.h b/src/latexgen.h index bf3e530..802542a 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -63,6 +63,10 @@ class LatexGenerator : public OutputGenerator void writeString(const char *text); void startIndexList() { t << "\\begin{CompactList}" << endl; } void endIndexList() { t << "\\end{CompactList}" << endl; } + void startIndexKey(); + void endIndexKey(); + void startIndexValue(); + void endIndexValue(const char *); void startItemList() { t << "\\begin{CompactItemize}" << endl; } void endItemList() { t << "\\end{CompactItemize}" << endl; } void startEnumList() { t << "\\begin{enumerate}" << endl; } diff --git a/src/mangen.h b/src/mangen.h index e87cbc7..6599c1e 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -61,6 +61,10 @@ class ManGenerator : public OutputGenerator void writeString(const char *text); void startIndexList() {} void endIndexList() { newParagraph(); } + void startIndexKey() {} + void endIndexKey() {} + void startIndexValue() {} + void endIndexValue(const char *) {} void startItemList() {} void endItemList() { newParagraph(); } void startEnumList() {} diff --git a/src/memberdef.cpp b/src/memberdef.cpp index afdcab6..5b58626 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -1653,6 +1653,8 @@ MemberDef *MemberDef::createTemplateInstanceMember( bool MemberDef::hasOneLineInitializer() const { + //printf("%s: init=%s, initLines=%d maxInitLines=%d userInitLines=%d\n", + // name().data(),init.data(),initLines,maxInitLines,userInitLines); return !init.isEmpty() && initLines==0 && // one line initializer ((maxInitLines>0 && userInitLines==-1) || userInitLines>0); // enabled by default or explicitly } @@ -1664,3 +1666,12 @@ bool MemberDef::hasMultiLineInitializer() const || initLines<userInitLines // explicitly enabled ); } + +void MemberDef::setInitializer(const char *initializer) +{ + init=initializer; + int p=init.length()-1; + while (p>=0 && isspace(init.at(p))) p--; + init=init.left(p+1); + initLines=init.contains('\n'); +} diff --git a/src/memberdef.h b/src/memberdef.h index 4af6f66..b734615 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -139,10 +139,7 @@ class MemberDef : public Definition void setProtection(Protection p) { prot=p; } void setMemberSpecifiers(int s) { memSpec=s; } void mergeMemberSpecifiers(int s) { memSpec|=s; } - void setInitializer(const char *i) { init=i; - //init=init.stripWhiteSpace(); - initLines=init.contains('\n'); - } + void setInitializer(const char *i); void setBitfields(const char *s) { bitfields = s; } void setMaxInitLines(int lines) { userInitLines=lines; } void setMemberClass(ClassDef *cd); diff --git a/src/outputgen.h b/src/outputgen.h index 15cab68..dbc2351 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -314,6 +314,10 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endTitleHead(const char *fileName,const char *name) = 0; virtual void startIndexList() = 0; virtual void endIndexList() = 0; + virtual void startIndexKey() = 0; + virtual void endIndexKey() = 0; + virtual void startIndexValue() = 0; + virtual void endIndexValue(const char *) = 0; virtual void startAlphabeticalIndexList() = 0; virtual void endAlphabeticalIndexList() = 0; virtual void writeIndexHeading(const char *s) = 0; diff --git a/src/outputlist.h b/src/outputlist.h index 8583e56..625c7a5 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -105,6 +105,14 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startIndexList); } void endIndexList() { forall(&OutputGenerator::endIndexList); } + void startIndexKey() + { forall(&OutputGenerator::startIndexKey); } + void endIndexKey() + { forall(&OutputGenerator::endIndexKey); } + void startIndexValue() + { forall(&OutputGenerator::startIndexValue); } + void endIndexValue(const char *name) + { forall(&OutputGenerator::endIndexValue,name); } void startItemList() { forall(&OutputGenerator::startItemList); } void endItemList() diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 1831072..5313f9b 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -877,6 +877,7 @@ void RTFGenerator::startFile(const char *name,const char *, void RTFGenerator::endFile() { + DBG_RTF(t << "{\\comment endFile}\n") t << "}"; endPlainFile(); @@ -1410,7 +1411,6 @@ void RTFGenerator::startItemList() t << "{"; incrementIndentLevel(); listItemInfo[m_listLevel].isEnum = FALSE; - //t << Rtf_Style_Reset << Rtf_BList_DepthStyle(); } /*! end bullet list */ @@ -1421,9 +1421,6 @@ void RTFGenerator::endItemList() t << "}"; decrementIndentLevel(); m_omitParagraph=TRUE; - //t << Rtf_Style_Reset << styleStack.top() << endl; - //printf("RTFGenerator::endItemList() `%s'\n",styleStack.top()); - //newParagraph(); } /*! start enumeration list */ @@ -1571,6 +1568,39 @@ void RTFGenerator::writeEndAnnoItem(const char *name) newParagraph(); } +void RTFGenerator::startIndexKey() +{ + DBG_RTF(t << "{\\comment (startIndexKey)}" << endl) + t << "{\\b "; +} + +void RTFGenerator::endIndexKey() +{ +} + +void RTFGenerator::startIndexValue() +{ + t << " ("; +} + +void RTFGenerator::endIndexValue(const char *name) +{ + DBG_RTF(t << "{\\comment (endIndexKey)}" << endl) + t << ")"; + t << "} "; + if (name) + { + t << "\\tab "; + WriteRTFReference(name); + t << endl; + } + else + { + t << endl; + } + newParagraph(); +} + void RTFGenerator::startSubsection() { //beginRTFSubSection(); @@ -1937,7 +1967,7 @@ void RTFGenerator::startDescList(SectionTypes) void RTFGenerator::endDescTitle() { DBG_RTF(t << "{\\comment (endDescTitle) }" << endl) - endBold(); + //endBold(); newParagraph(); //t << Rtf_Style_Reset << styleStack.top(); incrementIndentLevel(); @@ -1948,6 +1978,7 @@ void RTFGenerator::startParamList(ParamListTypes) { DBG_RTF(t << "{\\comment (startParamList)}" << endl) t << "{"; + incrementIndentLevel(); newParagraph(); } @@ -2182,6 +2213,7 @@ void RTFGenerator::endCodeFragment() //styleStack.pop(); //printf("RTFGenerator::endCodeFrament() top=%s\n",styleStack.top()); //t << Rtf_Style_Reset << styleStack.top() << endl; + DBG_RTF(t << "{\\comment (endCodeFragment) }" << endl) t << "}" << endl; m_omitParagraph = TRUE; } @@ -2382,8 +2414,8 @@ void RTFGenerator::startTextBlock(bool dense) void RTFGenerator::endTextBlock() { newParagraph(); - t << "}" << endl; DBG_RTF(t << "{\\comment End TextBlock}" << endl) + t << "}" << endl; m_omitParagraph = TRUE; } @@ -2395,12 +2427,14 @@ void RTFGenerator::newParagraph() void RTFGenerator::startMemberSubtitle() { + DBG_RTF(t << "{\\comment startMemberSubtitle}" << endl) t << "{" << endl; t << Rtf_Style_Reset << Rtf_CList_DepthStyle() << endl; } void RTFGenerator::endMemberSubtitle() { + DBG_RTF(t << "{\\comment endMemberSubtitle}" << endl) newParagraph(); t << "}" << endl; } diff --git a/src/rtfgen.h b/src/rtfgen.h index 5569328..b2971ad 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -58,12 +58,16 @@ class RTFGenerator : public OutputGenerator void startTitleHead(const char *); void startTitle(); void endTitleHead(const char *,const char *name); - void endTitle() {}; //{ t << "}"; } + void endTitle() {} void newParagraph(); void writeString(const char *text); void startIndexList(); void endIndexList(); + void startIndexKey(); + void endIndexKey(); + void startIndexValue(); + void endIndexValue(const char *); void startItemList(); void endItemList(); void startEnumList(); diff --git a/src/scanner.l b/src/scanner.l index 0088e9a..faa8f3c 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -235,12 +235,18 @@ static void lineCount() static void addType( Entry* current ) { - if( current->type.length() ) - current->type += ' ' ; + uint tl=current->type.length(); + if( tl>0 && !current->name.isEmpty() && current->type.at(tl-1)!='.') + { + current->type += ' ' ; + } current->type += current->name ; current->name.resize(0) ; - if( current->type.length() ) - current->type += ' ' ; + tl=current->type.length(); + if( tl>0 && !current->args.isEmpty() && current->type.at(tl-1)!='.') + { + current->type += ' ' ; + } current->type += current->args ; current->args.resize(0) ; current->argList->clear(); @@ -443,6 +449,7 @@ UL [uU][lL] OL [oO][lL] DL [dD][lL] TITLE [tT][iI][tT][lL][eE] +CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) %option noyywrap @@ -531,7 +538,6 @@ TITLE [tT][iI][tT][lL][eE] %x FileDocArg2 %x ExampleDoc %x ExampleDocArg1 -%x EnumDoc %x EnumDocArg1 %x FuncPtr %x EndFuncPtr @@ -633,9 +639,7 @@ TITLE [tT][iI][tT][lL][eE] BEGIN( FindMembers ); } } -<NextSemi>"'"\\[0-7]{1,3}"'" -<NextSemi>"'"\\."'" -<NextSemi>"'".{1,4}"'" +<NextSemi>{CHARLIT} <NextSemi>\" { lastStringContext=NextSemi; BEGIN(SkipString); @@ -1148,6 +1152,12 @@ TITLE [tT][iI][tT][lL][eE] BEGIN(FindMembers); } } +<FindMembers>"." { + if (insideJava) + { + current->name+="."; + } + } <FindMembers>"::" { current->name+=yytext; } @@ -1388,9 +1398,7 @@ TITLE [tT][iI][tT][lL][eE] initializerSharpCount--; current->initializer+=*yytext; } -<ReadInitializer>"'"\\[0-7]{1,3}"'" | -<ReadInitializer>"'"\\."'" | -<ReadInitializer>"'".{1,4}"'" { current->initializer+=yytext; } +<ReadInitializer>{CHARLIT} { current->initializer+=yytext; } <ReadInitializer>\n { current->initializer+=*yytext; yyLineNr++; @@ -1438,9 +1446,7 @@ TITLE [tT][iI][tT][lL][eE] yyLineNr++; *pCopyRoundString+=*yytext; } -<CopyRound>"'"\\[0-7]{1,3}"'" { *pCopyRoundString+=yytext; } -<CopyRound>"'"\\."'" { *pCopyRoundString+=yytext; } -<CopyRound>"'".{1,4}"'" { *pCopyRoundString+=yytext; } +<CopyRound>{CHARLIT} { *pCopyRoundString+=yytext; } <CopyRound>[^"'()\n]+ { *pCopyRoundString+=yytext; } @@ -1461,9 +1467,7 @@ TITLE [tT][iI][tT][lL][eE] if (--curlyCount<0) BEGIN(lastCurlyContext); } -<CopyCurly>"'"\\[0-7]{1,3}"'" { *pCopyCurlyString+=yytext; } -<CopyCurly>"'"\\."'" { *pCopyCurlyString+=yytext; } -<CopyCurly>"'".{1,4}"'" { *pCopyCurlyString+=yytext; } +<CopyCurly>{CHARLIT} { *pCopyCurlyString+=yytext; } <CopyCurly>[^"'{}\/\n]+ { *pCopyCurlyString+=yytext; } @@ -1623,9 +1627,7 @@ TITLE [tT][iI][tT][lL][eE] lastContext = ReadBody ; BEGIN( Comment ) ; } -<ReadBody>"'"\\[0-7]{1,3}"'" { current->program += yytext; } -<ReadBody>"'"\\."'" { current->program += yytext; } -<ReadBody>"'".{1,4}"'" { current->program += yytext; } +<ReadBody>{CHARLIT} { current->program += yytext; } <ReadBody>"{" { current->program += yytext ; ++curlyCount ; } @@ -2052,15 +2054,7 @@ TITLE [tT][iI][tT][lL][eE] fullArgString+=*yytext; BEGIN( lastCopyArgStringContext ); } -<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>"'"\\[0-7]{1,3}"'" { - *copyArgString+=yytext; - fullArgString+=yytext; - } -<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>"'"\\."'" { - *copyArgString+=yytext; - fullArgString+=yytext; - } -<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>"'".{1,4}"'" { +<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>{CHARLIT} { *copyArgString+=yytext; fullArgString+=yytext; } @@ -2294,13 +2288,7 @@ TITLE [tT][iI][tT][lL][eE] current = tempEntry; BEGIN( lastCurlyContext ); } -<SkipCurly>"'"\\[0-7]{1,3}"'" { - //addToBody(yytext); - } -<SkipCurly>"'"\\."'" { - //addToBody(yytext); - } -<SkipCurly>"'".{1,4}"'" { +<SkipCurly>{CHARLIT} { //addToBody(yytext); } <SkipCurly>\" { @@ -3321,6 +3309,9 @@ TITLE [tT][iI][tT][lL][eE] addSection(); BEGIN(PageDoc); } +<SectionTitle>[^\n*]* { + sectionTitle+=yytext; + } <SectionTitle>"*" { sectionTitle+=yytext; } diff --git a/src/util.cpp b/src/util.cpp index 5f54a61..764ab02 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -473,7 +473,7 @@ ClassDef *getResolvedClass( { // strip * and & from n int ip=subst.length()-1; - while (subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ') ip--; + while (ip>=0 && (subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ')) ip--; subst=subst.left(ip+1); if (pIsTypeDef) *pIsTypeDef=TRUE; diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index dfe19b9..f5f66ac 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -296,7 +296,6 @@ class XMLGenerator : public OutputDocInterface } void startCodeFragment() { - startParMode(); m_t << "<programlisting>"; } void endCodeFragment() @@ -305,7 +304,6 @@ class XMLGenerator : public OutputDocInterface } void startPreFragment() { - startParMode(); m_t << "<programlisting>"; } void endPreFragment() @@ -416,11 +414,10 @@ class XMLGenerator : public OutputDocInterface int i;for (i=0;i<num;i++) m_t << " "; } - //// TODO: translate these as well.... - void writeObjectLink(const char *ref,const char *file, const char *anchor, const char *text) { + startParMode(); writeXMLLink(m_t,ref,file,anchor,text); } void writeCodeLink(const char *ref,const char *file, @@ -748,13 +745,15 @@ void writeXMLDocBlock(QTextStream &t, const QCString &name, const QCString &text) { + if (text.stripWhiteSpace().isEmpty()) return; XMLGenerator *xmlGen = new XMLGenerator; + xmlGen->startParMode(); parseDoc(*xmlGen, fileName, // input definition file lineNr, // input definition line scope, // scope (which should not be linked to) name, // member (which should not be linked to) - text // actual text + text+"\n" // actual text ); xmlGen->endParMode(); t << xmlGen->getContents(); @@ -979,6 +978,7 @@ void generateXMLForClass(ClassDef *cd,QTextStream &t) // + standard member sections // + detailed member documentation + if (cd->isReference()) return; // skip external references. if (cd->name().find('@')!=-1) return; // skip anonymous compounds. if (cd->templateMaster()!=0) return; // skip generated template instances. t << " <compounddef id=\"" @@ -989,7 +989,6 @@ void generateXMLForClass(ClassDef *cd,QTextStream &t) t << "</compoundname>" << endl; if (cd->baseClasses()->count()>0) { - //t << " <basecompoundlist>" << endl; BaseClassListIterator bcli(*cd->baseClasses()); BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) @@ -1012,11 +1011,9 @@ void generateXMLForClass(ClassDef *cd,QTextStream &t) } t << "\"/>" << endl; } - //t << " </basecompoundlist>" << endl; } if (cd->subClasses()->count()>0) { - //t << " <derivedcompoundlist>" << endl; BaseClassListIterator bcli(*cd->subClasses()); BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) @@ -1039,7 +1036,6 @@ void generateXMLForClass(ClassDef *cd,QTextStream &t) } t << "\"/>" << endl; } - //t << " </derivedcompoundlist>" << endl; } int numMembers = cd->pubTypes.count()+cd->pubMembers.count()+cd->pubAttribs.count()+ @@ -1120,6 +1116,7 @@ void generateXMLFileSection(FileDef *fd,QTextStream &t,MemberList *ml,const char void generateXMLForFile(FileDef *fd,QTextStream &t) { + if (fd->isReference()) return; // skip external references t << " <compounddef id=\"" << fd->getOutputFileBase() << "\" kind=\"file\">" << endl; t << " <compoundname>"; |