From 5b3f3dc61bad158050a2953728f87a9a411823e2 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 25 Dec 2008 20:54:44 +0000 Subject: Release-1.5.7.1-20081225 --- INSTALL | 4 +- README | 4 +- addon/doxyapp/doxyapp.cpp | 1 + configure | 3 +- doc/commands.doc | 91 +++-- doc/docblocks.doc | 14 +- doc/language.doc | 4 +- doc/output.doc | 1 - src/classdef.cpp | 196 ++--------- src/code.l | 2 +- src/commentcnv.l | 65 +++- src/commentscan.l | 12 +- src/declinfo.l | 2 +- src/definition.cpp | 119 ++++--- src/definition.h | 17 + src/dirdef.cpp | 32 -- src/doctokenizer.l | 4 +- src/dot.cpp | 5 +- src/doxygen.cpp | 821 ++++++++++++++++++++++++++-------------------- src/doxygen.h | 5 +- src/filedef.cpp | 79 ++--- src/fortrancode.l | 4 +- src/fortranscanner.l | 2 +- src/ftvhelp.cpp | 1 + src/groupdef.cpp | 121 ++----- src/htmlgen.cpp | 324 +----------------- src/index.cpp | 9 +- src/index.h | 2 + src/latexgen.cpp | 2 +- src/layout.cpp | 4 + src/layout_default.h | 6 +- src/layout_default.xml | 6 +- src/main.cpp | 2 +- src/mangen.cpp | 2 +- src/memberdef.cpp | 94 ++++-- src/memberdef.h | 10 +- src/memberlist.cpp | 6 +- src/namespacedef.cpp | 56 ---- src/pagedef.cpp | 2 +- src/pre.l | 4 +- src/rtfgen.cpp | 2 +- src/scanner.l | 65 +--- src/util.cpp | 64 ++-- src/vhdlscanner.l | 85 +++-- 44 files changed, 1001 insertions(+), 1353 deletions(-) diff --git a/INSTALL b/INSTALL index e9d896b..1272a3b 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.5.7.1-20081206 +DOXYGEN Version 1.5.7.1-20081225 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (06 December 2008) +Dimitri van Heesch (25 December 2008) diff --git a/README b/README index 3dc06f4..8fc1899 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.5.7.1_20081206 +DOXYGEN Version 1.5.7.1_20081225 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) (06 December 2008) +Dimitri van Heesch (dimitri@stack.nl) (25 December 2008) diff --git a/addon/doxyapp/doxyapp.cpp b/addon/doxyapp/doxyapp.cpp index bd44b18..c6b7ed4 100644 --- a/addon/doxyapp/doxyapp.cpp +++ b/addon/doxyapp/doxyapp.cpp @@ -270,6 +270,7 @@ int main(int argc,char **argv) // check and finialize the configuration checkConfiguration(); + adjustConfiguration(); // parse the files parseInput(); diff --git a/configure b/configure index 6ca8cab..efda7c1 100755 --- a/configure +++ b/configure @@ -111,7 +111,7 @@ Usage: $0 [--help] [--shared] [--static] [--release] [--debug] [--perl name] [--flex name] [--bison name] [--make name] [--dot name] [--platform target] [--prefix dir] [--docdir dir] [--install name] [--english-only] [----enable-langs list] - [--with-doxywizard] + [--with-doxywizard] [--with-doxyapp] Options: @@ -145,6 +145,7 @@ Options: [default: $f_langs] --with-doxywizard Build the GUI frontend for doxygen. This requires Qt 3.3.x + --with-doxyapp Example showing how to embed doxygen in an application. EOF test "$f_error" = y && exit 1 diff --git a/doc/commands.doc b/doc/commands.doc index 7450d91..4d8e5f7 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -127,14 +127,14 @@ documentation: \refitem cmdparam \\param \refitem cmdpost \\post \refitem cmdpre \\pre -\refitem cmd_php_only \\private (PHP only) -\refitem cmd_php_only \\privatesection (PHP only) +\refitem cmdprivate \\private +\refitem cmdprivate \\privatesection \refitem cmdproperty \\property -\refitem cmd_php_only \\protected (PHP only) -\refitem cmd_php_only \\protectedsection (PHP only) +\refitem cmdprotected \\protected +\refitem cmdprotected \\protectedsection \refitem cmdprotocol \\protocol -\refitem cmd_php_only \\public (PHP only) -\refitem cmd_php_only \\publicsection (PHP only) +\refitem cmdpublic \\public +\refitem cmdpublic \\publicsection \refitem cmdref \\ref \refitem cmdrelates \\relates \refitem cmdrelatesalso \\relatesalso @@ -575,6 +575,10 @@ doxygen. Unrecognized commands are treated as normal text. is represented as a real member of the class. This can be useful when the programming language does not support the concept of member functions natively (e.g. C). + + It is also possible to use this command together with + \ref cmdpublic "\\public", \ref cmdprotected "\\protected" or + \ref cmdprivate "\\private". The file \c manual.c in the example directory shows how to use this command. \htmlonly @@ -582,8 +586,9 @@ doxygen. Unrecognized commands are treated as normal text. for the corresponding HTML documentation that is generated by doxygen. \endhtmlonly - \sa section \ref cmdextends "\\extends" and section - \ref cmdmemberof "\\memberof" + \sa sections \ref cmdextends "\\extends", \ref cmdimplements "\\implements", + \ref cmdpublic "\\public", \ref cmdprotected "\\protected" and + \ref cmdprivate "\\private".
\section cmdname \\name (header) @@ -683,6 +688,25 @@ doxygen. Unrecognized commands are treated as normal text. \ref cmdref "\\ref".
+\section cmdprivate \\private + + \addindex \\private + \addindex \\privatesection + Indicates that the member documented in the comment block is private, + i.e., should only be accessed by other members in the same class. + + Note that Doxygen automatically detects the protection level of members + in object-oriented languages. This command is intended for use only when + the language does not support the concept of protection level natively + (e.g. C, PHP 4). + + For starting a section of private members, in a way similar to the + "private:" class marker in C++, use \\privatesection. + + \sa sections \ref cmdmemberof "\\memberof", \ref cmdpublic "\\public", + and \ref cmdprotected "\\protected". + +
\section cmdproperty \\property (qualified property name) \addindex \\property @@ -693,6 +717,26 @@ doxygen. Unrecognized commands are treated as normal text. \sa section \ref cmdfn "\\fn" and \ref cmdvar "\\var".
+\section cmdprotected \\protected + + \addindex \\protected + \addindex \\protectedsection + Indicates that the member documented in the comment block is protected, + i.e., should only be accessed by other members in the same or derived + classes. + + Note that Doxygen automatically detects the protection level of members + in object-oriented languages. This command is intended for use only when + the language does not support the concept of protection level natively + (e.g. C, PHP 4). + + For starting a section of protected members, in a way similar to the + "protected:" class marker in C++, use \\protectedsection. + + \sa sections \ref cmdmemberof "\\memberof", \ref cmdpublic "\\public", + and \ref cmdprivate "\\private". + +
\section cmdprotocol \\protocol [] [] \addindex \\protocol @@ -703,6 +747,25 @@ doxygen. Unrecognized commands are treated as normal text. \sa section \ref cmdclass "\\class".
+\section cmdpublic \\public + + \addindex \\public + \addindex \\publicsection + Indicates that the member documented in the comment block is public, + i.e., can be accessed by any other class or function. + + Note that Doxygen automatically detects the protection level of members + in object-oriented languages. This command is intended for use only when + the language does not support the concept of protection level natively + (e.g. C, PHP 4). + + For starting a section of public members, in a way similar to the + "public:" class marker in C++, use \\publicsection. + + \sa sections \ref cmdmemberof "\\memberof", \ref cmdprotected "\\protected" + and \ref cmdprivate "\\private". + +
\section cmdrelates \\relates \addindex \\relates @@ -2369,18 +2432,6 @@ class Receiver character has to be escaped in some cases, because it is used to prevent auto-linking to word that is also a documented class or struct. -
-\section cmd_php_only PHP only commands -For PHP files there are a number of additional commands, that can be -used inside classes to make members public, private, or protected even -though the language itself doesn't support this notion. - -To mark a single item use one of \\private, \\protected, \\public. -For starting a section with a certain protection level use one of: -\\privatesection, \\protectedsection, \\publicsection. -The latter commands are similar to -"private:", "protected:", and "public:" in C++. -

\htmlonly
--- \endhtmlonly Commands included for Qt compatibility \htmlonly ---
\endhtmlonly

diff --git a/doc/docblocks.doc b/doc/docblocks.doc index 0e9f38e..8ac55bb 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -238,7 +238,8 @@ If you want to document the members of a file, struct, union, class, or enum, and you want to put the documentation for these members inside the compound, it is sometimes desired to place the documentation block after the member instead of before. For this purpose you have to put an additional \< marker -in the comment block. Note that this also works for the parameters of a function. +in the comment block. Note that this also works for the parameters +of a function. Here are some examples: \verbatim @@ -271,6 +272,14 @@ or int var; ///< Brief description after the member \endverbatim +For functions one can use \@param to document the parameters +and then use [in], [out], [in,out] +to document the direction. For inline documentation this is also possible +by starting with the direction attribute, e.g. +\verbatim +void foo(int v /**< [in] docs for input parameter v. */); +\endverbatim + Note that these blocks have the same structure and meaning as the special comment blocks in the previous section only the \< indicates that the member is @@ -287,7 +296,8 @@ Here is an example of the use of these comment blocks: They cannot be used to document files, classes, unions, structs, groups, namespaces and enums themselves. Furthermore, the structural commands mentioned in the next section - (like \\class) are ignored inside these comment blocks. + (like \\class) are not allowed + inside these comment blocks. \section structuralcommands Documentation at other places diff --git a/doc/language.doc b/doc/language.doc index 65311ff..e5e3774 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -420,10 +420,10 @@ Just follow these steps: at two places in the script:
  1. After the f_langs= is statement, in lower case. -
  2. In the string that following @allowed= in upper case. +
  3. In the string that following \@allowed= in upper case.
