From b69146af8dce22431fc50dc3fcea6c7fd5fb1063 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 30 Mar 2003 19:53:04 +0000 Subject: Release-1.3-rc3-20030330 --- INSTALL | 4 +- README | 4 +- VERSION | 2 +- doc/config.doc | 21 +++++- doc/install.doc | 5 +- doc/language.doc | 2 +- libpng/inftrees.c | 4 +- packages/rpm/doxygen.spec | 2 +- qtools/qglobal.h | 3 + qtools/qtextcodec.cpp | 2 +- src/classdef.cpp | 4 +- src/config.l | 18 +++++ src/defgen.cpp | 6 +- src/docparser.cpp | 31 +++++++-- src/docparser.h | 4 +- src/doctokenizer.l | 4 +- src/dot.cpp | 20 ++++-- src/dot.h | 7 +- src/doxygen.cpp | 38 +++-------- src/htmlgen.cpp | 13 ++-- src/index.cpp | 6 +- src/language.cpp | 22 +++++-- src/memberlist.cpp | 165 +++++++++++++++++++++++----------------------- src/outputlist.cpp | 5 +- src/outputlist.h | 3 +- src/page.h | 64 ++++++++++-------- src/rtfdocvisitor.cpp | 45 ++++++++----- src/rtfdocvisitor.h | 2 +- src/rtfgen.cpp | 4 +- src/util.cpp | 18 +++-- src/xmlgen.cpp | 6 +- 31 files changed, 316 insertions(+), 218 deletions(-) diff --git a/INSTALL b/INSTALL index 7c2bf39..7da3486 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.3-rc3-20030317 +DOXYGEN Version 1.3-rc3-20030330 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (17 March 2003) +Dimitri van Heesch (30 March 2003) diff --git a/README b/README index a161c18..6439109 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.3_rc3_20030317 +DOXYGEN Version 1.3_rc3_20030330 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (17 March 2003) +Dimitri van Heesch (dimitri@stack.nl) (30 March 2003) diff --git a/VERSION b/VERSION index 96be0cb..addf17b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3-rc3-20030317 +1.3-rc3-20030330 diff --git a/doc/config.doc b/doc/config.doc index e704dd1..8cb2367 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -153,6 +153,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_man_extension MAN_EXTENSION \refitem cfg_man_links MAN_LINKS \refitem cfg_man_output MAN_OUTPUT +\refitem cfg_max_dot_graph_depth MAX_DOT_GRAPH_DEPTH \refitem cfg_max_dot_graph_height MAX_DOT_GRAPH_HEIGHT \refitem cfg_max_dot_graph_width MAX_DOT_GRAPH_WIDTH \refitem cfg_max_initializer_lines MAX_INITIALIZER_LINES @@ -1493,6 +1494,21 @@ TAGFILES = file1=loc1 "file2 = loc2" ... the specified constraint. Beware that most browsers cannot cope with very large images. +\anchor cfg_max_dot_graph_depth +
\c MAX_DOT_GRAPH_DEPTH
+\addindex MAX_DOT_GRAPH_DEPTH +The \c MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +graphs generated by dot. A depth value of 3 means that only nodes reachable +from the root by following a path via at most 3 edges will be shown. Nodes that +lay further from the root node will be omitted. Note that setting this option to +1 or 2 may greatly reduce the computation time needed for large code bases. Also +note that a graph may be further truncated if the graph's image dimensions are +not sufficient to fit the graph (see +\ref cfg_max_dot_graph_width "MAX_DOT_GRAPH_WIDTH" and +\ref cfg_max_dot_graph_height "MAX_DOT_GRAPH_HEIGHT"). +If 0 is used fot the depth value (the default), the graph is +not depth constraint. + \anchor cfg_max_dot_graph_width
\c MAX_DOT_GRAPH_WIDTH
\addindex MAX_DOT_GRAPH_WIDTH @@ -1512,8 +1528,9 @@ TAGFILES = file1=loc1 "file2 = loc2" ... \anchor cfg_dot_cleanup
\c DOT_CLEANUP
\addindex DOT_CLEANUP - This tag can be used to cleanup any mess DOT left behind. - If left blank, "NO" is assumed. +If the \c DOT_CLEANUP tag is set to \c YES (the default) doxygen will +remove the intermedate dot files that are used to generate the various graphs. + \section config_search Search engine options diff --git a/doc/install.doc b/doc/install.doc index a816e8b..9b2f6ac 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -344,7 +344,7 @@ $(TARGET): $(OBJECTS) $(OBJMOC) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) -Bdynamic \endverbatim -GNU 2.7.2.x compiler problems +GCC compiler problems Older versions of the GNU compiler have problems with constant strings containing characters with character codes larger than 127. Therefore @@ -357,6 +357,9 @@ On some platforms (such as OpenBSD) using some versions of gcc with such as config.cpp. As a workaround use --debug as a configure option or omit the -O2 for the particular files in the Makefile. +Gcc versions before 2.95 may produce broken binaries due to bugs in +these compilers. + Dot problems Due to a change in the way image maps are generated, older versions diff --git a/doc/language.doc b/doc/language.doc index 149686f..52a3396 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -25,7 +25,7 @@ Doxygen has built-in support for multiple languages. This means that the text fragments that doxygen generates can be produced in languages other than English (the default) at configuration time. -Currently (version 1.2.14-20020317), 28 languages +Currently (version 1.3-rc3-20030327), 28 languages are supported (sorted alphabetically): Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, diff --git a/libpng/inftrees.c b/libpng/inftrees.c index 901204d..e7aa918 100644 --- a/libpng/inftrees.c +++ b/libpng/inftrees.c @@ -213,7 +213,7 @@ local int huft_build(uIntf *b, uInt n, uInt s, const uIntf *d, const uIntf *e, i /* compute minimum size table less than or equal to l bits */ z = g - w; - z = z > (uInt)l ? l : z; /* table size upper limit */ + z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ { /* too few codes for k-w bit table */ f -= a + 1; /* deduct codes from patterns left */ @@ -445,6 +445,8 @@ int inflate_trees_fixed(uIntf *bl, uIntf *bd, inflate_huft **tl, inflate_huft ** ZFREE(z, c); fixed_built = 1; } +#else + z=z; // DvH: added to avoid compiler warning #endif *bl = fixed_bl; *bd = fixed_bd; diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index aa1b72d..4da0f17 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,6 +1,6 @@ Summary: A documentation system for C/C++. Name: doxygen -Version: 1.3_rc3_20030317 +Version: 1.3_rc3_20030330 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/qtools/qglobal.h b/qtools/qglobal.h index 2ec484c..53b082e 100644 --- a/qtools/qglobal.h +++ b/qtools/qglobal.h @@ -593,4 +593,7 @@ Q_EXPORT void qObsolete( const char *obj, const char *oldfunc ); Q_EXPORT void qObsolete( const char *message ); #endif +// DvH: added to avoid warnings on recent gcc versions +#define Q_DELETE_VOID_UNDEFINED + #endif // QGLOBAL_H diff --git a/qtools/qtextcodec.cpp b/qtools/qtextcodec.cpp index cdecfce..fbbc1f9 100644 --- a/qtools/qtextcodec.cpp +++ b/qtools/qtextcodec.cpp @@ -925,6 +925,7 @@ struct QMultiByteUnicodeTable { QMultiByteUnicodeTable* multibyte; }; +#ifndef QT_NO_CODECS static int getByte(char* &cursor) { int byte = 0; @@ -939,7 +940,6 @@ static int getByte(char* &cursor) return byte&0xff; } -#ifndef QT_NO_CODECS class QTextCodecFromIOD; class QTextCodecFromIODDecoder : public QTextDecoder { diff --git a/src/classdef.cpp b/src/classdef.cpp index 39e37f5..a24ffe5 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1032,7 +1032,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (Config_getBool("HAVE_DOT") && Config_getBool("CLASS_GRAPH")) // write class diagram using dot { - DotClassGraph inheritanceGraph(this,DotClassGraph::Inheritance); + DotClassGraph inheritanceGraph(this,DotClassGraph::Inheritance,Config_getInt("MAX_DOT_GRAPH_DEPTH")); if (!inheritanceGraph.isTrivial()) { ol.pushGeneratorState(); @@ -1067,7 +1067,7 @@ void ClassDef::writeDocumentation(OutputList &ol) if (Config_getBool("HAVE_DOT") && Config_getBool("COLLABORATION_GRAPH")) { - DotClassGraph usageImplGraph(this,DotClassGraph::Implementation); + DotClassGraph usageImplGraph(this,DotClassGraph::Implementation,Config_getInt("MAX_DOT_GRAPH_DEPTH")); if (!usageImplGraph.isTrivial()) { ol.pushGeneratorState(); diff --git a/src/config.l b/src/config.l index 7823412..b569d5d 100644 --- a/src/config.l +++ b/src/config.l @@ -1217,6 +1217,12 @@ void Config::check() } PUTENV(buf); } + + int &depth = Config_getInt("MAX_DOT_GRAPH_DEPTH"); + if (depth==0) + { + depth=1000; + } if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO")) { @@ -2518,6 +2524,18 @@ void Config::create() "large images. \n", 100,30000,1024 ); + ci = addInt( + "MAX_DOT_GRAPH_DEPTH", + "The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n" + "graphs generated by dot. A depth value of 3 means that only nodes reachable \n" + "from the root by following a path via at most 3 edges will be shown. Nodes that \n" + "lay further from the root node will be omitted. Note that setting this option to \n" + "1 or 2 may greatly reduce the computation time needed for large code bases. Also \n" + "note that a graph may be further truncated if the graph's image dimensions are \n" + "not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). \n" + "If 0 is used fot the depth value (the default), the graph is not depth constraint. \n", + 0,1000,0 + ); ci->addDependency("HAVE_DOT"); cb = addBool( "GENERATE_LEGEND", diff --git a/src/defgen.cpp b/src/defgen.cpp index 2aed0bf..2216dd9 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -450,14 +450,16 @@ void generateDEFForClass(ClassDef *cd,QTextStream &t) t << " cp-documentation = <<_EnD_oF_dEf_TeXt_" << endl << cd->documentation() << endl << "_EnD_oF_dEf_TeXt_;" << endl; - DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance); + DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance, + Config_getInt("MAX_DOT_GRAPH_DEPTH")); if (!inheritanceGraph.isTrivial()) { t << " cp-inheritancegraph = <<_EnD_oF_dEf_TeXt_" << endl; inheritanceGraph.writeDEF(t); t << endl << "_EnD_oF_dEf_TeXt_;" << endl; } - DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation); + DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation, + Config_getInt("MAX_DOT_GRAPH_DEPTH")); if (!collaborationGraph.isTrivial()) { t << " cp-collaborationgraph = <<_EnD_oF_dEf_TeXt_" << endl; diff --git a/src/docparser.cpp b/src/docparser.cpp index 846d19c..08e21cf 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -37,6 +37,7 @@ #include "cmdmapper.h" #include "printdocvisitor.h" #include "message.h" +#include "section.h" #define DBG(x) do {} while(0) //#define DBG(x) printf x @@ -58,10 +59,11 @@ static const char *sectionLevelToName[] = //--------------------------------------------------------------------------- // global variables during a call to validatingParseDoc -static bool g_hasParamCommand; -static MemberDef * g_memberDef; -static QDict g_paramsFound; -static bool g_isExample; +static bool g_hasParamCommand; +static MemberDef * g_memberDef; +static QDict g_paramsFound; +static bool g_isExample; +static SectionDict *g_sectionDict; // include file state static QString g_includeFileText; @@ -703,6 +705,10 @@ static void handleLinkedWord(DocNode *parent,QList &children) } else // compound link { + if (compound->definitionType()==Definition::TypeFile) + { + name=g_token->name; + } children.append(new DocLinkedWord(parent,name, compound->getReference(), @@ -1153,6 +1159,10 @@ DocAnchor::DocAnchor(DocNode *parent,const QString &id,bool newAnchor) { m_file = sec->fileName; m_anchor = sec->label; + if (g_sectionDict && g_sectionDict->find(id)==0) + { + g_sectionDict->insert(id,sec); + } } else { @@ -1458,6 +1468,10 @@ void DocSecRefItem::parse() { m_file = sec->fileName; m_anchor = sec->label; + if (g_sectionDict && g_sectionDict->find(m_target)==0) + { + g_sectionDict->insert(m_target,sec); + } } else { @@ -4339,6 +4353,7 @@ reparsetoken: break; } } + retval=0; endparagraph: handlePendingStyleCommands(this,m_children); DocNode *n = g_nodeStack.pop(); @@ -4369,6 +4384,10 @@ int DocSection::parse() m_anchor = sec->label; m_title = sec->title; if (m_title.isEmpty()) m_title = sec->label; + if (g_sectionDict && g_sectionDict->find(m_id)==0) + { + g_sectionDict->insert(m_id,sec); + } } } @@ -4611,7 +4630,8 @@ void DocRoot::parse() DocNode *validatingParseDoc(const char *fileName,int startLine, const char *context,MemberDef *md, - const char *input,bool isExample) + const char *input,bool isExample, + SectionDict *sections) { //printf("========== validating %s at line %d\n",fileName,startLine); @@ -4633,6 +4653,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, g_hasParamCommand = FALSE; g_paramsFound.setAutoDelete(FALSE); g_paramsFound.clear(); + g_sectionDict = sections; doctokenizerYYlineno=startLine; doctokenizerYYinit(input,g_fileName); diff --git a/src/docparser.h b/src/docparser.h index e8e9403..15d931c 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -33,6 +33,7 @@ class MemberDef; class PageInfo; class Definition; class MemberGroup; +class SectionDict; //--------------------------------------------------------------------------- @@ -51,7 +52,8 @@ class MemberGroup; */ DocNode *validatingParseDoc(const char *fileName,int startLine, const char *context, MemberDef *md, - const char *input,bool isExample); + const char *input,bool isExample, + SectionDict *sections=0); /*! Main entry point for parsing simple text fragments. These * fragments are limited to words, whitespace and symbols. diff --git a/src/doctokenizer.l b/src/doctokenizer.l index f8f363a..7655b54 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -288,7 +288,7 @@ OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG}) LNKWORD1 ("::"|"#")?{SCOPEMASK} CVSPEC {BLANK}*("const"|"volatile") LNKWORD2 {SCOPEPRE}*"operator"{OPMASK} -WORD1 [^ \t\n\r\\@<>()\[\]:;\?{}&$#,.]+|"{"|"}" +WORD1 [^ \t\n\r\\@<>()\[\]:;\?{}&$#,.]+|"{"|"}"|("\""[^"\n]*"\"") WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?" WORD1NQ [^ \t\n\r\\@<>()\[\]:;\?{}&$#,."]+ WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?" @@ -603,7 +603,7 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]* return 0; } -("#"|"::")?({ID}[.#:-])*{ID} { +("#"|"::")?({ID}("."|"#"|"::"|"-"))*{ID} { g_token->name=yytext; return TK_WORD; } diff --git a/src/dot.cpp b/src/dot.cpp index 928692b..ac0f645 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -775,7 +775,8 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) DotNode *node; for (;(node=dnli2.current());++dnli2) { - if (node->m_subgraphId==n->m_subgraphId) node->write(t,BITMAP,FALSE,TRUE); + if (node->m_subgraphId==n->m_subgraphId) + node->write(t,BITMAP,FALSE,TRUE,1000,TRUE); } t << "}" << endl; f.close(); @@ -1062,7 +1063,10 @@ void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, } m_usedNodes->insert(className,bn); //printf(" add new child node `%s' to %s\n",className.data(),n->m_label.data()); - if (distanceaddChild(bn,0,0,0); bn->addParent(n); m_usedNodes->insert(in,bn); - if (bfd) buildGraph(bn,bfd,distance+1); + + // we use <=, i.s.o < to cause one more level than intended which is used to + // detect truncated nodes + if (bfd && distance<=m_recDepth) buildGraph(bn,bfd,distance+1); } } } } -DotInclDepGraph::DotInclDepGraph(FileDef *fd,bool inverse) +DotInclDepGraph::DotInclDepGraph(FileDef *fd,int maxRecursionDepth,bool inverse) { m_maxDistance = 0; + m_recDepth = maxRecursionDepth; m_inverse = inverse; ASSERT(fd!=0); m_diskName = fd->getFileBase().copy(); @@ -1610,7 +1618,7 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, QCString mapName=m_startNode->m_label.copy(); if (m_inverse) mapName+="dep"; - findMaximalDotGraph(m_startNode,m_maxDistance,baseName,thisDir,format, + findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance),baseName,thisDir,format, FALSE,FALSE,!m_inverse); if (format==BITMAP) diff --git a/src/dot.h b/src/dot.h index 5646482..ae3ce60 100644 --- a/src/dot.h +++ b/src/dot.h @@ -76,7 +76,7 @@ class DotNode void removeChild(DotNode *n); void removeParent(DotNode *n); void write(QTextStream &t,GraphOutputFormat f,bool topDown,bool toChildren, - int maxDistance=1000,bool backArrows=TRUE); + int maxDistance,bool backArrows); int m_subgraphId; void clearWriteFlag(); void writeXML(QTextStream &t,bool isClassGraph); @@ -125,7 +125,7 @@ class DotClassGraph { public: enum GraphType { Interface, Implementation, Inheritance }; - DotClassGraph(ClassDef *cd,GraphType t,int maxRecusionDepth=1000); + DotClassGraph(ClassDef *cd,GraphType t,int maxRecusionDepth); ~DotClassGraph(); bool isTrivial() const; QCString writeGraph(QTextStream &t,GraphOutputFormat f,const char *path, @@ -152,7 +152,7 @@ class DotClassGraph class DotInclDepGraph { public: - DotInclDepGraph(FileDef *fd,bool inverse=FALSE); + DotInclDepGraph(FileDef *fd,int maxRecusionDepth,bool inverse=FALSE); ~DotInclDepGraph(); QCString writeGraph(QTextStream &t, GraphOutputFormat f,const char *path, bool writeImageMap=TRUE); @@ -168,6 +168,7 @@ class DotInclDepGraph QCString m_diskName; int m_maxDistance; bool m_inverse; + int m_recDepth; }; void generateGraphLegend(const char *path); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index c72fe21..15dc65e 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -2939,9 +2939,11 @@ static void findUsedClassesForClass(Entry *root, //printf("findUsedClassesForClass(%s)=%s\n",masterCd->name().data(),type.data()); while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec)) { + //printf("Found used class %s\n",usedClassName.data()); // the name could be a type definition, resolve it // TODO: recursive typedef resolution QCString typeName = resolveTypeDef(masterCd,usedClassName); + //printf("Found resolved class %s\n",typeName.data()); // add any template arguments to the class QCString usedName = usedClassName+templSpec; @@ -2993,34 +2995,10 @@ static void findUsedClassesForClass(Entry *root, if (!found) { - ClassDef *usedCd=0; -#if 0 - Definition *scope=masterCd->getOuterScope(); - do - { - // TODO: also consider using declarations and directives - // as done for inheritance relations. - - QCString scopeName; - if (scope) scopeName=scope->qualifiedName(); - if (!scopeName.isEmpty()) - { - usedCd=getResolvedClass(masterCd,scopeName+"::"+usedName,0,&templSpec); - if (usedCd==0) usedCd=getResolvedClass(masterCd,scopeName+"::"+usedClassName,0,&templSpec); - //printf("Search for class %s result=%p\n",(scopeName+"::"+usedName).data(),usedCd); - } - else - { - usedCd=getResolvedClass(masterCd,usedName,0,&templSpec); - if (usedCd==0) usedCd=getResolvedClass(masterCd,usedClassName,0,&templSpec); - //printf("Search for class %s result=%p\n",usedName.data(),usedCd); - } - if (scope) scope=scope->getOuterScope(); - } while (scope && usedCd==0); -#endif - usedCd = findClassWithinClassContext(masterCd,usedName); + ClassDef *usedCd=findClassWithinClassContext(masterCd,usedName); + //printf("Looking for used class: result=%p master=%p\n",usedCd,masterCd); - if (usedCd && usedCd!=masterCd) + if (usedCd /*&& usedCd!=masterCd*/) { found=TRUE; Debug::print(Debug::Classes,0," Adding used class `%s'\n", usedCd->name().data()); @@ -6109,7 +6087,7 @@ static void findMainPage(Entry *root) indexName, root->doc,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); Doxygen::mainPage->fileName = indexName; - Doxygen::mainPage->addSections(root->anchors); + //Doxygen::mainPage->addSections(root->anchors); // a page name is a label as well! SectionInfo *si=new SectionInfo( @@ -6253,7 +6231,7 @@ static void generatePageDocs() { scName=pi->context->name(); } - outputList->parseDoc(pi->defFileName,pi->defLine,scName,0,pi->doc,FALSE); + outputList->parseDoc(pi->defFileName,pi->defLine,scName,0,pi->doc,FALSE,pi->sectionDict); outputList->endTextBlock(); endFile(*outputList); //outputList->enable(OutputGenerator::Man); @@ -6293,7 +6271,7 @@ static void buildExampleList(Entry *root) PageInfo *pi=new PageInfo(root->fileName,root->startLine, root->name,root->doc,root->args); pi->fileName = convertNameToFile(pi->name+"-example"); - pi->addSections(root->anchors); + //pi->addSections(root->anchors); Doxygen::exampleSDict->inSort(root->name,pi); addExampleToGroups(root,pi); diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 516b05e..20998ad 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -63,6 +63,7 @@ static const char *defaultStyleSheet = "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" "BODY { background: white; color: black }\n" +"EM.mdesc { font-size: smaller }\n" "TD.indexkey { \n" " background-color: #eeeeff; \n" " font-weight: bold; \n" @@ -791,11 +792,11 @@ void HtmlGenerator::startMemberDescription() DBG_HTML(t << "" << endl) if (Config_getBool("HTML_ALIGN_MEMBERS")) { - t << " "; + t << " "; } else { - t << "
"; + t << "
"; } } @@ -804,11 +805,11 @@ void HtmlGenerator::endMemberDescription() DBG_HTML(t << "" << endl) if (Config_getBool("HTML_ALIGN_MEMBERS")) { - t << "

" << endl; + t << "


" << endl; } else { - t << "

"; + t << "

"; } } @@ -1046,7 +1047,7 @@ void HtmlGenerator::startParameterName(bool oneArgOnly) { t << "1\" valign=\"top"; } - t << "\" nowrap> "; + t << "\" nowrap>"; // "; } void HtmlGenerator::endParameterName(bool last,bool emptyList) @@ -1057,7 +1058,7 @@ void HtmlGenerator::endParameterName(bool last,bool emptyList) if (emptyList) { t << " " << endl; - t << " ) " << endl; + t << "  ) " << endl; t << " "; } else diff --git a/src/index.cpp b/src/index.cpp index 95698b6..c24714b 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2763,7 +2763,8 @@ void writeIndex(OutputList &ol) if (Doxygen::mainPage) { Doxygen::insideMainPage=TRUE; - ol.parseDoc(defFileName,defLine,0,0,Doxygen::mainPage->doc,FALSE); + ol.parseDoc(defFileName,defLine,0,0, + Doxygen::mainPage->doc,FALSE,Doxygen::mainPage->sectionDict); if (!Config_getString("GENERATE_TAGFILE").isEmpty()) { @@ -2936,7 +2937,8 @@ void writeIndex(OutputList &ol) // ol.endSection(si->label,FALSE); //} ol.startTextBlock(); - ol.parseDoc(defFileName,defLine,0,0,Doxygen::mainPage->doc,FALSE); + ol.parseDoc(defFileName,defLine,0,0, + Doxygen::mainPage->doc,FALSE,Doxygen::mainPage->sectionDict); ol.endTextBlock(); endFile(ol); ol.enable(OutputGenerator::Man); diff --git a/src/language.cpp b/src/language.cpp index 5a2b9d2..eb2dcb9 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -26,7 +26,7 @@ #include "translator_nl.h" #endif #ifdef LANG_SE -#include "translator_se.h" +//#include "translator_se.h" #endif #ifdef LANG_CZ #include "translator_cz.h" @@ -47,7 +47,7 @@ #include "translator_es.h" #endif #ifdef LANG_FI -#include "translator_fi.h" +//#include "translator_fi.h" #endif #ifdef LANG_RU #include "translator_ru.h" @@ -112,6 +112,16 @@ Translator *theTranslator=0; +static const char obsoleteMsg[] = + "---------\n" + "ERROR: The selected language is no longer supported!\n" + "If you want doxygen to produce output in this language \n" + "you are kindly requested to help bringing the documentation \n" + "up to date. Please read the development section of the manual \n" + "for more information or contact Petr Prikryl (Prikryl@skil.cz).\n" + "Thanks in advance!\n" + "---------\n"; + bool setTranslator(const char *langName) { if (L_EQUAL("english")) @@ -128,7 +138,9 @@ bool setTranslator(const char *langName) #ifdef LANG_SE else if (L_EQUAL("swedish")) { - theTranslator=new TranslatorSwedish; + //theTranslator=new TranslatorSwedish; + theTranslator=new TranslatorEnglish; + err(obsoleteMsg); } #endif #ifdef LANG_CZ @@ -174,7 +186,9 @@ bool setTranslator(const char *langName) #ifdef LANG_FI else if (L_EQUAL("finnish")) { - theTranslator=new TranslatorFinnish; + //theTranslator=new TranslatorFinnish; + theTranslator=new TranslatorEnglish; + err(obsoleteMsg); } #endif #ifdef LANG_RU diff --git a/src/memberlist.cpp b/src/memberlist.cpp index aea2f27..fe4da71 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -179,103 +179,100 @@ void MemberList::writePlainDeclarations(OutputList &ol, MemberListIterator mli(*this); for ( ; (md=mli.current()); ++mli ) { - //printf(">>> Member `%s' type=%d\n",md->name().data(),md->memberType()); - switch(md->memberType()) + if (md->isBriefSectionVisible()) { - case MemberDef::Define: // fall through - case MemberDef::Prototype: // fall through - case MemberDef::Typedef: // fall through - case MemberDef::Variable: // fall through - case MemberDef::Function: // fall through - case MemberDef::Signal: // fall through - case MemberDef::Slot: // fall through - case MemberDef::DCOP: // fall through - case MemberDef::Property: // fall through - case MemberDef::Event: - { - if (md->isBriefSectionVisible()) - { - if (first) ol.startMemberList(),first=FALSE; - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); - } - break; - } - case MemberDef::Enumeration: + //printf(">>> Member `%s' type=%d\n",md->name().data(),md->memberType()); + switch(md->memberType()) { - if (first) ol.startMemberList(),first=FALSE; - int enumVars=0; - MemberListIterator vmli(*this); - MemberDef *vmd; - QCString name(md->name()); - int i=name.findRev("::"); - if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) - if (name[0]=='@') // anonymous enum => append variables - { - for ( ; (vmd=vmli.current()) ; ++vmli) + case MemberDef::Define: // fall through + case MemberDef::Prototype: // fall through + case MemberDef::Typedef: // fall through + case MemberDef::Variable: // fall through + case MemberDef::Function: // fall through + case MemberDef::Signal: // fall through + case MemberDef::Slot: // fall through + case MemberDef::DCOP: // fall through + case MemberDef::Property: // fall through + case MemberDef::Event: { - QCString vtype=vmd->typeString(); - if ((vtype.find(name))!=-1) - { - enumVars++; - vmd->setAnonymousEnumType(md); - } + if (first) ol.startMemberList(),first=FALSE; + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); + break; } - } - // if this is an anoymous enum and there are variable of this - // enum type (i.e. enumVars>0), then we do not show the enum here. - if (enumVars==0) // show enum here - { - ol.startMemberItem(0); - ol.writeString("enum "); - ol.insertMemberAlign(); - //ol+=typeDecl; // append the enum values. - md->writeEnumDeclaration(ol,cd,nd,fd,gd); - ol.endMemberItem(); - if (!md->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) + case MemberDef::Enumeration: { - ol.startMemberDescription(); - ol.parseDoc( - md->briefFile(),md->briefLine(), - cd?cd->name().data():0,md, - md->briefDescription(), - FALSE - ); - if (md->isDetailedSectionLinkable()) + if (first) ol.startMemberList(),first=FALSE; + int enumVars=0; + MemberListIterator vmli(*this); + MemberDef *vmd; + QCString name(md->name()); + int i=name.findRev("::"); + if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) + if (name[0]=='@') // anonymous enum => append variables { - ol.disableAllBut(OutputGenerator::Html); - ol.endEmphasis(); - ol.docify(" "); - if (md->getGroupDef()!=0 && gd==0) // forward link to group + for ( ; (vmd=vmli.current()) ; ++vmli) { - ol.startTextLink(md->getGroupDef()->getOutputFileBase(), - md->anchor()); + QCString vtype=vmd->typeString(); + if ((vtype.find(name))!=-1) + { + enumVars++; + vmd->setAnonymousEnumType(md); + } } - else + } + // if this is an anoymous enum and there are variables of this + // enum type (i.e. enumVars>0), then we do not show the enum here. + if (enumVars==0) // show enum here + { + ol.startMemberItem(0); + ol.writeString("enum "); + ol.insertMemberAlign(); + //ol+=typeDecl; // append the enum values. + md->writeEnumDeclaration(ol,cd,nd,fd,gd); + ol.endMemberItem(); + if (!md->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startTextLink(0,md->anchor()); + ol.startMemberDescription(); + ol.parseDoc( + md->briefFile(),md->briefLine(), + cd?cd->name().data():0,md, + md->briefDescription(), + FALSE + ); + if (md->isDetailedSectionLinkable()) + { + ol.disableAllBut(OutputGenerator::Html); + ol.endEmphasis(); + ol.docify(" "); + if (md->getGroupDef()!=0 && gd==0) // forward link to group + { + ol.startTextLink(md->getGroupDef()->getOutputFileBase(), + md->anchor()); + } + else + { + ol.startTextLink(0,md->anchor()); + } + ol.parseText(theTranslator->trMore()); + ol.endTextLink(); + ol.startEmphasis(); + ol.enableAll(); + } + ol.endMemberDescription(); } - ol.parseText(theTranslator->trMore()); - ol.endTextLink(); - ol.startEmphasis(); - ol.enableAll(); } - ol.endMemberDescription(); + md->warnIfUndocumented(); + break; } - } - md->warnIfUndocumented(); - break; - } - case MemberDef::Friend: - { - if (md->isBriefSectionVisible()) - { - if (first) ol.startMemberList(),first=FALSE; - md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); - } - break; + case MemberDef::Friend: + { + if (first) ol.startMemberList(),first=FALSE; + md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); + break; + } + case MemberDef::EnumValue: + break; } - case MemberDef::EnumValue: - break; } } diff --git a/src/outputlist.cpp b/src/outputlist.cpp index d943415..7a074c7 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -193,7 +193,8 @@ void OutputList::popGeneratorState() void OutputList::parseDoc(const char *fileName,int startLine, const char * clName,MemberDef * md, - const QCString &docStr,bool isExample) + const QCString &docStr,bool isExample, + SectionDict *sections) { int count=0; OutputGenerator *og=outputs->first(); @@ -205,7 +206,7 @@ void OutputList::parseDoc(const char *fileName,int startLine, if (count==0) return; // no output formats enabled. DocNode *root = validatingParseDoc(fileName,startLine, - clName,md,docStr,isExample); + clName,md,docStr,isExample,sections); og=outputs->first(); while (og) diff --git a/src/outputlist.h b/src/outputlist.h index b21ae50..4b6f9fe 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -36,6 +36,7 @@ class ClassDiagram; class DotClassGraph; class DotInclDepGraph; class DotGfxHierarchyTable; +class SectionDict; class OutputList : public OutputDocInterface { @@ -61,7 +62,7 @@ class OutputList : public OutputDocInterface void parseDoc(const char *fileName,int startLine, const char *clName,MemberDef *md,const QCString &docStr, - bool isExample); + bool isExample,SectionDict *sections=0); void parseText(const QCString &textStr); diff --git a/src/page.h b/src/page.h index 3177c42..7190188 100644 --- a/src/page.h +++ b/src/page.h @@ -27,8 +27,14 @@ class PageInfo public: PageInfo(const char *f, int l,const char *n,const char *d,const char *t) : defFileName(f), defLine(l), name(n), - doc(d), title(t), context(0), sectionDict(0),specialListItems(0),m_inGroup(0) - {} + doc(d), title(t), context(0),specialListItems(0),m_inGroup(0) + { + sectionDict = new SectionDict(17); + } + ~PageInfo() + { + delete sectionDict; + } // where the page definition was found QCString defFileName; @@ -51,33 +57,33 @@ class PageInfo bool isReference() const { return !reference.isEmpty(); } QCString getReference() const { return reference; } - void addSections(QList *anchorList) - { - if (anchorList) - { - QCString *s=anchorList->first(); - while (s) - { - SectionInfo *si=0; - if (!s->isEmpty() && (si=Doxygen::sectionDict[*s])) - { - //printf("Add section `%s' to definition `%s'\n", - // si->label.data(),n.data()); - if (sectionDict==0) - { - sectionDict = new SectionDict(17); - } - if (sectionDict->find(*s)==0) - { - sectionDict->insert(*s,si); - } - si->pageRef = this; - si->fileName = fileName; - } - s=anchorList->next(); - } - } - } + //void addSections(QList *anchorList) + //{ + // if (anchorList) + // { + // QCString *s=anchorList->first(); + // while (s) + // { + // SectionInfo *si=0; + // if (!s->isEmpty() && (si=Doxygen::sectionDict[*s])) + // { + // //printf("Add section `%s' to definition `%s'\n", + // // si->label.data(),n.data()); + // if (sectionDict==0) + // { + // sectionDict = new SectionDict(17); + // } + // if (sectionDict->find(*s)==0) + // { + // sectionDict->insert(*s,si); + // } + // si->pageRef = this; + // si->fileName = fileName; + // } + // s=anchorList->next(); + // } + // } + //} void findSectionsInDocumentation() { docFindSections(doc,this,0,0,defFileName); diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 3d1a127..e10b3f1 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -292,15 +292,15 @@ void RTFDocVisitor::visit(DocVerbatim *s) m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); parseCode(m_ci,s->context(),s->text().latin1(),s->isExample(),s->exampleFile()); - m_t << "\\par" << endl; + //m_t << "\\par" << endl; m_t << "}" << endl; break; case DocVerbatim::Verbatim: m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); - filter(s->text()); - m_t << "\\par" << endl; + filter(s->text(),TRUE); + //m_t << "\\par" << endl; m_t << "}" << endl; break; case DocVerbatim::HtmlOnly: @@ -572,14 +572,17 @@ void RTFDocVisitor::visitPost(DocSimpleListItem *) void RTFDocVisitor::visitPre(DocSection *s) { if (m_hide) return; - m_t << "{" // start section + m_t << "\\par" << endl << + "{{" // start section << rtf_Style_Reset; QString heading; - int level = QMIN(s->level()+2,4); + int level = QMIN(s->level()+1,4); heading.sprintf("Heading%d",level); // set style - m_t << rtf_Style[heading]->reference; + m_t << rtf_Style[heading]->reference << endl; // make table of contents entry + filter(s->title()); + m_t << endl << "\\par" << "}" << endl; m_t << "{\\tc\\tcl" << level << " \\v "; filter(s->title()); m_t << "}" << endl; @@ -588,8 +591,7 @@ void RTFDocVisitor::visitPre(DocSection *s) void RTFDocVisitor::visitPost(DocSection *) { if (m_hide) return; - m_t << "\\par" << endl; - m_t << "}"; // end section + m_t << "}" << endl; // end section } void RTFDocVisitor::visitPre(DocHtmlList *l) @@ -686,15 +688,15 @@ void RTFDocVisitor::visitPre(DocHtmlTable *) m_t << "\\par" << endl; } -void RTFDocVisitor::visitPost(DocHtmlTable *t) +void RTFDocVisitor::visitPost(DocHtmlTable *) { if (m_hide) return; - if (!t->hasCaption()) - { - m_t << endl; - m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl; - m_t << "{\\row }" << endl; - } + //if (!t->hasCaption()) + //{ + // m_t << endl; + // m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl; + // m_t << "{\\row }" << endl; + //} m_t << "\\pard" << endl; } @@ -724,7 +726,7 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r) "\\clbrdrb\\brdrs\\brdrw10 " "\\clbrdrr \\brdrs\\brdrw10 " "\\cltxlrtb " - "\\cellx" << (i*columnWidth) << endl; + "\\cellx" << ((i+1)*columnWidth) << endl; } m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl; } @@ -1091,7 +1093,7 @@ static char* getMultiByte(int c) return s; } -void RTFDocVisitor::filter(const char *str) +void RTFDocVisitor::filter(const char *str,bool verbatim) { if (str) { @@ -1121,6 +1123,15 @@ void RTFDocVisitor::filter(const char *str) case '{': m_t << "\\{"; break; case '}': m_t << "\\}"; break; case '\\': m_t << "\\\\"; break; + case '\n': if (verbatim) + { + m_t << "\\par" << endl; + } + else + { + m_t << '\n'; + } + break; default: m_t << (char)c; } pc = c; diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h index 7a6bbc8..96a0736 100644 --- a/src/rtfdocvisitor.h +++ b/src/rtfdocvisitor.h @@ -132,7 +132,7 @@ class RTFDocVisitor : public DocVisitor // helper functions //-------------------------------------- - void filter(const char *str); + void filter(const char *str,bool verbatim=FALSE); void startLink(const QString &ref,const QString &file, const QString &anchor); void endLink(const QString &ref); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 88d0f62..e92eef6 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -823,7 +823,7 @@ void RTFGenerator::lastIndexPage() t <<"\\sect \\sbkpage \\pgndec \\pgnrestart\n"; t <<"\\sect \\sectd \\sbknone\n"; - // set footer + // set new footer with arabic numbers t <<"{\\footer "<< rtf_Style["Footer"]->reference << "{\\chpgn}}\n"; //t << rtf_Style["Heading1"]->reference << "\n"; @@ -1970,7 +1970,7 @@ void RTFGenerator::endTextBlock() newParagraph(); DBG_RTF(t << "{\\comment endTextBlock}" << endl) t << "}" << endl; - m_omitParagraph = TRUE; + //m_omitParagraph = TRUE; } void RTFGenerator::newParagraph() diff --git a/src/util.cpp b/src/util.cpp index 75ca37f..494a333 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -467,9 +467,11 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, MemberDef *tmd=0; for (;(tmd=mni.current());++mni) { - //printf("Found member %s scope=%p mContext=%p\n",tmd->name().data(), - // tmd->getOuterScope(),mContext); - if (tmd->isTypedef() && tmd->getOuterScope()==resScope) + //printf("Found member %s resScope=%s outerScope=%s mContext=%p\n", + // tmd->name().data(), resScope->name().data(), + // tmd->getOuterScope()->name().data(), mContext); + if (tmd->isTypedef() /*&& tmd->getOuterScope()==resScope*/) + /*! TODO: look if resScope is visible within tmd->getOuterScope() */ { md=tmd; } @@ -2739,6 +2741,10 @@ bool generateLink(OutputDocInterface &od,const char *clName, { linkText=((GroupDef *)compound)->groupTitle(); // use group's title as link } + else if (compound->definitionType()==Definition::TypeFile) + { + linkText=lt; // use text "as is" + } od.writeObjectLink(compound->getReference(), compound->getOutputFileBase(),anchor,linkText); if (!compound->isReference()) @@ -2761,6 +2767,7 @@ bool generateLink(OutputDocInterface &od,const char *clName, void generateFileRef(OutputDocInterface &od,const char *name,const char *text) { + //printf("generateFileRef(%s,%s)\n",name,text); QCString linkText = text ? text : name; //FileInfo *fi; FileDef *fd; @@ -3581,7 +3588,8 @@ found: //---------------------------------------------------------------------------- PageInfo *addRelatedPage(const char *name,const QCString &ptitle, - const QCString &doc,QList *anchors, + const QCString &doc, + QList * /*anchors*/, const char *fileName,int startLine, const QList *sli, GroupDef *gd, @@ -3634,7 +3642,7 @@ PageInfo *addRelatedPage(const char *name,const QCString &ptitle, pageName=pi->name.lower(); //setFileNameForSections(anchors,pageName,pi); pi->fileName = pageName; - pi->addSections(anchors); + //pi->addSections(anchors); //printf("Appending page `%s'\n",baseName.data()); Doxygen::pageSDict->append(baseName,pi); diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 25ca501..86cd12f 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -978,14 +978,16 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) t << " " << endl; writeXMLDocBlock(t,cd->docFile(),cd->docLine(),cd->name(),0,cd->documentation()); t << " " << endl; - DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance); + DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance, + Config_getBool("MAX_DOT_GRAPH_DEPTH")); if (!inheritanceGraph.isTrivial()) { t << " " << endl; inheritanceGraph.writeXML(t); t << " " << endl; } - DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation); + DotClassGraph collaborationGraph(cd,DotClassGraph::Implementation, + Config_getBool("MAX_DOT_GRAPH_DEPTH")); if (!collaborationGraph.isTrivial()) { t << " " << endl; -- cgit v0.12