From 1c51f44b5f0b3510618a283d522aab0741ddb3a1 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Tue, 28 Dec 2004 15:52:58 +0000 Subject: Release-1.3.9.1-20041228 --- INSTALL | 4 +- README | 4 +- VERSION | 2 +- doc/config.doc | 56 ++++++- doc/install.doc | 38 +---- doc/language.doc | 11 +- doc/translator_report.txt | 20 +-- packages/rpm/doxygen.spec | 2 +- src/classdef.cpp | 146 ++++++++-------- src/classdef.h | 1 + src/cmdmapper.cpp | 2 +- src/cmdmapper.h | 2 +- src/commentcnv.l | 38 ++++- src/config.l | 203 +++++++--------------- src/dirdef.cpp | 31 +++- src/docparser.cpp | 171 ++++++++++--------- src/docparser.h | 34 ++-- src/docvisitor.h | 6 +- src/dot.cpp | 420 ++++++++++++++++++++++++++++++++-------------- src/dot.h | 22 +++ src/doxygen.cpp | 136 ++++++++------- src/filedef.cpp | 65 ++++++- src/filedef.h | 13 +- src/htmldocvisitor.cpp | 36 ++-- src/htmldocvisitor.h | 4 +- src/htmlgen.cpp | 9 +- src/latexdocvisitor.cpp | 36 ++-- src/latexdocvisitor.h | 4 +- src/mandocvisitor.cpp | 36 ++-- src/mandocvisitor.h | 4 +- src/memberdef.cpp | 8 +- src/memberdef.h | 5 +- src/memberlist.cpp | 1 - src/message.cpp | 150 ++++++++++------- src/perlmodgen.cpp | 24 +-- src/printdocvisitor.h | 20 +-- src/rtfdocvisitor.cpp | 40 ++--- src/rtfdocvisitor.h | 4 +- src/scanner.l | 51 ++++-- src/xmldocvisitor.cpp | 22 +-- src/xmldocvisitor.h | 4 +- 41 files changed, 1114 insertions(+), 771 deletions(-) diff --git a/INSTALL b/INSTALL index 039e19c..887f7b1 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.3.9.1-20041224 +DOXYGEN Version 1.3.9.1-20041228 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (24 December 2004) +Dimitri van Heesch (28 December 2004) diff --git a/README b/README index 37e90c7..34f8162 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.3.9.1_20041224 +DOXYGEN Version 1.3.9.1_20041228 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) (24 December 2004) +Dimitri van Heesch (dimitri@stack.nl) (28 December 2004) diff --git a/VERSION b/VERSION index f33edb0..ba9fa2a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.9.1-20041224 +1.3.9.1-20041228 diff --git a/doc/config.doc b/doc/config.doc index 8885525..ab2934d 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -19,7 +19,7 @@ \section config_format Format A configuration file is a free-form ASCII text file with a structure -that is similar to that of a Makefile, default name \c Doxyfile. It is +that is similar to that of a Makefile, with the default name \c Doxyfile. It is parsed by \c doxygen. The file may contain tabs and newlines for formatting purposes. The statements in the file are case-sensitive. Comments may be placed anywhere within the file (except within quotes). @@ -35,7 +35,7 @@ new values to the list. Values are sequences of non-blanks. If the value should contain one or more blanks it must be surrounded by quotes ("..."). Multiple lines can be concatenated by inserting a backslash (\\) as the last character of a line. Environment variables can be expanded -using the pattern \c \$(ENV_VARIABLE_NAME). +using the pattern \$(ENV_VARIABLE_NAME). You can also include part of a configuration file from another configuration file using a \@INCLUDE tag as follows: @@ -77,7 +77,9 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_disable_index DISABLE_INDEX \refitem cfg_distribute_group_doc DISTRIBUTE_GROUP_DOC \refitem cfg_dot_image_format DOT_IMAGE_FORMAT +\refitem cfg_dot_multi_targets DOT_MULTI_TARGETS \refitem cfg_dot_path DOT_PATH +\refitem cfg_dot_transparent DOT_TRANSPARENT \refitem cfg_dotfile_dirs DOTFILE_DIRS \refitem cfg_enable_preprocessing ENABLE_PREPROCESSING \refitem cfg_enum_values_per_line ENUM_VALUES_PER_LINE @@ -98,6 +100,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_extract_private EXTRACT_PRIVATE \refitem cfg_extract_static EXTRACT_STATIC \refitem cfg_file_patterns FILE_PATTERNS +\refitem cfg_file_version_filter FILE_VERSION_FILTER \refitem cfg_filter_patterns FILTER_PATTERNS \refitem cfg_filter_source_files FILTER_SOURCE_FILES \refitem cfg_full_path_names FULL_PATH_NAMES @@ -726,6 +729,39 @@ documentation. *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm +\anchor cfg_file_version_filter +
\c FILE_VERSION_FILTER
+ \addindex FILE_VERSION_FILTER + The \c FILE_VERSION_FILTER tag can be used to specify a program or script that + doxygen should invoke to get the current version for each file (typically from the + version control system). Doxygen will invoke the program by executing (via + popen()) the command command input-file, where \c command is + the value of the \c FILE_VERSION_FILTER tag, and \c input-file is the name + of an input file provided by doxygen. + Whatever the progam writes to standard output is used as the file version. + +Example of using a shell script as a filter for Unix: +\verbatim + FILE_VERSION_FILTER = "/bin/sh versionfilter.sh" +\endverbatim + +Example shell script for CVS: +\verbatim +#!/bin/sh +cvs status $1 | sed -n 's/^[ \]*Working revision:[ \t]*\([0-9][0-9\.]*\).*/\1/p' +\endverbatim + +Example shell script for Subversion: +\verbatim +#!/bin/sh +svn stat -v $1 | sed -n 's/^[ A-Z?\*|!]\{1,15\}/r/;s/ \{1,15\}/\/r/;s/ .*//p' +\endverbatim + +Example filter for ClearCase: +\verbatim +FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" +\endverbatim + \anchor cfg_recursive
\c RECURSIVE
\addindex RECURSIVE @@ -1655,6 +1691,22 @@ not depth-constraint. the specified constraint. Beware that most browsers cannot cope with very large images. +\anchor cfg_dot_transparent +
\c DOT_TRANSPARENT
+ \addindex DOT_TRANSPARENT + Set the \c DOT_TRANSPARENT tag to \c YES to generate images with a transparent + background. This is disabled by default, which results in a white background. + Warning: Depending on the platform used, enabling this option may lead to badly + anti-aliased labels on the edges of a graph (i.e. they become hard to read). + +\anchor cfg_dot_multi_targets +
\c DOT_MULTI_TARGETS
+ \addindex DOT_MULTI_TARGET + Set the \c DOT_MULTI_TARGETS tag to \c YES allow dot to generate multiple output + files in one run (i.e. multiple -o and -T options on the command line). This + makes dot run faster, but since only newer versions of dot (>1.8.10) + support this, this feature is disabled by default. + \anchor cfg_generate_legend
\c GENERATE_LEGEND
\addindex GENERATE_LEGEND diff --git a/doc/install.doc b/doc/install.doc index 3c9a74b..950fe02 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -104,9 +104,9 @@ Compilation is now done by performing the following steps: See the PLATFORMS file for a list of possible platform options. - If you have Qt-2.1.x installed and want to build the GUI front-end, you - should run the configure script with the --with-doxywizard - option: + If you have Qt-3.2.x or higher installed and want to build the GUI + front-end, you should run the configure script with + the --with-doxywizard option: \verbatim configure --with-doxywizard @@ -297,32 +297,10 @@ ce_parse.cpp: Sun compiler problems -I tried compiling doxygen only with Sun's C++ WorkShop Compiler -version 5.0 (I used ./configure --platform solaris-cc) - -Qt-2.x.y is required for this compiler (Qt-1.44 has problems with the bool -type). - -Compiling the \c doxygen binary went ok, but while linking doxytag I got a -lot of link errors, like these: - -\verbatim -QList::__vtbl /home/dimitri/doxygen/ -objects/SunWS_cache/CC_obj_6/6c3eO4IogMT2vrlGCQUQ.o -[Hint: try checking whether the first non-inlined, non-pure -virtual function of class QList is defined] -\endverbatim - -These are generated because the compiler is confused about the object sharing -between \c doxygen and \c doxytag. To compile \c doxytag -anyway do: - -\verbatim -rm -rf objects -mkdir objects -cd src -gmake -f Makefile.doxytag -\endverbatim +It appears that doxygen doesn't work properly if it is compiled +with Sun's C++ WorkShop Compiler. I cannot verify this myself as I do +not have access to a Solaris machine with this compiler. With GNU compiler +it does work. when configuring with --static I got: @@ -467,7 +445,7 @@ Here is what is required: still a requirement however. A commercial license to build doxywizard with the latest Qt library was kindly donated to me by the nice people at TrollTech. - See doxygen download page for a link. + See doxygen download page for a link.
  • If you used WinZip to extract the tar archive it will (apparently) not create empty folders, so you have to add the folders diff --git a/doc/language.doc b/doc/language.doc index 38e629d..3737086 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -23,7 +23,7 @@ text fragments, generated by doxygen, can be produced in languages other than English (the default). The output language is chosen through the configuration file (with default name and known as Doxyfile). -Currently (version 1.3.9.1-20041129), 30 languages +Currently (version 1.3.9.1-20041221), 30 languages are supported (sorted alphabetically): Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, @@ -160,9 +160,9 @@ when the translator was updated. Korean - Richard Kim - ryk at dspwiz dot com - 1.3.8 + SooYoung Jung
    Richard Kim + jung5000 at gmail dot com
    ryk at dspwiz dot com + up-to-date KoreanEn @@ -299,7 +299,8 @@ when the translator was updated. \hline JapaneseEn & see the Japanese language & {\tt\tiny ~} & English based \\ \hline - Korean & Richard Kim & {\tt\tiny ryk@dspwiz.com} & 1.3.8 \\ + Korean & SooYoung Jung & {\tt\tiny jung5000@gmail.com} & up-to-date \\ + ~ & Richard Kim & {\tt\tiny ryk@dspwiz.com} & ~ \\ \hline KoreanEn & see the Korean language & {\tt\tiny ~} & English based \\ \hline diff --git a/doc/translator_report.txt b/doc/translator_report.txt index 41cb44f..9a80657 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -1,4 +1,4 @@ -(1.3.9.1-20041129) +(1.3.9.1-20041221) Doxygen supports the following 30 languages (sorted alphabetically): @@ -8,7 +8,7 @@ German, Greek, Hungarian, Italian, Japanese (+En), Korean (+En), Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. -Of them, 14 translators are up-to-date, 16 translators are based on +Of them, 15 translators are up-to-date, 15 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -27,6 +27,7 @@ still may be some details listed even for them: TranslatorGerman TranslatorHungarian TranslatorItalian + TranslatorKorean -- Change the base class to Translator. TranslatorPolish TranslatorRussian TranslatorSerbian @@ -44,7 +45,6 @@ must be implemented to become up-to-date: TranslatorAfrikaans 1.3.9 6 methods to implement TranslatorSpanish 1.3.8 7 methods to implement TranslatorLithuanian 1.3.8 7 methods to implement - TranslatorKorean 1.3.8 7 methods to implement TranslatorChinesetraditional 1.3.8 7 methods to implement TranslatorPortuguese 1.3.3 11 methods to implement TranslatorSlovak 1.2.18 20 methods to implement @@ -340,20 +340,10 @@ TranslatorJapaneseEn (TranslatorEnglish) 196 methods to implement virtual QCString idLanguageCharset() -TranslatorKorean (TranslatorAdapter_1_3_8) 7 methods to implement +TranslatorKorean (TranslatorAdapter_1_3_9) ---------------- - Implements 194 of the required methods. - - Missing methods (should be implemented): - - virtual QCString trDirIndex() - virtual QCString trDirDocumentation() - virtual QCString trDirectories() - virtual QCString trDirDescription() - virtual QCString trSourceFile(QCString & filename) - virtual QCString trDirReference(const char * dirName) - virtual QCString trDir(bool first_capital, bool singular) + Implements 201 of the required methods. TranslatorKoreanEn (TranslatorEnglish) 196 methods to implement diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index c9d35ca..b983065 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.9.1_20041224 +Version: 1.3.9.1_20041228 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index ce8431c..da83484 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -936,6 +936,84 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &pageType } } +void ClassDef::showUsedFiles(OutputList &ol) +{ + if (Config_getBool("SHOW_USED_FILES")) + { + ol.writeRuler(); + ol.parseText(theTranslator->trGeneratedFromFiles( + m_isObjC && m_compType==Interface ? Class : m_compType, + m_files.count()==1)); + + bool first=TRUE; + const char *file = m_files.first(); + while (file) + { + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameDict,file,ambig); + if (fd) + { + if (first) + { + first=FALSE; + ol.startItemList(); + } + + ol.writeListItem(); + QCString path=fd->getPath().copy(); + if (Config_getBool("FULL_PATH_NAMES")) + { + ol.docify(stripFromPath(path)); + } + + QCString fname = fd->name(); + if (!fd->getVersion().isEmpty()) // append version if available + { + fname += " (" + fd->getVersion() + ")"; + } + + // for HTML + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + if (fd->generateSourceFile()) + { + ol.writeObjectLink(0,fd->getSourceFileBase(),0,fname); + } + else if (fd->isLinkable()) + { + ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0, + fname); + } + else + { + ol.docify(fname); + } + ol.popGeneratorState(); + + // for other output formats + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + if (fd->isLinkable()) + { + ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0, + fname); + } + else + { + ol.docify(fname); + } + + ol.popGeneratorState(); + + + } + file=m_files.next(); + } + if (!first) ol.endItemList(); + } +} + + // write all documentation for this class void ClassDef::writeDocumentation(OutputList &ol) { @@ -1389,73 +1467,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); - if (Config_getBool("SHOW_USED_FILES")) - { - ol.writeRuler(); - ol.parseText(theTranslator->trGeneratedFromFiles( - m_isObjC && m_compType==Interface ? Class : m_compType, - m_files.count()==1)); - - bool first=TRUE; - const char *file = m_files.first(); - while (file) - { - bool ambig; - FileDef *fd=findFileDef(Doxygen::inputNameDict,file,ambig); - if (fd) - { - if (first) - { - first=FALSE; - ol.startItemList(); - } - - ol.writeListItem(); - QCString path=fd->getPath().copy(); - if (Config_getBool("FULL_PATH_NAMES")) - { - ol.docify(stripFromPath(path)); - } - - // for HTML - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - if (fd->generateSourceFile()) - { - ol.writeObjectLink(0,fd->getSourceFileBase(),0,fd->name()); - } - else if (fd->isLinkable()) - { - ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0, - fd->name()); - } - else - { - ol.docify(fd->name()); - } - ol.popGeneratorState(); - - // for other output formats - ol.pushGeneratorState(); - ol.disable(OutputGenerator::Html); - if (fd->isLinkable()) - { - ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0, - fd->name()); - } - else - { - ol.docify(fd->name()); - } - - ol.popGeneratorState(); - - - } - file=m_files.next(); - } - if (!first) ol.endItemList(); - } + showUsedFiles(ol); // write Author section (Man only) ol.enable(OutputGenerator::Man); diff --git a/src/classdef.h b/src/classdef.h index f73a7d1..0cbc49d 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -333,6 +333,7 @@ class ClassDef : public Definition void addUsedInterfaceClasses(MemberDef *md,const char *typeStr); bool hasExamples(); bool hasNonReferenceSuperClass(); + void showUsedFiles(OutputList &ol); /*! \} Interal API */ diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index b3047e2..d955f97 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -99,7 +99,7 @@ CommandMap cmdMap[] = { "$", CMD_DOLLAR }, { "#", CMD_HASH }, { "%", CMD_PERCENT }, - { "~", CMD_LANGSWITCH }, + //{ "~", CMD_LANGSWITCH }, { "_internalref", CMD_INTERNALREF }, { "dot", CMD_DOT }, { "enddot", CMD_ENDDOT }, diff --git a/src/cmdmapper.h b/src/cmdmapper.h index a68d2bc..2e3f2c2 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -66,7 +66,7 @@ enum CommandType CMD_INTERNAL = 32, CMD_INTERNALREF = 33, CMD_INVARIANT = 34 | SIMPLESECT_BIT , - CMD_LANGSWITCH = 35, + //CMD_LANGSWITCH = 35, CMD_LATEXONLY = 36, CMD_LESS = 37, CMD_LI = 38, diff --git a/src/commentcnv.l b/src/commentcnv.l index dc152a1..d129ff3 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -245,6 +245,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) %x Verbatim %x ReadLine %x CondLine +%x SkipLang %% @@ -290,18 +291,18 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) copyToOutput(yytext,yyleng); BEGIN(CComment); } -"\\verbatim" { /* start of a verbatim block */ +[\\@]"verbatim" { /* start of a verbatim block */ copyToOutput(yytext,yyleng); BEGIN(Verbatim); } . { /* any other character */ copyToOutput(yytext,yyleng); } -"\\endverbatim" { /* end of verbatim block */ +[\\@]"endverbatim" { /* end of verbatim block */ copyToOutput(yytext,yyleng); BEGIN(Scan); } -[^\\\n]* { /* any character not a backslash or new line */ +[^@\\\n]* { /* any character not a backslash or new line */ copyToOutput(yytext,yyleng); } \n { /* new line in verbatim block */ @@ -310,6 +311,25 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) . { /* any other character */ copyToOutput(yytext,yyleng); } +[\\@]"~"[a-zA-Z]* { /* end of verbatim block */ + QCString langId = &yytext[2]; + if (langId.isEmpty() || + stricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)==0) + { // enable language specific section + BEGIN(CComment); + } + } +[^*@\\\n]* { /* any character not a *, @, backslash or new line */ + } +\n { /* new line in verbatim block */ + copyToOutput(yytext,yyleng); + } +"*/" { /* end of comment block */ + copyToOutput(yytext,yyleng); + BEGIN(Scan); + } +. { /* any other character */ + } \\. { /* escaped character in string */ copyToOutput(yytext,yyleng); } @@ -323,7 +343,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) \n { /* new line inside string (illegal for some compilers) */ copyToOutput(yytext,yyleng); } -[^\\@*\n]* { /* anything that is not a '*' */ +[^\\@*\n]* { /* anything that is not a '*' or command */ copyToOutput(yytext,yyleng); } "*"+[^*/\\@\n]* { /* stars without slashes */ @@ -388,9 +408,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) copyToOutput(yytext,yyleng); BEGIN(g_readLineCtx); } -("\\\\"|"@@")[a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command +("\\\\"|"@@")[~a-z_A-Z][a-z_A-Z0-9]*[ \t]* { // escaped command copyToOutput(yytext,yyleng); } +[@\\]"~"[a-zA-Z]* { // language switch + QCString langId = &yytext[2]; + if (!langId.isEmpty() && + stricmp(Config_getEnum("OUTPUT_LANGUAGE"),langId)!=0) + { + BEGIN(SkipLang); + } + } [\\@]"cond"[ \t]+ { // conditional section g_condCtx = YY_START; BEGIN(CondLine); diff --git a/src/config.l b/src/config.l index 06bf179..972f3d3 100644 --- a/src/config.l +++ b/src/config.l @@ -1139,113 +1139,6 @@ void Config::check() examplePatternList.append("*"); } - // add default pattern if needed - //QStrList &imagePatternList = Config_getList("IMAGE_PATTERNS"); - //if (imagePatternList.isEmpty()) - //{ - // imagePatternList.append("*"); - //} - - // more checks needed if and only if the search engine is enabled. -// if (Config_getBool("SEARCHENGINE")) -// { -// // check cgi name -// QCString &cgiName = Config_getString("CGI_NAME"); -// if (cgiName.isEmpty()) -// { -// config_err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n"); -// exit(1); -// } -// // check cgi URL -// QCString &cgiURL = Config_getString("CGI_URL"); -// if (cgiURL.isEmpty()) -// { -// config_err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); -// exit(1); -// } -// else if (cgiURL.left(7)!="http://" && -// cgiURL.left(8)!="https://" && -// cgiURL.left(4)!="cgi:" -// ) -// { -// config_err("Error: tag CGI_URL: URL to cgi directory is invalid (must " -// "start with http:// or https://).\n"); -// exit(1); -// } -// // check documentation URL -// QCString &docURL = Config_getString("DOC_URL"); -// if (docURL.isEmpty()) -// { -// docURL = Config_getString("OUTPUT_DIRECTORY").copy().prepend("file://").append("html"); -// } -// else if (docURL.left(7)!="http://" && -// docURL.left(8)!="https://" && -// docURL.left(7)!="file://" -// ) -// { -// config_err("Error: tag DOC_URL: URL to documentation is invalid or " -// "not absolute.\n"); -// exit(1); -// } -// // check absolute documentation path -// QCString &docAbsPath = Config_getString("DOC_ABSPATH"); -// if (docAbsPath.isEmpty()) -// { -// docAbsPath = Config_getString("OUTPUT_DIRECTORY")+"/html"; -// } -// else if (docAbsPath[0]!='/' && docAbsPath[1]!=':') -// { -// config_err("Error: tag DOC_ABSPATH: path is not absolute!\n"); -// exit(1); -// } -// // check path to doxysearch -// QCString &binAbsPath = Config_getString("BIN_ABSPATH"); -// if (binAbsPath.isEmpty()) -// { -// config_err("Error: tag BIN_ABSPATH: no absolute path to doxysearch " -// "specified.\n"); -// exit(1); -// } -// else if (binAbsPath[0]!='/' && binAbsPath[1]!=':') -// { -// config_err("Error: tag BIN_ABSPATH: path is not absolute!\n"); -// exit(1); -// } -// -// } -// // check perl path -// bool found=FALSE; -// QCString &perlPath = Config_getString("PERL_PATH"); -// if (perlPath.isEmpty()) -// { -// QFileInfo fi; -// fi.setFile("/usr/bin/perl"); -// if (fi.exists()) -// { -// perlPath="/usr/bin/perl"; -// found=TRUE; -// } -// else -// { -// fi.setFile("/usr/local/bin/perl"); -// if (fi.exists()) -// { -// perlPath="/usr/local/bin/perl"; -// found=TRUE; -// } -// } -// } -// if (!found) -// { -// QFileInfo fi(perlPath); -// if (!fi.exists()) -// { -// config_warn("Warning: tag PERL_PATH: perl interpreter not found at default or" -// "user specified (%s) location\n", -// perlPath.data()); -// } -// } - #undef PUTENV #undef SEP #if defined(_WIN32) && !defined(__GNUC__) && (__BORLANDC__ < 0x0550) @@ -1352,9 +1245,9 @@ void Config::create() "If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n" "4096 sub-directories (in 2 levels) under the output directory of each output \n" "format and will distribute the generated files over these directories. \n" - "Enabling this option can be useful when feeding doxygen a huge amount of source \n" - "files, where putting all generated files in the same directory would otherwise \n" - "cause performance problems for the file system. \n", + "Enabling this option can be useful when feeding doxygen a huge amount of \n" + "source files, where putting all generated files in the same directory would \n" + "otherwise cause performance problems for the file system. \n", FALSE ); ce = addEnum( @@ -1490,11 +1383,12 @@ void Config::create() "This tag implements a quasi-intelligent brief description abbreviator \n" "that is used to form the text in various listings. Each string \n" "in this list, if found as the leading text of the brief description, will be \n" - "stripped from the text and the result after processing the whole list, is used \n" - "as the annotated text. Otherwise, the brief description is used as-is. If left \n" - "blank, the following values are used (\"$name\" is automatically replaced with the \n" - "name of the entity): \"The $name class\" \"The $name widget\" \"The $name file\" \n" - "\"is\" \"provides\" \"specifies\" \"contains\" \"represents\" \"a\" \"an\" \"the\"\n" + "stripped from the text and the result after processing the whole list, is \n" + "used as the annotated text. Otherwise, the brief description is used as-is. \n" + "If left blank, the following values are used (\"$name\" is automatically \n" + "replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n" + "\"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n" + "\"represents\" \"a\" \"an\" \"the\"\n" ); cb = addBool( "ALWAYS_DETAILED_SEC", @@ -1505,10 +1399,10 @@ void Config::create() ); cb = addBool( "INLINE_INHERITED_MEMB", - "If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited \n" - "members of a class in the documentation of that class as if those members were \n" - "ordinary class members. Constructors, destructors and assignment operators of \n" - "the base classes will not be shown. \n", + "If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n" + "inherited members of a class in the documentation of that class as if those \n" + "members were ordinary class members. Constructors, destructors and assignment \n" + "operators of the base classes will not be shown. \n", FALSE ); cb = addBool( @@ -1602,8 +1496,8 @@ void Config::create() ); cb = addBool( "OPTIMIZE_OUTPUT_FOR_C", - "Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources \n" - "only. Doxygen will then generate output that is more tailored for C. \n" + "Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n" + "sources only. Doxygen will then generate output that is more tailored for C. \n" "For instance, some of the names that are used will be different. The list \n" "of all members will be omitted, etc. \n", FALSE @@ -1823,6 +1717,15 @@ void Config::create() "in the documentation.\n", TRUE ); + cs = addString( "FILE_VERSION_FILTER", + "The FILE_VERSION_FILTER tag can be used to specify a program or script that \n" + "doxygen should invoke to get the current version for each file (typically from the \n" + "version control system). Doxygen will invoke the program by executing (via \n" + "popen()) the command , where is the value of \n" + "the FILE_VERSION_FILTER tag, and is the name of an input file \n" + "provided by doxygen. Whatever the progam writes to standard output \n" + "is used as the file version. See the manual for examples. \n" + ); //----------------------------------------------------------------------------------------------- addInfo( "Messages","configuration options related to warning and progress messages"); @@ -1869,7 +1772,9 @@ void Config::create() "The WARN_FORMAT tag determines the format of the warning messages that \n" "doxygen can produce. The string should contain the $file, $line, and $text \n" "tags, which will be replaced by the file and line number from which the \n" - "warning originated and the warning text. \n" + "warning originated and the warning text. Optionally the format may contain \n" + "$version, which will be replaced by the version of the file (if it could \n" + "be obtained via FILE_VERSION_FILTER)\n" ); cs->setDefaultValue("$file:$line: $text"); cs = addString( @@ -1895,8 +1800,8 @@ void Config::create() "FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n" "and *.h) to filter out the source-files in the directories. If left \n" "blank the following patterns are tested: \n" - "*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp \n" - "*.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm\n" + "*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx \n" + "*.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm\n" ); cb = addBool( "RECURSIVE", @@ -1913,8 +1818,9 @@ void Config::create() ); cb = addBool( "EXCLUDE_SYMLINKS", - "The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories \n" - "that are symbolic links (a Unix filesystem feature) are excluded from the input. \n", + "The EXCLUDE_SYMLINKS tag can be used select whether or not files or \n" + "directories that are symbolic links (a Unix filesystem feature) are excluded \n" + "from the input. \n", FALSE ); cl->setWidgetType(ConfigList::FileAndDir); @@ -2556,8 +2462,8 @@ void Config::create() "If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n" "doxygen's preprocessor will remove all function-like macros that are alone \n" "on a line, have an all uppercase name, and do not end with a semicolon. Such \n" - "function macros are typically used for boiler-plate code, and will confuse the \n" - "parser if not removed. \n", + "function macros are typically used for boiler-plate code, and will confuse \n" + "the parser if not removed. \n", TRUE ); cb->addDependency("ENABLE_PREPROCESSING"); @@ -2616,10 +2522,11 @@ void Config::create() cb = addBool( "CLASS_DIAGRAMS", "If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n" - "generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or \n" - "super classes. Setting the tag to NO turns the diagrams off. Note that this \n" - "option is superseded by the HAVE_DOT option below. This is only a fallback. It is \n" - "recommended to install and use dot, since it yields more powerful graphs. \n", + "generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n" + "or super classes. Setting the tag to NO turns the diagrams off. Note that \n" + "this option is superseded by the HAVE_DOT option below. This is only a \n" + "fallback. It is recommended to install and use dot, since it yields more \n" + "powerful graphs. \n", TRUE ); cb = addBool( @@ -2770,16 +2677,36 @@ void Config::create() "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 for the depth value (the default), the graph is not depth-constrained. \n", + "from the root by following a path via at most 3 edges will be shown. Nodes \n" + "that lay further from the root node will be omitted. Note that setting this \n" + "option to 1 or 2 may greatly reduce the computation time needed for large \n" + "code bases. Also note that a graph may be further truncated if the graph's \n" + "image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH \n" + "and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), \n" + "the graph is not depth-constrained. \n", 0,1000,0 ); ci->addDependency("HAVE_DOT"); cb = addBool( + "DOT_TRANSPARENT", + "Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n" + "background. This is disabled by default, which results in a white background. \n" + "Warning: Depending on the platform used, enabling this option may lead to \n" + "badly anti-aliased labels on the edges of a graph (i.e. they become hard to \n" + "read). \n", + FALSE + ); + cb->addDependency("HAVE_DOT"); + cb = addBool( + "DOT_MULTI_TARGETS", + "Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n" + "files in one run (i.e. multiple -o and -T options on the command line). This \n" + "makes dot run faster, but since only newer versions of dot (>1.8.10) \n" + "support this, this feature is disabled by default. \n", + FALSE + ); + cb->addDependency("HAVE_DOT"); + cb = addBool( "GENERATE_LEGEND", "If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n" "generate a legend page explaining the meaning of the various boxes and \n" diff --git a/src/dirdef.cpp b/src/dirdef.cpp index e79601e..2ca264f 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -498,6 +498,10 @@ DirDef *DirDef::mergeDirectoryInTree(const QCString &path) void DirDef::writeDepGraph(QTextStream &t) { t << "digraph G {\n"; + if (Config_getBool("DOT_TRANSPARENT")) + { + t << " bgcolor=transparent;\n"; + } t << " compound=true\n"; t << " node [ fontsize=10, fontname=\"Helvetica\"];\n"; t << " edge [ labelfontsize=9, labelfontname=\"Helvetica\"];\n"; @@ -583,7 +587,11 @@ void DirDef::writeDepGraph(QTextStream &t) << usedDir->shortName() << "\""; if (usedDir->isCluster()) { - t << " color=\"red\" fillcolor=\"white\" style=\"filled\""; + if (!Config_getBool("DOT_TRANSPARENT")) + { + t << " fillcolor=\"white\" style=\"filled\""; + } + t << " color=\"red\""; } t << " URL=\"" << usedDir->getOutputFileBase() << Doxygen::htmlFileExtension << "\"];\n"; @@ -831,13 +839,20 @@ void writeDirDependencyGraph(const char *dirName) dir->writeDepGraph(t); } f.close(); - QCString dotArgs(4096); - QCString outFile = QCString(dirName)+"/"+dir->getOutputFileBase()+"_dep.gif"; - dotArgs.sprintf("%s -Tgif -o %s",path.data(),outFile.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) - { - err("Problems running dot. Check your installation!\n"); - } + + QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); + QCString outFile = QCString(dirName)+"/"+ + dir->getOutputFileBase()+"_dep."+imgExt; + DotRunner dotRun(path); + dotRun.addJob(imgExt,outFile); + dotRun.run(); + + //QCString dotArgs(4096); + //dotArgs.sprintf("%s -Tgif -o %s",path.data(),outFile.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + //} } out << ""; } diff --git a/src/docparser.cpp b/src/docparser.cpp index 8e1a487..74aa938 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -505,16 +505,16 @@ static bool insideOL(DocNode *n) //--------------------------------------------------------------------------- -/*! Returns TRUE iff node n is a child of a language node */ -static bool insideLang(DocNode *n) -{ - while (n) - { - if (n->kind()==DocNode::Kind_Language) return TRUE; - n=n->parent(); - } - return FALSE; -} +///*! Returns TRUE iff node n is a child of a language node */ +//static bool insideLang(DocNode *n) +//{ +// while (n) +// { +// if (n->kind()==DocNode::Kind_Language) return TRUE; +// n=n->parent(); +// } +// return FALSE; +//} //--------------------------------------------------------------------------- @@ -673,6 +673,10 @@ static int handleStyleArgument(DocNode *parent,QList &children, g_token->name.data(),cmdName.data()); break; case TK_HTMLTAG: + if (insideLI(parent) && HtmlTagMapper::map(g_token->name) && g_token->endTag) + { // ignore
  • as the end of a style command + continue; + } return tok; break; default: @@ -844,7 +848,7 @@ static void handleLinkedWord(DocNode *parent,QList &children) if (!g_insideHtmlLink && resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member)) { - //printf("resolveRef %s = %p (linkable?=%d)\n",g_token->name.data(),member,member->isLinkable()); + //printf("resolveRef %s = %p (linkable?=%d)\n",g_token->name.data(),member,member ? member->isLinkable() : FALSE); if (member) // member link { children.append(new @@ -861,6 +865,10 @@ static void handleLinkedWord(DocNode *parent,QList &children) { name=g_token->name; } + else if (compound->definitionType()==Definition::TypeGroup) + { + name=((GroupDef*)compound)->groupTitle(); + } children.append(new DocLinkedWord(parent,name, compound->getReference(), @@ -1662,30 +1670,30 @@ DocFormula::DocFormula(DocNode *parent,int id) : //--------------------------------------------------------------------------- -int DocLanguage::parse() -{ - int retval; - DBG(("DocLanguage::parse() start\n")); - g_nodeStack.push(this); - - // parse one or more paragraphs - bool isFirst=TRUE; - DocPara *par=0; - do - { - par = new DocPara(this); - if (isFirst) { par->markFirst(); isFirst=FALSE; } - m_children.append(par); - retval=par->parse(); - } - while (retval==TK_NEWPARA); - if (par) par->markLast(); - - DBG(("DocLanguage::parse() end\n")); - DocNode *n = g_nodeStack.pop(); - ASSERT(n==this); - return retval; -} +//int DocLanguage::parse() +//{ +// int retval; +// DBG(("DocLanguage::parse() start\n")); +// g_nodeStack.push(this); +// +// // parse one or more paragraphs +// bool isFirst=TRUE; +// DocPara *par=0; +// do +// { +// par = new DocPara(this); +// if (isFirst) { par->markFirst(); isFirst=FALSE; } +// m_children.append(par); +// retval=par->parse(); +// } +// while (retval==TK_NEWPARA); +// if (par) par->markLast(); +// +// DBG(("DocLanguage::parse() end\n")); +// DocNode *n = g_nodeStack.pop(); +// ASSERT(n==this); +// return retval; +//} //--------------------------------------------------------------------------- @@ -3627,50 +3635,49 @@ endref: doctokenizerYYsetStatePara(); } - -int DocPara::handleLanguageSwitch() -{ - int retval=RetVal_OK; - - if (!insideLang(this)) // start a language section at this level - { - do - { - int tok = doctokenizerYYlex(); - if (tok==TK_WHITESPACE) - { - // end of language specific sections - retval=RetVal_OK; - goto endlang; - } - else if (tok==TK_NEWPARA) - { - // end of language specific sections - retval = tok; - goto endlang; - } - else if (tok==TK_WORD || tok==TK_LNKWORD) - { - DocLanguage *dl = new DocLanguage(this,g_token->name); - m_children.append(dl); - retval = dl->parse(); - } - else - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s as parameter of \\~", - tokToString(tok)); - goto endlang; - } - } - while (retval==RetVal_SwitchLang); - } - else // return from this section - { - retval = RetVal_SwitchLang; - } -endlang: - return retval; -} +//int DocPara::handleLanguageSwitch() +//{ +// int retval=RetVal_OK; +// +// if (!insideLang(this)) // start a language section at this level +// { +// do +// { +// int tok = doctokenizerYYlex(); +// if (tok==TK_WHITESPACE) +// { +// // end of language specific sections +// retval=RetVal_OK; +// goto endlang; +// } +// else if (tok==TK_NEWPARA) +// { +// // end of language specific sections +// retval = tok; +// goto endlang; +// } +// else if (tok==TK_WORD || tok==TK_LNKWORD) +// { +// DocLanguage *dl = new DocLanguage(this,g_token->name); +// m_children.append(dl); +// retval = dl->parse(); +// } +// else +// { +// warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected token %s as parameter of \\~", +// tokToString(tok)); +// goto endlang; +// } +// } +// while (retval==RetVal_SwitchLang); +// } +// else // return from this section +// { +// retval = RetVal_SwitchLang; +// } +//endlang: +// return retval; +//} void DocPara::handleInclude(const QString &cmdName,DocInclude::Type t) { @@ -4091,9 +4098,9 @@ int DocPara::handleCommand(const QString &cmdName) m_children.append(form); } break; - case CMD_LANGSWITCH: - retval = handleLanguageSwitch(); - break; + //case CMD_LANGSWITCH: + // retval = handleLanguageSwitch(); + // break; case CMD_INTERNALREF: warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data()); break; diff --git a/src/docparser.h b/src/docparser.h index 241ea6d..8d2f5b4 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -124,7 +124,7 @@ class DocNode Kind_Formula = 38, Kind_SecRefItem = 39, Kind_SecRefList = 40, - Kind_Language = 41, + //Kind_Language = 41, Kind_LinkedWord = 42, Kind_ParamSect = 43, Kind_ParamList = 44, @@ -695,21 +695,21 @@ class DocInternalRef : public CompAccept, public DocNode }; /*! @brief Node representing a Language specific section */ -class DocLanguage : public CompAccept, public DocNode -{ - public: - DocLanguage(DocNode *parent,const QString &id) : - m_parent(parent), m_id(id) {} - QString id() const { return m_id; } - Kind kind() const { return Kind_Language; } - DocNode *parent() const { return m_parent; } - void accept(DocVisitor *v) { CompAccept::accept(this,v); } - int parse(); - - private: - DocNode * m_parent; - QString m_id; -}; +//class DocLanguage : public CompAccept, public DocNode +//{ +// public: +// DocLanguage(DocNode *parent,const QString &id) : +// m_parent(parent), m_id(id) {} +// QString id() const { return m_id; } +// Kind kind() const { return Kind_Language; } +// DocNode *parent() const { return m_parent; } +// void accept(DocVisitor *v) { CompAccept::accept(this,v); } +// int parse(); +// +// private: +// DocNode * m_parent; +// QString m_id; +//}; /*! @brief Node representing a Hypertext reference */ class DocHRef : public CompAccept, public DocNode @@ -973,7 +973,7 @@ class DocPara : public CompAccept, public DocNode void handleRef(const QString &cmdName); void handleSection(const QString &cmdName); int handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs,int level); - int handleLanguageSwitch(); + //int handleLanguageSwitch(); private: DocNode *m_parent; diff --git a/src/docvisitor.h b/src/docvisitor.h index e71bb14..924a562 100644 --- a/src/docvisitor.h +++ b/src/docvisitor.h @@ -69,7 +69,7 @@ class DocRef; class DocFormula; class DocSecRefItem; class DocSecRefList; -class DocLanguage; +//class DocLanguage; class DocLinkedWord; class DocParamSect; class DocParamList; @@ -163,8 +163,8 @@ class DocVisitor virtual void visitPost(DocSecRefItem *) = 0; virtual void visitPre(DocSecRefList *) = 0; virtual void visitPost(DocSecRefList *) = 0; - virtual void visitPre(DocLanguage *) = 0; - virtual void visitPost(DocLanguage *) = 0; + //virtual void visitPre(DocLanguage *) = 0; + //virtual void visitPost(DocLanguage *) = 0; virtual void visitPre(DocParamSect *) = 0; virtual void visitPost(DocParamSect *) = 0; virtual void visitPre(DocParamList *) = 0; diff --git a/src/dot.cpp b/src/dot.cpp index ae34fb1..3ae2c58 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -35,9 +35,6 @@ #include #include -// Enable this for transparent images -// It doesn't seems to work very well with edge labels so I disabled it. -//#define DOT_TRANSPARENT //-------------------------------------------------------------------- @@ -74,9 +71,10 @@ static void writeGraphHeader(QTextStream &t) { t << "digraph G" << endl; t << "{" << endl; -#if defined(DOT_TRANSPARENT) - t << " bgcolor=\"transparent\"" << endl; -#endif + if (Config_getBool("DOT_TRANSPARENT")) + { + t << " bgcolor=\"transparent\";" << endl; + } t << " edge [fontname=\"Helvetica\",fontsize=10," "labelfontname=\"Helvetica\",labelfontsize=10];\n"; t << " node [fontname=\"Helvetica\",fontsize=10,shape=record];\n"; @@ -393,6 +391,53 @@ class DotNodeList : public QList //-------------------------------------------------------------------- +DotRunner::DotRunner(const char *file) : m_file(file) +{ + m_jobs.setAutoDelete(TRUE); +} + +void DotRunner::addJob(const char *format,const char *output) +{ + QCString args = QCString("-T")+format+" -o \""+output+"\""; + m_jobs.append(new QCString(args)); +} + +bool DotRunner::run() +{ + QListIterator li(m_jobs); + QCString *s; + if (Config_getBool("DOT_MULTI_TARGETS")) + { + QCString dotArgs="\""+m_file+"\""; + for (li.toFirst();(s=li.current());++li) + { + dotArgs+=' '; + dotArgs+=*s; + } + if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + { + goto error; + } + } + else + { + for (li.toFirst();(s=li.current());++li) + { + QCString dotArgs="\""+m_file+"\" "+*s; + if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + { + goto error; + } + } + } + return TRUE; +error: + err("Problems running dot. Check your installation!\n"); + return FALSE; +} + +//-------------------------------------------------------------------- + /*! helper function that deletes all nodes in a connected graph, given * one of the graph's nodes @@ -621,11 +666,14 @@ void DotNode::writeBox(QTextStream &t, } else { -#if defined(DOT_TRANSPARENT) - t << ",color=\"" << labCol << "\", fillcolor=\"white\", style=\"filled\""; -#else - t << ",color=\"" << labCol << "\""; -#endif + if (!Config_getBool("DOT_TRANSPARENT")) + { + t << ",color=\"" << labCol << "\", fillcolor=\"white\", style=\"filled\""; + } + else + { + t << ",color=\"" << labCol << "\""; + } if (!m_url.isEmpty()) { int anchorPos = m_url.findRev('#'); @@ -1067,17 +1115,23 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) f.close(); resetReNumbering(); - QCString dotArgs(maxCmdLine); - dotArgs.sprintf("\"%s\" -T%s -o \"%s\" -Timap -o \"%s\"", - dotName.data(), imgExt.data(), imgName.data(), mapName.data()); - //printf("Running: dot %s -T%s -o %s -Timap -o %s\n", - // dotName.data(),imgExt.data(),imgName.data(),mapName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(dotName); + dotRun.addJob(imgExt,imgName); + dotRun.addJob("imap",mapName); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); out << "" << endl; return; } + + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("\"%s\" -T%s -o \"%s\" -Timap -o \"%s\"", + // dotName.data(), imgExt.data(), imgName.data(), mapName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // return; + //} checkDotResult(imgName); if (Config_getBool("DOT_CLEANUP")) thisDir.remove(dotName); } @@ -1625,14 +1679,22 @@ static bool findMaximalDotGraph(DotNode *root, writeDotGraph(root,gt,format,baseName,lrRank,renderParents, curDistance,backArrows,reNumber); - QCString dotArgs(maxCmdLine); // create annotated dot file - dotArgs.sprintf("-Tdot \"%s.dot\" -o \"%s_tmp.dot\"",baseName.data(),baseName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob("dot",baseName+"_tmp.dot"); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); return FALSE; } + + //QCString dotArgs(maxCmdLine); + //// create annotated dot file + //dotArgs.sprintf("-Tdot \"%s.dot\" -o \"%s_tmp.dot\"",baseName.data(),baseName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + // { + // err("Problems running dot. Check your installation!\n"); + // return FALSE; + //} // extract bounding box from the result readBoundingBoxDot(baseName+"_tmp.dot",&width,&height); @@ -1768,32 +1830,50 @@ QCString DotClassGraph::writeGraph(QTextStream &out, { QCString dotArgs(maxCmdLine); QCString imgName = baseName+"."+imgExt; - dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", - baseName.data(),imgExt.data(),imgName.data()); - if (generateImageMap) - { - // run dot also to create an image map - dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", - baseName.data()); - } - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + + DotRunner dotRun(baseName+".dot"); + dotRun.addJob(imgExt,imgName); + if (generateImageMap) dotRun.addJob("imap",baseName+".map"); + if (!dotRun.run()) { - err("Error: Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + + //dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", + // baseName.data(),imgExt.data(),imgName.data()); + //if (generateImageMap) + //{ + // // run dot also to create an image map + // dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", + // baseName.data()); + //} + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Error: Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} checkDotResult(imgName); } else if (format==EPS) // run dot to create a .eps image { - QCString dotArgs(maxCmdLine); - dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"",baseName.data(),baseName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob("ps",baseName+".eps"); + if (!dotRun.run()) { - err("Error: Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"",baseName.data(),baseName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Error: Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} if (Config_getBool("USE_PDFLATEX")) { QCString epstopdfArgs(maxCmdLine); @@ -2025,41 +2105,56 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, format, // format TRUE, // lrRank FALSE, // renderParents - FALSE // backArrows + m_inverse // backArrows ); if (format==BITMAP) { // run dot to create a bitmap image QCString dotArgs(maxCmdLine); QCString imgName=baseName+"."+imgExt; - dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", - baseName.data(),imgExt.data(),imgName.data()); - if (generateImageMap) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob(imgExt,imgName); + if (generateImageMap) dotRun.addJob("imap",baseName+".map"); + if (!dotRun.run()) { - // run dot also to create an image map - dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", - baseName.data()); - } - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) - { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", + // baseName.data(),imgExt.data(),imgName.data()); + //if (generateImageMap) + //{ + // // run dot also to create an image map + // dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", + // baseName.data()); + //} + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} checkDotResult(imgName); } else if (format==EPS) { // run dot to create a .eps image - QCString dotArgs(maxCmdLine); - dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", - baseName.data(),baseName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob("ps",baseName+".eps"); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", + // baseName.data(),baseName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} if (Config_getBool("USE_PDFLATEX")) { QCString epstopdfArgs(maxCmdLine); @@ -2218,34 +2313,49 @@ QCString DotCallGraph::writeGraph(QTextStream &out, GraphOutputFormat format, // run dot to create a bitmap image QCString dotArgs(maxCmdLine); QCString imgName=baseName+"."+imgExt; - dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", - baseName.data(),imgExt.data(),imgName.data()); - if (generateImageMap) - { - // run dot also to create an image map - dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", - baseName.data()); - } - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob(imgExt,imgName); + if (generateImageMap) dotRun.addJob("imap",baseName+".map"); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", + // baseName.data(),imgExt.data(),imgName.data()); + //if (generateImageMap) + //{ + // // run dot also to create an image map + // dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", + // baseName.data()); + //} + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} checkDotResult(imgName); } else if (format==EPS) { // run dot to create a .eps image - QCString dotArgs(maxCmdLine); - dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", - baseName.data(),baseName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob("ps",baseName+".eps"); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", + // baseName.data(),baseName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} if (Config_getBool("USE_PDFLATEX")) { QCString epstopdfArgs(maxCmdLine); @@ -2410,34 +2520,49 @@ QCString DotDirDeps::writeGraph(QTextStream &out, // run dot to create a bitmap image QCString dotArgs(maxCmdLine); QCString imgName=baseName+"."+imgExt; - dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", - baseName.data(),imgExt.data(),imgName.data()); - if (generateImageMap) - { - // run dot also to create an image map - dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", - baseName.data()); - } - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob(imgExt,imgName); + if (generateImageMap) dotRun.addJob("imap",baseName+".map"); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", + // baseName.data(),imgExt.data(),imgName.data()); + //if (generateImageMap) + //{ + // // run dot also to create an image map + // dotArgs+=QCString(maxCmdLine).sprintf(" -Timap -o \"%s.map\"", + // baseName.data()); + //} + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} checkDotResult(imgName); } else if (format==EPS) { // run dot to create a .eps image - QCString dotArgs(maxCmdLine); - dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", - baseName.data(),baseName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob("ps",baseName+".eps"); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", + // baseName.data(),baseName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} if (Config_getBool("USE_PDFLATEX")) { QCString epstopdfArgs(maxCmdLine); @@ -2553,16 +2678,24 @@ void generateGraphLegend(const char *path) QDir::setCurrent(d.absPath()); // run dot to generate the a bitmap image from the graph - QCString dotArgs(maxCmdLine); QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); QCString imgName = "graph_legend."+imgExt; - dotArgs.sprintf("-T%s graph_legend.dot -o %s",imgExt.data(),imgName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + + DotRunner dotRun("graph_legend.dot"); + dotRun.addJob(imgExt,imgName); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return; } + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("-T%s graph_legend.dot -o %s",imgExt.data(),imgName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return; + //} checkDotResult(imgName); QDir::setCurrent(oldDir); } @@ -2595,26 +2728,37 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, // outf.writeBlock(a.data(),s); //} - QCString dotArgs(maxCmdLine); QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); QCString imgName = (QCString)outFile+"."+imgExt; - if (format==BITMAP) - { - dotArgs.sprintf("-T%s \"%s\" -o \"%s\"", - imgExt.data(), - inFile, - imgName.data()); - } + + DotRunner dotRun(inFile); + if (format==BITMAP) + dotRun.addJob(imgExt,imgName); else // format==EPS + dotRun.addJob("ps",QCString(outFile)+".eps"); + if (!dotRun.run()) { - dotArgs.sprintf("-Tps \"%s\" -o \"%s.eps\"",inFile,outFile); - } - QCString dotExe = Config_getString("DOT_PATH")+"dot"; - //printf("Running: %s %s\n",dotExe.data(),dotArgs.data()); - if (iSystem(dotExe,dotArgs)!=0) - { - err("Problems running dot. Check your installation!\n"); + QDir::setCurrent(oldDir); + return; } + //QCString dotArgs(maxCmdLine); + //if (format==BITMAP) + //{ + // dotArgs.sprintf("-T%s \"%s\" -o \"%s\"", + // imgExt.data(), + // inFile, + // imgName.data()); + //} + //else // format==EPS + //{ + // dotArgs.sprintf("-Tps \"%s\" -o \"%s.eps\"",inFile,outFile); + //} + //QCString dotExe = Config_getString("DOT_PATH")+"dot"; + ////printf("Running: %s %s\n",dotExe.data(),dotArgs.data()); + //if (iSystem(dotExe,dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + //} // Added by Nils Strom if ( (format==EPS) && (Config_getBool("USE_PDFLATEX")) ) { @@ -2651,17 +2795,24 @@ QString getDotImageMapFromFile(const QString& inFile, const QString& outDir, QDir::setCurrent(outDir); //printf("Going to dir %s\n",QDir::currentDirPath().data()); - QCString dotArgs(maxCmdLine); - dotArgs.sprintf("-Timap \"%s\" -o \"%s\"", inFile.data(), outFile.data()); - - QCString dotExe = Config_getString("DOT_PATH") + "dot"; - //printf("Running: %s %s\n",dotExe.data(),dotArgs.data()); - if (iSystem(dotExe,dotArgs)!=0) + DotRunner dotRun(inFile); + dotRun.addJob("imap",outFile); + if (!dotRun.run()) { - err("Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return ""; } + + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("-Timap \"%s\" -o \"%s\"", inFile.data(), outFile.data()); + //QCString dotExe = Config_getString("DOT_PATH") + "dot"; + ////printf("Running: %s %s\n",dotExe.data(),dotArgs.data()); + //if (iSystem(dotExe,dotArgs)!=0) + //{ + // err("Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return ""; + //} QString result; QTextOStream tmpout(&result); convertMapFile(tmpout, outFile, relPath ,TRUE); @@ -2928,22 +3079,31 @@ QCString DotGroupCollaboration::writeGraph( QTextStream &t, GraphOutputFormat fo { QCString dotArgs(maxCmdLine); QCString imgName = baseName+"."+imgExt; - dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", - baseName.data(), imgExt.data(), imgName.data()); QCString mapName=baseName+".map"; - if (writeImageMap) + DotRunner dotRun(baseName); + dotRun.addJob(imgExt,imgName); + if (writeImageMap) dotRun.addJob("imap",mapName); + if (!dotRun.run()) { - // run dot also to create an image map - dotArgs+=" -Timap -o \""+mapName+"\""; - } - - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) - { - err("Error: Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //dotArgs.sprintf("\"%s.dot\" -T%s -o \"%s\"", + // baseName.data(), imgExt.data(), imgName.data()); + // + //if (writeImageMap) + //{ + // // run dot also to create an image map + // dotArgs+=" -Timap -o \""+mapName+"\""; + //} + // + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Error: Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} if (writeImageMap) { @@ -2959,15 +3119,22 @@ QCString DotGroupCollaboration::writeGraph( QTextStream &t, GraphOutputFormat fo } else if (format==EPS) { - QCString dotArgs(maxCmdLine); - dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", - baseName.data(),baseName.data()); - if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + DotRunner dotRun(baseName+".dot"); + dotRun.addJob("ps",baseName+".eps"); + if (!dotRun.run()) { - err("Error: Problems running dot. Check your installation!\n"); QDir::setCurrent(oldDir); return baseName; } + //QCString dotArgs(maxCmdLine); + //dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"", + // baseName.data(),baseName.data()); + //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0) + //{ + // err("Error: Problems running dot. Check your installation!\n"); + // QDir::setCurrent(oldDir); + // return baseName; + //} if (Config_getBool("USE_PDFLATEX")) { QCString epstopdfArgs(maxCmdLine); @@ -3074,9 +3241,10 @@ void DotGroupCollaboration::writeGraphHeader(QTextStream &t) { t << "digraph structs" << endl; t << "{" << endl; -#if defined(DOT_TRANSPARENT) - t << " bgcolor=\"transparent\"" << endl; -#endif + if (Config_getBool("DOT_TRANSPARENT")) + { + t << " bgcolor=\"transparent\";" << endl; + } t << " edge [fontname=\"Helvetica\",fontsize=8," "labelfontname=\"Helvetica\",labelfontsize=8];\n"; t << " node [fontname=\"Helvetica\",fontsize=10,shape=record];\n"; diff --git a/src/dot.h b/src/dot.h index 3e5d790..5b5346c 100644 --- a/src/dot.h +++ b/src/dot.h @@ -286,6 +286,28 @@ class DotGroupCollaboration QList m_edges; }; +/** @brief Helper class to run dot from doxygen. + */ +class DotRunner +{ + public: + /** Creates a runner for a dot \a file. */ + DotRunner(const char *file); + + /** Adds an additional job to the run. + * Performing multiple jobs one file can be faster. + */ + void addJob(const char *format,const char *output); + + /** Runs dot for all jobs added. */ + bool run(); + private: + QList m_jobs; + QCString m_file; +}; + + + void generateGraphLegend(const char *path); void writeDotGraphFromFile(const char *inFile,const char *outDir, const char *outFile,GraphOutputFormat format); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 5ed0f9a..d785ef1 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1408,12 +1408,11 @@ static MemberDef *addVariableToClass( Entry *root, ClassDef *cd, MemberDef::MemberType mtype, - /*const QCString &scope,*/ const QCString &name, bool fromAnnScope, - /*int indentDepth,*/ MemberDef *fromAnnMemb, - Protection prot) + Protection prot, + bool related) { QCString qualScope = cd->qualifiedNameWithTemplateParameters(); QCString scopeSeparator="::"; @@ -1437,7 +1436,7 @@ static MemberDef *addVariableToClass( QCString def; if (!root->type.isEmpty()) { - if (mtype==MemberDef::Friend || Config_getBool("HIDE_SCOPE_NAMES")) + if (related || mtype==MemberDef::Friend || Config_getBool("HIDE_SCOPE_NAMES")) { def=root->type+" "+name+root->args; } @@ -1481,7 +1480,7 @@ static MemberDef *addVariableToClass( MemberDef *md=new MemberDef( root->fileName,root->startLine, root->type,name,root->args,0, - prot,Normal,root->stat,FALSE, + prot,Normal,root->stat,related, mtype,0,0); if (root->tagInfo) { @@ -1636,24 +1635,6 @@ static MemberDef *addVariableToFile( md->setRefItems(root->sli); return md; } - - // TODO: rethink why we would need this! - //if (nd==0 && md->isExplicit()!=root->explicitExternal) - //{ - // // merge ingroup specifiers - // if (md->getGroupDef()==0 && root->groups->first()) - // { - // //GroupDef *gd=Doxygen::groupSDict[root->groups->first()->groupname.data()]; - // //md->setGroupDef(gd, root->groups->first()->pri, root->fileName, root->startLine, !root->doc.isEmpty()); - // addMemberToGroups(root,md); - // } - // else if (md->getGroupDef()!=0 && root->groups->count()==0) - // { - // // enabling has the result that an ungrouped, undocumented external variable is put - // // in a group if the definition is documented and grouped! - // //root->groups->append(new Grouping(md->getGroupDef()->name(), md->getGroupPri())); - // } - //} } } // new global variable, enum value or typedef @@ -1667,8 +1648,6 @@ static MemberDef *addVariableToFile( md->setAnchor(root->tagInfo->anchor); md->setReference(root->tagInfo->tagName); } - //md->setDefFile(root->fileName); - //md->setDefLine(root->startLine); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setBriefDescription(root->brief,root->briefFile,root->briefLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); @@ -1937,8 +1916,15 @@ static void buildVarList(Entry *root) cd=getClass(scope); if (cd) { - addVariableToClass(root,cd,MemberDef::Friend,/*scope,*/ - root->name,FALSE,/*0,*/0,Public); + addVariableToClass(root, // entry + cd, // class to add member to + MemberDef::Friend, // type of member + root->name, // name of the member + FALSE, // from Anonymous scope + 0, // anonymous member + Public, // protection + FALSE // related to a class + ); } } goto nextMember; @@ -1968,6 +1954,17 @@ static void buildVarList(Entry *root) classScope=stripTemplateSpecifiersFromScope(classScope,FALSE); QCString annScopePrefix=scope.left(scope.length()-classScope.length()); scope=classScope; + + bool isRelated=FALSE; + if (!root->relates.isEmpty()) // related variable + { + isRelated=TRUE; + if (getClass(root->relates)==0 && !scope.isEmpty()) + scope=mergeScopes(scope,root->relates); + else + scope=root->relates.copy(); + } + if (!scope.isEmpty() && !name.isEmpty() && (cd=getClass(scope))) { // TODO: clean up this mess! @@ -1991,9 +1988,15 @@ static void buildVarList(Entry *root) { if (!pScope.isEmpty() && (pcd=getClass(pScope))) { - //Protection p = (Protection)QMAX((int)root->protection,(int)cd->protection()); - md=addVariableToClass(root,pcd,mtype,name, - TRUE,0,root->protection); + md=addVariableToClass(root, // entry + pcd, // class to add member to + mtype, // member type + name, // member name + TRUE, // from anonymous scope + 0, // from anonymous member + root->protection, + isRelated + ); added=TRUE; } else // annonymous scope inside namespace or file => put variable in the global scope @@ -2008,8 +2011,14 @@ static void buildVarList(Entry *root) // scope.right(scope.length()-si).data(), // indentDepth, // anonyScopes); - addVariableToClass(root,cd,mtype,name, - FALSE,md,root->protection); + addVariableToClass(root, // entry + cd, // class to add member to + mtype, // member type + name, // name of the member + FALSE, // from anonymous scope + md, // from anonymous member + root->protection, + isRelated); } else if (!name.isEmpty()) // global variable { @@ -5452,17 +5461,18 @@ static void findEnums(Entry *root) ClassDef *cd=0; FileDef *fd=0; NamespaceDef *nd=0; - //MemberNameDict *mnd=0; - //MemberNameList *mnl=0; MemberNameSDict *mnsd=0; bool isGlobal; - //printf("Found enum with name `%s'\n",root->name.data()); + bool isRelated=FALSE; + //printf("Found enum with name `%s' relates=%s\n",root->name.data(),root->relates.data()); int i; QCString name; + QCString scope; + if ((i=root->name.findRev("::"))!=-1) // scope is specified { - QCString scope=root->name.left(i); // extract scope + scope=root->name.left(i); // extract scope name=root->name.right(root->name.length()-i-2); // extract name if ((cd=getClass(scope))==0) nd=getResolvedNamespace(scope); } @@ -5472,24 +5482,31 @@ static void findEnums(Entry *root) && !root->parent->name.isEmpty() ) // found enum docs inside a compound { - QCString scope=root->parent->name; + scope=root->parent->name; if ((cd=getClass(scope))==0) nd=getResolvedNamespace(scope); } name=root->name.copy(); } + + if (!root->relates.isEmpty()) + { // related member, prefix user specified scope + isRelated=TRUE; + if (getClass(root->relates)==0 && !scope.isEmpty()) + scope=mergeScopes(scope,root->relates); + else + scope=root->relates.copy(); + if ((cd=getClass(scope))==0) nd=getResolvedNamespace(scope); + } + if (cd && !name.isEmpty()) // found a enum inside a compound { //printf("Enum `%s'::`%s'\n",cd->name(),name.data()); fd=0; - //mnd=&Doxygen::memberNameDict; - //mnl=&Doxygen::memberNameList; mnsd=&Doxygen::memberNameSDict; isGlobal=FALSE; } else if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') // found enum inside namespace { - //mnd=&Doxygen::functionNameDict; - //mnl=&Doxygen::functionNameList; mnsd=&Doxygen::functionNameSDict; isGlobal=TRUE; } @@ -5497,26 +5514,24 @@ static void findEnums(Entry *root) { bool ambig; fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); - //mnd=&Doxygen::functionNameDict; - //mnl=&Doxygen::functionNameList; mnsd=&Doxygen::functionNameSDict; isGlobal=TRUE; } + if (!name.isEmpty()) { // new enum type md = new MemberDef( root->fileName,root->startLine, - 0,name,0,0,root->protection,Normal,FALSE,FALSE, - MemberDef::Enumeration,0,0); + 0,name,0,0, + root->protection,Normal,FALSE,isRelated,MemberDef::Enumeration, + 0,0); if (root->tagInfo) { md->setAnchor(root->tagInfo->anchor); md->setReference(root->tagInfo->tagName); } if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd); - //md->setDefFile(root->fileName); - //md->setDefLine(root->startLine); md->setBodySegment(root->bodyLine,root->endBodyLine); bool ambig; md->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); @@ -5525,14 +5540,10 @@ static void findEnums(Entry *root) md->addSectionsToDefinition(root->anchors); md->setMemberGroupId(root->mGrpId); md->enableCallGraph(root->callGraph); - //if (root->mGrpId!=-1) - //{ - // md->setMemberGroup(memberGroupDict[root->mGrpId]); - //} md->setRefItems(root->sli); if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { - if (Config_getBool("HIDE_SCOPE_NAMES")) + if (isRelated || Config_getBool("HIDE_SCOPE_NAMES")) { md->setDefinition(name); } @@ -5564,7 +5575,7 @@ static void findEnums(Entry *root) } else if (cd) { - if (Config_getBool("HIDE_SCOPE_NAMES")) + if (isRelated || Config_getBool("HIDE_SCOPE_NAMES")) { md->setDefinition(name); } @@ -5591,8 +5602,6 @@ static void findEnums(Entry *root) { mn = new MemberName(name); mn->append(md); - //mnd->insert(name,mn); - //mnl->append(mn); mnsd->append(name,mn); //printf("add %s to new memberName. Now %d members\n", // name.data(),mn->count()); @@ -5603,8 +5612,10 @@ static void findEnums(Entry *root) Entry *e; for (;(e=eli.current());++eli) { + //printf("e->name=%s isRelated=%d\n",e->name.data(),isRelated); MemberName *fmn=0; - if (!e->name.isEmpty() && (fmn=(*mnsd)[e->name])) + MemberNameSDict *emnsd = isRelated ? &Doxygen::functionNameSDict : mnsd; + if (!e->name.isEmpty() && (fmn=(*emnsd)[e->name])) // get list of members with the same name as the field { MemberNameIterator fmni(*fmn); @@ -5613,6 +5624,7 @@ static void findEnums(Entry *root) { if (fmd->isEnumValue()) { + //printf("found enum value with same name\n"); if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { NamespaceDef *fnd=fmd->getNamespaceDef(); @@ -5631,6 +5643,16 @@ static void findEnums(Entry *root) fmd->setEnumScope(md); } } + else if (isRelated && cd) // reparent enum value to + // match the enum's scope + { + md->insertEnumField(fmd); // add field def to list + fmd->setEnumScope(md); // cross ref with enum name + fmd->setEnumClassScope(cd); // cross ref with enum name + fmd->setOuterScope(cd); + fmd->makeRelated(); + cd->insertMember(fmd); + } else { ClassDef *fcd=fmd->getClassDef(); @@ -8199,7 +8221,7 @@ void parseInput() compoundKeywordDict.insert("exception",(void *)8); bool alwaysRecursive = Config_getBool("RECURSIVE"); - + /************************************************************************** * Read and preprocess input * **************************************************************************/ diff --git a/src/filedef.cpp b/src/filedef.cpp index 32c0a5f..762eca0 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -34,6 +34,11 @@ #include "searchindex.h" //#include "xml.h" +#if defined(_MSC_VER) || defined(__BORLANDC__) +#define popen _popen +#define pclose _pclose +#endif + class DevNullCodeDocInterface : public BaseCodeDocInterface { public: @@ -91,6 +96,7 @@ FileDef::FileDef(const char *p,const char *nm, } memberGroupSDict = new MemberGroupSDict; memberGroupSDict->setAutoDelete(TRUE); + acquireFileVersion(); } /*! destroy the file definition */ @@ -212,6 +218,12 @@ void FileDef::writeDocumentation(OutputList &ol) //printf("WriteDocumentation diskname=%s\n",diskname.data()); + QCString versionTitle; + if (!fileVersion.isEmpty()) + { + versionTitle=("("+fileVersion+")"); + } + QCString title = docname+versionTitle; QCString pageTitle=theTranslator->trFileReference(docname); startFile(ol,getOutputFileBase(),name(),pageTitle); @@ -228,14 +240,22 @@ void FileDef::writeDocumentation(OutputList &ol) ol.parseText(pageTitle); // other output formats ol.popGeneratorState(); addGroupListToTitle(ol,this); - endTitle(ol,getOutputFileBase(),docname); + endTitle(ol,getOutputFileBase(),title); } else { startTitle(ol,getOutputFileBase()); ol.parseText(pageTitle); addGroupListToTitle(ol,this); - endTitle(ol,getOutputFileBase(),docname); + endTitle(ol,getOutputFileBase(),title); + } + if (!fileVersion.isEmpty()) + { + ol.disableAllBut(OutputGenerator::Html); + ol.startProjectNumber(); + ol.docify(versionTitle); + ol.endProjectNumber(); + ol.enableAll(); } if (Config_getBool("SEARCHENGINE")) @@ -519,7 +539,12 @@ void FileDef::writeDocumentation(OutputList &ol) /*! Write a source listing of this file to the output */ void FileDef::writeSource(OutputList &ol) { - QCString pageTitle = theTranslator->trSourceFile(docname); + QCString title = docname; + if (!fileVersion.isEmpty()) + { + title+=(" ("+fileVersion+")"); + } + QCString pageTitle = theTranslator->trSourceFile(title); ol.disableAllBut(OutputGenerator::Html); startFile(ol,getSourceFileBase(),0,pageTitle); @@ -528,12 +553,12 @@ void FileDef::writeSource(OutputList &ol) getDirDef()->writeNavigationPath(ol); startTitle(ol,getOutputFileBase()); ol.parseText(name()); - endTitle(ol,getOutputFileBase(),docname); + endTitle(ol,getOutputFileBase(),title); } else { startTitle(ol,0); - ol.parseText(docname); + ol.parseText(title); endTitle(ol,0,0); } @@ -1116,3 +1141,33 @@ bool FileDef::isDocumentationFile() const name().right(4)==".txt" || name().right(4)==".dox"; } + +void FileDef::acquireFileVersion() +{ + QCString vercmd = Config_getString("FILE_VERSION_FILTER"); + if (!vercmd.isEmpty()) + { + msg("Version of %s : ",filepath.data()); + FILE *f=popen(vercmd+" "+filepath,"r"); + if (!f) + { + err("Error: could not execute %s\n",vercmd.data()); + return; + } + const int bufSize=1024; + char buf[bufSize]; + int numRead = fread(buf,1,bufSize,f); + pclose(f); + if (numRead > 0) + { + fileVersion = QCString(buf,numRead).stripWhiteSpace(); + msg("%s\n",fileVersion.data()); + } + else + { + msg("no version available\n"); + } + } +} + + diff --git a/src/filedef.h b/src/filedef.h index 2af7f94..a5719ee 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -109,6 +109,9 @@ class FileDef : public Definition /*! Returns the absolute path of this file. */ QCString getPath() const { return path; } + + /*! Returns version of this file. */ + QCString getVersion() const { return fileVersion; } bool isLinkableInProject() const { @@ -187,6 +190,13 @@ class FileDef : public Definition bool visited; + protected: + /** + * Retrieves the file version from version control system. + */ + void acquireFileVersion(); + + private: QDict *includeDict; @@ -195,16 +205,15 @@ class FileDef : public Definition QList *includedByList; NamespaceSDict *usingDirList; SDict *usingDeclList; - //DefineList *defineList; QCString path; QCString filepath; QCString diskname; QCString filename; QCString docname; - //QCString incName; QIntDict *srcDefDict; QIntDict *srcMemberDict; bool isSource; + QCString fileVersion; PackageDef *package; DirDef *dir; diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 41c2fb4..76cc16a 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -835,24 +835,24 @@ void HtmlDocVisitor::visitPost(DocSecRefList *) m_t << "" << endl; } -void HtmlDocVisitor::visitPre(DocLanguage *l) -{ - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - pushEnabled(); - m_hide = TRUE; - } -} - -void HtmlDocVisitor::visitPost(DocLanguage *l) -{ - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - popEnabled(); - } -} +//void HtmlDocVisitor::visitPre(DocLanguage *l) +//{ +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// pushEnabled(); +// m_hide = TRUE; +// } +//} +// +//void HtmlDocVisitor::visitPost(DocLanguage *l) +//{ +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// popEnabled(); +// } +//} void HtmlDocVisitor::visitPre(DocParamSect *s) { diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h index 9d96e46..e8c2a9f 100644 --- a/src/htmldocvisitor.h +++ b/src/htmldocvisitor.h @@ -111,8 +111,8 @@ class HtmlDocVisitor : public DocVisitor void visitPost(DocSecRefItem *); void visitPre(DocSecRefList *); void visitPost(DocSecRefList *); - void visitPre(DocLanguage *); - void visitPost(DocLanguage *); + //void visitPre(DocLanguage *); + //void visitPost(DocLanguage *); void visitPre(DocParamSect *); void visitPost(DocParamSect *); void visitPre(DocParamList *); diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index eed39a5..2ddf606 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -46,7 +46,7 @@ static const char *defaultStyleSheet = "BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {\n" " font-family: Geneva, Arial, Helvetica, sans-serif;\n" "}\n" -"BODY {\n" +"BODY,TD {\n" " font-size: 90%;\n" "}\n" "H1 {\n" @@ -136,6 +136,11 @@ static const char *defaultStyleSheet = //"}\n" "DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }\n" "TD.md { background-color: #F4F4FB; font-weight: bold; }\n" +"TD.mdPrefix {\n" +" background-color: #F4F4FB;\n" +" color: #606060;\n" +" font-size: 80%;\n" +"}\n" "TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; }\n" "TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; }\n" "DIV.groupHeader {\n" @@ -1118,7 +1123,7 @@ void HtmlGenerator::startMemberDocPrefixItem() { DBG_HTML(t << "" << endl;) t << " " << endl; - t << " " << endl; + t << " " << endl; } void HtmlGenerator::endMemberDocPrefixItem() diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 7436ccb..5b76e93 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -841,24 +841,24 @@ void LatexDocVisitor::visitPost(DocSecRefList *) m_t << "\\normalsize" << endl; } -void LatexDocVisitor::visitPre(DocLanguage *l) -{ - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - pushEnabled(); - m_hide = TRUE; - } -} - -void LatexDocVisitor::visitPost(DocLanguage *l) -{ - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - popEnabled(); - } -} +//void LatexDocVisitor::visitPre(DocLanguage *l) +//{ +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// pushEnabled(); +// m_hide = TRUE; +// } +//} +// +//void LatexDocVisitor::visitPost(DocLanguage *l) +//{ +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// popEnabled(); +// } +//} void LatexDocVisitor::visitPre(DocParamSect *s) { diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index 195c843..ec89b99 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -111,8 +111,8 @@ class LatexDocVisitor : public DocVisitor void visitPost(DocSecRefItem *); void visitPre(DocSecRefList *); void visitPost(DocSecRefList *); - void visitPre(DocLanguage *); - void visitPost(DocLanguage *); + //void visitPre(DocLanguage *); + //void visitPost(DocLanguage *); void visitPre(DocParamSect *); void visitPost(DocParamSect *); void visitPre(DocParamList *); diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 4fddfce..3c1d347 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -748,24 +748,24 @@ void ManDocVisitor::visitPost(DocSecRefList *) m_t << ".PP" << endl; } -void ManDocVisitor::visitPre(DocLanguage *l) -{ - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - pushEnabled(); - m_hide = TRUE; - } -} - -void ManDocVisitor::visitPost(DocLanguage *l) -{ - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - popEnabled(); - } -} +//void ManDocVisitor::visitPre(DocLanguage *l) +//{ +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// pushEnabled(); +// m_hide = TRUE; +// } +//} +// +//void ManDocVisitor::visitPost(DocLanguage *l) +//{ +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// popEnabled(); +// } +//} void ManDocVisitor::visitPre(DocParamSect *s) { diff --git a/src/mandocvisitor.h b/src/mandocvisitor.h index 2af8a0e..c74b30e 100644 --- a/src/mandocvisitor.h +++ b/src/mandocvisitor.h @@ -111,8 +111,8 @@ class ManDocVisitor : public DocVisitor void visitPost(DocSecRefItem *); void visitPre(DocSecRefList *); void visitPost(DocSecRefList *); - void visitPre(DocLanguage *); - void visitPost(DocLanguage *); + //void visitPre(DocLanguage *); + //void visitPost(DocLanguage *); void visitPre(DocParamSect *); void visitPost(DocParamSect *); void visitPre(DocParamList *); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 6b28bf9..ded94bc 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -605,12 +605,12 @@ bool MemberDef::isLinkableInProject() const //printf("in a class but class not linkable!\n"); return FALSE; // in class but class not linkable } - if (!group && nspace && !nspace->isLinkableInProject()) + if (!group && nspace && !related && !nspace->isLinkableInProject()) { //printf("in a namespace but namespace not linkable!\n"); return FALSE; // in namespace but namespace not linkable } - if (!group && !nspace && fileDef && !fileDef->isLinkableInProject()) + if (!group && !nspace && !related && fileDef && !fileDef->isLinkableInProject()) { //printf("in a file but file not linkable!\n"); return FALSE; // in file (and not in namespace) but file not linkable @@ -679,7 +679,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType() } QCString ltype(type); // strip `static' keyword from ltype - if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7); + //if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7); // strip `friend' keyword from ltype if (ltype.left(7)=="friend ") ltype=ltype.right(ltype.length()-7); static QRegExp r("@[0-9]+"); @@ -927,7 +927,7 @@ void MemberDef::writeDeclaration(OutputList &ol, QCString ltype(type); if (mtype==Typedef) ltype.prepend("typedef "); // strip `static' keyword from ltype - if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7); + //if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7); // strip `friend' keyword from ltype if (ltype.left(7)=="friend ") ltype=ltype.right(ltype.length()-7); static QRegExp r("@[0-9]+"); diff --git a/src/memberdef.h b/src/memberdef.h index e5b48eb..31837fc 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -213,11 +213,8 @@ class MemberDef : public Definition // enumeration specific members void insertEnumField(MemberDef *md); void setEnumScope(MemberDef *md); + void setEnumClassScope(ClassDef *cd) { classDef = cd; } MemberDef *getEnumScope() const { return enumScope; } - //void setEnumUsed() { eUsed=TRUE; } - //bool enumUsed() const { return eUsed; } - //void setEnumDecl(OutputList &ed); - //OutputList *enumDecl() const { return enumDeclList; } MemberList *enumFieldList() const { return enumFields; } void setDocumentedEnumValues(bool value) { docEnumValues=value; } bool hasDocumentedEnumValues() const { return docEnumValues; } diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 5226660..6388a39 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -228,7 +228,6 @@ void MemberList::writePlainDeclarations(OutputList &ol, 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")) diff --git a/src/message.cpp b/src/message.cpp index 8f85b8c..9f39834 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -24,66 +24,68 @@ #include "doxygen.h" static QCString outputFormat; -static int warnFormatOrder; // 1 = $file,$line,$text - // 2 = $text,$line,$file - // 3 = $line,$text,$file - // 4 = $file,$text,$line - // 5 = $text,$file,$line - // 6 = $line,$file,$text +//static int warnFormatOrder; // 1 = $file,$line,$text +// // 2 = $text,$line,$file +// // 3 = $line,$text,$file +// // 4 = $file,$text,$line +// // 5 = $text,$file,$line +// // 6 = $line,$file,$text static FILE *warnFile = stderr; void initWarningFormat() { - int filePos = Config_getString("WARN_FORMAT").find("$file"); - int linePos = Config_getString("WARN_FORMAT").find("$line"); - int textPos = Config_getString("WARN_FORMAT").find("$text"); - - // sort items on position (there are 6 cases) - warnFormatOrder = 1; - if (filePos>linePos && filePos>textPos) - { - if (linePos>textPos) // $text,$line,$file - { - warnFormatOrder = 2; - } - else // $line,$text,$file - { - warnFormatOrder = 3; - } - } - else if (filePostextPos) // $file,$text,$line - { - warnFormatOrder = 4; - } - } - else if (filePostextPos) // $text,$file,$line - { - warnFormatOrder = 5; - } - else // $line,$file,$text - { - warnFormatOrder = 6; - } - outputFormat = - substitute( - substitute( - substitute( - Config_getString("WARN_FORMAT"), - "$file","%s" - ), - "$text","%s" - ), - "$line","%d" - )+'\n'; +// int filePos = Config_getString("WARN_FORMAT").find("$file"); +// int linePos = Config_getString("WARN_FORMAT").find("$line"); +// int textPos = Config_getString("WARN_FORMAT").find("$text"); +// +// // sort items on position (there are 6 cases) +// warnFormatOrder = 1; +// if (filePos>linePos && filePos>textPos) +// { +// if (linePos>textPos) // $text,$line,$file +// { +// warnFormatOrder = 2; +// } +// else // $line,$text,$file +// { +// warnFormatOrder = 3; +// } +// } +// else if (filePostextPos) // $file,$text,$line +// { +// warnFormatOrder = 4; +// } +// } +// else if (filePostextPos) // $text,$file,$line +// { +// warnFormatOrder = 5; +// } +// else // $line,$file,$text +// { +// warnFormatOrder = 6; +// } +// outputFormat = +// substitute( +// substitute( +// substitute( +// Config_getString("WARN_FORMAT"), +// "$file","%s" +// ), +// "$text","%s" +// ), +// "$line","%d" +// )+'\n'; // replace(QRegExp("\\$file"),"%s"). // replace(QRegExp("\\$text"),"%s"). // replace(QRegExp("\\$line"),"%d")+ // '\n'; + outputFormat = Config_getString("WARN_FORMAT"); + if (!Config_getString("WARN_LOGFILE").isEmpty()) { warnFile = fopen(Config_getString("WARN_LOGFILE"),"w"); @@ -115,18 +117,48 @@ static void do_warn(const char *tag, const char *file, int line, const char *fmt if (!Config_getBool(tag)) return; // warning type disabled char text[40960]; vsprintf(text, fmt, args); - if (file==0) file=""; - switch(warnFormatOrder) + QCString fileSubst = file==0 ? "" : file; + QCString lineSubst; lineSubst.setNum(line); + QCString textSubst = text; + QCString versionSubst; + if (file) // get version from file name { - case 1: fprintf(warnFile,outputFormat,file,line,text); break; - case 2: fprintf(warnFile,outputFormat,text,line,file); break; - case 3: fprintf(warnFile,outputFormat,line,text,file); break; - case 4: fprintf(warnFile,outputFormat,file,text,line); break; - case 5: fprintf(warnFile,outputFormat,text,file,line); break; - case 6: fprintf(warnFile,outputFormat,line,file,text); break; - default: - printf("Error: warning format has not been initialized!\n"); + bool ambig; + FileDef *fd=findFileDef(Doxygen::inputNameDict,file,ambig); + if (fd) + { + versionSubst = fd->getVersion(); + } } + // substitute markers by actual values + QCString msgText = + substitute( + substitute( + substitute( + substitute( + outputFormat, + "$file",fileSubst + ), + "$text",textSubst + ), + "$line",lineSubst + ), + "$version",versionSubst + )+'\n'; + + // print resulting message + fprintf(warnFile,msgText); +// switch(warnFormatOrder) +// { +// case 1: fprintf(warnFile,outputFormat,file,line,text); break; +// case 2: fprintf(warnFile,outputFormat,text,line,file); break; +// case 3: fprintf(warnFile,outputFormat,line,text,file); break; +// case 4: fprintf(warnFile,outputFormat,file,text,line); break; +// case 5: fprintf(warnFile,outputFormat,text,file,line); break; +// case 6: fprintf(warnFile,outputFormat,line,file,text); break; +// default: +// printf("Error: warning format has not been initialized!\n"); +// } } void warn(const char *file,int line,const char *fmt, ...) diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 0a07900..9426414 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -367,8 +367,8 @@ public: void visitPost(DocSecRefItem *); void visitPre(DocSecRefList *); void visitPost(DocSecRefList *); - void visitPre(DocLanguage *); - void visitPost(DocLanguage *); + //void visitPre(DocLanguage *); + //void visitPost(DocLanguage *); void visitPre(DocParamSect *); void visitPost(DocParamSect *); void visitPre(DocParamList *); @@ -1126,16 +1126,16 @@ void PerlModDocVisitor::visitPost(DocSecRefList *) #endif } -void PerlModDocVisitor::visitPre(DocLanguage *l) -{ - openItem("language"); - m_output.addFieldQuotedString("id", l->id()); -} - -void PerlModDocVisitor::visitPost(DocLanguage *) -{ - closeItem(); -} +//void PerlModDocVisitor::visitPre(DocLanguage *l) +//{ +// openItem("language"); +// m_output.addFieldQuotedString("id", l->id()); +//} +// +//void PerlModDocVisitor::visitPost(DocLanguage *) +//{ +// closeItem(); +//} void PerlModDocVisitor::visitPre(DocParamSect *s) { diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index a7a8b44..fa47f1a 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -534,16 +534,16 @@ class PrintDocVisitor : public DocVisitor indent_post(); printf("\n"); } - void visitPre(DocLanguage *l) - { - indent_pre(); - printf("\n",l->id().data()); - } - void visitPost(DocLanguage *) - { - indent_post(); - printf("\n"); - } + //void visitPre(DocLanguage *l) + //{ + // indent_pre(); + // printf("\n",l->id().data()); + //} + //void visitPost(DocLanguage *) + //{ + // indent_post(); + // printf("\n"); + //} void visitPre(DocParamList *pl) { indent_pre(); diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index acfaafa..6fb0948 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -1088,26 +1088,26 @@ void RTFDocVisitor::visitPost(DocSecRefList *) m_lastIsPara=TRUE; } -void RTFDocVisitor::visitPre(DocLanguage *l) -{ - DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocLanguage)}\n"); - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - pushEnabled(); - m_hide = TRUE; - } -} - -void RTFDocVisitor::visitPost(DocLanguage *l) -{ - DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLanguage)}\n"); - QString langId = Config_getEnum("OUTPUT_LANGUAGE"); - if (l->id().lower()!=langId.lower()) - { - popEnabled(); - } -} +//void RTFDocVisitor::visitPre(DocLanguage *l) +//{ +// DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocLanguage)}\n"); +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// pushEnabled(); +// m_hide = TRUE; +// } +//} +// +//void RTFDocVisitor::visitPost(DocLanguage *l) +//{ +// DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLanguage)}\n"); +// QString langId = Config_getEnum("OUTPUT_LANGUAGE"); +// if (l->id().lower()!=langId.lower()) +// { +// popEnabled(); +// } +//} void RTFDocVisitor::visitPre(DocParamSect *s) { diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h index 83c5abe..e4e777a 100644 --- a/src/rtfdocvisitor.h +++ b/src/rtfdocvisitor.h @@ -111,8 +111,8 @@ class RTFDocVisitor : public DocVisitor void visitPost(DocSecRefItem *); void visitPre(DocSecRefList *); void visitPost(DocSecRefList *); - void visitPre(DocLanguage *); - void visitPost(DocLanguage *); + //void visitPre(DocLanguage *); + //void visitPost(DocLanguage *); void visitPre(DocParamSect *); void visitPost(DocParamSect *); void visitPre(DocParamList *); diff --git a/src/scanner.l b/src/scanner.l index 0d8c09d..6061502 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -84,6 +84,7 @@ static int lastPreLineCtrlContext; static int lastSkipVerbStringContext; static int lastCommentInArgContext; static int lastFileDocContext; +static int lastSectionContext; static int nextDefContext; static int overloadContext; static Protection protection; @@ -672,6 +673,7 @@ DL [dD][lL] TITLE [tT][iI][tT][lL][eE] CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] +IDLATTR ("["[^\]]*"]"){BN}* %option noyywrap @@ -828,6 +830,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] %x ObjCProtocolList %x QtPropType %x QtPropName +%x QtPropAttr %x QtPropRead %x QtPropWrite @@ -1189,7 +1192,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] ";" { BEGIN(FindMembers); } -{B}*"static"{BN}+ { //current->type += " static "; +{B}*"static"{BN}+ { current->type += " static "; current->stat = TRUE; lineCount(); } @@ -1410,8 +1413,8 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] if (yytext[yyleng-1]=='{') unput('{'); BEGIN( CompoundName ) ; } -{B}*(("typedef"{BN}+)?)"enum{" | -{B}*(("typedef"{BN}+)?)"enum"{BN}+ { +{B}*(("typedef"{BN}+)?){IDLATTR}?"enum{" | +{B}*(("typedef"{BN}+)?){IDLATTR}?"enum"{BN}+ { // for IDL: typedef [something] enum isTypedef=((QCString)yytext).find("typedef")!=-1; current->section = Entry::ENUM_SEC ; addType( current ) ; @@ -1649,28 +1652,41 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current->mtype = mtype = Property; BEGIN(QtPropType); } +"(" { // start of property arguments + } +")" { // end of property arguments + unput(';'); + BEGIN(FindMembers); + } {ID} { current->type=yytext; BEGIN(QtPropName); } {ID} { current->name=yytext; - BEGIN(QtPropRead); + BEGIN(QtPropAttr); } -"READ" { +"READ" { current->memSpec |= Entry::Readable; + BEGIN(QtPropRead); + } +"WRITE" { + current->memSpec |= Entry::Writable; + BEGIN(QtPropWrite); + } +"RESET"{B}+{ID} { // reset method => not supported yet + } +"SCRIPTABLE"{B}+{ID} { // scriptable property => not supported yet + } +"DESIGNABLE"{B}+{ID} { // designable property => not supported yet } {ID} { current->read = yytext; - BEGIN(QtPropWrite); - } -"WRITE" { - current->memSpec |= Entry::Writable; + BEGIN(QtPropAttr); } {ID} { current->write = yytext; - unput(';'); - BEGIN(FindMembers); + BEGIN(QtPropAttr); } "friend"{BN}+("class"|"union"|"struct"){BN}+ { current->name=yytext; @@ -4745,21 +4761,25 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] {CMD}"section"{B}+ { //sectionType=SectionInfo::Section; current->doc+=yytext; + lastSectionContext=YY_START; BEGIN(SectionLabel); } {CMD}"subsection"{B}+ { //sectionType=SectionInfo::Subsection; current->doc+=yytext; + lastSectionContext=YY_START; BEGIN(SectionLabel); } {CMD}"subsubsection"{B}+ { //sectionType=SectionInfo::Subsubsection; current->doc+=yytext; + lastSectionContext=YY_START; BEGIN(SectionLabel); } {CMD}"paragraph"{B}+ { //sectionType=SectionInfo::Paragraph; current->doc+=yytext; + lastSectionContext=YY_START; BEGIN(SectionLabel); } . { memberGroupHeader+=*yytext; } @@ -5011,7 +5031,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] current->anchors->append(si); Doxygen::sectionDict.insert(yytext,si); current->doc+=yytext; - BEGIN(PageDoc); + BEGIN(lastSectionContext); } [^\n*]* { sectionTitle+=yytext; @@ -5356,7 +5376,8 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] ); } \n { yyLineNr++; BEGIN( ClassDoc ); } -{BS}({BL}|"\\n\\n") { +{BS}({BL}|"\\n\\n") | +("\\_linebr \\_linebr") { //if (!current->doc.isEmpty()) current->doc+="

    "; if (lastBriefContext==TodoParam || lastBriefContext==TestParam || @@ -5444,6 +5465,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] {BS}{CMD}("brief"|"short"){BN}+ { //lastBriefContext=YY_START; } +{ID} { current->brief += yytext; } . { current->brief += *yytext; } {ID}/"(" { current->name = yytext; @@ -5577,6 +5599,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] yyLineNr++; BEGIN(AfterDoc); } +{ID} { current->brief+=yytext; } . { current->brief+=yytext; } {BS}({BL}|"\\n\\n") { current->brief=current->brief.stripWhiteSpace(); @@ -5707,7 +5730,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] } "\\_linebr " { // used to compensate for misalignments due to \n's inside ALIASES - current->doc += '\n'; + current->doc += '\n'; } ^{B}*(("//"{B}*)?)"*"+[ \t]*"-"("#")?{B}+ { current->doc += yytext; diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 7f0181e..a4cb16a 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -711,17 +711,17 @@ void XmlDocVisitor::visitPost(DocSecRefList *) m_t << "" << endl; } -void XmlDocVisitor::visitPre(DocLanguage *l) -{ - if (m_hide) return; - m_t << "id() << "\">"; -} - -void XmlDocVisitor::visitPost(DocLanguage *) -{ - if (m_hide) return; - m_t << "" << endl; -} +//void XmlDocVisitor::visitPre(DocLanguage *l) +//{ +// if (m_hide) return; +// m_t << "id() << "\">"; +//} +// +//void XmlDocVisitor::visitPost(DocLanguage *) +//{ +// if (m_hide) return; +// m_t << "" << endl; +//} void XmlDocVisitor::visitPre(DocParamSect *s) { diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h index 3fa93aa..61551db 100644 --- a/src/xmldocvisitor.h +++ b/src/xmldocvisitor.h @@ -111,8 +111,8 @@ class XmlDocVisitor : public DocVisitor void visitPost(DocSecRefItem *); void visitPre(DocSecRefList *); void visitPost(DocSecRefList *); - void visitPre(DocLanguage *); - void visitPost(DocLanguage *); + //void visitPre(DocLanguage *); + //void visitPost(DocLanguage *); void visitPre(DocParamSect *); void visitPost(DocParamSect *); void visitPre(DocParamList *); -- cgit v0.12