From a6cb7ef1dc7c3d6b6ff949646b9b2deda3fc0bf3 Mon Sep 17 00:00:00 2001 From: mueller Date: Wed, 15 Dec 1999 19:26:45 +0000 Subject: mods for doxygen-0.49-990522 --- INSTALL | 17 +- Makefile.config | 2 +- README | 4 +- doc/autolink.doc | 17 +- doc/commands.doc | 211 ++++++++++++--------- doc/config.doc | 9 +- doc/index.doc | 5 +- doc/trouble.doc | 5 + src/classdef.cpp | 246 +++++++++++++++++------- src/classdef.h | 11 +- src/code.l | 28 ++- src/config.h | 2 + src/config.l | 80 +++++--- src/definition.cpp | 30 +++ src/definition.h | 12 +- src/diagram.cpp | 4 +- src/doxygen.cpp | 259 +++++++++++++++++++++---- src/doxygen.h | 14 +- src/doxygen.pro | 2 +- src/doxytag.l | 3 +- src/entry.cpp | 19 ++ src/entry.h | 1 + src/filedef.cpp | 38 ++-- src/filedef.h | 3 +- src/groupdef.cpp | 19 +- src/groupdef.h | 3 +- src/htmlgen.cpp | 300 ++++++++++++++--------------- src/htmlgen.h | 24 ++- src/index.cpp | 230 ++++++++++++++++------ src/index.h | 16 +- src/latexgen.cpp | 78 ++++++-- src/latexgen.h | 13 +- src/mangen.cpp | 2 +- src/mangen.h | 5 + src/memberdef.cpp | 26 ++- src/memberdef.h | 5 +- src/memberlist.cpp | 5 +- src/namespacedef.cpp | 59 +++--- src/namespacedef.h | 8 +- src/outputgen.h | 5 + src/outputlist.h | 10 + src/pre.l | 4 +- src/scanner.h | 1 + src/scanner.l | 167 +++++++++++++--- src/section.h | 49 +++++ src/tag.l | 52 ++++- src/translator.h | 317 ++++++++++++++++++++++++++++--- src/translator_fr.h | 7 +- src/translator_nl.h | 158 ++++++++++++++-- src/translator_se.h | 96 +++++----- src/util.cpp | 525 +++++++++++++++++++++++++++++++++------------------ src/util.h | 6 +- 52 files changed, 2325 insertions(+), 887 deletions(-) create mode 100644 src/section.h diff --git a/INSTALL b/INSTALL index 22f0481..6a9e9b9 100644 --- a/INSTALL +++ b/INSTALL @@ -1,12 +1,12 @@ -DOXYGEN Version 0.49-990425 +DOXYGEN Version 0.49-990522 INSTALLATION INSTRUCTIONS FOR UNIX: ----------------------------------- 1. Unpack the archive, unless you already have: - gunzip doxygen-0.49-990425.src.tar.gz # uncompress the archive - tar xf doxygen-0.49-990425.src.tar # unpack it + gunzip doxygen-0.49-990522.src.tar.gz # uncompress the archive + tar xf doxygen-0.49-990522.src.tar # unpack it 2. Make sure Qt is installed properly (check the environment variable $QTDIR) @@ -80,6 +80,10 @@ You will need to install the windows/dos versions of following tools: X-windows version as well!) - Microsoft Visual C++ version 5.0, use the vcvars32.bat to set the environment variables. +- If you used WinZip to extract the tar archive it will (apparently) not + create empty folders, so you have to add the folders + `objects' and `bin' manually in the root of the distribution before + compiling. Make sure all tools are accessible from the command-line. @@ -97,6 +101,11 @@ nmake -f Makefile.windows examples ----------------------------------------------------------------------------- KNOWN CONFIGURATION PROBLEMS +HTML RELATED PROBLEMS: +- the indent continuously increases. + This seems to be a problem that can be observed with Netscape 4.01. + It is not present in many later and earlier versions. + LATEX RELATED PROBLEMS: - the LaTeX translation of HTML tables doesn't seem to work for all @@ -129,4 +138,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (25 April 1999) +Dimitri van Heesch (22 May 1999) diff --git a/Makefile.config b/Makefile.config index 0492810..a10a57b 100644 --- a/Makefile.config +++ b/Makefile.config @@ -9,4 +9,4 @@ PERL = perl # The values below should probably be left unmodified TAR = tar # name of the GNU tar tool TMAKE = ../tmake/bin/tmake -VERSION = 0.49-990425 +VERSION = 0.49-990522 diff --git a/README b/README index 7ebbeb7..899040e 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 0.49-990425 +DOXYGEN Version 0.49-990522 Please read INSTALL for compilation instructions. @@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at Enjoy, -Dimitri van Heesch (25 April 1999) +Dimitri van Heesch (22 May 1999) diff --git a/doc/autolink.doc b/doc/autolink.doc index b0f0fa4..900d819 100644 --- a/doc/autolink.doc +++ b/doc/autolink.doc @@ -18,7 +18,7 @@ Most documentation systems have special `see also' sections where links to other pieces of documentation can be inserted. Although doxygen also has a command to start such a section (See section - \ref cmdsa), it does allow you to put these kind of links anywhere in the + \ref cmdsa "\\sa"), it does allow you to put these kind of links anywhere in the documentation. For \f$\mbox{\LaTeX}\f$ documentation a reference to the page number is written instead of a link. Furthermore, the index at the end of the @@ -93,20 +93,7 @@ for the corresponding HTML documentation that is generated by Doxygen. \endhtmlonly - \subsection resolving Resolving of defines and typedefs. - - Macro definitions of the form: -\verbatim -#define TypeName ClassName -\endverbatim - will be resolved inside documentation blocks. - - \par Example: - \verbinclude resdefine.cpp - \htmlonly - Click here - for the corresponding HTML documentation that is generated by Doxygen. - \endhtmlonly + \subsection resolving typedefs. Typedefs that involve classes, structs and unions, like \verbatim diff --git a/doc/commands.doc b/doc/commands.doc index c288be7..48f5c53 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -42,6 +42,7 @@ documentation: \endlatexonly
  • \refitem cmda \a
  • \refitem cmdaddindex \addindex +
  • \refitem cmdanchor \anchor
  • \refitem cmdarg \arg
  • \refitem cmdauthor \author
  • \refitem cmdb \b @@ -148,7 +149,7 @@ Doxygen. Unrecognized commands are treated as normal text. classes and members that are documented are automatically replaced by links to the documentation. - \sa section \ref cmdendcode, section \ref cmdverbatim + \sa section \ref cmdendcode "\\endcode", section \ref cmdverbatim "\\verbatim"
    \subsection cmddef \def @@ -172,14 +173,14 @@ Doxygen. Unrecognized commands are treated as normal text. group of classes, files or namespaces. This can be used to categorize classes, files or namespaces, and document those categories. - \sa section \ref cmdingroup + \sa section \ref cmdingroup "\\ingroup"
    \subsection cmdendcode \endcode \addindex \endcode Ends a block of code. - \sa section \ref cmdcode + \sa section \ref cmdcode "\\code"
    \subsection cmdenum \enum @@ -226,7 +227,7 @@ Doxygen. Unrecognized commands are treated as normal text. for the corresponding HTML documentation that is generated by Doxygen. \endhtmlonly - \sa section \ref cmdinclude. + \sa section \ref cmdinclude "\\include".
    \subsection cmdfile \file [] @@ -266,7 +267,7 @@ Doxygen. Unrecognized commands are treated as normal text. for the corresponding HTML documentation that is generated by Doxygen. \endhtmlonly - \sa section \ref cmdvar and \ref cmdtypedef + \sa section \ref cmdvar "\\var" and \ref cmdtypedef "\\typedef".
    \subsection cmdingroup \ingroup @@ -275,7 +276,7 @@ Doxygen. Unrecognized commands are treated as normal text. If the \\ingroup command is placed in a comment block of a class, file or namespace, then it will be added to the group. - \sa section \ref cmddefgroup + \sa section \ref cmddefgroup "\\defgroup".
    \subsection cmdinternal \internal @@ -337,8 +338,9 @@ Doxygen. Unrecognized commands are treated as normal text. for the corresponding HTML documentation that is generated by Doxygen. \endhtmlonly - \sa section \ref cmdsection, section \ref cmdsubsection, and - section \ref cmdref + \sa section \ref cmdsection "\\section", section + \ref cmdsubsection "\\subsection", and section + \ref cmdref "\\ref".
    \subsection cmdrelates \relates @@ -366,7 +368,7 @@ Doxygen. Unrecognized commands are treated as normal text. struct with name \. The arguments are equal to the \\class command. - \sa section \ref cmdclass. + \sa section \ref cmdclass "\\class".
    \subsection cmdtypedef \typedef (typedef declaration) @@ -376,7 +378,7 @@ Doxygen. Unrecognized commands are treated as normal text. typedef (either global or as a member of a class). This command is equivalent to \\var and \\fn. - \sa section \ref cmdfn and \ref cmdvar + \sa section \ref cmdfn "\\fn" and \ref cmdvar "\\var".
    \subsection cmdunion \union [] [] @@ -386,7 +388,7 @@ Doxygen. Unrecognized commands are treated as normal text. union with name \. The arguments are equal to the \\class command. - \sa section \ref cmdclass. + \sa section \ref cmdclass "\\class".
    \subsection cmdvar \var (variable declaration) @@ -396,7 +398,7 @@ Doxygen. Unrecognized commands are treated as normal text. enum value (either global or as a member of a class). This command is equivalent to \\typedef and \\fn. - \sa section \ref cmdfn and \cmdtypedef + \sa section \ref cmdfn "\\fn" and \ref cmdtypedef "\\typedef".
    @@ -423,7 +425,7 @@ Doxygen. Unrecognized commands are treated as normal text. for the corresponding HTML documentation that is generated by Doxygen. \endhtmlonly - \sa Section \ref cmdjdauthor. + \sa Section \ref cmdjdauthor "@author".
    \subsection cmdbrief \brief {brief description} @@ -437,9 +439,9 @@ Doxygen. Unrecognized commands are treated as normal text. it is advised to keep it brief!). A brief description ends when a blank line or another sectioning command is encountered. If multiple \\brief commands are present they will be joined. See section - \ref cmdauthor for an example. + \ref cmdauthor "\\author" for an example. - \sa Section \ref cmdjdshort + \sa Section \ref cmdjdshort "@short".
    \subsection cmdbug \bug { bug description } @@ -453,8 +455,8 @@ Doxygen. Unrecognized commands are treated as normal text. Each bug description will start on a new line. Alternatively, one \\bug command may mention several bugs. The \\bug command ends when a blank line or some other - sectioning command is encountered. See section \ref cmdauthor for an - example. + sectioning command is encountered. See section \ref cmdauthor "\\author" + for an example.
    \subsection cmddate \date { date description } @@ -468,10 +470,10 @@ Doxygen. Unrecognized commands are treated as normal text. Each date description will start on a new line. Alternatively, one \\date command may mention several dates. The \\date command ends when a blank line or some other - sectioning command is encountered. See section \ref cmdauthor for an - example. + sectioning command is encountered. See section \ref cmdauthor "\\author" + for an example. - \sa Section \ref cmdjddate. + \sa Section \ref cmdjddate "@date".
    \subsection cmdpar \par (paragraph title) { paragraph } @@ -504,10 +506,10 @@ Doxygen. Unrecognized commands are treated as normal text. Multiple adjacent \\param commands will be joined into a single paragraph. Each parameter description will start on a new line. The \\param description ends when a blank line or some other - sectioning command is encountered. See section \ref cmdfn for an + sectioning command is encountered. See section \ref cmdfn "\\fn" for an example. - \sa Section \ref cmdjdparam. + \sa Section \ref cmdjdparam "@param".
    \subsection cmdexception \exception { exception description } @@ -521,10 +523,10 @@ Doxygen. Unrecognized commands are treated as normal text. Multiple adjacent \\exception commands will be joined into a single paragraph. Each parameter description will start on a new line. The \\exception description ends when a blank line or some other - sectioning command is encountered. See section \ref cmdfn for an + sectioning command is encountered. See section \ref cmdfn "\\fn" for an example. - \sa Section \ref cmdjdexception. + \sa Section \ref cmdjdexception "@exception".
    \subsection cmdreturn \return { description of the return value } @@ -535,10 +537,10 @@ Doxygen. Unrecognized commands are treated as normal text. enhancement commands may be used inside the paragraph. Multiple adjacent \\return commands will be joined into a single paragraph. The \\return description ends when a blank line or some other - sectioning command is encountered. See section \ref cmdfn for an + sectioning command is encountered. See section \ref cmdfn "\\fn" for an example. - \sa Section \ref cmdjdreturn. + \sa Section \ref cmdjdreturn "@return".
    \subsection cmdsa \sa { references } @@ -551,8 +553,8 @@ Doxygen. Unrecognized commands are treated as normal text. may be selected by including a parenthesized list of argument types after the method. - \sa section \ref autolink for information on how to create links to objects - and section \ref cmdjdsee for the JavaDoc version of this command. + \sa section \ref autolink "\\autolink" for information on how to create links to objects + and section \ref cmdjdsee "@see" for the JavaDoc version of this command.
    \subsection cmdversion \version { version number } @@ -566,10 +568,10 @@ Doxygen. Unrecognized commands are treated as normal text. Each version description will start on a new line. Alternatively, one \\version command may mention several dates. The \\version command ends when a blank line or some other - sectioning command is encountered. See section \ref cmdauthor for an - example. + sectioning command is encountered. See section \ref cmdauthor "\\author" + for an example. - \sa Section \ref cmdjdversion. + \sa Section \ref cmdjdversion "@version".
    \subsection cmdwarning \warning { warning message } @@ -583,25 +585,35 @@ Doxygen. Unrecognized commands are treated as normal text. Each warning description will start on a new line. Alternatively, one \\warning command may mention several warnings. The \\warning command ends when a blank line or some other - sectioning command is encountered. See section \ref cmdauthor for an - example. + sectioning command is encountered. See section \ref cmdauthor "\\author" + for an example. +

    \htmlonly
    --- \endhtmlonly Commands to create links \htmlonly ---
    \endhtmlonly

    -\subsection cmdaddindex \addindex +\subsection cmdaddindex \addindex (text) \addindex \addindex - This command adds \ to the \htmlonly LaTeX\endhtmlonly - \latexonly\LaTeX\ \endlatexonly index. + This command adds (text) to the \f$\mbox{\LaTeX}\f$ index. + +
    +\subsection cmdanchor \anchor + \addindex \anchor + This command places an invisble, named anchor into to documentation + to which you can refer with the \\ref command. + + \sa section \ref cmdref "\\ref". + +
    \subsection cmdendlink \endlink \addindex \endlink This command ends a link that is started with the \\link command. - \sa section \ref cmdlink. + \sa section \ref cmdlink "\\link".
    \subsection cmdlink \link @@ -616,25 +628,28 @@ Doxygen. Unrecognized commands are treated as normal text. the \\link and \\endlink commands serves as text for a link to the \ specified as the first argument of \\link. - See section \ref autolink for more information on automatically + See section \ref autolink "\\autolink" for more information on automatically generated links and valid link-objects. \b Notice: Keep in mind that links are only meaningful in HTML text; - in \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly - text, the link text is just written to the output. + in \f$\mbox{\LaTeX}\f$ text, the link text is just written to the output.
    -\subsection cmdref \ref +\subsection cmdref \ref ["(text)"] \addindex \ref - Creates a reference to a named section, subsection, or page. + Creates a reference to a named section, subsection, page or anchor. For HTML documentation the reference command will generate a link to - the section, the title of the section will be used as the link text. - For \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly documentation the reference command will generate a section - number. + the section. For a sections or subsections the title of the section will be + used as the text of the link. For anchor the optional text between quotes + will be used or \ if no text is specified. + For \f$\mbox{\LaTeX}\f$ documentation the reference command will + generate a section number for sections or the text followed by a + page number if \ refers to an anchor. - See section \ref cmdpage for an example of the \\ref command. + \sa + Section \ref cmdpage "\\page" for an example of the \\ref command.
    \subsection cmdsection \section (section title) @@ -644,7 +659,11 @@ Doxygen. Unrecognized commands are treated as normal text. section should be specified as the second argument of the \\section command. - See section \ref cmdpage for an example of the \\cmdsection command. + \warning This command only works inside related page documentation and + \e not in other documentation blocks! + + \sa + Section \ref cmdpage "\\page" for an example of the \\cmdsection command.
    \subsection cmdsubsection \subsection (subsection title) @@ -653,7 +672,11 @@ Doxygen. Unrecognized commands are treated as normal text. subsection should be specified as the second argument of the \\subsection command. - See section \ref cmdpage for an example of the \\cmdsubsection command. + \warning This command only works inside related page documentation and + \e not in other documentation blocks! + + \sa + Section \ref cmdpage "\\page" for an example of the \\cmdsubsection command.

    \htmlonly
    --- \endhtmlonly @@ -682,7 +705,8 @@ Doxygen. Unrecognized commands are treated as normal text. for the corresponding HTML documentation that is generated by Doxygen. \endhtmlonly - \sa sections \ref cmdline, \ref cmdskip, \ref cmdskipline, and \ref cmduntil. + \sa sections \ref cmdline "\\line", \ref cmdskip "\\skip", + \ref cmdskipline "\\skipline", and \ref cmduntil "\\until".
    \subsection cmdinclude \include @@ -706,7 +730,7 @@ Doxygen. Unrecognized commands are treated as normal text. \\until commands. An internal pointer is used for these command. The \\include command sets the pointer to the first line of the example. - \sa section \ref cmdexample and \ref cmddontinclude. + \sa section \ref cmdexample "\\example" and \ref cmddontinclude "\\dontinclude".
    \subsection cmdline \line ( pattern ) @@ -722,7 +746,7 @@ Doxygen. Unrecognized commands are treated as normal text. line that was found (or to the end of the example if no such line could be found). - See section \ref cmddontinclude for an example. + See section \ref cmddontinclude "\\dontinclude" for an example.
    \subsection cmdskip \skip ( pattern ) @@ -736,7 +760,7 @@ Doxygen. Unrecognized commands are treated as normal text. the example, is set to the start of the line that contains the specified pattern (or to the end of the example if the pattern could not be found). - See section \ref cmddontinclude for an example. + See section \ref cmddontinclude "\\dontinclude" for an example.
    \subsection cmdskipline \skipline ( pattern ) @@ -758,7 +782,7 @@ Doxygen. Unrecognized commands are treated as normal text. \skip pattern \line pattern\endverbatim - See section \ref cmddontinclude for an example. + See section \ref cmddontinclude "\\dontinclude" for an example.
    \subsection cmduntil \until ( pattern ) @@ -773,7 +797,7 @@ Doxygen. Unrecognized commands are treated as normal text. the example, is set to the start of the line following last written line (or to the end of the example if the pattern could not be found). - See section \ref cmddontinclude for an example. + See section \ref cmddontinclude "\\dontinclude" for an example.
    \subsection cmdverbinclude \verbinclude @@ -875,7 +899,7 @@ Doxygen. Unrecognized commands are treated as normal text. \addindex \endhtmlonly Ends a block of text that was started with a \\htmlonly command. - \sa section \ref cmdhtmlonly. + \sa section \ref cmdhtmlonly "\\htmlonly".
    \subsection cmdendlatexonly \endlatexonly @@ -883,7 +907,7 @@ Doxygen. Unrecognized commands are treated as normal text. \addindex \endlatexonly Ends a block of text that was started with a \\latexonly command. - \sa section \ref cmdlatexonly. + \sa section \ref cmdlatexonly "\\latexonly".
    \subsection cmdendverbatim \endverbatim @@ -891,7 +915,7 @@ Doxygen. Unrecognized commands are treated as normal text. \addindex \endverbatim Ends a block of text that was started with a \\verbatim command. - \sa section \ref cmdverbatim. + \sa section \ref cmdverbatim "\\verbatim".
    \subsection cmdfdollar \f$ @@ -899,7 +923,7 @@ Doxygen. Unrecognized commands are treated as normal text. \addindex \\f$ Marks the start and end of an in-text formula. - \sa section \ref formulas for an example. + \sa section \ref formulas "formulas" for an example.
    \subsection cmdfbropen \f[ @@ -908,7 +932,7 @@ Doxygen. Unrecognized commands are treated as normal text. Marks the start of a long formula that is displayed centered on a separate line. - \sa section \ref cmdfbrclose and section \ref formulas. + \sa section \ref cmdfbrclose "\\f]" and section \ref formulas "formulas".
    \subsection cmdfbrclose \f] @@ -917,7 +941,7 @@ Doxygen. Unrecognized commands are treated as normal text. Marks the end of a long formula that is displayed centered on a separate line. - \sa section \ref cmdfbropen and section \ref formulas. + \sa section \ref cmdfbropen ""\\f[" and section \ref formulas "formulas".
    \subsection cmdhtmlonly \htmlonly @@ -930,38 +954,42 @@ Doxygen. Unrecognized commands are treated as normal text. This command can be used to include HTML code that is too complex for Doxygen (i.e. images, applets, java-scripts, and HTML tags that require attributes). You can use the \\latexonly and \\endlatexonly - pair to provide a proper \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly alternative. + pair to provide a proper \f$\mbox{\LaTeX}\f$ alternative. \b Notice: environment variables (like \$(HOME) ) are resolved inside a HTML-only block. - \sa section \ref cmdhtmlonly and section \ref cmdlatexonly. + \sa section \ref cmdhtmlonly "\\htmlonly" and section + \ref cmdlatexonly "\\latexonly".
    \subsection cmdlatexonly \latexonly \addindex \latexonly Starts a block of text that will be verbatim included in the - generated \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly documentation only. The block ends with a + generated \f$\mbox{\LaTeX}\f$ documentation only. The block ends with a endlatexonly command. - This command can be used to include \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly code that is too complex - for Doxygen (i.e. images, formulas, special characters). You can use the - \\htmlonly and \\endhtmlonly pair to provide a proper HTML alternative. + This command can be used to include \f$\mbox{\LaTeX}\f$ code that is too + complex for Doxygen (i.e. images, formulas, special characters). You can + use the \\htmlonly and \\endhtmlonly pair to provide a proper HTML + alternative. \b Notice: environment variables (like \$(HOME) ) are resolved inside a - \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\endlatexonly-only block. + \f$\mbox{\LaTeX}\f$-only block. - \sa section \ref cmdlatexonly and section \ref cmdhtmlonly. + \sa section \ref cmdlatexonly "\\latexonly" + and section \ref cmdhtmlonly "\\htmlonly".
    \subsection cmdverbatim \verbatim \addindex \verbatim Starts a block of text that will be verbatim included in both the - HTML and the \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly documentation. The block should end with a + HTML and the + \f$\mbox{\LaTeX}\f$ documentation. The block should end with a \\endverbatim block. All commands are disabled in a verbatim block. \warning Make sure you include a \\endverbatim command for each @@ -971,30 +999,32 @@ Doxygen. Unrecognized commands are treated as normal text. \subsection cmdbackslash \\ \addindex \\ - This command writes a backslash character (\\) to the HTML and \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly output. - The backslash has to be escaped in some cases because Doxygen uses it to - detect commands. + This command writes a backslash character (\\) to the HTML and + \f$\mbox{\LaTeX}\f$ output. The backslash has to be escaped in some + cases because Doxygen uses it to detect commands.
    \subsection cmdat \@ \addindex \@ - This command writes an at-sign (@) to the HTML and \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly output. - The at-sign has to be escaped in some cases because Doxygen uses it to - detect JavaDoc commands. + This command writes an at-sign (@) to the HTML and + \f$\mbox{\LaTeX}\f$ output. The at-sign has to be escaped in some cases + because Doxygen uses it to detect JavaDoc commands.
    \subsection cmdamp \& \addindex \& - This command writes the \& character to the HTML and \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly output. This - character has to be escaped because it has a special meaning in HTML. + This command writes the \& character to the HTML and + \f$\mbox{\LaTeX}\f$ output. This character has to be escaped because + it has a special meaning in HTML.
    \subsection cmddollar \$ \addindex \$ - This command writes the \$ character to the HTML and \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly output. This + This command writes the \$ character to the HTML and + \f$\mbox{\LaTeX}\f$ output. This character has to be escaped in some cases, because it is used to expand environment variables. @@ -1002,7 +1032,8 @@ Doxygen. Unrecognized commands are treated as normal text. \subsection cmdhash \# \addindex \# - This command writes the \# character to the HTML and \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly output. This + This command writes the \# character to the HTML and + \f$\mbox{\LaTeX}\f$ output. This character has to be escaped in some cases, because it is used to refer to documented entities. @@ -1010,14 +1041,16 @@ Doxygen. Unrecognized commands are treated as normal text. \subsection cmdlt \\< \addindex \\< - This command writes the \< character to the HTML and \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly output. This + This command writes the \< character to the HTML and + \f$\mbox{\LaTeX}\f$ output. This character has to be escaped because it has a special meaning in HTML.
    \subsection cmdgt \\> \addindex \\> - This command writes the \> character to the HTML and \htmlonly LaTeX\endhtmlonly\latexonly\LaTeX\ \endlatexonly output. This + This command writes the \> character to the HTML and + \f$\mbox{\LaTeX}\f$ output. This character has to be escaped because it has a special meaning in HTML.
    @@ -1030,28 +1063,28 @@ The following command JavaDoc command are support. \subsection cmdjdauthor @author { list of authors } \addindex @author - Equivalent to \\author (see section \ref cmdauthor). + Equivalent to \\author (see section \ref cmdauthor "\\author"). \subsection cmdjddate @date { date description } \addindex @date - Equivalent to \\date (see section \ref cmddate). + Equivalent to \\date (see section \ref cmddate "\\date"). \subsection cmdjdparam @param { parameter-description } \addindex @param - Equivalent to \\param (see section \ref cmdparam). + Equivalent to \\param (see section \ref cmdparam "\\param"). \subsection cmdjdexception @exception { exception-description } \addindex @exception - Equivalent to \\exception (see section \ref cmdexception). + Equivalent to \\exception (see section \ref cmdexception "\\exception"). \subsection cmdjdreturn @return { description of the return value } \addindex @return - Equivalent to \\return (see section \ref cmdreturn). + Equivalent to \\return (see section \ref cmdreturn "\\return"). \subsection cmdjdsee @see { references } \addindex @see - Equivalent to \\sa (see section \ref cmdsa). + Equivalent to \\sa (see section \ref cmdsa "\\sa"). \subsection cmdjdshort @short { brief description } \addindex @short - Equivalent to \\brief (see section \ref cmdbrief). + Equivalent to \\brief (see section \ref cmdbrief "\\brief"). \subsection cmdjdversion @version { version number } \addindex @version - Equivalent to \\version (see section \ref cmdversion). + Equivalent to \\version (see section \ref cmdversion "\\version").

    \htmlonly
    --- \endhtmlonly Commands included for Qt compatibility diff --git a/doc/config.doc b/doc/config.doc index 0412634..481925c 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -169,7 +169,7 @@ Below is a list of tags that are recognized for each category. If the VERBATIM_HEADERS tag is set the YES (the default) then Doxygen\n"; will generate a verbatim copy of the header file for each class for\n"; which an include is specified. Set to NO to disable this.\n"; - \sa Section \ref cmdclass. + \sa Section \ref cmdclass "\\class". @@ -216,7 +216,7 @@ Below is a list of tags that are recognized for each category. \addindex EXAMPLE_PATH The \c EXAMPLE_PATH tag can be used to specify one or more files or directories that contain example code fragments that are included (see - the \\include command in section \ref cmdinclude). + the \\include command in section \ref cmdinclude "\\include").
    \c INCLUDE_PATH
    \addindex INCLUDE_PATH @@ -262,6 +262,7 @@ Below is a list of tags that are recognized for each category. My title + \endverbatim @@ -341,6 +342,10 @@ EXTRA_PACKAGES = times A directory man3 will be created inside the directory specified by \c MAN_OUTPUT. +
    \c MAN_EXTENSION
    + \addindex MAX_EXTENSION + The MAN_EXTENSION tag determines the extension that is added to + the generated man pages (default is the subroutine's section .3) \subsection config_prepro Preprocessor related options diff --git a/doc/index.doc b/doc/index.doc index add62b4..f60eec9 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -155,8 +155,9 @@ Ole Gerden, Olaf Meeuwissen, Feiyi Wang, Robert J. Clark, -Matthias Baas and -Walter Mueller +Matthias Baas, +Walter Mueller, and +William van Dieten for suggestions, patches and bug reports. */ diff --git a/doc/trouble.doc b/doc/trouble.doc index 5103bda..72013d3 100644 --- a/doc/trouble.doc +++ b/doc/trouble.doc @@ -62,6 +62,11 @@ Furthermore, I would appreciate a mail if you have found a bug, or if you have ideas (or even better some code or a patch) how to fix existing bugs and limitations. +The easiest way for me to solve bugs is if you can send me a small example +demonstrating the problem you have (make sure the example compiles!). It is +usually a good idea to send along the configuation file as well, but please +use doxygen with the -s flag while generating it. + My email address: dimitri@stack.nl */ diff --git a/src/classdef.cpp b/src/classdef.cpp index 079252d..50cd54c 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -37,7 +37,7 @@ static QString stripExtension(const char *fName) } // constructs a new class definition -ClassDef::ClassDef(const char *nm,int ct,const char *ref,const char *fName) +ClassDef::ClassDef(const char *nm,CompoundType ct,const char *ref,const char *fName) : Definition(removeRedundantWhiteSpace(nm)) { //name=n; @@ -155,7 +155,7 @@ void ClassDef::insertMember(const MemberDef *md) if (md->isFriend() || md->protection()!=Private || extractPrivateFlag) { MemberInfo *mi = new MemberInfo((MemberDef *)md,Public,Normal); - MemberNameInfo *mni; + MemberNameInfo *mni=0; if ((mni=(*allMemberNameInfoDict)[md->name()])) { mni->append(mi); @@ -232,8 +232,9 @@ void ClassDef::writeDocumentation(OutputList &ol) pageTitle+=pageType+" Reference"; startFile(ol,fileName,pageTitle); startTitle(ol); - ol.docify(name()+" "+pageType.right(pageType.length()-1)+" "); - parseDoc(ol,0,0,theTranslator->trReference()); + //ol.docify(name()+" "+pageType.right(pageType.length()-1)+" "); + //parseText(ol,theTranslator->trReference()); + parseText(ol,theTranslator->trCompoundReference(name(),compType)); endTitle(ol,name()); // write brief description @@ -244,8 +245,8 @@ void ClassDef::writeDocumentation(OutputList &ol) ol+=briefOutput; ol.writeString(" \n"); ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(0,"details"); - parseDoc(ol,0,0,theTranslator->trMore()); + ol.startTextLink(0,"_details"); + parseText(ol,theTranslator->trMore()); ol.endTextLink(); ol.enableAll(); } @@ -286,7 +287,41 @@ void ClassDef::writeDocumentation(OutputList &ol) int count; if ((count=inherits->count())>0) { - parseDoc(ol,0,0,theTranslator->trInherits()+" "); + //parseText(ol,theTranslator->trInherits()+" "); + + QString inheritLine = theTranslator->trInheritsList(inherits->count()); + QRegExp marker("@[0-9]+"); + int index=0,newIndex,matchLen; + // now replace all markers in inheritLine with links to the classes + while ((newIndex=marker.match(inheritLine,index,&matchLen))!=-1) + { + parseText(ol,inheritLine.mid(index,newIndex-index)); + bool ok; + uint entryIndex = inheritLine.mid(newIndex+1,matchLen-1).toUInt(&ok); + BaseClassDef *bcd=inherits->at(entryIndex); + if (ok && bcd) + { + ClassDef *cd=bcd->classDef; + if (cd->hasDocumentation() || cd->isReference()) + { + if (genTagFile.length()>0) tagFile << cd->getOutputFileBase() << "?"; + ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()+bcd->templSpecifiers); + } + else + { + ol.docify(cd->name()); + } + } + else + { + err("Error: invalid marker %d in inherits list!\n",entryIndex); + } + index=newIndex+matchLen; + } + parseText(ol,inheritLine.right(inheritLine.length()-index)); + ol.newParagraph(); + +#if 0 BaseClassDef *bcd=inherits->first(); while (bcd) { @@ -305,13 +340,13 @@ void ClassDef::writeDocumentation(OutputList &ol) if (bcd) { if (inherits->at()==count-1) - parseDoc(ol,0,0," "+theTranslator->trAnd()+" "); + parseText(ol," "+theTranslator->trAnd()+" "); else ol.writeString(", "); } } ol.writeString("."); - ol.newParagraph(); +#endif } if (genTagFile.length()>0) tagFile << " \"" << fileName << ".html\"\n"; @@ -319,7 +354,36 @@ void ClassDef::writeDocumentation(OutputList &ol) // write subclasses if ((count=inheritedBy->count())>0) { - parseDoc(ol,0,0,theTranslator->trInheritedBy()+" "); + QString inheritLine = theTranslator->trInheritedByList(inheritedBy->count()); + QRegExp marker("@[0-9]+"); + int index=0,newIndex,matchLen; + // now replace all markers in inheritLine with links to the classes + while ((newIndex=marker.match(inheritLine,index,&matchLen))!=-1) + { + parseText(ol,inheritLine.mid(index,newIndex-index)); + bool ok; + uint entryIndex = inheritLine.mid(newIndex+1,matchLen-1).toUInt(&ok); + BaseClassDef *bcd=inheritedBy->at(entryIndex); + if (ok && bcd) + { + ClassDef *cd=bcd->classDef; + if (cd->hasDocumentation() || cd->isReference()) + { + ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()); + } + else + { + ol.docify(cd->name()); + } + writeInheritanceSpecifier(ol,bcd); + } + index=newIndex+matchLen; + } + parseText(ol,inheritLine.right(inheritLine.length()-index)); + ol.newParagraph(); + +#if 0 + parseText(ol,theTranslator->trInheritedBy()+" "); BaseClassDef *bcd=inheritedBy->first(); while (bcd) { @@ -337,13 +401,14 @@ void ClassDef::writeDocumentation(OutputList &ol) if (bcd) { if (inheritedBy->at()==count-1) - parseDoc(ol,0,0," "+theTranslator->trAnd()+" "); + parseText(ol," "+theTranslator->trAnd()+" "); else ol.writeString(", "); } } ol.writeString("."); ol.newParagraph(); +#endif } if (classDiagramFlag) ol.enableAll(); @@ -376,7 +441,7 @@ void ClassDef::writeDocumentation(OutputList &ol) ClassDiagram diagram(this); // create a diagram of this class. ol.startClassDiagram(); ol.disable(OutputGenerator::Man); - parseDoc(ol,name(),0,theTranslator->trClassDiagram(name())); + parseText(ol,theTranslator->trClassDiagram(name())); ol.enable(OutputGenerator::Man); ol.endClassDiagram(diagram,fileName,name()); } @@ -386,40 +451,45 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.disableAllBut(OutputGenerator::Html); ol.startTextLink(memListFileName,0); - parseDoc(ol,0,0,theTranslator->trListOfAllMembers()); + parseText(ol,theTranslator->trListOfAllMembers()); ol.endTextLink(); ol.enableAll(); } // write member groups - writeMemberDecs(ol,this,0,0,"Public Members",0,&pubMembers); - writeMemberDecs(ol,this,0,0,"Public Slots",0,&pubSlots); - writeMemberDecs(ol,this,0,0,"Signals",0,&signals); - writeMemberDecs(ol,this,0,0,"Static Public Members",0,&pubStaticMembers); - writeMemberDecs(ol,this,0,0,"Protected Members",0,&proMembers); - writeMemberDecs(ol,this,0,0,"Protected Slots",0,&proSlots); - writeMemberDecs(ol,this,0,0,"Static Protected Members",0,&proStaticMembers); + ol.startMemberSections(); + writeMemberDecs(ol,this,0,0,theTranslator->trPublicMembers(),0,&pubMembers); + writeMemberDecs(ol,this,0,0,theTranslator->trPublicSlots(),0,&pubSlots); + writeMemberDecs(ol,this,0,0,theTranslator->trSignals(),0,&signals); + writeMemberDecs(ol,this,0,0,theTranslator->trStaticPublicMembers(),0,&pubStaticMembers); + writeMemberDecs(ol,this,0,0,theTranslator->trProtectedMembers(),0,&proMembers); + writeMemberDecs(ol,this,0,0,theTranslator->trProtectedSlots(),0,&proSlots); + writeMemberDecs(ol,this,0,0,theTranslator->trStaticProtectedMembers(),0,&proStaticMembers); if (extractPrivateFlag) { - writeMemberDecs(ol,this,0,0,"Private Members",0,&priMembers); - writeMemberDecs(ol,this,0,0,"Private Slots",0,&priSlots); - writeMemberDecs(ol,this,0,0,"Static Private Members",0,&priStaticMembers); + writeMemberDecs(ol,this,0,0,theTranslator->trPrivateMembers(),0,&priMembers); + writeMemberDecs(ol,this,0,0,theTranslator->trPrivateSlots(),0,&priSlots); + writeMemberDecs(ol,this,0,0,theTranslator->trStaticPrivateMembers(),0,&priStaticMembers); } - writeMemberDecs(ol,this,0,0,"Friends",0,&friends); + writeMemberDecs(ol,this,0,0,theTranslator->trFriends(),0,&friends); writeMemberDecs(ol,this,0,0, theTranslator->trRelatedFunctions(), theTranslator->trRelatedSubscript(), &related ); + ol.endMemberSections(); // write detailed description bool exampleFlag=hasExamples(); if (!briefDescription().isEmpty() || !documentation().isEmpty() || exampleFlag) { ol.writeRuler(); - ol.writeAnchor("details"); + bool latexOn = ol.isEnabled(OutputGenerator::Latex); + if (latexOn) ol.disable(OutputGenerator::Latex); + ol.writeAnchor("_details"); + if (latexOn) ol.enable(OutputGenerator::Latex); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trDetailedDescription()); + parseText(ol,theTranslator->trDetailedDescription()); ol.endGroupHeader(); if (tempArgs) // class is a template { @@ -460,11 +530,11 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.startDescList(); ol.startBold(); - parseDoc(ol,0,0,theTranslator->trExamples()+": "); + parseText(ol,theTranslator->trExamples()+": "); ol.endBold(); ol.endDescTitle(); ol.writeDescItem(); - writeExample(ol); + writeExample(ol,exampleList); //ol.endDescItem(); ol.endDescList(); } @@ -489,7 +559,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trMemberTypedefDocumentation()); + parseText(ol,theTranslator->trMemberTypedefDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,&pubMembers,name(),MemberDef::Typedef); @@ -507,7 +577,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trMemberEnumerationDocumentation()); + parseText(ol,theTranslator->trMemberEnumerationDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,&pubMembers,name(),MemberDef::Enumeration); @@ -525,7 +595,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trEnumerationValueDocumentation()); + parseText(ol,theTranslator->trEnumerationValueDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,&pubMembers,name(),MemberDef::EnumValue); @@ -548,7 +618,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trMemberFunctionDocumentation()); + parseText(ol,theTranslator->trMemberFunctionDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,&pubMembers,name(),MemberDef::Function); @@ -570,7 +640,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trRelatedFunctionDocumentation()); + parseText(ol,theTranslator->trRelatedFunctionDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,&friends,name(),MemberDef::Friend); writeMemberDocs(ol,&related,name(),MemberDef::Function); @@ -586,7 +656,7 @@ void ClassDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trMemberDataDocumentation()); + parseText(ol,theTranslator->trMemberDataDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,&pubMembers,name(),MemberDef::Variable); @@ -603,41 +673,57 @@ void ClassDef::writeDocumentation(OutputList &ol) // write the list of used files (Html and LaTeX only) ol.disable(OutputGenerator::Man); ol.writeRuler(); - parseDoc(ol,0,0, - theTranslator->trGeneratedFrom(pageType.lower(), + parseText(ol,theTranslator->trGeneratedFrom(pageType.lower(), files.count()==1)); - ol.startItemList(); - + + bool first=TRUE; const char *file = files.first(); while (file) { - QFileInfo fi(file); - ol.writeListItem(); - FileDef *fd; bool ambig; - if ((fd=findFileDef(&inputNameDict,fi.absFilePath(),ambig)) - && fd->hasDocumentation()) - { - ol.writeObjectLink(fd->getReference(),fd->diskName(),0, - fi.fileName()); - } - else + FileDef *fd=findFileDef(&inputNameDict,file,ambig); + if (fd) { - ol.docify(fi.fileName()); + if (first) + { + first=FALSE; + ol.startItemList(); + } + + ol.writeListItem(); + QString path=fd->getPath().copy(); + if (fullPathNameFlag) + { + // strip part of the path + if (path.left(stripFromPath.length())==stripFromPath) + { + path=path.right(path.length()-stripFromPath.length()); + } + ol.docify(path); + } + + if (fd->hasDocumentation()) + { + ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0, + fd->name()); + } + else + { + ol.docify(fd->name()); + } } file=files.next(); } + if (!first) ol.endItemList(); - ol.endItemList(); - ol.enable(OutputGenerator::Man); - // write Author section (Man only) + ol.enable(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man); ol.writeString("\n"); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trAuthor()); + parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseDoc(ol,0,0,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); ol.enableAll(); endFile(ol); @@ -651,13 +737,11 @@ void ClassDef::writeMemberList(OutputList &ol) ol.disableAllBut(OutputGenerator::Html); startFile(ol,memListFileName,theTranslator->trMemberList()); startTitle(ol); - parseDoc(ol,name(),0,name()+" "+theTranslator->trMemberList()); + parseText(ol,name()+" "+theTranslator->trMemberList()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trThisIsTheListOfAllMembers()); - ol.writeString(" "); + parseText(ol,theTranslator->trThisIsTheListOfAllMembers()); ol.writeObjectLink(reference,fileName,0,name()); - ol.writeString(", "); - parseDoc(ol,0,0,theTranslator->trIncludingInheritedMembers()); + parseText(ol,theTranslator->trIncludingInheritedMembers()); ol.startItemList(); @@ -702,14 +786,14 @@ void ClassDef::writeMemberList(OutputList &ol) { QString name=mi->ambiguityResolutionScope+md->name(); ol.writeListItem(); - ol.writeObjectLink(cd->getReference(),cd->classFile(), + ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), md->anchor(),name); if ( md->isFunction() || md->isSignal() || md->isSlot() ) ol.docify(md->argsString()); else if (md->isEnumerate()) - parseDoc(ol,0,0," "+theTranslator->trEnumName()); + parseText(ol," "+theTranslator->trEnumName()); else if (md->isEnumValue()) - parseDoc(ol,0,0," "+theTranslator->trEnumValue()); + parseText(ol," "+theTranslator->trEnumValue()); else if (md->isTypedef()) ol.docify(" typedef"); else if (md->isFriend() && !strcmp(md->typeString(),"friend class")) @@ -725,16 +809,16 @@ void ClassDef::writeMemberList(OutputList &ol) if ( md->isFunction() || md->isSignal() || md->isSlot() ) ol.docify(md->argsString()); else if (md->isEnumerate()) - parseDoc(ol,0,0," "+theTranslator->trEnumName()); + parseText(ol," "+theTranslator->trEnumName()); else if (md->isEnumValue()) - parseDoc(ol,0,0," "+theTranslator->trEnumValue()); + parseText(ol," "+theTranslator->trEnumValue()); else if (md->isTypedef()) ol.docify(" typedef"); ol.writeString(" ("); - parseDoc(ol,0,0,theTranslator->trDefinedIn()+" "); + parseText(ol,theTranslator->trDefinedIn()+" "); if (cd->isVisible()) { - ol.writeObjectLink(cd->getReference(),cd->classFile(),0,cd->name()); + ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->name()); } else { @@ -792,9 +876,9 @@ void ClassDef::writeIncludeFile(OutputList &ol) startTitle(ol); QString n=incName.copy(); if (incName.isNull()) n=incFile->name(); - parseDoc(ol,0,0,n); + parseText(ol,n); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trVerbatimText(incFile->name())); + parseText(ol,theTranslator->trVerbatimText(incFile->name())); ol.writeRuler(); ol.startCodeFragment(); parseCode(ol,n,fileToString(incFile->absFilePath()),FALSE,0); @@ -829,9 +913,31 @@ bool ClassDef::hasExamples() return exampleList->count()>0; } +#if 0 // write the list of all examples that are use this class. void ClassDef::writeExample(OutputList &ol) { + QString exampleLine=theTranslator->trWriteList(exampleList->count()); + + QRegExp marker("@[0-9]+"); + int index=0,newIndex,matchLen; + // now replace all markers in inheritLine with links to the classes + while ((newIndex=marker.match(exampleLine,index,&matchLen))!=-1) + { + bool ok; + parseText(ol,exampleLine.mid(index,newIndex-index)); + uint entryIndex = exampleLine.mid(newIndex+1,matchLen-1).toUInt(&ok); + Example *e=exampleList->at(entryIndex); + if (ok && e) + { + ol.writeObjectLink(0,e->file,e->anchor,e->name); + } + index=newIndex+matchLen; + } + parseText(ol,exampleLine.right(exampleLine.length()-index)); + ol.writeString("."); + +#if 0 Example *e=exampleList->first(); while (e) { @@ -840,13 +946,15 @@ void ClassDef::writeExample(OutputList &ol) if (e) { if (exampleList->at()==(int)exampleList->count()-1) - parseDoc(ol,0,0," "+theTranslator->trAnd()+" "); + parseText(ol," "+theTranslator->trAnd()+" "); else ol.writeString(", "); } } ol.writeString("."); +#endif } +#endif void ClassDef::setTemplateArguments(ArgumentList *al) { diff --git a/src/classdef.h b/src/classdef.h index 8fe0f21..d5fc466 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -49,10 +49,11 @@ class ClassDef : public Definition Union=Entry::UNION_SEC }; - ClassDef(const char *name,int ct,const char *ref=0,const char *fName=0); + ClassDef(const char *name,CompoundType ct,const char *ref=0,const char *fName=0); ~ClassDef(); - QString classFile() const { return fileName; } - int compoundType() const { return compType; } + //QString classFile() const { return fileName; } + QString getOutputFileBase() const { return fileName; } + CompoundType compoundType() const { return compType; } const char *memberListFileName() const { return memListFileName; } void insertBaseClass(ClassDef *,Protection p,Specifier s,const char *t=0); BaseClassList *baseClasses() { return inherits; } @@ -75,7 +76,7 @@ class ClassDef : public Definition void writeIncludeFile(OutputList &ol); bool addExample(const char *anchor,const char *name, const char *file); bool hasExamples(); - void writeExample(OutputList &ol); + //void writeExample(OutputList &ol); void setProtection(Protection p) { prot=p; } Protection protection() const { return prot; } bool isVisible() @@ -130,7 +131,7 @@ class ClassDef : public Definition QString reference; ExampleList *exampleList; ExampleDict *exampleDict; - int compType; + CompoundType compType; Protection prot; }; diff --git a/src/code.l b/src/code.l index 8bff410..dd5ec0c 100644 --- a/src/code.l +++ b/src/code.l @@ -173,16 +173,19 @@ static void generateClassLink(OutputList &ol,const char *clName) if (exampleBlock) { QString anchor; - anchor.sprintf("a%d",anchorCount); + anchor.sprintf("_a%d",anchorCount); //printf("addExampleClass(%s,%s,%s)\n",anchor.data(),exampleName.data(), // exampleFile.data()); if (cd->addExample(anchor,exampleName,exampleFile)) { + bool latexOn = ol.isEnabled(OutputGenerator::Latex); + if (latexOn) ol.disable(OutputGenerator::Latex); ol.writeAnchor(anchor); + if (latexOn) ol.enable(OutputGenerator::Latex); anchorCount++; } } - ol.writeCodeLink(cd->getReference(),cd->classFile(),0,className); + ol.writeCodeLink(cd->getReference(),cd->getOutputFileBase(),0,className); } else { @@ -193,13 +196,14 @@ static void generateClassLink(OutputList &ol,const char *clName) static bool getLink(const char *className, const char *memberName,OutputList &result) { - MemberDef *md; - ClassDef *cd; - FileDef *fd; + MemberDef *md; + ClassDef *cd; + FileDef *fd; + NamespaceDef *nd; QString m=memberName; QString c=className; //printf("Trying `%s'::`%s'\n",c.data(),m.data()); - if (getDefs(m,c,"()",md,cd,fd) && + if (getDefs(m,c,"()",md,cd,fd,nd) && (md->hasDocumentation() || md->isReference())) { //printf("Found!\n"); @@ -217,13 +221,19 @@ static bool getLink(const char *className, } if (cd) { - result.writeCodeLink(cd->getReference(),cd->classFile(), + result.writeCodeLink(cd->getReference(),cd->getOutputFileBase(), + md->anchor(),memberName); + return TRUE; + } + else if (nd) + { + result.writeCodeLink(nd->getReference(),nd->getOutputFileBase(), md->anchor(),memberName); return TRUE; } else if (fd) { - result.writeCodeLink(fd->getReference(),fd->diskName(), + result.writeCodeLink(fd->getReference(),fd->getOutputFileBase(), md->anchor(),memberName); return TRUE; } @@ -363,7 +373,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* if ((fd=findFileDef(&inputNameDict,yytext,ambig)) && fd->hasDocumentation()) { - code->writeCodeLink(0,fd->diskName(),0,yytext); + code->writeCodeLink(0,fd->getOutputFileBase(),0,yytext); } else { diff --git a/src/config.h b/src/config.h index 6269e85..492f356 100644 --- a/src/config.h +++ b/src/config.h @@ -41,6 +41,7 @@ extern QString genTagFile; // the tag file to generate extern QString inputFilter; // a filter command that is applied to input files extern QString paperType; // the page type to generate docs for extern QString stripFromPath; // the string to strip from the file path +extern QString manExtension; // extension the man page files extern QStrList includePath; // list of include paths extern QStrList examplePath; // list of example paths extern QStrList inputSources; // list of input files @@ -76,5 +77,6 @@ extern bool repeatBriefFlag; // repeat brief descriptions. extern bool internalDocsFlag; // determines what happens to internal docs. extern bool caseSensitiveNames; // determines if output can be mixed case. extern bool verbatimHeaderFlag; // enable/disable generation of verb headers. +extern bool htmlAlignMemberFlag; // align members in HTML using tables. #endif diff --git a/src/config.l b/src/config.l index 232f531..0545f32 100644 --- a/src/config.l +++ b/src/config.l @@ -62,6 +62,7 @@ QString inputFilter; QString paperType; QString outputLanguage; QString stripFromPath; +QString manExtension; QStrList includePath; QStrList examplePath; QStrList inputSources; @@ -72,31 +73,32 @@ QStrList tagFileList; QStrList extDocPathList; QStrList predefined; QStrList extraPackageList; -bool quietFlag = FALSE; -bool warningFlag = FALSE; -bool recursiveFlag = FALSE; -bool allExtFlag = FALSE; -bool searchEngineFlag = FALSE; -bool extractAllFlag = FALSE; -bool extractPrivateFlag = FALSE; -bool noIndexFlag = FALSE; -bool hideMemberFlag = FALSE; -bool hideClassFlag = FALSE; -bool macroExpansionFlag = FALSE; -bool onlyPredefinedFlag = FALSE; -bool fullPathNameFlag = FALSE; -bool compactLatexFlag = FALSE; -bool internalDocsFlag = FALSE; -bool caseSensitiveNames = FALSE; -bool generateHtml = TRUE; -bool generateLatex = TRUE; -bool generateMan = TRUE; -bool preprocessingFlag = TRUE; -bool briefMemDescFlag = TRUE; -bool searchIncludeFlag = TRUE; -bool classDiagramFlag = TRUE; -bool repeatBriefFlag = TRUE; -bool verbatimHeaderFlag = TRUE; +bool quietFlag = FALSE; +bool warningFlag = FALSE; +bool recursiveFlag = FALSE; +bool allExtFlag = FALSE; +bool searchEngineFlag = FALSE; +bool extractAllFlag = FALSE; +bool extractPrivateFlag = FALSE; +bool noIndexFlag = FALSE; +bool hideMemberFlag = FALSE; +bool hideClassFlag = FALSE; +bool macroExpansionFlag = FALSE; +bool onlyPredefinedFlag = FALSE; +bool fullPathNameFlag = FALSE; +bool compactLatexFlag = FALSE; +bool internalDocsFlag = FALSE; +bool caseSensitiveNames = FALSE; +bool generateHtml = TRUE; +bool generateLatex = TRUE; +bool generateMan = TRUE; +bool preprocessingFlag = TRUE; +bool briefMemDescFlag = TRUE; +bool searchIncludeFlag = TRUE; +bool classDiagramFlag = TRUE; +bool repeatBriefFlag = TRUE; +bool verbatimHeaderFlag = TRUE; +bool htmlAlignMemberFlag = TRUE; /* ----------------------------------------------------------------- * @@ -162,7 +164,8 @@ static int yyread(char *buf,int max_size) "INPUT_FILTER"[ \t]*"=" { BEGIN(GetString); s=&inputFilter; } "PAPER_TYPE"[ \t]*"=" { BEGIN(GetString); s=&paperType; } "OUTPUT_LANGUAGE"[ \t]*"=" { BEGIN(GetString); s=&outputLanguage; } -"STRIP_FROM_PATH"[ \t]*"=" { BEGIN(GetString); s=&stripFromPath; } +"STRIP_FROM_PATH"[ \t]*"=" { BEGIN(GetString); s=&stripFromPath; } +"MAN_EXTENSION"[ \t]*"=" { BEGIN(GetString); s=&manExtension; } "INCLUDE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&includePath; elemStr=""; } "EXAMPLE_PATH"[ \t]*"=" { BEGIN(GetStrList); l=&examplePath; elemStr=""; } "INPUT"[ \t]*"=" { BEGIN(GetStrList); l=&inputSources; elemStr=""; } @@ -198,6 +201,7 @@ static int yyread(char *buf,int max_size) "INTERNAL_DOCS"[ \t]*"=" { BEGIN(GetBool); b=&internalDocsFlag; } "CASE_SENSE_NAMES"[ \t]*"=" { BEGIN(GetBool); b=&caseSensitiveNames; } "VERBATIM_HEADERS"[ \t]*"=" { BEGIN(GetBool); b=&verbatimHeaderFlag; } +"HTML_ALIGN_MEMBERS"[ \t]*"=" { BEGIN(GetBool); b=&htmlAlignMemberFlag; } [a-z_A-Z0-9]+ { err("Warning: ignoring unknown tag `%s' at line %d\n",yytext,yyLineNr); } \n { yyLineNr++; BEGIN(Start); } \n { @@ -636,6 +640,15 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,\n"; + t << "# files or namespaces will be aligned in HTML using tables. If set to\n"; + t << "# NO a bullet list will be used.\n"; + t << "\n"; + } + t << "HTML_ALIGN_MEMBERS = YES\n"; + if (!sl) + { + t << "\n"; t << "#---------------------------------------------------------------------------\n"; t << "# configuration options related to the LaTeX output\n"; t << "#---------------------------------------------------------------------------\n"; @@ -704,6 +717,15 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# The MAN_EXTENSION tag determines the extension that is added to\n"; + t << "# the generated man pages (default is the subroutine's section .3)\n"; + t << "\n"; + } + t << "MAN_EXTENSION = .3\n"; + + if (!sl) + { + t << "\n"; t << "#---------------------------------------------------------------------------\n"; t << "# Configuration options related to the preprocessor \n"; t << "#---------------------------------------------------------------------------\n"; @@ -870,6 +892,12 @@ void checkConfig() // projectName[0]=toupper(projectName[0]); //} + // set default man page extension if non is given by the user + if (manExtension.isEmpty()) + { + manExtension=".3"; + } + paperType = paperType.lower().stripWhiteSpace(); if (paperType.isEmpty()) { diff --git a/src/definition.cpp b/src/definition.cpp index 535612b..328bebe 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -16,6 +16,17 @@ #include #include "definition.h" +#include "doxygen.h" + +Definition::Definition(const char *name,const char *b,const char *d) +{ + n=name; brief=b; doc=d; sectionList=0; +} + +Definition::~Definition() +{ + delete sectionList; +} QString Definition::nameToFile(const char *name) { @@ -42,3 +53,22 @@ QString Definition::nameToFile(const char *name) } return result; } + +void Definition::addSectionsToDefinition(QList *anchorList) +{ + if (!anchorList) return; + QString *s=anchorList->first(); + while (s) + { + SectionInfo *si=0; + if (!s->isEmpty() && (si=sectionDict[*s])) + { + //printf("Add section `%s' to definition `%s'\n", + // si->label.data(),n.data()); + if (sectionList==0) sectionList = new SectionList; + sectionList->append(si); + si->definition = this; + } + s=anchorList->next(); + } +} diff --git a/src/definition.h b/src/definition.h index 2dbee89..48301bc 100644 --- a/src/definition.h +++ b/src/definition.h @@ -18,19 +18,22 @@ #define DEFINITION_H #include +#include #include "config.h" +#include "section.h" /*! The common base class of all definitions. */ class Definition { public: //! create a new definition - Definition(const char *name,const char *b=0,const char *d=0) - { n=name; brief=b; doc=d; } + Definition(const char *name,const char *b=0,const char *d=0); //! destroys the definition - virtual ~Definition() {} + virtual ~Definition(); //! returns the name of the definition QString name() const { return n; } + //! returns the base name of the output file that contains this definition. + virtual QString getOutputFileBase() const = 0; //! returns the detailed description of this definition QString documentation() const { return doc; } //! returns the brief description of this definition @@ -55,10 +58,13 @@ class Definition { return !doc.isNull() || !brief.isNull() || extractAllFlag; } QString nameToFile(const char *name); + void addSectionsToDefinition(QList *anchorList); + private: QString n; // name of the definition QString brief; // brief description QString doc; // detailed description + SectionList *sectionList; // list of all sections }; #endif diff --git a/src/diagram.cpp b/src/diagram.cpp index 0fd30a5..87d5488 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -152,7 +152,7 @@ static void writeMapArea(QTextStream &t,ClassDef *cd,int x,int y,int w,int h) { t << "getReference()) t << "doxygen=\"" << cd->getReference() << ":\" "; - t << "href=\"" << cd->classFile() << ".html\" "; + t << "href=\"" << cd->getOutputFileBase() << ".html\" "; t << "ALT=\"" << cd->name(); t << "\" shape=\"rect\" coords=\"" << x << "," << y << ","; t << x+w << "," << y+h << "\">" << endl; @@ -187,7 +187,7 @@ QString DiagramItem::label() const QString DiagramItem::fileName() const { - return classDef->classFile(); + return classDef->getOutputFileBase(); } int DiagramItem::avgChildPos() const diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 3d641ef..8c11c0b 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -60,6 +60,7 @@ PageList exampleList; // list of all example files PageList pageList; // list of all related documentation pages MemberNameList memberNameList; // list of class member + related functions MemberNameList functionNameList; // list of all unrelated functions +//MemberNameList namespaceNameList; // list of namespace members; FileNameList inputNameList; // list of all input files StringList inputFiles; FileList includeFiles; @@ -71,8 +72,9 @@ PageDict pageDict(1009); // dictionary of all doc pages PageDict exampleDict(1009); // dictionary of all examples ClassDict classDict(1009); // dictionary of all documented classes NamespaceDict namespaceDict(257); // dictionary of all documented namespaces -MemberNameDict memberNameDict(10007); // dictionary of all member names +MemberNameDict memberNameDict(10007); // dictionary of all class member names MemberNameDict functionNameDict(10007); // dictionary of all functions +//MemberNameDict namespaceNameDict(10007);// dictionaty of all namespace member names StringDict substituteDict(1009); // dictionary of class name substitutes SectionDict sectionDict(257); // dictionary of all page sections FileNameDict inputNameDict(1009); // dictionary of sections @@ -100,6 +102,7 @@ int documentedMembers; int documentedFiles; int documentedGroups; int documentedNamespaces; +int documentedNamespaceMembers; QTextStream tagFile; @@ -140,6 +143,7 @@ void buildGroupList(Entry *root) gd = new GroupDef(root->name,root->type); gd->setBriefDescription(root->brief); gd->setDocumentation(root->doc); + gd->addSectionsToDefinition(root->anchors); groupList.inSort(gd); groupDict.insert(root->name,gd); } @@ -207,6 +211,7 @@ void buildFileList(Entry *root) { fd->setDocumentation(root->doc); fd->setBriefDescription(root->brief); + fd->addSectionsToDefinition(root->anchors); QListIterator sli(*root->groups); QString *s; for (;(s=sli.current());++sli) @@ -290,7 +295,7 @@ void addIncludeFile(ClassDef *cd,FileDef *ifd,Entry *root) cd->setIncludeFile(fd); // set include supplied name cd->setIncludeName(root->includeName); - fd->setIncludeName((QString)cd->classFile()+"-include"); + fd->setIncludeName(cd->getOutputFileBase()+"-include"); if (includeDict[fd->absFilePath()]==0) // include not inserted earlier { includeFiles.inSort(fd); @@ -409,6 +414,7 @@ void buildClassList(Entry *root) { cd->setDocumentation(root->doc); cd->setBriefDescription(root->brief); + cd->addSectionsToDefinition(root->anchors); cd->setName(fullName); // change name to match docs } } @@ -429,7 +435,7 @@ void buildClassList(Entry *root) ) // new class { - int sec=ClassDef::Class; + ClassDef::CompoundType sec=ClassDef::Class; switch(root->section) { case Entry::UNION_SEC: @@ -445,6 +451,7 @@ void buildClassList(Entry *root) //printf("new ClassDef tempArgList=%p\n",root->tArgList); cd->setTemplateArguments(root->tArgList); cd->setProtection(root->protection); + cd->addSectionsToDefinition(root->anchors); QListIterator sli(*root->groups); QString *s; @@ -519,6 +526,7 @@ void buildNamespaceList(Entry *root) { nd->setDocumentation(root->doc); nd->setName(fullName); // change name to match docs + nd->addSectionsToDefinition(root->anchors); } else if (!nd->documentation().isEmpty() && root->doc.length()>0) { @@ -539,14 +547,16 @@ void buildNamespaceList(Entry *root) } } } - else if (root->doc.length()>0 || + else /* if (root->doc.length()>0 || root->brief.length()>0 || extractAllFlag - ) + ) + */ { NamespaceDef *nd=new NamespaceDef(fullName); nd->setDocumentation(root->doc); // copy docs to definition nd->setBriefDescription(root->brief); + nd->addSectionsToDefinition(root->anchors); QListIterator sli(*root->groups); QString *s; @@ -639,12 +649,14 @@ void buildVarList(Entry *root) bool stat=root->stat; ClassDef *cd=0; Entry *p = root->parent; - while ((p->section & Entry::COMPOUND_MASK)) + while ((p->section & Entry::COMPOUND_MASK) || + p->section==Entry::NAMESPACE_SEC) { if (p->name.length()>0 && p->name[0]!='@') { if (!scope.isEmpty()) scope.prepend("::"); scope.prepend(p->name); + break; } p=p->parent; } @@ -652,6 +664,7 @@ void buildVarList(Entry *root) //printf("scope=%s\n",scope.data()); int ni; +#if 0 if ((ni=root->name.findRev("::"))!=-1) { if (scope.length()>0) scope+="::"; @@ -659,8 +672,18 @@ void buildVarList(Entry *root) name=root->name.right(root->name.length()-ni-2); stat=TRUE; } +#endif + + if ((ni=root->name.findRev("::"))!=-1) goto nextMember; + /* skip this member, because it is a + * static variable definition (always?), which will be + * found in a class scope as well, but then we know the + * correct protection level, so only then it will be + * inserted in the correct list! + */ MemberDef::MemberType mtype; +// NamespaceDef *nd = 0; QString type=root->type.stripWhiteSpace(); if (type=="@") mtype=MemberDef::EnumValue; @@ -715,11 +738,28 @@ void buildVarList(Entry *root) if (mn) { MemberDef *md=mn->first(); - while (md) + while (md && !found) { if (md->memberClass()==cd) // member already in the scope { addMemberDocs(root,md,def,FALSE); + +#if 0 + // always trust the most protected scope, so adjust if needed + // This is needed to properly place static private variables, + // which are defined in a `public' scope. + printf("Checking protection level\n"); + if (root->protection==Private || md->protection()!=Private) + { + printf("Set to private\n"); + md->setProtection(Private); + } + else if (root->protection==Protected && md->protection()==Public) + { + printf("Set to protected\n"); + md->setProtection(Protected); + } +#endif found=TRUE; } md=mn->next(); @@ -737,6 +777,7 @@ void buildVarList(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->setDefinition(def); + md->addSectionsToDefinition(root->anchors); // add the member to the global list if (mn) @@ -761,6 +802,56 @@ void buildVarList(Entry *root) cd->insertUsedFile(root->fileName); } } +#if 0 + else if (scope.length()>0 && name.length()>0 && (nd=namespaceDict[scope])) + { + Debug::print(Debug::Variables,0, + " namespace variable:\n" + " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d\n", + root->type.data(), + scope.data(), + name.data(), + root->args.data(), + root->protection + ); + // new global variable, enum value or typedef + MemberDef *md=new MemberDef(root->type,name,root->args,0, + Public, Normal,root->stat,FALSE, + mtype,0,0); + md->setDefFile(root->fileName); + md->setDefLine(root->startLine); + md->setDocumentation(root->doc); + md->setBriefDescription(root->brief); + md->addSectionsToDefinition(root->anchors); + QString def; + nd->insertMember(md); + md->setNamespace(nd); + if (root->type.length()>0) + { + def=root->type+" "+nd->name()+"::"+name+root->args; + } + else + { + def=nd->name()+"::"+name+root->args; + } + if (def.left(7)=="static ") def=def.right(def.length()-7); + md->setDefinition(def); + + MemberName *mn; + // add member definition to the list of globals + if ((mn=namespaceNameDict[name])) + { + mn->inSort(md); + } + else + { + mn = new MemberName(name); + mn->inSort(md); + namespaceNameDict.insert(name,mn); + namespaceNameList.inSort(mn); + } + } +#endif else if (name.length()>0) // global variable { Debug::print(Debug::Variables,0, @@ -781,6 +872,7 @@ void buildVarList(Entry *root) md->setDefLine(root->startLine); md->setDocumentation(root->doc); md->setBriefDescription(root->brief); + md->addSectionsToDefinition(root->anchors); QString def; // see if the function is inside a namespace @@ -850,6 +942,7 @@ void buildVarList(Entry *root) } } } +nextMember: EntryListIterator eli(*root->sublist); Entry *e; for (;(e=eli.current());++eli) @@ -925,6 +1018,7 @@ void buildMemberList(Entry *root) md->setDefLine(root->startLine); md->setDocumentation(root->doc); md->setBriefDescription(root->brief); + md->addSectionsToDefinition(root->anchors); QString def; if (root->relates.length()>0 || isFriend) { @@ -1048,6 +1142,7 @@ void buildMemberList(Entry *root) { md->setBriefDescription(root->brief); } + md->addSectionsToDefinition(root->anchors); } md=mn->next(); } @@ -1067,6 +1162,7 @@ void buildMemberList(Entry *root) md->setDocumentation(root->doc); md->setBriefDescription(root->brief); md->setPrototype(root->proto); + md->addSectionsToDefinition(root->anchors); QString def; if (root->type.length()>0) { @@ -1357,8 +1453,9 @@ void computeClassRelations(Entry *root) } else // base class not documented { - //printf("Found undocumented base class %s\n",bi->name.data()); NamespaceDef *nd=cd->getNamespace(); + //printf("Found undocumented base class `%s' namespace scope=`%s'\n", + // bi->name.data(),nd ? nd->name().data() : ""); if (nd && (baseClass=getClass(nd->name()+"::"+baseClassName))) // class is defined inside namespace { @@ -1369,7 +1466,7 @@ void computeClassRelations(Entry *root) } else // undocumented base class { - baseClass=new ClassDef(bi->name,Entry::CLASS_SEC); + baseClass=new ClassDef(bi->name,ClassDef::Class); // add base class to this class cd->insertBaseClass(baseClass,bi->prot,bi->virt,templSpec); // add this class as super class to the base class @@ -1523,6 +1620,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, } md->setDefFile(root->fileName); md->setDefLine(root->startLine); + md->addSectionsToDefinition(root->anchors); if (cd) cd->insertUsedFile(root->fileName); } @@ -1676,21 +1774,23 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, else scopeName=related.copy(); } - else if (scopeName.isEmpty() && related.isEmpty() && root->parent && + else if (/*scopeName.isEmpty() &&*/ related.isEmpty() && root->parent && !root->parent->name.isNull()) { Entry *p=root->parent; while (p) // get full scope as class name { + //printf("++++++ scope=`%s'\n",p->name.data()); if (((p->section & Entry::COMPOUND_MASK) || p->section == Entry::NAMESPACE_SEC ) && !p->name.isEmpty() && p->name[0]!='@' ) { + if (scopeName.left(p->name.length())==p->name) + break; // scope already present, so stop now + // prepend name to scope if (!scopeName.isEmpty()) scopeName.prepend("::"); scopeName.prepend(p->name); - break; // stop here because the class name already contains - // the whole scope! } p=p->parent; } @@ -1906,6 +2006,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, md->setDefFile(root->fileName); md->setDefLine(root->startLine); md->setPrototype(root->proto); + md->addSectionsToDefinition(root->anchors); mn->inSort(md); cd->insertMember(md); cd->insertUsedFile(root->fileName); @@ -1970,6 +2071,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, md->setDefFile(root->fileName); md->setDefLine(root->startLine); md->setPrototype(root->proto); + md->addSectionsToDefinition(root->anchors); mn->inSort(md); cd->insertMember(md); cd->insertUsedFile(root->fileName); @@ -2014,7 +2116,7 @@ void findMember(Entry *root,QString funcDecl,QString related,bool overloaded, void findMemberDocumentation(Entry *root) { int i,l; - QRegExp re("([a-zA-Z0-9: ]*[ *]+[ ]*"); + QRegExp re("([a-zA-Z0-9: ]*\\*+[ \\*]*"); Debug::print(Debug::FindMembers,0, "root->type=`%s' root->name=`%s' root->args=`%s'\n", root->type.data(),root->name.data(),root->args.data() @@ -2026,7 +2128,7 @@ void findMemberDocumentation(Entry *root) root->type=root->type.left(i+l); isFunc=FALSE; } - else if (root->name.find(re)!=-1 && root->name.find("operator")!=-1) + else if (root->name.find(re)!=-1 && root->name.find("operator")==-1) // func ptr entered with \fn, \var or \typedef { isFunc=FALSE; @@ -2151,6 +2253,7 @@ void findEnums(Entry *root) if (!isGlobal) md->setMemberClass(cd); else md->setFileDef(fd); md->setDefFile(root->fileName); md->setDefLine(root->startLine); + md->addSectionsToDefinition(root->anchors); if (nd) { md->setDefinition(nd->name()+"::"+name); @@ -2301,6 +2404,7 @@ void findEnumDocumentation(Entry *root) { md->setBriefDescription(root->brief); } + md->addSectionsToDefinition(root->anchors); found=TRUE; } md=mn->next(); @@ -2319,6 +2423,7 @@ void findEnumDocumentation(Entry *root) { md->setDocumentation(root->doc); md->setBriefDescription(root->brief); + md->addSectionsToDefinition(root->anchors); found=TRUE; } } @@ -2338,6 +2443,49 @@ void findEnumDocumentation(Entry *root) } } +// seach for each enum (member or function) in mnl if it has documented +// enum values. +static void findDEV(const MemberNameList &mnl) +{ + MemberName *mn; + MemberNameListIterator mnli(mnl); + // for each member name + for (mnli.toFirst();(mn=mnli.current());++mnli) + { + MemberDef *md; + MemberNameIterator mni(*mn); + // for each member definition + for (mni.toFirst();(md=mni.current());++mni) + { + if (md->isEnumerate()) // member is an enum + { + QList *fmdl = md->enumFieldList(); + int documentedEnumValues=0; + if (fmdl) // enum has values + { + MemberDef *fmd=fmdl->first(); + // for each enum value + while (fmd) + { + if (fmd->hasDocumentation()) documentedEnumValues++; + fmd=fmdl->next(); + } + } + // at least one enum value is documented + if (documentedEnumValues>0) md->setDocumentedEnumValues(TRUE); + } + } + } +} + +// seach for each enum (member or function) if it has documented enum +// values. +void findDocumentedEnumValues() +{ + findDEV(memberNameList); + findDEV(functionNameList); +} + //---------------------------------------------------------------------- // recursive function: // returns TRUE iff class definition `bcd' represents an (in)direct base @@ -2695,6 +2843,7 @@ void findDefineDocumentation(Entry *root) md->setDocumentation(root->doc); if (md->briefDescription().isEmpty()) md->setBriefDescription(root->brief); + md->addSectionsToDefinition(root->anchors); } md=mn->next(); } @@ -2715,6 +2864,7 @@ void findDefineDocumentation(Entry *root) md->setDocumentation(root->doc); if (md->briefDescription().isEmpty()) md->setBriefDescription(root->brief); + md->addSectionsToDefinition(root->anchors); } } md=mn->next(); @@ -2769,6 +2919,7 @@ void buildPageList(Entry *root) baseName=baseName.left(baseName.length()-5); pi=new PageInfo(baseName, root->doc, root->args.stripWhiteSpace()); + setFileNameForSections(root->anchors,root->name); pageList.append(pi); pageDict.insert(baseName,pi); if (pi->title.length()>0) @@ -2779,8 +2930,11 @@ void buildPageList(Entry *root) else pageName=pi->name.lower(); //outputList->writeTitle(pi->name,pi->title); - SectionInfo *si=new SectionInfo(pageName+".html", - pi->name,pi->title,FALSE); + + // a page name is a label as well! + SectionInfo *si=new SectionInfo( + pi->name,pi->title,SectionInfo::Section); + si->fileName=pageName+".html"; //printf("Adding section info %s\n",pi->name.data()); sectionDict.insert(pi->name,si); } @@ -2796,6 +2950,26 @@ void buildPageList(Entry *root) } //---------------------------------------------------------------------------- + +void resolveUserReferences() +{ + QDictIterator sdi(sectionDict); + SectionInfo *si; + for (;(si=sdi.current());++sdi) + { + if (si->definition) + { + //printf("si=`%s' def=`%s' file=`%s'\n", + // si->label.data(), + // si->definition->name().data(), + // si->definition->getOutputFileBase().data()); + si->fileName=si->definition->getOutputFileBase().copy(); + } + } +} + + +//---------------------------------------------------------------------------- // generate all separate documentation pages void generatePageDocs() @@ -2803,14 +2977,7 @@ void generatePageDocs() PageInfo *pi=pageList.first(); while (pi) { - if (!pi->title.isEmpty()) - { - msg("Generating docs for page %s...\n",pi->title.data()); - } - else - { - msg("Generating docs for page %s...\n",pi->name.data()); - } + msg("Generating docs for page %s...\n",pi->name.data()); outputList->disable(OutputGenerator::Man); QString pageName; if (caseSensitiveNames) @@ -2850,6 +3017,7 @@ void buildExampleList(Entry *root) else { PageInfo *pi=new PageInfo(root->name,root->doc,root->args); + setFileNameForSections(root->anchors,root->name); exampleList.inSort(pi); exampleDict.insert(root->name,pi); } @@ -3166,6 +3334,7 @@ void readFiles(BufStr &output) s=inputFiles.next(); } // *p++='\0'; + output.addChar('\n'); /* to prevent problems under Windows ? */ output.addChar(0); //printf("Output after preprocessing:\n---------\n%s\n----------\n",output.data()); //printf("Final length = %d\n",p-output.data()); @@ -3206,7 +3375,7 @@ int readDir(QFileInfo *fi, else if (cfi->isFile() && patternMatch(cfi,patList) && !patternMatch(cfi,exclPatList)) { - totalSize+=cfi->size()+cfi->absFilePath().length()+3; + totalSize+=cfi->size()+cfi->absFilePath().length()+4; QString name=cfi->fileName(); if (fnDict) { @@ -3306,7 +3475,7 @@ int readFileOrDirectory(const char *s, } else if (fi.isFile()) { - totalSize+=fi.size()+fi.absFilePath().length()+3; //readFile(&fi,fiList,input); + totalSize+=fi.size()+fi.absFilePath().length()+4; //readFile(&fi,fiList,input); //fiList->inSort(new FileInfo(fi)); QString name=fi.fileName(); if (fnDict) @@ -3646,16 +3815,19 @@ int main(int argc,char **argv) msg("Searching for enumerations...\n"); findEnums(root); findEnumDocumentation(root); - // msg("Searching for function prototypes...\n"); // findPrototypes(root); // may introduce new members ! msg("Searching for member function documentation...\n"); findMemberDocumentation(root); // may introduce new members ! + msg("Freeing entry tree\n"); delete root; + msg("Determining which enums are documented\n"); + findDocumentedEnumValues(); + msg("Computing member references...\n"); computeMemberReferences(); @@ -3678,18 +3850,22 @@ int main(int argc,char **argv) // If the result is 0 we do not generate the lists and omit the // corresponding links in the index. msg("Counting data structures...\n"); - annotatedClasses = countAnnotatedClasses(); - hierarchyClasses = countClassHierarchy(); - documentedMembers = countMemberList(); - documentedFunctions = countFunctionList(); - documentedFiles = countFileList(); - documentedGroups = countGroupList(); - documentedNamespaces = countNamespaceList(); + annotatedClasses = countAnnotatedClasses(); + hierarchyClasses = countClassHierarchy(); + documentedMembers = countClassMembers(); + documentedFunctions = countFileMembers(); + documentedFiles = countFiles(); + documentedGroups = countGroups(); + documentedNamespaces = countNamespaces(); + documentedNamespaceMembers = countNamespaceMembers(); // compute the shortest possible names of all files // without loosing the uniqueness of the file names. msg("Generating disk names...\n"); inputNameList.generateDiskNames(); + + msg("Resolving user defined references...\n"); + resolveUserReferences(); msg("Generating example documentation...\n"); generateExampleDocs(); @@ -3715,9 +3891,12 @@ int main(int argc,char **argv) msg("Generating example index...\n"); writeExampleIndex(*outputList); - msg("Generating function index...\n"); - writeFunctionIndex(*outputList); + msg("Generating file member index...\n"); + writeFileMemberIndex(*outputList); + msg("Generating namespace member index...\n"); + writeNamespaceMemberIndex(*outputList); + // msg("Generating define index...\n"); // writeDefineIndex(*outputList); @@ -3730,17 +3909,17 @@ int main(int argc,char **argv) msg("Generating style sheet...\n"); outputList->writeStyleInfo(0); // write first part outputList->disableAllBut(OutputGenerator::Latex); - parseDoc(*outputList,0,0, + parseText(*outputList, theTranslator->trGeneratedAt(dateToString(TRUE),projectName) ); outputList->writeStyleInfo(1); // write second part - parseDoc(*outputList,0,0, theTranslator->trWrittenBy()); + parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(2); // write third part - parseDoc(*outputList,0,0, + parseText(*outputList, theTranslator->trGeneratedAt(dateToString(TRUE),projectName) ); outputList->writeStyleInfo(3); // write fourth part - parseDoc(*outputList,0,0, theTranslator->trWrittenBy()); + parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(4); // write last part outputList->enableAll(); diff --git a/src/doxygen.h b/src/doxygen.h index 05ca854..005ac7e 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -28,6 +28,7 @@ #include "define.h" #include "namespacedef.h" #include "formula.h" +#include "section.h" struct PageInfo { @@ -72,23 +73,12 @@ class BufStr : public QString const int spareRoom; // 10Kb extra room to avoid frequent resizing }; -struct SectionInfo -{ - SectionInfo(const char *n,const char *l,const char *t,bool sub) - { pageName=n; label=l; title=t; isSubsection=sub; } - QString pageName; - QString label; - QString title; - bool isSubsection; -}; - typedef QList StringList; typedef QDict MemberDict; typedef QDict ClassDict; typedef QDict FileDict; typedef QDict StringDict; typedef QDict PageDict; -typedef QDict SectionDict; typedef QDict GroupDict; extern const char * getOverloadDocs(); @@ -118,6 +108,7 @@ extern FileList includeFiles; extern StringDict typedefDict; extern GroupList groupList; extern NamespaceList namespaceList; +extern NamespaceDict namespaceDict; extern FormulaList formulaList; extern FormulaDict formulaDict; extern FormulaDict formulaNameDict; @@ -130,5 +121,6 @@ extern int documentedDefines; extern int documentedFiles; extern int documentedGroups; extern int documentedNamespaces; +extern int documentedNamespaceMembers; #endif diff --git a/src/doxygen.pro b/src/doxygen.pro index e6dd3c0..21e2ea5 100644 --- a/src/doxygen.pro +++ b/src/doxygen.pro @@ -14,7 +14,7 @@ # TMake project file for doxygen TEMPLATE = doxygen.t -CONFIG = console qt warn_on release #debug +CONFIG = console qt warn_on release #debug HEADERS = doxygen.h scanner.h classdef.h classlist.h memberdef.h \ membername.h index.h memberlist.h definition.h \ entry.h logos.h instdox.h message.h code.h \ diff --git a/src/doxytag.l b/src/doxytag.l index 4f9fac1..0c70dc6 100644 --- a/src/doxytag.l +++ b/src/doxytag.l @@ -251,7 +251,8 @@ QString unhtmlify(const char *str) } [a-z_A-Z0-9]+ { docAnchor = yytext; - if (docAnchor=="details") + if (docAnchor=="details" || + docAnchor=="_details") { docRefName=className.copy(); addReference(); diff --git a/src/entry.cpp b/src/entry.cpp index 2520fa3..51724ce 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -29,6 +29,8 @@ Entry::Entry() extends->setAutoDelete(TRUE); groups = new QList; groups->setAutoDelete(TRUE); + anchors = new QList; + anchors->setAutoDelete(TRUE); argList = new ArgumentList; argList->setAutoDelete(TRUE); //printf("Entry::Entry() tArgList=0\n"); @@ -66,6 +68,8 @@ Entry::Entry(const Entry &e) extends->setAutoDelete(TRUE); groups = new QList; groups->setAutoDelete(TRUE); + anchors = new QList; + anchors->setAutoDelete(TRUE); argList = new ArgumentList; argList->setAutoDelete(TRUE); //printf("Entry::Entry(copy) tArgList=0\n"); @@ -94,6 +98,12 @@ Entry::Entry(const Entry &e) { groups->append(new QString(*s)); } + + QListIterator sli2(*e.anchors); + for (;(s=sli2.current());++sli2) + { + anchors->append(new QString(*s)); + } // deep copy argument list QListIterator ali(*e.argList); @@ -128,6 +138,7 @@ Entry::~Entry() delete sublist; delete extends; delete groups; + delete anchors; delete argList; //printf("Entry::~Entry() tArgList=%p\n",tArgList); delete tArgList; @@ -177,6 +188,7 @@ void Entry::reset() sublist->clear(); extends->clear(); groups->clear(); + anchors->clear(); argList->clear(); if (tArgList) { delete tArgList; tArgList=0; } } @@ -211,6 +223,13 @@ int Entry::getSize() size+=s->length()+1; s=groups->next(); } + s=anchors->first(); + while (s) + { + size+=sizeof(QLNode); + size+=s->length()+1; + s=anchors->next(); + } Entry *e=sublist->first(); while (e) { diff --git a/src/entry.h b/src/entry.h index 40624d8..a302955 100644 --- a/src/entry.h +++ b/src/entry.h @@ -140,6 +140,7 @@ class Entry QList *sublist; // entries that are children of this one QList *extends; // list of base classes QList *groups; // list of groups this entry belongs to + QList *anchors; // list of anchors defined in this entry QString fileName; // file this entry was extracted from int startLine; // start line of entry in the source int num; diff --git a/src/filedef.cpp b/src/filedef.cpp index 54266a5..7921bf7 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -69,7 +69,7 @@ void FileDef::writeDocumentation(OutputList &ol) QString pageTitle=name()+" File Reference"; startFile(ol,diskname,pageTitle); startTitle(ol); - ol.docify(pageTitle); + parseText(ol,theTranslator->trFileReference(name())); endTitle(ol,name()); //ol.newParagraph(); @@ -86,8 +86,8 @@ void FileDef::writeDocumentation(OutputList &ol) ol+=briefOutput; ol.writeString(" \n"); ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(0,"details"); - parseDoc(ol,0,0,theTranslator->trMore()); + ol.startTextLink(0,"_details"); + parseText(ol,theTranslator->trMore()); ol.endTextLink(); ol.enableAll(); } @@ -96,6 +96,7 @@ void FileDef::writeDocumentation(OutputList &ol) ol.enable(OutputGenerator::Man); ol.writeSynopsis(); + ol.startMemberSections(); if (classList->count()>0) { ClassDef *cd=classList->first(); @@ -111,7 +112,7 @@ void FileDef::writeDocumentation(OutputList &ol) if (!found) { ol.startMemberHeader(); - parseDoc(ol,0,0,theTranslator->trCompounds()); + parseText(ol,theTranslator->trCompounds()); ol.endMemberHeader(); ol.startMemberList(); found=TRUE; @@ -124,10 +125,11 @@ void FileDef::writeDocumentation(OutputList &ol) case ClassDef::Union: ol.writeString("union"); break; } ol.writeString(" "); + ol.insertMemberAlign(); if (cd->hasDocumentation()) { ol.writeObjectLink(cd->getReference(), - cd->classFile(), + cd->getOutputFileBase(), 0, cd->name() ); @@ -146,6 +148,7 @@ void FileDef::writeDocumentation(OutputList &ol) } writeMemberDecs(ol,0,0,this,0,0,memList); + ol.endMemberSections(); //doc=doc.stripWhiteSpace(); //int bl=brief.length(); @@ -153,9 +156,12 @@ void FileDef::writeDocumentation(OutputList &ol) if (!briefDescription().isEmpty() || !documentation().isEmpty()) { ol.writeRuler(); - ol.writeAnchor("details"); + bool latexOn = ol.isEnabled(OutputGenerator::Latex); + if (latexOn) ol.disable(OutputGenerator::Latex); + ol.writeAnchor("_details"); + if (latexOn) ol.enable(OutputGenerator::Latex); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trDetailedDescription()); + parseText(ol,theTranslator->trDetailedDescription()); ol.endGroupHeader(); if (!briefDescription().isEmpty()) { @@ -177,7 +183,7 @@ void FileDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trDefineDocumentation()); + parseText(ol,theTranslator->trDefineDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Define); } @@ -186,7 +192,7 @@ void FileDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trFunctionPrototypeDocumentation()); + parseText(ol,theTranslator->trFunctionPrototypeDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Prototype); } @@ -195,7 +201,7 @@ void FileDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trTypedefDocumentation()); + parseText(ol,theTranslator->trTypedefDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Typedef); } @@ -204,7 +210,7 @@ void FileDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trEnumerationTypeDocumentation()); + parseText(ol,theTranslator->trEnumerationTypeDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Enumeration); } @@ -213,7 +219,7 @@ void FileDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trEnumerationValueDocumentation()); + parseText(ol,theTranslator->trEnumerationValueDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::EnumValue); } @@ -222,7 +228,7 @@ void FileDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trFunctionDocumentation()); + parseText(ol,theTranslator->trFunctionDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Function); } @@ -231,7 +237,7 @@ void FileDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trVariableDocumentation()); + parseText(ol,theTranslator->trVariableDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Variable); } @@ -239,9 +245,9 @@ void FileDef::writeDocumentation(OutputList &ol) // write Author section (Man only) ol.disableAllBut(OutputGenerator::Man); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trAuthor()); + parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseDoc(ol,0,0,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); ol.enableAll(); endFile(ol); } diff --git a/src/filedef.h b/src/filedef.h index 36ce9cb..ca95e20 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -62,7 +62,8 @@ class FileDef : public Definition } /*! Returns nameString with all slashes replaced by underscores. */ - const char *diskName() const { return diskname; } + //const char *diskName() const { return diskname; } + QString getOutputFileBase() const { return diskname; } /*! Returns the absolute path including the file name. */ QString absFilePath() const { return filepath; } diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 6a2d79b..924199e 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -90,20 +90,20 @@ void GroupDef::writeDocumentation(OutputList &ol) ol+=briefOutput; ol.writeString(" \n"); ol.disable(OutputGenerator::Latex); - ol.startTextLink(0,"details"); - parseDoc(ol,0,0,theTranslator->trMore()); + ol.startTextLink(0,"_details"); + parseText(ol,theTranslator->trMore()); ol.enable(OutputGenerator::Latex); } if (fileList->count()>0) { ol.startMemberHeader(); - parseDoc(ol,0,0,theTranslator->trFiles()); + parseText(ol,theTranslator->trFiles()); ol.endMemberHeader(); ol.startIndexList(); FileDef *fd=fileList->first(); while (fd) { - ol.writeStartAnnoItem("file ",fd->diskName(),0,fd->name()); + ol.writeStartAnnoItem("file ",fd->getOutputFileBase(),0,fd->name()); ol.writeEndAnnoItem(fd->name()); fd=fileList->next(); } @@ -112,7 +112,7 @@ void GroupDef::writeDocumentation(OutputList &ol) if (classList->count()>0) { ol.startMemberHeader(); - parseDoc(ol,0,0,theTranslator->trCompounds()); + parseText(ol,theTranslator->trCompounds()); ol.endMemberHeader(); ol.startIndexList(); ClassDef *cd=classList->first(); @@ -125,7 +125,7 @@ void GroupDef::writeDocumentation(OutputList &ol) case ClassDef::Struct: type="struct"; break; case ClassDef::Union: type="union"; break; } - ol.writeStartAnnoItem(type,cd->classFile(),0,cd->name()); + ol.writeStartAnnoItem(type,cd->getOutputFileBase(),0,cd->name()); ol.writeEndAnnoItem(cd->name()); cd=classList->next(); } @@ -136,9 +136,12 @@ void GroupDef::writeDocumentation(OutputList &ol) if (!briefDescription().isEmpty() || !documentation().isEmpty()) { ol.writeRuler(); - ol.writeAnchor("details"); + bool latexOn = ol.isEnabled(OutputGenerator::Latex); + if (latexOn) ol.disable(OutputGenerator::Latex); + ol.writeAnchor("_details"); + if (latexOn) ol.enable(OutputGenerator::Latex); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trDetailedDescription()); + parseText(ol,theTranslator->trDetailedDescription()); ol.endGroupHeader(); // repeat brief description if (!briefDescription().isEmpty()) diff --git a/src/groupdef.h b/src/groupdef.h index 421b701..a8bc562 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -35,7 +35,8 @@ class GroupDef : public Definition public: GroupDef(const char *name,const char *title); ~GroupDef(); - const char *groupFile() const { return fileName; } + //const char *groupFile() const { return fileName; } + QString getOutputFileBase() const { return fileName; } const char *groupTitle() const { return title; } void addFile(const FileDef *def); void addClass(const ClassDef *def); diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 4ab337f..8c5b50a 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -51,77 +51,10 @@ void HtmlGenerator::init() writeLogo(htmlOutputDir); } -//void HtmlGenerator::generateExternalIndex() -//{ -// //printf("Generating external index...\n"); -// QFile f; -// f.setName(htmlOutputDir+"/header.html"); -// if (f.open(IO_WriteOnly)) -// { -// QTextStream tt(&f); -// if (header.length()==0) -// { -// tt << "\n" -// "\n" -// "Doxysearch\n" -// "\n"; -// } -// else -// { -// tt << header; -// } -// if (!noIndexFlag) -// { -// tt << "
    "; -// if (documentedGroups>0) -// tt << "Modules   "; -// if (hierarchyClasses>0) -// tt << "Class hierarchy   "; -// if (annotatedClasses>0) -// tt << "Compound list   "; -// if (documentedFiles>0) -// tt << "File list   "; -// if (includeFiles.count()>0) -// tt << "Header files   "; -// if (documentedMembers>0) -// tt << "Compound Members   "; -// if (documentedFunctions>0) -// tt << "File Members   "; -// if (pageList.count()>0) -// tt << "Related Pages   "; -// if (exampleList.count()>0) -// tt << "Examples   "; -// if (searchEngineFlag) -// tt << "Search"; -// tt << endl << "

    " << endl; -// } -// } -// f.close(); -// -// f.setName(htmlOutputDir+"/footer.html"); -// if (f.open(IO_WriteOnly)) -// { -// QTextStream tt(&f); -// if (footer.length()==0) -// { -// tt << "
    Generated at " << dateToString(TRUE); -// if (projectName.length()>0) tt << " for " << projectName; -// tt << " by " -// "doxygen  written by Dimitri van Heesch, © " -// "1997-1999
    \n\n\n"; -// } -// else -// { -// tt << footer; -// } -// } -// f.close(); -//} - void HtmlGenerator::startFile(const char *name,const char *title,bool external) { QString fileName=name; + lastTitle=title; if (fileName.right(5)!=".html") fileName+=".html"; startPlainFile(fileName); if (header.length()==0) @@ -139,34 +72,14 @@ void HtmlGenerator::startFile(const char *name,const char *title,bool external) } else { - t << header; + t << substitute( + substitute( + substitute(header,"$title",lastTitle), + "$datetime",dateToString(TRUE) + ), + "$date",dateToString(FALSE) + ); } - -// if (!noIndexFlag) -// { -// t << "
    "; -// if (documentedGroups>0) -// t << "Modules   "; -// if (hierarchyClasses>0) -// t << "Class hierarchy   "; -// if (annotatedClasses>0) -// t << "Compound list   "; -// if (documentedFiles>0) -// t << "File list   "; -// if (includeFiles.count()>0) -// t << "Header files   "; -// if (documentedMembers>0) -// t << "Compound Members   "; -// if (documentedFunctions>0) -// t << "File Members   "; -// if (pageList.count()>0) -// t << "Related Pages   "; -// if (exampleList.count()>0) -// t << "Examples   "; -// if (searchEngineFlag) -// t << "Search"; -// t << endl << "

    " << endl; -// } } void HtmlGenerator::startQuickIndexItem(const char *s,const char *l) @@ -189,7 +102,13 @@ void HtmlGenerator::writeFooter(int part,bool external) if (footer.length()==0) t << "
    "; else - t << footer; + t << substitute( + substitute( + substitute(footer,"$title",lastTitle), + "$datetime",dateToString(TRUE) + ), + "$date",dateToString(FALSE) + ); break; case 1: if (footer.length()==0) @@ -219,24 +138,6 @@ void HtmlGenerator::writeFooter(int part,bool external) void HtmlGenerator::endFile() { -// if (footer.length()==0) -// { -// t << "
    Generated at " << dateToString(TRUE); -// if (projectName.length()>0) -// { -// t << " for "; -// docify(projectName); -// } -// t << " by " -// "\"doxygen\"  written by Dimitri van Heesch, © " -// "1997-1999
    \n\n\n"; -// } -// else -// { -// t << footer; -// } endPlainFile(); } @@ -250,45 +151,6 @@ void HtmlGenerator::endProjectNumber() t << "

    "; } -//void HtmlGenerator::writeIndex() -//{ -// startFile("index.html","Main Index"); -// t << "

    "; -// docify(projectName); -// t << " Documentation

    " -// << "

    " << endl << "

    " << endl; -// if (!projectNumber.isEmpty()) -// { -// t << "

    "; -// docify(projectNumber); -// t << "

    \n

    \n

    \n"; -// } -// if (noIndexFlag) -// { -// t << "

      " << endl; -// if (hierarchyClasses>0) -// t << "
    • Class hierarchy" << endl; -// if (annotatedClasses>0) -// t << "
    • Compound list" << endl; -// if (documentedFiles>0) -// t << "
    • File list" << endl; -// if (includeFiles.count()>0) -// t << "
    • Header files" << endl; -// if (documentedMembers>0) -// t << "
    • Compound Members" << endl; -// if (documentedFunctions>0) -// t << "
    • File Members" << endl; -// if (pageList.count()>0) -// t << "
    • Related Pages" << endl; -// if (exampleList.count()>0) -// t << "
    • Examples" << endl; -// if (searchEngineFlag) -// t << "
    • Search" << endl; -// t << "
    " << endl; -// } -// endFile(); -//} - void HtmlGenerator::writeStyleInfo(int part) { if (part==0) @@ -414,9 +276,9 @@ void HtmlGenerator::writeSectionRef(const char *name,const char *lab, { QString refName=name; if (refName.right(5)!=".html") refName+=".html"; - t << """; + t << ""; docify(title); - t << """; + t << ""; } void HtmlGenerator::writeSectionRefItem(const char *name,const char *lab, @@ -429,12 +291,12 @@ void HtmlGenerator::writeSectionRefItem(const char *name,const char *lab, t << ""; } -//void HtmlGenerator::docify(const char *str) -//{ -// docifyStatic(t,str); -//} +void HtmlGenerator::writeSectionRefAnchor(const char *name,const char *lab, + const char *title) +{ + writeSectionRef(name,lab,title); +} -//void HtmlGenerator::docifyStatic(QTextStream &t,const char *str) void HtmlGenerator::docify(const char *str) { if (str) @@ -510,3 +372,121 @@ void HtmlGenerator::writeFormula(const char *n,const char *text) t << "" << endl; if (text && text[0]=='\\') t << "

    " << endl; } + +void HtmlGenerator::startMemberList() +{ + if (htmlAlignMemberFlag) + { + //t << endl << "

    " << endl; + } + else + { + t << "
      " << endl; + } +} + +void HtmlGenerator::endMemberList() +{ + if (htmlAlignMemberFlag) + { + //t << "
    " << endl; + } + else + { + t << "" << endl; + } +} + +void HtmlGenerator::startMemberItem() +{ + if (htmlAlignMemberFlag) + { + t << ""; + } + else + { + t << "

  • "; + } +} + +void HtmlGenerator::insertMemberAlign() +{ + if (htmlAlignMemberFlag) + { + t << ""; + } +} + +void HtmlGenerator::endMemberItem() +{ + if (htmlAlignMemberFlag) + { + t << ""; + } + t << endl; +} + +void HtmlGenerator::startMemberDescription() +{ + if (htmlAlignMemberFlag) + { + t << ""; + } + else + { + t << "
    "; + } +} + +void HtmlGenerator::endMemberDescription() +{ + if (htmlAlignMemberFlag) + { + t << "

    " << endl; + } + else + { + t << "
    "; + } +} + +void HtmlGenerator::startMemberSections() +{ + if (htmlAlignMemberFlag) + { + t << "" << endl; + } +} + +void HtmlGenerator::endMemberSections() +{ + if (htmlAlignMemberFlag) + { + t << "
    " << endl; + } +} + +void HtmlGenerator::startMemberHeader() +{ + if (htmlAlignMemberFlag) + { + t << "

    "; + } + else + { + startGroupHeader(); + } +} + +void HtmlGenerator::endMemberHeader() +{ + if (htmlAlignMemberFlag) + { + t << "

    " << endl; + } + else + { + endGroupHeader(); + } +} + diff --git a/src/htmlgen.h b/src/htmlgen.h index c8a5223..556a334 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -81,18 +81,23 @@ class HtmlGenerator : public OutputGenerator void endGroupHeader(); void writeListItem() { t << "
  • "; } - void startMemberHeader() { startGroupHeader(); } - void endMemberHeader() { endGroupHeader(); } - void startMemberList() { t << "
      " << endl; } - void endMemberList() { t << "
    " << endl; } - void startMemberItem() { t << "
  • "; } - void endMemberItem() { t << endl; } + void startMemberSections(); + void endMemberSections(); + void startMemberHeader(); + void endMemberHeader(); + void startMemberList(); + void endMemberList(); + void startMemberItem(); + void insertMemberAlign(); + void endMemberItem(); + void startMemberDescription(); + void endMemberDescription(); void writeRuler() { t << "
    "; } void writeAnchor(const char *name) { t << ""; } void startCodeFragment() { t << "
    "; }
    -    void endCodeFragment()   { t << "
    "; } + void endCodeFragment() { t << ""; } void writeBoldString(const char *text) { t << ""; docify(text); t << ""; } void startEmphasis() { t << ""; } @@ -111,6 +116,7 @@ class HtmlGenerator : public OutputGenerator void writeDoxyAnchor(const char *clName,const char *anchor, const char *name); void writeLatexSpacing() {} + void writeLatexLabel(const char *,const char *) {} void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); void writeEndAnnoItem(const char *) { t << endl; } @@ -139,8 +145,6 @@ class HtmlGenerator : public OutputGenerator void writeGrave(char c) { t << "&" << c << "grave;"; } void writeCirc(char c) { t << "&" << c << "circ;"; } void writeTilde(char c) { t << "&" << c << "tilde;"; } - void startMemberDescription() { t << "
    "; } - void endMemberDescription() { t << "
    "; } void startDescList() { t << "
    " << endl; } void endDescTitle() {} void writeDescItem() { t << "
    " << endl; } @@ -148,6 +152,7 @@ class HtmlGenerator : public OutputGenerator void writeSection(const char *,const char *,bool); void writeSectionRef(const char *,const char *,const char *); void writeSectionRefItem(const char *,const char *,const char *); + void writeSectionRefAnchor(const char *,const char *,const char *); void addToIndex(const char *,const char *) {} void startIndent() { t << "
    " << endl; } void endIndent() { t << "
    " << endl; } @@ -166,6 +171,7 @@ class HtmlGenerator : public OutputGenerator private: QString header; QString footer; + QString lastTitle; HtmlGenerator &operator=(const HtmlGenerator &g); HtmlGenerator(const HtmlGenerator &g); diff --git a/src/index.cpp b/src/index.cpp index d472542..dcd457f 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -147,7 +147,7 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper) //printf("Passed...\n"); if (cd->hasDocumentation() || cd->isReference()) { - ol.writeIndexItem(cd->getReference(),cd->classFile(),cd->name()); + ol.writeIndexItem(cd->getReference(),cd->getOutputFileBase(),cd->name()); if (cd->isReference()) { ol.startTypewriter(); @@ -191,7 +191,7 @@ void writeClassHierarchy(OutputList &ol) } if (cd->hasDocumentation() || cd->isReference()) { - ol.writeIndexItem(cd->getReference(),cd->classFile(),cd->name()); + ol.writeIndexItem(cd->getReference(),cd->getOutputFileBase(),cd->name()); if (cd->isReference()) { ol.startTypewriter(); @@ -236,9 +236,9 @@ void writeHierarchicalIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"hierarchy","Hierarchical Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trClassHierarchy()); + parseText(ol,projectName+" "+theTranslator->trClassHierarchy()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trClassHierarchyDescription()); + parseText(ol,theTranslator->trClassHierarchyDescription()); ol.newParagraph(); writeClassHierarchy(ol); endFile(ol); @@ -247,7 +247,7 @@ void writeHierarchicalIndex(OutputList &ol) //---------------------------------------------------------------------------- -int countFileList() +int countFiles() { int count=0; FileNameListIterator fnli(inputNameList); @@ -272,10 +272,10 @@ void writeFileIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"files","File Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trFileList()); + parseText(ol,projectName+" "+theTranslator->trFileList()); endTitle(ol,0); ol.newParagraph(); - parseDoc(ol,0,0,theTranslator->trFileListDescription(extractAllFlag)); + parseText(ol,theTranslator->trFileListDescription(extractAllFlag)); ol.newParagraph(); ol.startIndexList(); @@ -299,7 +299,7 @@ void writeFileIndex(OutputList &ol) } ol.writeStartAnnoItem("file", - fd->diskName(), + fd->getOutputFileBase(), path, fd->name() ); @@ -314,7 +314,7 @@ void writeFileIndex(OutputList &ol) else { ol.startEmphasis(); - parseDoc(ol,0,0,theTranslator->trNoDescriptionAvailable()); + parseText(ol,theTranslator->trNoDescriptionAvailable()); ol.endEmphasis(); } ol.docify(")"); @@ -330,15 +330,14 @@ void writeFileIndex(OutputList &ol) } //---------------------------------------------------------------------------- - -int countNamespaceList() +int countNamespaces() { int count=0; NamespaceListIterator nli(namespaceList); NamespaceDef *nd; for (;(nd=nli.current());++nli) { - if (nd->hasDocumentation()) count++; + if (!nd->getReference() && nd->hasDocumentation()) count++; } return count; } @@ -351,19 +350,19 @@ void writeNamespaceIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"namespaces","Namespace Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trNamespaceList()); + parseText(ol,projectName+" "+theTranslator->trNamespaceList()); endTitle(ol,0); ol.newParagraph(); - parseDoc(ol,0,0,theTranslator->trNamespaceListDescription(extractAllFlag)); + parseText(ol,theTranslator->trNamespaceListDescription(extractAllFlag)); ol.newParagraph(); ol.startIndexList(); NamespaceDef *nd=namespaceList.first(); while (nd) { - if (nd->hasDocumentation()) + if (!nd->getReference() && nd->hasDocumentation()) { - ol.writeStartAnnoItem("namespace",nd->namespaceFile(),0,nd->name()); + ol.writeStartAnnoItem("namespace",nd->getOutputFileBase(),0,nd->name()); ol.docify(" ("); if (nd->briefDescription()) { @@ -375,7 +374,7 @@ void writeNamespaceIndex(OutputList &ol) else { ol.startEmphasis(); - parseDoc(ol,0,0,theTranslator->trNoDescriptionAvailable()); + parseText(ol,theTranslator->trNoDescriptionAvailable()); ol.endEmphasis(); } ol.docify(")"); @@ -433,7 +432,7 @@ void writeAnnotatedClassList(OutputList &ol) case ClassDef::Union: type="union"; break; default: type="unknown"; break; // an error } - ol.writeStartAnnoItem(type,cd->classFile(),0,cd->name()); + ol.writeStartAnnoItem(type,cd->getOutputFileBase(),0,cd->name()); ol.docify(" ("); if (cd->briefDescription()) { @@ -445,7 +444,7 @@ void writeAnnotatedClassList(OutputList &ol) else { ol.startEmphasis(); - parseDoc(ol,0,0,theTranslator->trNoDescriptionAvailable()); + parseText(ol,theTranslator->trNoDescriptionAvailable()); ol.endEmphasis(); } ol.docify(")"); @@ -466,9 +465,9 @@ void writeAnnotatedIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"annotated","Annotated Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trCompoundList()); + parseText(ol,projectName+" "+theTranslator->trCompoundList()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trCompoundListDescription()); + parseText(ol,theTranslator->trCompoundListDescription()); writeAnnotatedClassList(ol); endFile(ol); ol.enable(OutputGenerator::Man); @@ -522,7 +521,7 @@ void writeMemberList(OutputList &ol) ol.docify(": "); else ol.docify(", "); - ol.writeObjectLink(cd->getReference(),cd->classFile(),md->anchor(), + ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),md->anchor(), cd->name()); count++; prevName=cd->name(); @@ -537,7 +536,7 @@ void writeMemberList(OutputList &ol) //---------------------------------------------------------------------------- -int countMemberList() +int countClassMembers() { int count=0; MemberName *mn=memberNameList.first(); @@ -575,9 +574,9 @@ void writeMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"functions","Compound Member Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trCompoundMembers()); + parseText(ol,projectName+" "+theTranslator->trCompoundMembers()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trCompoundMembersDescription(extractAllFlag)); + parseText(ol,theTranslator->trCompoundMembersDescription(extractAllFlag)); writeMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -586,7 +585,7 @@ void writeMemberIndex(OutputList &ol) //---------------------------------------------------------------------------- -void writeFunctionList(OutputList &ol) +void writeFileMemberList(OutputList &ol) { ol.startItemList(); MemberName *mn=functionNameList.first(); @@ -639,7 +638,7 @@ void writeFunctionList(OutputList &ol) //if ((s=baseName.findRev("/"))!=-1) // baseName=baseName.right(baseName.length()-s-1); ol.writeObjectLink(fd->getReference(), - fd->diskName(),md->anchor(), baseName); + fd->getOutputFileBase(),md->anchor(), baseName); count++; prevName=fd->name(); } @@ -653,7 +652,89 @@ void writeFunctionList(OutputList &ol) //---------------------------------------------------------------------------- -int countFunctionList() +void writeNamespaceMemberList(OutputList &ol) +{ + ol.startItemList(); + MemberName *mn=functionNameList.first(); + while (mn) + { + MemberDef *md=mn->first(); + bool found=FALSE; + while (md && !found) + { + NamespaceDef *nd=md->getNamespace(); + if (nd && nd->hasDocumentation() && + !md->isReference() && + md->hasDocumentation() && + !md->name().isEmpty() && + md->name()[0]!='@') found=TRUE; + else + md=mn->next(); + } + if (found) // member is documented and in a documented namespace + { + ol.writeListItem(); + ol.docify(md->name()); + if (md->isFunction()) ol.docify("()"); + ol.writeString("\n"); + + int count=0; + md=mn->first(); + QString prevName; + while (md) + { + NamespaceDef *nd=md->getNamespace(); + if (nd && nd->hasDocumentation() && + !md->isReference() && + md->hasDocumentation() && + !md->name().isEmpty() && md->name()[0]!='@' + ) + { + if (count==0) + ol.docify(": "); + else + ol.docify(", "); + ol.writeObjectLink(nd->getReference(),nd->getOutputFileBase(), + md->anchor(),nd->name()); + count++; + } + md=mn->next(); + } + } + mn=functionNameList.next(); + } + ol.endItemList(); +} + +//---------------------------------------------------------------------------- + +int countNamespaceMembers() +{ + int count=0; + MemberName *mn=functionNameList.first(); + while (mn) + { + MemberDef *md=mn->first(); + bool found=FALSE; + while (md && !found) + { + if (md->getNamespace() && + !md->isReference() && md->hasDocumentation() && + !md->name().isEmpty() && md->name()[0]!='@' + ) + found=TRUE; + else + md=mn->next(); + } + if (found) count++; + mn=functionNameList.next(); + } + return count; +} + +//---------------------------------------------------------------------------- + +int countFileMembers() { int count=0; MemberName *mn=functionNameList.first(); @@ -665,7 +746,7 @@ int countFunctionList() while (md && !found) { if (!md->isReference() && md->hasDocumentation() && - md->name()[0]!='@' && + !md->name().isEmpty() && md->name()[0]!='@' && (((fd=md->getFileDef()) && fd->hasDocumentation()) || ((fd=md->getFileDec()) && fd->hasDocumentation()) @@ -683,17 +764,35 @@ int countFunctionList() //---------------------------------------------------------------------------- -void writeFunctionIndex(OutputList &ol) +void writeFileMemberIndex(OutputList &ol) { if (documentedFunctions==0) return; ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); startFile(ol,"globals","File Member Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trFileMembers()); + parseText(ol,projectName+" "+theTranslator->trFileMembers()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trFileMembersDescription(extractAllFlag)); - writeFunctionList(ol); + parseText(ol,theTranslator->trFileMembersDescription(extractAllFlag)); + writeFileMemberList(ol); + endFile(ol); + ol.enable(OutputGenerator::Latex); + ol.enable(OutputGenerator::Man); +} + +//---------------------------------------------------------------------------- + +void writeNamespaceMemberIndex(OutputList &ol) +{ + if (documentedNamespaceMembers==0) return; + ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Latex); + startFile(ol,"namespacemembers","Namespace Member Index"); + startTitle(ol); + parseText(ol,projectName+" "+theTranslator->trNamespaceMembers()); + endTitle(ol,0); + parseText(ol,theTranslator->trNamespaceMemberDescription(extractAllFlag)); + writeNamespaceMemberList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); ol.enable(OutputGenerator::Man); @@ -736,9 +835,9 @@ void writeHeaderIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); startFile(ol,"headers","Header File Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trHeaderFiles()); + parseText(ol,projectName+" "+theTranslator->trHeaderFiles()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trHeaderFilesDescription()); + parseText(ol,theTranslator->trHeaderFilesDescription()); writeHeaderFileList(ol); endFile(ol); ol.enable(OutputGenerator::Latex); @@ -753,9 +852,9 @@ void writeExampleIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"examples","Example Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trExamples()); + parseText(ol,projectName+" "+theTranslator->trExamples()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trExamplesDescription()); + parseText(ol,theTranslator->trExamplesDescription()); ol.startIndexList(); PageInfo *pi=exampleList.first(); while (pi) @@ -788,18 +887,25 @@ void writePageIndex(OutputList &ol) startTitle(ol); ol.docify(projectName+" "+theTranslator->trRelatedPages()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trRelatedPagesDescription()); + parseText(ol,theTranslator->trRelatedPagesDescription()); ol.startIndexList(); PageInfo *pi=pageList.first(); while (pi) { - QString pageName; + QString pageName,pageTitle; + if (caseSensitiveNames) pageName=pi->name.copy(); else pageName=pi->name.lower(); + + if (pi->title.isEmpty()) + pageTitle=pi->name; + else + pageTitle=pi->title; + ol.writeListItem(); - ol.writeObjectLink(0,pageName,0,pi->name); + ol.writeObjectLink(0,pageName,0,pageTitle); ol.writeString("\n"); pi=pageList.next(); } @@ -810,7 +916,7 @@ void writePageIndex(OutputList &ol) //---------------------------------------------------------------------------- -int countGroupList() +int countGroups() { int count=0; GroupListIterator gli(groupList); @@ -835,7 +941,7 @@ void writeGroupList(OutputList &ol) if (gd->countMembers()>0) { ol.startDescItem(); - ol.startTextLink(gd->groupFile(),0); + ol.startTextLink(gd->getOutputFileBase(),0); parseDoc(ol,0,0,gd->groupTitle()); ol.endTextLink(); ol.endDescItem(); @@ -854,9 +960,9 @@ void writeGroupIndex(OutputList &ol) ol.disable(OutputGenerator::Man); startFile(ol,"modules","Module Index"); startTitle(ol); - parseDoc(ol,0,0,projectName+" "+theTranslator->trModules()); + parseText(ol,projectName+" "+theTranslator->trModules()); endTitle(ol,0); - parseDoc(ol,0,0,theTranslator->trModulesDescription()); + parseText(ol,theTranslator->trModulesDescription()); writeGroupList(ol); endFile(ol); ol.enable(OutputGenerator::Man); @@ -880,7 +986,7 @@ void writeIndex(OutputList &ol) ol.startFile("index","Main Index",FALSE); if (!noIndexFlag) writeQuickLinks(ol,TRUE); ol.startTitleHead(); - parseDoc(ol,0,0,projPrefix+theTranslator->trDocumentation()); + parseText(ol,projPrefix+theTranslator->trDocumentation()); ol.endTitleHead(0); ol.newParagraph(); if (!projectNumber.isEmpty()) @@ -897,7 +1003,7 @@ void writeIndex(OutputList &ol) ol.enable(OutputGenerator::Latex); ol.startFile("refman",0,FALSE); ol.startIndexSection(isTitlePageStart); - parseDoc(ol,0,0,projPrefix+theTranslator->trReferenceManual()); + parseText(ol,projPrefix+theTranslator->trReferenceManual()); if (!projectNumber.isEmpty()) { ol.startProjectNumber(); @@ -906,60 +1012,72 @@ void writeIndex(OutputList &ol) } ol.endIndexSection(isTitlePageStart); ol.startIndexSection(isTitlePageAuthor); - parseDoc(ol,0,0,theTranslator->trGeneratedBy()); + parseText(ol,theTranslator->trGeneratedBy()); ol.endIndexSection(isTitlePageAuthor); if (documentedGroups>0) { ol.startIndexSection(isModuleIndex); - parseDoc(ol,0,0,projPrefix+theTranslator->trModuleIndex()); + parseText(ol,projPrefix+theTranslator->trModuleIndex()); ol.endIndexSection(isModuleIndex); } + if (documentedNamespaces>0) + { + ol.startIndexSection(isNamespaceIndex); + parseText(ol,projPrefix+theTranslator->trNamespaceIndex()); + ol.endIndexSection(isNamespaceIndex); + } if (hierarchyClasses>0) { ol.startIndexSection(isClassHierarchyIndex); - parseDoc(ol,0,0,projPrefix+theTranslator->trHierarchicalIndex()); + parseText(ol,projPrefix+theTranslator->trHierarchicalIndex()); ol.endIndexSection(isClassHierarchyIndex); } if (annotatedClasses>0) { ol.startIndexSection(isCompoundIndex); - parseDoc(ol,0,0,projPrefix+theTranslator->trCompoundIndex()); + parseText(ol,projPrefix+theTranslator->trCompoundIndex()); ol.endIndexSection(isCompoundIndex); } if (documentedFiles>0) { ol.startIndexSection(isFileIndex); - parseDoc(ol,0,0,projPrefix+theTranslator->trFileIndex()); + parseText(ol,projPrefix+theTranslator->trFileIndex()); ol.endIndexSection(isFileIndex); } if (documentedGroups>0) { ol.startIndexSection(isModuleDocumentation); - parseDoc(ol,0,0,projPrefix+theTranslator->trModuleDocumentation()); + parseText(ol,projPrefix+theTranslator->trModuleDocumentation()); ol.endIndexSection(isModuleDocumentation); } + if (documentedNamespaces>0) + { + ol.startIndexSection(isNamespaceDocumentation); + parseText(ol,projPrefix+theTranslator->trNamespaceDocumentation()); + ol.endIndexSection(isNamespaceDocumentation); + } if (annotatedClasses>0) { ol.startIndexSection(isClassDocumentation); - parseDoc(ol,0,0,projPrefix+theTranslator->trClassDocumentation()); + parseText(ol,projPrefix+theTranslator->trClassDocumentation()); ol.endIndexSection(isClassDocumentation); } if (documentedFiles>0) { ol.startIndexSection(isFileDocumentation); - parseDoc(ol,0,0,projPrefix+theTranslator->trFileDocumentation()); + parseText(ol,projPrefix+theTranslator->trFileDocumentation()); ol.endIndexSection(isFileDocumentation); } if (exampleList.count()>0) { ol.startIndexSection(isExampleDocumentation); - parseDoc(ol,0,0,projPrefix+theTranslator->trExampleDocumentation()); + parseText(ol,projPrefix+theTranslator->trExampleDocumentation()); ol.endIndexSection(isExampleDocumentation); } if (pageList.count()>0) { ol.startIndexSection(isPageDocumentation); - parseDoc(ol,0,0,projPrefix+theTranslator->trPageDocumentation()); + parseText(ol,projPrefix+theTranslator->trPageDocumentation()); ol.endIndexSection(isPageDocumentation); } ol.endIndexSection(isEndIndex); diff --git a/src/index.h b/src/index.h index 5b3cc67..0091f6a 100644 --- a/src/index.h +++ b/src/index.h @@ -25,10 +25,12 @@ enum IndexSections isTitlePageStart, isTitlePageAuthor, isModuleIndex, + isNamespaceIndex, isClassHierarchyIndex, isCompoundIndex, isFileIndex, isModuleDocumentation, + isNamespaceDocumentation, isClassDocumentation, isFileDocumentation, isExampleDocumentation, @@ -50,16 +52,18 @@ void writeHeaderIndex(OutputList &ol); void writeHeaderFileList(OutputList &ol); void writeExampleIndex(OutputList &ol); void writePageIndex(OutputList &ol); -void writeFunctionIndex(OutputList &ol); +void writeFileMemberIndex(OutputList &ol); void writeGroupIndex(OutputList &ol); void writeNamespaceIndex(OutputList &ol); +void writeNamespaceMemberIndex(OutputList &ol); int countClassHierarchy(); -int countMemberList(); -int countFunctionList(); -int countFileList(); -int countGroupList(); -int countNamespaceList(); +int countClassMembers(); +int countFileMembers(); +int countFiles(); +int countGroups(); +int countNamespaces(); int countAnnotatedClasses(); +int countNamespaceMembers(); #endif diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 50ec496..2f2f62b 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -172,6 +172,10 @@ void LatexGenerator::startIndexSection(IndexSections is) if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Module Index}\n" break; + case isNamespaceIndex: + if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + t << "{"; //Namespace Index}\" + break; case isClassHierarchyIndex: if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; t << "{"; //Hierarchical Index}\n" @@ -200,17 +204,28 @@ void LatexGenerator::startIndexSection(IndexSections is) } } break; + case isNamespaceDocumentation: + { + NamespaceDef *nd=namespaceList.first(); + bool found=FALSE; + while (nd && !found) + { + if (nd->hasDocumentation()) + { + if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; + t << "{"; // Namespace Documentation}\n": + found=TRUE; + } + nd=namespaceList.next(); + } + } + break; case isClassDocumentation: { ClassDef *cd=classList.first(); bool found=FALSE; while (cd && !found) { - //if (cd->classFile()[0]!='@' && !cd->getReference() && - // (cd->hasDocumentation() || !hideClassFlag) && - // (cd->protection()!=Private || extractPrivateFlag) - // ) - if (!cd->isReference() && cd->isVisible()) { if (compactLatexFlag) t << "\\section"; else t << "\\chapter"; @@ -282,6 +297,9 @@ void LatexGenerator::endIndexSection(IndexSections is) case isModuleIndex: t << "}\n\\input{modules}\n"; break; + case isNamespaceIndex: + t << "}\n\\input{namespaces}\n"; + break; case isClassHierarchyIndex: t << "}\n\\input{hierarchy}\n"; break; @@ -299,7 +317,7 @@ void LatexGenerator::endIndexSection(IndexSections is) { if (gd->hasDocumentation() || gd->countMembers()>0) { - t << "}\n\\input{" << gd->groupFile() << "}\n"; + t << "}\n\\input{" << gd->getOutputFileBase() << "}\n"; found=TRUE; } gd=groupList.next(); @@ -309,12 +327,36 @@ void LatexGenerator::endIndexSection(IndexSections is) if (gd->hasDocumentation() || gd->countMembers()>0) { if (compactLatexFlag) t << "\\input"; else t << "\\include"; - t << "{" << gd->groupFile() << "}\n"; + t << "{" << gd->getOutputFileBase() << "}\n"; } gd=groupList.next(); } } break; + case isNamespaceDocumentation: + { + NamespaceDef *nd=namespaceList.first(); + bool found=FALSE; + while (nd && !found) + { + if (nd->hasDocumentation() || nd->countMembers()>0) + { + t << "}\n\\input{" << nd->getOutputFileBase() << "}\n"; + found=TRUE; + } + nd=namespaceList.next(); + } + while (nd) + { + if (nd->hasDocumentation() || nd->countMembers()>0) + { + if (compactLatexFlag) t << "\\input"; else t << "\\include"; + t << "{" << nd->getOutputFileBase() << "}\n"; + } + nd=namespaceList.next(); + } + } + break; case isClassDocumentation: { ClassDef *cd=classList.first(); @@ -327,7 +369,7 @@ void LatexGenerator::endIndexSection(IndexSections is) // ) if (!cd->isReference() && cd->isVisible()) { - t << "}\n\\input{" << cd->classFile() << "}\n"; + t << "}\n\\input{" << cd->getOutputFileBase() << "}\n"; found=TRUE; } cd=classList.next(); @@ -341,7 +383,7 @@ void LatexGenerator::endIndexSection(IndexSections is) if (!cd->isReference() && cd->isVisible()) { if (compactLatexFlag) t << "\\input"; else t << "\\include"; - t << "{" << cd->classFile() << "}\n"; + t << "{" << cd->getOutputFileBase() << "}\n"; } cd=classList.next(); } @@ -360,13 +402,13 @@ void LatexGenerator::endIndexSection(IndexSections is) { if (isFirst) { - t << "}\n\\input{" << fd->diskName() << "}\n"; + t << "}\n\\input{" << fd->getOutputFileBase() << "}\n"; isFirst=FALSE; } else { if (compactLatexFlag) t << "\\input" ; else t << "\\include"; - t << "{" << fd->diskName() << "}\n"; + t << "{" << fd->getOutputFileBase() << "}\n"; } } fd=fn->next(); @@ -670,6 +712,11 @@ void LatexGenerator::writeDoxyAnchor(const char *clname,const char *anchor,const t << "}" << endl; } +void LatexGenerator::writeLatexLabel(const char *clName,const char *anchor) +{ + writeDoxyAnchor(clName,anchor,0); +} + void LatexGenerator::addToIndex(const char *s1,const char *s2) { if (s1) @@ -709,6 +756,15 @@ void LatexGenerator::writeSectionRefItem(const char *,const char *lab, t << "}{\\ref{" << lab << "}}" << endl; } +void LatexGenerator::writeSectionRefAnchor(const char *,const char *lab, + const char *title) +{ + startBold(); + docify(title); + endBold(); + t << " (p. \\pageref{" << lab << "})" << endl; +} + //void LatexGenerator::docify(const char *str) //{ // docifyStatic(t,str); diff --git a/src/latexgen.h b/src/latexgen.h index 5a3dd1c..5cabe66 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -79,17 +79,20 @@ class LatexGenerator : public OutputGenerator void endGroupHeader(); void writeListItem() { t << "\\item " << endl; } + void startMemberSections() {} + void endMemberSections() {} void startMemberHeader() { startGroupHeader(); } void endMemberHeader() { endGroupHeader(); } void startMemberList() { t << "\\begin{CompactItemize}" << endl; } void endMemberList() { t << "\\end{CompactItemize}" << endl; } void startMemberItem() { t << "\\item " << endl; } void endMemberItem() { t << endl; } + void insertMemberAlign() {} void writeRuler() { t << "\\vspace{0.4cm}\\hrule\\vspace{0.2cm}"; } - void writeAnchor(const char *) {} + void writeAnchor(const char *name) { t << "\\label{" << name << "}" << endl; } void startCodeFragment() { t << "\\small\\begin{verbatim}"; } - void endCodeFragment() { t << "\\end{verbatim}\\normalsize "; } + void endCodeFragment() { t << "\\end{verbatim}\\normalsize " << endl; } void writeBoldString(const char *text) { t << "{\\bf "; docify(text); t << "}"; } void startEmphasis() { t << "{\\em "; } @@ -99,13 +102,14 @@ class LatexGenerator : public OutputGenerator void startDescription() { t << "\\begin{description}" << endl; } void endDescription() { t << "\\end{description}" << endl; } void startDescItem() { t << "\\item["; } - void endDescItem() { t << "]"; } + void endDescItem() { t << "]" << endl; } void lineBreak() { t << "\\par\n"; } void startMemberDoc(const char *,const char *,const char *); void endMemberDoc() { t << "}"; } void writeDoxyAnchor(const char *,const char *,const char *); void writeChar(char c); void writeLatexSpacing() { t << "\\hspace{0.3cm}"; } + void writeLatexLabel(const char *scope,const char *anchor); void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); void writeEndAnnoItem(const char *name); @@ -148,11 +152,12 @@ class LatexGenerator : public OutputGenerator void endMemberDescription() { t << "\\item\\end{CompactList}"; } void startDescList() { t << "\\begin{Desc}\\item["; } void endDescTitle() { t << "]"; } - void writeDescItem() { t << "\\par "; } + void writeDescItem() { t << "\\par" << endl; } void endDescList() { t << "\\end{Desc}"; } void writeSection(const char *,const char *,bool); void writeSectionRef(const char *,const char *,const char *); void writeSectionRefItem(const char *,const char *,const char *); + void writeSectionRefAnchor(const char *,const char *,const char *); void addToIndex(const char *,const char *); void startIndent() {} void endIndent() {} diff --git a/src/mangen.cpp b/src/mangen.cpp index 55bf8c7..d1bc4c6 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -78,7 +78,7 @@ void ManGenerator::startFile(const char *name,const char *,bool) { fileName=fileName.left(i); } - if (fileName.right(2)!=".3") fileName+=".3"; + if (fileName.right(2)!=manExtension) fileName+=manExtension; startPlainFile(fileName); firstCol=TRUE; } diff --git a/src/mangen.h b/src/mangen.h index d091782..bcc9034 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -77,8 +77,11 @@ class ManGenerator : public OutputGenerator void endTypewriter() { t << "\\fR"; firstCol=FALSE; } void startGroupHeader(); void endGroupHeader(); + void startMemberSections() {} + void endMemberSections() {} void startMemberHeader(); void endMemberHeader(); + void insertMemberAlign() {} void writeListItem(); void startMemberList() { t << "\n.in +1c"; firstCol=FALSE; } void endMemberList() { t << "\n.in -1c"; firstCol=FALSE; } @@ -107,6 +110,7 @@ class ManGenerator : public OutputGenerator void endMemberDoc() {} void writeDoxyAnchor(const char *clName,const char *anchor,const char *name); void writeLatexSpacing() {} + void writeLatexLabel(const char *,const char *) {} void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); void writeEndAnnoItem(const char *) { t << endl; firstCol=TRUE; } @@ -144,6 +148,7 @@ class ManGenerator : public OutputGenerator void writeSection(const char *,const char *,bool) {} void writeSectionRef(const char *,const char *,const char *) {} void writeSectionRefItem(const char *,const char *,const char *) {} + void writeSectionRefAnchor(const char *,const char *,const char *) {} void addToIndex(const char *,const char *) {} void startIndent() {} void endIndent() {} diff --git a/src/memberdef.cpp b/src/memberdef.cpp index f96a2d6..bd440c3 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -20,6 +20,7 @@ #include "membername.h" #include "doxygen.h" #include "util.h" +#include "message.h" /*! Creates a new member definition. * Members can be function/variables/enums/etc. inside a class or inside a @@ -159,7 +160,7 @@ bool MemberDef::hasExamples() return exampleList->count()>0; } - +#if 0 void MemberDef::writeExample(OutputList &ol) { Example *e=exampleList->first(); @@ -177,4 +178,27 @@ void MemberDef::writeExample(OutputList &ol) } ol.writeString("."); } +#endif +QString MemberDef::getOutputFileBase() const +{ + if (classDef) + { + return classDef->getOutputFileBase(); + } + else if (fileDef) + { + return fileDef->getOutputFileBase(); + } + else if (fileDec) + { + return fileDec->getOutputFileBase(); + } + else if (nspace) + { + return nspace->getOutputFileBase(); + } + warn("Warning: Internal inconsistency: member %s does not belong to any\n" + " container!\n",name().data()); + return "dummy"; +} diff --git a/src/memberdef.h b/src/memberdef.h index fba76f8..67a9aa9 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -55,6 +55,7 @@ class MemberDef : public Definition const ArgumentList *al); ~MemberDef(); + QString getOutputFileBase() const; const char *declaration() const { return decl; } const char *definition() const { return def; } const char *typeString() const { return type; } @@ -72,6 +73,7 @@ class MemberDef : public Definition void setFileDef(FileDef *fd) { fileDef=fd; } void setFileDec(FileDef *fd) { fileDec=fd; } void setAnchor(const char *a) { ref=a; } + void setProtection(Protection p) { prot=p; } FileDef *getFileDef() { return fileDef; } FileDef *getFileDec() { return fileDec; } void setMemberClass(ClassDef *cd) { classDef=cd; } @@ -105,8 +107,9 @@ class MemberDef : public Definition // example related members bool addExample(const char *anchor,const char *name,const char *file); - void writeExample(OutputList &ol); + //void writeExample(OutputList &ol); bool hasExamples(); + ExampleList *getExampleList() const { return exampleList; } // prototype related members const char *getDefFile() { return defFile; } diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 4d7cc73..e9fa8b0 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -43,7 +43,10 @@ void MemberList::countDecMembers() if ((!hideMemberFlag || md->hasDocumentation()) && (!hideMemberFlag || !md->documentation().isEmpty() || briefMemDescFlag || repeatBriefFlag - ) || extractAllFlag + ) || extractAllFlag || + (md->isEnumerate() && + md->hasDocumentedEnumValues() + ) ) { switch(md->memberType()) diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 9d055b2..bde86c6 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -22,12 +22,14 @@ #include "classdef.h" #include "classlist.h" #include "memberlist.h" +#include "doxygen.h" -NamespaceDef::NamespaceDef(const char *name) : Definition(name) +NamespaceDef::NamespaceDef(const char *name,const char *ref) : Definition(name) { fileName="namespace_"+nameToFile(name); classList = new ClassList; memList = new MemberList; + reference=ref; } NamespaceDef::~NamespaceDef() @@ -61,18 +63,21 @@ void NamespaceDef::writeDocumentation(OutputList &ol) QString pageTitle=name()+" Namespace Reference"; startFile(ol,fileName,pageTitle); startTitle(ol); - ol.docify(pageTitle); + //ol.docify(pageTitle); + parseText(ol,theTranslator->trNamespaceReference(name())); endTitle(ol,name()); + if (genTagFile.length()>0) tagFile << "%" << name() << ":\n"; + OutputList briefOutput(&ol); if (briefDescription()) { - parseDoc(briefOutput,0,0,briefDescription()); + parseDoc(briefOutput,name(),0,briefDescription()); ol+=briefOutput; ol.writeString(" \n"); ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(0,"details"); - parseDoc(ol,0,0,theTranslator->trMore()); + ol.startTextLink(0,"_details"); + parseText(ol,theTranslator->trMore()); ol.endTextLink(); ol.enableAll(); } @@ -81,6 +86,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ol.enable(OutputGenerator::Man); ol.writeSynopsis(); + ol.startMemberSections(); if (classList->count()>0) { ClassDef *cd=classList->first(); @@ -92,7 +98,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) if (!found) { ol.startMemberHeader(); - parseDoc(ol,0,0,theTranslator->trCompounds()); + parseText(ol,theTranslator->trCompounds()); ol.endMemberHeader(); ol.startMemberList(); found=TRUE; @@ -111,13 +117,14 @@ void NamespaceDef::writeDocumentation(OutputList &ol) case ClassDef::Union: ol.writeString("union"); break; } ol.writeString(" "); + ol.insertMemberAlign(); if (cd->hasDocumentation()) { ol.writeObjectLink(cd->getReference(), - cd->classFile(), - 0, - clName - ); + cd->getOutputFileBase(), + 0, + clName + ); } else { @@ -133,13 +140,17 @@ void NamespaceDef::writeDocumentation(OutputList &ol) } writeMemberDecs(ol,0,this,0,0,0,memList); + ol.endMemberSections(); if (!briefDescription().isEmpty() || !documentation().isEmpty()) { ol.writeRuler(); - ol.writeAnchor("details"); + bool latexOn = ol.isEnabled(OutputGenerator::Latex); + if (latexOn) ol.disable(OutputGenerator::Latex); + ol.writeAnchor("_details"); + if (latexOn) ol.enable(OutputGenerator::Latex); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trDetailedDescription()); + parseText(ol,theTranslator->trDetailedDescription()); ol.endGroupHeader(); if (!briefDescription().isEmpty()) { @@ -148,7 +159,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) } if (!documentation().isEmpty()) { - parseDoc(ol,0,0,documentation()+"\n"); + parseDoc(ol,name(),0,documentation()+"\n"); ol.newParagraph(); } } @@ -159,7 +170,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trFunctionPrototypeDocumentation()); + parseText(ol,theTranslator->trFunctionPrototypeDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Prototype); } @@ -168,7 +179,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trTypedefDocumentation()); + parseText(ol,theTranslator->trTypedefDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Typedef); } @@ -177,7 +188,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trEnumerationTypeDocumentation()); + parseText(ol,theTranslator->trEnumerationTypeDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Enumeration); } @@ -186,7 +197,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trEnumerationValueDocumentation()); + parseText(ol,theTranslator->trEnumerationValueDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::EnumValue); } @@ -195,7 +206,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trFunctionDocumentation()); + parseText(ol,theTranslator->trFunctionDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Function); } @@ -204,7 +215,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { ol.writeRuler(); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trVariableDocumentation()); + parseText(ol,theTranslator->trVariableDocumentation()); ol.endGroupHeader(); writeMemberDocs(ol,memList,name(),MemberDef::Variable); } @@ -212,9 +223,15 @@ void NamespaceDef::writeDocumentation(OutputList &ol) // write Author section (Man only) ol.disableAllBut(OutputGenerator::Man); ol.startGroupHeader(); - parseDoc(ol,0,0,theTranslator->trAuthor()); + parseText(ol,theTranslator->trAuthor()); ol.endGroupHeader(); - parseDoc(ol,0,0,theTranslator->trGeneratedAutomatically(projectName)); + parseText(ol,theTranslator->trGeneratedAutomatically(projectName)); ol.enableAll(); endFile(ol); } + +int NamespaceDef::countMembers() +{ + memList->countDocMembers(); + return memList->totalCount()+classList->count(); +} diff --git a/src/namespacedef.h b/src/namespacedef.h index 9da6b2c..f888f43 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -31,16 +31,20 @@ class MemberDef; class NamespaceDef : public Definition { public: - NamespaceDef(const char *name); + NamespaceDef(const char *name,const char *ref=0); ~NamespaceDef(); - QString namespaceFile() const { return fileName; } + //QString namespaceFile() const { return fileName; } + QString getOutputFileBase() const { return fileName; } void insertUsedFile(const char *fname); void writeDocumentation(OutputList &ol); void insertClass(ClassDef *cd); void insertMember(MemberDef *md); void computeAnchors(); + int countMembers(); + const char *getReference() { return reference; } private: + QString reference; QString fileName; QStrList files; ClassList *classList; diff --git a/src/outputgen.h b/src/outputgen.h index 457dd80..5b9f981 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -84,12 +84,15 @@ class OutputGenerator virtual void endGroupHeader() = 0; virtual void writeListItem() = 0; + virtual void startMemberSections() = 0; + virtual void endMemberSections() = 0; virtual void startMemberHeader() = 0; virtual void endMemberHeader() = 0; virtual void startMemberList() = 0; virtual void endMemberList() = 0; virtual void startMemberItem() = 0; virtual void endMemberItem() = 0; + virtual void insertMemberAlign() = 0; virtual void writeRuler() = 0; virtual void writeAnchor(const char *name) = 0; @@ -103,6 +106,7 @@ class OutputGenerator virtual void endMemberDoc() = 0; virtual void writeDoxyAnchor(const char *clName,const char *anchor,const char *name) = 0; virtual void writeLatexSpacing() = 0; + virtual void writeLatexLabel(const char *clName,const char *anchor) = 0; virtual void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name) = 0; virtual void writeEndAnnoItem(const char *name) = 0; @@ -144,6 +148,7 @@ class OutputGenerator virtual void writeSection(const char *,const char *,bool) = 0; virtual void writeSectionRef(const char *,const char *,const char *) = 0; virtual void writeSectionRefItem(const char *,const char *,const char *) = 0; + virtual void writeSectionRefAnchor(const char *,const char *,const char *) = 0; virtual void lineBreak() = 0; virtual void addToIndex(const char *s1,const char *s2) = 0; virtual void startIndent() = 0; diff --git a/src/outputlist.h b/src/outputlist.h index 2c57dad..6f73271 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -129,6 +129,10 @@ class OutputList { forall(&OutputGenerator::endGroupHeader); } void writeListItem() { forall(&OutputGenerator::writeListItem); } + void startMemberSections() + { forall(&OutputGenerator::startMemberSections); } + void endMemberSections() + { forall(&OutputGenerator::endMemberSections); } void startMemberHeader() { forall(&OutputGenerator::startMemberHeader); } void endMemberHeader() @@ -141,6 +145,8 @@ class OutputList { forall(&OutputGenerator::startMemberItem); } void endMemberItem() { forall(&OutputGenerator::endMemberItem); } + void insertMemberAlign() + { forall(&OutputGenerator::insertMemberAlign); } void writeRuler() { forall(&OutputGenerator::writeRuler); } void writeAnchor(const char *name) @@ -165,6 +171,8 @@ class OutputList { forall(&OutputGenerator::writeDoxyAnchor,clName,anchor,name); } void writeLatexSpacing() { forall(&OutputGenerator::writeLatexSpacing); } + void writeLatexLabel(const char *scope,const char *anchor) + { forall(&OutputGenerator::writeLatexLabel,scope,anchor); } void startDescription() { forall(&OutputGenerator::startDescription); } void endDescription() @@ -251,6 +259,8 @@ class OutputList { forall(&OutputGenerator::writeSectionRef,page,lab,title); } void writeSectionRefItem(const char *page,const char *lab, const char *title) { forall(&OutputGenerator::writeSectionRefItem,page,lab,title); } + void writeSectionRefAnchor(const char *page,const char *lab, const char *title) + { forall(&OutputGenerator::writeSectionRefAnchor,page,lab,title); } void addToIndex(const char *s1,const char *s2) { forall(&OutputGenerator::addToIndex,s1,s2); } void writeSynopsis() diff --git a/src/pre.l b/src/pre.l index 92f7553..bc74cf1 100644 --- a/src/pre.l +++ b/src/pre.l @@ -1160,11 +1160,11 @@ BN [ \t\r\n] . [^/\n]+ . -"//" { +"//" { lastCPPContext=YY_START; BEGIN(RemoveCPPComment); } -"/*" { +"/*" { lastCContext=YY_START; BEGIN(RemoveCComment); } diff --git a/src/scanner.h b/src/scanner.h index 59d5966..acebd5f 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -31,4 +31,5 @@ extern void parseDoc(OutputList &ol,const char *clName, const char *memName, const QString &docString); extern void parseExample(OutputList &ol,const QString &docString, const char *fileName); +extern void parseText(OutputList &ol,const QString &txtString); #endif diff --git a/src/scanner.l b/src/scanner.l index 0beadae..9737ff1 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -76,6 +76,7 @@ static int lastCodeState; static int lastAfterDocContext; static int lastGroupContext; static int lastFormulaContext; +static int lastAnchorContext; static int nextDefContext; static Protection protection; static Protection baseProt; @@ -120,7 +121,8 @@ static char afterDocTerminator; static int tmpDocType; static QString sectionLabel; static QString sectionTitle; -static bool isSubsection; +static SectionInfo::SectionType + sectionType; static QString funcPtrType; static QString templateStr; static QString baseName; @@ -184,7 +186,6 @@ static void initParser() inParBlock = FALSE; firstSeeArg = FALSE; javaDocSee = FALSE; - isSubsection = FALSE; } //----------------------------------------------------------------------------- @@ -532,12 +533,19 @@ static void addSection() { //printf("New section pageName=%s label=%s title=%s\n", // current->name.data(),sectionLabel.data(),sectionTitle.data()); - SectionInfo *si=new SectionInfo(current->name, - sectionLabel,sectionTitle,isSubsection); - sectionDict.insert(sectionLabel,si); + if (sectionLabel.isEmpty()) return; + if (sectionDict[sectionLabel]==0) + { + SectionInfo *si=new SectionInfo(sectionLabel,sectionTitle,sectionType); + sectionDict.insert(sectionLabel,si); + current->anchors->append(new QString(sectionLabel)); + } + else + { + warn("Warning: Duplicate label %s found!\n",sectionLabel.data()); + } } - // Adds a formula text to the list/dictionary of formulas if it was // not already added. Returns the label of the formula. static QString addFormula() @@ -710,6 +718,7 @@ VAR [vV][aA][rR] %x MemberSpec %x MemberSpecSkip %x SkipVerbatim +%x Text %x DocScan %x DocParam %x DocException @@ -742,6 +751,8 @@ VAR [vV][aA][rR] %x DocVerbInc %x DocIndexWord %x DocRef +%x DocRefArg +%x DocRefArgStart %x DocRefItem %x DocRefItemName %x SectionLabel @@ -756,6 +767,7 @@ VAR [vV][aA][rR] %x DocSkipHtmlComment %x ReadFormulaShort %x ReadFormulaLong +%x AnchorLabel %% @@ -798,13 +810,13 @@ VAR [vV][aA][rR] "