diff options
45 files changed, 691 insertions, 339 deletions
diff --git a/.travis.yml b/.travis.yml index acc325a..51a32a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: cpp compiler: - gcc - clang +sudo: required before_install: - sudo apt-add-repository ppa:smspillaz/cmake-2.8.12 -y diff --git a/doc/autolink.doc b/doc/autolink.doc index 98556c5..ff468e4 100644 --- a/doc/autolink.doc +++ b/doc/autolink.doc @@ -16,7 +16,7 @@ */ /*! \page autolink Automatic link generation - \tableofcontents + \tableofcontents{html,latex} Most documentation systems have special `see also' sections where links to other pieces of documentation can be inserted. diff --git a/doc/changelog.doc b/doc/changelog.doc index 1d4eeba..0b245b6 100644 --- a/doc/changelog.doc +++ b/doc/changelog.doc @@ -1,5 +1,5 @@ /** \page changelog Changelog -\tableofcontents +\tableofcontents{html,latex} \section log_1_8 1.8 Series \subsection log_1_8_14 Release 1.8.14 diff --git a/doc/commands.doc b/doc/commands.doc index eeb5041..6c680ee 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -2028,15 +2028,23 @@ Make sure you have first read \ref intro "the introduction". \endverbatim <hr> -\section cmdtableofcontents \\tableofcontents +\section cmdtableofcontents \\tableofcontents['{'[option[:level]][,option[:level]]*'}'] \addindex \\tableofcontents Creates a table of contents at the top of a page, listing all - sections and subsections in the page. + sections and subsections in the page. The `option` can be `HTML` or `LaTeX` + or `XML`. When a `level` is specified this means the maximum nesting level + that is shown. The value of `level` should be in the range 1..5, values outside + this range are considered to be 5. In case no `level` is specified `level` is + set to 5 (show all) + In case no `option`. is specified \c \\tableofcontents acts as if just the + `option` `HTML` was specified. In case of multiple \c \\tableofcontents + commands in a page the `option`(s) will be used additional to the already + specified `option`(s), but only the last `level` of an `option` is valid. \warning This command only works inside related page documentation and \e not in other documentation blocks and only has effect in the - HTML output! + the specified output! <hr> \section cmdsection \\section <section-name> (section title) diff --git a/doc/custcmd.doc b/doc/custcmd.doc index de9a30d..acc0224 100644 --- a/doc/custcmd.doc +++ b/doc/custcmd.doc @@ -16,7 +16,7 @@ */ /*! \page custcmd Custom Commands -\tableofcontents +\tableofcontents{html,latex} Doxygen provides a large number of \ref commands "special commands", \ref xmlcmds "XML commands", and \ref htmlcmds "HTML commands". diff --git a/doc/customize.doc b/doc/customize.doc index e2d53db..7b2729d 100644 --- a/doc/customize.doc +++ b/doc/customize.doc @@ -16,7 +16,7 @@ */ /*! \page customize Customizing the output -\tableofcontents +\tableofcontents{html,latex} Doxygen provides various levels of customization. The section \ref minor_tweaks "Minor Tweaks" discusses what to @@ -289,7 +289,12 @@ The following generic elements are possible for each page: <dt>\c detaileddescription <dd>Represents the detailed description on a page. <dt>\c authorsection - <dd>Represents the author section of a page (only used for man pages). + <dd>Represents the author section of a page (only used for man pages). This is + a separate section for man pages with a text like: + `Generated automatically by Doxygen for My Project from the source code.` + This should not be misinterpreted with the doxygen commands \ref cmdauthor + "\\author" or \ref cmdauthors "\\authors" that generate an author paragraph + inside a detailed description. <dt>\c memberdecl <dd>Represents the quick overview of members on a page (member declarations). This elements has child elements per type of member list. diff --git a/doc/docblocks.doc b/doc/docblocks.doc index e72ce95..f02e55b 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -15,7 +15,7 @@ * */ /*! \page docblocks Documenting the code -\tableofcontents +\tableofcontents{html,latex} This chapter covers two topics: 1. How to put comments in your code such that doxygen incorporates them in diff --git a/doc/doxygen_manual.tex b/doc/doxygen_manual.tex index 3e4cd49..95e1ed6 100644 --- a/doc/doxygen_manual.tex +++ b/doc/doxygen_manual.tex @@ -70,9 +70,13 @@ \hfuzz=15pt \setlength{\emergencystretch}{15pt} \setlength{\parindent}{0pt} -\setlength{\parskip}{0.2cm} +\newcommand{\doxynormalparskip}{\setlength{\parskip}{0.2cm}} +\newcommand{\doxytocparskip}{\setlength{\parskip}{0.2cm}} +\doxynormalparskip \hbadness=750 \tolerance=750 +\usepackage{etoc} +\etocsettocstyle{\doxytocparskip}{\doxynormalparskip} \begin{document} \pagenumbering{alph} \begin{titlepage} @@ -85,6 +89,7 @@ Written by Dimitri van Heesch\\[2ex] \end{titlepage} \clearemptydoublepage \pagenumbering{Roman} +\chapter*{Contents} \tableofcontents \clearemptydoublepage \pagenumbering{arabic} diff --git a/doc/faq.doc b/doc/faq.doc index a91a2f5..e9c93d8 100644 --- a/doc/faq.doc +++ b/doc/faq.doc @@ -16,7 +16,7 @@ */ /*! \page faq Frequently Asked Questions -\tableofcontents +\tableofcontents{html,latex} \section faq_index How to get information on the index page in HTML? diff --git a/doc/install.doc b/doc/install.doc index f981431..497a0c0 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -17,7 +17,7 @@ /*! \page install Installation \addindex installation -\tableofcontents +\tableofcontents{html,latex} First go to the <a href="http://www.doxygen.org/download.html">download</a> page diff --git a/doc/starting.doc b/doc/starting.doc index e39aa25..0765a3b 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -15,7 +15,7 @@ * */ /*! \page starting Getting started -\tableofcontents +\tableofcontents{html,latex} The executable \c doxygen is the main program that parses the sources and generates the documentation. See section \ref doxygen_usage for more diff --git a/src/classdef.cpp b/src/classdef.cpp index 4977760..657968e 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1582,7 +1582,11 @@ void ClassDef::writeSummaryLinks(OutputList &ol) void ClassDef::writeTagFile(FTextStream &tagFile) { if (!isLinkableInProject()) return; - tagFile << " <compound kind=\"" << compoundTypeString(); + tagFile << " <compound kind=\""; + if (isFortran() && (compoundTypeString() == "type")) + tagFile << "struct"; + else + tagFile << compoundTypeString(); tagFile << "\""; if (isObjectiveC()) { tagFile << " objc=\"yes\""; } tagFile << ">" << endl; @@ -4500,6 +4504,11 @@ bool ClassDef::isObjectiveC() const return getLanguage()==SrcLangExt_ObjC; } +bool ClassDef::isFortran() const +{ + return getLanguage()==SrcLangExt_Fortran; +} + bool ClassDef::isCSharp() const { return getLanguage()==SrcLangExt_CSharp; diff --git a/src/classdef.h b/src/classdef.h index b169221..12fcd93 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -266,6 +266,9 @@ class ClassDef : public Definition /** Returns TRUE if this class is implemented in Objective-C */ bool isObjectiveC() const; + /** Returns TRUE if this class is implemented in Fortran */ + bool isFortran() const; + /** Returns TRUE if this class is implemented in C# */ bool isCSharp() const; diff --git a/src/commentscan.l b/src/commentscan.l index 42318d1..8488e6c 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -30,6 +30,7 @@ #include <qstack.h> #include <qregexp.h> #include <qfile.h> +#include <qstringlist.h> #include "scanner.h" #include "entry.h" @@ -54,81 +55,81 @@ #define YY_NO_UNISTD_H 1 // forward declarations -static bool handleBrief(const QCString &); -static bool handleFn(const QCString &); -static bool handleDef(const QCString &); -static bool handleOverload(const QCString &); -static bool handleEnum(const QCString &); -static bool handleDefGroup(const QCString &); -static bool handleAddToGroup(const QCString &); -static bool handleWeakGroup(const QCString &); -static bool handleNamespace(const QCString &); -static bool handlePackage(const QCString &); -static bool handleClass(const QCString &); -static bool handleHeaderFile(const QCString &); -static bool handleProtocol(const QCString &); -static bool handleCategory(const QCString &); -static bool handleUnion(const QCString &); -static bool handleStruct(const QCString &); -static bool handleInterface(const QCString &); -static bool handleIdlException(const QCString &); -static bool handlePage(const QCString &); -static bool handleMainpage(const QCString &); -static bool handleFile(const QCString &); -static bool handleDir(const QCString &); -static bool handleExample(const QCString &); -static bool handleDetails(const QCString &); -static bool handleName(const QCString &); -static bool handleTodo(const QCString &); -static bool handleTest(const QCString &); -static bool handleBug(const QCString &); -static bool handleSubpage(const QCString &s); -static bool handleDeprecated(const QCString &); -static bool handleXRefItem(const QCString &); -static bool handleRelated(const QCString &); -static bool handleRelatedAlso(const QCString &); -static bool handleMemberOf(const QCString &); -static bool handleRefItem(const QCString &); -static bool handleSection(const QCString &); -static bool handleAnchor(const QCString &); -static bool handleCite(const QCString &); -static bool handleFormatBlock(const QCString &); -static bool handleAddIndex(const QCString &); -static bool handleIf(const QCString &); -static bool handleIfNot(const QCString &); -static bool handleElseIf(const QCString &); -static bool handleElse(const QCString &); -static bool handleEndIf(const QCString &); -static bool handleIngroup(const QCString &); -static bool handleNoSubGrouping(const QCString &); -static bool handleShowInitializer(const QCString &); -static bool handleHideInitializer(const QCString &); -static bool handleCallgraph(const QCString &); -static bool handleHideCallgraph(const QCString &); -static bool handleCallergraph(const QCString &); -static bool handleHideCallergraph(const QCString &); -static bool handleInternal(const QCString &); -static bool handleLineBr(const QCString &); -static bool handleStatic(const QCString &); -static bool handlePure(const QCString &); -static bool handlePrivate(const QCString &); -static bool handlePrivateSection(const QCString &); -static bool handleProtected(const QCString &); -static bool handleProtectedSection(const QCString &); -static bool handlePublic(const QCString &s); -static bool handlePublicSection(const QCString &s); -static bool handleToc(const QCString &s); -static bool handleInherit(const QCString &); -static bool handleExtends(const QCString &); -static bool handleCopyDoc(const QCString &); -static bool handleCopyBrief(const QCString &); -static bool handleCopyDetails(const QCString &); -static bool handleParBlock(const QCString &); -static bool handleEndParBlock(const QCString &); -static bool handleParam(const QCString &); -static bool handleRetval(const QCString &); - -typedef bool (*DocCmdFunc)(const QCString &name); +static bool handleBrief(const QCString &, const QCString &); +static bool handleFn(const QCString &, const QCString &); +static bool handleDef(const QCString &, const QCString &); +static bool handleOverload(const QCString &, const QCString &); +static bool handleEnum(const QCString &, const QCString &); +static bool handleDefGroup(const QCString &, const QCString &); +static bool handleAddToGroup(const QCString &, const QCString &); +static bool handleWeakGroup(const QCString &, const QCString &); +static bool handleNamespace(const QCString &, const QCString &); +static bool handlePackage(const QCString &, const QCString &); +static bool handleClass(const QCString &, const QCString &); +static bool handleHeaderFile(const QCString &, const QCString &); +static bool handleProtocol(const QCString &, const QCString &); +static bool handleCategory(const QCString &, const QCString &); +static bool handleUnion(const QCString &, const QCString &); +static bool handleStruct(const QCString &, const QCString &); +static bool handleInterface(const QCString &, const QCString &); +static bool handleIdlException(const QCString &, const QCString &); +static bool handlePage(const QCString &, const QCString &); +static bool handleMainpage(const QCString &, const QCString &); +static bool handleFile(const QCString &, const QCString &); +static bool handleDir(const QCString &, const QCString &); +static bool handleExample(const QCString &, const QCString &); +static bool handleDetails(const QCString &, const QCString &); +static bool handleName(const QCString &, const QCString &); +static bool handleTodo(const QCString &, const QCString &); +static bool handleTest(const QCString &, const QCString &); +static bool handleBug(const QCString &, const QCString &); +static bool handleSubpage(const QCString &s, const QCString &); +static bool handleDeprecated(const QCString &, const QCString &); +static bool handleXRefItem(const QCString &, const QCString &); +static bool handleRelated(const QCString &, const QCString &); +static bool handleRelatedAlso(const QCString &, const QCString &); +static bool handleMemberOf(const QCString &, const QCString &); +static bool handleRefItem(const QCString &, const QCString &); +static bool handleSection(const QCString &, const QCString &); +static bool handleAnchor(const QCString &, const QCString &); +static bool handleCite(const QCString &, const QCString &); +static bool handleFormatBlock(const QCString &, const QCString &); +static bool handleAddIndex(const QCString &, const QCString &); +static bool handleIf(const QCString &, const QCString &); +static bool handleIfNot(const QCString &, const QCString &); +static bool handleElseIf(const QCString &, const QCString &); +static bool handleElse(const QCString &, const QCString &); +static bool handleEndIf(const QCString &, const QCString &); +static bool handleIngroup(const QCString &, const QCString &); +static bool handleNoSubGrouping(const QCString &, const QCString &); +static bool handleShowInitializer(const QCString &, const QCString &); +static bool handleHideInitializer(const QCString &, const QCString &); +static bool handleCallgraph(const QCString &, const QCString &); +static bool handleHideCallgraph(const QCString &, const QCString &); +static bool handleCallergraph(const QCString &, const QCString &); +static bool handleHideCallergraph(const QCString &, const QCString &); +static bool handleInternal(const QCString &, const QCString &); +static bool handleLineBr(const QCString &, const QCString &); +static bool handleStatic(const QCString &, const QCString &); +static bool handlePure(const QCString &, const QCString &); +static bool handlePrivate(const QCString &, const QCString &); +static bool handlePrivateSection(const QCString &, const QCString &); +static bool handleProtected(const QCString &, const QCString &); +static bool handleProtectedSection(const QCString &, const QCString &); +static bool handlePublic(const QCString &s, const QCString &); +static bool handlePublicSection(const QCString &s, const QCString &); +static bool handleToc(const QCString &s, const QCString &); +static bool handleInherit(const QCString &, const QCString &); +static bool handleExtends(const QCString &, const QCString &); +static bool handleCopyDoc(const QCString &, const QCString &); +static bool handleCopyBrief(const QCString &, const QCString &); +static bool handleCopyDetails(const QCString &, const QCString &); +static bool handleParBlock(const QCString &, const QCString &); +static bool handleEndParBlock(const QCString &, const QCString &); +static bool handleParam(const QCString &, const QCString &); +static bool handleRetval(const QCString &, const QCString &); + +typedef bool (*DocCmdFunc)(const QCString &name, const QCString &opt); struct DocCmdMap { @@ -582,7 +583,7 @@ static void addXRefItem(const char *listName,const char *itemTitle, item->listAnchor = anchorLabel; docEntry->addSpecialListItem(listName,itemId); QCString cmdString; - cmdString.sprintf("\\xrefitem %s %d.",listName,itemId); + cmdString.sprintf(" \\xrefitem %s %d.",listName,itemId); if (inBody) { docEntry->inbodyDocs += cmdString; @@ -1093,16 +1094,29 @@ RCSTAG "$"{ID}":"[^\n$]+"$" BEGIN(CdataSection); } <Comment>{B}*{CMD}"endinternal"{B}* { - addOutput("\\endinternal "); + addOutput(" \\endinternal "); if (!inInternalDocs) warn(yyFileName,yyLineNr, "found \\endinternal without matching \\internal" ); inInternalDocs = FALSE; } +<Comment>{B}*{CMD}[a-z_A-Z]+"{"[a-zA-Z_,:0-9\. ]*"}"{B}* | <Comment>{B}*{CMD}[a-z_A-Z]+{B}* { // potentially interesting command // the {B}* in the front was added for bug620924 - QCString cmdName = QCString(yytext).stripWhiteSpace().data()+1; + QCString fullMatch = QCString(yytext); + int idx = fullMatch.find('{'); + QCString cmdName; + QCString optName; + if (idx == -1) + { + cmdName = QCString(yytext).stripWhiteSpace().data()+1; // to remove {CMD} + } + else + { + cmdName = fullMatch.left(idx).stripWhiteSpace().data()+1; // to remove {CMD} + optName = fullMatch.right(fullMatch.length() - idx).stripWhiteSpace().data(); + } DocCmdMapper::Cmd *cmdPtr = DocCmdMapper::map(cmdName); if (cmdPtr) // special action is required { @@ -1116,7 +1130,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" setOutput(OutputDoc); } //if (i>0) addOutput(QCString(yytext).left(i)); // removed for bug 689341 - if (cmdPtr->func && cmdPtr->func(cmdName)) + if (cmdPtr->func && cmdPtr->func(cmdName, optName)) { // implicit split of the comment block into two // entries. Restart the next block at the start @@ -1729,7 +1743,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" /* ----- handle arguments of the section/subsection/.. commands ------- */ -<SectionLabel>{LABELID} { // first argyment +<SectionLabel>{LABELID} { // first argument g_sectionLabel=yytext; addOutput(yytext); g_sectionTitle.resize(0); @@ -2233,7 +2247,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" /* ----- handle arguments of the cite command ------- */ -<CiteLabel>{CITEID} { // found argyment +<CiteLabel>{CITEID} { // found argument addCite(); addOutput(yytext); BEGIN(Comment); @@ -2279,14 +2293,14 @@ RCSTAG "$"{ID}":"[^\n$]+"$" //---------------------------------------------------------------------------- -static bool handleBrief(const QCString &) +static bool handleBrief(const QCString &, const QCString &) { //printf("handleBrief\n"); setOutput(OutputBrief); return FALSE; } -static bool handleFn(const QCString &) +static bool handleFn(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::MEMBERDOC_SEC); functionProto.resize(0); @@ -2295,7 +2309,7 @@ static bool handleFn(const QCString &) return stop; } -static bool handleDef(const QCString &) +static bool handleDef(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::DEFINEDOC_SEC); functionProto.resize(0); @@ -2303,21 +2317,21 @@ static bool handleDef(const QCString &) return stop; } -static bool handleOverload(const QCString &) +static bool handleOverload(const QCString &, const QCString &) { functionProto.resize(0); BEGIN(OverloadParam); return FALSE; } -static bool handleEnum(const QCString &) +static bool handleEnum(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::ENUMDOC_SEC); BEGIN(EnumDocArg1); return stop; } -static bool handleDefGroup(const QCString &) +static bool handleDefGroup(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC); current->groupDocType = Entry::GROUPDOC_NORMAL; @@ -2325,7 +2339,7 @@ static bool handleDefGroup(const QCString &) return stop; } -static bool handleAddToGroup(const QCString &) +static bool handleAddToGroup(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC); current->groupDocType = Entry::GROUPDOC_ADD; @@ -2333,7 +2347,7 @@ static bool handleAddToGroup(const QCString &) return stop; } -static bool handleWeakGroup(const QCString &) +static bool handleWeakGroup(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::GROUPDOC_SEC); current->groupDocType = Entry::GROUPDOC_WEAK; @@ -2341,83 +2355,83 @@ static bool handleWeakGroup(const QCString &) return stop; } -static bool handleNamespace(const QCString &) +static bool handleNamespace(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::NAMESPACEDOC_SEC); BEGIN( NameSpaceDocArg1 ); return stop; } -static bool handlePackage(const QCString &) +static bool handlePackage(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::PACKAGEDOC_SEC); BEGIN( PackageDocArg1 ); return stop; } -static bool handleClass(const QCString &) +static bool handleClass(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::CLASSDOC_SEC); BEGIN( ClassDocArg1 ); return stop; } -static bool handleHeaderFile(const QCString &) +static bool handleHeaderFile(const QCString &, const QCString &) { BEGIN( ClassDocArg2 ); return FALSE; } -static bool handleProtocol(const QCString &) +static bool handleProtocol(const QCString &, const QCString &) { // Obj-C protocol bool stop=makeStructuralIndicator(Entry::PROTOCOLDOC_SEC); BEGIN( ClassDocArg1 ); return stop; } -static bool handleCategory(const QCString &) +static bool handleCategory(const QCString &, const QCString &) { // Obj-C category bool stop=makeStructuralIndicator(Entry::CATEGORYDOC_SEC); BEGIN( CategoryDocArg1 ); return stop; } -static bool handleUnion(const QCString &) +static bool handleUnion(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::UNIONDOC_SEC); BEGIN( ClassDocArg1 ); return stop; } -static bool handleStruct(const QCString &) +static bool handleStruct(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::STRUCTDOC_SEC); BEGIN( ClassDocArg1 ); return stop; } -static bool handleInterface(const QCString &) +static bool handleInterface(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::INTERFACEDOC_SEC); BEGIN( ClassDocArg1 ); return stop; } -static bool handleIdlException(const QCString &) +static bool handleIdlException(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::EXCEPTIONDOC_SEC); BEGIN( ClassDocArg1 ); return stop; } -static bool handlePage(const QCString &) +static bool handlePage(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::PAGEDOC_SEC); BEGIN( PageDocArg1 ); return stop; } -static bool handleMainpage(const QCString &) +static bool handleMainpage(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::MAINPAGEDOC_SEC); if (!stop) @@ -2428,7 +2442,7 @@ static bool handleMainpage(const QCString &) return stop; } -static bool handleFile(const QCString &) +static bool handleFile(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::FILEDOC_SEC); if (!stop) @@ -2439,7 +2453,7 @@ static bool handleFile(const QCString &) return stop; } -static bool handleParam(const QCString &) +static bool handleParam(const QCString &, const QCString &) { // we need process param and retval arguments to escape leading underscores in case of // markdown processing, see bug775493 @@ -2448,14 +2462,14 @@ static bool handleParam(const QCString &) return FALSE; } -static bool handleRetval(const QCString &) +static bool handleRetval(const QCString &, const QCString &) { addOutput("@retval "); BEGIN( ParamArg1 ); return FALSE; } -static bool handleDir(const QCString &) +static bool handleDir(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::DIRDOC_SEC); if (!stop) current->name = yyFileName; @@ -2463,7 +2477,7 @@ static bool handleDir(const QCString &) return stop; } -static bool handleExample(const QCString &) +static bool handleExample(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::EXAMPLE_SEC); if (!stop) current->name = yyFileName; @@ -2471,7 +2485,7 @@ static bool handleExample(const QCString &) return stop; } -static bool handleDetails(const QCString &) +static bool handleDetails(const QCString &, const QCString &) { if (inContext!=OutputBrief) { @@ -2482,7 +2496,7 @@ static bool handleDetails(const QCString &) return FALSE; } -static bool handleName(const QCString &) +static bool handleName(const QCString &, const QCString &) { bool stop=makeStructuralIndicator(Entry::MEMBERGRP_SEC); if (!stop) @@ -2497,7 +2511,7 @@ static bool handleName(const QCString &) return stop; } -static bool handleTodo(const QCString &) +static bool handleTodo(const QCString &, const QCString &) { newXRefKind = XRef_Todo; setOutput(OutputXRef); @@ -2505,7 +2519,7 @@ static bool handleTodo(const QCString &) return FALSE; } -static bool handleTest(const QCString &) +static bool handleTest(const QCString &, const QCString &) { newXRefKind = XRef_Test; setOutput(OutputXRef); @@ -2513,7 +2527,7 @@ static bool handleTest(const QCString &) return FALSE; } -static bool handleBug(const QCString &) +static bool handleBug(const QCString &, const QCString &) { newXRefKind = XRef_Bug; setOutput(OutputXRef); @@ -2521,7 +2535,7 @@ static bool handleBug(const QCString &) return FALSE; } -static bool handleDeprecated(const QCString &) +static bool handleDeprecated(const QCString &, const QCString &) { newXRefKind = XRef_Deprecated; setOutput(OutputXRef); @@ -2529,14 +2543,14 @@ static bool handleDeprecated(const QCString &) return FALSE; } -static bool handleXRefItem(const QCString &) +static bool handleXRefItem(const QCString &, const QCString &) { newXRefKind = XRef_Item; BEGIN(XRefItemParam1); return FALSE; } -static bool handleParBlock(const QCString &) +static bool handleParBlock(const QCString &, const QCString &) { if (g_insideParBlock) { @@ -2553,7 +2567,7 @@ static bool handleParBlock(const QCString &) return FALSE; } -static bool handleEndParBlock(const QCString &) +static bool handleEndParBlock(const QCString &, const QCString &) { if (!g_insideParBlock) { @@ -2566,7 +2580,7 @@ static bool handleEndParBlock(const QCString &) return FALSE; } -static bool handleRelated(const QCString &) +static bool handleRelated(const QCString &, const QCString &) { if (!current->relates.isEmpty()) { @@ -2578,7 +2592,7 @@ static bool handleRelated(const QCString &) return FALSE; } -static bool handleRelatedAlso(const QCString &) +static bool handleRelatedAlso(const QCString &, const QCString &) { if (!current->relates.isEmpty()) { @@ -2590,7 +2604,7 @@ static bool handleRelatedAlso(const QCString &) return FALSE; } -static bool handleMemberOf(const QCString &) +static bool handleMemberOf(const QCString &, const QCString &) { if (!current->relates.isEmpty()) { @@ -2602,14 +2616,14 @@ static bool handleMemberOf(const QCString &) return FALSE; } -static bool handleRefItem(const QCString &) +static bool handleRefItem(const QCString &, const QCString &) { addOutput("@refitem "); BEGIN(LineParam); return FALSE; } -static bool handleSection(const QCString &s) +static bool handleSection(const QCString &s, const QCString &) { setOutput(OutputDoc); addOutput("@"+s+" "); @@ -2621,7 +2635,7 @@ static bool handleSection(const QCString &s) return FALSE; } -static bool handleSubpage(const QCString &s) +static bool handleSubpage(const QCString &s, const QCString &) { if (current->section!=Entry::EMPTY_SEC && current->section!=Entry::PAGEDOC_SEC && @@ -2641,14 +2655,14 @@ static bool handleSubpage(const QCString &s) return FALSE; } -static bool handleAnchor(const QCString &s) +static bool handleAnchor(const QCString &s, const QCString &) { addOutput("@"+s+" "); BEGIN(AnchorLabel); return FALSE; } -static bool handleCite(const QCString &s) +static bool handleCite(const QCString &s, const QCString &) { if (!g_spaceBeforeCmd.isEmpty()) { @@ -2660,24 +2674,24 @@ static bool handleCite(const QCString &s) return FALSE; } -static bool handleFormatBlock(const QCString &s) +static bool handleFormatBlock(const QCString &s, const QCString &opt) { - addOutput("@"+s+" "); - //printf("handleFormatBlock(%s)\n",s.data()); + addOutput("@"+s+" "+opt); + //printf("handleFormatBlock(%s) with option(%s)\n",s.data(),opt.data()); blockName=s; g_commentCount=0; BEGIN(FormatBlock); return FALSE; } -static bool handleAddIndex(const QCString &) +static bool handleAddIndex(const QCString &, const QCString &) { addOutput("@addindex "); BEGIN(LineParam); return FALSE; } -static bool handleIf(const QCString &) +static bool handleIf(const QCString &, const QCString &) { enabledSectionFound=FALSE; guardType = Guard_If; @@ -2686,7 +2700,7 @@ static bool handleIf(const QCString &) return FALSE; } -static bool handleIfNot(const QCString &) +static bool handleIfNot(const QCString &, const QCString &) { enabledSectionFound=FALSE; guardType = Guard_IfNot; @@ -2695,7 +2709,7 @@ static bool handleIfNot(const QCString &) return FALSE; } -static bool handleElseIf(const QCString &) +static bool handleElseIf(const QCString &, const QCString &) { if (guards.isEmpty()) { @@ -2710,7 +2724,7 @@ static bool handleElseIf(const QCString &) return FALSE; } -static bool handleElse(const QCString &) +static bool handleElse(const QCString &, const QCString &) { if (guards.isEmpty()) { @@ -2724,7 +2738,7 @@ static bool handleElse(const QCString &) return FALSE; } -static bool handleEndIf(const QCString &) +static bool handleEndIf(const QCString &, const QCString &) { if (guards.isEmpty()) { @@ -2745,56 +2759,56 @@ static bool handleEndIf(const QCString &) return FALSE; } -static bool handleIngroup(const QCString &) +static bool handleIngroup(const QCString &, const QCString &) { inGroupParamFound=FALSE; BEGIN( InGroupParam ); return FALSE; } -static bool handleNoSubGrouping(const QCString &) +static bool handleNoSubGrouping(const QCString &, const QCString &) { current->subGrouping = FALSE; return FALSE; } -static bool handleShowInitializer(const QCString &) +static bool handleShowInitializer(const QCString &, const QCString &) { current->initLines = 100000; // ON return FALSE; } -static bool handleHideInitializer(const QCString &) +static bool handleHideInitializer(const QCString &, const QCString &) { current->initLines = 0; // OFF return FALSE; } -static bool handleCallgraph(const QCString &) +static bool handleCallgraph(const QCString &, const QCString &) { current->callGraph = TRUE; // ON return FALSE; } -static bool handleHideCallgraph(const QCString &) +static bool handleHideCallgraph(const QCString &, const QCString &) { current->callGraph = FALSE; // OFF return FALSE; } -static bool handleCallergraph(const QCString &) +static bool handleCallergraph(const QCString &, const QCString &) { current->callerGraph = TRUE; // ON return FALSE; } -static bool handleHideCallergraph(const QCString &) +static bool handleHideCallergraph(const QCString &, const QCString &) { current->callerGraph = FALSE; // OFF return FALSE; } -static bool handleInternal(const QCString &) +static bool handleInternal(const QCString &, const QCString &) { if (!Config_getBool(INTERNAL_DOCS)) { @@ -2810,91 +2824,135 @@ static bool handleInternal(const QCString &) else { // re-enabled for bug640828 - addOutput("\\internal "); + addOutput(" \\internal "); inInternalDocs = TRUE; } return FALSE; } -static bool handleLineBr(const QCString &) +static bool handleLineBr(const QCString &, const QCString &) { addOutput('\n'); return FALSE; } -static bool handleStatic(const QCString &) +static bool handleStatic(const QCString &, const QCString &) { endBrief(); current->stat = TRUE; return FALSE; } -static bool handlePure(const QCString &) +static bool handlePure(const QCString &, const QCString &) { endBrief(); current->virt = Pure; return FALSE; } -static bool handlePrivate(const QCString &) +static bool handlePrivate(const QCString &, const QCString &) { current->protection = Private; return FALSE; } -static bool handlePrivateSection(const QCString &) +static bool handlePrivateSection(const QCString &, const QCString &) { current->protection = protection = Private; return FALSE; } -static bool handleProtected(const QCString &) +static bool handleProtected(const QCString &, const QCString &) { current->protection = Protected; return FALSE; } -static bool handleProtectedSection(const QCString &) +static bool handleProtectedSection(const QCString &, const QCString &) { current->protection = protection = Protected ; return FALSE; } -static bool handlePublic(const QCString &) +static bool handlePublic(const QCString &, const QCString &) { current->protection = Public; return FALSE; } -static bool handlePublicSection(const QCString &) +static bool handlePublicSection(const QCString &, const QCString &) { current->protection = protection = Public; return FALSE; } -static bool handleToc(const QCString &) +static bool handleToc(const QCString &, const QCString &opt) { if (current->section==Entry::PAGEDOC_SEC || current->section==Entry::MAINPAGEDOC_SEC) { - current->stat=TRUE; // we 'abuse' stat to pass whether or the TOC is enabled + QString optName = opt.stripWhiteSpace(); // to be sure + optName = optName.left(optName.length() - 1).right(optName.length() - 2); + QStringList optList=QStringList::split(",",optName,FALSE); + QStringList::Iterator it; + for ( it = optList.begin(); it != optList.end(); ++it ) + { + QString opt = (*it).stripWhiteSpace().lower(); + char dum; + int level = 5; + int i = opt.find(':'); + if (i>0) // found ':' but not on position 0 what would mean just a level + { + if (sscanf(opt.right(opt.length() - i - 1).data(),"%d%c",&level,&dum) != 1) + { + warn(yyFileName,yyLineNr,"Unknown option:level specified with \\tableofcontents: `%s'", (*it).stripWhiteSpace().data()); + opt = ""; + } + else + { + level = (level > 5 ? 5 : level); + level = (level <= 0 ? 5 : level); + opt = opt.left(i).stripWhiteSpace(); + } + } + if (!opt.isEmpty()) + { + if (opt == "html") + { + current->localToc.enableHtml(level); + } + else if (opt == "latex") + { + current->localToc.enableLatex(level); + } + else if (opt == "xml") + { + current->localToc.enableXml(level); + } + else warn(yyFileName,yyLineNr,"Unknown option specified with \\tableofcontents: `%s'", (*it).stripWhiteSpace().data()); + } + } + if (current->localToc.nothingEnabled()) + { + current->localToc.enableHtml(5); // for backward compatibility + } } return FALSE; } -static bool handleInherit(const QCString &) +static bool handleInherit(const QCString &, const QCString &) { BEGIN(InheritParam); return FALSE; } -static bool handleExtends(const QCString &) +static bool handleExtends(const QCString &, const QCString &) { BEGIN(ExtendsParam); return FALSE; } -static bool handleCopyBrief(const QCString &) +static bool handleCopyBrief(const QCString &, const QCString &) { if (current->brief.isEmpty() && current->doc.isEmpty()) { // if we don't have a brief or detailed description yet, @@ -2911,7 +2969,7 @@ static bool handleCopyBrief(const QCString &) return FALSE; } -static bool handleCopyDetails(const QCString &) +static bool handleCopyDetails(const QCString &, const QCString &) { setOutput(OutputDoc); if (!g_spaceBeforeCmd.isEmpty()) @@ -2923,7 +2981,7 @@ static bool handleCopyDetails(const QCString &) return FALSE; } -static bool handleCopyDoc(const QCString &) +static bool handleCopyDoc(const QCString &, const QCString &) { setOutput(OutputBrief); if (!g_spaceBeforeCmd.isEmpty()) diff --git a/src/condparser.cpp b/src/condparser.cpp index ab33ae3..74e26bc 100644 --- a/src/condparser.cpp +++ b/src/condparser.cpp @@ -100,9 +100,10 @@ static bool isAlpha(const char c) return (c>='A' && c<='Z') || (c>='a' && c<='z') || c=='_'; } -static bool isAlphaNum(const char c) +static bool isAlphaNumSpec(const char c) { - return isAlpha(c) || (c>='0' && c<='9'); + return isAlpha(c) || (c>='0' && c<='9') || c=='-' || c=='.' || + (((unsigned char)c)>=0x80 && ((unsigned char)c)<=0xFF); } /** @@ -170,7 +171,7 @@ void CondParser::getToken() if (isAlpha(*m_e)) { m_tokenType = VARIABLE; - while (isAlphaNum(*m_e)) + while (isAlphaNumSpec(*m_e)) { m_token += *m_e++; } diff --git a/src/config.xml b/src/config.xml index 94376f5..c863ac7 100644 --- a/src/config.xml +++ b/src/config.xml @@ -2553,6 +2553,20 @@ EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... <![CDATA[ The \c MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate index for \f$\mbox{\LaTeX}\f$. + + @note This tag is used in the `Makefile` / `make.bat`. + \sa \ref cfg_latex_makeindex_cmd "LATEX_MAKEINDEX_CMD" for the part in the generated output file (`.tex`). +]]> + </docs> + </option> + <option type='string' id='LATEX_MAKEINDEX_CMD' defval='\makeindex' depends='GENERATE_LATEX'> + <docs> +<![CDATA[ + The \c LATEX_MAKEINDEX_CMD tag can be used to specify the command name to + generate index for \f$\mbox{\LaTeX}\f$. + + @note This tag is used in the generated output file (`.tex`). + \sa \ref cfg_makeindex_cmd_name "MAKEINDEX_CMD_NAME" for the part in the `Makefile` / `make.bat`. ]]> </docs> </option> diff --git a/src/configgen.py b/src/configgen.py index 33857b7..ca2a5d1 100755 --- a/src/configgen.py +++ b/src/configgen.py @@ -272,7 +272,7 @@ def parseOption(node): print(" \"%s\"" % (line)) print(" );") if defval != '': - print(" cs->setDefaultValue(\"%s\");" % (defval)) + print(" cs->setDefaultValue(\"%s\");" % (defval.replace('\\','\\\\'))) if format == 'file': print(" cs->setWidgetType(ConfigString::File);") elif format == 'image': @@ -529,7 +529,7 @@ def parseOptionDoc(node, first): if defval != '': print("") print("The default value is: <code>%s</code>." % ( - defval)) + defval.replace('\\','\\\\'))) print("") # depends handling if (node.hasAttribute('depends')): diff --git a/src/definition.cpp b/src/definition.cpp index 92baf0c..cbfad94 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -41,6 +41,7 @@ #include "namespacedef.h" #include "filedef.h" #include "dirdef.h" +#include "pagedef.h" #define START_MARKER 0x4445465B // DEF[ #define END_MARKER 0x4445465D // DEF] @@ -1613,72 +1614,92 @@ void Definition::writeNavigationPath(OutputList &ol) const } // TODO: move to htmlgen -void Definition::writeToc(OutputList &ol) +void Definition::writeToc(OutputList &ol, const LocalToc &localToc) { SectionDict *sectionDict = m_impl->sectionDict; if (sectionDict==0) return; - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - ol.writeString("<div class=\"toc\">"); - ol.writeString("<h3>"); - ol.writeString(theTranslator->trRTFTableOfContents()); - ol.writeString("</h3>\n"); - ol.writeString("<ul>"); - SDict<SectionInfo>::Iterator li(*sectionDict); - SectionInfo *si; - int level=1,l; - char cs[2]; - cs[1]='\0'; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE }; - for (li.toFirst();(si=li.current());++li) - { - if (si->type==SectionInfo::Section || - si->type==SectionInfo::Subsection || - si->type==SectionInfo::Subsubsection || - si->type==SectionInfo::Paragraph) + if (localToc.isHtmlEnabled()) + { + int maxLevel = localToc.htmlLevel(); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.writeString("<div class=\"toc\">"); + ol.writeString("<h3>"); + ol.writeString(theTranslator->trRTFTableOfContents()); + ol.writeString("</h3>\n"); + ol.writeString("<ul>"); + SDict<SectionInfo>::Iterator li(*sectionDict); + SectionInfo *si; + int level=1,l; + char cs[2]; + cs[1]='\0'; + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE }; + for (li.toFirst();(si=li.current());++li) { - //printf(" level=%d title=%s\n",level,si->title.data()); - int nextLevel = (int)si->type; - if (nextLevel>level) + if (si->type==SectionInfo::Section || + si->type==SectionInfo::Subsection || + si->type==SectionInfo::Subsubsection || + si->type==SectionInfo::Paragraph) { - for (l=level;l<nextLevel;l++) + //printf(" level=%d title=%s\n",level,si->title.data()); + int nextLevel = (int)si->type; + if (nextLevel>level) { - ol.writeString("<ul>"); + for (l=level;l<nextLevel;l++) + { + if (l < maxLevel) ol.writeString("<ul>"); + } } - } - else if (nextLevel<level) - { - for (l=level;l>nextLevel;l--) + else if (nextLevel<level) { - if (inLi[l]) ol.writeString("</li>\n"); - inLi[l]=FALSE; - ol.writeString("</ul>\n"); + for (l=level;l>nextLevel;l--) + { + if (l <= maxLevel && inLi[l]) ol.writeString("</li>\n"); + inLi[l]=FALSE; + if (l <= maxLevel) ol.writeString("</ul>\n"); + } } + cs[0]='0'+nextLevel; + if (nextLevel <= maxLevel && inLi[nextLevel]) ol.writeString("</li>\n"); + QCString titleDoc = convertToHtml(si->title); + if (nextLevel <= maxLevel) ol.writeString("<li class=\"level"+QCString(cs)+"\"><a href=\"#"+si->label+"\">"+(si->title.isEmpty()?si->label:titleDoc)+"</a>"); + inLi[nextLevel]=TRUE; + level = nextLevel; } - cs[0]='0'+nextLevel; - if (inLi[nextLevel]) ol.writeString("</li>\n"); - QCString titleDoc = convertToHtml(si->title); - ol.writeString("<li class=\"level"+QCString(cs)+"\"><a href=\"#"+si->label+"\">"+(si->title.isEmpty()?si->label:titleDoc)+"</a>"); - inLi[nextLevel]=TRUE; - level = nextLevel; } - } - while (level>1) - { - if (inLi[level]) ol.writeString("</li>\n"); + while (level>1 && level <= maxLevel) + { + if (inLi[level]) ol.writeString("</li>\n"); + inLi[level]=FALSE; + ol.writeString("</ul>\n"); + level--; + } + if (level <= maxLevel && inLi[level]) ol.writeString("</li>\n"); inLi[level]=FALSE; ol.writeString("</ul>\n"); - level--; + ol.writeString("</div>\n"); + ol.popGeneratorState(); + } + + if (localToc.isLatexEnabled()) + { + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Latex); + int maxLevel = localToc.latexLevel(); + + ol.writeString("\\etocsetnexttocdepth{"+QCString().setNum(maxLevel)+"}\n"); + + ol.writeString("\\localtableofcontents\n"); + ol.popGeneratorState(); } - if (inLi[level]) ol.writeString("</li>\n"); - inLi[level]=FALSE; - ol.writeString("</ul>\n"); - ol.writeString("</div>\n"); - ol.popGeneratorState(); } //---------------------------------------------------------------------------------------- +SectionDict * Definition::getSectionDict(void) +{ + return m_impl->sectionDict; +} QCString Definition::symbolName() const { diff --git a/src/definition.h b/src/definition.h index d16c6b9..c0428a0 100644 --- a/src/definition.h +++ b/src/definition.h @@ -275,6 +275,9 @@ class Definition : public DefinitionIntf QCString id() const; + /** returns the section dictionary, only of importance for pagedef */ + SectionDict * getSectionDict(void); + //----------------------------------------------------------------------------------- // ---- setters ----- //----------------------------------------------------------------------------------- @@ -346,7 +349,7 @@ class Definition : public DefinitionIntf void setLocalName(const QCString name); void addSectionsToIndex(); - void writeToc(OutputList &ol); + void writeToc(OutputList &ol, const LocalToc <); void setCookie(Cookie *cookie) { delete m_cookie; m_cookie = cookie; } Cookie *cookie() const { return m_cookie; } diff --git a/src/docparser.cpp b/src/docparser.cpp index 205e818..0cb4ea3 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -5635,7 +5635,8 @@ int DocPara::handleCommand(const QCString &cmdName) defaultHandleTitleAndSize(CMD_STARTUML,dv,dv->children(),width,height); doctokenizerYYsetStatePlantUML(); retval = doctokenizerYYlex(); - dv->setText(g_token->verb); + int line=0; + dv->setText(stripLeadingAndTrailingEmptyLines(g_token->verb,line)); dv->setWidth(width); dv->setHeight(height); if (jarPath.isEmpty()) diff --git a/src/dot.cpp b/src/dot.cpp index 93fdb20..7b29569 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -3071,7 +3071,7 @@ DotClassGraph::~DotClassGraph() QCString computeMd5Signature(DotNode *root, DotNode::GraphType gt, GraphOutputFormat format, - bool lrRank, + const QCString &rank, // either "LR", "RL", or "" bool renderParents, bool backArrows, const QCString &title, @@ -3082,9 +3082,9 @@ QCString computeMd5Signature(DotNode *root, QGString buf; FTextStream md5stream(&buf); writeGraphHeader(md5stream,title); - if (lrRank) + if (!rank.isEmpty()) { - md5stream << " rankdir=\"LR\";" << endl; + md5stream << " rankdir=\"" << rank << "\";" << endl; } root->clearWriteFlag(); root->write(md5stream, @@ -3133,7 +3133,7 @@ static bool updateDotGraph(DotNode *root, DotNode::GraphType gt, const QCString &baseName, GraphOutputFormat format, - bool lrRank, + const QCString &rank, bool renderParents, bool backArrows, const QCString &title=QCString() @@ -3142,7 +3142,7 @@ static bool updateDotGraph(DotNode *root, QCString theGraph; // TODO: write graph to theGraph, then compute md5 checksum QCString md5 = computeMd5Signature( - root,gt,format,lrRank,renderParents, + root,gt,format,rank,renderParents, backArrows,title,theGraph); QFile f(baseName+".dot"); if (f.open(IO_WriteOnly)) @@ -3203,7 +3203,7 @@ QCString DotClassGraph::writeGraph(FTextStream &out, m_graphType, absBaseName, graphFormat, - m_lrRank, + m_lrRank ? "LR" : "", m_graphType==DotNode::Inheritance, TRUE, m_startNode->label() @@ -3563,7 +3563,7 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out, DotNode::Dependency, absBaseName, graphFormat, - FALSE, // lrRank + "", // lrRank FALSE, // renderParents m_inverse, // backArrows m_startNode->label() @@ -3876,11 +3876,12 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat graphForma QCString absImgName = absBaseName+"."+imgExt; bool regenerate = FALSE; + if (updateDotGraph(m_startNode, DotNode::CallGraph, absBaseName, graphFormat, - TRUE, // lrRank + m_inverse ? "RL" : "LR", // lrRank FALSE, // renderParents m_inverse, // backArrows m_startNode->label() @@ -133,8 +133,9 @@ class DotNode friend QCString computeMd5Signature( DotNode *root, GraphType gt, - GraphOutputFormat f, - bool lrRank, bool renderParents, + GraphOutputFormat f, + const QCString &rank, + bool renderParents, bool backArrows, const QCString &title, QCString &graphStr diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 4aaec34..68b49c2 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -609,7 +609,7 @@ static void addRelatedPage(EntryNav *rootNav) { pd->setBriefDescription(root->brief,root->briefFile,root->briefLine); pd->addSectionsToDefinition(root->anchors); - pd->setShowToc(root->stat); + pd->setLocalToc(root->localToc); addPageToContext(pd,rootNav); } } @@ -8716,7 +8716,7 @@ static void findMainPage(EntryNav *rootNav) //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); Doxygen::mainPage->setBriefDescription(root->brief,root->briefFile,root->briefLine); Doxygen::mainPage->setFileName(indexName); - Doxygen::mainPage->setShowToc(root->stat); + Doxygen::mainPage->setLocalToc(root->localToc); addPageToContext(Doxygen::mainPage,rootNav); SectionInfo *si = Doxygen::sectionDict->find(Doxygen::mainPage->name()); @@ -10218,11 +10218,6 @@ void readConfiguration(int argc, char **argv) { case 'g': genConfig=TRUE; - configName=getArg(argc,argv,optind); - if (optind+1<argc && qstrcmp(argv[optind+1],"-")==0) - { configName="-"; optind++; } - if (!configName) - { configName="Doxyfile"; } break; case 'l': genLayout=TRUE; @@ -10461,26 +10456,6 @@ void readConfiguration(int argc, char **argv) Config::init(); - if (genConfig && g_useOutputTemplate) - { - generateTemplateFiles("templates"); - cleanUpDoxygen(); - exit(0); - } - - if (genConfig) - { - generateConfigFile(configName,shortList); - cleanUpDoxygen(); - exit(0); - } - if (genLayout) - { - writeDefaultLayoutFile(layoutName); - cleanUpDoxygen(); - exit(0); - } - QFileInfo configFileInfo1("Doxyfile"),configFileInfo2("doxyfile"); if (optind>=argc) { @@ -10492,6 +10467,10 @@ void readConfiguration(int argc, char **argv) { configName="doxyfile"; } + else if (genConfig) + { + configName="Doxyfile"; + } else { err("Doxyfile not found and no input file specified!\n"); @@ -10502,7 +10481,7 @@ void readConfiguration(int argc, char **argv) else { QFileInfo fi(argv[optind]); - if (fi.exists() || qstrcmp(argv[optind],"-")==0) + if (fi.exists() || qstrcmp(argv[optind],"-")==0 || genConfig) { configName=argv[optind]; } @@ -10513,7 +10492,25 @@ void readConfiguration(int argc, char **argv) exit(1); } } + if (genConfig && g_useOutputTemplate) + { + generateTemplateFiles("templates"); + cleanUpDoxygen(); + exit(0); + } + if (genConfig) + { + generateConfigFile(configName,shortList); + cleanUpDoxygen(); + exit(0); + } + if (genLayout) + { + writeDefaultLayoutFile(layoutName); + cleanUpDoxygen(); + exit(0); + } if (!Config::parse(configName,updateConfig)) { diff --git a/src/entry.cpp b/src/entry.cpp index 9d15ec8..a0460da 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -73,6 +73,7 @@ Entry::Entry(const Entry &e) spec = e.spec; initLines = e.initLines; stat = e.stat; + localToc = e.localToc; explicitExternal = e.explicitExternal; proto = e.proto; subGrouping = e.subGrouping; diff --git a/src/entry.h b/src/entry.h index f1b81ef..fac3831 100644 --- a/src/entry.h +++ b/src/entry.h @@ -288,6 +288,7 @@ class Entry bool artificial; //!< Artificially introduced item GroupDocType groupDocType; QCString id; //!< libclang id + LocalToc localToc; static int num; //!< counts the total number of entries diff --git a/src/formula.cpp b/src/formula.cpp index 46e2075..c252e07 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -69,8 +69,10 @@ void FormulaList::generateBitmaps(const char *path) FTextStream t(&f); if (Config_getBool(LATEX_BATCHMODE)) t << "\\batchmode" << endl; t << "\\documentclass{article}" << endl; + t << "\\usepackage{ifthen}" << endl; t << "\\usepackage{epsfig}" << endl; // for those who want to include images writeExtraLatexPackages(t); + writeLatexSpecialFormulaChars(t); t << "\\pagestyle{empty}" << endl; t << "\\begin{document}" << endl; int page=0; diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index d71c48f..cee39f2 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -304,7 +304,7 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n) } else { - t << ">"; + t << "\">"; } t << convertToHtml(n->name); t << "</a>"; diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 32eaff6..121106a 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1117,7 +1117,8 @@ void HtmlGenerator::startIndexItem(const char *ref,const char *f) } t << "href=\""; t << externalRef(relPath,ref,TRUE); - if (f) t << f << Doxygen::htmlFileExtension << "\">"; + if (f) t << f << Doxygen::htmlFileExtension; + t << "\">"; } else { diff --git a/src/index.cpp b/src/index.cpp index 3706bbf..3c231fc 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -3883,9 +3883,9 @@ static void writeIndex(OutputList &ol) if (Doxygen::mainPage) { Doxygen::insideMainPage=TRUE; - if (Doxygen::mainPage->showToc() && Doxygen::mainPage->hasSections()) + if (Doxygen::mainPage->localToc().isHtmlEnabled() && Doxygen::mainPage->hasSections()) { - Doxygen::mainPage->writeToc(ol); + Doxygen::mainPage->writeToc(ol,Doxygen::mainPage->localToc()); } ol.startTextBlock(); diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 7fd27bb..d2c4c5d 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -219,7 +219,7 @@ void LatexDocVisitor::visit(DocURL *u) if (u->isEmail()) m_t << "mailto:"; m_t << u->url() << "}"; } - m_t << "{\\tt "; + m_t << "\\texttt{ "; filter(u->url()); m_t << "}"; } @@ -1249,7 +1249,7 @@ void LatexDocVisitor::visitPre(DocHRef *href) m_t << href->url(); m_t << "}"; } - m_t << "{\\tt "; + m_t << "\\texttt{ "; } void LatexDocVisitor::visitPost(DocHRef *) @@ -1496,7 +1496,7 @@ void LatexDocVisitor::visitPre(DocParamList *pl) { if (pl->direction()!=DocParamSect::Unspecified) { - m_t << "\\mbox{\\tt "; + m_t << "\\mbox{\\texttt{ "; if (pl->direction()==DocParamSect::In) { m_t << "in"; @@ -1509,7 +1509,7 @@ void LatexDocVisitor::visitPre(DocParamList *pl) { m_t << "in,out"; } - m_t << "} "; + m_t << "}} "; } if (useTable) m_t << " & "; } diff --git a/src/latexgen.cpp b/src/latexgen.cpp index ee29edc..474d368 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -182,7 +182,7 @@ void LatexCodeGenerator::writeCodeLink(const char *ref,const char *f, } else { - m_t << name; + codify(name); } m_col+=l; } @@ -583,7 +583,9 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\hbadness=750\n" "\\setlength{\\emergencystretch}{15pt}\n" "\\setlength{\\parindent}{0cm}\n" - "\\setlength{\\parskip}{3ex plus 2ex minus 2ex}\n"; + "\\newcommand{\\doxynormalparskip}{\\setlength{\\parskip}{3ex plus 2ex minus 2ex}}\n" + "\\newcommand{\\doxytocparskip}{\\setlength{\\parskip}{1ex plus 0ex minus 0ex}}\n" + "\\doxynormalparskip\n"; // Redefine paragraph/subparagraph environments, using sectsty fonts t << "\\makeatletter\n" "\\renewcommand{\\paragraph}{%\n" @@ -645,33 +647,29 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\usepackage{natbib}\n" "\\usepackage[titles]{tocloft}\n" "\\setcounter{tocdepth}{3}\n" - "\\setcounter{secnumdepth}{5}\n" - "\\makeindex\n" - "\n"; + "\\setcounter{secnumdepth}{5}\n"; + + QCString latex_mkidx_command = Config_getString(LATEX_MAKEINDEX_CMD); + if (!latex_mkidx_command.isEmpty()) + { + if (latex_mkidx_command[0] == '\\') + t << latex_mkidx_command << "\n"; + else + t << '\\' << latex_mkidx_command << "\n"; + } + else + { + t << "\\makeindex\n"; + } + t << "\n"; writeExtraLatexPackages(t); + writeLatexSpecialFormulaChars(t); // Hyperlinks bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS); if (pdfHyperlinks) { - unsigned char minus[4]; // Superscript minus - char *pminus = (char *)minus; - unsigned char sup2[3]; // Superscript two - char *psup2 = (char *)sup2; - unsigned char sup3[3]; - char *psup3 = (char *)sup3; // Superscript three - minus[0]= 0xE2; - minus[1]= 0x81; - minus[2]= 0xBB; - minus[3]= 0; - sup2[0]= 0xC2; - sup2[1]= 0xB2; - sup2[2]= 0; - sup3[0]= 0xC2; - sup3[1]= 0xB3; - sup3[2]= 0; - t << "% Hyperlinks (required, but should be loaded last)\n" "\\ifpdf\n" " \\usepackage[pdftex,pagebackref=true]{hyperref}\n" @@ -682,18 +680,6 @@ static void writeDefaultHeaderPart1(FTextStream &t) " \\usepackage[ps2pdf,pagebackref=true]{hyperref}\n" " \\fi\n" "\\fi\n" - "\\ifpdf\n" - " \\DeclareUnicodeCharacter{207B}{${}^{-}$}% Superscript minus\n" - " \\DeclareUnicodeCharacter{C2B2}{${}^{2}$}% Superscript two\n" - " \\DeclareUnicodeCharacter{C2B3}{${}^{3}$}% Superscript three\n" - "\\else\n" - " \\catcode`\\" << pminus << "=13% Superscript minus\n" - " \\def" << pminus << "{${}^{-}$}\n" - " \\catcode`\\" << psup2 << "=13% Superscript two\n" - " \\def" << psup2 << "{${}^{2}$}\n" - " \\catcode`\\"<<psup3<<"=13% Superscript three\n" - " \\def"<<psup3<<"{${}^{3}$}\n" - "\\fi\n" "\n" "\\hypersetup{%\n" " colorlinks=true,%\n" @@ -715,6 +701,11 @@ static void writeDefaultHeaderPart1(FTextStream &t) t << "\\usepackage{caption}\n" << "\\captionsetup{labelsep=space,justification=centering,font={bf},singlelinecheck=off,skip=4pt,position=top}\n\n"; + + // in page table of contents + t << "\\usepackage{etoc}\n" + "\\etocsettocstyle{\\doxytocparskip}{\\doxynormalparskip}\n"; + // prevent numbers overlap the titles in toc t << "\\renewcommand{\\numberline}[1]{#1~}\n"; @@ -1378,7 +1369,7 @@ void LatexGenerator::startHtmlLink(const char *url) t << url; t << "}"; } - t << "{\\tt "; + t << "\\texttt{ "; } void LatexGenerator::endHtmlLink() @@ -1394,7 +1385,7 @@ void LatexGenerator::endHtmlLink() // t << url; // t << "}"; // } -// t << "{\\tt "; +// t << "\\texttt{ "; // docify(url); // t << "}"; //} @@ -1402,7 +1393,7 @@ void LatexGenerator::endHtmlLink() void LatexGenerator::writeStartAnnoItem(const char *,const char *, const char *path,const char *name) { - t << "\\item\\contentsline{section}{\\bf "; + t << "\\item\\contentsline{section}\\textbf{ "; if (path) docify(path); docify(name); t << "} "; @@ -1437,7 +1428,7 @@ void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/) //void LatexGenerator::writeClassLink(const char *,const char *, // const char *,const char *name) //{ -// t << "{\\bf "; +// t << "\\textbf{ "; // docify(name); // t << "}"; //} @@ -2239,6 +2230,11 @@ void LatexGenerator::startCodeFragment() void LatexGenerator::endCodeFragment() { + //if (DoxyCodeOpen) + //{ + // t << "}\n"; + // DoxyCodeOpen = FALSE; + //} t << "\\end{DoxyCode}\n"; DoxyCodeOpen = FALSE; } diff --git a/src/marshal.cpp b/src/marshal.cpp index af14978..fa29aed 100644 --- a/src/marshal.cpp +++ b/src/marshal.cpp @@ -344,6 +344,14 @@ void marshalMemberLists(StorageIntf *s,SDict<MemberList> *mls) } } +void marshalLocalToc(StorageIntf *s,const LocalToc <) +{ + marshalInt(s,lt.mask()); + marshalInt(s,lt.htmlLevel()); + marshalInt(s,lt.latexLevel()); + marshalInt(s,lt.xmlLevel()); +} + void marshalEntry(StorageIntf *s,Entry *e) { marshalUInt(s,HEADER); @@ -355,6 +363,7 @@ void marshalEntry(StorageIntf *s,Entry *e) marshalUInt64(s,e->spec); marshalInt(s,e->initLines); marshalBool(s,e->stat); + marshalLocalToc(s,e->localToc); marshalBool(s,e->explicitExternal); marshalBool(s,e->proto); marshalBool(s,e->subGrouping); @@ -724,6 +733,28 @@ SDict<MemberList> *unmarshalMemberLists(StorageIntf *s) return result; } +LocalToc unmarshalLocalToc(StorageIntf *s) +{ + LocalToc result; + int mask = unmarshalInt(s); + int htmlLevel = unmarshalInt(s); + int latexLevel = unmarshalInt(s); + int xmlLevel = unmarshalInt(s); + if ((mask & (1<<LocalToc::Html))!=0) + { + result.enableHtml(htmlLevel); + } + if ((mask & (1<<LocalToc::Latex))!=0) + { + result.enableLatex(latexLevel); + } + if ((mask & (1<<LocalToc::Xml))!=0) + { + result.enableXml(xmlLevel); + } + return result; +} + Entry * unmarshalEntry(StorageIntf *s) { Entry *e = new Entry; @@ -737,6 +768,7 @@ Entry * unmarshalEntry(StorageIntf *s) e->spec = unmarshalUInt64(s); e->initLines = unmarshalInt(s); e->stat = unmarshalBool(s); + e->localToc = unmarshalLocalToc(s); e->explicitExternal = unmarshalBool(s); e->proto = unmarshalBool(s); e->subGrouping = unmarshalBool(s); diff --git a/src/pagedef.cpp b/src/pagedef.cpp index b2b7dc8..4721306 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -35,7 +35,6 @@ PageDef::PageDef(const char *f,int l,const char *n, m_pageScope = 0; m_nestingLevel = 0; m_fileName = ::convertNameToFile(n,FALSE,TRUE); - m_showToc = FALSE; } PageDef::~PageDef() @@ -207,9 +206,9 @@ void PageDef::writeDocumentation(OutputList &ol) ol.popGeneratorState(); //2.} - if (m_showToc && hasSections()) + if ((m_localToc.isHtmlEnabled() || m_localToc.isLatexEnabled()) && hasSections()) { - writeToc(ol); + writeToc(ol, m_localToc); } writePageDocumentation(ol); @@ -326,8 +325,7 @@ void PageDef::setNestingLevel(int l) m_nestingLevel = l; } -void PageDef::setShowToc(bool b) +void PageDef::setLocalToc(const LocalToc <) { - m_showToc |= b; + m_localToc = lt; } - diff --git a/src/pagedef.h b/src/pagedef.h index 41b84cb..27316cb 100644 --- a/src/pagedef.h +++ b/src/pagedef.h @@ -34,7 +34,7 @@ class PageDef : public Definition // setters void setFileName(const char *name); - void setShowToc(bool b); + void setLocalToc(const LocalToc &tl); // getters DefType definitionType() const { return TypePage; } @@ -59,7 +59,7 @@ class PageDef : public Definition bool documentedPage() const; bool hasSubPages() const; bool hasParentPage() const; - bool showToc() const { return m_showToc; } + LocalToc localToc() const { return m_localToc; } void setPageScope(Definition *d){ m_pageScope = d; } Definition *getPageScope() const { return m_pageScope; } QCString displayName(bool=TRUE) const { return !m_title.isEmpty() ? m_title : Definition::name(); } @@ -75,7 +75,7 @@ class PageDef : public Definition PageSDict *m_subPageDict; // list of pages in the group Definition *m_pageScope; int m_nestingLevel; - bool m_showToc; + LocalToc m_localToc; }; class PageSDict : public SDict<PageDef> diff --git a/src/plantuml.cpp b/src/plantuml.cpp index 609d5fd..89e6e9e 100644 --- a/src/plantuml.cpp +++ b/src/plantuml.cpp @@ -88,7 +88,9 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp { pumlArgs += "-graphvizdot \""; pumlArgs += dotPath; - pumlArgs += "dot\" "; + pumlArgs += "dot"; + pumlArgs += portable_commandExtension(); + pumlArgs += "\" "; } pumlArgs+="-o \""; pumlArgs+=outDir; @@ -1739,6 +1739,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) %x SkipString %x CopyLine %x CopyString +%x CopyStringCs %x CopyStringFtn %x CopyStringFtnDouble %x Include @@ -1850,6 +1851,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) <CopyLine>"'"."'" { outputArray(yytext,(int)yyleng); } +<CopyLine>@\" { + if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_CSharp) REJECT; + outputArray(yytext,(int)yyleng); + BEGIN( CopyStringCs ); + } <CopyLine>\" { outputChar(*yytext); if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) @@ -1869,10 +1875,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) <CopyString>[^\"\\\r\n]+ { outputArray(yytext,(int)yyleng); } +<CopyStringCs>[^\"\r\n]+ { + outputArray(yytext,(int)yyleng); + } <CopyString>\\. { outputArray(yytext,(int)yyleng); } -<CopyString>\" { +<CopyString,CopyStringCs>\" { outputChar(*yytext); BEGIN( CopyLine ); } @@ -1952,6 +1961,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) } } <CopyLine>"\\"\r?/\n { // strip line continuation characters + if (getLanguageFromFileName(g_yyFileName)==SrcLangExt_Fortran) outputChar(*yytext); } <CopyLine>. { outputChar(*yytext); diff --git a/src/types.h b/src/types.h index 806e6fc..e58c8fc 100644 --- a/src/types.h +++ b/src/types.h @@ -16,6 +16,7 @@ #ifndef TYPES_H #define TYPES_H +#include <string.h> #include <qcstring.h> /** @file @@ -218,4 +219,48 @@ enum FortranFormat FortranFormat_Fixed }; +class LocalToc +{ + public: + enum Type { + None = 0, // initial value + Html = 0, // index / also to be used as bit position in mask (1 << Html) + Latex = 1, // ... + Xml = 2, // ... + numTocTypes = 3 // number of enum values + }; + LocalToc() : m_mask(None) { memset(m_level,0,sizeof(m_level)); } + + // setters + void enableHtml(int level) + { + m_mask|=(1<<Html); + m_level[Html]=level; + } + void enableLatex(int level) + { + m_mask|=(1<<Latex); + m_level[Latex]=level; + } + void enableXml(int level) + { + m_mask|=(1<<Xml); + m_level[Xml]=level; + } + + // getters + bool isHtmlEnabled() const { return (m_mask & (1<<Html))!=0; } + bool isLatexEnabled() const { return (m_mask & (1<<Latex))!=0; } + bool isXmlEnabled() const { return (m_mask & (1<<Xml))!=0; } + bool nothingEnabled() const { return m_mask == None; } + int htmlLevel() const { return m_level[Html]; } + int latexLevel() const { return m_level[Latex]; } + int xmlLevel() const { return m_level[Xml]; } + int mask() const { return m_mask; } + + private: + int m_mask; + int m_level[numTocTypes]; +}; + #endif diff --git a/src/util.cpp b/src/util.cpp index 581ecfc..6c7e3d5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6741,6 +6741,16 @@ void filterLatexString(FTextStream &t,const char *str, { switch(c) { + case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd + // the LaTeX command \ucr has been defined in doxygen.sty + if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd) + { + t << "{\\ucr}"; + p += 2; + } + else + t << (char)c; + break; case '\\': t << "\\(\\backslash\\)"; break; case '{': t << "\\{"; break; case '}': t << "\\}"; break; @@ -6762,6 +6772,16 @@ void filterLatexString(FTextStream &t,const char *str, { switch(c) { + case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd + // the LaTeX command \ucr has been defined in doxygen.sty + if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd) + { + t << "{\\ucr}"; + p += 2; + } + else + t << (char)c; + break; case '#': t << "\\#"; break; case '$': t << "\\$"; break; case '%': t << "\\%"; break; @@ -8846,6 +8866,32 @@ void writeExtraLatexPackages(FTextStream &t) } } +void writeLatexSpecialFormulaChars(FTextStream &t) +{ + unsigned char minus[4]; // Superscript minus + char *pminus = (char *)minus; + unsigned char sup2[3]; // Superscript two + char *psup2 = (char *)sup2; + unsigned char sup3[3]; + char *psup3 = (char *)sup3; // Superscript three + minus[0]= 0xE2; + minus[1]= 0x81; + minus[2]= 0xBB; + minus[3]= 0; + sup2[0]= 0xC2; + sup2[1]= 0xB2; + sup2[2]= 0; + sup3[0]= 0xC2; + sup3[1]= 0xB3; + sup3[2]= 0; + + t << "\\usepackage{newunicodechar}\n" + " \\newunicodechar{" << pminus << "}{${}^{-}$}% Superscript minus\n" + " \\newunicodechar{" << psup2 << "}{${}^{2}$}% Superscript two\n" + " \\newunicodechar{" << psup3 << "}{${}^{3}$}% Superscript three\n" + "\n"; +} + //------------------------------------------------------ static int g_usedTableLevels = 0; @@ -478,6 +478,7 @@ void convertProtectionLevel( bool mainPageHasTitle(); bool openOutputFile(const char *outFile,QFile &f); void writeExtraLatexPackages(FTextStream &t); +void writeLatexSpecialFormulaChars(FTextStream &t); int usedTableLevels(); void incUsedTableLevels(); diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 63fc8ad..e68c454 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1838,9 +1838,62 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample) } } writeInnerPages(pd->getSubPages(),t); - if(pd->showToc()) - { - t << " <tableofcontents/>" << endl; + if (pd->localToc().isXmlEnabled()) + { + t << " <tableofcontents>" << endl; + SectionDict *sectionDict = pd->getSectionDict(); + SDict<SectionInfo>::Iterator li(*sectionDict); + SectionInfo *si; + int level=1,l; + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE }; + int maxLevel = pd->localToc().xmlLevel(); + for (li.toFirst();(si=li.current());++li) + { + if (si->type==SectionInfo::Section || + si->type==SectionInfo::Subsection || + si->type==SectionInfo::Subsubsection || + si->type==SectionInfo::Paragraph) + { + //printf(" level=%d title=%s\n",level,si->title.data()); + int nextLevel = (int)si->type; + if (nextLevel>level) + { + for (l=level;l<nextLevel;l++) + { + if (l < maxLevel) t << " <tableofcontents>" << endl; + } + } + else if (nextLevel<level) + { + for (l=level;l>nextLevel;l--) + { + if (l <= maxLevel && inLi[l]) t << " </tocsect>" << endl; + inLi[l]=FALSE; + if (l <= maxLevel) t << " </tableofcontents>" << endl; + } + } + if (l <= maxLevel && inLi[nextLevel]) t << " </tocsect>" << endl; + if (nextLevel <= maxLevel) + { + QCString titleDoc = convertToXML(si->title); + t << " <tocsect>" << endl; + t << " <name>" << (si->title.isEmpty()?si->label:titleDoc) << "</name>" << endl; + t << " <reference>" << convertToXML(pageName) << "_1" << convertToXML(si -> label) << "</reference>" << endl; + } + inLi[nextLevel]=TRUE; + level = nextLevel; + } + } + while (level>1 && level <= maxLevel) + { + if (inLi[level]) t << " </tocsect>" << endl; + inLi[level]=FALSE; + t << " </tableofcontents>" << endl; + level--; + } + if (level <= maxLevel && inLi[level]) t << " </tocsect>" << endl; + inLi[level]=FALSE; + t << " </tableofcontents>" << endl; } t << " <briefdescription>" << endl; writeXMLDocBlock(t,pd->briefFile(),pd->briefLine(),pd,0,pd->briefDescription()); diff --git a/templates/html/menu.js b/templates/html/menu.js index 89aaf57..433c15b 100644 --- a/templates/html/menu.js +++ b/templates/html/menu.js @@ -40,7 +40,7 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); if (searchEnabled) { if (serverSide) { - $('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.png" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>'); + $('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+relPath+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.png" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>'); } else { $('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.png" alt=""/></a></span></div></li>'); } diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty index 51e369b..7798d48 100644 --- a/templates/latex/doxygen.sty +++ b/templates/latex/doxygen.sty @@ -87,6 +87,8 @@ % Necessary for redefining not defined charcaters, i.e. "Replacement Character" in tex output. \newlength{\CodeWidthChar} \newlength{\CodeHeightChar} +\settowidth{\CodeWidthChar}{?} +\settoheight{\CodeHeightChar}{?} % Necessary for hanging indent \newlength{\DoxyCodeWidth} @@ -117,22 +119,15 @@ }{% \normalfont% \normalsize% + \settowidth{\CodeWidthChar}{?}% + \settoheight{\CodeHeightChar}{?}% } -% Redefining not defined charcaters, i.e. "Replacement Character" in tex output. +% Redefining not defined characters, i.e. "Replacement Character" in tex output. \def\ucr{\adjustbox{width=\CodeWidthChar,height=\CodeHeightChar}{\stackinset{c}{}{c}{-.2pt}{% \textcolor{white}{\sffamily\bfseries\small ?}}{% \rotatebox{45}{$\blacksquare$}}}} -% Choosing right setup for "Replacement character" -\ifpdf - \RequirePackage[utf8]{inputenc} - \DeclareUnicodeCharacter{FFFD}{\ucr} -\else - \catcode`\�=13 - \def�{\ucr} -\fi - % Used by @example, @include, @includelineno and @dontinclude \newenvironment{DoxyCodeInclude}[1]{% \DoxyCode{#1}% diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd index b4356ac..72d9097 100644 --- a/templates/xml/compound.xsd +++ b/templates/xml/compound.xsd @@ -29,7 +29,7 @@ <xsd:element name="innergroup" type="refType" minOccurs="0" maxOccurs="unbounded" /> <xsd:element name="templateparamlist" type="templateparamlistType" minOccurs="0" /> <xsd:element name="sectiondef" type="sectiondefType" minOccurs="0" maxOccurs="unbounded" /> - <xsd:element name="tableofcontents" minOccurs="0" maxOccurs="1" /> + <xsd:element name="tableofcontents" type="tableofcontentsType" minOccurs="0" maxOccurs="1" /> <xsd:element name="briefdescription" type="descriptionType" minOccurs="0" /> <xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" /> <xsd:element name="inheritancegraph" type="graphType" minOccurs="0" /> @@ -879,5 +879,19 @@ </xsd:restriction> </xsd:simpleType> + <xsd:complexType name="tableofcontentsType"> + <xsd:sequence> + <xsd:element name="tocsect" type="tableofcontentsKindType" minOccurs="1" maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="tableofcontentsKindType"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/> + <xsd:element name="reference" type="xsd:string" minOccurs="1" maxOccurs="1"/> + <xsd:element name="tableofcontents" type="tableofcontentsType" minOccurs="0" maxOccurs="unbounded" /> + </xsd:sequence> + </xsd:complexType> + </xsd:schema> diff --git a/testing/043/mypage.xml b/testing/043/mypage.xml index 79fb7ae..c9bd6d0 100644 --- a/testing/043/mypage.xml +++ b/testing/043/mypage.xml @@ -4,7 +4,34 @@ <compoundname>mypage</compoundname> <title>Page Title</title> <innerpage refid="another">Another Page</innerpage> - <tableofcontents/> + <tableofcontents> + <tocsect> + <name>Section Title.</name> + <reference>mypage_1mysect</reference> + <tableofcontents> + <tocsect> + <name>Subsection Title.</name> + <reference>mypage_1mysubsect</reference> + <tableofcontents> + <tocsect> + <name>Subsubsection Title.</name> + <reference>mypage_1mysubsubsect</reference> + <tableofcontents> + <tocsect> + <name>Paragraph Title.</name> + <reference>mypage_1mypara</reference> + </tocsect> + </tableofcontents> + </tocsect> + </tableofcontents> + </tocsect> + </tableofcontents> + </tocsect> + <tocsect> + <name>Another Section Title.</name> + <reference>mypage_1mysect2</reference> + </tocsect> + </tableofcontents> <briefdescription> <para>Page brief description. </para> </briefdescription> diff --git a/testing/043_page.dox b/testing/043_page.dox index 38c1894..d554da2 100644 --- a/testing/043_page.dox +++ b/testing/043_page.dox @@ -4,7 +4,7 @@ /** \page mypage Page Title * \brief Page brief description. * - * @tableofcontents + * @tableofcontents{xml,html,latex} * * Text at page level. See \ref mysect for more. * \section mysect Section Title. |