From 7d9031583b2a1cc2374a54f5004ed2dd4a61e649 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 25 Jun 2000 15:06:41 +0000 Subject: Release-1.1.4-20000625 --- INSTALL | 8 +-- README | 4 +- VERSION | 2 +- addon/configgen/configgen.cpp | 58 +++++++++++++++++--- addon/doxywizard/README | 2 + doc/commands.doc | 11 ++++ doc/config.doc | 61 +++++++++++++++++---- packages/rpm/doxygen.spec | 2 +- src/classdef.cpp | 123 +++++++++++++++++++++++------------------- src/classdef.h | 1 + src/code.l | 40 ++++++++++++-- src/config.h | 6 ++- src/config.l | 88 +++++++++++++++++++++++++++--- src/dot.cpp | 66 +++++++++++++---------- src/dot.h | 9 ++-- src/doxygen.cpp | 88 ++++++++++++++++-------------- src/filedef.cpp | 38 ++++++++++++- src/filedef.h | 6 ++- src/latexgen.cpp | 41 +++++++++++--- src/memberdef.cpp | 18 +++---- src/membergroup.cpp | 7 ++- src/memberlist.cpp | 4 +- src/pre.l | 19 +++++-- src/scanner.l | 118 ++++++++++++++++++++++++++++------------ src/translator.h | 13 ++++- src/translator_cz.h | 3 +- src/translator_de.h | 3 +- src/translator_es.h | 3 +- src/translator_fi.h | 3 +- src/translator_fr.h | 3 +- src/translator_hr.h | 3 +- src/translator_it.h | 3 +- src/translator_jp.h | 3 +- src/translator_nl.h | 4 +- src/translator_ru.h | 4 +- src/translator_se.h | 3 +- src/util.cpp | 2 + 37 files changed, 631 insertions(+), 239 deletions(-) create mode 100644 addon/doxywizard/README diff --git a/INSTALL b/INSTALL index d2f9e7f..7b57165 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ -DOXYGEN Version 1.1.4 +DOXYGEN Version 1.1.4-20000625 CONTENTS -------- @@ -15,8 +15,8 @@ INSTALLATION INSTRUCTIONS FOR UNIX: 1. Unpack the archive, unless you already have: - gunzip doxygen-1.1.4.src.tar.gz # uncompress the archive - tar xf doxygen-1.1.4.src.tar # unpack it + gunzip doxygen-1.1.4-20000625.src.tar.gz # uncompress the archive + tar xf doxygen-1.1.4-20000625.src.tar # unpack it 2. Run the configure script: @@ -255,4 +255,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (18 June 2000) +Dimitri van Heesch (25 June 2000) diff --git a/README b/README index 58d746c..7d7c361 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.1.4 +DOXYGEN Version 1.1.4-20000625 Please read INSTALL for compilation instructions. @@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (18 June 2000) +Dimitri van Heesch (25 June 2000) diff --git a/VERSION b/VERSION index 65087b4..34515fa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.4 +1.1.4-20000625 diff --git a/addon/configgen/configgen.cpp b/addon/configgen/configgen.cpp index 92ec41e..c1f139a 100644 --- a/addon/configgen/configgen.cpp +++ b/addon/configgen/configgen.cpp @@ -787,18 +787,25 @@ void init() ConfigBool::add( "extractAllFlag", "EXTRACT_ALL", "FALSE", - "gererate docs for all classes flag", + "generate docs for all classes flag", "If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n" "documentation are documented, even if no documentation was available. \n" "Private class members and static file members will be hidden unless \n" - "the EXTRACT_PRIVATE tag is set to YES \n" + "the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES \n" ); ConfigBool::add( "extractPrivateFlag", "EXTRACT_PRIVATE", "FALSE", "generate docs for private members flag", "If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n" - "and the static members of a file will be included in the documentation. \n" + "will be included in the documentation. \n" + ); + ConfigBool::add( "extractStaticFlag", + "EXTRACT_STATIC", + "FALSE", + "generate docs for static members flag", + "If the EXTRACT_STATIC tag is set to YES all static members of a file \n" + "will be included in the documentation. \n" ); ConfigBool::add( "hideMemberFlag", "HIDE_UNDOC_MEMBERS", @@ -806,6 +813,8 @@ void init() "hide undocumented members.", "If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n" "undocumented members of documented classes, files or namespaces. \n" + "If set to NO (the default) these members will be included in the \n" + "various overviews, but no documentation section is generated. \n" "This option has no effect if EXTRACT_ALL is enabled. \n" ); ConfigBool::add( "hideClassFlag", @@ -814,7 +823,8 @@ void init() "hide undocumented members.", "If the HIDE_UNDOC_CLASSESS tag is set to YES, Doxygen will hide all \n" "undocumented classes that are normally visible in the class hierarchy. \n" - "This option has no effect if EXTRACT_ALL is enabled. \n" + "If set to NO (the default) these class will be included in the various \n" + "overviews. This option has no effect if EXTRACT_ALL is enabled. \n" ); ConfigBool::add( "briefMemDescFlag", "BRIEF_MEMBER_DESC", @@ -1290,7 +1300,7 @@ void init() //----------------------------------------------------------------------------------------------- ConfigBool::add( "generateRTF", "GENERATE_RTF", - "FALSE", + "TRUE", "generate RTF flag", "If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n" "For now this is experimental and is disabled by default. The RTF output \n" @@ -1490,6 +1500,15 @@ void init() "documented files. \n" ); addDependency("includeGraphFlag","haveDotFlag"); + ConfigBool::add( "includedByGraphFlag", + "INCLUDED_BY_GRAPH", + "TRUE", + "depends on include graph", + "If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to \n" + "YES then doxygen will generate a graph for each documented header file showing \n" + "the documented files that directly or indirectly include this file \n" + ); + addDependency("includedByGraphFlag","haveDotFlag"); ConfigBool::add( "gfxHierarchyFlag", "GRAPHICAL_HIERARCHY", "TRUE", @@ -1502,11 +1521,36 @@ void init() "DOT_PATH", "", "path to the dot tool", - "This tag can be used to specify the path where the dot tool can be found. \n" - "If left blank, it is assumed the dot tool can be found on the path. \n", + "The tag DOT_PATH can be used to specify the path where the dot tool can be \n" + "found. If left blank, it is assumed the dot tool can be found on the path. \n", ConfigString::Dir ); addDependency("dotPath","haveDotFlag"); + ConfigInt::add( "maxDotGraphWidth", + "MAX_DOT_GRAPH_WIDTH", + "1024", + "max dot graph width", + "The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width \n" + "(in pixels) of the graphs generated by dot. If a graph becomes larger than \n" + "this value, doxygen will try to truncate the graph, so that it fits within \n" + "the specified constraint. Beware that most browsers cannot cope with very \n" + "large images. \n", + 250,30000 + ); + addDependency("maxDotGraphWidth","haveDotFlag"); + ConfigInt::add( "maxDotGraphHeight", + "MAX_DOT_GRAPH_HEIGHT", + "1024", + "max dot graph height", + "The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height \n" + "(in pixels) of the graphs generated by dot. If a graph becomes larger than \n" + "this value, doxygen will try to truncate the graph, so that it fits within \n" + "the specified constraint. Beware that most browsers cannot cope with very \n" + "large images. \n", + 250,30000 + ); + addDependency("maxDotGraphHeight","haveDotFlag"); + //----------------------------------------------------------------------------------------------- ConfigInfo::add( "Search","Configuration::addtions related to the search engine "); diff --git a/addon/doxywizard/README b/addon/doxywizard/README new file mode 100644 index 0000000..e265c2e --- /dev/null +++ b/addon/doxywizard/README @@ -0,0 +1,2 @@ +Doxywizard is a graphical front-end to read/edit/write doxygen configuration +files. It requires Qt version 2.1.0 or higher. diff --git a/doc/commands.doc b/doc/commands.doc index 8bf691a..b275909 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -104,6 +104,7 @@ documentation:
  • \refitem cmdsa \sa
  • \refitem cmdsection \section
  • \refitem cmdshowinitializer \showinitializer +
  • \refitem cmdsince \since
  • \refitem cmdskip \skip
  • \refitem cmdskipline \skipline
  • \refitem cmdstruct \struct @@ -802,6 +803,16 @@ Public/Protected/Private/... section. to objects.
    +\subsection cmdsince \since { text } + + \addindex \since + This tag can be used to specify since when (version or time) an + entity is available. The paragraph that follows \\since does not have any + special internal structure. All visual enhancement commands may be + used inside the paragraph. The \\since description ends when a blank + line or some other sectioning command is encountered. + +
    \subsection cmdthrow \throw { exception description } \addindex \throw diff --git a/doc/config.doc b/doc/config.doc index 109ba09..dc909da 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -52,8 +52,8 @@ followed by the descriptions of the tags grouped by category. \begin{CompactList} \endlatexonly
  • \refitem cfg_allexternals ALLEXTERNALS -
  • \refitem cfg_always_detailed_sec ALWAYS_DETAILED_SEC
  • \refitem cfg_alphabetical_index ALPHABETICAL_INDEX +
  • \refitem cfg_always_detailed_sec ALWAYS_DETAILED_SEC
  • \refitem cfg_bin_abspath BIN_ABSPATH
  • \refitem cfg_brief_member_desc BRIEF_MEMBER_DESC
  • \refitem cfg_case_sense_names CASE_SENSE_NAMES @@ -68,6 +68,7 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_disable_index DISABLE_INDEX
  • \refitem cfg_doc_abspath DOC_ABSPATH
  • \refitem cfg_doc_url DOC_URL +
  • \refitem cfg_dot_path DOT_PATH
  • \refitem cfg_enable_preprocessing ENABLE_PREPROCESSING
  • \refitem cfg_enabled_sections ENABLED_SECTIONS
  • \refitem cfg_example_path EXAMPLE_PATH @@ -79,6 +80,7 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_extra_packages EXTRA_PACKAGES
  • \refitem cfg_extract_all EXTRACT_ALL
  • \refitem cfg_extract_private EXTRACT_PRIVATE +
  • \refitem cfg_extract_static EXTRACT_STATIC
  • \refitem cfg_file_patterns FILE_PATTERNS
  • \refitem cfg_full_path_names FULL_PATH_NAMES
  • \refitem cfg_generate_html GENERATE_HTML @@ -114,6 +116,8 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_macro_expansion MACRO_EXPANSION
  • \refitem cfg_man_extension MAN_EXTENSION
  • \refitem cfg_man_output MAN_OUTPUT +
  • \refitem cfg_max_dot_graph_height MAX_DOT_GRAPH_HEIGHT +
  • \refitem cfg_max_dot_graph_width MAX_DOT_GRAPH_WIDTH
  • \refitem cfg_output_directory OUTPUT_DIRECTORY
  • \refitem cfg_output_language OUTPUT_LANGUAGE
  • \refitem cfg_paper_type PAPER_TYPE @@ -125,6 +129,8 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_quiet QUIET
  • \refitem cfg_recursive RECURSIVE
  • \refitem cfg_repeat_brief REPEAT_BRIEF +
  • \refitem cfg_rtf_hyperlinks RTF_HYPERLINKS +
  • \refitem cfg_rtf_output RTF_OUTPUT
  • \refitem cfg_search_includes SEARCH_INCLUDES
  • \refitem cfg_searchengine SEARCHENGINE
  • \refitem cfg_show_include_files SHOW_INCLUDE_FILES @@ -132,14 +138,12 @@ followed by the descriptions of the tags grouped by category.
  • \refitem cfg_source_browser SOURCE_BROWSER
  • \refitem cfg_strip_code_comments STRIP_CODE_COMMENTS
  • \refitem cfg_strip_from_path STRIP_FROM_PATH -
  • \refitem cfg_rtf_hyperlinks RTF_HYPERLINKS -
  • \refitem cfg_rtf_output RTF_OUTPUT
  • \refitem cfg_tab_size TAB_SIZE
  • \refitem cfg_tagfiles TAGFILES
  • \refitem cfg_verbatim_headers VERBATIM_HEADERS -
  • \refitem cfg_warnings WARNINGS
  • \refitem cfg_warn_format WARN_FORMAT
  • \refitem cfg_warn_if_undocumented WARN_IF_UNDOCUMENTED +
  • \refitem cfg_warnings WARNINGS \htmlonly @@ -197,8 +201,10 @@ followed by the descriptions of the tags grouped by category. \anchor cfg_extract_all
    \c EXTRACT_ALL
    \addindex EXTRACT_ALL - If the \c EXTRACT_ALL tag is set to \c YES all classes and functions will be - included in the documentation, even if no documentation was available. + If the \c EXTRACT_ALL tag is set to \c YES doxygen will assume all + entities in documentation are documented, even if no documentation was + available. Private class members and static file members will be hidden + unless the \c EXTRACT_PRIVATE and \c EXTRACT_STATIC tags are set to \c YES \par Note: This will also disable the warnings about undocumented members @@ -207,8 +213,14 @@ followed by the descriptions of the tags grouped by category. \anchor cfg_extract_private
    \c EXTRACT_PRIVATE
    \addindex EXTRACT_PRIVATE - If the \c EXTRACT_PRIVATE tag is set to \c YES all - documentation for private members will be extracted as well. + If the \c EXTRACT_PRIVATE tag is set to \c YES all private members of a + class will be included in the documentation. + +\anchor cfg_extract_static +
    \c EXTRACT_STATIC
    + \addindex EXTRACT_STATIC + If the \c EXTRACT_STATIC tag is set to \c YES all static members of a file + will be included in the documentation. \anchor cfg_hide_undoc_members
    \c HIDE_UNDOC_MEMBERS
    @@ -217,6 +229,7 @@ followed by the descriptions of the tags grouped by category. undocumented members inside documented classes or files. If set to \c NO (the default) these members will be included in the various overviews, but no documentation section is generated. + This option has no effect if \c EXTRACT_ALL is enabled. \anchor cfg_hide_undoc_classes
    \c HIDE_UNDOC_CLASSES
    @@ -225,6 +238,7 @@ followed by the descriptions of the tags grouped by category. undocumented classes. If set to \c NO (the default) these classes will be included in the various overviews. + This option has no effect if \c EXTRACT_ALL is enabled. \anchor cfg_brief_member_desc
    \c BRIEF_MEMBER_DESC
    @@ -247,6 +261,7 @@ followed by the descriptions of the tags grouped by category. \anchor cfg_always_detailed_sec
    \c ALWAYS_DETAILED_SEC
    + \addindex ALWAYS_DETAILED_SEC If the \c ALWAYS_DETAILED_SEC and \c REPEAT_BRIEF tags are both set to \c YES then Doxygen will generate a detailed section even if there is only a brief description. @@ -822,13 +837,13 @@ EXTRA_PACKAGES = times put in front of it. If left blank `man' will be used as the default path. A directory man3 will be created inside the directory specified by \c MAN_OUTPUT. + \anchor cfg_man_extension
    \c MAN_EXTENSION
    \addindex MAX_EXTENSION The \c MAN_EXTENSION tag determines the extension that is added to the generated man pages (default is the subroutine's section .3) - \subsection config_prepro Preprocessor related options \anchor cfg_enable_preprocessing @@ -964,6 +979,14 @@ TAGFILES = file1=loc1 "file2 = loc2" ... showing the direct and indirect include dependencies of the file with other documented files. +\anchor cfg_included_by_graph +
    \c INCLUDED_BY_GRAPH
    + \addindex INCLUDED_BY_GRAPH + If the \c ENABLE_PREPROCESSING, \c INCLUDED_BY_GRAPH, and \c HAVE_DOT tags are + set to \c YES then doxygen will generate a graph for each documented header + file showing the documented files that directly or indirectly include this + file. + \anchor cfg_graphical_hierarchy
    \c GRAPHICAL_HIERARCHY
    \addindex GRAPHICAL_HIERATCHY @@ -976,6 +999,24 @@ TAGFILES = file1=loc1 "file2 = loc2" ... This tag can be used to specify the path where the dot tool can be found. If left blank, it is assumed the dot tool can be found on the path. +\anchor cfg_max_dot_graph_height +
    \c MAX_DOT_GRAPH_HEIGHT
    + \addindex MAX_DOT_GRAPH_HEIGHT + The \c MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height + (in pixels) of the graphs generated by dot. If a graph becomes larger than + this value, doxygen will try to truncate the graph, so that it fits within + the specified constraint. Beware that most browsers cannot cope with very + large images. + +\anchor cfg_max_dot_graph_width +
    \c MAX_DOT_GRAPH_WIDTH
    + \addindex MAX_DOT_GRAPH_WIDTH + The \c MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width + (in pixels) of the graphs generated by dot. If a graph becomes larger than + this value, doxygen will try to truncate the graph, so that it fits within + the specified constraint. Beware that most browsers cannot cope with very + large images. + \subsection config_search Search engine options \anchor cfg_searchengine @@ -1007,7 +1048,7 @@ TAGFILES = file1=loc1 "file2 = loc2" ... \addindex DOC_URL The \c DOC_URL tag should be the absolute URL to the directory where the documentation is located. If left blank the absolute path to the - documentation, with file:// prepended to it, will be used. + documentation, with \c file:// prepended to it, will be used. This is correct for local viewing only. \anchor cfg_doc_abspath diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index 41d8d41..4909686 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,5 +1,5 @@ Name: doxygen -Version: 1.1.4 +Version: 1.1.4-20000625 Summary: documentation system for C, C++ and IDL Release: 1 Source0: doxygen-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index 1ccf663..daacfba 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -566,23 +566,44 @@ void ClassDef::setIncludeFile(FileDef *fd,const char *incName,bool local) } } +ArgumentList *ClassDef::outerTemplateArguments() const +{ + int ti; + ClassDef *pcd=0; + int pi=0; + // find the outer most class scope + while ((ti=name().find("::",pi))!=-1 && + (pcd=getClass(name().left(ti)))==0 + ) pi=ti+2; + if (pcd) + { + return pcd->templateArguments(); + } + else + { + return tempArgs; + } +} + // write all documentation for this class void ClassDef::writeDocumentation(OutputList &ol) { // write title QCString pageTitle=name().copy(); QCString pageType; + ArgumentList *outerTempArgList = outerTemplateArguments(); + if (outerTempArgList) pageType+=" Template"; switch(compType) { - case Class: pageType=" Class"; break; - case Struct: pageType=" Struct"; break; - case Union: pageType=" Union"; break; - default: pageType=" Interface"; break; + case Class: pageType+=" Class"; break; + case Struct: pageType+=" Struct"; break; + case Union: pageType+=" Union"; break; + default: pageType+=" Interface"; break; } pageTitle+=pageType+" Reference"; startFile(ol,fileName,pageTitle); startTitle(ol,getOutputFileBase()); - parseText(ol,theTranslator->trCompoundReference(name(),compType)); + parseText(ol,theTranslator->trCompoundReference(name(),compType,outerTempArgList!=0)); endTitle(ol,getOutputFileBase(),name()); ol.startTextBlock(); @@ -868,24 +889,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.endGroupHeader(); ol.startTextBlock(); - ArgumentList *al=0; - int ti; - ClassDef *pcd=0; - int pi=0; - // find the outer most class scope - while ((ti=name().find("::",pi))!=-1 && - (pcd=getClass(name().left(ti)))==0 - ) pi=ti+2; - - if (pcd) - { - al=pcd->templateArguments(); - } - else - { - al=tempArgs; - } - + ArgumentList *al=outerTempArgList; if (al) // class is a template { ol.startSubsubsection(); @@ -894,7 +898,11 @@ void ClassDef::writeDocumentation(OutputList &ol) while (a) { ol.docify(a->type); - ol.docify(a->name); + if (!a->name.isEmpty()) + { + ol.docify(" "); + ol.docify(a->name); + } if (a->defval.length()!=0) { ol.docify(" = "); @@ -1583,45 +1591,48 @@ void ClassDef::determineImplUsageRelation() // name().data(),type.data(),md->name().data()); int p=0,i,l; bool found=FALSE; - while ((i=re.match(type,p,&l))!=-1 && !found) // for each class name in the type + if (typeLen>0) { - int ts=i+l; - int te=ts; - while (type.at(ts)==' ' && ts') brCount--; - te++; + // locate end of template + te=ts+1; + int brCount=1; + while (te') brCount--; + te++; + } } - } - QCString templSpec; - if (te>ts) templSpec = type.mid(ts,te-ts); - ClassDef *cd=getResolvedClass(name()+"::"+type.mid(i,l)); - if (cd==0) cd=getResolvedClass(type.mid(i,l)); // TODO: also try inbetween scopes! - if (cd) // class exists - { - found=TRUE; - if (usesImplClassDict==0) usesImplClassDict = new UsesClassDict(257); - UsesClassDef *ucd=usesImplClassDict->find(cd->name()); - if (ucd==0 || ucd->templSpecifiers!=templSpec) + QCString templSpec; + if (te>ts) templSpec = type.mid(ts,te-ts); + ClassDef *cd=getResolvedClass(name()+"::"+type.mid(i,l)); + if (cd==0) cd=getResolvedClass(type.mid(i,l)); // TODO: also try inbetween scopes! + if (cd) // class exists { - ucd = new UsesClassDef(cd); - usesImplClassDict->insert(cd->name(),ucd); - ucd->templSpecifiers = templSpec; - //printf("Adding used class %s to class %s\n", - // cd->name().data(),name().data()); + found=TRUE; + if (usesImplClassDict==0) usesImplClassDict = new UsesClassDict(257); + UsesClassDef *ucd=usesImplClassDict->find(cd->name()); + if (ucd==0 || ucd->templSpecifiers!=templSpec) + { + ucd = new UsesClassDef(cd); + usesImplClassDict->insert(cd->name(),ucd); + ucd->templSpecifiers = templSpec; + //printf("Adding used class %s to class %s\n", + // cd->name().data(),name().data()); + } + ucd->addAccessor(md->name()); + //printf("Adding accessor %s to class %s\n", + // md->name().data(),ucd->classDef->name().data()); } - ucd->addAccessor(md->name()); - //printf("Adding accessor %s to class %s\n", - // md->name().data(),ucd->classDef->name().data()); + p=i+l; } - p=i+l; } } } diff --git a/src/classdef.h b/src/classdef.h index 86f735d..9fde96d 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -99,6 +99,7 @@ class ClassDef : public Definition // template argument functions ArgumentList *templateArguments() const { return tempArgs; } + ArgumentList *outerTemplateArguments() const; void setTemplateArguments(ArgumentList *al); //QCString getTemplateNameString(); void setNamespace(NamespaceDef *nd) { nspace = nd; } diff --git a/src/code.l b/src/code.l index 08f10ce..a057a23 100644 --- a/src/code.l +++ b/src/code.l @@ -396,6 +396,7 @@ static bool getLink(const char *className, static ClassDef *stripClassName(const char *s) { QCString tmp=s; + if (tmp.isEmpty()) return 0; static const QRegExp re("[a-z_A-Z][a-z_A-Z0-9:]*"); int p=0,i,l; while ((i=re.match(tmp,p,&l))!=-1) @@ -1131,10 +1132,10 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" endFontClass(); } } -<*>\n({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n) { // remove one-line group marker +<*>\n{B}*"//@"[{}].*\n { // remove one-line group marker if (Config::stripCommentsFlag) { - g_yyLineNr+=((QCString)yytext).contains('\n'); + g_yyLineNr+=2; g_code->endCodeLine(); if (g_yyLineNr^{B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n { // remove one-line group marker +<*>\n{B}*"/*@"[{}] { // remove one-line group marker + if (Config::stripCommentsFlag) + { + g_lastSpecialCContext = YY_START; + g_yyLineNr++; + BEGIN(RemoveSpecialCComment); + } + else + { + // check is to prevent getting stuck in skipping C++ comments + if (YY_START != SkipCxxComment) + { + g_lastCContext = YY_START ; + } + startFontClass("comment"); + codifyLines(yytext); + BEGIN(SkipComment); + } + } +<*>^{B}*"//@"[{}].*\n { // remove one-line group marker if (Config::stripCommentsFlag) { g_yyLineNr++; @@ -1165,6 +1185,20 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" endFontClass(); } } +<*>^{B}*"/*@"[{}] { // remove multi-line group marker + if (Config::stripCommentsFlag) + { + g_lastSpecialCContext = YY_START; + BEGIN(RemoveSpecialCComment); + } + else + { + g_lastCContext = YY_START ; + startFontClass("comment"); + g_code->codify(yytext); + BEGIN(SkipComment); + } + } <*>^{B}*"//"[!/][^\n]*\n { // remove special one-line comment if (Config::stripCommentsFlag) { diff --git a/src/config.h b/src/config.h index a417b5f..9330012 100644 --- a/src/config.h +++ b/src/config.h @@ -36,8 +36,9 @@ struct Config static QCString outputDir; // the global output directory static QCString outputLanguage; // the output language static bool noIndexFlag; // generate condensed index flag - static bool extractAllFlag; // gererate docs for all classes flag + static bool extractAllFlag; // generate docs for all classes flag static bool extractPrivateFlag; // generate docs for private members flag + static bool extractStaticFlag; // generate docs for static members flag static bool hideMemberFlag; // hide undocumented members. static bool hideClassFlag; // hide undocumented members. static bool briefMemDescFlag; // enable `inline' brief member descr. @@ -112,8 +113,11 @@ struct Config static bool classGraphFlag; // class graph static bool collGraphFlag; // collaboration graph static bool includeGraphFlag; // include graph + static bool includedByGraphFlag; // depends on include graph static bool gfxHierarchyFlag; // flag to enable graphical hierarchy static QCString dotPath; // path to the dot tool + static int maxDotGraphWidth; // max dot graph width + static int maxDotGraphHeight; // max dot graph height static bool searchEngineFlag; // generate search engine flag static QCString cgiName; // the name of the CGI binary static QCString cgiURL; // the absolute URL to the CGI binary diff --git a/src/config.l b/src/config.l index e088707..780e9ce 100644 --- a/src/config.l +++ b/src/config.l @@ -73,6 +73,7 @@ QCString Config::outputLanguage = "English"; bool Config::noIndexFlag = FALSE; bool Config::extractAllFlag = FALSE; bool Config::extractPrivateFlag = FALSE; +bool Config::extractStaticFlag = FALSE; bool Config::hideMemberFlag = FALSE; bool Config::hideClassFlag = FALSE; bool Config::briefMemDescFlag = TRUE; @@ -126,7 +127,7 @@ QStrList Config::extraPackageList; QCString Config::latexHeaderFile; bool Config::pdfHyperFlag = FALSE; bool Config::latexBatchModeFlag = FALSE; -bool Config::generateRTF = FALSE; +bool Config::generateRTF = TRUE; QCString Config::rtfOutputDir = "rtf"; bool Config::compactRTFFlag = FALSE; bool Config::rtfHyperFlag = FALSE; @@ -147,8 +148,11 @@ bool Config::haveDotFlag = FALSE; bool Config::classGraphFlag = TRUE; bool Config::collGraphFlag = TRUE; bool Config::includeGraphFlag = TRUE; +bool Config::includedByGraphFlag = TRUE; bool Config::gfxHierarchyFlag = TRUE; QCString Config::dotPath; +int Config::maxDotGraphWidth = 1024; +int Config::maxDotGraphHeight = 1024; bool Config::searchEngineFlag = FALSE; QCString Config::cgiName = "search.cgi"; QCString Config::cgiURL; @@ -175,6 +179,8 @@ static QCString elemStr; //static QCString colsInAlphaIndexString; static QCString tabSizeString; static QCString colsInAlphaIndexString; +static QCString maxDotGraphWidthString; +static QCString maxDotGraphHeightString; /* ----------------------------------------------------------------- */ @@ -215,6 +221,7 @@ static int yyread(char *buf,int max_size) "DISABLE_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::noIndexFlag; } "EXTRACT_ALL"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractAllFlag; } "EXTRACT_PRIVATE"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractPrivateFlag; } +"EXTRACT_STATIC"[ \t]*"=" { BEGIN(GetBool); b=&Config::extractStaticFlag; } "HIDE_UNDOC_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideMemberFlag; } "HIDE_UNDOC_CLASSES"[ \t]*"=" { BEGIN(GetBool); b=&Config::hideClassFlag; } "BRIEF_MEMBER_DESC"[ \t]*"=" { BEGIN(GetBool); b=&Config::briefMemDescFlag; } @@ -289,8 +296,11 @@ static int yyread(char *buf,int max_size) "CLASS_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::classGraphFlag; } "COLLABORATION_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::collGraphFlag; } "INCLUDE_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::includeGraphFlag; } +"INCLUDED_BY_GRAPH"[ \t]*"=" { BEGIN(GetBool); b=&Config::includedByGraphFlag; } "GRAPHICAL_HIERARCHY"[ \t]*"=" { BEGIN(GetBool); b=&Config::gfxHierarchyFlag; } "DOT_PATH"[ \t]*"=" { BEGIN(GetString); s=&Config::dotPath; s->resize(0); } +"MAX_DOT_GRAPH_WIDTH"[ \t]*"=" { BEGIN(GetString); s=&maxDotGraphWidthString; s->resize(0); } +"MAX_DOT_GRAPH_HEIGHT"[ \t]*"=" { BEGIN(GetString); s=&maxDotGraphHeightString; s->resize(0); } "SEARCHENGINE"[ \t]*"=" { BEGIN(GetBool); b=&Config::searchEngineFlag; } "CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiName; s->resize(0); } "CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiURL; s->resize(0); } @@ -395,6 +405,7 @@ void dumpConfig() printf("noIndexFlag=`%d'\n",Config::noIndexFlag); printf("extractAllFlag=`%d'\n",Config::extractAllFlag); printf("extractPrivateFlag=`%d'\n",Config::extractPrivateFlag); + printf("extractStaticFlag=`%d'\n",Config::extractStaticFlag); printf("hideMemberFlag=`%d'\n",Config::hideMemberFlag); printf("hideClassFlag=`%d'\n",Config::hideClassFlag); printf("briefMemDescFlag=`%d'\n",Config::briefMemDescFlag); @@ -577,8 +588,11 @@ void dumpConfig() printf("classGraphFlag=`%d'\n",Config::classGraphFlag); printf("collGraphFlag=`%d'\n",Config::collGraphFlag); printf("includeGraphFlag=`%d'\n",Config::includeGraphFlag); + printf("includedByGraphFlag=`%d'\n",Config::includedByGraphFlag); printf("gfxHierarchyFlag=`%d'\n",Config::gfxHierarchyFlag); printf("dotPath=`%s'\n",Config::dotPath.data()); + printf("maxDotGraphWidth=`%d'\n",Config::maxDotGraphWidth); + printf("maxDotGraphHeight=`%d'\n",Config::maxDotGraphHeight); printf("# Configuration::addtions related to the search engine \n"); printf("searchEngineFlag=`%d'\n",Config::searchEngineFlag); printf("cgiName=`%s'\n",Config::cgiName.data()); @@ -605,6 +619,7 @@ void Config::init() Config::noIndexFlag = FALSE; Config::extractAllFlag = FALSE; Config::extractPrivateFlag = FALSE; + Config::extractStaticFlag = FALSE; Config::hideMemberFlag = FALSE; Config::hideClassFlag = FALSE; Config::briefMemDescFlag = TRUE; @@ -658,7 +673,7 @@ void Config::init() Config::latexHeaderFile.resize(0); Config::pdfHyperFlag = FALSE; Config::latexBatchModeFlag = FALSE; - Config::generateRTF = FALSE; + Config::generateRTF = TRUE; Config::rtfOutputDir = "rtf"; Config::compactRTFFlag = FALSE; Config::rtfHyperFlag = FALSE; @@ -679,8 +694,11 @@ void Config::init() Config::classGraphFlag = TRUE; Config::collGraphFlag = TRUE; Config::includeGraphFlag = TRUE; + Config::includedByGraphFlag = TRUE; Config::gfxHierarchyFlag = TRUE; Config::dotPath.resize(0); + Config::maxDotGraphWidth = 1024; + Config::maxDotGraphHeight = 1024; Config::searchEngineFlag = FALSE; Config::cgiName = "search.cgi"; Config::cgiURL.resize(0); @@ -818,8 +836,10 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; - t << "# If the EXTRACT_ALL tag is set to YES all classes and functions will be \n"; - t << "# included in the documentation, even if no documentation was available. \n"; + t << "# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n"; + t << "# documentation are documented, even if no documentation was available. \n"; + t << "# Private class members and static file members will be hidden unless \n"; + t << "# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES \n"; t << "\n"; } t << "EXTRACT_ALL = "; @@ -838,8 +858,21 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# If the EXTRACT_STATIC tag is set to YES all static members of a file \n"; + t << "# will be included in the documentation. \n"; + t << "\n"; + } + t << "EXTRACT_STATIC = "; + writeBoolValue(t,Config::extractStaticFlag); + t << "\n"; + if (!sl) + { + t << "\n"; t << "# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n"; - t << "# undocumented members inside documented classes or files. \n"; + t << "# undocumented members of documented classes, files or namespaces. \n"; + t << "# If set to NO (the default) these members will be included in the \n"; + t << "# various overviews, but no documentation section is generated. \n"; + t << "# This option has no effect if EXTRACT_ALL is enabled. \n"; t << "\n"; } t << "HIDE_UNDOC_MEMBERS = "; @@ -849,7 +882,9 @@ void writeTemplateConfig(QFile *f,bool sl) { t << "\n"; t << "# If the HIDE_UNDOC_CLASSESS tag is set to YES, Doxygen will hide all \n"; - t << "# undocumented classes. \n"; + t << "# undocumented classes that are normally visible in the class hierarchy. \n"; + t << "# If set to NO (the default) these class will be included in the various \n"; + t << "# overviews. This option has no effect if EXTRACT_ALL is enabled. \n"; t << "\n"; } t << "HIDE_UNDOC_CLASSES = "; @@ -1735,6 +1770,17 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to \n"; + t << "# YES then doxygen will generate a graph for each documented header file showing \n"; + t << "# the documented files that directly or indirectly include this file \n"; + t << "\n"; + } + t << "INCLUDED_BY_GRAPH = "; + writeBoolValue(t,Config::includedByGraphFlag); + t << "\n"; + if (!sl) + { + t << "\n"; t << "# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n"; t << "# will graphical hierarchy of all classes instead of a textual one. \n"; t << "\n"; @@ -1745,8 +1791,8 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; - t << "# This tag can be used to specify the path where the dot tool can be found. \n"; - t << "# If left blank, it is assumed the dot tool can be found on the path. \n"; + t << "# The tag DOT_PATH can be used to specify the path where the dot tool can be \n"; + t << "# found. If left blank, it is assumed the dot tool can be found on the path. \n"; t << "\n"; } t << "DOT_PATH = "; @@ -1755,6 +1801,32 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width \n"; + t << "# (in pixels) of the graphs generated by dot. If a graph becomes larger than \n"; + t << "# this value, doxygen will try to truncate the graph, so that it fits within \n"; + t << "# the specified constraint. Beware that most browsers cannot cope with very \n"; + t << "# large images. \n"; + t << "\n"; + } + t << "MAX_DOT_GRAPH_WIDTH = "; + writeIntValue(t,Config::maxDotGraphWidth); + t << "\n"; + if (!sl) + { + t << "\n"; + t << "# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height \n"; + t << "# (in pixels) of the graphs generated by dot. If a graph becomes larger than \n"; + t << "# this value, doxygen will try to truncate the graph, so that it fits within \n"; + t << "# the specified constraint. Beware that most browsers cannot cope with very \n"; + t << "# large images. \n"; + t << "\n"; + } + t << "MAX_DOT_GRAPH_HEIGHT = "; + writeIntValue(t,Config::maxDotGraphHeight); + t << "\n"; + if (!sl) + { + t << "\n"; } t << "#---------------------------------------------------------------------------\n"; t << "# Configuration::addtions related to the search engine \n"; diff --git a/src/dot.cpp b/src/dot.cpp index 2eaa7d5..a85e9bd 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -30,11 +30,8 @@ //-------------------------------------------------------------------- -const int maxImageWidth=1024; -const int maxImageHeight=1024; - /*! mapping from protection levels to color names */ -static char *edgeColorMap[] = +static const char *edgeColorMap[] = { "midnightblue", // Public "darkgreen", // Protected @@ -43,7 +40,7 @@ static char *edgeColorMap[] = "grey" // Undocumented }; -static char *edgeStyleMap[] = +static const char *edgeStyleMap[] = { "solid", // inheritance "dashed" // usage @@ -364,7 +361,8 @@ void DotNode::write(QTextStream &t, GraphOutputFormat format, bool topDown, bool toChildren, - int distance + int distance, + bool backArrows ) { //printf("DotNode::write(%d) name=%s\n",distance,m_label.data()); @@ -394,9 +392,9 @@ void DotNode::write(QTextStream &t, { if (cn->m_distance<=distance) { - writeArrow(t,format,cn,dnli2.current(),topDown); + writeArrow(t,format,cn,dnli2.current(),topDown,backArrows); } - cn->write(t,format,topDown,toChildren,distance); + cn->write(t,format,topDown,toChildren,distance,backArrows); } } else // render parents @@ -411,10 +409,11 @@ void DotNode::write(QTextStream &t, format, pn, pn->m_edgeInfo->at(pn->m_children->findRef(this)), - FALSE + FALSE, + backArrows ); } - pn->write(t,format,TRUE,FALSE,distance); + pn->write(t,format,TRUE,FALSE,distance,backArrows); } } } @@ -915,11 +914,12 @@ void writeDotGraph(DotNode *root, const QCString &baseName, bool lrRank, bool renderParents, - int distance + int distance, + bool backArrows ) { // generate the graph description for dot - //printf("writeDotGraph(%s,%d)\n",baseName.data(),renderParents); + //printf("writeDotGraph(%s,%d)\n",baseName.data(),backArrows); QFile f; f.setName(baseName+".dot"); if (f.open(IO_WriteOnly)) @@ -932,7 +932,7 @@ void writeDotGraph(DotNode *root, t << " rankdir=LR;" << endl; } root->clearWriteFlag(); - root->write(t,format,TRUE,TRUE,distance); + root->write(t,format,TRUE,TRUE,distance,backArrows); if (renderParents && root->m_parents) { //printf("rendering parents!\n"); @@ -946,10 +946,11 @@ void writeDotGraph(DotNode *root, format, pn, pn->m_edgeInfo->at(pn->m_children->findRef(root)), - FALSE + FALSE, + backArrows ); } - pn->write(t,format,TRUE,FALSE,distance); + pn->write(t,format,TRUE,FALSE,distance,backArrows); } } t << "}" << endl; @@ -963,7 +964,8 @@ static void findMaximalDotGraph(DotNode *root, QDir &thisDir, GraphOutputFormat format, bool lrRank=FALSE, - bool renderParents=FALSE + bool renderParents=FALSE, + bool backArrows=TRUE ) { bool lastFit; @@ -974,10 +976,11 @@ static void findMaximalDotGraph(DotNode *root, int height=0; // binary search for the maximal inheritance depth that fits in a reasonable - // sized image (dimensions: maxImageWidth, maxImageHeight) + // sized image (dimensions: Config::maxDotGraphWidth, Config::maxDotGraphHeight) do { - writeDotGraph(root,format,baseName,lrRank,renderParents,curDistance); + writeDotGraph(root,format,baseName,lrRank,renderParents, + curDistance,backArrows); QCString dotCmd(4096); // create annotated dot file @@ -995,7 +998,7 @@ static void findMaximalDotGraph(DotNode *root, height = height*96/72; // 96 pixels/inch, 72 points/inch //printf("Found bounding box (%d,%d)\n",width,height); - lastFit=(widthmaxImageWidth), + lrRank || (curDistance==1 && width>Config::maxDotGraphWidth), renderParents, - minDistance + minDistance, + backArrows ); } } @@ -1131,7 +1135,8 @@ int DotInclDepGraph::m_curNodeNumber; void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) { - QList *includeFiles = fd->includeFileList(); + QList *includeFiles = + m_inverse ? fd->includedByFileList() : fd->includeFileList(); QListIterator ili(*includeFiles); IncludeInfo *ii; for (;(ii=ili.current());++ili) @@ -1178,9 +1183,10 @@ void DotInclDepGraph::buildGraph(DotNode *n,FileDef *fd,int distance) } } -DotInclDepGraph::DotInclDepGraph(FileDef *fd) +DotInclDepGraph::DotInclDepGraph(FileDef *fd,bool inverse) { m_maxDistance = 0; + m_inverse = inverse; ASSERT(fd!=0); m_diskName = fd->getOutputFileBase().copy(); m_startNode = new DotNode(m_curNodeNumber++, @@ -1221,9 +1227,14 @@ void DotInclDepGraph::writeGraph(QTextStream &out, QDir::setCurrent(d.absPath()); QDir thisDir; - QCString baseName=m_diskName+"_incldep"; + QCString baseName=m_diskName; + if (m_inverse) baseName+="_dep"; + baseName+="_incl"; + QCString mapName=m_startNode->m_label.copy(); + if (m_inverse) mapName+="dep"; - findMaximalDotGraph(m_startNode,m_maxDistance,baseName,thisDir,format); + findMaximalDotGraph(m_startNode,m_maxDistance,baseName,thisDir,format, + FALSE,FALSE,!m_inverse); if (format==GIF) { @@ -1247,8 +1258,8 @@ void DotInclDepGraph::writeGraph(QTextStream &out, } out << "

    m_label << "_map\">
    " << endl; - out << "m_label << "_map\">" << endl; + << mapName << "_map\">" << endl; + out << "" << endl; convertMapFile(out,baseName+".map"); out << "

    " << endl; thisDir.remove(baseName+".map"); @@ -1257,7 +1268,6 @@ void DotInclDepGraph::writeGraph(QTextStream &out, { // run dot to create a .eps image QCString dotCmd; - dotCmd.sprintf("%sdot -Tps \"%s.dot\" -o \"%s.eps\"", Config::dotPath.data(),baseName.data(),baseName.data()); if (system(dotCmd)!=0) diff --git a/src/dot.h b/src/dot.h index 94b5162..e3c8c5d 100644 --- a/src/dot.h +++ b/src/dot.h @@ -52,7 +52,9 @@ class DotNode const QCString &baseName, bool lrRank, bool renderParents, - int distance); + int distance, + bool backArrow + ); public: DotNode(int n,const char *lab,const char *url,int distance = 0,bool rootNode=FALSE); ~DotNode(); @@ -70,7 +72,7 @@ class DotNode void removeParent(DotNode *n); int number() const { return m_number; } void write(QTextStream &t,GraphOutputFormat f,bool topDown,bool toChildren, - int maxDistance=1000); + int maxDistance=1000,bool backArrows=TRUE); int m_subgraphId; void clearWriteFlag(); @@ -137,7 +139,7 @@ class DotClassGraph class DotInclDepGraph { public: - DotInclDepGraph(FileDef *fd); + DotInclDepGraph(FileDef *fd,bool inverse=FALSE); ~DotInclDepGraph(); void writeGraph(QTextStream &t, GraphOutputFormat f,const char *path); bool isTrivial() const; @@ -150,4 +152,5 @@ class DotInclDepGraph static int m_curNodeNumber; QCString m_diskName; int m_maxDistance; + bool m_inverse; }; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 3240633..39e5f8a 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1165,10 +1165,9 @@ void buildVarList(Entry *root) root->type=root->name; QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*"); int l; - i=re.match(root->args,0,&l); + i=root->args.isEmpty() ? -1 : re.match(root->args,0,&l); root->name=root->args.mid(i,l); - root->args=root->args.mid(i+l, - root->args.find(')',i+l)-i-l); + root->args=root->args.mid(i+l,root->args.find(')',i+l)-i-l); //printf("new: type=`%s' name=`%s' args=`%s'\n", // root->type.data(),root->name.data(),root->args.data()); } @@ -1350,7 +1349,7 @@ static void buildMemberList(Entry *root) ) { int l; - if ((i=re.match(root->type,0,&l))!=-1) // function variable + if (!root->type.isEmpty() && (i=re.match(root->type,0,&l))!=-1) // function variable { root->args+=root->type.right(root->type.length()-i-l); root->type=root->type.left(i+l); @@ -1882,8 +1881,14 @@ static bool findBaseClassRelation(Entry *root,ClassDef *cd, int typeLen = baseClassName.length(); while (e') brCount--; + if (baseClassName.at(e)=='<') + { + if (e') + { + if (e') e++; else brCount--; + } e++; } if (brCount==0) // end of template was found at e @@ -2185,6 +2190,8 @@ static void addMemberDocs(Entry *root, FileDef *fd=findFileDef(inputNameDict,root->fileName,ambig); md->setBodyDef(fd); } + + } //md->setDefFile(root->fileName); //md->setDefLine(root->startLine); @@ -2192,6 +2199,7 @@ static void addMemberDocs(Entry *root, md->addSectionsToDefinition(root->anchors); addMemberToGroups(root,md); if (cd) cd->insertUsedFile(root->fileName); + //printf("root->mGrpId=%d\n",root->mGrpId); if (root->mGrpId!=-1) { if (md->getMemberGroupId()!=-1) @@ -2208,23 +2216,9 @@ static void addMemberDocs(Entry *root, } else // set group id { + //printf("setMemberGroupId=%d md=%s\n",root->mGrpId,md->name().data()); md->setMemberGroupId(root->mGrpId); } - //md->setMemberGroup(memberGroupDict[root->mGrpId]); - // if (cd) - // cd->addMemberToGroup(md,root->mGrpId); - // else if (nd) - // nd->addMemberToGroup(md,root->mGrpId); - // else - // { - // bool ambig; - // FileDef *fd=findFileDef(inputNameDict,root->fileName,ambig); - // if (fd) - // { - // //fd->addMemberToGroup(md,root->mGrpId); - // } - // } - //} } } @@ -2419,24 +2413,26 @@ static void substituteTemplateArgNames(ArgumentList *src, bool isReplaced=FALSE; QRegExp re(idMask); int i,p=0,l,c=0; - while ((i=re.match(s,p,&l))!=-1) // for each template name found at the - // member definition + while (!s.isEmpty() && (i=re.match(s,p,&l))!=-1) // for each template name found at the + // member definition { Argument *ta = c<(int)tempArgs->count() ? tempArgs->at(c) : 0; if (ta) // get matching template argument of the class { QCString dstName=s.mid(i,l); - QCString srcName=ta->type.copy(); + QCString srcName=ta->name.copy(); + if (srcName.isEmpty()) srcName=ta->type.copy(); + //printf("1.Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); int bi; if ((bi=srcName.findRev(' '))!=-1) // search for separator { - // strip the type specifier (usuall class or typename) + // strip the type specifier (usually class or typename) srcName=srcName.right(srcName.length()-bi-1); } //if (srcName.left(6)=="class ") srcName=srcName.right(srcName.length()-6); //if (srcName.left(9)=="typename ") srcName=srcName.right(srcName.length()-9); - //printf("Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); + //printf("2.Template Name = `%s' -> `%s'\n",srcName.data(),dstName.data()); if (srcName!=dstName) /* we need to substitute */ { int ti,tp=0; @@ -2478,7 +2474,7 @@ static void substituteTemplateArgNames(ArgumentList *src, } dst->append(na); } - //printf("substituteTemplateArgNames(src=`%s',tempNameStr=`%s',tempArgs=`%s',dest=`%s')\n", + //printf("substituteTemplateArgNames(\nsrc=`%s',\ntempNameStr=`%s',\ntempArgs=`%s',\ndest=`%s'\n)\n", // argListToString(src).data(), // s.data(), // argListToString(tempArgs).data(), @@ -3210,14 +3206,14 @@ static void findMember(Entry *root,QCString funcDecl,QCString related,bool overl static void findMemberDocumentation(Entry *root) { - int i,l; + int i=-1,l; QRegExp re("([a-zA-Z0-9: ]*\\*+[ \\*]*"); Debug::print(Debug::FindMembers,0, - "root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d\n", - root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec + "root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d root->mGrpId=%d\n", + root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec,root->mGrpId ); bool isFunc=TRUE; - if ((i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr + if (!root->type.isEmpty() && (i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr { root->args+=root->type.right(root->type.length()-i-l); root->type=root->type.left(i+l); @@ -3249,14 +3245,13 @@ static void findMemberDocumentation(Entry *root) else if ((root->section==Entry::FUNCTION_SEC // function || - (root->section==Entry::VARIABLE_SEC && + (root->section==Entry::VARIABLE_SEC && // variable !root->type.isEmpty() && root->type.left(8)!="typedef " && compoundKeywordDict.find(root->type)==0 ) ) && - (!root->doc.isEmpty() || !root->brief.isEmpty() || - root->bodyLine!=-1 - || (root->memSpec&Entry::Inline) + (!root->doc.isEmpty() || !root->brief.isEmpty() || root->bodyLine!=-1 || + (root->memSpec&Entry::Inline) || root->mGrpId!=-1 ) ) { @@ -3386,7 +3381,14 @@ static void findEnums(Entry *root) //} if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - md->setDefinition(nd->name()+"::"+name); + if (Config::hideScopeNames) + { + md->setDefinition(name); + } + else + { + md->setDefinition(nd->name()+"::"+name); + } nd->insertMember(md); md->setNamespace(nd); } @@ -3397,7 +3399,14 @@ static void findEnums(Entry *root) } else if (cd) { - md->setDefinition(cd->name()+"::"+name); + if (Config::hideScopeNames) + { + md->setDefinition(name); + } + else + { + md->setDefinition(cd->name()+"::"+name); + } cd->insertMember(md); cd->insertUsedFile(root->fileName); } @@ -3538,7 +3547,6 @@ static void findEnumDocumentation(Entry *root) if (root->mGrpId!=-1 && md->getMemberGroupId()==-1) { - //cd->addMemberToGroup(md,root->mGrpId); md->setMemberGroupId(root->mGrpId); } @@ -3562,6 +3570,7 @@ static void findEnumDocumentation(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->addSectionsToDefinition(root->anchors); + md->setMemberGroupId(root->mGrpId); found=TRUE; } } @@ -3853,7 +3862,8 @@ static void addSourceReferences() { //printf("Found member `%s' in file `%s' at line `%d'\n", // md->name().data(),fd->name().data(),md->getStartBodyLine()); - Definition *d=gd ? gd : (nd ? nd : fd); + Definition *d=gd!=0 ? (Definition *)gd : + (nd!=0 ? (Definition *)nd : (Definition *)fd); fd->addSourceRef(md->getStartBodyLine(),d,md); } } diff --git a/src/filedef.cpp b/src/filedef.cpp index 182793f..08b16b2 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -46,6 +46,9 @@ FileDef::FileDef(const char *p,const char *nm,const char *ref) includeList = new QList; includeList->setAutoDelete(TRUE); includeDict = new QDict(61); + includedByList = new QList; + includedByList->setAutoDelete(TRUE); + includedByDict = new QDict(61); namespaceList = new NamespaceList; namespaceDict = new NamespaceDict(7); srcDefDict = 0; @@ -188,7 +191,7 @@ void FileDef::writeDocumentation(OutputList &ol) if (Config::haveDotFlag && Config::includeGraphFlag) { //printf("Graph for file %s\n",name().data()); - DotInclDepGraph incDepGraph(this); + DotInclDepGraph incDepGraph(this,FALSE); if (!incDepGraph.isTrivial()) { ol.disable(OutputGenerator::Man); @@ -201,6 +204,22 @@ void FileDef::writeDocumentation(OutputList &ol) //incDepGraph.writeGraph(Config::htmlOutputDir,fd->getOutputFileBase()); } + if (Config::haveDotFlag && Config::includedByGraphFlag) + { + //printf("Graph for file %s\n",name().data()); + DotInclDepGraph incDepGraph(this,TRUE); + if (!incDepGraph.isTrivial()) + { + ol.disable(OutputGenerator::Man); + ol.newParagraph(); + ol.startInclDepGraph(); + parseText(ol,theTranslator->trInclByDepGraph()); + ol.endInclDepGraph(incDepGraph); + ol.enableAll(); + } + //incDepGraph.writeGraph(Config::htmlOutputDir,fd->getOutputFileBase()); + } + if (generateSource() || (!isReference() && Config::sourceBrowseFlag)) { ol.disableAllBut(OutputGenerator::Html); @@ -454,6 +473,7 @@ void FileDef::addMemberListToGroup(MemberList *ml, { QCString *pGrpHeader = memberHeaderDict[groupId]; QCString *pDocs = memberDocDict[groupId]; + //printf("Member `%s' pGrpHeader=%p\n",md->name().data(),pGrpHeader); if (pGrpHeader) { MemberGroup *mg = memberGroupDict->find(groupId); @@ -463,6 +483,7 @@ void FileDef::addMemberListToGroup(MemberList *ml, memberGroupDict->insert(groupId,mg); memberGroupList->append(mg); } + //printf("insert member %s in group %s\n",md->name().data(),pGrpHeader->data()); mg->insertMember(md); md->setMemberGroup(mg); } @@ -595,6 +616,21 @@ void FileDef::addIncludeDependency(FileDef *fd,const char *incName,bool local) } } +void FileDef::addIncludedByDependency(FileDef *fd,const char *incName,bool local) +{ + //printf("FileDef::addIncludedByDependency(%p,%s,%d)\n",fd,incName,local); + QCString iName = fd ? fd->absFilePath().data() : incName; + if (!iName.isEmpty() && includedByDict->find(iName)==0) + { + IncludeInfo *ii = new IncludeInfo; + ii->fileDef = fd; + ii->includeName = incName; + ii->local = local; + includedByList->append(ii); + includedByDict->insert(iName,ii); + } +} + //----------------------------------------------------------------------------- /*! Creates a file list. */ diff --git a/src/filedef.h b/src/filedef.h index 0bc19d6..0dd8d05 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -122,9 +122,11 @@ class FileDef : public Definition void setGenerateSource(bool b) { isSource=b; } bool generateSource() const { return isSource; } + void addIncludeDependency(FileDef *fd,const char *incName,bool local); + void addIncludedByDependency(FileDef *fd,const char *incName,bool local); QList *includeFileList() const { return includeList; } - QDict *includeFileDict() const { return includeDict; } + QList *includedByFileList() const { return includedByList; } void addMembersToMemberGroup(); void distributeMemberGroupDocumentation(); @@ -145,6 +147,8 @@ class FileDef : public Definition ClassList *classList; QDict *includeDict; QList *includeList; + QDict *includedByDict; + QList *includedByList; NamespaceDict *namespaceDict; NamespaceList *namespaceList; NamespaceList *usingDirList; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 036abe4..192e6d4 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -48,22 +48,47 @@ static QCString filterTitle(const char *s) return result; } -static QCString escapeLabelName(const QCString &s) +static QCString escapeLabelName(const char *s) { QCString result; - uint i; - for (i=0;idocify(str); break; + } + } + return result; +} + LatexGenerator::LatexGenerator() : OutputGenerator() { @@ -178,7 +203,7 @@ void LatexGenerator::startIndexSection(IndexSections is) t << "}\n"; if (Config::paperType=="a4wide") t << "\\usepackage{a4wide}\n"; t << "\\usepackage{makeidx}\n" - "\\usepackage{fancyheadings}\n" + "\\usepackage{fancyhdr}\n" "\\usepackage{epsfig}\n" "\\usepackage{float}\n" "\\usepackage{doxygen}\n"; @@ -865,11 +890,11 @@ void LatexGenerator::startMemberDoc(const char *clname, t << "}!"; } t << escapeLabelName(memname) << "@{"; - docify(memname); + escapeMakeIndexChars(this,t,memname); t << "}}" << endl; t << "\\index{" << escapeLabelName(memname) << "@{"; - docify(memname); + escapeMakeIndexChars(this,t,memname); t << "}"; if (clname) { @@ -934,7 +959,7 @@ void LatexGenerator::addToIndex(const char *s1,const char *s2) if (s1) { t << "\\index{" << escapeLabelName(s1) << "@{"; - docify(s1); + escapeMakeIndexChars(this,t,s1); t << "}"; if (s2) { diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 3613f78..f08a858 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -475,8 +475,8 @@ void MemberDef::writeDeclaration(OutputList &ol, if (Config::hideMemberFlag && documentation().isEmpty() && !Config::briefMemDescFlag && !Config::repeatBriefFlag ) return; - // hide static file & namespace members unless extract private is on - if (cd==0 && isStatic() && !Config::extractPrivateFlag) return; + // hide static file & namespace members unless extract static is on + if (cd==0 && isStatic() && !Config::extractStaticFlag) return; // hide private member that are put into a member group. Non-grouped // members are not rendered anyway. @@ -489,7 +489,8 @@ void MemberDef::writeDeclaration(OutputList &ol, // strip `friend' keyword from type if (type.left(7)=="friend ") type=type.right(type.length()-7); static QRegExp r("@[0-9]+"); - if ((i=r.match(type,0,&l))==-1 || !enumUsed()) + i=-1; + if ((type.isEmpty() || (i=r.match(type,0,&l))==-1) || !enumUsed()) { if (!Config::genTagFile.isEmpty()) @@ -792,7 +793,7 @@ void MemberDef::writeDeclaration(OutputList &ol, void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, const char *scopeName) { - if (memberClass()==0 && isStatic() && !Config::extractPrivateFlag) return; + if (memberClass()==0 && isStatic() && !Config::extractStaticFlag) return; bool hasDocs = detailsAreVisible(); //printf("MemberDef::writeDocumentation(): type=`%s' def=`%s'\n",type.data(),definition()); if ( @@ -834,14 +835,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, int i=0,l; static QRegExp r("@[0-9]+"); - //ENUM if (isEnumValue()) return; - //if (isEnumValue() && def[0]=='@') def = def.right(def.length()-2); - //int dummy; - //if (isEnumerate() && r.match(def,0,&l)!=-1) return; - //MemberDef *smd; - //if (isEnumValue() && (smd = getEnumScope()) - // && r.match(smd->name(),0,&dummy)==-1) return; ol.pushGeneratorState(); @@ -1342,7 +1336,7 @@ bool MemberDef::isLinkableInProject() ((hasDocumentation() && !isReference()) ) && (prot!=Private || Config::extractPrivateFlag || isFriend()) && // not a private class member - (classDef!=0 || Config::extractPrivateFlag || !isStatic()); // not a private file/namespace member + (classDef!=0 || Config::extractStaticFlag || !isStatic()); // not a static file/namespace member } bool MemberDef::isLinkable() diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 7590079..516a284 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -111,14 +111,17 @@ int MemberGroup::countDecMembers(bool sectionPerType) void MemberGroup::distributeMemberGroupDocumentation() { + //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",grpHeader.data()); MemberDef *md=memberList->first(); - if (md && md->hasDocumentation()) + if (md && !(md->documentation().isEmpty() && md->briefDescription().isEmpty())) { + //printf("First member %s has documentation!\n",md->name().data()); MemberDef *omd=memberList->next(); while (omd) { - if (!omd->hasDocumentation()) + if (omd->documentation().isEmpty() && omd->briefDescription().isEmpty()) { + //printf("Copying documentation to member %s\n",omd->name().data()); omd->setBriefDescription(md->briefDescription()); omd->setDocumentation(md->documentation()); } diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 7a862a8..e49b0ef 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -54,7 +54,7 @@ void MemberList::countDecMembers(bool inGroup,bool countSubGroups,bool sectionPe { //printf("md=%p md->name()=`%s' inGroup=%d getMemberGroup()=%p\n", // md,md->name().data(),inGroup,md->getMemberGroup()); - if (!(md->memberClass()==0 && md->isStatic() && !Config::extractPrivateFlag) && + if (!(md->memberClass()==0 && md->isStatic() && !Config::extractStaticFlag) && (!Config::hideMemberFlag || md->hasDocumentation()) && ( (!Config::hideMemberFlag || !md->documentation().isEmpty() || @@ -119,7 +119,7 @@ void MemberList::countDocMembers() //printf("%s MemberList::countDocMembers() details=%d\n", // md->name().data(),md->detailsAreVisible()); bool visibleIfStatic = - !(md->memberClass()==0 && md->isStatic() && !Config::extractPrivateFlag); + !(md->memberClass()==0 && md->isStatic() && !Config::extractStaticFlag); if (visibleIfStatic && (Config::extractAllFlag || md->detailsAreVisible()) diff --git a/src/pre.l b/src/pre.l index 04e67e0..11efd91 100644 --- a/src/pre.l +++ b/src/pre.l @@ -120,7 +120,8 @@ static void decrLevel() } else { - err("Error: More #endif's than #if's found.\n"); + err("%s:%d: Error: More #endif's than #if's found.\n", + g_yyFileName.data(),g_yyLineNr); } } @@ -128,7 +129,8 @@ static bool otherCaseDone() { if (g_level==0) { - err("Error: Found an #else without a preceding #if.\n"); + err("%s:%d: Error: Found an #else without a preceding #if.\n", + g_yyFileName.data(),g_yyLineNr); return TRUE; } else @@ -165,7 +167,7 @@ static FILE *findFile(const char *fileName) { QCString absName=(QCString)s+"/"+fileName; QFileInfo fi(absName); - if (fi.exists()) + if (fi.exists() && fi.isFile()) { FILE *f; if (!Config::inputFilter.isEmpty()) @@ -279,6 +281,7 @@ static void processConcatOperators(QCString &expr) { QRegExp r("[ \\t\\n]*##[ \\t\\n]*"); int l,n,i=0; + if (expr.isEmpty()) return; while ((n=r.match(expr,i,&l))!=-1) { if (n+l+1<(int)expr.length() && expr.at(n+l)=='@' && expr.at(n+l+1)=='-') @@ -840,6 +843,11 @@ static void readIncludeFile(const QCString &inc) { // add include dependency to the file in which the #include was found oldFileDef->addIncludeDependency(g_yyFileDef,incFileName,localInclude); + // add included by dependency + if (g_yyFileDef) + { + g_yyFileDef->addIncludedByDependency(oldFileDef,oldFileDef->name(),localInclude); + } } // store the state of the old file FileState *fs=new FileState; @@ -861,6 +869,11 @@ static void readIncludeFile(const QCString &inc) FileDef *fd = findFileDef(inputNameDict,incFileName,ambig); // add include dependency to the file in which the #include was found oldFileDef->addIncludeDependency(fd,incFileName,localInclude); + // add included by dependency + if (fd) + { + fd->addIncludedByDependency(oldFileDef,oldFileDef->name(),localInclude); + } } #if SHOW_INCLUDES msg("#include %s: not found! skipping...\n",incFileName.data()); diff --git a/src/scanner.l b/src/scanner.l index 1c2bc01..7b098f8 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -83,6 +83,7 @@ static int lastFormulaContext; static int lastAnchorContext; static int lastInitializerContext; static int lastClassTemplSpecContext; +static int lastSkipHtmlCommentContext; static int nextDefContext; static int overloadContext; static Protection protection; @@ -130,6 +131,7 @@ static bool inReturnBlock; static bool inAuthorBlock; static bool inDeprecatedBlock; static bool inVersionBlock; +static bool inSinceBlock; static bool inDateBlock; static bool inBugBlock; static bool inNoteBlock; @@ -218,6 +220,7 @@ static void initParser() inAuthorBlock = FALSE; inDeprecatedBlock = FALSE; inVersionBlock = FALSE; + inSinceBlock = FALSE; inDateBlock = FALSE; inBugBlock = FALSE; inNoteBlock = FALSE; @@ -669,7 +672,7 @@ static void tryEndItemList() static bool inBlock() { return inParamBlock || inRetValBlock || inSeeBlock || inReturnBlock || inAuthorBlock || - inVersionBlock || inDateBlock || inWarningBlock || inRemarkBlock || + inVersionBlock || inSinceBlock || inDateBlock || inWarningBlock || inRemarkBlock || inAttentionBlock || inBugBlock || inNoteBlock || inParBlock || inExceptionBlock || inDeprecatedBlock || inPreBlock || inPostBlock || inInvarBlock; @@ -684,7 +687,7 @@ static void endBlock() } outDoc->endDescList(); inParamBlock=inRetValBlock=inSeeBlock=inReturnBlock=inAuthorBlock= - inVersionBlock=inDateBlock=inBugBlock=inNoteBlock=inWarningBlock= + inVersionBlock=inSinceBlock=inDateBlock=inBugBlock=inNoteBlock=inWarningBlock= inParBlock=inExceptionBlock=inDeprecatedBlock=inPreBlock=inPostBlock= inInvarBlock=inRemarkBlock=inAttentionBlock=FALSE; } @@ -965,7 +968,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") %x FuncQual %x Operator %x Array -%x Curly +%x ReadBody %x Using %x UsingDirective %x NameSpaceDocArg1 @@ -1089,7 +1092,7 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") %x ReadFuncArgType %x ReadTempArgs %x Specialization -%x DocSkipHtmlComment +%x SkipHtmlComment %x ReadFormulaShort %x ReadFormulaLong %x AnchorLabel @@ -1149,9 +1152,6 @@ DOCPARAM ([a-z_A-Z0-9:\<\>\=\.\-]+)|("\"".*"\"") \n{B}*(("//"{B}*)?)"*"*{B}*"-"{B}+ { addListItemMarker(yytext+1); } -"