diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2000-04-09 18:46:16 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2000-04-09 18:46:16 (GMT) |
commit | 0001e1e28b80b870b85b82b9f1cacfdb5cd834eb (patch) | |
tree | fd63e43b2dca7528a3a4ac6ae45bf46fb3fc0ea3 /src | |
parent | ba6357a253beeff03588578154bbc311bd986a47 (diff) | |
download | Doxygen-0001e1e28b80b870b85b82b9f1cacfdb5cd834eb.zip Doxygen-0001e1e28b80b870b85b82b9f1cacfdb5cd834eb.tar.gz Doxygen-0001e1e28b80b870b85b82b9f1cacfdb5cd834eb.tar.bz2 |
Release 1.1.2
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 12 | ||||
-rw-r--r-- | src/doxygen.cpp | 32 | ||||
-rw-r--r-- | src/htmlgen.cpp | 55 | ||||
-rw-r--r-- | src/htmlgen.h | 3 | ||||
-rw-r--r-- | src/latexgen.h | 2 | ||||
-rw-r--r-- | src/mangen.h | 2 | ||||
-rw-r--r-- | src/memberdef.cpp | 28 | ||||
-rw-r--r-- | src/memberlist.cpp | 21 | ||||
-rw-r--r-- | src/outputgen.cpp | 3 | ||||
-rw-r--r-- | src/outputgen.h | 3 | ||||
-rw-r--r-- | src/outputlist.h | 7 | ||||
-rw-r--r-- | src/qtbc.h | 4 | ||||
-rw-r--r-- | src/rtfgen.h | 3 | ||||
-rw-r--r-- | src/scanner.l | 14 |
14 files changed, 124 insertions, 65 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 3b73672..8055a76 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1649,19 +1649,19 @@ void ClassDef::determineImplUsageRelation() #ifdef DUMP if (usesClassDict) { - printf("Class %s uses the following classes:\n",name().data()); + msg("Class %s uses the following classes:\n",name().data()); UsesClassDictIterator ucdi(*usesClassDict); UsesClassDef *ucd; for (;(ucd=ucdi.current());++ucdi) { - printf(" %s via ",ucd->classDef->name().data()); + msg(" %s via ",ucd->classDef->name().data()); QDictIterator<void> dvi(*ucd->accessors); const char *s; for (;(s=dvi.currentKey());++dvi) { - printf("%s ",s); + msg("%s ",s); } - printf("\n"); + msg("\n"); } } #endif @@ -1697,8 +1697,8 @@ void ClassDef::addUsedInterfaceClasses(MemberDef *md,const char *typeStr) // name().data(),cd->name().data()); } ucd->addAccessor(md->name()); - printf("in class `%s' adding accessor `%s' to class `%s'\n", - name().data(),md->name().data(),ucd->classDef->name().data()); + //printf("in class `%s' adding accessor `%s' to class `%s'\n", + // name().data(),md->name().data(),ucd->classDef->name().data()); } p=i+l; } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index d53f327..98cccb4 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -358,7 +358,12 @@ static void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root) iName=iName.mid(1,iName.length()-2); // strip quotes or brackets } } - if (Config::verbatimHeaderFlag) // generate code for header + else // use name of the file containing the class definition + { + iName=fd->name(); + } + if (Config::verbatimHeaderFlag || Config::sourceBrowseFlag) + // generate code for header { cd->setIncludeFile(fd,iName,local); fd->setGenerateSource(TRUE); @@ -858,7 +863,7 @@ static MemberDef *addVariableToClass(Entry *root,ClassDef *cd, md->setFromAnnonymousMember(fromAnnMemb); md->setIndentDepth(indentDepth); md->setBodySegment(root->bodyLine,root->endBodyLine); - md->setInitializer(root->initializer); + md->setInitializer(root->initializer.simplifyWhiteSpace()); //if (root->mGrpId!=-1) //{ // printf("memberdef %s in memberGroup %d\n",name.data(),root->mGrpId); @@ -917,7 +922,7 @@ static MemberDef *addVariableToFile(Entry *root,MemberDef::MemberType mtype, md->setFromAnnonymousMember(fromAnnMemb); md->setIndentDepth(indentDepth); md->setBodySegment(root->bodyLine,root->endBodyLine); - md->setInitializer(root->initializer); + md->setInitializer(root->initializer.simplifyWhiteSpace()); bool ambig; FileDef *fd=findFileDef(&inputNameDict,root->fileName,ambig); md->setBodyDef(fd); @@ -1380,9 +1385,12 @@ void buildMemberList(Entry *root) MemberDef *md=mn->first(); while (md && !found) { - if (md->getFileDef() && - md->getFileDef()->absFilePath()==root->fileName && - matchArguments(md->argumentList(),root->argList) + NamespaceDef *nd = md->getNamespace(); + FileDef *fd = md->getFileDef(); + QCString nsName = nd ? nd->name().data() : ""; + //printf("namespace `%s'\n",nsName.data()); + if ((nd || (fd && fd->absFilePath()==root->fileName)) && + matchArguments(md->argumentList(),root->argList,0,nsName) ) { // function already found in the same file, one is probably @@ -2002,7 +2010,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, if (md->initializer().isEmpty() && !root->initializer.isEmpty()) { - md->setInitializer(root->initializer); + md->setInitializer(root->initializer.simplifyWhiteSpace()); } //if (md->bodyCode().isEmpty() && !root->body.isEmpty()) /* no body yet */ @@ -4419,8 +4427,11 @@ void copyAndFilterFile(const char *fileName,BufStr &dest) const int bufSize=1024; char buf[bufSize]; int numRead; - while ((numRead=fread(buf,1,bufSize,f))!=bufSize) + while ((numRead=fread(buf,1,bufSize,f))>0) + { + //printf(">>>>>>>>Reading %d bytes\n",numRead); dest.addArray(buf,numRead),size+=numRead; + } pclose(f); } // filter unwanted bytes from the resulting data @@ -4761,7 +4772,10 @@ const char *getArg(int argc,char **argv,int &optind) int main(int argc,char **argv) { - +#if QT_VERSION >= 200 + setlocale(LC_ALL,""); +#endif + initPreprocessor(); /************************************************************************** diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 408c1d7..af3ecce 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -577,11 +577,6 @@ void HtmlGenerator::startMemberItem(int annoType) if (Config::htmlAlignMemberFlag) { t << "<tr>"; - //if (inGroup) - // t << "<td bgcolor=\"" << GROUP_COLOR << "\">"; - //else - //t << "<td>"; - //t << "<img src=\"null.gif\"></td><td><img src=\"null.gif\"></td>"; switch(annoType) { case 0: t << "<td nowrap align=right valign=top>"; break; @@ -600,26 +595,30 @@ void HtmlGenerator::endMemberItem(bool) //DBG_HTML(t << "<!-- endMemberItem(" << (int)inGroup << "," << fileName << "," << headerName << " -->" << endl) if (Config::htmlAlignMemberFlag) { - //if (inGroup) - //{ - // t << " </td><td"; - // if (headerName) - // { - // t << " align=right valign=top><a class=\"gl\" href=\"" - // << fileName << ".html\"> " << headerName << " </a>"; - // } - // else - // { - // t << ">"; - // } - // t << "</td><td bgcolor=\"" << GROUP_COLOR - // << "\"><img src=\"null.gif\">"; - //} t << "</td></tr>"; } t << endl; } +void HtmlGenerator::startParameter(bool first) +{ + if (first) + { + t << endl << "</b></td>" << endl; + t << "<td><b>" << endl; + } + else + { + t << "<tr><td></td><td><b>" << endl; + } +} + +void HtmlGenerator::endParameter(bool) +{ + t << "</b></td></tr>" << endl; +} + + void HtmlGenerator::insertMemberAlign() { DBG_HTML(t << "<!-- insertMemberAlign -->" << endl) @@ -762,12 +761,24 @@ void HtmlGenerator::writeImage(const char *name,const char *,const char *) void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const char *) { - t << endl << "<p><table width=100% cellpadding=2 cellspacing=0 border=0><tr><td class=\"md\"><b>" << endl; + t << "<p>" << endl; + t << "<table width=100% cellpadding=2 cellspacing=0 border=0>" << endl; + t << " <tr>" << endl; + t << " <td class=\"md\"><b>" << endl; + t << " <table cellspadding=0 cellspacing=0 border=0>" << endl; + t << " <tr>" << endl; + t << " <td><b>" << endl; } void HtmlGenerator::endMemberDoc() { - t << endl << "</b></td></tr></table>" << endl; + t << endl; + t << " </b></td>" << endl; + t << " </tr>" << endl; + t << " </table>" << endl; + t << " </td>" << endl; + t << " </tr>" << endl; + t << "</table>" << endl; } void HtmlGenerator::startCollaborationDiagram() diff --git a/src/htmlgen.h b/src/htmlgen.h index 75f5ce7..149e6dd 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -224,6 +224,9 @@ class HtmlGenerator : public OutputGenerator void endTextBlock() {} void lastIndexPage() {} + void startParameter(bool first); + void endParameter(bool last); + private: QCString header; QCString footer; diff --git a/src/latexgen.h b/src/latexgen.h index 1012dea..5fd278b 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -219,6 +219,8 @@ class LatexGenerator : public OutputGenerator void startTextBlock(bool) {} void endTextBlock() {} + void startParameter(bool) {} + void endParameter(bool) {} private: LatexGenerator(const LatexGenerator &); diff --git a/src/mangen.h b/src/mangen.h index f34caed..1f4ebec 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -206,6 +206,8 @@ class ManGenerator : public OutputGenerator void startTextBlock(bool) {} void endTextBlock() {} void lastIndexPage() {} + void startParameter(bool) {} + void endParameter(bool) {} private: bool firstCol; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 2c1fd32..86b91bf 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -101,22 +101,12 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, } //printf("~~~ %s cName=%s\n",md->name().data(),cName.data()); - // You can set the next to TRUE to experiment with multiline parameter lists. - // I'll add this in some form in a future release. - bool multiLineArgs = FALSE; /* argList->count()>2; */ + bool first=TRUE; while (a) { + ol.startParameter(first); first=FALSE; QRegExp re(")("); int vp; - if (multiLineArgs) - { - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - ol.lineBreak(); - ol.writeNonBreakableSpace(); - ol.writeNonBreakableSpace(); - ol.popGeneratorState(); - } if (!a->attrib.isEmpty()) // argument has an IDL attribute { ol.docify(a->attrib+" "); @@ -161,14 +151,11 @@ static void writeDefArgumentList(OutputList &ol,ClassDef *cd, linkifyText(ol,scopeName,md->name(),n); } a=argList->next(); - if (a) ol.docify(", "); // there are more arguments - } - if (multiLineArgs) - { - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - ol.lineBreak(); - ol.popGeneratorState(); + if (a) + { + ol.docify(", "); // there are more arguments + ol.endParameter(FALSE); + } } ol.docify(")"); // end argument list if (argList->constSpecifier) @@ -971,6 +958,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.docify("]"); ol.endTypewriter(); } + ol.endParameter(TRUE); ol.endMemberDoc(); ol.endDoxyAnchor(); ol.startIndent(); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index f997529..ec884b8 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -94,8 +94,8 @@ void MemberList::countDecMembers(bool inGroup) MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - printf("memberGroupList adding %d inGroup=%d\n", - mg->countDecMembers(),m_count); + //printf("memberGroupList adding %d inGroup=%d\n", + // mg->countDecMembers(),m_count); m_count+=mg->countDecMembers(); } } @@ -355,6 +355,13 @@ void MemberList::writePlainDeclarations(OutputList &ol, MemberDef *fmd=fmdl->first(); while (fmd) { + /* in html we start each enum item on a new line */ + typeDecl.pushGeneratorState(); + typeDecl.disableAllBut(OutputGenerator::Html); + typeDecl.lineBreak(); + typeDecl.writeString(" "); + typeDecl.popGeneratorState(); + if (fmd->hasDocumentation()) // enum value has docs { if (!Config::genTagFile.isEmpty()) @@ -379,6 +386,10 @@ void MemberList::writePlainDeclarations(OutputList &ol, typeDecl.enable(OutputGenerator::Man); } } + typeDecl.pushGeneratorState(); + typeDecl.disableAllBut(OutputGenerator::Html); + typeDecl.lineBreak(); + typeDecl.popGeneratorState(); typeDecl.docify(" }"); md->setEnumDecl(typeDecl); int enumVars=0; @@ -571,7 +582,7 @@ void MemberList::writeDeclarations(OutputList &ol, if (memberGroupList) { - printf("MemberList::writeDeclarations()\n"); + //printf("MemberList::writeDeclarations()\n"); MemberGroupListIterator mgli(*memberGroupList); MemberGroup *mg; while ((mg=mgli.current())) @@ -581,7 +592,7 @@ void MemberList::writeDeclarations(OutputList &ol, ol.endMemberGroupHeader(); if (!mg->documentation().isEmpty()) { - printf("Member group has docs!\n"); + //printf("Member group has docs!\n"); ol.startMemberGroupDocs(); parseDoc(ol,0,0,mg->documentation()); ol.endMemberGroupDocs(); @@ -608,7 +619,7 @@ void MemberList::writeDocumentation(OutputList &ol, void MemberList::addMemberGroup(MemberGroup *mg) { - printf("MemberList::addMemberGroup(%p)\n",mg); + //printf("MemberList::addMemberGroup(%p)\n",mg); if (memberGroupList==0) { memberGroupList=new MemberGroupList; diff --git a/src/outputgen.cpp b/src/outputgen.cpp index b765eec..722558d 100644 --- a/src/outputgen.cpp +++ b/src/outputgen.cpp @@ -28,6 +28,9 @@ OutputGenerator::OutputGenerator() b.setBuffer(a); b.open( IO_WriteOnly ); t.setDevice(&b); +#if QT_VERSION >= 200 + t.setEncoding(QTextStream::Latin1); +#endif active=TRUE; genStack = new QStack<bool>; genStack->setAutoDelete(TRUE); diff --git a/src/outputgen.h b/src/outputgen.h index a422338..d3696cf 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -210,6 +210,9 @@ class OutputGenerator virtual void endTextBlock() = 0; virtual void lastIndexPage() = 0; + virtual void startParameter(bool) = 0; + virtual void endParameter(bool) = 0; + void clear() { b.close(); a.resize(0); b.setBuffer(a); b.open(IO_WriteOnly); t.setDevice(&b); } diff --git a/src/outputlist.h b/src/outputlist.h index 1dd11b2..191d82b 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -312,8 +312,6 @@ class OutputList { forall(&OutputGenerator::addToIndex,s1,s2); } void writeSynopsis() { forall(&OutputGenerator::writeSynopsis); } - //void generateExternalIndex() - //{ forall(&OutputGenerator::generateExternalIndex); } void startClassDiagram() { forall(&OutputGenerator::startClassDiagram); } void endClassDiagram(ClassDiagram &d,const char *f,const char *n) @@ -366,6 +364,11 @@ class OutputList void lastIndexPage() { forall(&OutputGenerator::lastIndexPage); } + void startParameter(bool first) + { forall(&OutputGenerator::startParameter,first); } + void endParameter(bool last) + { forall(&OutputGenerator::endParameter,last); } + private: void debug(); void clear(); @@ -26,11 +26,13 @@ #if QT_VERSION >= 200 +#include <locale.h> + #define GCI QCollection::Item #include <qcstring.h> #include <qstring.h> -inline QCString convertToQCString(const QString &s) { return s.local8Bit(); } +inline QCString convertToQCString(const QString &s) { return s.latin1(); } #else /* QT_VERSION < 200 */ diff --git a/src/rtfgen.h b/src/rtfgen.h index f47da9b..d8bec55 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -208,6 +208,9 @@ class RTFGenerator : public OutputGenerator void endTextBlock(); void lastIndexPage(); + void startParameter(bool) {} + void endParameter(bool) {} + static bool preProcessFileInplace(const char *path,const char *name); private: diff --git a/src/scanner.l b/src/scanner.l index ff2e61a..589bbff 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -355,6 +355,16 @@ static void endTable() curTable=tableStack.top(); } +static void forceEndTable() +{ + err("Error: More <table> tags found than </table> " + "tags in documentation block in file %s!\n",yyFileName); + while (!tableStack.isEmpty()) + { + endTable(); + } +} + //----------------------------------------------------------------------------- static void lineCount() @@ -4854,6 +4864,10 @@ void parseDocument(OutputList &ol,const QCString &docString) { warn("Warning: Documentation block contains \\if without matching \\endif: %d\n",depthIf); } + if (!tableStack.isEmpty()) + { + forceEndTable(); + } ol+=*outDoc; delete outDoc; outDoc=0; return; |