The rerun the configure script such that is generates src/lang_cfg.h. -This file should now contain a #define for your language code. +This file should now contain a \#define for your language code.
  • Edit language.cpp: Add a \verbatim diff --git a/doc/output.doc b/doc/output.doc index 5777ca2..6e37f91 100644 --- a/doc/output.doc +++ b/doc/output.doc @@ -34,7 +34,6 @@ The following output formats are \e directly supported by doxygen: Word 97. If you have success with other programs, please let me know.
    XML
    Generated if \c GENERATE_XML is set to \c YES in the configuration file.

    - Note that the XML output is still under development.

    Qt Help Project (.qhp)
    Generated if \c GENERATE_QHP is set to \c YES in the configuration file. diff --git a/src/classdef.cpp b/src/classdef.cpp index 910a305..c62a7de 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -277,7 +277,6 @@ QCString ClassDef::getMemberListFileName() const QCString ClassDef::displayName() const { - static bool hideScopeNames = Config_getBool("HIDE_SCOPE_NAMES"); static bool optimizeOutputForJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); QCString n; @@ -285,11 +284,7 @@ QCString ClassDef::displayName() const { n = VhdlDocGen::getClassName(this); } - else if (hideScopeNames) - { - n=m_impl->className; - } - else + else { n=qualifiedNameWithTemplateParameters(); } @@ -1450,9 +1445,6 @@ void ClassDef::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- -#define NEW_LAYOUT -#ifdef NEW_LAYOUT // new flexible layout - QListIterator eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); LayoutDocEntry *lde; @@ -1544,154 +1536,6 @@ void ClassDef::writeDocumentation(OutputList &ol) } } -#else // old fixed layout - - //printf("Class %s brief=`%s' doc=`%s'\n",name().data(),briefDescription().data(),documentation().data()); - - //ol.startTextBlock(); - - // write brief description - if (!Config_getBool("DETAILS_AT_TOP")) - { - writeBriefDescription(ol,exampleFlag); - } - - writeIncludeFiles(ol); - writeInheritanceGraph(ol); - writeCollaborationGraph(ol); - writeAllMembersLink(ol); - - //ol.endTextBlock(); - - // write detailed description if the user wants it near the top - if (Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,pageType,exampleFlag); - } - - /////////////////////////////////////////////////////////////////////////// - //// Member declarations + brief descriptions - /////////////////////////////////////////////////////////////////////////// - - startMemberDeclarations(ol); - - // write member groups - writeMemberGroups(ol); - - // public types - writeMemberDeclarations(ol,MemberList::pubTypes,theTranslator->trPublicTypes()); - - // public methods - writeMemberDeclarations(ol,MemberList::pubSlots,theTranslator->trPublicSlots()); - writeMemberDeclarations(ol,MemberList::signals,theTranslator->trSignals()); - writeMemberDeclarations(ol,MemberList::dcopMethods,theTranslator->trDCOPMethods()); - writeMemberDeclarations(ol,MemberList::pubMethods,theTranslator->trPublicMembers()); - writeMemberDeclarations(ol,MemberList::pubStaticMethods,theTranslator->trStaticPublicMembers()); - - // public attribs - writeMemberDeclarations(ol,MemberList::pubAttribs,theTranslator->trPublicAttribs()); - writeMemberDeclarations(ol,MemberList::pubStaticAttribs,theTranslator->trStaticPublicAttribs()); - - // protected types - writeMemberDeclarations(ol,MemberList::proTypes,theTranslator->trProtectedTypes()); - - // protected methods - writeMemberDeclarations(ol,MemberList::proSlots,theTranslator->trProtectedSlots()); - writeMemberDeclarations(ol,MemberList::proMethods,theTranslator->trProtectedMembers()); - writeMemberDeclarations(ol,MemberList::proStaticMethods,theTranslator->trStaticProtectedMembers()); - - // protected attribs - writeMemberDeclarations(ol,MemberList::proAttribs,theTranslator->trProtectedAttribs()); - writeMemberDeclarations(ol,MemberList::proStaticAttribs,theTranslator->trStaticProtectedAttribs()); - - // package types - writeMemberDeclarations(ol,MemberList::pacTypes,theTranslator->trPackageTypes()); - - // package methods - writeMemberDeclarations(ol,MemberList::pacMethods,theTranslator->trPackageMembers()); - writeMemberDeclarations(ol,MemberList::pacStaticMethods,theTranslator->trStaticPackageMembers()); - - // package attribs - writeMemberDeclarations(ol,MemberList::pacAttribs,theTranslator->trPackageAttribs()); - writeMemberDeclarations(ol,MemberList::pacStaticAttribs,theTranslator->trStaticPackageAttribs()); - - // package - writeMemberDeclarations(ol,MemberList::properties,theTranslator->trProperties()); - - // events - writeMemberDeclarations(ol,MemberList::events,theTranslator->trEvents()); - - if (Config_getBool("EXTRACT_PRIVATE")) - { - // private types - writeMemberDeclarations(ol,MemberList::priTypes,theTranslator->trPrivateTypes()); - - // private members - writeMemberDeclarations(ol,MemberList::priSlots,theTranslator->trPrivateSlots()); - writeMemberDeclarations(ol,MemberList::priMethods,theTranslator->trPrivateMembers()); - writeMemberDeclarations(ol,MemberList::priStaticMethods,theTranslator->trStaticPrivateMembers()); - - // private attribs - writeMemberDeclarations(ol,MemberList::priAttribs,theTranslator->trPrivateAttribs()); - writeMemberDeclarations(ol,MemberList::priStaticAttribs,theTranslator->trStaticPrivateAttribs()); - } - - // friends - writeMemberDeclarations(ol,MemberList::friends,theTranslator->trFriends()); - - // related functions - writeMemberDeclarations(ol,MemberList::related,theTranslator->trRelatedFunctions(), - theTranslator->trRelatedSubscript() - ); - - writeNestedClasses(ol); - - endMemberDeclarations(ol); - - // write detailed description - if (!Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,pageType,exampleFlag); - } - - /////////////////////////////////////////////////////////////////////////// - //// Member definitions + detailed documentation - /////////////////////////////////////////////////////////////////////////// - - startMemberDocumentation(ol); - - writeMemberDocumentation(ol,MemberList::typedefMembers,theTranslator->trMemberTypedefDocumentation()); - writeMemberDocumentation(ol,MemberList::enumMembers,theTranslator->trMemberEnumerationDocumentation()); - writeMemberDocumentation(ol,MemberList::constructors,theTranslator->trConstructorDocumentation()); - if (fortranOpt) - { - writeMemberDocumentation(ol,MemberList::functionMembers,theTranslator->trMemberFunctionDocumentationFortran()); - } - else - { - writeMemberDocumentation(ol,MemberList::functionMembers,theTranslator->trMemberFunctionDocumentation()); - } - writeMemberDocumentation(ol,MemberList::relatedMembers,theTranslator->trRelatedFunctionDocumentation()); - writeMemberDocumentation(ol,MemberList::variableMembers,theTranslator->trMemberDataDocumentation()); - writeMemberDocumentation(ol,MemberList::propertyMembers,theTranslator->trPropertyDocumentation()); - writeMemberDocumentation(ol,MemberList::eventMembers,theTranslator->trEventDocumentation()); - - endMemberDocumentation(ol); - ///////////////////////////////////////////////////////////////////// - //ol.startTextBlock(); - - // write the list of used files (not for man pages) - showUsedFiles(ol); - - // write Author section (Man only) - writeAuthorSection(ol); - - //ol.endTextBlock(); - ///////////////////////////////////////////////////////////////////// - //---------------------------------------- end flexible part ------------------------------- - -#endif - if (!Config_getString("GENERATE_TAGFILE").isEmpty()) { writeDocAnchorsToTagFile(); @@ -3154,30 +2998,34 @@ QCString ClassDef::qualifiedNameWithTemplateParameters( QList *actualParams) const { static bool optimizeOutputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); + static bool hideScopeNames = Config_getBool("HIDE_SCOPE_NAMES"); //printf("qualifiedNameWithTemplateParameters() localName=%s\n",localName().data()); QCString scName; - Definition *d=getOuterScope(); - if (d) + if (!hideScopeNames) { - if (d->definitionType()==Definition::TypeClass) - { - ClassDef *cd=(ClassDef *)d; - scName = cd->qualifiedNameWithTemplateParameters(actualParams); - } - else + Definition *d=getOuterScope(); + if (d) { - scName = d->qualifiedName(); + if (d->definitionType()==Definition::TypeClass) + { + ClassDef *cd=(ClassDef *)d; + scName = cd->qualifiedNameWithTemplateParameters(actualParams); + } + else + { + scName = d->qualifiedName(); + } } - } - QCString scopeSeparator; - if (optimizeOutputJava) - scopeSeparator="."; - else - scopeSeparator="::"; + QCString scopeSeparator; + if (optimizeOutputJava) + scopeSeparator="."; + else + scopeSeparator="::"; - if (!scName.isEmpty()) scName+=scopeSeparator; - scName+=localName(); + if (!scName.isEmpty()) scName+=scopeSeparator; + } + scName+=m_impl->className; ArgumentList *al=0; bool isSpecialization = localName().find('<')!=-1; if (templateArguments()) diff --git a/src/code.l b/src/code.l index 8c22012..69e01c4 100644 --- a/src/code.l +++ b/src/code.l @@ -2441,7 +2441,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP} g_code->codify(yytext); } \n { - g_code->codify(yytext); + codifyLines(yytext); } ":" { g_code->codify(yytext); diff --git a/src/commentcnv.l b/src/commentcnv.l index 9a8d4f3..4c71988 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -61,6 +61,8 @@ static QStack g_condStack; static QCString g_blockName; static int g_lastCommentContext; static bool g_inSpecialComment; +static bool g_inRoseComment; +static int g_javaBlock; static QCString g_aliasString; static int g_blockCount; @@ -331,6 +333,7 @@ void replaceComment(int offset); g_blockHeadCol=g_col; copyToOutput("/**",3); replaceAliases(yytext+i); + g_inRoseComment=TRUE; BEGIN(SComment); } "//"/.*\n { /* one line C++ comment */ @@ -364,9 +367,17 @@ void replaceComment(int offset); BEGIN(CComment); } } +[ \t]+"{@code" { + copyToOutput(" @code",6); + g_lastCommentContext = YY_START; + g_javaBlock=1; + g_blockName=&yytext[1]; + BEGIN(VerbatimCode); + } [\\@]("dot"|"code"|"msc")/[^a-z_A-Z0-9] { /* start of a verbatim block */ copyToOutput(yytext,yyleng); g_lastCommentContext = YY_START; + g_javaBlock=0; g_blockName=&yytext[1]; BEGIN(VerbatimCode); } @@ -404,6 +415,31 @@ void replaceComment(int offset); BEGIN(g_lastCommentContext); } } +"{" { + if (g_javaBlock==0) + { + REJECT; + } + else + { + g_javaBlock++; + } + } +"}" { + if (g_javaBlock==0) + { + REJECT; + } + else + { + g_javaBlock--; + if (g_javaBlock==0) + { + copyToOutput(" @endcode ",10); + BEGIN(g_lastCommentContext); + } + } + } [\\@]("enddot"|"endcode"|"endmsc") { /* end of verbatim block */ copyToOutput(yytext,yyleng); if (&yytext[4]==g_blockName) @@ -417,7 +453,7 @@ void replaceComment(int offset); copyToOutput(yytext,yyleng); } } -[^@\/\\\n]* { /* any character not a backslash or new line */ +[^@\/\\\n{}]* { /* any character not a backslash or new line or } */ copyToOutput(yytext,yyleng); } \n { /* new line in verbatim block */ @@ -552,19 +588,34 @@ void replaceComment(int offset); BEGIN(ReadLine); } ^[ \t]*"//##"/.*\n { - replaceComment(0); - g_readLineCtx=YY_START; - BEGIN(ReadLine); + if (!g_inRoseComment) + { + REJECT; + } + else + { + replaceComment(0); + g_readLineCtx=YY_START; + BEGIN(ReadLine); + } } \n[ \t]*"//##"/.*\n { - replaceComment(1); - g_readLineCtx=YY_START; - BEGIN(ReadLine); + if (!g_inRoseComment) + { + REJECT; + } + else + { + replaceComment(1); + g_readLineCtx=YY_START; + BEGIN(ReadLine); + } } \n { /* end of special comment */ copyToOutput(" */",3); copyToOutput(yytext,yyleng); g_inSpecialComment=FALSE; + g_inRoseComment=FALSE; BEGIN(Scan); } [^\\@\n]*/\n { diff --git a/src/commentscan.l b/src/commentscan.l index 2652c6c..181a15a 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -540,7 +540,7 @@ static void addXRefItem(const char *listName,const char *itemTitle, item->listAnchor = anchorLabel; docEntry->addSpecialListItem(listName,itemId); QCString cmdString; - cmdString.sprintf("\\xrefitem %s %d\n",listName,itemId); + cmdString.sprintf("\\xrefitem %s %d.",listName,itemId); if (inBody) { docEntry->inbodyDocs += cmdString; @@ -1237,6 +1237,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" { current->name=current->name.left(current->name.length()-5); } + current->type.resize(0); BEGIN(GroupDocArg2); } "\\"{B}*"\n" { // line continuation @@ -2411,6 +2412,11 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, commentScanYYlex(); setOutput( OutputDoc ); + if (YY_START==OverloadParam) // comment ended with \overload + { + addOutput(getOverloadDocs()); + } + if (!guards.isEmpty()) { warn(yyFileName,yyLineNr,"Documentation block ended in the middle of a conditional section!"); @@ -2431,8 +2437,8 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, } Debug::print(Debug::CommentScan,0, - "brief=[%s]\ndocs=[%s]\n===========\n", - current->brief.data(),current->doc.data() + "brief=[%s]\ndocs=[%s]\ninbody=[%s]\n===========\n", + current->brief.data(),current->doc.data(),current->inbodyDocs.data() ); checkFormula(); diff --git a/src/declinfo.l b/src/declinfo.l index d4c2676..92a0b39 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -97,7 +97,7 @@ static int yyread(char *buf,int max_size) %} B [ \t] -ID ([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+) +ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+) %option nounput %option noyywrap diff --git a/src/definition.cpp b/src/definition.cpp index c9db4bd..865da3d 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -58,13 +58,14 @@ class DefinitionImpl QList *xrefListItems; GroupList *partOfGroups; - DocInfo *details; // not exported - BriefInfo *brief; // not exported - BodyInfo *body; // not exported + DocInfo *details; // not exported + DocInfo *inbodyDocs; // not exported + BriefInfo *brief; // not exported + BodyInfo *body; // not exported QCString docSignatures; QCString localName; // local (unqualified) name of the definition - // in the future m_name should become m_localName + // in the future m_name should become m_localName QCString qualifiedName; QCString ref; // reference to external documentation @@ -82,7 +83,7 @@ class DefinitionImpl DefinitionImpl::DefinitionImpl() : sectionDict(0), sourceRefByDict(0), sourceRefsDict(0), xrefListItems(0), partOfGroups(0), - details(0), brief(0), body(0), + details(0), inbodyDocs(0), brief(0), body(0), outerScope(0) { } @@ -97,6 +98,7 @@ DefinitionImpl::~DefinitionImpl() delete brief; delete details; delete body; + delete inbodyDocs; } void DefinitionImpl::init(const char *df,int dl, @@ -121,17 +123,18 @@ void DefinitionImpl::init(const char *df,int dl, } //printf("m_localName=%s\n",m_localName.data()); - brief = 0; - details = 0; - body = 0; - sourceRefByDict=0; - sourceRefsDict=0; - sectionDict=0, - outerScope=Doxygen::globalScope; - partOfGroups=0; - xrefListItems=0; - hidden = FALSE; - isArtificial = FALSE; + brief = 0; + details = 0; + body = 0; + inbodyDocs = 0; + sourceRefByDict = 0; + sourceRefsDict = 0; + sectionDict = 0, + outerScope = Doxygen::globalScope; + partOfGroups = 0; + xrefListItems = 0; + hidden = FALSE; + isArtificial = FALSE; } //----------------------------------------------------------------------------------------- @@ -305,26 +308,6 @@ void Definition::setName(const char *name) { if (name==0) return; m_name = name; -#if 0 - makeResident(); - if (m_isSymbol) - { - removeFromMap(this); - } - if (m_name!="") - { - //extractNamespaceName(m_name,m_localName,ns); - m_impl->localName=stripScope(m_name); - } - else - { - m_impl->localName=m_name; - } - if (m_isSymbol) - { - addToMap(m_name,this); - } -#endif } void Definition::addSectionsToDefinition(QList *anchorList) @@ -494,6 +477,31 @@ void Definition::setBriefDescription(const char *b,const char *briefFile,int bri _setBriefDescription(b,briefFile,briefLine); } +void Definition::_setInbodyDocumentation(const char *doc,const char *inbodyFile,int inbodyLine) +{ + if (m_impl->inbodyDocs==0) + { + m_impl->inbodyDocs = new DocInfo; + } + if (m_impl->inbodyDocs->doc.isEmpty()) // fresh inbody docs + { + m_impl->inbodyDocs->doc = doc; + m_impl->inbodyDocs->file = inbodyFile; + m_impl->inbodyDocs->line = inbodyLine; + } + else // another inbody documentation fragment, append this to the end + { + m_impl->inbodyDocs->doc += QCString("\n\n")+doc; + } +} + +void Definition::setInbodyDocumentation(const char *d,const char *inbodyFile,int inbodyLine) +{ + if (d==0) return; + makeResident(); + _setInbodyDocumentation(d,inbodyFile,inbodyLine); +} + /*! Reads a fragment of code from file \a fileName starting at * line \a startLine and ending at line \a endLine (inclusive). The fragment is * stored in \a result. If FALSE is returned the code fragment could not be @@ -903,8 +911,9 @@ bool Definition::hasDocumentation() const //static bool sourceBrowser = Config_getBool("SOURCE_BROWSER"); makeResident(); bool hasDocs = - (m_impl->details && !m_impl->details->doc.isEmpty()) || // has detailed docs - (m_impl->brief && !m_impl->brief->doc.isEmpty()) || // has brief description + (m_impl->details && !m_impl->details->doc.isEmpty()) || // has detailed docs + (m_impl->brief && !m_impl->brief->doc.isEmpty()) || // has brief description + (m_impl->inbodyDocs && !m_impl->inbodyDocs->doc.isEmpty()) || // has inbody docs extractAll //|| // extract everything // (sourceBrowser && m_impl->body && // m_impl->body->startLine!=-1 && m_impl->body->fileDef) @@ -916,8 +925,9 @@ bool Definition::hasUserDocumentation() const { makeResident(); bool hasDocs = - (m_impl->details && !m_impl->details->doc.isEmpty()) || - (m_impl->brief && !m_impl->brief->doc.isEmpty()); + (m_impl->details && !m_impl->details->doc.isEmpty()) || + (m_impl->brief && !m_impl->brief->doc.isEmpty()) || + (m_impl->inbodyDocs && !m_impl->inbodyDocs->doc.isEmpty()); return hasDocs; } @@ -1204,6 +1214,8 @@ QCString Definition::symbolName() const return m_symbolName; } +//---------------------- + QCString Definition::documentation() const { makeResident(); @@ -1222,6 +1234,8 @@ QCString Definition::docFile() const return m_impl->details ? m_impl->details->file : QCString("<"+m_name+">"); } +//---------------------- + QCString Definition::briefDescription() const { makeResident(); @@ -1266,6 +1280,29 @@ QCString Definition::briefFile() const return m_impl->brief ? m_impl->brief->file : QCString("<"+m_name+">"); } +//---------------------- + +QCString Definition::inbodyDocumentation() const +{ + makeResident(); + return m_impl->inbodyDocs ? m_impl->inbodyDocs->doc : QCString(""); +} + +int Definition::inbodyLine() const +{ + makeResident(); + return m_impl->inbodyDocs ? m_impl->inbodyDocs->line : 1; +} + +QCString Definition::inbodyFile() const +{ + makeResident(); + return m_impl->inbodyDocs ? m_impl->inbodyDocs->file : QCString("<"+m_name+">"); +} + + +//---------------------- + QCString Definition::getDefFileName() const { makeResident(); @@ -1405,6 +1442,7 @@ void Definition::flushToDisk() const marshalItemInfoList (Doxygen::symbolStorage,m_impl->xrefListItems); marshalGroupList (Doxygen::symbolStorage,m_impl->partOfGroups); marshalDocInfo (Doxygen::symbolStorage,m_impl->details); + marshalDocInfo (Doxygen::symbolStorage,m_impl->inbodyDocs); marshalBriefInfo (Doxygen::symbolStorage,m_impl->brief); marshalBodyInfo (Doxygen::symbolStorage,m_impl->body); marshalQCString (Doxygen::symbolStorage,m_impl->docSignatures); @@ -1436,6 +1474,7 @@ void Definition::loadFromDisk() const m_impl->xrefListItems = unmarshalItemInfoList (Doxygen::symbolStorage); m_impl->partOfGroups = unmarshalGroupList (Doxygen::symbolStorage); m_impl->details = unmarshalDocInfo (Doxygen::symbolStorage); + m_impl->inbodyDocs = unmarshalDocInfo (Doxygen::symbolStorage); m_impl->brief = unmarshalBriefInfo (Doxygen::symbolStorage); m_impl->body = unmarshalBodyInfo (Doxygen::symbolStorage); m_impl->docSignatures = unmarshalQCString (Doxygen::symbolStorage); diff --git a/src/definition.h b/src/definition.h index 765118d..78c9893 100644 --- a/src/definition.h +++ b/src/definition.h @@ -156,6 +156,16 @@ class Definition : public DefinitionIntf, public LockableObj /*! Returns the line number at which the brief description was found. */ int briefLine() const; + /*! Returns the documentation found inside the body of a member */ + QCString inbodyDocumentation() const; + + /*! Returns the file in which the in body documentation was found */ + QCString inbodyFile() const; + + /*! Returns the line at which the first in body documentation + part was found */ + int inbodyLine() const; + /*! Returns the file in which the brief description was found. * This can differ from getDefFileName(). */ @@ -255,6 +265,12 @@ class Definition : public DefinitionIntf, public LockableObj */ void setBriefDescription(const char *b,const char *briefFile,int briefLine); + /*! Set the documentation that was found inside the body of an item. + * If there was already some documentation set, the new documentation + * will be appended. + */ + void setInbodyDocumentation(const char *d,const char *docFile,int docLine); + /*! Sets the tag file id via which this definition was imported. */ void setReference(const char *r); @@ -318,6 +334,7 @@ class Definition : public DefinitionIntf, public LockableObj const QCString &text,MemberSDict *members,bool); void _setBriefDescription(const char *b,const char *briefFile,int briefLine); void _setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace,bool atTop); + void _setInbodyDocumentation(const char *d,const char *docFile,int docLine); bool _docsAlreadyAdded(const QString &doc); DefinitionImpl *m_impl; // internal structure holding all private data QCString m_name; diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 23fe600..dba1d85 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -343,9 +343,6 @@ void DirDef::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- -#define NEW_LAYOUT -#ifdef NEW_LAYOUT // new flexible layout - QListIterator eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Directory)); LayoutDocEntry *lde; @@ -410,35 +407,6 @@ void DirDef::writeDocumentation(OutputList &ol) } } - -#else - - // write brief or details (if DETAILS_AT_TOP) - if (Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - else if (!briefDescription().isEmpty()) - { - writeBriefDescription(ol); - } - - writeDirectoryGraph(ol); - - startMemberDeclarations(ol); - - writeSubDirList(ol); - writeFileList(ol); - - endMemberDeclarations(ol); - - if (!Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - -#endif - //---------------------------------------- end flexible part ------------------------------- if (!Config_getString("GENERATE_TAGFILE").isEmpty()) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index d183e4c..e095dff 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -290,7 +290,7 @@ CMD ("\\"|"@") WS [ \t\r\n] NONWS [^ \t\r\n] BLANK [ \t\r] -ID [a-z_A-Z][a-z_A-Z0-9]* +ID "$"?[a-z_A-Z][a-z_A-Z0-9]* MAILADR [a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+ OPTSTARS ("//"{BLANK}*)?"*"*{BLANK}* LISTITEM {BLANK}*{OPTSTARS}"-"("#")?{WS} @@ -773,7 +773,7 @@ REFWORD ("#"|"::")?({ID}{TEMPLPART}?("."|"#"|"::"|"-"|"/"))*({ID}(":")?){FUNCA " " { BEGIN(St_XRefItem2); } -[0-9]+{WS} { +[0-9]+"." { QString numStr=yytext; numStr=numStr.left(yyleng-1); g_token->id=numStr.toInt(); diff --git a/src/dot.cpp b/src/dot.cpp index ece1638..48c319b 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -587,7 +587,8 @@ static void writeBoxMemberList(QTextStream &t,char prot,MemberList *ml,ClassDef if (mma->getClassDef() == scope) { t << prot << " " << convertLabel(mma->name()); - if (!mma->isObjCMethod() && mma->isFunction()) t << "()"; + if (!mma->isObjCMethod() && + (mma->isFunction() || mma->isSlot() || mma->isSignal())) t << "()"; t << "\\l"; } } @@ -2323,7 +2324,7 @@ void DotCallGraph::buildGraph(DotNode *n,MemberDef *md,int distance) MemberDef *rmd; for (;(rmd=mri.current());++mri) { - if (rmd->isFunction()) + if (rmd->isFunction() || rmd->isSlot() || rmd->isSignal()) { QCString uniqueId; uniqueId=rmd->getReference()+"$"+ diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 03ef3ff..62ca201 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -142,31 +142,26 @@ bool Doxygen::gatherDefines = TRUE; IndexList Doxygen::indexList; int Doxygen::subpageNestingLevel = 0; bool Doxygen::userComments = FALSE; +QCString Doxygen::spaces; // locally accessible globals -static QDict classEntries(1009); -static StringList inputFiles; -static StringDict excludeNameDict(1009); // sections -static QDict compoundKeywordDict(7); // keywords recognised as compounds -static OutputList *outputList = 0; // list of output generating objects -static QDict g_usingDeclarations(1009); // used classes -static const char idMask[] = "[A-Za-z_][A-Za-z_0-9]*"; - -FileStorage *g_storage = 0; - -QCString spaces; - -static bool g_successfulRun = FALSE; -static bool g_dumpSymbolMap = FALSE; -static bool g_dumpConfigAsXML = FALSE; +static QDict g_classEntries(1009); +static StringList g_inputFiles; +static QDict g_compoundKeywordDict(7); // keywords recognised as compounds +static OutputList *g_outputList = 0; // list of output generating objects +static QDict g_usingDeclarations(1009); // used classes +static FileStorage *g_storage = 0; +static bool g_successfulRun = FALSE; +static bool g_dumpSymbolMap = FALSE; +static bool g_dumpConfigAsXML = FALSE; void clearAll() { - inputFiles.clear(); - excludeNameDict.clear(); - delete outputList; outputList=0; + g_inputFiles.clear(); + //g_excludeNameDict.clear(); + //delete g_outputList; g_outputList=0; Doxygen::classSDict->clear(); Doxygen::namespaceSDict->clear(); @@ -198,8 +193,8 @@ void statistics() Doxygen::imageNameDict->statistics(); fprintf(stderr,"--- dotFileNameDict stats ----\n"); Doxygen::dotFileNameDict->statistics(); - fprintf(stderr,"--- excludeNameDict stats ----\n"); - excludeNameDict.statistics(); + //fprintf(stderr,"--- g_excludeNameDict stats ----\n"); + //g_excludeNameDict.statistics(); fprintf(stderr,"--- aliasDict stats ----\n"); Doxygen::aliasDict.statistics(); fprintf(stderr,"--- typedefDict stats ----\n"); @@ -211,8 +206,8 @@ void statistics() Doxygen::formulaNameDict.statistics(); fprintf(stderr,"--- tagDestinationDict stats ----\n"); Doxygen::tagDestinationDict.statistics(); - fprintf(stderr,"--- compoundKeywordDict stats ----\n"); - compoundKeywordDict.statistics(); + fprintf(stderr,"--- g_compoundKeywordDict stats ----\n"); + g_compoundKeywordDict.statistics(); fprintf(stderr,"--- expandAsDefinedDict stats ----\n"); Doxygen::expandAsDefinedDict.statistics(); fprintf(stderr,"--- memGrpInfoDict stats ----\n"); @@ -468,11 +463,11 @@ static void addRelatedPage(EntryNav *rootNav) QCString doc; if (root->brief.isEmpty()) { - doc=root->doc; + doc=root->doc+root->inbodyDocs; } else { - doc=root->brief+"\n\n"+root->doc; + doc=root->brief+"\n\n"+root->doc+root->inbodyDocs; } PageDef *pd = addRelatedPage(root->name,root->args,doc,root->anchors, root->fileName,root->startLine, @@ -503,31 +498,21 @@ static void buildGroupListFiltered(EntryNav *rootNav,bool additional) if ((gd=Doxygen::groupSDict->find(root->name))) { -#if 0 - if ( root->groupDocType==Entry::GROUPDOC_NORMAL ) + if ( !gd->hasGroupTitle() ) { - warn(root->fileName,root->startLine, - "Warning: group %s already documented. " - "Skipping documentation.", - root->name.data()); + gd->setGroupTitle( root->type ); } - else -#endif + else if ( root->type.length() > 0 && root->name != root->type && gd->groupTitle() != root->type ) { - if ( !gd->hasGroupTitle() ) - gd->setGroupTitle( root->type ); - else if ( root->type.length() > 0 && root->name != root->type && gd->groupTitle() != root->type ) - warn( root->fileName,root->startLine, - "group %s: ignoring title \"%s\" that does not match old title \"%s\"\n", - root->name.data(), root->type.data(), gd->groupTitle() ); - //if ( gd->briefDescription().isEmpty() ) - gd->setBriefDescription(root->brief,root->briefFile,root->briefLine); - //if ( !root->doc.stripWhiteSpace().isEmpty() ) - gd->setDocumentation( root->doc, root->docFile, root->docLine ); - gd->addSectionsToDefinition(root->anchors); - gd->setRefItems(root->sli); - //addGroupToGroups(root,gd); + warn( root->fileName,root->startLine, + "group %s: ignoring title \"%s\" that does not match old title \"%s\"\n", + root->name.data(), root->type.data(), gd->groupTitle() ); } + gd->setBriefDescription(root->brief,root->briefFile,root->briefLine); + gd->setDocumentation( root->doc, root->docFile, root->docLine ); + gd->setInbodyDocumentation( root->inbodyDocs, root->inbodyFile, root->inbodyLine ); + gd->addSectionsToDefinition(root->anchors); + gd->setRefItems(root->sli); } else { @@ -542,6 +527,7 @@ static void buildGroupListFiltered(EntryNav *rootNav,bool additional) } gd->setBriefDescription(root->brief,root->briefFile,root->briefLine); gd->setDocumentation(root->doc,root->docFile,root->docLine); + gd->setInbodyDocumentation( root->inbodyDocs, root->inbodyFile, root->inbodyLine ); gd->addSectionsToDefinition(root->anchors); Doxygen::groupSDict->append(root->name,gd); gd->setRefItems(root->sli); @@ -1468,7 +1454,7 @@ static void buildNamespaceList(EntryNav *rootNav) //---------------------------------------------------------------------- -static NamespaceDef *findUsedNamespace(const NamespaceSDict *unl, +static NamespaceDef *findUsedNamespace(NamespaceSDict *unl, const QCString &name) { NamespaceDef *usingNd =0; @@ -1660,8 +1646,8 @@ static void findUsingDeclarations(EntryNav *rootNav) Entry *root = rootNav->entry(); //printf("Found using declaration %s at line %d of %s inside section %x\n", - // root->name.data(),root->startLine,root->fileName.data(), - // root->parent->section); + // root->name.data(),root->startLine,root->fileName.data(), + // rootNav->parent()->section()); if (!root->name.isEmpty()) { ClassDef *usingCd = 0; @@ -1686,9 +1672,7 @@ static void findUsingDeclarations(EntryNav *rootNav) // with the most inner scope and going to the most outer scope (i.e. // file scope). - QCString name = substitute(root->name,".","::"); - //MemberDef *mtd=0; - //usingCd = getResolvedClass(nd,fd,name,&mtd); + QCString name = substitute(root->name,".","::"); //Java/C# scope->internal usingCd = getClass(name); if (usingCd==0) { @@ -1712,22 +1696,6 @@ static void findUsingDeclarations(EntryNav *rootNav) usingCd->name().data(),nd?nd->name().data():fd->name().data()); } -#if 0 - if (mtd) // add the typedef to the correct scope - { - if (nd) - { - //printf("Inside namespace %s\n",nd->name().data()); - nd->addUsingDeclaration(mtd); - } - else if (fd) - { - //printf("Inside file %s\n",nd->name().data()); - fd->addUsingDeclaration(mtd); - } - } - else -#endif if (usingCd) // add the class to the correct scope { if (nd) @@ -1737,7 +1705,7 @@ static void findUsingDeclarations(EntryNav *rootNav) } else if (fd) { - //printf("Inside file %s\n",nd->name().data()); + //printf("Inside file %s\n",fd->name().data()); fd->addUsingDeclaration(usingCd); } } @@ -2056,16 +2024,46 @@ static MemberDef *addVariableToFile( FileDef *fd = rootNav->fileDef(); + // see if we have a typedef that should hide a struct or union + if (mtype==MemberDef::Typedef && Config_getBool("TYPEDEF_HIDES_STRUCT")) + { + QCString type = root->type; + type.stripPrefix("typedef "); + if (type.left(7)=="struct " || type.left(6)=="union ") + { + type.stripPrefix("struct "); + type.stripPrefix("union "); + static QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*"); + int l,s; + s = re.match(type,0,&l); + if (s>=0) + { + QCString typeValue = type.mid(s,l); + ClassDef *cd = getClass(typeValue); + if (cd) + { + // this typedef should hide compound name cd, so we + // change the name that is displayed from cd. + cd->setClassName(name); + cd->setDocumentation(root->doc,root->docFile,root->docLine); + cd->setBriefDescription(root->brief,root->briefFile,root->briefLine); + return 0; + } + } + } + } + // see if the function is inside a namespace NamespaceDef *nd = 0; QCString nscope; if (!scope.isEmpty()) { - nscope=removeAnonymousScopes(scope); - if (!nscope.isEmpty()) - { - nd = getResolvedNamespace(nscope); - } + if (scope.find('@')!=-1) return 0; // anonymous scope! + //nscope=removeAnonymousScopes(scope); + //if (!nscope.isEmpty()) + //{ + nd = getResolvedNamespace(scope); + //} } QCString def; @@ -2110,9 +2108,10 @@ static MemberDef *addVariableToFile( //QCString nscope=removeAnonymousScopes(scope); //NamespaceDef *nd=0; //if (!nscope.isEmpty()) - //{ - // nd = getResolvedNamespace(nscope); - //} + if (!scope.isEmpty()) + { + nd = getResolvedNamespace(scope); + } MemberNameIterator mni(*mn); MemberDef *md; for (mni.toFirst();(md=mni.current());++mni) @@ -2541,6 +2540,7 @@ static void addVariable(EntryNav *rootNav,int isFuncPtr=-1) } } } + //printf("name=`%s' scope=%s scope.right=%s\n", // name.data(),scope.data(), // scope.right(scope.length()-si).data()); @@ -2599,7 +2599,7 @@ static void buildVarList(EntryNav *rootNav) //printf("buildVarList(%s)\n",rootNav->name().data()); int isFuncPtr=-1; if (!rootNav->name().isEmpty() && - (rootNav->type().isEmpty() || compoundKeywordDict.find(rootNav->type())==0) && + (rootNav->type().isEmpty() || g_compoundKeywordDict.find(rootNav->type())==0) && ( (rootNav->section()==Entry::VARIABLE_SEC // it's a variable ) || @@ -2821,12 +2821,12 @@ static void buildFunctionList(EntryNav *rootNav) QCString rname = removeRedundantWhiteSpace(root->name); //printf("rname=%s\n",rname.data()); - if (!rname.isEmpty()) + QCString scope=rootNav->parent()->name(); //stripAnonymousNamespaceScope(root->parent->name); + if (!rname.isEmpty() && scope.find('@')==-1) { ClassDef *cd=0; // check if this function's parent is a class - QCString scope=rootNav->parent()->name(); //stripAnonymousNamespaceScope(root->parent->name); scope=stripTemplateSpecifiersFromScope(scope,FALSE); FileDef *rfd=rootNav->fileDef(); @@ -3042,7 +3042,8 @@ static void buildFunctionList(EntryNav *rootNav) // the name already (in that case nd should be non-zero already) if (nd==0 && rootNav->parent()->section() == Entry::NAMESPACE_SEC ) { - QCString nscope=removeAnonymousScopes(rootNav->parent()->name()); + //QCString nscope=removeAnonymousScopes(rootNav->parent()->name()); + QCString nscope=rootNav->parent()->name(); if (!nscope.isEmpty()) { nd = getResolvedNamespace(nscope); @@ -3845,7 +3846,7 @@ static void findBaseClassesForClass( BaseInfo *bi=0; for (bii.toFirst();(bi=bii.current());++bii) { - //printf("masterCd=%s bi->name=%s #actualArgs=%d\n", + //printf("masterCd=%s bi->name='%s' #actualArgs=%d\n", // masterCd->localName().data(),bi->name.data(),actualArgs?(int)actualArgs->count():-1); bool delTempNames=FALSE; if (templateNames==0) @@ -3924,7 +3925,7 @@ static bool findTemplateInstanceRelation(Entry *root, // search for new template instances caused by base classes of // instanceClass - EntryNav *templateRootNav = classEntries.find(templateClass->name()); + EntryNav *templateRootNav = g_classEntries.find(templateClass->name()); if (templateRootNav) { bool unloadNeeded=FALSE; @@ -4225,7 +4226,8 @@ static bool findClassRelation( } bool isATemplateArgument = templateNames!=0 && templateNames->find(biName)!=0; // make templSpec canonical - templSpec = getCanonicalTemplateSpec(cd, cd->getFileDef(), templSpec); + // Warning: the following line doesn't work for Mixin classes (see bug 560623) + // templSpec = getCanonicalTemplateSpec(cd, cd->getFileDef(), templSpec); //printf("3. found=%d\n",found); if (found) @@ -4378,7 +4380,7 @@ static void findClassEntries(EntryNav *rootNav) { if (isClassSection(rootNav)) { - classEntries.insert(rootNav->name(),rootNav); + g_classEntries.insert(rootNav->name(),rootNav); } RECURSE_ENTRYTREE(findClassEntries,rootNav); } @@ -4392,7 +4394,7 @@ static void findInheritedTemplateInstances() { ClassSDict::Iterator cli(*Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator edi(classEntries); + QDictIterator edi(g_classEntries); EntryNav *rootNav; for (;(rootNav=edi.current());++edi) { @@ -4415,7 +4417,7 @@ static void findUsedTemplateInstances() { ClassSDict::Iterator cli(*Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator edi(classEntries); + QDictIterator edi(g_classEntries); EntryNav *rootNav; for (;(rootNav=edi.current());++edi) { @@ -4437,7 +4439,7 @@ static void computeClassRelations() { ClassSDict::Iterator cli(*Doxygen::classSDict); for (cli.toFirst();cli.current();++cli) cli.current()->visited=FALSE; - QDictIterator edi(classEntries); + QDictIterator edi(g_classEntries); EntryNav *rootNav; for (;(rootNav=edi.current());++edi) { @@ -4476,7 +4478,7 @@ static void computeClassRelations() static void computeTemplateClassRelations() { - QDictIterator edi(classEntries); + QDictIterator edi(g_classEntries); EntryNav *rootNav; for (;(rootNav=edi.current());++edi) { @@ -4901,7 +4903,7 @@ static bool findGlobalMember(EntryNav *rootNav, FileDef *fd=rootNav->fileDef(); //printf("File %s\n",fd ? fd->name().data() : ""); - NamespaceSDict *nl = fd ? fd->getUsedNamespaces() : 0; + NamespaceSDict *nl = fd ? fd->getUsedNamespaces() : 0; //SDict *cl = fd ? fd->getUsedClasses() : 0; //printf("NamespaceList %p\n",nl); @@ -5007,9 +5009,8 @@ static QCString substituteTemplatesInString( ) { QCString dst; - QRegExp re(idMask); + QRegExp re( "[A-Za-z_][A-Za-z_0-9]*"); //printf("type=%s\n",sa->type.data()); - int i,p=0,l; while ((i=re.match(src,p,&l))!=-1) // for each word in srcType { @@ -5294,7 +5295,9 @@ static void findMember(EntryNav *rootNav, //printf("scopeName=`%s' className=`%s' namespaceName=`%s'\n", // scopeName.data(),className.data(),namespaceName.data()); - namespaceName=removeAnonymousScopes(namespaceName); + //namespaceName=removeAnonymousScopes(namespaceName); + if (namespaceName.find('@')!=-1) return; // skip stuff in anonymous namespace... + //printf("namespaceName=`%s' className=`%s'\n",namespaceName.data(),className.data()); // merge class and namespace scopes again scopeName.resize(0); @@ -6104,7 +6107,7 @@ static void filterMemberDocumentation(EntryNav *rootNav) || (root->section==Entry::VARIABLE_SEC && // variable !root->type.isEmpty() && // with a type - compoundKeywordDict.find(root->type)==0 // that is not a keyword + g_compoundKeywordDict.find(root->type)==0 // that is not a keyword // (to skip forward declaration of class etc.) ) ) @@ -6552,14 +6555,33 @@ static void addEnumValuesToEnums(EntryNav *rootNav) ) ) { - // For C# enum value are only inside the enum scope, so we - // must create them here + // Unlike C++, for C# enum value are only inside the enum + // scope, so we must create them here and only add them to the + // enum e->loadEntry(g_storage); - MemberDef *fmd = addVariableToFile(e,MemberDef::EnumValue, - md->getOuterScope() ? md->getOuterScope()->name() : QCString(), - e->name(),FALSE,0); - md->insertEnumField(fmd); - fmd->setEnumScope(md); + Entry *root = e->entry(); + MemberDef *fmd=new MemberDef( + root->fileName,root->startLine, + root->type,root->name,root->args,0, + Public, Normal,root->stat,Member, + MemberDef::EnumValue,0,0); + if (md->getClassDef()) fmd->setMemberClass(md->getClassDef()); + else if (md->getNamespaceDef()) fmd->setNamespace(md->getNamespaceDef()); + else if (md->getFileDef()) fmd->setFileDef(md->getFileDef()); + fmd->setOuterScope(md->getOuterScope()); + fmd->setTagInfo(e->tagInfo()); + fmd->setDocumentation(root->doc,root->docFile,root->docLine); + fmd->setBriefDescription(root->brief,root->briefFile,root->briefLine); + fmd->addSectionsToDefinition(root->anchors); + fmd->setInitializer(root->initializer); + fmd->setMaxInitLines(root->initLines); + fmd->setMemberGroupId(root->mGrpId); + fmd->setExplicitExternal(root->explicitExternal); + if (fmd) + { + md->insertEnumField(fmd); + fmd->setEnumScope(md); + } e->releaseEntry(); } else @@ -7024,7 +7046,7 @@ static void generateFileSources() if (fd->generateSourceFile()) // sources need to be shown in the output { msg("Generating code for file %s...\n",fd->docName().data()); - fd->writeSource(*outputList); + fd->writeSource(*g_outputList); } else if (!fd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them @@ -7057,7 +7079,7 @@ static void generateFileDocs() if (doc) { msg("Generating docs for file %s...\n",fd->docName().data()); - fd->writeDocumentation(*outputList); + fd->writeDocumentation(*g_outputList); } } } @@ -7163,11 +7185,11 @@ static void generateClassList(ClassSDict &classSDict) { msg("Generating docs for compound %s...\n",cd->name().data()); - cd->writeDocumentation(*outputList); - cd->writeMemberList(*outputList); + cd->writeDocumentation(*g_outputList); + cd->writeMemberList(*g_outputList); } // even for undocumented classes, the inner classes can be documented. - cd->writeDocumentationForInnerClasses(*outputList); + cd->writeDocumentationForInnerClasses(*g_outputList); } } } @@ -7185,19 +7207,19 @@ static void generateClassDocs() } msg("Generating annotated compound index...\n"); - writeAnnotatedIndex(*outputList); + writeAnnotatedIndex(*g_outputList); //if (Config_getBool("ALPHABETICAL_INDEX")) //{ msg("Generating alphabetical compound index...\n"); - writeAlphabeticalIndex(*outputList); + writeAlphabeticalIndex(*g_outputList); //} msg("Generating hierarchical class index...\n"); - writeHierarchicalIndex(*outputList); + writeHierarchicalIndex(*g_outputList); msg("Generating member index...\n"); - writeClassMemberIndex(*outputList); + writeClassMemberIndex(*g_outputList); if (Doxygen::exampleSDict->count()>0) { @@ -7742,7 +7764,7 @@ static void findMainPage(EntryNav *rootNav) QCString title=root->args.stripWhiteSpace(); QCString indexName=usingTreeIndex()?"main":"index"; Doxygen::mainPage = new PageDef(root->fileName,root->startLine, - indexName, root->brief+root->doc,title); + indexName, root->brief+root->doc+root->inbodyDocs,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); Doxygen::mainPage->setFileName(indexName); addPageToContext(Doxygen::mainPage,rootNav); @@ -7910,7 +7932,7 @@ static void generatePageDocs() { msg("Generating docs for page %s...\n",pd->name().data()); Doxygen::insideMainPage=TRUE; - pd->writeDocumentation(*outputList); + pd->writeDocumentation(*g_outputList); Doxygen::insideMainPage=FALSE; } } @@ -7937,7 +7959,7 @@ static void buildExampleList(EntryNav *rootNav) else { PageDef *pd=new PageDef(root->fileName,root->startLine, - root->name,root->brief+root->doc,root->args); + root->name,root->brief+root->doc+root->inbodyDocs,root->args); pd->setFileName(convertNameToFile(pd->name()+"-example")); pd->addSectionsToDefinition(root->anchors); //pi->addSections(root->anchors); @@ -7976,7 +7998,7 @@ void printNavTree(EntryNav *rootNav,int indent) static void generateExampleDocs() { - outputList->disable(OutputGenerator::Man); + g_outputList->disable(OutputGenerator::Man); PageSDict::Iterator pdi(*Doxygen::exampleSDict); PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) @@ -7984,11 +8006,11 @@ static void generateExampleDocs() msg("Generating docs for example %s...\n",pd->name().data()); resetCCodeParserState(); QCString n=pd->getOutputFileBase(); - startFile(*outputList,n,n,pd->name()); - startTitle(*outputList,n); - outputList->docify(pd->name()); - endTitle(*outputList,n,0); - outputList->parseDoc(pd->docFile(), // file + startFile(*g_outputList,n,n,pd->name()); + startTitle(*g_outputList,n); + g_outputList->docify(pd->name()); + endTitle(*g_outputList,n,0); + g_outputList->parseDoc(pd->docFile(), // file pd->docLine(), // startLine pd, // context 0, // memberDef @@ -7997,9 +8019,9 @@ static void generateExampleDocs() TRUE, // is example pd->name() ); - endFile(*outputList); + endFile(*g_outputList); } - outputList->enable(OutputGenerator::Man); + g_outputList->enable(OutputGenerator::Man); } //---------------------------------------------------------------------------- @@ -8013,7 +8035,7 @@ static void generateGroupDocs() { if (!gd->isReference()) { - gd->writeDocumentation(*outputList); + gd->writeDocumentation(*g_outputList); } } } @@ -8022,7 +8044,7 @@ static void generateGroupDocs() //static void generatePackageDocs() //{ -// writePackageIndex(*outputList); +// writePackageIndex(*g_outputList); // // if (Doxygen::packageDict.count()>0) // { @@ -8030,7 +8052,7 @@ static void generateGroupDocs() // PackageDef *pd; // for (pdi.toFirst();(pd=pdi.current());++pdi) // { -// pd->writeDocumentation(*outputList); +// pd->writeDocumentation(*g_outputList); // } // } //} @@ -8040,7 +8062,7 @@ static void generateGroupDocs() static void generateNamespaceDocs() { - writeNamespaceIndex(*outputList); + writeNamespaceIndex(*g_outputList); NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); NamespaceDef *nd; @@ -8051,7 +8073,7 @@ static void generateNamespaceDocs() if (nd->isLinkableInProject()) { msg("Generating docs for namespace %s\n",nd->name().data()); - nd->writeDocumentation(*outputList); + nd->writeDocumentation(*g_outputList); } // for each class in the namespace... @@ -8068,10 +8090,10 @@ static void generateNamespaceDocs() { msg("Generating docs for compound %s...\n",cd->name().data()); - cd->writeDocumentation(*outputList); - cd->writeMemberList(*outputList); + cd->writeDocumentation(*g_outputList); + cd->writeMemberList(*g_outputList); } - cd->writeDocumentationForInnerClasses(*outputList); + cd->writeDocumentationForInnerClasses(*g_outputList); } } } @@ -8201,14 +8223,14 @@ static QCString fixSlashes(QCString &s) // { // err("Error: Cannot open file %s for writing\n",fileName.data()); // } -// //outputList->generateExternalIndex(); -// outputList->pushGeneratorState(); -// outputList->disableAllBut(OutputGenerator::Html); -// startFile(*outputList,"header"+Doxygen::htmlFileExtension,0,"Search Engine",TRUE); -// outputList->endPlainFile(); -// outputList->startPlainFile("footer"+Doxygen::htmlFileExtension); -// endFile(*outputList,TRUE); -// outputList->popGeneratorState(); +// //g_outputList->generateExternalIndex(); +// g_outputList->pushGeneratorState(); +// g_outputList->disableAllBut(OutputGenerator::Html); +// startFile(*g_outputList,"header"+Doxygen::htmlFileExtension,0,"Search Engine",TRUE); +// g_outputList->endPlainFile(); +// g_outputList->startPlainFile("footer"+Doxygen::htmlFileExtension); +// endFile(*g_outputList,TRUE); +// g_outputList->popGeneratorState(); // } //} @@ -8513,7 +8535,7 @@ static void parseFiles(Entry *root,EntryNav *rootNav) } } - QCString *s=inputFiles.first(); + QCString *s=g_inputFiles.first(); while (s) { QCString fileName=*s; @@ -8561,10 +8583,65 @@ static void parseFiles(Entry *root,EntryNav *rootNav) ASSERT(fd!=0); root->createNavigationIndex(rootNav,g_storage,fd); - s=inputFiles.next(); + s=g_inputFiles.next(); } } +// resolves a path that may include symlinks, if a recursive symlink is +// found an empty string is returned. +static QCString resolveSymlink(QCString path) +{ + int sepPos=0; + QFileInfo fi; + QDict nonSymlinks; + QDict known; + QCString result = path; + do + { +#ifdef WIN32 + // UNC path, skip server and share name + if (sepPos==0 && (result.left(2)=="//" || result.left(2)=="\\\\")) + sepPos = result.find('/',2); + if (sepPos!=-1) + sepPos = result.find('/',sepPos+1); +#else + sepPos = result.find('/',sepPos+1); +#endif + QCString prefix = sepPos==-1 ? result : result.left(sepPos); + if (nonSymlinks.find(prefix)==0) + { + fi.setFile(prefix); + if (fi.isSymLink()) + { + QString target = fi.readLink(); + if (QFileInfo(target).isRelative()) + { + target = QDir::cleanDirPath(prefix+"/"+target.data()); + } + if (sepPos!=-1) + { + if (fi.isDir() && target.length()>0 && target.at(target.length()-1)!='/') + { + target+='/'; + } + target+=result.mid(sepPos); + } + result = QDir::cleanDirPath(target).data(); + sepPos = 0; + if (known.find(result)) return QCString(); // recursive symlink! + known.insert(result,(void*)0x8); + } + else + { + nonSymlinks.insert(prefix,(void*)0x8); + } + } + } + while (sepPos!=-1); + return QDir::cleanDirPath(result).data(); +} + +static QDict g_pathsVisited(1009); //---------------------------------------------------------------------------- // Read all files matching at least one pattern in `patList' in the @@ -8585,7 +8662,15 @@ int readDir(QFileInfo *fi, QDict *killDict ) { - QDir dir((const char *)fi->absFilePath()); + QString dirName = fi->absFilePath(); + if (fi->isSymLink()) + { + dirName = resolveSymlink(dirName.data()); + if (dirName.isEmpty()) return 0; // recusive symlink + if (g_pathsVisited.find(dirName)) return 0; // already visited path + g_pathsVisited.insert(dirName,(void*)0x8); + } + QDir dir(dirName); dir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden ); int totalSize=0; msg("Searching for files in directory %s\n", fi->absFilePath().data()); @@ -9001,6 +9086,40 @@ void initDoxygen() initClassMemberIndices(); initNamespaceMemberIndices(); initFileMemberIndices(); + + Doxygen::symbolMap = new QDict(1000); + Doxygen::inputNameList = new FileNameList; + Doxygen::inputNameList->setAutoDelete(TRUE); + Doxygen::memberNameSDict = new MemberNameSDict(10000); + Doxygen::memberNameSDict->setAutoDelete(TRUE); + Doxygen::functionNameSDict = new MemberNameSDict(10000); + Doxygen::functionNameSDict->setAutoDelete(TRUE); + Doxygen::groupSDict = new GroupSDict(17); + Doxygen::groupSDict->setAutoDelete(TRUE); + Doxygen::globalScope = new NamespaceDef("",1,""); + Doxygen::namespaceSDict = new NamespaceSDict(20); + Doxygen::namespaceSDict->setAutoDelete(TRUE); + Doxygen::classSDict = new ClassSDict(1009); + Doxygen::classSDict->setAutoDelete(TRUE); + Doxygen::hiddenClasses = new ClassSDict(257); + Doxygen::hiddenClasses->setAutoDelete(TRUE); + Doxygen::directories = new DirSDict(17); + Doxygen::directories->setAutoDelete(TRUE); + Doxygen::pageSDict = new PageSDict(1009); // all doc pages + Doxygen::pageSDict->setAutoDelete(TRUE); + Doxygen::exampleSDict = new PageSDict(1009); // all examples + Doxygen::exampleSDict->setAutoDelete(TRUE); + Doxygen::inputNameDict = new FileNameDict(10007); + Doxygen::includeNameDict = new FileNameDict(10007); + Doxygen::exampleNameDict = new FileNameDict(1009); + Doxygen::exampleNameDict->setAutoDelete(TRUE); + Doxygen::imageNameDict = new FileNameDict(257); + Doxygen::dotFileNameDict = new FileNameDict(257); + Doxygen::sectionDict.setAutoDelete(TRUE); + Doxygen::memGrpInfoDict.setAutoDelete(TRUE); + Doxygen::tagDestinationDict.setAutoDelete(TRUE); + Doxygen::lookupCache.setAutoDelete(TRUE); + Doxygen::dirRelations.setAutoDelete(TRUE); } void cleanUpDoxygen() @@ -9018,7 +9137,7 @@ void cleanUpDoxygen() delete Doxygen::parserManager; cleanUpPreprocessor(); delete theTranslator; - delete outputList; + delete g_outputList; Mappers::freeMappers(); codeFreeScanner(); @@ -9368,6 +9487,7 @@ void readConfiguration(int argc, char **argv) } +/** check and resolve config options */ void checkConfiguration() { @@ -9376,7 +9496,11 @@ void checkConfiguration() Config::instance()->check(); initWarningFormat(); +} +/** adjust globals that depend on configuration settings. */ +void adjustConfiguration() +{ QCString outputLanguage=Config_getEnum("OUTPUT_LANGUAGE"); if (!setTranslator(outputLanguage)) { @@ -9403,7 +9527,56 @@ void checkConfiguration() Config_getBool("REFERENCES_RELATION") || Config_getBool("REFERENCED_BY_RELATION"); + /************************************************************************** + * Add custom extension mappings + **************************************************************************/ + QStrList &extMaps = Config_getList("EXTENSION_MAPPING"); + char *mapping = extMaps.first(); + while (mapping) + { + QCString mapStr = mapping; + int i; + if ((i=mapStr.find('='))!=-1) + { + QCString ext=mapStr.left(i).stripWhiteSpace().lower(); + QCString language=mapStr.mid(i+1).stripWhiteSpace().lower(); + if (!updateLanguageMapping(ext,language)) + { + err("Failed to map file extension '%s' to unsupported language '%s'.\n" + "Check the EXTENSION_MAPPING setting in the config file.\n", + ext.data(),language.data()); + } + else + { + msg("Adding custom extension mapping: .%s will be treated as language %s\n", + ext.data(),language.data()); + } + } + mapping = extMaps.next(); + } + + + // add predefined macro name to a dictionary + QStrList &expandAsDefinedList =Config_getList("EXPAND_AS_DEFINED"); + s=expandAsDefinedList.first(); + while (s) + { + if (Doxygen::expandAsDefinedDict[s]==0) + { + Doxygen::expandAsDefinedDict.insert(s,(void *)666); + } + s=expandAsDefinedList.next(); + } + + // read aliases and store them in a dictionary + readAliases(); + + // store number of spaces in a tab into Doxygen::spaces + int &tabSize = Config_getInt("TAB_SIZE"); + Doxygen::spaces.resize(tabSize+1); + int sp;for (sp=0;sp *killDict = new QDict(10007); + int inputSize=0; + QStrList &inputList=Config_getList("INPUT"); + inputFiles.setAutoDelete(TRUE); + s=inputList.first(); + while (s) { - QCString mapStr = mapping; - int i; - if ((i=mapStr.find('='))!=-1) - { - QCString ext=mapStr.left(i).stripWhiteSpace().lower(); - QCString language=mapStr.mid(i+1).stripWhiteSpace().lower(); - if (!updateLanguageMapping(ext,language)) - { - err("Failed to map file extension '%s' to unsupported language '%s'.\n" - "Check the EXTENSION_MAPPING setting in the config file.\n", - ext.data(),language.data()); - } - else - { - msg("Adding custom extension mapping: .%s will be treated as language %s\n", - ext.data(),language.data()); - } - } - mapping = extMaps.next(); + QCString path=s; + uint l = path.length(); + // strip trailing slashes + if (path.at(l-1)=='\\' || path.at(l-1)=='/') path=path.left(l-1); + + inputSize+=readFileOrDirectory( + path, + Doxygen::inputNameList, + Doxygen::inputNameDict, + &excludeNameDict, + &Config_getList("FILE_PATTERNS"), + &exclPatterns, + &inputFiles,0, + alwaysRecursive, + TRUE, + killDict); + s=inputList.next(); } + delete killDict; +} + +void parseInput() +{ + atexit(exitDoxygen); /************************************************************************** @@ -9551,7 +9798,6 @@ void parseInput() * Initialize global lists and dictionaries **************************************************************************/ - Doxygen::symbolMap = new QDict(1000); int cacheSize = Config_getInt("SYMBOL_CACHE_SIZE"); if (cacheSize<0) cacheSize=0; if (cacheSize>9) cacheSize=9; @@ -9575,58 +9821,19 @@ void parseInput() exit(1); } - Doxygen::inputNameList = new FileNameList; - Doxygen::inputNameList->setAutoDelete(TRUE); - Doxygen::memberNameSDict = new MemberNameSDict(10000); - Doxygen::memberNameSDict->setAutoDelete(TRUE); - Doxygen::functionNameSDict = new MemberNameSDict(10000); - Doxygen::functionNameSDict->setAutoDelete(TRUE); - Doxygen::groupSDict = new GroupSDict(17); - Doxygen::groupSDict->setAutoDelete(TRUE); - Doxygen::globalScope = new NamespaceDef("",1,""); - Doxygen::namespaceSDict = new NamespaceSDict(20); - Doxygen::namespaceSDict->setAutoDelete(TRUE); - Doxygen::classSDict = new ClassSDict(1009); - Doxygen::classSDict->setAutoDelete(TRUE); - Doxygen::hiddenClasses = new ClassSDict(257); - Doxygen::hiddenClasses->setAutoDelete(TRUE); - Doxygen::directories = new DirSDict(17); - Doxygen::directories->setAutoDelete(TRUE); - Doxygen::pageSDict = new PageSDict(1009); // all doc pages - Doxygen::pageSDict->setAutoDelete(TRUE); - Doxygen::exampleSDict = new PageSDict(1009); // all examples - Doxygen::exampleSDict->setAutoDelete(TRUE); - Doxygen::inputNameDict = new FileNameDict(10007); - Doxygen::includeNameDict = new FileNameDict(10007); - Doxygen::exampleNameDict = new FileNameDict(1009); - Doxygen::exampleNameDict->setAutoDelete(TRUE); - Doxygen::imageNameDict = new FileNameDict(257); - Doxygen::dotFileNameDict = new FileNameDict(257); - Doxygen::sectionDict.setAutoDelete(TRUE); - Doxygen::memGrpInfoDict.setAutoDelete(TRUE); - Doxygen::tagDestinationDict.setAutoDelete(TRUE); - Doxygen::lookupCache.setAutoDelete(TRUE); - Doxygen::dirRelations.setAutoDelete(TRUE); - excludeNameDict.setAutoDelete(TRUE); /************************************************************************** * Initialize some global constants **************************************************************************/ - int &tabSize = Config_getInt("TAB_SIZE"); - spaces.resize(tabSize+1); - int sp;for (sp=0;sp *killDict = new QDict(10007); - int inputSize=0; - QStrList &inputList=Config_getList("INPUT"); - inputFiles.setAutoDelete(TRUE); - s=inputList.first(); - while (s) - { - QCString path=s; - uint l = path.length(); - // strip trailing slashes - if (path.at(l-1)=='\\' || path.at(l-1)=='/') path=path.left(l-1); - - inputSize+=readFileOrDirectory( - path, - Doxygen::inputNameList, - Doxygen::inputNameDict, - &excludeNameDict, - &Config_getList("FILE_PATTERNS"), - &exclPatterns, - &inputFiles,0, - alwaysRecursive, - TRUE, - killDict); - s=inputList.next(); - } - delete killDict; - - // add predefined macro name to a dictionary - QStrList &expandAsDefinedList =Config_getList("EXPAND_AS_DEFINED"); - s=expandAsDefinedList.first(); - while (s) - { - if (Doxygen::expandAsDefinedDict[s]==0) - { - Doxygen::expandAsDefinedDict.insert(s,(void *)666); - } - s=expandAsDefinedList.next(); - } - - // read aliases and store them in a dictionary - readAliases(); + searchInputFiles(g_inputFiles); // Notice: the order of the function calls below is very important! @@ -9830,7 +9929,7 @@ void parseInput() msg("Reading and parsing tag files\n"); QStrList &tagFileList = Config_getList("TAGFILES"); - s=tagFileList.first(); + char *s=tagFileList.first(); while (s) { readTagFile(root,s); @@ -9888,9 +9987,6 @@ void parseInput() buildFileList(rootNav); //generateFileTree(); - msg("Searching for included using directives...\n"); - findIncludedUsingDirectives(); - msg("Building class list...\n"); buildClassList(rootNav); @@ -9904,16 +10000,12 @@ void parseInput() resolveClassNestingRelations(); // calling buildClassList may result in cached relations that - // become invalid after resolveClassNestingRelation(), that's why + // become invalid after resolveClassNestingRelations(), that's why // we need to clear the cache here Doxygen::lookupCache.clear(); // we don't need the list of using declaration anymore g_usingDeclarations.clear(); - msg("Searching for members imported via using declarations...\n"); - findUsingDeclImports(rootNav); - findUsingDeclarations(rootNav); - msg("Building example list...\n"); buildExampleList(rootNav); @@ -9927,6 +10019,15 @@ void parseInput() msg("Searching for documented typedefs...\n"); buildTypedefList(rootNav); + msg("Searching for members imported via using declarations...\n"); + findUsingDeclImports(rootNav); + // this should be after buildTypedefList in order to properly import + // used typedefs + findUsingDeclarations(rootNav); + + msg("Searching for included using directives...\n"); + findIncludedUsingDirectives(); + msg("Searching for documented variables...\n"); buildVarList(rootNav); @@ -9956,13 +10057,13 @@ void parseInput() flushUnresolvedRelations(); //if (Config_getBool("OPTIMIZE_OUTPUT_VHDL")) //{ - // VhdlDocGen::computeVhdlComponentRelations(classEntries,g_storage); + // VhdlDocGen::computeVhdlComponentRelations(g_classEntries,g_storage); //} //else //{ computeClassRelations(); //} - classEntries.clear(); + g_classEntries.clear(); msg("Add enum values to enums...\n"); addEnumValuesToEnums(rootNav); @@ -10093,10 +10194,10 @@ void generateOutput() initDocParser(); - outputList = new OutputList(TRUE); + g_outputList = new OutputList(TRUE); if (Config_getBool("GENERATE_HTML")) { - outputList->add(new HtmlGenerator); + g_outputList->add(new HtmlGenerator); HtmlGenerator::init(); if (Config_getBool("GENERATE_HTMLHELP")) Doxygen::indexList.addIndex(new HtmlHelp); if (Config_getBool("GENERATE_QHP")) Doxygen::indexList.addIndex(new Qhp); @@ -10116,17 +10217,17 @@ void generateOutput() } if (Config_getBool("GENERATE_LATEX")) { - outputList->add(new LatexGenerator); + g_outputList->add(new LatexGenerator); LatexGenerator::init(); } if (Config_getBool("GENERATE_MAN")) { - outputList->add(new ManGenerator); + g_outputList->add(new ManGenerator); ManGenerator::init(); } if (Config_getBool("GENERATE_RTF")) { - outputList->add(new RTFGenerator); + g_outputList->add(new RTFGenerator); RTFGenerator::init(); } @@ -10171,17 +10272,17 @@ void generateOutput() //printf("writing style info\n"); QCString genString = theTranslator->trGeneratedAt(dateToString(TRUE),Config_getString("PROJECT_NAME")); - outputList->writeStyleInfo(0); // write first part - outputList->disableAllBut(OutputGenerator::Latex); - outputList->parseText(genString); - outputList->writeStyleInfo(1); // write second part - //parseText(*outputList,theTranslator->trWrittenBy()); - outputList->writeStyleInfo(2); // write third part - outputList->parseText(genString); - outputList->writeStyleInfo(3); // write fourth part - //parseText(*outputList,theTranslator->trWrittenBy()); - outputList->writeStyleInfo(4); // write last part - outputList->enableAll(); + g_outputList->writeStyleInfo(0); // write first part + g_outputList->disableAllBut(OutputGenerator::Latex); + g_outputList->parseText(genString); + g_outputList->writeStyleInfo(1); // write second part + //parseText(*g_outputList,theTranslator->trWrittenBy()); + g_outputList->writeStyleInfo(2); // write third part + g_outputList->parseText(genString); + g_outputList->writeStyleInfo(3); // write fourth part + //parseText(*g_outputList,theTranslator->trWrittenBy()); + g_outputList->writeStyleInfo(4); // write last part + g_outputList->enableAll(); //statistics(); @@ -10189,10 +10290,10 @@ void generateOutput() // If the result is 0 we do not generate the lists and omit the // corresponding links in the index. msg("Generating index page...\n"); - writeIndex(*outputList); + writeIndex(*g_outputList); msg("Generating page index...\n"); - writePageIndex(*outputList); + writePageIndex(*g_outputList); msg("Generating example documentation...\n"); generateExampleDocs(); @@ -10213,7 +10314,7 @@ void generateOutput() generateGroupDocs(); msg("Generating group index...\n"); - writeGroupIndex(*outputList); + writeGroupIndex(*g_outputList); msg("Generating class documentation...\n"); generateClassDocs(); @@ -10221,41 +10322,41 @@ void generateOutput() if (Config_getBool("HAVE_DOT") && Config_getBool("GRAPHICAL_HIERARCHY")) { msg("Generating graphical class hierarchy...\n"); - writeGraphicalClassHierarchy(*outputList); + writeGraphicalClassHierarchy(*g_outputList); } msg("Generating namespace index...\n"); generateNamespaceDocs(); msg("Generating namespace member index...\n"); - writeNamespaceMemberIndex(*outputList); + writeNamespaceMemberIndex(*g_outputList); if (Config_getBool("GENERATE_LEGEND")) { msg("Generating graph info page...\n"); - writeGraphInfo(*outputList); + writeGraphInfo(*g_outputList); } if (Config_getBool("SHOW_DIRECTORIES")) { msg("Generating directory documentation...\n"); - generateDirDocs(*outputList); + generateDirDocs(*g_outputList); } msg("Generating file index...\n"); - writeFileIndex(*outputList); + writeFileIndex(*g_outputList); if (Config_getBool("SHOW_DIRECTORIES")) { msg("Generating directory index...\n"); - writeDirIndex(*outputList); + writeDirIndex(*g_outputList); } msg("Generating example index...\n"); - writeExampleIndex(*outputList); + writeExampleIndex(*g_outputList); msg("Generating file member index...\n"); - writeFileMemberIndex(*outputList); + writeFileMemberIndex(*g_outputList); //writeDirDependencyGraph(Config_getString("HTML_OUTPUT")); diff --git a/src/doxygen.h b/src/doxygen.h index 034389f..c8e8c58 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -71,7 +71,7 @@ struct LookupInfo QCString resolvedType; }; -extern QCString spaces; +extern QCString g_spaces; /*! \brief This class serves as a namespace for global variables used by doxygen. * @@ -130,11 +130,14 @@ class Doxygen static bool userComments; static IndexList indexList; static int subpageNestingLevel; + static QCString spaces; }; void initDoxygen(); void readConfiguration(int argc, char **argv); void checkConfiguration(); +void adjustConfiguration(); +void searchInputFiles(StringList &inputFiles); void parseInput(); void generateOutput(); void readAliases(); diff --git a/src/filedef.cpp b/src/filedef.cpp index d17f796..515dce8 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -530,9 +530,6 @@ void FileDef::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- -#define NEW_LAYOUT -#ifdef NEW_LAYOUT // new flexible layout - QListIterator eli( LayoutDocManager::instance().docEntries(LayoutDocManager::File)); LayoutDocEntry *lde; @@ -627,62 +624,6 @@ void FileDef::writeDocumentation(OutputList &ol) } } - -#else - - bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); - bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - - if (Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - else - { - writeBriefDescription(ol); - } - - writeIncludeFiles(ol); - writeIncludeGraph(ol); - writeIncludedByGraph(ol); - writeSourceLink(ol); - - startMemberDeclarations(ol); - - writeNamespaceDeclarations(ol); - writeClassDeclarations(ol); - writeMemberGroups(ol); - - writeMemberDeclarations(ol,MemberList::decDefineMembers,theTranslator->trDefines()); - writeMemberDeclarations(ol,MemberList::decTypedefMembers,theTranslator->trTypedefs()); - writeMemberDeclarations(ol,MemberList::decEnumMembers,theTranslator->trEnumerations()); - writeMemberDeclarations(ol,MemberList::decFuncMembers, - fortranOpt ? theTranslator->trSubprograms() : - vhdlOpt ? VhdlDocGen::trFunctionAndProc() : - theTranslator->trFunctions()) ; - writeMemberDeclarations(ol,MemberList::decVarMembers,theTranslator->trVariables()); - - endMemberDeclarations(ol); - - if (!Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - - startMemberDocumentation(ol); - - writeMemberDocumentation(ol,MemberList::docDefineMembers,theTranslator->trDefineDocumentation()); - writeMemberDocumentation(ol,MemberList::docTypedefMembers,theTranslator->trTypedefDocumentation()); - writeMemberDocumentation(ol,MemberList::docEnumMembers,theTranslator->trEnumerationTypeDocumentation()); - writeMemberDocumentation(ol,MemberList::docFuncMembers,theTranslator->trFunctionDocumentation()); - writeMemberDocumentation(ol,MemberList::docVarMembers,theTranslator->trVariableDocumentation()); - - endMemberDocumentation(ol); - - // write Author section (Man only) - writeAuthorSection(ol); - -#endif //---------------------------------------- end flexible part ------------------------------- if (!Config_getString("GENERATE_TAGFILE").isEmpty()) @@ -1056,6 +997,7 @@ void FileDef::addIncludedUsingDirectives() { if (ii->fileDef && ii->fileDef!=this) { + // add using directives NamespaceSDict *unl = ii->fileDef->usingDirList; if (unl) { @@ -1073,6 +1015,25 @@ void FileDef::addIncludedUsingDirectives() } } } + // add using declarations + SDict *udl = ii->fileDef->usingDeclList; + if (udl) + { + SDict::Iterator udi(*udl); + Definition *d; + for (udi.toLast();(d=udi.current());--udi) + { + //printf("Adding using declaration %s\n",d->name().data()); + if (usingDeclList==0) + { + usingDeclList = new SDict(17); + } + if (usingDeclList->find(d->qualifiedName())==0) + { + usingDeclList->prepend(d->qualifiedName(),d); + } + } + } } } } diff --git a/src/fortrancode.l b/src/fortrancode.l index 8a95038..183f4d9 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -345,10 +345,10 @@ static void addDocCrossReference(MemberDef *src, MemberDef *dst) //------------------------------------------------------------------------------- /** searches for definition of a type - @param memberName the name of the type + @param tname the name of the type @param moduleName name of enclosing module or null, if global entry @param cd the entry, if found or null - @param useList array of data of USE-statement + @param useDict dictionary of data of USE-statement @returns true, if type is found */ static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName, diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 3fa9bd1..88ae240 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -204,7 +204,7 @@ SEPARATE [:, \t] ID [a-z_A-Z%]+{IDSYM}* PP_ID {ID} LABELID [a-z_A-Z]+[a-z_A-Z0-9\-]* -SUBPROG (subroutine|function) +SUBPROG (subroutine|function|block) B [ \t] BS [ \t]* BS_ [ \t]+ diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 13572ee..1d27d2b 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -747,6 +747,7 @@ void FTVHelp::generateTreeView(QString* OutString) else { QTextStream t(&f); + t.setEncoding(QTextStream::UnicodeUTF8); t << *OutString << endl; f.close(); } diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 746c6a7..c65f483 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -500,7 +500,7 @@ void GroupDef::computeAnchors() void GroupDef::writeDetailedDescription(OutputList &ol,const QCString &title) { if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) - || !documentation().isEmpty() + || !documentation().isEmpty() || !inbodyDocumentation().isEmpty() ) { if (pageDict->count()!=countMembers()) // not only pages -> classical layout @@ -513,25 +513,25 @@ void GroupDef::writeDetailedDescription(OutputList &ol,const QCString &title) ol.startGroupHeader(); ol.parseText(title); ol.endGroupHeader(); + } - // repeat brief description - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) - { - ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE); - } - // write separator between brief and details - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && - !documentation().isEmpty()) - { - ol.pushGeneratorState(); - ol.disable(OutputGenerator::Man); - ol.disable(OutputGenerator::RTF); - ol.newParagraph(); - ol.enableAll(); - ol.disableAllBut(OutputGenerator::Man); - ol.writeString("\n\n"); - ol.popGeneratorState(); - } + // repeat brief description + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) + { + ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE); + } + // write separator between brief and details + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && + !documentation().isEmpty()) + { + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::RTF); + ol.newParagraph(); + ol.enableAll(); + ol.disableAllBut(OutputGenerator::Man); + ol.writeString("\n\n"); + ol.popGeneratorState(); } // write detailed documentation @@ -539,6 +539,12 @@ void GroupDef::writeDetailedDescription(OutputList &ol,const QCString &title) { ol.parseDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE); } + + // write inbody documentation + if (!inbodyDocumentation().isEmpty()) + { + ol.parseDoc(inbodyFile(),inbodyLine(),this,0,inbodyDocumentation()+"\n",TRUE,FALSE); + } } } @@ -729,7 +735,7 @@ void GroupDef::writePageDocumentation(OutputList &ol) ol.endSection(si->label,SectionInfo::Subsection); } ol.startTextBlock(); - ol.parseDoc(pd->docFile(),pd->docLine(),pd,0,pd->documentation(),TRUE,FALSE); + ol.parseDoc(pd->docFile(),pd->docLine(),pd,0,pd->documentation()+pd->inbodyDocumentation(),TRUE,FALSE); ol.endTextBlock(); } } @@ -822,9 +828,6 @@ void GroupDef::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- -#define NEW_LAYOUT -#ifdef NEW_LAYOUT // new flexible layout - QListIterator eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); LayoutDocEntry *lde; @@ -930,78 +933,6 @@ void GroupDef::writeDocumentation(OutputList &ol) } } -#else - - bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); - bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - - - if (Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - else - { - writeBriefDescription(ol); - } - - writeGroupGraph(ol); - - startMemberDeclarations(ol); - - writeFiles(ol); - writeNamespaces(ol); - writeNestedGroups(ol); - writeDirs(ol); - writeClasses(ol); - writeMemberGroups(ol); - - writeMemberDeclarations(ol,MemberList::decDefineMembers,theTranslator->trDefines()); - writeMemberDeclarations(ol,MemberList::decTypedefMembers,theTranslator->trTypedefs()); - writeMemberDeclarations(ol,MemberList::decEnumMembers,theTranslator->trEnumerations()); - writeMemberDeclarations(ol,MemberList::decEnumValMembers,theTranslator->trEnumerationValues()); - writeMemberDeclarations(ol,MemberList::decFuncMembers, - fortranOpt ? theTranslator->trSubprograms() : - vhdlOpt ? VhdlDocGen::trFunctionAndProc() : - theTranslator->trFunctions()); - writeMemberDeclarations(ol,MemberList::decVarMembers,theTranslator->trVariables()); - writeMemberDeclarations(ol,MemberList::decSignalMembers,theTranslator->trSignals()); - writeMemberDeclarations(ol,MemberList::decPubSlotMembers,theTranslator->trPublicSlots()); - writeMemberDeclarations(ol,MemberList::decProSlotMembers,theTranslator->trProtectedSlots()); - writeMemberDeclarations(ol,MemberList::decPriSlotMembers,theTranslator->trPrivateSlots()); - writeMemberDeclarations(ol,MemberList::decEventMembers,theTranslator->trEvents()); - writeMemberDeclarations(ol,MemberList::decPropMembers,theTranslator->trProperties()); - writeMemberDeclarations(ol,MemberList::decFriendMembers,theTranslator->trFriends()); - - endMemberDeclarations(ol); - - if (!Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - - startMemberDocumentation(ol); - - writePageDocumentation(ol); - - writeMemberDocumentation(ol,MemberList::docDefineMembers,theTranslator->trDefineDocumentation()); - writeMemberDocumentation(ol,MemberList::docTypedefMembers,theTranslator->trTypedefDocumentation()); - writeMemberDocumentation(ol,MemberList::docEnumMembers,theTranslator->trEnumerationTypeDocumentation()); - writeMemberDocumentation(ol,MemberList::docEnumValMembers,theTranslator->trEnumerationValueDocumentation()); - writeMemberDocumentation(ol,MemberList::docFuncMembers,fortranOpt?theTranslator->trSubprogramDocumentation():theTranslator->trFunctionDocumentation()); - writeMemberDocumentation(ol,MemberList::docVarMembers,theTranslator->trVariableDocumentation()); - writeMemberDocumentation(ol,MemberList::docSignalMembers,theTranslator->trSignals()); // todo: add trSignalDocumentation() - writeMemberDocumentation(ol,MemberList::docPubSlotMembers,theTranslator->trPublicSlots()); // todo: add trSlotDocumentation() - writeMemberDocumentation(ol,MemberList::docProSlotMembers,theTranslator->trProtectedSlots()); // todo: add trSlotDocumentation() - writeMemberDocumentation(ol,MemberList::docPriSlotMembers,theTranslator->trPrivateSlots()); // todo: add trSlotDocumentation() - writeMemberDocumentation(ol,MemberList::docEventMembers,theTranslator->trEvents()); // todo: add trEventDocumentation() - writeMemberDocumentation(ol,MemberList::docPropMembers,theTranslator->trProperties()); // todo: add trPropertyDocumentation() - writeMemberDocumentation(ol,MemberList::docFriendMembers,theTranslator->trFriends()); // todo: add trFriendDocumentation() - - endMemberDocumentation(ol); - -#endif - //---------------------------------------- end flexible part ------------------------------- endFile(ol); diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index bca8fc6..9aa8174 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1081,7 +1081,7 @@ void HtmlGenerator::codify(const char *str) { case '\t': spacesToNextTabStop = Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE")); - t << spaces.left(spacesToNextTabStop); + t << Doxygen::spaces.left(spacesToNextTabStop); col+=spacesToNextTabStop; break; case '\n': t << "\n"; col=0; @@ -1740,9 +1740,6 @@ static QCString fixSpaces(const QCString &s) return substitute(s," "," "); } -#define NEW_LAYOUT -#ifdef NEW_LAYOUT - static bool quickLinkVisible(LayoutNavEntry::Kind kind) { switch (kind) @@ -1910,325 +1907,6 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, } } -#else // old fixed layout - -static void writeNamespaceSubIndex(QTextStream &t,bool compact, - HighlightedItem hli,const QCString &relPath - ) -{ - bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); - startQuickIndexList(t,compact); - if (documentedNamespaces>0) - { - startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, - hli==HLI_Namespaces,compact,relPath); - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - t << fixSpaces(theTranslator->trPackages()); - } - else if(fortranOpt) - { - t << theTranslator->trModulesList(); - } - else - { - t << theTranslator->trNamespaceList(); - } - endQuickIndexItem(t); - } - if (documentedNamespaceMembers[NMHL_All]>0) - { - startQuickIndexItem(t,"namespacemembers"+Doxygen::htmlFileExtension, - hli==HLI_NamespaceMembers,compact,relPath); - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - t << fixSpaces(theTranslator->trPackageMembers()); - } - else if(fortranOpt) - { - t << fixSpaces(theTranslator->trModulesMembers()); - } - else - { - t << fixSpaces(theTranslator->trNamespaceMembers()); - } - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); -} - -static void writeClassSubIndex(QTextStream &t,bool compact, - HighlightedItem hli,const QCString &relPath - ) -{ - bool fortranOpt=Config_getBool("OPTIMIZE_FOR_FORTRAN"); - bool vhdlOpt=Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - startQuickIndexList(t,compact); - if (annotatedClasses>0) - { - if (Config_getBool("ALPHABETICAL_INDEX")) - { - startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension, - hli==HLI_Classes,compact,relPath); - t << fixSpaces(theTranslator->trAlphabeticalList()); - endQuickIndexItem(t); - } - startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, - hli==HLI_Annotated,compact,relPath); - if (fortranOpt) - { - t << fixSpaces(theTranslator->trCompoundListFortran()); - } - else if (vhdlOpt) - { - t << fixSpaces(VhdlDocGen::trDesignUnitList()); - } - else - { - t << fixSpaces(theTranslator->trCompoundList()); - } - - endQuickIndexItem(t); - } - if (hierarchyClasses>0) - { - QCString title = theTranslator->trClassHierarchy(); - if (vhdlOpt) title = VhdlDocGen::trDesignUnitHierarchy(); - startQuickIndexItem(t,"hierarchy"+Doxygen::htmlFileExtension, - hli==HLI_Hierarchy,compact,relPath); - t << fixSpaces(title); - endQuickIndexItem(t); - } - if (documentedClassMembers[CMHL_All]>0) - { - startQuickIndexItem(t,"functions"+Doxygen::htmlFileExtension, - hli==HLI_Functions,compact,relPath); - if (fortranOpt) - { - t << fixSpaces(theTranslator->trCompoundMembersFortran()); - } - else if (vhdlOpt) - { - t << fixSpaces(VhdlDocGen::trDesignUnitMembers()); - } - else - { - t << fixSpaces(theTranslator->trCompoundMembers()); - } - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); -} - -static void writeFileSubIndex(QTextStream &t,bool compact, - HighlightedItem hli,const QCString &relPath) -{ - startQuickIndexList(t,compact); - if (documentedHtmlFiles>0) - { - startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, - hli==HLI_Files,compact,relPath); - t << fixSpaces(theTranslator->trFileList()); - endQuickIndexItem(t); - } - if (documentedFileMembers[FMHL_All]>0) - { - startQuickIndexItem(t,"globals"+Doxygen::htmlFileExtension, - hli==HLI_Globals,compact,relPath); - t << fixSpaces(theTranslator->trFileMembers()); - endQuickIndexItem(t); - } - endQuickIndexList(t,compact); -} - -static void writeDefaultQuickLinks(QTextStream &t,bool compact, - HighlightedItem hli,const QCString &relPath) -{ - bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); - bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - startQuickIndexList(t,compact); - - if (usingTreeIndex()) - { - startQuickIndexItem(t,"main"+Doxygen::htmlFileExtension, - hli==HLI_Main,compact,relPath); - } - else - { - startQuickIndexItem(t,"index"+Doxygen::htmlFileExtension, - hli==HLI_Main,compact,relPath); - } - t << fixSpaces(theTranslator->trMainPage()); - endQuickIndexItem(t); - - // -------------- Related pages - - if (indexedPages>0) - { - startQuickIndexItem(t,"pages"+Doxygen::htmlFileExtension, - hli==HLI_Pages,compact,relPath); - t << fixSpaces(theTranslator->trRelatedPages()); - endQuickIndexItem(t); - } - - // --------------- Modules - - if (documentedGroups>0) - { - startQuickIndexItem(t,"modules"+Doxygen::htmlFileExtension, - hli==HLI_Modules,compact,relPath); - t << fixSpaces(theTranslator->trModules()); - endQuickIndexItem(t); - } - - // --------------- Namespace indices - - if (documentedNamespaces>0) - { - startQuickIndexItem(t,"namespaces"+Doxygen::htmlFileExtension, - hli==HLI_Namespaces || hli==HLI_NamespaceMembers || hli==HLI_NamespaceVisible, - compact,relPath); - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - t << fixSpaces(theTranslator->trPackages()); - } - else if (fortranOpt) - { - t << theTranslator->trModules(); - } - else - { - t << theTranslator->trNamespaces(); - } - endQuickIndexItem(t); - if (!compact) - { - writeNamespaceSubIndex(t,compact,hli,relPath); - } - } - - - // -------------- Class indices - - if (annotatedClasses>0) - { - static bool alphaIndex=Config_getBool("ALPHABETICAL_INDEX"); - { - startQuickIndexItem(t,QCString(alphaIndex?"classes":"annotated")+Doxygen::htmlFileExtension, - hli==HLI_Hierarchy || hli==HLI_Classes || - hli==HLI_Annotated || hli==HLI_Functions || hli==HLI_ClassVisible, - compact,relPath); - } - if (fortranOpt) - { - t << fixSpaces(theTranslator->trDataTypes()); - } - else if (vhdlOpt) - { - t << fixSpaces(VhdlDocGen::trDesignUnits()); - } - else - { - t << fixSpaces(theTranslator->trClasses()); - } - endQuickIndexItem(t); - if (!compact) - { - writeClassSubIndex(t,compact,hli,relPath); - } - } - - // -------------- File - - if (documentedHtmlFiles>0) - { - startQuickIndexItem(t,"files"+Doxygen::htmlFileExtension, - hli==HLI_Files || hli==HLI_Globals || hli==HLI_FileVisible, - compact,relPath); - t << fixSpaces(theTranslator->trFile(TRUE,FALSE)); - endQuickIndexItem(t); - if (!compact) - { - writeFileSubIndex(t,compact,hli,relPath); - } - } - - // -------------- Directories - - if (Config_getBool("SHOW_DIRECTORIES") && documentedDirs>0) - { - startQuickIndexItem(t,"dirs"+Doxygen::htmlFileExtension, - hli==HLI_Directories,compact,relPath); - t << fixSpaces(theTranslator->trDirectories()); - endQuickIndexItem(t); - } - - // -------------- Examples - - if (Doxygen::exampleSDict->count()>0) - { - startQuickIndexItem(t,"examples"+Doxygen::htmlFileExtension, - hli==HLI_Examples,compact,relPath); - t << fixSpaces(theTranslator->trExamples()); - endQuickIndexItem(t); - } - - // -------------- Search field - - if (Config_getBool("SEARCHENGINE")) - { - QCString searchFor = fixSpaces(theTranslator->trSearchForIndex()); - if (searchFor.at(0)=='S') searchFor="S"+searchFor.mid(1); - t << "
  • \n"; - t << "
    \n"; - t << " \n"; - t << " \n"; - t << " \n"; - if (hli!=HLI_Search) - { - t << " \n"; - t << " \n"; - t << "
    \n"; - t << "
    \n"; - t << "
  • \n"; - } - } - if (hli!=HLI_Search) // on the search page the page will be ended by the - // page itself - { - endQuickIndexList(t,compact); - } - - //------------------------------------------------------------------------- - // write sub indices in compact mode - - if ((hli==HLI_Namespaces || hli==HLI_NamespaceMembers || - hli==HLI_NamespaceVisible - ) && - documentedNamespaces>0 && - documentedNamespaceMembers[NMHL_All]>0) - { - writeNamespaceSubIndex(t,compact,hli,relPath); - } - else if ((hli==HLI_Hierarchy || hli==HLI_Classes || - hli==HLI_Annotated || hli==HLI_Functions || - hli==HLI_ClassVisible || !compact - ) && annotatedClasses>0 - ) - { - writeClassSubIndex(t,compact,hli,relPath); - } - else if ((hli==HLI_Files || hli==HLI_Globals || - hli==HLI_FileVisible || !compact - ) && documentedHtmlFiles>0 && documentedFileMembers[FMHL_All]>0 - ) - { - writeFileSubIndex(t,compact,hli,relPath); - } - -} -#endif - void HtmlGenerator::startQuickIndices() { if (!Config_getBool("DISABLE_INDEX")) diff --git a/src/index.cpp b/src/index.cpp index 79240ce..f42e2b1 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -1519,15 +1519,16 @@ void addClassMemberNameToIndex(MemberDef *md) static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); ClassDef *cd=0; + if (vhdlOpt && (VhdlDocGen::isRecord(md) || VhdlDocGen::isUnit(md))) + { + VhdlDocGen::adjustRecordMember(md); + } + if (md->isLinkableInProject() && (cd=md->getClassDef()) && cd->isLinkableInProject() && cd->templateMaster()==0) { - if (vhdlOpt && (VhdlDocGen::isRecord(md) || VhdlDocGen::isUnit(md))) - { - VhdlDocGen::adjustRecordMember(md); - } QCString n = md->name(); int index = getPrefixIndex(n); int letter = tolower(n.at(index)) & 0x7f; diff --git a/src/index.h b/src/index.h index ef730be..56b0681 100644 --- a/src/index.h +++ b/src/index.h @@ -76,6 +76,8 @@ class IndexList : public IndexIntf IndexList() { m_intfs.setAutoDelete(TRUE); } void addIndex(IndexIntf *intf) { m_intfs.append(intf); } + + // IndexIntf implementation void initialize() { foreach(&IndexIntf::initialize); } void finalize() diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 01798ff..da5b8bf 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1321,7 +1321,7 @@ void LatexGenerator::codify(const char *str) case 0x0c: break; // remove ^L case '\t': spacesToNextTabStop = tabSize - (col%tabSize); - t << spaces.left(spacesToNextTabStop); + t << Doxygen::spaces.left(spacesToNextTabStop); col+=spacesToNextTabStop; break; case '\n': t << '\n'; col=0; break; diff --git a/src/layout.cpp b/src/layout.cpp index 567e061..ab2c130 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -464,6 +464,8 @@ class LayoutParser : public QXmlDefaultHandler new StartElementHandlerKind(this,LayoutDocEntry::FileIncludedByGraph,&LayoutParser::startSimpleEntry)); m_sHandler.insert("file/sourcelink", new StartElementHandlerKind(this,LayoutDocEntry::FileSourceLink,&LayoutParser::startSimpleEntry)); + m_sHandler.insert("file/memberdecl/membergroups", + new StartElementHandlerKind(this,LayoutDocEntry::MemberGroups,&LayoutParser::startSimpleEntry)); m_sHandler.insert("file/memberdecl", new StartElementHandler(this,&LayoutParser::startMemberDecl)); m_sHandler.insert("file/memberdecl/classes", @@ -533,6 +535,8 @@ class LayoutParser : public QXmlDefaultHandler new StartElementHandlerKind(this,LayoutDocEntry::AuthorSection,&LayoutParser::startSimpleEntry)); m_sHandler.insert("group/groupgraph", new StartElementHandlerKind(this,LayoutDocEntry::GroupGraph,&LayoutParser::startSimpleEntry)); + m_sHandler.insert("group/memberdecl/membergroups", + new StartElementHandlerKind(this,LayoutDocEntry::MemberGroups,&LayoutParser::startSimpleEntry)); m_sHandler.insert("group/memberdecl", new StartElementHandler(this,&LayoutParser::startMemberDecl)); m_sHandler.insert("group/memberdecl/classes", diff --git a/src/layout_default.h b/src/layout_default.h index 29ac52b..dde4ed5 100644 --- a/src/layout_default.h +++ b/src/layout_default.h @@ -30,7 +30,6 @@ " \n" " \n" " \n" -" \n" " \n" " \n" " \n" @@ -60,6 +59,7 @@ " \n" " \n" " \n" +" \n" " \n" " \n" " \n" @@ -82,11 +82,11 @@ " \n" " \n" " \n" -" \n" " \n" " \n" " \n" " \n" +" \n" " \n" " \n" " \n" @@ -113,6 +113,7 @@ " \n" " \n" " \n" +" \n" " \n" " \n" " \n" @@ -148,6 +149,7 @@ " \n" " \n" " \n" +" \n" " \n" " \n" " \n" diff --git a/src/layout_default.xml b/src/layout_default.xml index ba2d254..1c8525c 100644 --- a/src/layout_default.xml +++ b/src/layout_default.xml @@ -30,7 +30,6 @@ - @@ -60,6 +59,7 @@ + @@ -82,11 +82,11 @@ - + @@ -113,6 +113,7 @@ + @@ -148,6 +149,7 @@ + diff --git a/src/main.cpp b/src/main.cpp index c8ba81f..eb61b11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,9 +31,9 @@ int main(int argc,char **argv) { initDoxygen(); - readConfiguration(argc,argv); checkConfiguration(); + adjustConfiguration(); parseInput(); generateOutput(); return 0; diff --git a/src/mangen.cpp b/src/mangen.cpp index d917435..c438a15 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -304,7 +304,7 @@ void ManGenerator::codify(const char *str) { case '\t': spacesToNextTabStop = Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE")); - t << spaces.left(spacesToNextTabStop); + t << Doxygen::spaces.left(spacesToNextTabStop); col+=spacesToNextTabStop; break; case '\n': t << "\n"; firstCol=TRUE; col=0; break; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 960699a..c708ffd 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -296,6 +296,27 @@ static void writeTemplatePrefix(OutputList &ol,ArgumentList *al) ol.docify("> "); } +QCString extractDirection(QCString &docs) +{ + QRegExp re("\\[[^\\]]+\\]"); // [...] + int l=0; + if (re.match(docs,0,&l)==0) + { + int inPos = docs.find("in", 1,FALSE); + int outPos = docs.find("out",1,FALSE); + bool input = inPos!=-1 && inPosgroup && !m_impl->nspace && !m_impl->related && !m_impl->classDef && m_impl->fileDef && !m_impl->fileDef->isLinkableInProject()) + if (!m_impl->group && !m_impl->nspace && + !m_impl->related && !m_impl->classDef && + m_impl->fileDef && !m_impl->fileDef->isLinkableInProject()) { //printf("in a file but file not linkable!\n"); return FALSE; // in file (and not in namespace) but file not linkable @@ -1548,7 +1571,8 @@ bool MemberDef::isDetailedSectionLinkable() const bool MemberDef::isDetailedSectionVisible(bool inGroup,bool inFile) const { - bool groupFilter = getGroupDef()==0 || inGroup; + static bool separateMemPages = Config_getBool("SEPARATE_MEMBER_PAGES"); + bool groupFilter = getGroupDef()==0 || inGroup || separateMemPages; bool fileFilter = getNamespaceDef()==0 || !inFile; bool visible = isDetailedSectionLinkable() && groupFilter && fileFilter && @@ -1950,22 +1974,23 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } /* write detailed description */ - if (!detailed.isEmpty() || !m_impl->inbodyDocs.isEmpty()) + if (!detailed.isEmpty() || + !inbodyDocumentation().isEmpty()) { ol.parseDoc(docFile(),docLine(),getOuterScope()?getOuterScope():container,this,detailed+"\n",TRUE,FALSE); - if (!m_impl->inbodyDocs.isEmpty()) + if (!inbodyDocumentation().isEmpty()) { ol.newParagraph(); - ol.parseDoc(inbodyFile(),inbodyLine(),getOuterScope()?getOuterScope():container,this,m_impl->inbodyDocs+"\n",TRUE,FALSE); + ol.parseDoc(inbodyFile(),inbodyLine(),getOuterScope()?getOuterScope():container,this,inbodyDocumentation()+"\n",TRUE,FALSE); } } else if (!brief.isEmpty() && (Config_getBool("REPEAT_BRIEF") || !Config_getBool("BRIEF_MEMBER_DESC"))) { - if (!m_impl->inbodyDocs.isEmpty()) + if (!inbodyDocumentation().isEmpty()) { ol.newParagraph(); - ol.parseDoc(inbodyFile(),inbodyLine(),getOuterScope()?getOuterScope():container,this,m_impl->inbodyDocs+"\n",TRUE,FALSE); + ol.parseDoc(inbodyFile(),inbodyLine(),getOuterScope()?getOuterScope():container,this,inbodyDocumentation()+"\n",TRUE,FALSE); } } @@ -1975,6 +2000,29 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, // defArgList?defArgList->hasDocumentation():-1); if (docArgList!=0 && docArgList->hasDocumentation()) { + QCString paramDocs; + ArgumentListIterator ali(*docArgList); + Argument *a; + // convert the parameter documentation into a list of @param commands + for (ali.toFirst();(a=ali.current());++ali) + { + if (a->hasDocumentation()) + { + QCString direction = extractDirection(a->docs); + paramDocs+="@param"+direction+" "+a->name+" "+a->docs; + } + } + // feed the result to the documentation parser + ol.parseDoc( + docFile(),docLine(), + getOuterScope()?getOuterScope():container, + this, // memberDef + paramDocs, // docStr + TRUE, // indexWords + FALSE // isExample + ); + +#if 0 // old, now obsolete way to add parameter documentation //printf("***** argumentList is documented\n"); ol.startParamList(BaseOutputDocInterface::Param,theTranslator->trParameters()+": "); ol.writeDescItem(); @@ -1988,6 +2036,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.startDescTableTitle(); ol.docify(a->name); ol.endDescTableTitle(); + QCString doc = a->docs+"\n"; ol.startDescTableData(); ol.parseDoc(docFile(),docLine(), getOuterScope()?getOuterScope():container, @@ -2001,6 +2050,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } ol.endDescTable(); ol.endParamList(); +#endif } // For enum, we also write the documented enum values @@ -2013,6 +2063,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, MemberDef *fmd=fmdl->first(); while (fmd) { + //printf("Enum: isLinkable()=%d\n",fmd->isLinkable()); if (fmd->isLinkable()) { if (first) @@ -2237,7 +2288,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, // write call graph if ((m_impl->hasCallGraph || Config_getBool("CALL_GRAPH")) - && isFunction() && Config_getBool("HAVE_DOT") + && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") ) { DotCallGraph callGraph(this,FALSE); @@ -2253,7 +2304,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } } if ((m_impl->hasCallerGraph || Config_getBool("CALLER_GRAPH")) - && isFunction() && Config_getBool("HAVE_DOT") + && (isFunction() || isSlot() || isSignal()) && Config_getBool("HAVE_DOT") ) { DotCallGraph callerGraph(this, TRUE); @@ -2390,17 +2441,17 @@ bool MemberDef::hasDocumentation() const { makeResident(); return Definition::hasDocumentation() || - !m_impl->inbodyDocs.isEmpty() || (m_impl->mtype==Enumeration && m_impl->docEnumValues) || // has enum values (m_impl->defArgList!=0 && m_impl->defArgList->hasDocumentation()); // has doc arguments } +#if 0 bool MemberDef::hasUserDocumentation() const { - bool hasDocs = Definition::hasUserDocumentation() || - (m_impl->inbodyDocs && !m_impl->inbodyDocs.isEmpty()); + bool hasDocs = Definition::hasUserDocumentation(); return hasDocs; } +#endif void MemberDef::setMemberGroup(MemberGroup *grp) @@ -2929,6 +2980,7 @@ bool MemberDef::protectionVisible() const (m_impl->prot==Package && Config_getBool("EXTRACT_PACKAGE")); } +#if 0 void MemberDef::setInbodyDocumentation(const char *docs, const char *docFile,int docLine) { @@ -2938,6 +2990,7 @@ void MemberDef::setInbodyDocumentation(const char *docs, m_impl->inbodyLine = docLine; m_impl->inbodyFile = docFile; } +#endif bool MemberDef::isObjCMethod() const { @@ -3380,6 +3433,7 @@ bool MemberDef::hasDocumentedReturnType() const return m_impl->hasDocumentedReturnType; } +#if 0 int MemberDef::inbodyLine() const { makeResident(); @@ -3397,6 +3451,7 @@ const QCString &MemberDef::inbodyDocumentation() const makeResident(); return m_impl->inbodyDocs; } +#endif ClassDef *MemberDef::relatedAlso() const { @@ -3842,9 +3897,6 @@ void MemberDef::flushToDisk() const marshalObjPointer (Doxygen::symbolStorage,m_impl->cachedTypedefValue); marshalQCString (Doxygen::symbolStorage,m_impl->cachedTypedefTemplSpec); marshalQCString (Doxygen::symbolStorage,m_impl->cachedResolvedType); - marshalInt (Doxygen::symbolStorage,m_impl->inbodyLine); - marshalQCString (Doxygen::symbolStorage,m_impl->inbodyFile); - marshalQCString (Doxygen::symbolStorage,m_impl->inbodyDocs); marshalObjPointer (Doxygen::symbolStorage,m_impl->docProvider); marshalQCString (Doxygen::symbolStorage,m_impl->explicitOutputFileBase); marshalBool (Doxygen::symbolStorage,m_impl->implOnly); @@ -3942,9 +3994,6 @@ void MemberDef::loadFromDisk() const m_impl->cachedTypedefValue = (ClassDef*)unmarshalObjPointer (Doxygen::symbolStorage); m_impl->cachedTypedefTemplSpec = unmarshalQCString (Doxygen::symbolStorage); m_impl->cachedResolvedType = unmarshalQCString (Doxygen::symbolStorage); - m_impl->inbodyLine = unmarshalInt (Doxygen::symbolStorage); - m_impl->inbodyFile = unmarshalQCString (Doxygen::symbolStorage); - m_impl->inbodyDocs = unmarshalQCString (Doxygen::symbolStorage); m_impl->docProvider = (MemberDef*)unmarshalObjPointer (Doxygen::symbolStorage); m_impl->explicitOutputFileBase = unmarshalQCString (Doxygen::symbolStorage); m_impl->implOnly = unmarshalBool (Doxygen::symbolStorage); @@ -3969,6 +4018,7 @@ void MemberDef::loadFromDisk() const void MemberDef::makeResident() const { + if (Doxygen::symbolCache==0) return; if (m_cacheHandle==-1) // not yet in cache { MemberDef *victim = 0; diff --git a/src/memberdef.h b/src/memberdef.h index d476f5d..8f47022 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -172,7 +172,7 @@ class MemberDef : public Definition bool isLinkableInProject() const; bool isLinkable() const; bool hasDocumentation() const; // overrides hasDocumentation in definition.h - bool hasUserDocumentation() const; // overrides hasUserDocumentation + //bool hasUserDocumentation() const; // overrides hasUserDocumentation bool isBriefSectionVisible() const; bool isDetailedSectionVisible(bool inGroup,bool inFile) const; bool isDetailedSectionLinkable() const; @@ -182,9 +182,9 @@ class MemberDef : public Definition MemberDef *reimplements() const; LockingPtr reimplementedBy() const; - int inbodyLine() const; - QCString inbodyFile() const; - const QCString &inbodyDocumentation() const; + //int inbodyLine() const; + //QCString inbodyFile() const; + //const QCString &inbodyDocumentation() const; ClassDef *relatedAlso() const; @@ -269,7 +269,7 @@ class MemberDef : public Definition void insertReimplementedBy(MemberDef *md); // in-body documentation - void setInbodyDocumentation(const char *docs,const char *file,int line); + //void setInbodyDocumentation(const char *docs,const char *file,int line); void setRelatedAlso(ClassDef *cd); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index ff3a7a1..32bbfd6 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -217,7 +217,6 @@ void MemberList::writePlainDeclarations(OutputList &ol, } case MemberDef::Enumeration: { - if (first) ol.startMemberList(),first=FALSE; int enumVars=0; MemberListIterator vmli(*this); MemberDef *vmd; @@ -240,6 +239,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, // enum type (i.e. enumVars>0), then we do not show the enum here. if (enumVars==0) // show enum here { + //printf("Enum!!\n"); + if (first) ol.startMemberList(),first=FALSE; ol.startMemberItem(0); ol.writeString("enum "); ol.insertMemberAlign(); @@ -279,6 +280,8 @@ void MemberList::writePlainDeclarations(OutputList &ol, } case MemberDef::EnumValue: { + if (!m_inGroup) return; + printf("EnumValue!\n"); if (first) ol.startMemberList(),first=FALSE; md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); } @@ -360,7 +363,6 @@ void MemberList::writeDeclarations(OutputList &ol, writePlainDeclarations(ol,cd,nd,fd,gd); } - //printf("memberGroupList=%p\n",memberGroupList); if (memberGroupList) { diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 6adb9e1..869b5a2 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -414,9 +414,6 @@ void NamespaceDef::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- -#define NEW_LAYOUT -#ifdef NEW_LAYOUT // new flexible layout - QListIterator eli( LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)); LayoutDocEntry *lde; @@ -503,59 +500,6 @@ void NamespaceDef::writeDocumentation(OutputList &ol) } } -#else // old fixed layout - - bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - - //ol.startTextBlock(); - - if (Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - - if (!Config_getBool("DETAILS_AT_TOP")) - { - writeBriefDescription(ol); - } - - //ol.endTextBlock(); - - startMemberDeclarations(ol); - - writeClassDeclarations(ol); - writeNamespaceDeclarations(ol); - writeMemberGroups(ol); - - writeMemberDeclarations(ol,MemberList::decDefineMembers,theTranslator->trDefines()); - writeMemberDeclarations(ol,MemberList::decTypedefMembers,theTranslator->trTypedefs()); - writeMemberDeclarations(ol,MemberList::decEnumMembers,theTranslator->trEnumerations()); - writeMemberDeclarations(ol,MemberList::decFuncMembers, - fortranOpt ? theTranslator->trSubprograms() : - vhdlOpt ? VhdlDocGen::trFunctionAndProc() : - theTranslator->trFunctions()); - writeMemberDeclarations(ol,MemberList::decVarMembers,theTranslator->trVariables()); - endMemberDeclarations(ol); - - if (!Config_getBool("DETAILS_AT_TOP")) - { - writeDetailedDescription(ol,theTranslator->trDetailedDescription()); - } - - startMemberDocumentation(ol); - - writeMemberDocumentation(ol,MemberList::docDefineMembers,theTranslator->trDefineDocumentation()); - writeMemberDocumentation(ol,MemberList::docTypedefMembers,theTranslator->trTypedefDocumentation()); - writeMemberDocumentation(ol,MemberList::docEnumMembers,theTranslator->trEnumerationTypeDocumentation()); - writeMemberDocumentation(ol,MemberList::docFuncMembers,fortranOpt?theTranslator->trSubprogramDocumentation():theTranslator->trFunctionDocumentation()); - writeMemberDocumentation(ol,MemberList::docVarMembers,theTranslator->trVariableDocumentation()); - - endMemberDocumentation(ol); - - writeAuthorSection(ol); - -#endif - //---------------------------------------- end flexible part ------------------------------- endFile(ol); diff --git a/src/pagedef.cpp b/src/pagedef.cpp index cf2c21a..05825a6 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -167,7 +167,7 @@ void PageDef::writePageDocumentation(OutputList &ol) docLine(), // startLine this, // context 0, // memberdef - documentation(), // docStr + documentation()+inbodyDocumentation(), // docStr TRUE, // index words FALSE // not an example ); diff --git a/src/pre.l b/src/pre.l index 7d5565b..f946fc4 100644 --- a/src/pre.l +++ b/src/pre.l @@ -2005,7 +2005,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) . { outputChar(*yytext); } -[^*a-z_A-Z]+ { +[^*a-z_A-Z\n]+ { g_defLitText+=yytext; g_defText+=escapeAt(yytext); } @@ -2017,7 +2017,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) \n { g_yyLineNr++; g_defLitText+=yytext; - g_defText+=yytext; + g_defText+=' '; } "*/" { BEGIN(g_lastCContext); } "//" diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 0560a70..615d4d2 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -1754,7 +1754,7 @@ void RTFGenerator::codify(const char *str) switch(c) { case '\t': spacesToNextTabStop = Config_getInt("TAB_SIZE") - (col%Config_getInt("TAB_SIZE")); - t << spaces.left(spacesToNextTabStop); + t << Doxygen::spaces.left(spacesToNextTabStop); col+=spacesToNextTabStop; break; case '\n': newParagraph(); diff --git a/src/scanner.l b/src/scanner.l index 58c43fc..dc36a8a 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2509,7 +2509,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) *pCopyRoundGString+=yytext; } } -[^"'()\n]+ { +[^"'()\n/]+ { *pCopyRoundGString+=yytext; } . { @@ -4323,10 +4323,10 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) current->spec |= Entry::Template; current->tArgLists->append(al); currentArgumentList = al; - //current->name+="<"; templateStr="<"; + current->name += "<"; fullArgString = templateStr; - copyArgString = ¤t->args; + copyArgString = ¤t->name; currentArgumentContext = ClassVar; BEGIN( ReadTempArgs ); } @@ -4880,12 +4880,6 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) //printf("Start doc block at %d\n",yyLineNr); removeSlashes=(yytext[1]=='/'); tmpDocType=-1; -#if 0 - if (YY_START!=SkipCurly) - { - current->doc.resize(0); - } -#endif if (!current->doc.isEmpty()) { current->doc+="\n\n"; @@ -4895,16 +4889,11 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) current->docLine = yyLineNr; current->docFile = yyFileName; } -// lastDocContext = YY_START; if (current_root->section & Entry::SCOPE_MASK) { current->inside = current_root->name+"::"; - //if (current->mGrpId!=DOX_NOGROUP) - //{ - // memberGroupInside = current->inside.copy(); - //} } docBlockContext = YY_START; docBlockInBody = YY_START==SkipCurly; @@ -4915,16 +4904,6 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) current->briefLine = yyLineNr; current->briefFile = yyFileName; } -#if 0 - if (!docBlockInBody) - { - current->doc.resize(0); - if (docBlockAutoBrief) - { - current->brief.resize(0); - } - } -#endif startCommentBlock(FALSE); BEGIN( DocBlock ); } @@ -4936,10 +4915,6 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) if (current_root->section & Entry::SCOPE_MASK) { current->inside = current_root->name+"::"; - //if (current->mGrpId!=DOX_NOGROUP) - //{ - // memberGroupInside = current->inside.copy(); - //} } current->docLine = yyLineNr; current->docFile = yyFileName; @@ -4952,37 +4927,15 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) current->briefLine = yyLineNr; current->briefFile = yyFileName; } -#if 0 - if (!docBlockInBody) - { - current->doc.resize(0); - if (docBlockAutoBrief) - { - current->brief.resize(0); - } - } -#endif startCommentBlock(FALSE); BEGIN( DocBlock ); } "//!" { -#if 0 - if (YY_START!=SkipCurly) - { - current->brief.resize(0); - current->briefFile=yyFileName; - current->briefLine=yyLineNr; - } -#endif tmpDocType=-1; lastDocContext = YY_START; if (current_root->section & Entry::SCOPE_MASK) { current->inside = current_root->name+"::"; - //if (current->mGrpId!=DOX_NOGROUP) - //{ - // memberGroupInside = current->inside.copy(); - //} } docBlockContext = YY_START; docBlockInBody = YY_START==SkipCurly; @@ -4992,23 +4945,11 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) BEGIN( DocLine ); } "///"/[^/] { -#if 0 - if (YY_START!=SkipCurly) - { - current->brief.resize(0); - current->briefFile=yyFileName; - current->briefLine=yyLineNr; - } -#endif tmpDocType=-1; lastDocContext = YY_START; if (current_root->section & Entry::SCOPE_MASK) { current->inside = current_root->name+"::"; - //if (current->mGrpId!=DOX_NOGROUP) - //{ - // memberGroupInside = current->inside.copy(); - //} } docBlockContext = YY_START; docBlockInBody = YY_START==SkipCurly; diff --git a/src/util.cpp b/src/util.cpp index 4c870b3..2905439 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -393,6 +393,7 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, { MemberNameIterator mni(*mn); MemberDef *tmd=0; + int minDist=-1; for (;(tmd=mni.current());++mni) { //printf("Found member %s resScope=%s outerScope=%s mContext=%p\n", @@ -400,12 +401,11 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, // tmd->getOuterScope()->name().data(), mContext); if (tmd->isTypedef() /*&& tmd->getOuterScope()==resScope*/) { - // look if resScope is visible within tmd->getOuterScope() - Definition *d = tmd->getOuterScope(); - while (d && d!=resScope) d=d->getOuterScope(); - if (d) + int dist=isAccessibleFrom(resScope,0,tmd); + if (dist!=-1 && (md==0 || dist *cl, const QCString &explicitScopePart="" ) { + //printf("accessibleViaUsingClass(%p)\n",cl); if (cl) // see if the class was imported via a using statement { SDict::Iterator cli(*cl); @@ -2110,6 +2111,7 @@ QCString recodeString(const QCString &str,const char *fromEncoding,const char *t QCString transcodeCharacterStringToUTF8(const QCString &input) { + bool error=FALSE; static QCString inputEncoding = Config_getString("INPUT_ENCODING"); const char *outputEncoding = "UTF-8"; if (inputEncoding.isEmpty() || qstricmp(inputEncoding,outputEncoding)==0) return input; @@ -2121,27 +2123,30 @@ QCString transcodeCharacterStringToUTF8(const QCString &input) { err("Error: unsupported character conversion: '%s'->'%s'\n", inputEncoding.data(),outputEncoding); - exit(1); + error=TRUE; } - size_t iLeft=inputSize; - size_t oLeft=outputSize; - const char *inputPtr = input.data(); - char *outputPtr = output.data(); - if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft)) + if (!error) { - outputSize-=oLeft; - output.resize(outputSize+1); - output.at(outputSize)='\0'; - //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data()); - } - else - { - err("Error: failed to translate characters from %s to %s: check INPUT_ENCODING\n", - inputEncoding.data(),outputEncoding); - exit(1); + size_t iLeft=inputSize; + size_t oLeft=outputSize; + const char *inputPtr = input.data(); + char *outputPtr = output.data(); + if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft)) + { + outputSize-=oLeft; + output.resize(outputSize+1); + output.at(outputSize)='\0'; + //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data()); + } + else + { + err("Error: failed to translate characters from %s to %s: check INPUT_ENCODING\ninput=[%s]\n", + inputEncoding.data(),outputEncoding,input.data()); + error=TRUE; + } } portable_iconv_close(cd); - return output; + return error ? input : output; } /*! reads a file with name \a name and returns it as a string. If \a filter @@ -5440,7 +5445,16 @@ QCString substituteTemplateArgumentsInString( ++formAli,actArg=actualArgs->next() ) { - //printf("formArg->type=%s\n",formArg->type.data()); + if (formArg->type.left(6)=="class " && formArg->name.isEmpty()) + { + formArg->name = formArg->type.mid(6); + formArg->type = "class"; + } + if (formArg->type.left(9)=="typename " && formArg->name.isEmpty()) + { + formArg->name = formArg->type.mid(9); + formArg->type = "typename"; + } if (formArg->type=="class" || formArg->type=="typename" || formArg->type.left(8)=="template") { //printf("n=%s formArg->type='%s' formArg->name='%s' formArg->defval='%s'\n", @@ -5453,7 +5467,7 @@ QCString substituteTemplateArgumentsInString( result += actArg->type+" "; } else // for case where the actual arg is something like "unsigned int" - // the "int" part is in actArg->name. + // the "int" part is in actArg->name. { result += actArg->type+" "+actArg->name+" "; } @@ -5481,7 +5495,7 @@ QCString substituteTemplateArgumentsInString( result+=name.right(name.length()-p); //printf(" Inheritance relation %s -> %s\n", // name.data(),result.data()); - return result; + return result.stripWhiteSpace(); } diff --git a/src/vhdlscanner.l b/src/vhdlscanner.l index 3e3d4af..87ece96 100644 --- a/src/vhdlscanner.l +++ b/src/vhdlscanner.l @@ -587,47 +587,57 @@ static void addOneTextLine(QCString& ss ) /* start command character */ /* -------------- VHDL SECTION -----------------------------------*/ -B [ \t] -CR [\r\n] -BR [ \t\n\r] -LETTER [a-zA-Z_0-9] -NAME {LETTER}[a-zA-Z0-9_.]* -FUNCNAME [a-zA-Z"][*+\-_a-zA-Z0-9"\/=<>]* -DIGITS [0-9]+|[0-9]+"."[0-9]+|[0-9]+"#"[0-9_a-fA-F\+\.]+"#" -COMMENT "--"[^\n]* -LABELID [a-z_A-Z][^\;]*";"({B}*{COMMENT})* -PROTO [ (]* -TEXTT "--"[^\/\@\*\#][^\n]* -PROC ("function"|"procedure") -ENDE ({BR}*("end"){BR}*{PROC}*{BR}*[;]{1}) -ENDEFF ("if"|"case"|"loop"|"generate"){BR}*[;] -ENDE3 ({BR}*("end"){BR}*{PROC}*{BR}*{FUNCNAME}{BR}*[;])|{ENDE} -ENDFUNC {B}*"end"{BR}*{PROC}*{BR}*{FUNCNAME}{BR}*[;] -FUNCIMPURE "impure"|"pure" -FUNCPROC ^{B}*{FUNCIMPURE}*{BR}*("function"|"procedure"){B}* -ARCHITECTURE ("architecture"){BR}+{NAME}{BR}*("of") +B [ \t] +CR [\r\n] +BR [ \t\n\r] +DIGIT [0-9] +LOWER_CASE_LETTER [a-z] +UPPER_CASE_LETTER [A-Z] +LETTER [a-zA-Z_0-9] +SPACE_CHARACTER [ \t] +SPECIAL_CHARACTER [#&'()*+,\-\./:;<=>_|] +OTHER_SPECIAL_CHARACTER [~!$ยง%?@\[\\\]^{}] +BASIC_GRAPHIC_CHARACTER {UPPER_CASE_LETTER}|{DIGIT}|{SPECIAL_CHARACTER}|{SPACE_CHARACTER} +GRAPHIC_CHARACTER {BASIC_GRAPHIC_CHARACTER}|{LOWER_CASE_LETTER}|{OTHER_SPECIAL_CHARACTER} + +NAME {LETTER}[a-zA-Z0-9_.]* +STRING_LITERAL \"{GRAPHIC_CHARACTER}*\" +FUNCNAME [a-zA-Z"][*+\-_a-zA-Z0-9"\/=<>]* +DIGITS [0-9]+|[0-9]+"."[0-9]+|[0-9]+"#"[0-9_a-fA-F\+\.]+"#" +COMMENT "--"[^\n]* +LABELID [a-z_A-Z][^\;]*";"({B}*{COMMENT})* +PROTO [ (]* +TEXTT "--"[^\/\@\*\#][^\n]* +PROC ("function"|"procedure") +ENDE ({BR}*("end"){BR}*{PROC}*{BR}*[;]{1}) +ENDEFF ("if"|"case"|"loop"|"generate"){BR}*[;] +ENDE3 ({BR}*("end"){BR}*{PROC}*{BR}*{FUNCNAME}{BR}*[;])|{ENDE} +ENDFUNC {B}*"end"{BR}*{PROC}*{BR}*{FUNCNAME}{BR}*[;] +FUNCIMPURE "impure"|"pure" +FUNCPROC ^{B}*{FUNCIMPURE}*{BR}*("function"|"procedure"){B}* +ARCHITECTURE ("architecture"){BR}+{NAME}{BR}*("of") /* Removed due to bug 538239 POST "postponed" PROCESS ({BR}*{FUNCNAME}{B}*[:]{BR}*({POST}{BR}+)?("process"){BR}*{PROTO})|("process"){BR}*("("){BR}*{PROTO}|[^a-zA-Z]("process"){CR}|[^a-zA-Z]("process"){BR}+("is") */ -PROCESS ({B}*{FUNCNAME}{B}*:{BR}*)?({B}*("postponed"){BR}+)?{B}*("process"){BR}*{PROTO} +PROCESS ({B}*{FUNCNAME}{B}*:{BR}*)?({B}*("postponed"){BR}+)?{B}*("process"){BR}*{PROTO} -ENDPROCESS ("end"){BR}*("postponed")*("process"){BR}*{FUNCNAME}*{BR}*[;] -LIBUSE ^{B}*("use"|"library"){BR}+ -ENTITY ^{B}*("component"|"entity"|"package"){BR}+ -PBODY ("package"){B}+("body"){BR}+{NAME} -SHARED ("shared"){BR}+("variable") -SIGTYPES ^{B}*({SHARED}|"alias"|"file"|"group"|"subtype"|"type"|"constant"|"attribute"|"signal"|"units"){BR}+ -CONFIG ("configuration"){BR}+{NAME}{BR}*("of"){BR}+{NAME}{BR}+"is" +ENDPROCESS ("end"){BR}*("postponed")*("process"){BR}*{FUNCNAME}*{BR}*[;] +LIBUSE ^{B}*("use"|"library"){BR}+ +ENTITY ^{B}*("component"|"entity"|"package"){BR}+ +PBODY ("package"){B}+("body"){BR}+{NAME} +SHARED ("shared"){BR}+("variable") +SIGTYPES ^{B}*({SHARED}|"alias"|"file"|"group"|"subtype"|"type"|"constant"|"attribute"|"signal"|"units"){BR}+ +CONFIG ("configuration"){BR}+{NAME}{BR}*("of"){BR}+{NAME}{BR}+"is" -ALLTYPESMAP {B}*[_a-zA-ZA_Z0-9.() ]*{B}* -MAPCOMPONENT ({ALLTYPESMAP}{BR}*[:]{BR}*("component"|"configuration")*{ALLTYPESMAP}{BR}*{TEXTT}*{BR}*("port"|"generic"){BR}*("map"){BR}*("("){1}) -MAPCOMPONENT1 ({ALLTYPESMAP}{BR}*[:]{BR}*("entity"){BR}*{ALLTYPESMAP}{BR}*("port"|"generic"){BR}*("map"){BR}*("("){1}) +ALLTYPESMAP {B}*[_a-zA-ZA_Z0-9.() ]*{B}* +MAPCOMPONENT ({ALLTYPESMAP}{BR}*[:]{BR}*("component"|"configuration")*{ALLTYPESMAP}{BR}*{TEXTT}*{BR}*("port"|"generic"){BR}*("map"){BR}*("("){1}) +MAPCOMPONENT1 ({ALLTYPESMAP}{BR}*[:]{BR}*("entity"){BR}*{ALLTYPESMAP}{BR}*("port"|"generic"){BR}*("map"){BR}*("("){1}) -BRACEOPEN [(]{1} -BRACECLOSE [)]{1} +BRACEOPEN [(]{1} +BRACECLOSE [)]{1} -ALLID [^;()\t ] +ALLID [^;()\t ] %option noyywrap @@ -1470,6 +1480,15 @@ ALLID [^;()\t ] lineCount(); } +<*>{STRING_LITERAL} { + // Make sure string literals get transfered to the output + // We have to match these because the comment characters (--) + // can exist inside a string literal. + // We shouldn't have to call lineCount because newlines + // are not allowed inside string literals + addText(yytext,yyleng); +} + /* <*>{BR}*"--!"{B}*"@}" { // end group if (current) -- cgit v0.12