From 145b564516f82be1bb4cc5a82277e7c9d10ca5ca Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 28 Mar 2011 14:10:48 +0000 Subject: Release-1.7.4 --- INSTALL | 4 +- README | 4 +- configure | 8 +- doc/config.doc | 10 + doc/language.doc | 4 +- doc/translator_report.txt | 22 +- examples/Makefile.in | 10 +- examples/dbusxml.cfg | 1 + qtools/qvaluestack.h | 2 +- src/classdef.cpp | 617 +++++++++++++++++++++++++++++++++++---------- src/classdef.h | 19 +- src/classlist.cpp | 144 +++-------- src/classlist.h | 1 + src/code.l | 8 +- src/commentscan.l | 4 + src/config.l | 7 + src/config.xml | 6 + src/configoptions.cpp | 9 + src/dbusxmlscanner.cpp | 1 + src/definition.cpp | 16 +- src/diagram.cpp | 12 +- src/dirdef.cpp | 7 +- src/docparser.cpp | 14 +- src/dot.cpp | 26 +- src/doxygen.cpp | 77 ++++-- src/doxygen.css | 17 +- src/doxygen_css.h | 17 +- src/filedef.cpp | 7 +- src/fortrancode.l | 2 +- src/fortranscanner.l | 2 +- src/ftvhelp.cpp | 4 +- src/groupdef.cpp | 224 +++++++++------- src/groupdef.h | 1 + src/htmldocvisitor.cpp | 17 +- src/htmlgen.cpp | 88 ++++--- src/htmlgen.h | 16 +- src/htmlhelp.cpp | 2 +- src/index.cpp | 61 +++-- src/latexgen.cpp | 177 +++++++++---- src/latexgen.h | 10 +- src/layout.cpp | 5 + src/layout.h | 2 +- src/layout_default.h | 1 + src/layout_default.xml | 1 + src/libdoxygen.t | 4 +- src/mangen.cpp | 37 ++- src/mangen.h | 10 +- src/memberdef.cpp | 43 +++- src/memberdef.h | 3 +- src/membergroup.cpp | 15 +- src/membergroup.h | 7 +- src/memberlist.cpp | 79 ++++-- src/memberlist.h | 6 +- src/message.cpp | 28 +- src/message.h | 1 + src/namespacedef.cpp | 8 +- src/outputgen.cpp | 2 + src/outputgen.h | 10 +- src/outputlist.cpp | 1 + src/outputlist.h | 21 +- src/perlmodgen.cpp | 2 +- src/pre.h | 2 +- src/pre.l | 59 +++-- src/pycode.l | 2 +- src/rtfdocvisitor.cpp | 8 +- src/rtfgen.cpp | 73 +++++- src/rtfgen.h | 14 +- src/scanner.l | 2 +- src/textdocvisitor.cpp | 1 + src/translator_ru.h | 90 ++++++- src/util.cpp | 51 ++-- src/vhdlcode.l | 2 +- src/vhdldocgen.cpp | 183 ++++++++++---- src/vhdldocgen.h | 11 +- src/vhdlscanner.l | 170 +++++++------ src/xmldocvisitor.cpp | 2 +- src/xmlgen.cpp | 46 +++- winbuild/Doxygen.vcproj | 2 + winbuild/Doxytag.vcproj | 2 + winbuild/Doxywizard.vcproj | 2 + 80 files changed, 1879 insertions(+), 807 deletions(-) diff --git a/INSTALL b/INSTALL index f41a30c..eb1af46 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.7.3-20110217 +DOXYGEN Version 1.7.4 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (17 February 2011) +Dimitri van Heesch (28 March 2011) diff --git a/README b/README index 2468a81..acb5590 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.7.3_20110217 +DOXYGEN Version 1.7.4 Please read INSTALL for compilation instructions. @@ -26,4 +26,4 @@ forum. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (17 February 2011) +Dimitri van Heesch (dimitri@stack.nl) (28 March 2011) diff --git a/configure b/configure index eb43c20..1605bce 100755 --- a/configure +++ b/configure @@ -17,10 +17,10 @@ doxygen_version_major=1 doxygen_version_minor=7 -doxygen_version_revision=3 +doxygen_version_revision=4 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=20110217 +doxygen_version_mmn=NO bin_dirs=`echo $PATH | sed -e "s/:/ /g"` @@ -606,7 +606,7 @@ EOF echo " \$(MAKE) -C libmd5" >> $DST echo " \$(MAKE) -C src" >> $DST if test $f_wizard = YES; then - echo " \$(MAKE) -C addon/doxywizard" >> $DST + echo " \$(MAKE) MAN1DIR=\$(MAN1DIR) -C addon/doxywizard" >> $DST fi if test $f_app = YES; then echo " \$(MAKE) -C addon/doxyapp" >> $DST @@ -614,7 +614,7 @@ EOF echo "" >> $DST echo "doxywizard_install:" >> $DST if test $f_wizard = YES; then - echo " \$(MAKE) -C addon/doxywizard install" >> $DST + echo " \$(MAKE) MAN1DIR=\$(MAN1DIR) -C addon/doxywizard install" >> $DST fi echo "" >> $DST fi diff --git a/doc/config.doc b/doc/config.doc index 0a3b0ce..a511f8b 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -176,6 +176,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_include_path INCLUDE_PATH \refitem cfg_included_by_graph INCLUDED_BY_GRAPH \refitem cfg_inherit_docs INHERIT_DOCS +\refitem cfg_inline_grouped_classes INLINE_GROUPED_CLASSES \refitem cfg_inline_info INLINE_INFO \refitem cfg_inline_inherited_memb INLINE_INHERITED_MEMB \refitem cfg_inline_sources INLINE_SOURCES @@ -602,6 +603,15 @@ followed by the descriptions of the tags grouped by category. \c NO to prevent subgrouping. Alternatively, this can be done per class using the \ref cmdnosubgrouping "\\nosubgrouping" command. +\anchor cfg_inline_grouped_classes +
\c INLINE_GROUPED_CLASSES
+ \addindex INLINE_GROUPED_CLASSES +When the \c INLINE_GROUPED_CLASSES tag is set to \c YES, classes, structs and +unions are shown inside the group in which they are included +(e.g. using @@ingroup) instead of on a separate page (for HTML and Man pages) +or section (for LaTeX and RTF). Note that this feature does not work in +combination with \ref cfg_separate_member_pages "SEPARATE_MEMBER_PAGES". + \anchor cfg_typedef_hides_struct
\c TYPEDEF_HIDES_STRUCT
\addindex TYPEDEF_HIDES_STRUCT diff --git a/doc/language.doc b/doc/language.doc index 9622e87..250f166 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -236,7 +236,7 @@ when the translator was updated. Russian Alexandr Chelpanov cav at cryptopro dot ru - 1.6.0 + up-to-date Serbian @@ -388,7 +388,7 @@ when the translator was updated. Romanian & Ionut Dumitrascu & {\tt\tiny reddumy at yahoo dot com} & 1.6.0 \\ ~ & Alexandru Iosup & {\tt\tiny aiosup at yahoo dot com} & ~ \\ \hline - Russian & Alexandr Chelpanov & {\tt\tiny cav at cryptopro dot ru} & 1.6.0 \\ + Russian & Alexandr Chelpanov & {\tt\tiny cav at cryptopro dot ru} & up-to-date \\ \hline Serbian & Dejan Milosavljevic & {\tt\tiny [unreachable] dmilos at email dot com} & 1.6.0 \\ \hline diff --git a/doc/translator_report.txt b/doc/translator_report.txt index 91bda18..30c1d89 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -10,7 +10,7 @@ Persian, Polish, Portuguese, Romanian, Russian, Serbian, SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, Ukrainian, and Vietnamese. -Of them, 15 translators are up-to-date, 23 translators are based on +Of them, 16 translators are up-to-date, 22 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -31,6 +31,7 @@ still may be some details listed even for them: TranslatorItalian TranslatorKorean -- Change the base class to Translator. TranslatorPersian -- The MAX_DOT_GRAPH_HEIGHT found in trLegendDocs() + TranslatorRussian -- Reimplementation using UTF-8 suggested. TranslatorSlovak TranslatorSpanish -- The MAX_DOT_GRAPH_HEIGHT found in trLegendDocs() TranslatorTurkish @@ -55,9 +56,6 @@ must be implemented to become up-to-date: Note: Reimplementation using UTF-8 suggested. TranslatorSerbianCyrilic 1.6.0 9 methods to implement (4 %) - TranslatorRussian 1.6.0 9 methods to implement (4 %) - Note: Reimplementation using UTF-8 suggested. - TranslatorRomanian 1.6.0 9 methods to implement (4 %) Note: Reimplementation using UTF-8 suggested. @@ -670,22 +668,10 @@ TranslatorRomanian (TranslatorAdapter_1_6_0) 9 methods to implement (4 %) virtual QCString trIncludesFileIn(const char * name) -TranslatorRussian (TranslatorAdapter_1_6_0) 9 methods to implement (4 %) +TranslatorRussian (Translator) ----------------- - Implements 216 of the required methods (96 %). - - Missing methods (should be implemented): - - virtual QCString trSearching() - virtual QCString trNoMatches() - virtual QCString trLoading() - virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime) - virtual QCString trFileIn(const char * name) - virtual QCString trGlobalNamespace() - virtual QCString trDirRelation(const char * name) - virtual QCString trDirDependency(const char * name) - virtual QCString trIncludesFileIn(const char * name) + Implements 225 of the required methods (100 %). TranslatorSerbian (TranslatorAdapter_1_6_0) 9 methods to implement (4 %) diff --git a/examples/Makefile.in b/examples/Makefile.in index 6db4f01..55bce8f 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -25,13 +25,16 @@ all: class/html/index.html \ docstring/html/index.html \ pyexample/html/index.html \ mux/html/index.html \ - manual/html/index.html + manual/html/index.html + +# Disabled since it is broken :-( +# dbusxml/html/index.html clean: rm -rf class define enum file func page relates author \ par overload example include qtstyle jdstyle structcmd \ autolink tag restypedef afterdoc template tag group diagrams \ - memgrp docstring pyexample mux manual + memgrp docstring pyexample mux manual dbusxml class/html/index.html: class.h class.cfg $(DOXYGEN)/bin/doxygen class.cfg @@ -113,6 +116,9 @@ manual/html/index.html: manual.c manual.cfg docstring/html/index.html: docstring.py docstring.cfg $(DOXYGEN)/bin/doxygen docstring.cfg +#dbusxml/html/index.html: dbusxml.xml dbusxml.cfg +# $(DOXYGEN)/bin/doxygen dbusxml.cfg + diagrams/html/index.html: diagrams_a.h diagrams_b.h diagrams_c.h diagrams_d.h diagrams_e.h diagrams.cfg ifneq ($(HAVE_DOT),) $(DOXYGEN)/bin/doxygen diagrams.cfg diff --git a/examples/dbusxml.cfg b/examples/dbusxml.cfg index 686d40c..23b9dea 100644 --- a/examples/dbusxml.cfg +++ b/examples/dbusxml.cfg @@ -9,3 +9,4 @@ QUIET = YES JAVADOC_AUTOBRIEF = YES EXTRACT_ALL = YES SEARCHENGINE = NO +EXTENSION_MAPPING = xml=dbusxml diff --git a/qtools/qvaluestack.h b/qtools/qvaluestack.h index 3fb61fd..fe4462a 100644 --- a/qtools/qvaluestack.h +++ b/qtools/qvaluestack.h @@ -49,7 +49,7 @@ class Q_EXPORT QValueStack : public QValueList public: QValueStack() {} ~QValueStack() {} - void push( const T& d ) { append(d); } + void push( const T& d ) { QValueList::append(d); } T pop() { T elem( this->last() ); diff --git a/src/classdef.cpp b/src/classdef.cpp index d92eada..cb4f842 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -872,18 +872,15 @@ void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag) ol.disable(OutputGenerator::RTF); ol.writeString(" \n"); ol.enable(OutputGenerator::RTF); + ol.popGeneratorState(); if (Config_getBool("REPEAT_BRIEF") || !documentation().isEmpty() || exampleFlag ) { - ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(0,"_details"); - ol.parseText(theTranslator->trMore()); - ol.endTextLink(); + writeMoreLink(ol,anchor()); } - ol.popGeneratorState(); //ol.pushGeneratorState(); //ol.disable(OutputGenerator::RTF); @@ -894,9 +891,54 @@ void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag) ol.writeSynopsis(); } +void ClassDef::writeDetailedDocumentationBody(OutputList &ol) +{ + static bool repeatBrief = Config_getBool("REPEAT_BRIEF"); + + ol.startTextBlock(); + + writeTemplateSpec(ol,this,compoundTypeString()); + + // repeat brief description + if (!briefDescription().isEmpty() && repeatBrief) + { + ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE); + } + if (!briefDescription().isEmpty() && repeatBrief && + !documentation().isEmpty()) + { + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + ol.writeString("\n\n"); + ol.popGeneratorState(); + } + // write documentation + if (!documentation().isEmpty()) + { + ol.parseDoc(docFile(),docLine(),this,0,documentation(),TRUE,FALSE); + } + // write type constraints + writeTypeConstraints(ol,this,m_impl->typeConstraints); + + // write examples + if (hasExamples() && m_impl->exampleSDict) + { + ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": "); + ol.startDescForItem(); + ol.startParagraph(); + writeExample(ol,m_impl->exampleSDict); + ol.endParagraph(); + ol.endDescForItem(); + ol.endSimpleSect(); + } + //ol.newParagraph(); + writeSourceDef(ol,name()); + ol.endTextBlock(); +} + // write the detailed description for this class void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &pageType, bool exampleFlag, - const QCString &title) + const QCString &title,const QCString &anchor) { if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || !documentation().isEmpty() || @@ -904,57 +946,27 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &pageType exampleFlag) { ol.writeRuler(); + ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - ol.writeAnchor(0,"_details"); + ol.writeAnchor(0,anchor.isEmpty() ? QCString("details") : anchor); ol.popGeneratorState(); - ol.startGroupHeader(); - ol.parseText(title); - ol.endGroupHeader(); - ol.startTextBlock(); - - writeTemplateSpec(ol,this,pageType); - - // repeat brief description - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) - { - ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE); - } - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && - !documentation().isEmpty()) + if (!anchor.isEmpty()) { ol.pushGeneratorState(); - ol.disable(OutputGenerator::Man); - ol.disable(OutputGenerator::RTF); - //ol.newParagraph(); // FIXME:PARA - ol.enableAll(); - ol.disableAllBut(OutputGenerator::Man); - ol.writeString("\n\n"); + ol.disable(OutputGenerator::Html); + ol.disable(OutputGenerator::Man); + ol.writeAnchor(getOutputFileBase(),anchor); ol.popGeneratorState(); } - // write documentation - if (!documentation().isEmpty()) - { - ol.parseDoc(docFile(),docLine(),this,0,documentation(),TRUE,FALSE); - } - // write type constraints - writeTypeConstraints(ol,this,m_impl->typeConstraints); - // write examples - if (exampleFlag && m_impl->exampleSDict) - { - ol.startSimpleSect(BaseOutputDocInterface::Examples,0,0,theTranslator->trExamples()+": "); - ol.startDescForItem(); - ol.startParagraph(); - writeExample(ol,m_impl->exampleSDict); - ol.endParagraph(); - ol.endDescForItem(); - ol.endSimpleSect(); - } - //ol.newParagraph(); - writeSourceDef(ol,name()); - ol.endTextBlock(); + ol.startGroupHeader(); + ol.parseText(title); + ol.endGroupHeader(); + + writeDetailedDocumentationBody(ol); + } else { @@ -1160,7 +1172,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) } ol.writeObjectLink(cd->getReference(), cd->getOutputFileBase(), - 0, + cd->anchor(), displayName); } else @@ -1197,7 +1209,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) ClassDef *cd=bcd->classDef; if (cd->isLinkable()) { - ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,cd->displayName()); + ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),cd->displayName()); } else { @@ -1310,7 +1322,7 @@ void ClassDef::writeAllMembersLink(OutputList &ol) } } -void ClassDef::writeMemberGroups(OutputList &ol) +void ClassDef::writeMemberGroups(OutputList &ol,bool showInline) { // write user defined member groups if (m_impl->memberGroupSDict) @@ -1322,7 +1334,7 @@ void ClassDef::writeMemberGroups(OutputList &ol) { if (!mg->allMembersInSameSection() || !m_impl->subGrouping) // group is in its own section { - mg->writeDeclarations(ol,this,0,0,0); + mg->writeDeclarations(ol,this,0,0,0,showInline); } else // add this group to the corresponding member section { @@ -1431,98 +1443,357 @@ void ClassDef::writeSummaryLinks(OutputList &ol) ol.popGeneratorState(); } -// write all documentation for this class -void ClassDef::writeDocumentation(OutputList &ol) +void ClassDef::writeTagFileMarker(OutputList &ol) { - static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); - static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); - static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - QCString pageType = " "; - QCString pageTitle = " "; - - pageType += compoundTypeString(); - toupper(pageType.at(1)); - if (fortranOpt) + // write markers for tag file processing to the output + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.writeString(""); + if (m_impl->inherits && m_impl->inherits->count()>0) { - pageTitle = theTranslator->trCompoundReferenceFortran(displayName(), - m_impl->compType, - m_impl->tempArgs != 0); + BaseClassListIterator bli(*m_impl->inherits); + ol.writeString(""); } - else if (vhdlOpt) + ol.popGeneratorState(); + + // write section to the tag file + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) { - // TODO: translate - pageTitle = VhdlDocGen::getClassTitle(this)+" Reference"; + Doxygen::tagFile << " " << endl; + Doxygen::tagFile << " " << convertToXML(name()) << "" << endl; + Doxygen::tagFile << " " << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "" << endl; + if (!anchor().isEmpty()) + { + Doxygen::tagFile << " " << convertToXML(anchor()) << "" << endl; + } + if (m_impl->tempArgs) + { + ArgumentListIterator ali(*m_impl->tempArgs); + Argument *a; + for (;(a=ali.current());++ali) + { + Doxygen::tagFile << " " << convertToXML(a->name) << "" << endl; + } + } } - else +} + +#if 0 +void ClassDef::writeInlineDeclaration(OutputList &ol,bool first) +{ + //printf("ClassDef::writeInlineDeclaration for %s\n",name().data()); + bool exampleFlag=hasExamples(); + QListIterator eli( + LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); + LayoutDocEntry *lde; + ol.startMemberHeader(first ? "nested-classes" : 0); + //ol.parseText(name()+" "+theTranslator->trClassDocumentation()); + QCString s = compoundTypeString(); + if (s.length()>0 && isId(s.at(0))) s[0]=toupper(s[0]); + s+=" "+name(); + ol.parseText(s); + ol.endMemberHeader(); + ol.writeAnchor(getOutputFileBase(),anchor()); + ol.startInlineDescription(); + writeBriefDescription(ol,exampleFlag); + ol.endInlineDescription(); + for (eli.toFirst();(lde=eli.current());++eli) { - pageTitle = theTranslator->trCompoundReference(displayName(), - m_impl->compType == Interface && m_impl->lang==SrcLangExt_ObjC ? Class : m_impl->compType, - m_impl->tempArgs != 0); + if (lde->kind()==LayoutDocEntry::MemberDecl) + { + LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + writeMemberDeclarations(ol,lmd->type,lmd->title,lmd->subscript,TRUE); + } + else if (lde->kind()==LayoutDocEntry::MemberGroups) + { + writeMemberGroups(ol,TRUE); + } } - - startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView); - if (!generateTreeView) +} +#endif + +/** Write class documentation inside another container (i.e. a group) */ +void ClassDef::writeInlineDocumentation(OutputList &ol) +{ + ol.addIndexItem(name(),0); + //printf("ClassDef::writeInlineDocumentation(%s)\n",name().data()); + QListIterator eli( + LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); + LayoutDocEntry *lde; + + // part 1: anchor and title + QCString s = compoundTypeString()+" "+name(); + + // part 1a + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + { // only HTML only + ol.writeAnchor(0,anchor()); + ol.startMemberDoc(0,0,0,0,FALSE); + ol.startMemberDocName(FALSE); + ol.parseText(s); + ol.endMemberDocName(); + ol.endMemberDoc(FALSE); + ol.startIndent(); + } + ol.popGeneratorState(); + + // part 1b + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + ol.disable(OutputGenerator::Man); + { // for LaTeX/RTF only + ol.writeAnchor(getOutputFileBase(),anchor()); + } + ol.popGeneratorState(); + + // part 1c + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); { - if (getOuterScope()!=Doxygen::globalScope) + // for LaTeX/RTF/Man + ol.startGroupHeader(1); + ol.parseText(s); + ol.endGroupHeader(1); + } + ol.popGeneratorState(); + + // part 2: the header and detailed description + for (eli.toFirst();(lde=eli.current());++eli) + { + switch (lde->kind()) { - writeNavigationPath(ol); + case LayoutDocEntry::BriefDesc: + { + // since we already shown the brief description in the + // declaration part of the container, so we use this to + // show the details on top. + writeDetailedDocumentationBody(ol); + } + break; + case LayoutDocEntry::ClassInheritanceGraph: + writeInheritanceGraph(ol); + break; + case LayoutDocEntry::ClassCollaborationGraph: + writeCollaborationGraph(ol); + break; + case LayoutDocEntry::MemberDeclStart: + startMemberDeclarations(ol); + break; + case LayoutDocEntry::MemberDecl: + { + LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + writeMemberDeclarations(ol,lmd->type,lmd->title,lmd->subscript,TRUE); + } + break; + case LayoutDocEntry::MemberGroups: + { + writeMemberGroups(ol,TRUE); + } + break; + case LayoutDocEntry::MemberDeclEnd: + endMemberDeclarations(ol); + break; + case LayoutDocEntry::MemberDefStart: + startMemberDocumentation(ol); + break; + case LayoutDocEntry::MemberDef: + { + LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + writeMemberDocumentation(ol,lmd->type,lmd->title,TRUE); + } + break; + case LayoutDocEntry::MemberDefEnd: + endMemberDocumentation(ol); + break; + default: + break; } - ol.endQuickIndices(); } - startTitle(ol,getOutputFileBase(),this); - ol.parseText(pageTitle); - addGroupListToTitle(ol,this); - endTitle(ol,getOutputFileBase(),name()); - ol.startContents(); + // part 3: close the block + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + { // HTML only + ol.endIndent(); + } + ol.popGeneratorState(); + + // part 4: write tag file information + writeTagFileMarker(ol); +} + +void ClassDef::writeMoreLink(OutputList &ol,const QCString &anchor) +{ + // TODO: clean up this mess by moving it to + // the output generators... + static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS"); + static bool rtfHyperlinks = Config_getBool("RTF_HYPERLINKS"); + static bool usePDFLatex = Config_getBool("USE_PDFLATEX"); + // HTML only + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.docify(" "); + ol.startTextLink(getOutputFileBase(), + anchor.isEmpty() ? QCString("details") : anchor); + ol.parseText(theTranslator->trMore()); + ol.endTextLink(); + ol.popGeneratorState(); + + if (!anchor.isEmpty()) { ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - ol.writeString(""); - if (m_impl->inherits && m_impl->inherits->count()>0) + // LaTeX + RTF + ol.disable(OutputGenerator::Html); + ol.disable(OutputGenerator::Man); + if (!(usePDFLatex && pdfHyperlinks)) { - BaseClassListIterator bli(*m_impl->inherits); - ol.writeString(""); + ol.disable(OutputGenerator::Latex); + } + if (!rtfHyperlinks) + { + ol.disable(OutputGenerator::RTF); } + ol.docify(" "); + ol.startTextLink(getOutputFileBase(), anchor); + ol.parseText(theTranslator->trMore()); + ol.endTextLink(); + // RTF only + ol.disable(OutputGenerator::Latex); + ol.writeString("\\par"); ol.popGeneratorState(); } +} - Doxygen::indexList.addIndexItem(this,0); - if (!Config_getString("GENERATE_TAGFILE").isEmpty()) +void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *header,bool localNames) +{ + static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); + static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); + static bool hideUndocClasses = Config_getBool("HIDE_UNDOC_CLASSES"); + static bool extractLocalClasses = Config_getBool("EXTRACT_LOCAL_CLASSES"); + bool isLink = isLinkable(); + if (isLink || + (!hideUndocClasses && + (!isLocal() || extractLocalClasses) + ) + ) { - Doxygen::tagFile << " " << endl; - Doxygen::tagFile << " " << convertToXML(name()) << "" << endl; - Doxygen::tagFile << " " << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "" << endl; - if (m_impl->tempArgs) + if (!found) // first class { - ArgumentListIterator ali(*m_impl->tempArgs); - Argument *a; - for (;(a=ali.current());++ali) + ol.startMemberHeader("nested-classes"); + if (header) { - Doxygen::tagFile << " " << convertToXML(a->name) << "" << endl; + ol.parseText(header); + } + else if (vhdlOpt) + { + ol.parseText(VhdlDocGen::trVhdlType(VhdlDocGen::ARCHITECTURE,FALSE)); + } + else + { + ol.parseText(fortranOpt ? theTranslator->trDataTypes() : + theTranslator->trCompounds()); + } + ol.endMemberHeader(); + ol.startMemberList(); + found=TRUE; + } + if (!Config_getString("GENERATE_TAGFILE").isEmpty() && + !isReference()) // skip classes found in tag files + { + Doxygen::tagFile << " " << convertToXML(name()) << "" << endl; + } + ol.startMemberItem(FALSE); + QCString ctype = compoundTypeString(); + QCString cname; + if (localNames) + { + cname = localName(); + if (cname.right(2)=="-p" || cname.right(2)=="-g") + { + cname = cname.left(cname.length()-2); + } + } + else + { + cname = displayName(); + } + + if (!vhdlOpt) // for VHDL we swap the name and the type + { + ol.writeString(ctype); + ol.writeString(" "); + ol.insertMemberAlign(); + } + if (isLink) + { + ol.writeObjectLink(getReference(), + getOutputFileBase(), + anchor(), + cname + ); + } + else + { + ol.startBold(); + ol.docify(cname); + ol.endBold(); + } + if (vhdlOpt) // now write the type + { + ol.writeString(" "); + ol.insertMemberAlign(); + VhdlDocGen::writeClassType(this,ol,cname); + } + ol.endMemberItem(); + + // add the brief description if available + if (!briefDescription().isEmpty()) + { + ol.startMemberDescription(); + ol.parseDoc(briefFile(),briefLine(),this,0, + briefDescription(),FALSE,FALSE,0,TRUE,FALSE); + if (isLinkableInProject()) + { + writeMoreLink(ol,anchor()); } + ol.endMemberDescription(); } } +} + +void ClassDef::writeDocumentationContents(OutputList &ol,const QCString &pageTitle) +{ + ol.startContents(); + + QCString pageType = " "; + pageType += compoundTypeString(); + toupper(pageType.at(1)); + + writeTagFileMarker(ol); + + Doxygen::indexList.addIndexItem(this,0); if (Doxygen::searchIndex) { - Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase()); + Doxygen::searchIndex->setCurrentDoc(pageTitle,getOutputFileBase(),anchor()); Doxygen::searchIndex->addWord(localName(),TRUE); } bool exampleFlag=hasExamples(); @@ -1605,6 +1876,7 @@ void ClassDef::writeDocumentation(OutputList &ol) case LayoutDocEntry::FileIncludedByGraph: case LayoutDocEntry::FileSourceLink: case LayoutDocEntry::GroupClasses: + case LayoutDocEntry::GroupInlineClasses: case LayoutDocEntry::GroupNamespaces: case LayoutDocEntry::GroupDirs: case LayoutDocEntry::GroupNestedGroups: @@ -1625,8 +1897,50 @@ void ClassDef::writeDocumentation(OutputList &ol) writeDocAnchorsToTagFile(); Doxygen::tagFile << " " << endl; } - ol.endContents(); +} + +// write all documentation for this class +void ClassDef::writeDocumentation(OutputList &ol) +{ + static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); + static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); + static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); + QCString pageTitle; + + if (fortranOpt) + { + pageTitle = theTranslator->trCompoundReferenceFortran(displayName(), + m_impl->compType, + m_impl->tempArgs != 0); + } + else if (vhdlOpt) + { + // TODO: translate + pageTitle = VhdlDocGen::getClassTitle(this)+" Reference"; + } + else + { + pageTitle = theTranslator->trCompoundReference(displayName(), + m_impl->compType == Interface && m_impl->lang==SrcLangExt_ObjC ? Class : m_impl->compType, + m_impl->tempArgs != 0); + } + + startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView); + if (!generateTreeView) + { + if (getOuterScope()!=Doxygen::globalScope) + { + writeNavigationPath(ol); + } + ol.endQuickIndices(); + } + + startTitle(ol,getOutputFileBase(),this); + ol.parseText(pageTitle); + addGroupListToTitle(ol,this); + endTitle(ol,getOutputFileBase(),name()); + writeDocumentationContents(ol,pageTitle); if (generateTreeView) { @@ -1763,7 +2077,7 @@ void ClassDef::writeMemberList(OutputList &ol) endTitle(ol,0,0); ol.startContents(); ol.parseText(theTranslator->trThisIsTheListOfAllMembers()); - ol.writeObjectLink(getReference(),getOutputFileBase(),0,displayName()); + ol.writeObjectLink(getReference(),getOutputFileBase(),anchor(),displayName()); ol.parseText(theTranslator->trIncludingInheritedMembers()); //ol.startItemList(); @@ -1877,7 +2191,7 @@ void ClassDef::writeMemberList(OutputList &ol) ol.writeObjectLink( cd->getReference(), cd->getOutputFileBase(), - 0, + cd->anchor(), cd->displayName()); } else @@ -1895,7 +2209,7 @@ void ClassDef::writeMemberList(OutputList &ol) ol.writeString(""); ol.writeObjectLink(cd->getReference(), cd->getOutputFileBase(), - 0, + cd->anchor(), md->category() ? md->category()->displayName() : cd->displayName()); @@ -2564,14 +2878,15 @@ void ClassDef::addUsedClass(ClassDef *cd,const char *accessName) { ucd = new UsesClassDef(cd); m_impl->usesImplClassDict->insert(cd->name(),ucd); - //printf("Adding used class %s to class %s\n", - // cd->name().data(),name().data()); + //printf("Adding used class %s to class %s via accessor %s\n", + // cd->name().data(),name().data(),accessName); } ucd->addAccessor(accessName); } void ClassDef::addUsedByClass(ClassDef *cd,const char *accessName) { + //printf("%s::addUsedByClass(%s,%s)\n",name().data(),cd->name().data(),accessName); if (m_impl->usedByImplClassDict==0) { m_impl->usedByImplClassDict = new UsesClassDict(17); @@ -2819,22 +3134,39 @@ QCString ClassDef::compoundTypeString() const } } -QCString ClassDef::getOutputFileBase() const -{ +QCString ClassDef::getXmlOutputFileBase() const +{ if (m_impl->templateMaster) { + // point to the template of which this class is an instance return m_impl->templateMaster->getOutputFileBase(); } else if (isReference()) { + // point to the external location return m_impl->fileName; } else { + // normal locally defined class return convertNameToFile(m_impl->fileName); } } +QCString ClassDef::getOutputFileBase() const +{ + static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES"); + if (inlineGroupedClasses && partOfGroups()!=0) + { + // point to the group that embeds this class + return partOfGroups()->at(0)->getOutputFileBase(); + } + else + { + return getXmlOutputFileBase(); + } +} + QCString ClassDef::getInstanceOutputFileBase() const { if (isReference()) @@ -3314,7 +3646,7 @@ void ClassDef::sortMemberLists() } void ClassDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title, - const char *subTitle) + const char *subTitle,bool showInline) { static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); MemberList * ml = getMemberList(lt); @@ -3324,17 +3656,17 @@ void ClassDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,co { VhdlDocGen::writeVhdlDeclarations(ml,ol,0,this,0); } - else // ise generic declaration function + else // use generic declaration function { - ml->writeDeclarations(ol,this,0,0,0,title,subTitle); + ml->writeDeclarations(ol,this,0,0,0,title,subTitle,FALSE,showInline); } } } -void ClassDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title) +void ClassDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title,bool showInline) { MemberList * ml = getMemberList(lt); - if (ml) ml->writeDocumentation(ol,name(),this,title); + if (ml) ml->writeDocumentation(ol,name(),this,title,FALSE,showInline); } void ClassDef::writePlainMemberDeclaration(OutputList &ol,MemberList::ListType lt,bool inGroup) @@ -3539,3 +3871,34 @@ void ClassDef::reclassifyMember(MemberDef *md,MemberDef::MemberType t) insertMember(md); } +QCString ClassDef::anchor() const +{ + QCString anc; + if (isEmbeddedInGroupDocs()) + { + if (m_impl->templateMaster) + { + // point to the template of which this class is an instance + anc = m_impl->templateMaster->getOutputFileBase(); + } + else if (isReference()) + { + // point to the external location + anc = m_impl->fileName; + } + else + { + // normal locally defined class + anc = convertNameToFile(m_impl->fileName); + } + } + return anc; +} + +bool ClassDef::isEmbeddedInGroupDocs() const +{ + static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES"); + return (inlineGroupedClasses && partOfGroups()!=0); +} + + diff --git a/src/classdef.h b/src/classdef.h index ed18fa3..7b5ce86 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -96,6 +96,7 @@ class ClassDef : public Definition /*! Returns the unique base name (without extension) of the class's file on disk */ QCString getOutputFileBase() const; + QCString getXmlOutputFileBase() const; QCString getInstanceOutputFileBase() const; QCString getFileBase() const; @@ -263,6 +264,9 @@ class ClassDef : public Definition bool isUsedOnly() const; + QCString anchor() const; + bool isEmbeddedInGroupDocs() const; + //----------------------------------------------------------------------------------- // --- setters ---- //----------------------------------------------------------------------------------- @@ -317,6 +321,9 @@ class ClassDef : public Definition void writeQuickMemberLinks(OutputList &ol,MemberDef *md) const; void writeSummaryLinks(OutputList &ol); void reclassifyMember(MemberDef *md,MemberDef::MemberType t); + void writeInlineDocumentation(OutputList &ol); + void writeDeclarationLink(OutputList &ol,bool &found, + const char *header,bool localNames); bool visited; @@ -327,28 +334,32 @@ class ClassDef : public Definition void showUsedFiles(OutputList &ol); private: + void writeTagFileMarker(OutputList &ol); + void writeDocumentationContents(OutputList &ol,const QCString &pageTitle); void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList); QCString getMemberListFileName() const; void addMemberToList(MemberList::ListType lt,MemberDef *md,bool isBrief); MemberList *createMemberList(MemberList::ListType lt); void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title, - const char *subTitle=0); - void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title); + const char *subTitle=0,bool showInline=FALSE); + void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title,bool showInline=FALSE); void writePlainMemberDeclaration(OutputList &ol,MemberList::ListType lt,bool inGroup); void writeBriefDescription(OutputList &ol,bool exampleFlag); void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag, - const QCString &title); + const QCString &title,const QCString &anchor=QCString()); void writeIncludeFiles(OutputList &ol); void writeAllMembersLink(OutputList &ol); void writeInheritanceGraph(OutputList &ol); void writeCollaborationGraph(OutputList &ol); - void writeMemberGroups(OutputList &ol); + void writeMemberGroups(OutputList &ol,bool showInline=FALSE); void writeNestedClasses(OutputList &ol,const QCString &title); void startMemberDeclarations(OutputList &ol); void endMemberDeclarations(OutputList &ol); void startMemberDocumentation(OutputList &ol); void endMemberDocumentation(OutputList &ol); void writeAuthorSection(OutputList &ol); + void writeMoreLink(OutputList &ol,const QCString &anchor); + void writeDetailedDocumentationBody(OutputList &ol); ClassDefImpl *m_impl; diff --git a/src/classlist.cpp b/src/classlist.cpp index b802cc6..953cf61 100644 --- a/src/classlist.cpp +++ b/src/classlist.cpp @@ -96,10 +96,8 @@ bool ClassSDict::declVisible(const ClassDef::CompoundType *filter) const void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter, const char *header,bool localNames) { - static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); - static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - static bool hideUndocClasses = Config_getBool("HIDE_UNDOC_CLASSES"); - static bool extractLocalClasses = Config_getBool("EXTRACT_LOCAL_CLASSES"); +// static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES"); +// bool first=TRUE; if (count()>0) { ClassSDict::Iterator sdi(*this); @@ -107,111 +105,53 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f bool found=FALSE; for (sdi.toFirst();(cd=sdi.current());++sdi) { + //printf(" ClassSDict::writeDeclaration for %s\n",cd->name().data()); if (cd->name().find('@')==-1 && (filter==0 || *filter==cd->compoundType()) ) { - bool isLink = cd->isLinkable(); - if (isLink || - (!hideUndocClasses && - (!cd->isLocal() || extractLocalClasses) - ) - ) - { - if (!found) - { - ol.startMemberHeader("nested-classes"); - if (header) - { - ol.parseText(header); - } - else if (vhdlOpt) - { - ol.parseText(VhdlDocGen::trVhdlType(VhdlDocGen::ARCHITECTURE,FALSE)); - } - else - { - ol.parseText(fortranOpt ? theTranslator->trDataTypes() : - theTranslator->trCompounds()); - } - ol.endMemberHeader(); - ol.startMemberList(); - found=TRUE; - } - if (!Config_getString("GENERATE_TAGFILE").isEmpty() && - !cd->isReference()) // skip classes found in tag files - { - Doxygen::tagFile << " compoundTypeString() - << "\">" << convertToXML(cd->name()) << "" << endl; - } - ol.startMemberItem(FALSE); - QCString tmp = cd->compoundTypeString(); - QCString cname; - if (localNames) - { - cname = cd->localName(); - if (cname.right(2)=="-p" || cname.right(2)=="-g") - { - cname = cname.left(cname.length()-2); - } - } - else - { - cname = cd->displayName(); - } - - if (!vhdlOpt) // for VHDL we swap the name and the type - { - ol.writeString(tmp); - ol.writeString(" "); - ol.insertMemberAlign(); - } - if (isLink) - { - ol.writeObjectLink(cd->getReference(), - cd->getOutputFileBase(), - 0, - cname - ); - } - else - { - ol.startBold(); - ol.docify(cname); - ol.endBold(); - } - if (vhdlOpt) // now write the type - { - ol.insertMemberAlign(); - VhdlDocGen::writeClassType(cd,ol,cname); - } - ol.endMemberItem(); - if (!cd->briefDescription().isEmpty()) - { - ol.startMemberDescription(); - ol.parseDoc(cd->briefFile(),cd->briefLine(),cd,0, - cd->briefDescription(),FALSE,FALSE,0,TRUE,FALSE); - if (//(!cd->briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || - //!cd->documentation().isEmpty()) - cd->isLinkableInProject() - ) - { - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - //ol.endEmphasis(); - ol.docify(" "); - ol.startTextLink(cd->getOutputFileBase(),"_details"); - ol.parseText(theTranslator->trMore()); - ol.endTextLink(); - //ol.startEmphasis(); - ol.popGeneratorState(); - } - ol.endMemberDescription(); - } - } +// //bool isLink = cd->isLinkable(); +// if (inlineGroupedClasses && cd->partOfGroups()->count()>0) +// { +// cd->writeInlineDeclaration(ol,first); +// first=FALSE; +// } +// else // show link's only +// { + cd->writeDeclarationLink(ol,found,header,localNames); +// } } } if (found) ol.endMemberList(); } } +void ClassSDict::writeDocumentation(OutputList &ol) +{ + static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); + + static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES"); + if (!inlineGroupedClasses) return; + + if (count()>0) + { + ol.writeRuler(); + ol.startGroupHeader(); + ol.parseText(fortranOpt?theTranslator->trTypeDocumentation(): + theTranslator->trClassDocumentation()); + ol.endGroupHeader(); + + ClassSDict::Iterator sdi(*this); + ClassDef *cd=0; + for (sdi.toFirst();(cd=sdi.current());++sdi) + { + if (cd->name().find('@')==-1 && + cd->partOfGroups()->count()==1 + ) + { + cd->writeInlineDocumentation(ol); + } + } + } +} + diff --git a/src/classlist.h b/src/classlist.h index 8c9cdb3..efa2b7a 100644 --- a/src/classlist.h +++ b/src/classlist.h @@ -54,6 +54,7 @@ class ClassSDict : public SDict int compareItems(GCI item1,GCI item2); void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter=0, const char *header=0,bool localNames=FALSE); + void writeDocumentation(OutputList &ol); bool declVisible(const ClassDef::CompoundType *filter=0) const; }; diff --git a/src/code.l b/src/code.l index 804bad8..55045ea 100644 --- a/src/code.l +++ b/src/code.l @@ -469,10 +469,12 @@ static void startCodeLine() //lineAnchor.sprintf("l%05d",g_yyLineNr); Definition *d = g_sourceFileDef->getSourceDefinition(g_yyLineNr); + //printf("%s:startCodeLine(%d)=%p\n",g_sourceFileDef->name().data(),g_yyLineNr,d); if (!g_includeCodeFragment && d) { g_currentDefinition = d; g_currentMemberDef = g_sourceFileDef->getSourceMember(g_yyLineNr); + //printf("->startCodeLine(%s)=%p\n",d->name().data(),g_currentMemberDef); g_insideBody = FALSE; g_searchingForBody = TRUE; g_realScope = d->name().copy(); @@ -1000,7 +1002,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, } ol.linkableSymbol(g_yyLineNr,cd->name(),cd, g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); - writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),0,clName,cd->briefDescriptionAsTooltip()); + writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),clName,cd->briefDescriptionAsTooltip()); addToSearchIndex(className); g_theCallContext.setClass(cd); if (md) @@ -1552,7 +1554,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) writeMultiLineCodeLink(*g_code, cd->getReference(), cd->getOutputFileBase(), - 0, + cd->anchor(), pObject->data(), cd->briefDescriptionAsTooltip()); } @@ -1568,7 +1570,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx) writeMultiLineCodeLink(*g_code, cd->getReference(), cd->getOutputFileBase(), - 0, + cd->anchor(), pObject->data(), cd->briefDescriptionAsTooltip()); } diff --git a/src/commentscan.l b/src/commentscan.l index 3284e57..b95ae7c 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1039,6 +1039,10 @@ RCSTAG "$"{ID}":"[^\n$]+"$" ^{B}*"."{B}*/\n { // explicit end autolist: e.g " ." addOutput(yytext); } +^{B}*"-" { // start of autolist + setOutput(OutputDoc); + addOutput(yytext); + } ("."+)[a-z_A-Z0-9\)] { // . at start or in the middle of a word, or ellipsis addOutput(yytext); } diff --git a/src/config.l b/src/config.l index 99f9aac..f5e9ee0 100644 --- a/src/config.l +++ b/src/config.l @@ -1197,6 +1197,13 @@ void Config::check() config_err("When enabling GENERATE_HTMLHELP the search engine (SEARCHENGINE) should be disabled. I'll do it for you.\n"); Config_getBool("SEARCHENGINE")=FALSE; } + + // check if SEPARATE_MEMBER_PAGES and INLINE_GROUPED_CLASSES are both enabled + if (Config_getBool("SEPARATE_MEMBER_PAGES") && Config_getBool("INLINE_GROUPED_CLASSES")) + { + config_err("When enabling INLINE_GROUPED_CLASSES the SEPARATE_MEMBER_PAGES option should be disabled. I'll do it for you.\n"); + Config_getBool("SEPARATE_MEMBER_PAGES")=FALSE; + } // check dot image format QCString &dotImageFormat=Config_getEnum("DOT_IMAGE_FORMAT"); diff --git a/src/config.xml b/src/config.xml index cbdcb42..2883b83 100644 --- a/src/config.xml +++ b/src/config.xml @@ -282,6 +282,12 @@ subgroup of that type (e.g. under the Public Functions section). Set it to NO to prevent subgrouping. Alternatively, this can be done per class using the \nosubgrouping command. ' defval='1'/> +
\n"; } void lineBreak(const char *style); void writeChar(char c); - void startMemberDoc(const char *,const char *,const char *,const char *); + void startMemberDoc(const char *,const char *,const char *,const char *,bool); void endMemberDoc(bool); void startDoxyAnchor(const char *fName,const char *manName, const char *anchor,const char *name, diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 9945ede..4d16c14 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -483,6 +483,7 @@ void HtmlHelp::createProjectFile() t << s << endl; s = indexFiles.next(); } +#if 0 // items not found by the html help compiler scan. t << "tabs.css" << endl; t << "tab_a.png" << endl; @@ -492,7 +493,6 @@ void HtmlHelp::createProjectFile() t << "nav_h.png" << endl; t << "nav_f.png" << endl; t << "bc_s.png" << endl; -#if 0 if (Config_getBool("HTML_DYNAMIC_SECTIONS")) { t << "open.png" << endl; diff --git a/src/index.cpp b/src/index.cpp index 35002de..8d1e4c5 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -56,6 +56,7 @@ static const char search_script[]= //; int annotatedClasses; +int annotatedClassesPrinted; int hierarchyClasses; int documentedFiles; int documentedGroups; @@ -75,14 +76,14 @@ void countFiles(int &htmlFiles,int &files); int countGroups(); int countDirs(); int countNamespaces(); -int countAnnotatedClasses(); +int countAnnotatedClasses(int *cp); int countNamespaceMembers(int filter=NMHL_All); int countIncludeFiles(); void countRelatedPages(int &docPages,int &indexPages); void countDataStructures() { - annotatedClasses = countAnnotatedClasses(); // "classes" + "annotated" + annotatedClasses = countAnnotatedClasses(&annotatedClassesPrinted); // "classes" + "annotated" hierarchyClasses = countClassHierarchy(); // "hierarchy" countFiles(documentedHtmlFiles,documentedFiles); // "files" countRelatedPages(documentedPages,indexedPages); // "pages" @@ -418,9 +419,9 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level,F ol.docify(" [external]"); ol.endTypewriter(); } - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); if (ftv) - ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); } else { @@ -481,7 +482,7 @@ void writeClassTree(BaseClassList *cl,int level) //printf("tree2: Has children %s: %d\n",cd->name().data(),hasChildren); if (cd->isLinkable()) { - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); } if (hasChildren) { @@ -514,7 +515,7 @@ void writeClassTreeNode(ClassDef *cd,bool &started,int level) //printf("node: Has children %s: %d\n",cd->name().data(),hasChildren); if (cd->isLinkable()) { - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); } if (hasChildren) { @@ -616,9 +617,9 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT ol.docify(" [external]"); ol.endTypewriter(); } - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); if (ftv) - ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); } else { @@ -1062,23 +1063,28 @@ void writeNamespaceIndex(OutputList &ol) //---------------------------------------------------------------------------- -int countAnnotatedClasses() +int countAnnotatedClasses(int *cp) { int count=0; - //ClassDef *cd=Doxygen::classList.first(); + int countPrinted=0; ClassSDict::Iterator cli(*Doxygen::classSDict); ClassDef *cd; for (;(cd=cli.current());++cli) { if (cd->isLinkableInProject() && cd->templateMaster()==0) { - //printf("Annotated class %s\n",cd->name().data()); + if (!cd->isEmbeddedInGroupDocs()) + { + countPrinted++; + } count++; } } + *cp = countPrinted; return count; } + //---------------------------------------------------------------------- void writeAnnotatedClassList(OutputList &ol) @@ -1135,6 +1141,12 @@ void writeAnnotatedClassList(OutputList &ol) for (cli.toFirst();(cd=cli.current());++cli) { + ol.pushGeneratorState(); + if (cd->isEmbeddedInGroupDocs()) + { + ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::RTF); + } if (cd->isLinkableInProject() && cd->templateMaster()==0) { QCString type=cd->compoundTypeString(); @@ -1144,9 +1156,10 @@ void writeAnnotatedClassList(OutputList &ol) { QCString prot= VhdlDocGen::getProtectionName((VhdlDocGen::VhdlClasses)cd->protection()); ol.docify(prot.data()); + ol.writeString(" "); ol.insertMemberAlign(); } - ol.writeObjectLink(0,cd->getOutputFileBase(),0,cd->displayName()); + ol.writeObjectLink(0,cd->getOutputFileBase(),cd->anchor(),cd->displayName()); ol.endIndexKey(); bool hasBrief = !cd->briefDescription().isEmpty(); ol.startIndexValue(hasBrief); @@ -1165,8 +1178,9 @@ void writeAnnotatedClassList(OutputList &ol) } ol.endIndexValue(cd->getOutputFileBase(),hasBrief); //ol.writeEndAnnoItem(cd->getOutputFileBase()); - Doxygen::indexList.addContentsItem(FALSE,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + Doxygen::indexList.addContentsItem(FALSE,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); } + ol.popGeneratorState(); } ol.endIndexList(); } @@ -1383,7 +1397,7 @@ void writeAlphabeticalClassList(OutputList &ol) } ol.writeObjectLink(cd->getReference(), - cd->getOutputFileBase(),0,cname); + cd->getOutputFileBase(),cd->anchor(),cname); if (!namesp.isEmpty()) { ol.docify(" ("); @@ -1428,8 +1442,6 @@ void writeAlphabeticalClassList(OutputList &ol) void writeAlphabeticalIndex(OutputList &ol) { - //bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); - //bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); if (annotatedClasses==0) return; ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -1455,10 +1467,17 @@ void writeAlphabeticalIndex(OutputList &ol) void writeAnnotatedIndex(OutputList &ol) { + //printf("writeAnnotatedIndex: count=%d printed=%d\n", + // annotatedClasses,annotatedClassesPrinted); if (annotatedClasses==0) return; ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); + if (annotatedClassesPrinted==0) + { + ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::RTF); + } LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassAnnotated); QCString title = lne->title(); startFile(ol,"annotated",0,title,HLI_Annotated); @@ -3535,7 +3554,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) if (cd->isLinkable()) { //printf("node: Has children %s\n",cd->name().data()); - Doxygen::indexList.addContentsItem(FALSE,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + Doxygen::indexList.addContentsItem(FALSE,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); } } @@ -4076,18 +4095,18 @@ void writeIndex(OutputList &ol) ol.startIndexSection(isClassHierarchyIndex); ol.parseText(/*projPrefix+*/ (fortranOpt ? theTranslator->trCompoundIndexFortran() : - vhdlOpt ? VhdlDocGen::trDesignUnitIndex() : + vhdlOpt ? VhdlDocGen::trDesignUnitIndex() : theTranslator->trCompoundIndex() )); ol.endIndexSection(isClassHierarchyIndex); } - if (annotatedClasses>0) + if (annotatedClassesPrinted>0) { ol.startIndexSection(isCompoundIndex); ol.parseText(/*projPrefix+*/ (fortranOpt ? theTranslator->trCompoundIndexFortran() : - vhdlOpt ? VhdlDocGen::trDesignUnitIndex() : - theTranslator->trCompoundIndex() + vhdlOpt ? VhdlDocGen::trDesignUnitIndex() : + theTranslator->trCompoundIndex() )); ol.endIndexSection(isCompoundIndex); } diff --git a/src/latexgen.cpp b/src/latexgen.cpp index ff00d0f..6c297b8 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -95,7 +95,7 @@ void LatexGenerator::init() FTextStream t(&file); if (!Config_getBool("USE_PDFLATEX")) // use plain old latex { - t << "all: clean refman.dvi" << endl + t << "all: refman.dvi" << endl << endl << "ps: refman.ps" << endl << endl @@ -116,7 +116,7 @@ void LatexGenerator::init() #else t << "\tps2pdf refman.ps refman.pdf" << endl << endl; #endif - t << "refman.dvi: refman.tex doxygen.sty" << endl + t << "refman.dvi: clean refman.tex doxygen.sty" << endl << "\techo \"Running latex...\"" << endl << "\t" << latex_command << " refman.tex" << endl << "\techo \"Running makeindex...\"" << endl @@ -144,9 +144,9 @@ void LatexGenerator::init() } else // use pdflatex for higher quality output { - t << "all: clean refman.pdf" << endl << endl + t << "all: refman.pdf" << endl << endl << "pdf: refman.pdf" << endl << endl; - t << "refman.pdf: refman.tex" << endl; + t << "refman.pdf: clean refman.tex" << endl; t << "\tpdflatex refman.tex" << endl; t << "\tmakeindex refman.idx" << endl; t << "\tpdflatex refman.tex" << endl @@ -161,7 +161,11 @@ void LatexGenerator::init() t << endl << "clean:" << endl +#if defined(_MSC_VER) + << "\tdel /s/y " +#else << "\trm -f " +#endif << "*.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf" << endl; createSubDirs(d); @@ -236,6 +240,8 @@ static void writeDefaultHeaderPart1(FTextStream &t) t << "\\usepackage{mathptmx}\n"; t << "\\usepackage[scaled=.90]{helvet}\n"; t << "\\usepackage{courier}\n"; + t << "\\usepackage{sectsty}\n"; + t << "\\usepackage[titles]{tocloft}\n"; t << "\\usepackage{doxygen}\n"; // define option for listings @@ -318,46 +324,46 @@ static void writeDefaultStyleSheetPart1(FTextStream &t) "\\RequirePackage{longtable}\n" "\\RequirePackage{verbatim}\n" "\\RequirePackage{ifthen}\n" - "\\RequirePackage{xcolor}\n\n"; + "\\RequirePackage[table]{xcolor}\n\n"; t << "% Use helvetica font instead of times roman\n" "\\RequirePackage{helvet}\n" "\\RequirePackage{sectsty}\n" "\\RequirePackage{tocloft}\n" - "\\allsectionsfont{\\usefont{OT1}{phv}{bc}{n}\\selectfont}\n" - "\\providecommand{\\cftchapfont}{%\n" - " \\fontsize{11}{13}\\usefont{OT1}{phv}{bc}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftchappagefont}{%\n" - " \\fontsize{11}{13}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftsecfont}{%\n" - " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftsecpagefont}{%\n" - " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftsubsecfont}{%\n" - " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftsubsecpagefont}{%\n" - " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftsubsubsecfont}{%\n" - " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftsubsubsecpagefont}{%\n" - " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftparafont}{%\n" - " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cftparapagefont}{%\n" - " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" - "}\n" - "\\providecommand{\\cfttoctitlefont}{%\n" - " \\fontsize{20}{22}\\usefont{OT1}{phv}{b}{n}\\selectfont\n" - "}\n" +// "\\allsectionsfont{\\usefont{OT1}{phv}{bc}{n}\\selectfont}\n" +// "\\providecommand{\\cftchapfont}{%\n" +// " \\fontsize{11}{13}\\usefont{OT1}{phv}{bc}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftchappagefont}{%\n" +// " \\fontsize{11}{13}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftsecfont}{%\n" +// " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftsecpagefont}{%\n" +// " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftsubsecfont}{%\n" +// " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftsubsecpagefont}{%\n" +// " \\fontsize{10}{12}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftsubsubsecfont}{%\n" +// " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftsubsubsecpagefont}{%\n" +// " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftparafont}{%\n" +// " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cftparapagefont}{%\n" +// " \\fontsize{9}{11}\\usefont{OT1}{phv}{c}{n}\\selectfont\n" +// "}\n" +// "\\providecommand{\\cfttoctitlefont}{%\n" +// " \\fontsize{20}{22}\\usefont{OT1}{phv}{b}{n}\\selectfont\n" +// "}\n" "\\providecommand{\\rmdefault}{phv}\n" "\\providecommand{\\bfdefault}{bc}\n" "\n\n"; @@ -738,16 +744,21 @@ static void writeDefaultStyleSheetPart3(FTextStream &t) t << "\\setlength{\\parindent}{0cm}\n"; t << "\\setlength{\\parskip}{0.2cm}\n"; - t << "\\addtocounter{secnumdepth}{1}\n"; + t << "\\addtocounter{secnumdepth}{2}\n"; // \sloppy should not be used, see bug 563698 //t << "\\sloppy\n"; t << "\\usepackage[T1]{fontenc}\n"; t << "\\makeatletter\n"; t << "\\renewcommand{\\paragraph}{\\@startsection{paragraph}{4}{0ex}%\n"; - t << " {-3.25ex plus -1ex minus -0.2ex}%\n"; - t << " {1.5ex plus 0.2ex}%\n"; - t << " {\\normalfont\\normalsize\\bfseries}}\n"; + t << " {-1.0ex}%\n"; + t << " {1.0ex}%\n"; + t << " {\\usefont{OT1}{phv}{bc}{n}\\color{darkgray}}}\n"; + t << "\\renewcommand{\\subparagraph}{\\@startsection{subparagraph}{5}{0ex}%\n"; + t << " {-1.0ex}%\n"; + t << " {1.0ex}%\n"; + t << " {\\usefont{OT1}{phv}{bc}{n}\\color{darkgray}}}\n"; t << "\\makeatother\n"; + t << "\\allsectionsfont{\\usefont{OT1}{phv}{bc}{n}\\selectfont\\color{darkgray}}\n"; t << "\\stepcounter{secnumdepth}\n"; t << "\\stepcounter{tocdepth}\n"; t << "\\definecolor{comment}{rgb}{0.5,0.0,0.0}\n"; @@ -948,7 +959,10 @@ void LatexGenerator::startIndexSection(IndexSections is) bool found=FALSE; for (cli.toFirst();(cd=cli.current()) && !found;++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInGroupDocs() + ) { if (compactLatex) t << "\\section"; else t << "\\chapter"; t << "{"; //Compound Documentation}\n"; @@ -1126,7 +1140,10 @@ void LatexGenerator::endIndexSection(IndexSections is) bool found=FALSE; for (cli.toFirst();(cd=cli.current()) && !found;++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInGroupDocs() + ) { t << "}\n\\input{" << cd->getOutputFileBase() << "}\n"; found=TRUE; @@ -1134,7 +1151,10 @@ void LatexGenerator::endIndexSection(IndexSections is) } for (;(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInGroupDocs() + ) { //if (compactLatex) t << "\\input"; else t << "\\include"; t << "\\input"; @@ -1524,20 +1544,33 @@ void LatexGenerator::startTitle() } } -void LatexGenerator::startGroupHeader() +void LatexGenerator::startGroupHeader(int extraIndentLevel) { if (Config_getBool("COMPACT_LATEX")) { - t << "\\subsubsection{"; + extraIndentLevel++; } - else + + if (extraIndentLevel==3) + { + t << "\\subparagraph*{"; + } + else if (extraIndentLevel==2) + { + t << "\\paragraph{"; + } + else if (extraIndentLevel==1) + { + t << "\\subsubsection{"; + } + else // extraIndentLevel==0 { t << "\\subsection{"; } disableLinks=TRUE; } -void LatexGenerator::endGroupHeader() +void LatexGenerator::endGroupHeader(int) { disableLinks=FALSE; t << "}" << endl; @@ -1565,7 +1598,8 @@ void LatexGenerator::endMemberHeader() void LatexGenerator::startMemberDoc(const char *clname, const char *memname, const char *, - const char *title) + const char *title, + bool showInline) { if (memname && memname[0]!='@') { @@ -1595,7 +1629,13 @@ void LatexGenerator::startMemberDoc(const char *clname, } t << "}" << endl; } - if (Config_getBool("COMPACT_LATEX")) t << "\\paragraph"; else t << "\\subsubsection"; + static const char *levelLab[] = { "subsubsection","paragraph","subparagraph", "subparagraph" }; + static bool compactLatex = Config_getBool("COMPACT_LATEX"); + int level=0; + if (showInline) level+=2; + if (compactLatex) level++; + t << "\\" << levelLab[level]; + //if (Config_getBool("PDF_HYPERLINKS") && memname) //{ // t << "["; @@ -1613,7 +1653,7 @@ void LatexGenerator::endMemberDoc(bool) { disableLinks=FALSE; t << "}"; - if (Config_getBool("COMPACT_LATEX")) t << "\\hfill"; + //if (Config_getBool("COMPACT_LATEX")) t << "\\hfill"; } void LatexGenerator::startDoxyAnchor(const char *fName,const char *, @@ -1903,7 +1943,8 @@ void LatexGenerator::endMemberDescription() { if (!insideTabbing) { - t << "\\item\\end{DoxyCompactList}"; + //t << "\\item\\end{DoxyCompactList}"; + t << "\\end{DoxyCompactList}"; } else { @@ -1944,12 +1985,19 @@ void LatexGenerator::endMemberList() void LatexGenerator::startMemberGroupHeader(bool hasHeader) { if (hasHeader) t << "\\begin{Indent}"; - t << "{\\bf "; + if (Config_getBool("COMPACT_LATEX")) + { + t << "\\subparagraph*{"; + } + else + { + t << "\\paragraph*{"; + } } void LatexGenerator::endMemberGroupHeader() { - t << "}\\par" << endl; + t << "}" << endl; } void LatexGenerator::startMemberGroupDocs() @@ -2301,3 +2349,20 @@ void LatexGenerator::endCodeAnchor() { } +void LatexGenerator::startInlineHeader() +{ + if (Config_getBool("COMPACT_LATEX")) + { + t << "\\paragraph*{"; + } + else + { + t << "\\subsubsection*{"; + } +} + +void LatexGenerator::endInlineHeader() +{ + t << "}" << endl; +} + diff --git a/src/latexgen.h b/src/latexgen.h index fc341fa..c1e4e52 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -91,8 +91,8 @@ class LatexGenerator : public OutputGenerator void endHtmlLink(); void startTypewriter() { t << "{\\ttfamily "; } void endTypewriter() { t << "}"; } - void startGroupHeader(); - void endGroupHeader(); + void startGroupHeader(int); + void endGroupHeader(int); void startItemListItem() { t << "\\item " << endl; } void endItemListItem() {} @@ -108,6 +108,10 @@ class LatexGenerator : public OutputGenerator void endMemberDocList() {} void startMemberList(); void endMemberList(); + void startInlineDescription() {} + void endInlineDescription() {} + void startInlineHeader(); + void endInlineHeader(); void startAnonTypeScope(int); void endAnonTypeScope(int); void startMemberItem(int); @@ -140,7 +144,7 @@ class LatexGenerator : public OutputGenerator void startDescItem(); void endDescItem(); void lineBreak(const char *style=0) { (void)style; t << "\\par\n"; } - void startMemberDoc(const char *,const char *,const char *,const char *); + void startMemberDoc(const char *,const char *,const char *,const char *,bool); void endMemberDoc(bool); void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *); void endDoxyAnchor(const char *,const char *); diff --git a/src/layout.cpp b/src/layout.cpp index cefda0f..46b90a7 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -612,6 +612,11 @@ class LayoutParser : public QXmlDefaultHandler new StartElementHandler(this,&LayoutParser::startMemberDef)); m_sHandler.insert("group/memberdef/pagedocs", new StartElementHandlerKind(this,LayoutDocEntry::GroupPageDocs,&LayoutParser::startSimpleEntry)); + m_sHandler.insert("group/memberdef/inlineclasses", + new StartElementHandlerSection(this,LayoutDocEntry::GroupInlineClasses,&LayoutParser::startSectionEntry, + fortranOpt ? theTranslator->trTypeDocumentation() : + theTranslator->trClassDocumentation() + )); m_sHandler.insert("group/memberdef/defines", new StartElementHandlerMember(this,&LayoutParser::startMemberDefEntry, MemberList::docDefineMembers,theTranslator->trDefineDocumentation())); diff --git a/src/layout.h b/src/layout.h index e985077..febcd87 100644 --- a/src/layout.h +++ b/src/layout.h @@ -52,7 +52,7 @@ struct LayoutDocEntry FileIncludedByGraph, FileSourceLink, // Group specific items - GroupClasses, GroupNamespaces, + GroupClasses, GroupInlineClasses, GroupNamespaces, GroupDirs, GroupNestedGroups, GroupFiles, GroupGraph, GroupPageDocs, diff --git a/src/layout_default.h b/src/layout_default.h index b4227aa..377ac52 100644 --- a/src/layout_default.h +++ b/src/layout_default.h @@ -154,6 +154,7 @@ " \n" " \n" " \n" +" \n" " \n" " \n" " \n" diff --git a/src/layout_default.xml b/src/layout_default.xml index 4e20439..e8faa6d 100644 --- a/src/layout_default.xml +++ b/src/layout_default.xml @@ -154,6 +154,7 @@ + diff --git a/src/libdoxygen.t b/src/libdoxygen.t index fe5268b..b603380 100644 --- a/src/libdoxygen.t +++ b/src/libdoxygen.t @@ -84,7 +84,7 @@ sub GenerateDep { #$ GenerateDep("commentcnv.cpp","commentcnv.l"); $(LEX) -PcommentcnvYY -t commentcnv.l | $(INCBUFSIZE) >commentcnv.cpp -#$GenerateDep("commentscan.cpp","commentscan.l"); +#$ GenerateDep("commentscan.cpp","commentscan.l"); $(LEX) -PcommentScanYY -t commentscan.l | $(INCBUFSIZE) >commentscan.cpp #$ GenerateDep("ce_lex.cpp","constexp.l","ce_parse.h"); @@ -97,6 +97,8 @@ sub GenerateDep { $(YACC) -l -d -p cppExpYY constexp.y -o ce_parse.c -rm ce_parse.c +#$ GenerateDep("layout.cpp","layout_default.h"); + TO_C_CMD=sed -e "s/\\\\/\\\\\\\\/g" -e "s/\"/\\\\\"/g" -e "s/^/\"/g" -e "s/$$/\\\\n\"/g" index_xsd.h: index.xsd diff --git a/src/mangen.cpp b/src/mangen.cpp index 55069d8..585754f 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -239,7 +239,7 @@ void ManGenerator::endHtmlLink() // docify(url); //} -void ManGenerator::startGroupHeader() +void ManGenerator::startGroupHeader(int) { if (!firstCol) t << endl; t << ".SH \""; @@ -247,7 +247,7 @@ void ManGenerator::startGroupHeader() firstCol=FALSE; } -void ManGenerator::endGroupHeader() +void ManGenerator::endGroupHeader(int) { t << "\"\n.PP " << endl; firstCol=TRUE; @@ -387,7 +387,7 @@ void ManGenerator::endCodeFragment() col=0; } -void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *) +void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *,bool) { if (!firstCol) t << endl; t << ".SS \""; @@ -586,8 +586,8 @@ void ManGenerator::startSection(const char *,const char *,SectionInfo::SectionTy { switch(type) { - case SectionInfo::Page: startGroupHeader(); break; - case SectionInfo::Section: startGroupHeader(); break; + case SectionInfo::Page: startGroupHeader(FALSE); break; + case SectionInfo::Section: startGroupHeader(FALSE); break; case SectionInfo::Subsection: startMemberHeader(0); break; case SectionInfo::Subsubsection: startMemberHeader(0); break; case SectionInfo::Paragraph: startMemberHeader(0); break; @@ -602,8 +602,8 @@ void ManGenerator::endSection(const char *,SectionInfo::SectionType type) { switch(type) { - case SectionInfo::Page: endGroupHeader(); break; - case SectionInfo::Section: endGroupHeader(); break; + case SectionInfo::Page: endGroupHeader(0); break; + case SectionInfo::Section: endGroupHeader(0); break; case SectionInfo::Subsection: endMemberHeader(); break; case SectionInfo::Subsubsection: endMemberHeader(); break; case SectionInfo::Paragraph: endMemberHeader(); break; @@ -715,5 +715,28 @@ void ManGenerator::endConstraintList() { } +void ManGenerator::startInlineDescription() +{ +} + +void ManGenerator::endInlineDescription() +{ +} + +void ManGenerator::startInlineHeader() +{ + if (!firstCol) + { + t << endl << ".PP" << endl << ".in -1c" << endl; + } + t << ".RI \"\\fB"; +} + +void ManGenerator::endInlineHeader() +{ + t << "\\fP\"" << endl << ".in +1c" << endl; + firstCol = FALSE; +} + diff --git a/src/mangen.h b/src/mangen.h index 64ff5b0..c635fc5 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -88,8 +88,8 @@ class ManGenerator : public OutputGenerator void endHtmlLink(); void startTypewriter() { t << "\\fC"; firstCol=FALSE; } void endTypewriter() { t << "\\fP"; firstCol=FALSE; } - void startGroupHeader(); - void endGroupHeader(); + void startGroupHeader(int); + void endGroupHeader(int); void startMemberSections() {} void endMemberSections() {} void startHeaderSection() {} @@ -106,6 +106,10 @@ class ManGenerator : public OutputGenerator void endMemberDocList() {} void startMemberList(); void endMemberList(); + void startInlineDescription(); + void endInlineDescription(); + void startInlineHeader(); + void endInlineHeader(); void startAnonTypeScope(int); void endAnonTypeScope(int); void startMemberItem(int); @@ -137,7 +141,7 @@ class ManGenerator : public OutputGenerator void endDescItem(); void lineBreak(const char *) { t << "\n.br" << endl; } void writeChar(char c); - void startMemberDoc(const char *,const char *,const char *,const char *); + void startMemberDoc(const char *,const char *,const char *,const char *,bool); void endMemberDoc(bool); void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *); void endDoxyAnchor(const char *,const char *) {} diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 5508a3a..8479370 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include "md5.h" #include "memberdef.h" #include "membername.h" #include "doxygen.h" @@ -1158,6 +1158,7 @@ bool MemberDef::isBriefSectionVisible() const !hasDocs ); + //printf("visibleIfStatic=%d visibleIfDocumented=%d visibleIfEnabled=%d " // "visibleIfPrivate=%d visibltIfNotDefaultCDTor=%d " // "visibleIfFriendCompound=%d !annScope=%d\n", @@ -1168,7 +1169,7 @@ bool MemberDef::isBriefSectionVisible() const bool visible = visibleIfStatic && visibleIfDocumented && visibleIfEnabled && visibleIfPrivate && /*visibleIfDocVirtual &&*/ visibleIfNotDefaultCDTor && - visibleIfFriendCompound && + visibleIfFriendCompound && !m_impl->annScope; //printf("MemberDef::isBriefSectionVisible() %d\n",visible); return visible; @@ -1682,7 +1683,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, const char *scName, Definition *container, bool inGroup, - bool showEnumValues + bool showEnumValues, + bool showInline ) { // if this member is in a group find the real scope name. @@ -1763,7 +1765,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (vmd->isEnumerate() && ldef.mid(i,l)==vmd->name()) { ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); - ol.startMemberDoc(cname,name(),memAnchor,name()); + ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef.left(i)); vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef()); linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef.right(ldef.length()-i-l)); @@ -1775,7 +1777,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, { //printf("Anonymous compound `%s'\n",cname.data()); ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); - ol.startMemberDoc(cname,name(),memAnchor,name()); + ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); // strip anonymous compound names from definition int si=ldef.find(' '),pi,ei=i+l; if (si==-1) si=0; @@ -1793,7 +1795,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, else // not an enum value { ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); - ol.startMemberDoc(cname,name(),memAnchor,name()); + ol.startMemberDoc(ciname,name(),memAnchor,name(),showInline); ClassDef *cd=getClassDef(); if (!Config_getBool("HIDE_SCOPE_NAMES")) @@ -1916,7 +1918,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, isFriend() || isRelated() || (isInline() && Config_getBool("INLINE_INFO")) || isSignal() || isSlot() || - isStatic() || (m_impl->classDef && m_impl->classDef!=container) || + isStatic() || + (m_impl->classDef && m_impl->classDef!=container && container->definitionType()==TypeClass) || (m_impl->memSpec & ~Entry::Inline)!=0 ) ) @@ -1971,7 +1974,13 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (isSlot()) sl.append("slot"); } } - if (m_impl->classDef && m_impl->classDef!=container) sl.append("inherited"); + if (m_impl->classDef && + container->definitionType()==TypeClass && + m_impl->classDef!=container + ) + { + sl.append("inherited"); + } } const char *s=sl.first(); while (s) @@ -2059,7 +2068,17 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, if (!detailed.isEmpty() || !inbodyDocumentation().isEmpty()) { - ol.parseDoc(docFile(),docLine(),getOuterScope()?getOuterScope():container,this,detailed+"\n",TRUE,FALSE); + // write vhdl inline code with or without option INLINE_SOURCE + if (optVhdl && VhdlDocGen::isMisc(this)) + { + VhdlDocGen::writeSource(this,ol,cname); + return; + } + else + { + ol.parseDoc(docFile(),docLine(),getOuterScope()?getOuterScope():container,this,detailed+"\n",TRUE,FALSE); + } + if (!inbodyDocumentation().isEmpty()) { ol.startParagraph(); @@ -2126,8 +2145,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.startDescTable(); } - ol.addIndexItem(fmd->name(),cname); - ol.addIndexItem(cname,fmd->name()); + ol.addIndexItem(fmd->name(),ciname); + ol.addIndexItem(ciname,fmd->name()); //Doxygen::indexList.addIndexItem( // ciname, // level1 @@ -2223,7 +2242,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, 0,bcd->displayName()); if (bcd->isLinkableInProject()/* && !Config_getBool("PDF_HYPERLINKS")*/ ) { - writePageRef(ol,bcd->getOutputFileBase(),0); + writePageRef(ol,bcd->getOutputFileBase(),bcd->anchor()); } } ol.parseText(reimplFromLine.right( diff --git a/src/memberdef.h b/src/memberdef.h index 121780e..0ddda3d 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -345,7 +345,8 @@ class MemberDef : public Definition bool inGroup); void writeDocumentation(MemberList *ml,OutputList &ol, const char *scopeName,Definition *container, - bool inGroup,bool showEnumValues=FALSE); + bool inGroup,bool showEnumValues=FALSE,bool + showInline=FALSE); void warnIfUndocumented(); MemberDef *createTemplateInstanceMember(ArgumentList *formalArgs, diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 0e463f9..5a5fd80 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -105,12 +105,13 @@ void MemberGroup::setAnchors(ClassDef *context) } void MemberGroup::writeDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd) + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + bool showInline) { //printf("MemberGroup::writeDeclarations() %s\n",grpHeader.data()); QCString ldoc = doc; - if (!ldoc.isEmpty()) ldoc.prepend(""); - memberList->writeDeclarations(ol,cd,nd,fd,gd,grpHeader,ldoc/*,TRUE,TRUE*/); + if (!ldoc.isEmpty()) ldoc.prepend(""); + memberList->writeDeclarations(ol,cd,nd,fd,gd,grpHeader,ldoc,FALSE,showInline); } void MemberGroup::writePlainDeclarations(OutputList &ol, @@ -122,9 +123,9 @@ void MemberGroup::writePlainDeclarations(OutputList &ol, } void MemberGroup::writeDocumentation(OutputList &ol,const char *scopeName, - Definition *container) + Definition *container,bool showEnumValues,bool showInline) { - memberList->writeDocumentation(ol,scopeName,container,0); + memberList->writeDocumentation(ol,scopeName,container,0,showEnumValues,showInline); } void MemberGroup::writeDocumentationPage(OutputList &ol,const char *scopeName, @@ -146,11 +147,11 @@ void MemberGroup::addToDeclarationSection() } } -int MemberGroup::countDecMembers(/*bool sectionPerType*/) +int MemberGroup::countDecMembers(GroupDef *gd) { if (m_numDecMembers==-1) /* number of member not cached */ { - memberList->countDecMembers(/*TRUE,TRUE,sectionPerType*/); + memberList->countDecMembers(gd); m_numDecMembers = memberList->numDecMembers(); } return m_numDecMembers; diff --git a/src/membergroup.h b/src/membergroup.h index 326e59d..bf9ff97 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -50,16 +50,17 @@ class MemberGroup void writePlainDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); void writeDeclarations(OutputList &ol, - ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); + ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, + bool showInline=FALSE); void writeDocumentation(OutputList &ol,const char *scopeName, - Definition *container); + Definition *container,bool showEnumValues,bool showInline); void writeDocumentationPage(OutputList &ol,const char *scopeName, Definition *container); QCString documentation() { return doc; } bool allMembersInSameSection() { return inSameSection; } void addToDeclarationSection(); - int countDecMembers(); + int countDecMembers(GroupDef *gd=0); int countDocMembers(); void distributeMemberGroupDocumentation(); void findSectionsInDocumentation(); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index d41f7f9..fd37977 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -66,7 +66,7 @@ int MemberList::compareItems(GCI item1, GCI item2) /*! Count the number of members in this list that are visible in * the declaration part of a compound's documentation page. */ -void MemberList::countDecMembers(bool countEnumValues) +void MemberList::countDecMembers(bool countEnumValues,GroupDef *gd) { if (m_numDecMembers!=-1) return; @@ -118,7 +118,7 @@ void MemberList::countDecMembers(bool countEnumValues) MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->countDecMembers(); + mg->countDecMembers(gd); m_varCnt+=mg->varCount(); m_funcCnt+=mg->funcCount(); m_enumCnt+=mg->enumCount(); @@ -313,7 +313,11 @@ void MemberList::writePlainDeclarations(OutputList &ol, if (enumVars==0) // show enum here { //printf("Enum!!\n"); - if (first) ol.startMemberList(),first=FALSE; + if (first) + { + ol.startMemberList(); + first=FALSE; + } ol.startMemberItem(0); ol.writeString("enum "); ol.insertMemberAlign(); @@ -326,8 +330,7 @@ void MemberList::writePlainDeclarations(OutputList &ol, md->briefFile(),md->briefLine(), cd,md, md->briefDescription(), - TRUE, - FALSE + TRUE,FALSE,0,TRUE,FALSE ); if (md->isDetailedSectionLinkable()) { @@ -347,7 +350,11 @@ void MemberList::writePlainDeclarations(OutputList &ol, } case MemberDef::Friend: { - if (first) ol.startMemberList(),first=FALSE; + if (first) + { + ol.startMemberList(); + first=FALSE; + } md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); break; } @@ -378,7 +385,11 @@ void MemberList::writePlainDeclarations(OutputList &ol, //printf("anonymous compound members\n"); if (md->isBriefSectionVisible()) { - if (first) ol.startMemberList(),first=FALSE; + if (first) + { + ol.startMemberList(); + first=FALSE; + } md->writeDeclaration(ol,cd,nd,fd,gd,m_inGroup); } md->setFromAnonymousScope(TRUE); @@ -386,7 +397,10 @@ void MemberList::writePlainDeclarations(OutputList &ol, } } - if (!first) ol.endMemberList(); + if (!first) + { + ol.endMemberList(); + } ol.popGeneratorState(); //printf("----- end writePlainDeclaration() ----\n"); @@ -394,13 +408,13 @@ void MemberList::writePlainDeclarations(OutputList &ol, void MemberList::writeDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - const char *title,const char *subtitle, bool showEnumValues - /*, bool inGroup,bool countSubGroups*/) + const char *title,const char *subtitle, bool showEnumValues, + bool showInline) { //printf("----- writeDeclaration() this=%p ----\n",this); static bool optimizeVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); - countDecMembers(showEnumValues); // count member not in group + countDecMembers(showEnumValues,gd); // count members shown in this section Definition *ctx = cd; if (ctx==0 && nd) ctx = nd; if (ctx==0 && gd) ctx = gd; @@ -409,12 +423,26 @@ void MemberList::writeDeclarations(OutputList &ol, if (numDecMembers()==0) return; //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n", // this,title,subtitle,numDecMembers()); - ol.startMemberHeader(listTypeAsString()); if (title) { + if (showInline) + { + ol.startInlineHeader(); + } + else + { + ol.startMemberHeader(listTypeAsString()); + } ol.parseText(title); + if (showInline) + { + ol.endInlineHeader(); + } + else + { + ol.endMemberHeader(); + } } - ol.endMemberHeader(); if (subtitle) { QCString st=subtitle; @@ -422,7 +450,7 @@ void MemberList::writeDeclarations(OutputList &ol, if (!st.isEmpty()) { ol.startMemberSubtitle(); - ol.parseDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,0,TRUE,FALSE); + ol.parseDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE,0,FALSE,FALSE); ol.endMemberSubtitle(); } } @@ -477,7 +505,7 @@ void MemberList::writeDeclarations(OutputList &ol, void MemberList::writeDocumentation(OutputList &ol, const char *scopeName, Definition *container, - const char *title,bool showEnumValues) + const char *title,bool showEnumValues,bool showInline) { //printf("MemberList::writeDocumentation()\n"); @@ -487,9 +515,9 @@ void MemberList::writeDocumentation(OutputList &ol, if (title) { ol.writeRuler(); - ol.startGroupHeader(); + ol.startGroupHeader(showInline ? 2 : 0); ol.parseText(title); - ol.endGroupHeader(); + ol.endGroupHeader(showInline ? 2 : 0); } ol.startMemberDocList(); @@ -497,7 +525,8 @@ void MemberList::writeDocumentation(OutputList &ol, MemberDef *md; for ( ; (md=mli.current()) ; ++mli) { - md->writeDocumentation(this,ol,scopeName,container,m_inGroup,showEnumValues); + md->writeDocumentation(this,ol,scopeName,container, + m_inGroup,showEnumValues,showInline); } if (memberGroupList) { @@ -506,7 +535,7 @@ void MemberList::writeDocumentation(OutputList &ol, MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->writeDocumentation(ol,scopeName,container); + mg->writeDocumentation(ol,scopeName,container,showEnumValues,showInline); } } ol.endMemberDocList(); @@ -527,6 +556,7 @@ void MemberList::writeDocumentationPage(OutputList &ol, if (!generateTreeView) { container->writeNavigationPath(ol); + ol.endQuickIndices(); } ol.startContents(); @@ -537,7 +567,7 @@ void MemberList::writeDocumentationPage(OutputList &ol, container->writeQuickMemberLinks(ol,md); ol.writeString(" \n"); - ol.writeString(" \n"); + ol.writeString(" \n"); md->writeDocumentation(this,ol,scopeName,container,m_inGroup); @@ -545,14 +575,17 @@ void MemberList::writeDocumentationPage(OutputList &ol, ol.writeString(" \n"); ol.writeString("\n"); - ol.endContents(); if (generateTreeView) { + ol.endContents(); container->writeNavigationPath(ol); + endFile(ol,TRUE); + } + else + { + endFile(ol); } - - endFile(ol,TRUE); } if (memberGroupList) { diff --git a/src/memberlist.h b/src/memberlist.h index 7e93139..2e40176 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -134,15 +134,15 @@ class MemberList : public QList int numDecMembers() const { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; } int numDocMembers() const { ASSERT(m_numDocMembers!=-1); return m_numDocMembers; } bool needsSorting() const { return m_needsSorting; } - void countDecMembers(bool countEnumValues=FALSE); + void countDecMembers(bool countEnumValues=FALSE,GroupDef *gd=0); void countDocMembers(bool countEnumValues=FALSE); void writePlainDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd); void writeDeclarations(OutputList &ol, ClassDef *cd,NamespaceDef *nd,FileDef *fd,GroupDef *gd, - const char *title,const char *subtitle,bool showEnumValues=FALSE); + const char *title,const char *subtitle,bool showEnumValues=FALSE,bool showInline=FALSE); void writeDocumentation(OutputList &ol,const char *scopeName, - Definition *container,const char *title,bool showEnumValues=FALSE); + Definition *container,const char *title,bool showEnumValues=FALSE,bool showInline=FALSE); void writeDocumentationPage(OutputList &ol, const char *scopeName, Definition *container); bool declVisible() const; diff --git a/src/message.cpp b/src/message.cpp index 351d9c1..7c0679c 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -113,12 +113,8 @@ void msg(const char *fmt, ...) } } -static void do_warn(const char *tag, const char *file, int line, const char *fmt, va_list args) +static void format_warn(const char *file,int line,const char *text) { - if (!Config_getBool(tag)) return; // warning type disabled - char text[4096]; - vsnprintf(text, 4096, fmt, args); - text[4095]='\0'; QCString fileSubst = file==0 ? "" : file; QCString lineSubst; lineSubst.setNum(line); QCString textSubst = text; @@ -134,7 +130,6 @@ static void do_warn(const char *tag, const char *file, int line, const char *fmt } // substitute markers by actual values QCString msgText = - substitute( substitute( substitute( substitute( @@ -147,12 +142,19 @@ static void do_warn(const char *tag, const char *file, int line, const char *fmt "$line",lineSubst ), "$version",versionSubst - ), - "%","%%" - )+'\n'; + )+'\n'; // print resulting message - fprintf(warnFile,"%s",msgText.data()); + fwrite(msgText.data(),1,msgText.length(),warnFile); +} + +static void do_warn(const char *tag, const char *file, int line, const char *fmt, va_list args) +{ + if (!Config_getBool(tag)) return; // warning type disabled + char text[4096]; + vsnprintf(text, 4096, fmt, args); + text[4095]='\0'; + format_warn(file,line,text); } void warn(const char *file,int line,const char *fmt, ...) @@ -163,6 +165,12 @@ void warn(const char *file,int line,const char *fmt, ...) va_end(args); } +void warn_simple(const char *file,int line,const char *text) +{ + if (!Config_getBool("WARNINGS")) return; // warning type disabled + format_warn(file,line,text); +} + void warn_undoc(const char *file,int line,const char *fmt, ...) { va_list args; diff --git a/src/message.h b/src/message.h index 8437ef3..5325e81 100644 --- a/src/message.h +++ b/src/message.h @@ -22,6 +22,7 @@ extern void msg(const char *fmt, ...); extern void warn(const char *file,int line,const char *fmt, ...); +extern void warn_simple(const char *file,int line,const char *text); extern void warn_undoc(const char *file,int line,const char *fmt, ...); extern void warn_doc_error(const char *file,int line,const char *fmt, ...); extern void err(const char *fmt, ...); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 09cd662..eca2dfe 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -241,7 +241,7 @@ void NamespaceDef::writeDetailedDescription(OutputList &ol,const QCString &title ol.writeRuler(); ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - ol.writeAnchor(0,"_details"); + ol.writeAnchor(0,"details"); ol.popGeneratorState(); ol.startGroupHeader(); ol.parseText(title); @@ -289,7 +289,7 @@ void NamespaceDef::writeBriefDescription(OutputList &ol) ) { ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(0,"_details"); + ol.startTextLink(0,"details"); ol.parseText(theTranslator->trMore()); ol.endTextLink(); } @@ -413,9 +413,10 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { static bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); + static bool outputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); QCString pageTitle; - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) + if (outputJava) { pageTitle = theTranslator->trPackage(displayName()); } @@ -533,6 +534,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) case LayoutDocEntry::FileIncludedByGraph: case LayoutDocEntry::FileSourceLink: case LayoutDocEntry::GroupClasses: + case LayoutDocEntry::GroupInlineClasses: case LayoutDocEntry::GroupNamespaces: case LayoutDocEntry::GroupDirs: case LayoutDocEntry::GroupNestedGroups: diff --git a/src/outputgen.cpp b/src/outputgen.cpp index 8aec61f..71b10ed 100644 --- a/src/outputgen.cpp +++ b/src/outputgen.cpp @@ -66,10 +66,12 @@ void OutputGenerator::endPlainFile() void OutputGenerator::pushGeneratorState() { genStack->push(new bool(isEnabled())); + //printf("%p:pushGeneratorState(%d)\n",this,genStack->count()); } void OutputGenerator::popGeneratorState() { + //printf("%p:popGeneratorState(%d)\n",this,genStack->count()); bool *lb = genStack->pop(); ASSERT(lb!=0); if (lb==0) return; // for some robustness against superfluous \endhtmlonly commands. diff --git a/src/outputgen.h b/src/outputgen.h index a7d1ec8..0465eeb 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -321,8 +321,8 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endIndexValue(const char *,bool) = 0; virtual void startIndexItem(const char *ref,const char *file) = 0; virtual void endIndexItem(const char *ref,const char *file) = 0; - virtual void startGroupHeader() = 0; - virtual void endGroupHeader() = 0; + virtual void startGroupHeader(int) = 0; + virtual void endGroupHeader(int) = 0; virtual void startMemberSections() = 0; virtual void endMemberSections() = 0; virtual void startHeaderSection() = 0; @@ -335,6 +335,10 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endMemberDocList() = 0; virtual void startMemberList() = 0; virtual void endMemberList() = 0; + virtual void startInlineDescription() = 0; + virtual void endInlineDescription() = 0; + virtual void startInlineHeader() = 0; + virtual void endInlineHeader() = 0; virtual void startAnonTypeScope(int) = 0; virtual void endAnonTypeScope(int) = 0; virtual void startMemberItem(int) = 0; @@ -349,7 +353,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endMemberGroup(bool) = 0; virtual void insertMemberAlign(bool) = 0; virtual void startMemberDoc(const char *,const char *, - const char *,const char *) = 0; + const char *,const char *,bool) = 0; virtual void endMemberDoc(bool) = 0; virtual void startDoxyAnchor(const char *fName,const char *manName, const char *anchor,const char *name, diff --git a/src/outputlist.cpp b/src/outputlist.cpp index b6f73dc..57f4f67 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -309,6 +309,7 @@ FORALL4(SectionTypes a1,const char *a2,const char *a3,const char *a4,a1,a2,a3,a4 FORALL4(const char *a1,const char *a2,const char *a3,const char *a4,a1,a2,a3,a4) FORALL4(const char *a1,const char *a2,const char *a3,int a4,a1,a2,a3,a4) FORALL5(const char *a1,const char *a2,const char *a3,const char *a4,const char *a5,a1,a2,a3,a4,a5) +FORALL5(const char *a1,const char *a2,const char *a3,const char *a4,bool a5,a1,a2,a3,a4,a5) //-------------------------------------------------------------------------- diff --git a/src/outputlist.h b/src/outputlist.h index 532e87c..1c78ada3 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -157,10 +157,10 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startTypewriter); } void endTypewriter() { forall(&OutputGenerator::endTypewriter); } - void startGroupHeader() - { forall(&OutputGenerator::startGroupHeader); } - void endGroupHeader() - { forall(&OutputGenerator::endGroupHeader); } + void startGroupHeader(int extraLevels=0) + { forall(&OutputGenerator::startGroupHeader,extraLevels); } + void endGroupHeader(int extraLevels=0) + { forall(&OutputGenerator::endGroupHeader,extraLevels); } //void writeListItem() //{ forall(&OutputGenerator::writeListItem); } void startItemListItem() @@ -191,6 +191,14 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startMemberList); } void endMemberList() { forall(&OutputGenerator::endMemberList); } + void startInlineDescription() + { forall(&OutputGenerator::startInlineDescription); } + void endInlineDescription() + { forall(&OutputGenerator::endInlineDescription); } + void startInlineHeader() + { forall(&OutputGenerator::startInlineHeader); } + void endInlineHeader() + { forall(&OutputGenerator::endInlineHeader); } void startAnonTypeScope(int i1) { forall(&OutputGenerator::startAnonTypeScope,i1); } void endAnonTypeScope(int i1) @@ -239,8 +247,8 @@ class OutputList : public OutputDocInterface void writeChar(char c) { forall(&OutputGenerator::writeChar,c); } void startMemberDoc(const char *clName,const char *memName, - const char *anchor,const char *title) - { forall(&OutputGenerator::startMemberDoc,clName,memName,anchor,title); } + const char *anchor,const char *title,bool showInline) + { forall(&OutputGenerator::startMemberDoc,clName,memName,anchor,title,showInline); } void endMemberDoc(bool hasArgs) { forall(&OutputGenerator::endMemberDoc,hasArgs); } void startDoxyAnchor(const char *fName,const char *manName, @@ -484,6 +492,7 @@ class OutputList : public OutputDocInterface FORALLPROTO4(const char *,const char *,const char *,const char *); FORALLPROTO4(const char *,const char *,const char *,bool); FORALLPROTO5(const char *,const char *,const char *,const char *,const char *); + FORALLPROTO5(const char *,const char *,const char *,const char *,bool); OutputList(const OutputList &ol); QList *outputs; diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 2b6641d..3265d67 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1107,7 +1107,7 @@ void PerlModDocVisitor::visitPre(DocMscFile *) void PerlModDocVisitor::visitPost(DocMscFile *) { #if 0 - m_output.add(""); + m_output.add(""); #endif } diff --git a/src/pre.h b/src/pre.h index 5b2446d..3e566fb 100644 --- a/src/pre.h +++ b/src/pre.h @@ -24,7 +24,7 @@ class BufStr; -DefineDict* getFileDefineDict(); +DefineDict* getGlobalDefineDict(); void initPreprocessor(); void cleanUpPreprocessor(); void addSearchDir(const char *dir); diff --git a/src/pre.l b/src/pre.l index 63c38d1..50ba69b 100644 --- a/src/pre.l +++ b/src/pre.l @@ -92,7 +92,8 @@ static int g_inputBufPos; static BufStr *g_outputBuf; static int g_roundCount; static bool g_quoteArg; -static DefineDict *g_fileDefineDict = new DefineDict(10009); +static DefineDict *g_globalDefineDict = new DefineDict(10009); +static DefineDict *g_fileDefineDict = new DefineDict(1009); static DefineDict *g_expandedDict; static int g_findDefArgContext; static bool g_expectGuard; @@ -112,12 +113,13 @@ static int g_condCtx; static bool g_skip; static QStack g_condStack; static bool g_insideCS; // C# has simpler preprocessor +static bool g_isSource; static bool g_lexInit = FALSE; -DefineDict* getFileDefineDict() +DefineDict* getGlobalDefineDict() { - return g_fileDefineDict; + return g_globalDefineDict; } static void setFileName(const char *name) @@ -135,6 +137,7 @@ static void setFileName(const char *name) // name,g_yyFileName.data(),g_yyFileDef); if (g_yyFileDef && g_yyFileDef->isReference()) g_yyFileDef=0; g_insideCS = getLanguageFromFileName(g_yyFileName)==SrcLangExt_CSharp; + g_isSource = guessSection(g_yyFileName); } static void incrLevel() @@ -210,7 +213,7 @@ static Define *isDefined(const char *name) Define *def=0; if (name) { - def=g_fileDefineDict->find(name); + def=g_globalDefineDict->find(name); //if ((def=fileDefineCache->findDefine(g_yyFileName,name)) && !def->undef) // return def; if (def && def->undef) def=0; @@ -1485,7 +1488,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) !( (g_includeStack.isEmpty() || g_curlyCount>0) && g_macroExpansion && - (def=g_fileDefineDict->find(name)) && + (def=g_globalDefineDict->find(name)) && macroIsAccessible(def) && (!g_expandOnlyPredef || def->isPredefined) ) @@ -1549,7 +1552,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) {ID}/{BN}{0,80}"(" { g_expectGuard = FALSE; Define *def=0; - //def=g_fileDefineDict->find(yytext); + //def=g_globalDefineDict->find(yytext); //printf("Search for define %s found=%d g_includeStack.isEmpty()=%d " // "g_curlyCount=%d g_macroExpansion=%d g_expandOnlyPredef=%d " // "isPreDefined=%d\n",yytext,def ? 1 : 0, @@ -1558,7 +1561,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) // ); if ((g_includeStack.isEmpty() || g_curlyCount>0) && g_macroExpansion && - (def=g_fileDefineDict->find(yytext)) && + (def=g_globalDefineDict->find(yytext)) && (def->isPredefined || macroIsAccessible(def)) && (!g_expandOnlyPredef || def->isPredefined) ) @@ -1586,7 +1589,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) Define *def=0; if ((g_includeStack.isEmpty() || g_curlyCount>0) && g_macroExpansion && - (def=g_fileDefineDict->find(yytext)) && + (def=g_globalDefineDict->find(yytext)) && def->nargs==-1 && (def->isPredefined || macroIsAccessible(def)) && (!g_expandOnlyPredef || def->isPredefined) @@ -2130,11 +2133,15 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) outputArray(yytext,yyleng); BEGIN(g_condCtx); } -[\\@]"cond"[ \t\r]*\n | +[\\@]"cond"[ \t\r]*/\n { + g_condCtx = YY_START; + outputArray(yytext,yyleng); + BEGIN(CondLine); + } . { unput(*yytext); startCondSection(" "); - if (YY_START==CondLine) BEGIN(g_condCtx); + BEGIN(g_condCtx); } [\\@]"endcond"/[^a-z_A-Z0-9] { outputArray(yytext,yyleng); @@ -2278,11 +2285,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) { addDefine(); } - def=g_fileDefineDict->find(g_defName); + def=g_globalDefineDict->find(g_defName); if (def==0) // new define { //printf("new define!\n"); - g_fileDefineDict->insert(g_defName,newDefine()); + Define *nd = newDefine(); + g_globalDefineDict->insert(g_defName,nd); + // also add it to the local file list if it is a source file + if (g_isSource && g_includeStack.isEmpty()) + { + g_fileDefineDict->insert(g_defName,nd); + } } else if (def && macroIsAccessible(def)) // name already exists @@ -2508,10 +2521,10 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output) g_expandedDict->clear(); g_condStack.clear(); g_condStack.setAutoDelete(TRUE); - g_fileDefineDict->clear(); // add due to bug 641346 + g_fileDefineDict->clear(); - //static bool firstTime=TRUE; - //if (firstTime) + static bool firstTime=TRUE; + if (firstTime) { // add predefined macros char *defStr; @@ -2579,7 +2592,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output) def->nonRecursive = nonRecursive; def->fileDef = g_yyFileDef; def->fileName = fileName; - g_fileDefineDict->insert(def->name,def); + g_globalDefineDict->insert(def->name,def); } //printf("#define `%s' `%s' #nargs=%d\n", @@ -2610,7 +2623,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output) def->nonRecursive = nonRecursive; def->fileDef = g_yyFileDef; def->fileName = fileName; - g_fileDefineDict->insert(def->name,def); + g_globalDefineDict->insert(def->name,def); } else { @@ -2642,6 +2655,18 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output) // make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829) forceEndCondSection(); + // remove locally defined macros so they can be redefined in another source file + if (g_fileDefineDict->count()>0) + { + QDictIterator di(*g_fileDefineDict); + Define *d; + for (di.toFirst();(d=di.current());++di) + { + g_globalDefineDict->remove(di.currentKey()); + } + g_fileDefineDict->clear(); + } + if (Debug::isFlagSet(Debug::Preprocessor)) { char *orgPos=output.data()+orgOffset; diff --git a/src/pycode.l b/src/pycode.l index 0b2f715..88f3b38 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -610,7 +610,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, if (cd && cd->isLinkable()) // is it a linkable class { - writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),0,clName,cd->briefDescriptionAsTooltip()); + writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),clName,cd->briefDescriptionAsTooltip()); addToSearchIndex(className); if (md) { diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 3cb0b58..cee9828 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -750,6 +750,8 @@ void RTFDocVisitor::visitPre(DocSection *s) if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSection)}\n"); if (!m_lastIsPara) m_t << "\\par" << endl; + m_t << "{\\bkmkstart " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}" << endl; + m_t << "{\\bkmkend " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}" << endl; m_t << "{{" // start section << rtf_Style_Reset; QCString heading; @@ -1084,7 +1086,7 @@ void RTFDocVisitor::visitPost(DocDotFile *) } void RTFDocVisitor::visitPre(DocMscFile *df) { - DBG_RTF("{\\comment RTFDocVisitor::visitPre(MscDotFile)}\n"); + DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocMscFile)}\n"); writeMscFile(df->file()); // hide caption since it is not supported at the moment @@ -1094,7 +1096,7 @@ void RTFDocVisitor::visitPre(DocMscFile *df) void RTFDocVisitor::visitPost(DocMscFile *) { - DBG_RTF("{\\comment RTFDocVisitor::visitPost(MscDotFile)}\n"); + DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocMscFile)}\n"); popEnabled(); } @@ -1125,7 +1127,7 @@ void RTFDocVisitor::visitPost(DocRef *ref) if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocRef)}\n"); if (!ref->file().isEmpty()) endLink(ref->ref()); - m_t << " "; + //m_t << " "; } diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 2bef5de..cc6690e 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -473,7 +473,10 @@ void RTFGenerator::startIndexSection(IndexSections is) bool found=FALSE; for (cli.toFirst();(cd=cli.current()) && !found;++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInGroupDocs() + ) { beginRTFChapter(); found=TRUE; @@ -753,7 +756,10 @@ void RTFGenerator::endIndexSection(IndexSections is) } for (cli.toFirst();(cd=cli.current()) && !found;++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInGroupDocs() + ) { t << "\\par " << rtf_Style_Reset << endl; t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \""; @@ -764,7 +770,10 @@ void RTFGenerator::endIndexSection(IndexSections is) } for (;(cd=cli.current());++cli) { - if (cd->isLinkableInProject() && cd->templateMaster()==0) + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInGroupDocs() + ) { t << "\\par " << rtf_Style_Reset << endl; beginRTFSection(); @@ -1409,16 +1418,27 @@ void RTFGenerator::startTitle() beginRTFChapter(); } -void RTFGenerator::startGroupHeader() +void RTFGenerator::startGroupHeader(int extraIndent) { DBG_RTF(t <<"{\\comment startGroupHeader}" << endl) //newParagraph(); t << rtf_Style_Reset; - t << rtf_Style["Heading3"]->reference; + if (extraIndent==2) + { + t << rtf_Style["Heading5"]->reference; + } + else if (extraIndent==1) + { + t << rtf_Style["Heading4"]->reference; + } + else // extraIndent==0 + { + t << rtf_Style["Heading3"]->reference; + } t << endl; } -void RTFGenerator::endGroupHeader() +void RTFGenerator::endGroupHeader(int) { DBG_RTF(t <<"{\\comment endGroupHeader}" << endl) t << "\\par" << endl; @@ -1428,7 +1448,8 @@ void RTFGenerator::endGroupHeader() void RTFGenerator::startMemberDoc(const char *clname, const char *memname, const char *, - const char *) + const char *, + bool showInline) { DBG_RTF(t << "{\\comment startMemberDoc}" << endl) if (memname && memname[0]!='@') @@ -1436,7 +1457,7 @@ void RTFGenerator::startMemberDoc(const char *clname, addIndexItem(memname,clname); addIndexItem(clname,memname); } - t << rtf_Style_Reset << rtf_Style["Heading4"]->reference; + t << rtf_Style_Reset << rtf_Style[showInline ? "Heading5" : "Heading4"]->reference; //styleStack.push(rtf_Style_Heading4); t << "{" << endl; //printf("RTFGenerator::startMemberDoc() `%s'\n",rtf_Style["Heading4"]->reference); @@ -1447,11 +1468,11 @@ void RTFGenerator::startMemberDoc(const char *clname, void RTFGenerator::endMemberDoc(bool) { DBG_RTF(t << "{\\comment endMemberDoc}" << endl) - t << "}" << endl; //const char *style = styleStack.pop(); //printf("RTFGenerator::endMemberDoc() `%s'\n",style); //ASSERT(style==rtf_Style["Heading4"]->reference); endBold(); + t << "}" << endl; newParagraph(); } @@ -2748,13 +2769,13 @@ void RTFGenerator::startConstraintDocs() void RTFGenerator::endConstraintDocs() { - DBG_RTF(t << "{\\comment (endConstraintDocs)}" << endl) + DBG_RTF(t << "{\\comment (endConstraintDocs)}" << endl) newParagraph(); } void RTFGenerator::endConstraintList() { - DBG_RTF(t << "{\\comment (endConstraintList)}" << endl) + DBG_RTF(t << "{\\comment (endConstraintList)}" << endl) newParagraph(); decrementIndentLevel(); m_omitParagraph = TRUE; @@ -2763,13 +2784,39 @@ void RTFGenerator::endConstraintList() void RTFGenerator::startIndexListItem() { - DBG_RTF(t << "{\\comment (startIndexListItem)}" << endl) + DBG_RTF(t << "{\\comment (startIndexListItem)}" << endl) } void RTFGenerator::endIndexListItem() { - DBG_RTF(t << "{\\comment (endIndexListItem)}" << endl) + DBG_RTF(t << "{\\comment (endIndexListItem)}" << endl) t << "\\par" << endl; } +void RTFGenerator::startInlineDescription() +{ + DBG_RTF(t << "{\\comment (startInlineDescription)}" << endl) +} + +void RTFGenerator::endInlineDescription() +{ + DBG_RTF(t << "{\\comment (endInlineDescription)}" << endl) +} + +void RTFGenerator::startInlineHeader() +{ + DBG_RTF(t << "{\\comment (startInlineHeader)}" << endl) + t << "{" << endl; + t << rtf_Style_Reset << rtf_Style["Heading5"]->reference; + startBold(); +} + +void RTFGenerator::endInlineHeader() +{ + DBG_RTF(t << "{\\comment (endInlineHeader)}" << endl) + endBold(); + t << "\\par"; + t << "}" << endl; +} + diff --git a/src/rtfgen.h b/src/rtfgen.h index 0bfd724..20931fa 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -88,8 +88,8 @@ class RTFGenerator : public OutputGenerator void endHtmlLink(); void startTypewriter() { t << "{\\f2 "; } void endTypewriter() { t << "}"; } - void startGroupHeader(); - void endGroupHeader(); + void startGroupHeader(int); + void endGroupHeader(int); //void writeListItem(); void startItemListItem(); void endItemListItem(); @@ -98,14 +98,18 @@ class RTFGenerator : public OutputGenerator void endMemberSections() {} void startHeaderSection() {} void endHeaderSection() {} - void startMemberHeader(const char *) { startGroupHeader(); } - void endMemberHeader() { endGroupHeader(); } + void startMemberHeader(const char *) { startGroupHeader(FALSE); } + void endMemberHeader() { endGroupHeader(FALSE); } void startMemberSubtitle(); void endMemberSubtitle(); void startMemberDocList() {} void endMemberDocList() {} void startMemberList(); void endMemberList(); + void startInlineDescription(); + void endInlineDescription(); + void startInlineHeader(); + void endInlineHeader(); void startAnonTypeScope(int) {} void endAnonTypeScope(int) {} void startMemberItem(int); @@ -131,7 +135,7 @@ class RTFGenerator : public OutputGenerator void startDescItem(); void endDescItem(); void lineBreak(const char *style=0); - void startMemberDoc(const char *,const char *,const char *,const char *); + void startMemberDoc(const char *,const char *,const char *,const char *,bool); void endMemberDoc(bool); void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *); void endDoxyAnchor(const char *,const char *); diff --git a/src/scanner.l b/src/scanner.l index 0ed3933..b654d47 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -572,7 +572,7 @@ TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,]*">")? CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID}) PRE [pP][rR][eE] CODE [cC][oO][dD][eE] -CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) +CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] IDLATTR ("["[^\]]*"]"){BN}* TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) diff --git a/src/textdocvisitor.cpp b/src/textdocvisitor.cpp index 2c70dec..dd7e181 100644 --- a/src/textdocvisitor.cpp +++ b/src/textdocvisitor.cpp @@ -67,6 +67,7 @@ void TextDocVisitor::visit(DocSymbol *s) void TextDocVisitor::filter(const char *str) { if (str==0) return; + //printf("TextDocVisitor::filter(%s)\n",str); const char *p=str; char c; while (*p) diff --git a/src/translator_ru.h b/src/translator_ru.h index 0dce0ca..31e1f0f 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -26,7 +26,7 @@ #ifndef TRANSLATOR_RU_H #define TRANSLATOR_RU_H -class TranslatorRussian : public TranslatorAdapter_1_6_0 +class TranslatorRussian : public Translator { public: /*! Used for identification of the language. */ @@ -1753,6 +1753,94 @@ class TranslatorRussian : public TranslatorAdapter_1_6_0 { return "Согласование типов"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.6.0 (mainly for the new search engine) +////////////////////////////////////////////////////////////////////////// + + /*! directory relation for \a name */ + virtual QCString trDirRelation(const char *name) + { + return QCString(name)+" Связь"; + } + + /*! Loading message shown when loading search results */ + virtual QCString trLoading() + { + return "Загрузка..."; + } + + /*! Label used for search results in the global namespace */ + virtual QCString trGlobalNamespace() + { + return "Глобальное пространство имён"; + } + + /*! Message shown while searching */ + virtual QCString trSearching() + { + return "Поиск..."; + } + + /*! Text shown when no search results are found */ + virtual QCString trNoMatches() + { + return "Не найдено"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.6.3 (missing items for the directory pages) +////////////////////////////////////////////////////////////////////////// + + /*! introduction text for the directory dependency graph */ + virtual QCString trDirDependency(const char *name) + { + return (QCString)"Диаграмма каталогов для "+name; + } + + /*! when clicking a directory dependency label, a page with a + * table is shown. The heading for the first column mentions the + * source file that has a relation to another file. + */ + virtual QCString trFileIn(const char *name) + { + return (QCString)"Файл в "+name; + } + + /*! when clicking a directory dependency label, a page with a + * table is shown. The heading for the second column mentions the + * destination file that is included. + */ + virtual QCString trIncludesFileIn(const char *name) + { + return (QCString)"Включает файл в "+name; + } + + /** Compiles a date string. + * @param year Year in 4 digits + * @param month Month of the year: 1=January + * @param day Day of the Month: 1..31 + * @param dayOfWeek Day of the week: 1=Monday..7=Sunday + * @param hour Hour of the day: 0..23 + * @param minutes Minutes in the hour: 0..59 + * @param seconds Seconds within the minute: 0..59 + * @param includeTime Include time in the result string? + */ + virtual QCString trDateTime(int year,int month,int day,int dayOfWeek, + int hour,int minutes,int seconds, + bool includeTime) + { + static const char *days[] = { "Пн","Вт","Ср","Чт","Пт","Сб","Вс" }; + static const char *months[] = { "Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек" }; + QCString sdate; + sdate.sprintf("%s %d %s %d",days[dayOfWeek-1],day,months[month-1],year); + if (includeTime) + { + QCString stime; + stime.sprintf(" %.2d:%.2d:%.2d",hour,minutes,seconds); + sdate+=stime; + } + return sdate; + } }; #endif diff --git a/src/util.cpp b/src/util.cpp index 100f140..ecc1b34 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include "md5.h" #include "qtbc.h" #include @@ -426,11 +426,11 @@ QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, // ); result=md->typeString(); QString args = md->argsString(); - if (result.find("*)")!=-1) // typedef of a function/member pointer + if (args.find(")(")!=-1) // typedef of a function/member pointer { - result+=md->argsString(); + result+=args; } - if (args.find('[')!=-1) + else if (args.find('[')!=-1) // typedef of an array { result+=args; } @@ -1830,7 +1830,7 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, // add link to the result if (external ? cd->isLinkable() : cd->isLinkableInProject()) { - out.writeLink(cd->getReference(),cd->getOutputFileBase(),0,word); + out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); found=TRUE; } } @@ -1851,7 +1851,7 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, // add link to the result if (external ? cd->isLinkable() : cd->isLinkableInProject()) { - out.writeLink(cd->getReference(),cd->getOutputFileBase(),0,word); + out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); found=TRUE; } } @@ -1860,7 +1860,7 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope, // add link to the result if (external ? cd->isLinkable() : cd->isLinkableInProject()) { - out.writeLink(cd->getReference(),cd->getOutputFileBase(),0,word); + out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word); found=TRUE; } } @@ -3128,7 +3128,8 @@ static QCString getCanonicalTypeForIdentifier( QCString symName,scope,result,templSpec,tmpName; //DefinitionList *defList=0; - if (tSpec && !tSpec->isEmpty()) templSpec = stripDeclKeywords(getCanonicalTemplateSpec(d,fs,*tSpec)); + if (tSpec && !tSpec->isEmpty()) + templSpec = stripDeclKeywords(getCanonicalTemplateSpec(d,fs,*tSpec)); if (word.findRev("::")!=-1 && !(tmpName=stripScope(word)).isEmpty()) { @@ -3232,7 +3233,7 @@ static QCString getCanonicalTypeForIdentifier( //printf("word=%s typeString=%s\n",word.data(),mType->typeString()); if (word!=mType->typeString()) { - result = getCanonicalTypeForIdentifier(d,fs,mType->typeString(),tSpec,count++); + result = getCanonicalTypeForIdentifier(d,fs,mType->typeString(),tSpec,count+1); } else { @@ -4245,7 +4246,9 @@ bool resolveRef(/* in */ const char *scName, ) ) { - if (checkScope && md && !cd && !nd && (!scopeStr.isEmpty() || nameStr.find("::")>0)) + //printf("after getDefs checkScope=%d nameStr=%s cd=%p nd=%p\n",checkScope,nameStr.data(),cd,nd); + if (checkScope && md && md->getOuterScope()==Doxygen::globalScope && + (!scopeStr.isEmpty() || nameStr.find("::")>0)) { // we did find a member, but it is a global one while we were explicitly // looking for a scoped variable. See bug 616387 for an example why this check is needed. @@ -4441,16 +4444,19 @@ bool resolveLink(/* in */ const char *scName, else if ((cd=getClass(linkRef))) // class link { *resContext=cd; + resAnchor=cd->anchor(); return TRUE; } else if ((cd=getClass(linkRef+"-p"))) // Obj-C protocol link { *resContext=cd; + resAnchor=cd->anchor(); return TRUE; } else if ((cd=getClass(linkRef+"-g"))) // C# generic link { *resContext=cd; + resAnchor=cd->anchor(); return TRUE; } else if ((nd=Doxygen::namespaceSDict->find(linkRef))) @@ -6072,18 +6078,17 @@ QCString stripExtension(const char *fName) void replaceNamespaceAliases(QCString &scope,int i) { - //printf("replaceNamespaceAliases(%s,%d)\n",scope.data(),i); while (i>0) { - QCString *s = Doxygen::namespaceAliasDict[scope.left(i)]; + QCString ns = scope.left(i); + QCString *s = Doxygen::namespaceAliasDict[ns]; if (s) { scope=*s+scope.right(scope.length()-i); i=s->length(); } - i=scope.findRev("::",i-1); + if (i>0 && ns==scope.left(i)) break; } - //printf("replaceNamespaceAliases() result=%s\n",scope.data()); } QCString stripPath(const char *s) @@ -6390,6 +6395,22 @@ int nextUtf8CharPosition(const QCString &utf8Str,int len,int startPos) bytes++; // 1111.xxxx: 4 byte character } } + else if (c=='&') // skip over character entities + { + static QRegExp re1("&#[0-9]+;"); // numerical entity + static QRegExp re2("&[A-Z_a-z]+;"); // named entity + int l1,l2; + int i1 = re1.match(utf8Str,startPos,&l1); + int i2 = re2.match(utf8Str,startPos,&l2); + if (i1!=-1) + { + bytes=l1; + } + else if (i2!=-1) + { + bytes=l2; + } + } return startPos+bytes; } @@ -6420,7 +6441,7 @@ QCString parseCommentAsText(const Definition *scope,const MemberDef *md, while ((i=nextUtf8CharPosition(result,l,i))=0 && isspace(result.at(i))) { addEllipsis=TRUE; } diff --git a/src/vhdlcode.l b/src/vhdlcode.l index a6bae7b..f0b02b5 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -513,7 +513,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName g_currentDefinition); writeMultiLineCodeLink(ol,cd->getReference(), cd->getOutputFileBase(), - 0, + cd->anchor(), temp, cd->briefDescriptionAsTooltip()); addToSearchIndex(className); diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 71fdd3d..a87d53e 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -42,7 +42,7 @@ #include "definition.h" #include "searchindex.h" #include "outputlist.h" - +#include "parserintf.h" /* --------------------------------------------------------------- */ //#define theTranslator_vhdlType theTranslator->trVhdlType @@ -682,15 +682,13 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol) QCString type; if (ii==VhdlDocGen::ENTITY) - type+=theTranslator_vhdlType(VhdlDocGen::ARCHITECTURE,TRUE); + type=theTranslator_vhdlType(VhdlDocGen::ARCHITECTURE,TRUE); else if (ii==VhdlDocGen::ARCHITECTURE) - type+=theTranslator_vhdlType(VhdlDocGen::ENTITY,TRUE); + type=theTranslator_vhdlType(VhdlDocGen::ENTITY,TRUE); else if (ii==VhdlDocGen::PACKAGE_BODY) - type+=theTranslator_vhdlType(VhdlDocGen::PACKAGE,TRUE); + type=theTranslator_vhdlType(VhdlDocGen::PACKAGE,TRUE); else if (ii==VhdlDocGen::PACKAGE) - type+=theTranslator_vhdlType(VhdlDocGen::PACKAGE_BODY,TRUE); - else - type+=""; + type=theTranslator_vhdlType(VhdlDocGen::PACKAGE_BODY,TRUE); //type=type.lower(); type+=" >> "; @@ -781,7 +779,7 @@ void VhdlDocGen::writeVhdlLink(const ClassDef* ccd ,OutputList& ol,QCString& typ ol.docify(type.data()); ol.endBold(); nn.stripPrefix("_"); - ol.writeObjectLink(ccd->getReference(),ccd->getOutputFileBase(),0,nn.data()); + ol.writeObjectLink(ccd->getReference(),ccd->getOutputFileBase(),ccd->anchor(),nn.data()); if (!behav.isEmpty()) { @@ -1211,6 +1209,7 @@ QCString VhdlDocGen::trTypeString(int type) case VhdlDocGen::COMPONENT_INST: return "Component Instantiation"; case VhdlDocGen::ALIAS: return "Alias"; case VhdlDocGen::CONFIG: return "Configuration"; + case VhdlDocGen::MISCELLANEOUS: return "Miscellaneous"; default: return ""; } } // convertType @@ -1300,7 +1299,9 @@ void VhdlDocGen::writeFormatString(QCString& qcs,OutputList&ol,const MemberDef* bool k=VhdlDocGen::isNumber(find); // is this a number if (k) { - VhdlDocGen::startFonts(find,"vhdldigit",ol); + ol.docify(" "); + VhdlDocGen::startFonts(find,"vhdldigit",ol); + ol.docify(" "); } else if (j != 0 && ss) { @@ -1334,14 +1335,13 @@ void VhdlDocGen::writeFormatString(QCString& qcs,OutputList&ol,const MemberDef* bool VhdlDocGen::isNumber(const QCString& s) { - // static bool veriOpt=Config_getBool("OPTIMIZE_OUTPUT_VERILOG"); static QRegExp regg("[0-9][0-9eEfFbBcCdDaA_.#-]*"); - if (s.isEmpty()) return false; + if (s.isEmpty()) return FALSE; int j,len; j = regg.match(s.data(),0,&len); - if ((j==0) && (len==(int)s.length())) return true; - return false; + if ((j==0) && (len==(int)s.length())) return TRUE; + return FALSE; #if 0 int len=s.length(); @@ -1590,51 +1590,55 @@ void VhdlDocGen::writeFuncProcDocu( ol.docify(" ( ) "); return; } - ol.startParameterList(FALSE); + ol.startParameterList(TRUE); Argument *arg; bool first=TRUE; for (;(arg=ali.current());++ali) { ol.startParameterType(first,""); - if (first) ol.writeChar('('); - if (!VhdlDocGen::isProcess(md)) + //if (first) ol.writeChar('('); + if (VhdlDocGen::isProcedure(md)) { - if (TRUE) //VhdlDocGen::isProcedure(md)) - { - startFonts(arg->defval,"keywordtype",ol); - ol.docify(" "); - } - // linkifyText(TextGeneratorOLImpl(ol),md->getClassDef(),md->getBodyDef(),md->name(),arg->type); - VhdlDocGen::writeFormatString(arg->name,ol,md); + startFonts(arg->defval,"keywordtype",ol); ol.docify(" "); + } + ol.endParameterType(); + + ol.startParameterName(TRUE); + VhdlDocGen::writeFormatString(arg->name,ol,md); + ol.docify(" "); + + if (VhdlDocGen::isProcedure(md)) + startFonts(arg->attrib,"stringliteral",ol); + else if (VhdlDocGen::isVhdlFunction(md)) + startFonts(QCString("in"),"stringliteral",ol); + - if (VhdlDocGen::isProcedure(md)) - startFonts(arg->attrib,"stringliteral",ol); - else - startFonts(QCString("in"),"stringliteral",ol); - } ol.docify(" "); ol.disable(OutputGenerator::Man); ol.startEmphasis(); ol.enable(OutputGenerator::Man); if (!VhdlDocGen::isProcess(md)) startFonts(arg->type,"vhdlkeyword",ol); - else - startFonts(arg->name,"vhdlkeyword",ol); ol.disable(OutputGenerator::Man); ol.endEmphasis(); ol.enable(OutputGenerator::Man); if (--index) + { ol.docify(" , "); + ol.endParameterName(FALSE,FALSE,FALSE); + } else - ol.docify(" ) "); - - ol.endParameterName(FALSE,FALSE,FALSE); + { + //ol.docify(" ) "); + ol.endParameterName(TRUE,FALSE,TRUE); + } sem=TRUE; first=FALSE; } + //ol.endParameterList(); } // writeDocFunProc @@ -1738,6 +1742,7 @@ void VhdlDocGen::writeVhdlDeclarations(MemberList* ml, VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::GROUP,FALSE),0,FALSE,VhdlDocGen::GROUP); VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::COMPONENT_INST,FALSE),0,FALSE,VhdlDocGen::COMPONENT_INST); VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::ALIAS,FALSE),0,FALSE,VhdlDocGen::ALIAS); + VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,0,gd,theTranslator_vhdlType(VhdlDocGen::MISCELLANEOUS),0,FALSE,VhdlDocGen::MISCELLANEOUS); // configurations must be added to global file definitions. VhdlDocGen::writeVHDLDeclarations(ml,ol,cd,0,fd,gd,theTranslator_vhdlType(VhdlDocGen::CONFIG,FALSE),0,FALSE,VhdlDocGen::CONFIG); @@ -1750,18 +1755,22 @@ static void setGlobalType(MemberList *ml) MemberListIterator mmli(*ml); for ( ; (mdd=mmli.current()); ++mmli ) { - if (strcmp(mdd->argsString(),"configuration")==0) + if (stricmp(mdd->argsString(),"configuration")==0) { mdd->setMemberSpecifiers(VhdlDocGen::CONFIG); } - else if (strcmp(mdd->typeString(),"library")==0) + else if (stricmp(mdd->typeString(),"library")==0) { mdd->setMemberSpecifiers(VhdlDocGen::LIBRARY); } - else if (strcmp(mdd->typeString(),"package")==0) + else if (stricmp(mdd->typeString(),"package")==0) { mdd->setMemberSpecifiers(VhdlDocGen::USE); } + else if (stricmp(mdd->typeString(),"misc")==0) + { + mdd->setMemberSpecifiers(VhdlDocGen::MISCELLANEOUS); + } } } @@ -1778,25 +1787,33 @@ void VhdlDocGen::writeVHDLTypeDocumentation(const MemberDef* mdef, const Definit MemberDef* memdef=VhdlDocGen::findMember(na,nn); if (memdef && memdef->isLinkable()) { + ol.docify(" "); ol.startBold(); //ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),0,mdef->typeString()); - writeLink(memdef,ol); + writeLink(memdef,ol); ol.endBold(); ol.docify(" "); } else { + ol.docify(" "); QCString ttype=mdef->typeString(); VhdlDocGen::formatString(ttype,ol,mdef); + ol.docify(" "); } ol.docify(mdef->name()); VhdlDocGen::writeFuncProcDocu(mdef,ol, mdef->argumentList().pointer()); } + if(VhdlDocGen::isMisc(mdef)) + { + writeLink(mdef,ol); + return; + } if (mdef->isVariable()) { //ol.docify(mdef->name().data()); - writeLink(mdef,ol); + writeLink(mdef,ol); ol.docify(" "); QCString ttype=mdef->typeString(); VhdlDocGen::formatString(ttype,ol,mdef); @@ -1941,12 +1958,17 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, if (gd) gd=0; switch(mm) { + case VhdlDocGen::MISCELLANEOUS: + VhdlDocGen::writeCodeFragment(mdef,ol); + break; case VhdlDocGen::PROCEDURE: case VhdlDocGen::FUNCTION: ol.startBold(); VhdlDocGen::formatString(ltype,ol,mdef); ol.endBold(); ol.insertMemberAlign(); + ol.docify(" "); + writeLink(mdef,ol); if (alp!=0 && mm==VhdlDocGen::FUNCTION) VhdlDocGen::writeFunctionProto(ol,alp.pointer(),mdef); @@ -1986,11 +2008,11 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, case VhdlDocGen::GENERIC: case VhdlDocGen::PORT: writeLink(mdef,ol); + ol.docify(" "); ol.insertMemberAlign(); if (mm==VhdlDocGen::GENERIC) { ol.startBold(); - ol.docify(" "); VhdlDocGen::formatString(ltype,ol,mdef); ol.endBold(); } @@ -2016,6 +2038,8 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, case VhdlDocGen::CONFIG: writeLink(mdef,ol); ol.insertMemberAlign(); + ol.docify(" "); + ol.startBold(); ol.docify(ltype); ol.endBold(); @@ -2070,6 +2094,7 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, break; case VhdlDocGen::RECORD: writeLink(mdef,ol); + ol.docify(" "); ol.startBold(); if (ltype.isEmpty()) ol.docify(" : record"); ol.insertMemberAlign(); @@ -2080,6 +2105,7 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, case VhdlDocGen::UNITS: ol.startBold(); writeLink(mdef,ol); + ol.docify(" "); if (ltype.isEmpty()) ol.docify(" : unit"); ol.insertMemberAlign(); if (!ltype.isEmpty()) @@ -2220,7 +2246,7 @@ void VhdlDocGen::writeVHDLDeclarations(MemberList* ml,OutputList &ol, if (title) { - ol.startMemberHeader(ml->listTypeAsString()); + ol.startMemberHeader(title); ol.parseText(title); ol.endMemberHeader(); ol.docify(" "); @@ -2282,13 +2308,9 @@ void VhdlDocGen::adjustRecordMember(MemberDef *mdef) /* strips the prefix for package and package body */ -bool VhdlDocGen::writeClassType( ClassDef *& cd, +bool VhdlDocGen::writeClassType( ClassDef * cd, OutputList &ol ,QCString & cname) { - //static ClassDef *prev = 0; - //if (prev == cd) return TRUE; - //if (cd != prev) prev=cd; - int id=cd->protection(); QCString qcs = VhdlDocGen::trTypeString(id+2); cname=VhdlDocGen::getClassName(cd); @@ -2296,7 +2318,6 @@ bool VhdlDocGen::writeClassType( ClassDef *& cd, ol.writeString(qcs.data()); ol.writeString(" "); ol.endBold(); - //ol.insertMemberAlign(); return FALSE; }// writeClassLink @@ -2379,7 +2400,8 @@ QCString VhdlDocGen::trVhdlType(int type,bool sing) case VhdlDocGen::CONFIG: if (sing) return "Configuration"; return "Configurations"; - + case VhdlDocGen::MISCELLANEOUS: + return "Miscellaneous"; default: return "Class"; } @@ -2478,3 +2500,70 @@ void VhdlDocGen::writeStringLink(const MemberDef *mdef,QCString mem, OutputList& VhdlDocGen::startFonts(mem,"vhdlchar",ol); }// found component +void VhdlDocGen::writeCodeFragment( MemberDef *mdef,OutputList& ol) +{ + // Definition d=(Definition)mdef; + // QCString fdd=mdef->getDefFileExtension(); + // QCString scope=mdef->getScopeString(); + QCString codeFragment=mdef->documentation(); + //FileDef *fd=mdef->getFileDef(); + + //int start=mdef->getStartBodyLine(); + //int end=mdef->getEndBodyLine(); + QStringList qsl=QStringList::split("\n",codeFragment); + + writeLink(mdef,ol); + ol.docify(" "); + ol.insertMemberAlign(); + int len = qsl.count(); + int j; + for (j=0;jgetDefFileExtension(); + QCString scope=mdef->getScopeString(); + QCString codeFragment=mdef->documentation(); + FileDef *fd=mdef->getFileDef(); + int start=mdef->getStartBodyLine(); + int end=mdef->getEndBodyLine(); + QStringList qsl=QStringList::split("\n",codeFragment); + + ParserInterface *pIntf = Doxygen::parserManager->getParser(fdd.data()); + pIntf->resetCodeParserState(); + + ol.startParagraph(); + ol.startCodeFragment(); + pIntf->parseCode(ol, // codeOutIntf + scope, // scope + codeFragment, // input + FALSE, // isExample + 0, // exampleName + fd, // fileDef + start, // startLine + end, // endLine + TRUE, // inlineFragment + mdef, // memberDef + FALSE // show line numbers + ); + ol.endCodeFragment(); + ol.endParagraph(); + + mdef->writeSourceDef(ol,cname); + mdef->writeSourceRefs(ol,cname); + mdef->writeSourceReffedBy(ol,cname); +} + diff --git a/src/vhdldocgen.h b/src/vhdldocgen.h index 7e75970..cebee43 100644 --- a/src/vhdldocgen.h +++ b/src/vhdldocgen.h @@ -75,7 +75,8 @@ class VhdlDocGen VFILE, SHAREDVARIABLE, CONFIG, - ALIAS + ALIAS, + MISCELLANEOUS }; VhdlDocGen(); @@ -137,7 +138,8 @@ class VhdlDocGen OutputList &ol); //static void writeVhdlComponentList(OutputList &ol,int type); - + static bool isMisc(const MemberDef *mdef) + { return mdef->getMemberSpecifiers()==VhdlDocGen::MISCELLANEOUS; } static bool isConfig(const MemberDef *mdef) { return mdef->getMemberSpecifiers()==VhdlDocGen::CONFIG; } static bool isAlias(const MemberDef *mdef) @@ -255,7 +257,7 @@ class VhdlDocGen const char *title,const char *subtitle,bool showEnumValues,int type); static QCString getClassName(const ClassDef*); - static bool writeClassType(ClassDef *&,OutputList &ol ,QCString & cname); + static bool writeClassType(ClassDef *,OutputList &ol ,QCString & cname); static void adjustRecordMember(MemberDef *mdef); static bool writeDoc(EntryNav* rootNav); @@ -265,12 +267,15 @@ class VhdlDocGen static void startFonts(const QCString& q, const char *keyword,OutputList& ol); static bool isNumber(const QCString& s); static QCString getProtectionName(int prot); + static void writeSource(MemberDef *mdef,OutputList& ol,QCString &); private: static void getFuncParams(QList&, const char* str); static bool compareArgList(ArgumentList*,ArgumentList*); static void writeVhdlLink(const ClassDef* cdd ,OutputList& ol,QCString& type,QCString& name,QCString& beh); static void findAllArchitectures(QList& ql,const ClassDef *cd); static void writeStringLink(const MemberDef *mdef,QCString mem,OutputList& ol); + static void writeCodeFragment(MemberDef *mdef,OutputList& ol); + }; #endif diff --git a/src/vhdlscanner.l b/src/vhdlscanner.l index ab52515..2d3288b 100644 --- a/src/vhdlscanner.l +++ b/src/vhdlscanner.l @@ -56,6 +56,7 @@ static int openGroups; static ParserInterface *g_thisParser; static const char * inputString; static int inputPosition; +static int inputLen; static int startComment = 0; static QFile inputFile; static QCString inbuf; @@ -84,17 +85,57 @@ static int g_lastCommentContext = 0; static bool docBlockAutoBrief; static char docBlockTerm; static int iDocLine = -1; +static Entry gBlock; +static int num_chars; //#define YY_A_INTERACTIVE 1 #define YY_NEVER_INTERACTIVE 1 //----------------------------------------------------------------------------- - +#define YY_USER_ACTION num_chars += yyleng; static void parserInit(); static void deleteSpecChars(char* str,char *buf); static void handleCommentBlock(const QCString &doc,bool brief); static void newEntry(); static void initEntry(Entry *e); +static int iCodeLen; + +static void makeInline() +{ + int diff=num_chars-iCodeLen; + assert(inputLen>iCodeLen+diff); + QCString par(&inputString[iCodeLen],diff); + int index=par.findRev("\\endcode"); + int tt=par.length()-par.find("\n",index); + QCString qc(&inputString[iCodeLen-tt],diff); + index=qc.findRev("--!"); + if (index<=0) return; + par=qc.left(index); + /* + fprintf(stderr,"\n-------------------------------------------------------------------------------- "); + fprintf(stderr,"\n bytes since %d %d \n %s",num_chars,iCodeLen,par.data()); + fprintf(stderr,"\n-------------------------------------------------------------------------------- "); + */ + gBlock.doc=par; + gBlock.section=Entry::VARIABLE_SEC; + gBlock.spec=VhdlDocGen::MISCELLANEOUS; + gBlock.fileName = yyFileName; + gBlock.endBodyLine=yyLineNr-1; + Entry *temp=new Entry(gBlock); + if (lastCompound) + lastCompound->addSubEntry(temp); + else if (lastEntity) + lastEntity->addSubEntry(temp); + else + { + temp->type="misc"; // global code + current_root->addSubEntry(temp); + } + + gBlock.reset(); + +}// makeInline + static void addSubEntry(Entry* root, Entry* e) { if (e==0 || root==0) return; @@ -502,16 +543,13 @@ static void parserInit() isFunc=0; isBody=0; scantype=0; - //pEntry=0; - //pp=0; lastCompound=0; lastEntity=0; bropen=0; openGroups=0; iDocLine=-1; - //isPrevDoc=FALSE; - //prevDocEntry.reset(); qrl.clear(); + num_chars=0; if (!g_lexInit) { @@ -557,36 +595,14 @@ static int yyread(char *buf,int max_size) while ( c < max_size && inputString[inputPosition] ) { *buf = inputString[inputPosition++] ; - c++; buf++; + c++; + buf++; } } return c; } -#if 0 -/* - * adds a text line description [--#] to the the previous type - */ -static void addOneTextLine(QCString& ss ) -{ - Entry* pTemp=0; - if (current && current->bodyLine==yyLineNr) - pTemp=current; - //else if (pEntry && pEntry->bodyLine==yyLineNr) - // pTemp=pEntry; - else - pTemp=getEntryAtLine(current_root,yyLineNr) ; - - if (pTemp) - { - ss=ss.stripWhiteSpace(); - ss.stripPrefix("--!"); - pTemp->brief=ss; - pTemp->briefLine=yyLineNr; - } -} -#endif %} @@ -1042,7 +1058,7 @@ ENDPROTECEDBODY "end"{BR}+"protected"{BR}+"body"{BR}+{NAME} {BR}* { lineCount(); -} + } ("end"){BR}*("record"){BR}*{LETTER}*{BR}*[;]|("end"){BR}*("units"){BR}*[;] { lineCount(); @@ -1098,36 +1114,6 @@ ENDPROTECEDBODY "end"{BR}+"protected"{BR}+"body"{BR}+{NAME} functionEntry=0; //eFuncBody=new Entry; ::parseFunctionProto(); -#if 0 - - EntryListIterator eli(*eFuncBody->children()); - Entry *rrt=eli.current(); - - if (current && (current->spec==VhdlDocGen::ARCHITECTURE && rrt)) - { - Entry *ep=new Entry(*rrt); - addSubEntry(current,ep); - isBody=1; - } - if (rrt) - { - Entry *ef=VhdlDocGen::findFunction(current_root,rrt); - if (ef) - { - ef->bodyLine=iFuncLine; - functionEntry=ef; - } - else if ((current->spec==VhdlDocGen::PACKAGE_BODY))//VhdlDocGen::Package_Body)) - { - Entry *ep=new Entry(*rrt); - addSubEntry(current,ep); - ep->bodyLine=iFuncLine; - functionEntry = ep; - } - } - delete eFuncBody; - eFuncBody=0; -#endif } bufferClear(); BEGIN(ParseType); @@ -1316,11 +1302,6 @@ ENDPROTECEDBODY "end"{BR}+"protected"{BR}+"body"{BR}+{NAME} } } -{TEXTT} { - lineCount(); - BEGIN(ParseType); -} - {BR}* { lineCount(); addText(yytext,yyleng); @@ -1348,6 +1329,7 @@ ENDPROTECEDBODY "end"{BR}+"protected"{BR}+"body"{BR}+{NAME} //qq=qq.lower(); current->name=qq; + qq=qq.lower(); if (lastCompound) { if (lastCompound->spec==VhdlDocGen::PACKAGE) @@ -1600,7 +1582,30 @@ ENDPROTECEDBODY "end"{BR}+"protected"{BR}+"body"{BR}+{NAME} QCString qcs; getBufText(qcs,iTextCounter); VhdlDocGen::prepareComment(qcs); - handleCommentBlock(qcs,FALSE); + int ii =qcs.find("\\code"); + if (ii>0) + { + iCodeLen=num_chars; + + gBlock.reset(); + int len=qcs.length(); + QCString name=qcs.right(len-ii); + name=VhdlDocGen::getIndexWord(name.data(),1); + if (!name) + gBlock.name="misc"+ VhdlDocGen::getRecordNumber(); + else + gBlock.name=name; + qcs=qcs.left(ii); + gBlock.startLine=yyLineNr+1; + gBlock.bodyLine=yyLineNr+1; + gBlock.brief+=qcs; + iTextCounter=0; + } + + if (ii==-1) + { + handleCommentBlock(qcs,FALSE); + } bufferClear(); unput(*yytext); BEGIN(g_lastCommentContext); @@ -1611,21 +1616,30 @@ ENDPROTECEDBODY "end"{BR}+"protected"{BR}+"body"{BR}+{NAME} QCString qcs(yytext); int j=qcs.find("--!"); qcs=qcs.right(qcs.length()-3-j); + bool isEndCode=qcs.contains("\\endcode"); + + if (isEndCode) + makeInline(); //printf("--> handleCommentBlock line %d\n",yyLineNr); Entry* pTemp=getEntryAtLine(current_root,yyLineNr); - if (pTemp) - { - pTemp->briefLine=yyLineNr; - pTemp->brief+=qcs; - iDocLine=-1; - } - else + + if (!isEndCode) { - handleCommentBlock(qcs,TRUE); - } - //printf("--> end: handleCommentBlock line %d\n",yyLineNr); + if (pTemp) + { + pTemp->briefLine=yyLineNr; + pTemp->brief+=qcs; + iDocLine=-1; + } + else + { + handleCommentBlock(qcs,TRUE); + } + } + bufferClear(); -} +}// one line + <*>{COMMENT} { } @@ -1914,7 +1928,9 @@ void VHDLLanguageScanner::parseInput(const char *fileName,const char *fileBuf,En g_inputFromFile = FALSE; inputPosition = 0; assert(root!=0); + inputString=fileBuf; + inputLen=strlen(fileBuf); current_root = root; global_root = root; current=new Entry; diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 87dd0ae..d1d9198 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -721,7 +721,7 @@ void XmlDocVisitor::visitPre(DocMscFile *df) void XmlDocVisitor::visitPost(DocMscFile *) { if (m_hide) return; - m_t << "" << endl; + m_t << "" << endl; } void XmlDocVisitor::visitPre(DocLink *lnk) { diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 6932794..b1cc535 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -544,6 +544,25 @@ static void stripQualifiers(QCString &typeStr) } } +static QCString classOutputFileBase(ClassDef *cd) +{ + static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES"); + if (inlineGroupedClasses && cd->partOfGroups()!=0) + return cd->getXmlOutputFileBase(); + else + return cd->getOutputFileBase(); +} + +static QCString memberOutputFileBase(MemberDef *md) +{ + static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES"); + if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0) + return md->getClassDef()->getXmlOutputFileBase(); + else + return md->getOutputFileBase(); +} + + static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,Definition *def) { @@ -587,7 +606,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De case MemberDef::Slot: memType="slot"; isFunc=TRUE; break; } - ti << " getOutputFileBase() + ti << " anchor() << "\" kind=\"" << memType << "\">" << convertToXML(md->name()) << "" << endl; @@ -606,7 +625,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De } else { - t << md->getOutputFileBase(); + t << memberOutputFileBase(md); } t << "_1" // encoded `:' character (see util.cpp:convertNameToFile) << md->anchor(); @@ -772,7 +791,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De if (rmd) { t << " getOutputFileBase() << "_1" << rmd->anchor() << "\">" + << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">" << convertToXML(rmd->name()) << "" << endl; } LockingPtr rbml = md->reimplementedBy(); @@ -782,7 +801,7 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De for (mli.toFirst();(rmd=mli.current());++mli) { t << " getOutputFileBase() << "_1" << rmd->anchor() << "\">" + << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">" << convertToXML(rmd->name()) << "" << endl; } } @@ -891,11 +910,11 @@ static void generateXMLForMember(MemberDef *md,FTextStream &ti,FTextStream &t,De MemberDef *emd; for (emli.toFirst();(emd=emli.current());++emli) { - ti << " getOutputFileBase() + ti << " anchor() << "\" kind=\"enumvalue\">" << convertToXML(emd->name()) << "" << endl; - t << " getOutputFileBase() << "_1" + t << " anchor() << "\" prot=\""; switch (emd->protection()) { @@ -1036,7 +1055,7 @@ static void writeListOfAllMembers(ClassDef *cd,FTextStream &t) { Protection prot = mi->prot; Specifier virt=md->virtualness(); - t << " getOutputFileBase() << "_1" << + t << " anchor() << "\" prot=\""; switch (prot) { @@ -1169,7 +1188,6 @@ static void writeInnerDirs(const DirList *dl,FTextStream &t) } } - static void generateXMLForClass(ClassDef *cd,FTextStream &ti) { // + brief description @@ -1187,7 +1205,7 @@ static void generateXMLForClass(ClassDef *cd,FTextStream &ti) // + standard member sections // + detailed member documentation // - examples using the class - + if (cd->isReference()) return; // skip external references. if (cd->isHidden()) return; // skip hidden classes. if (cd->name().find('@')!=-1) return; // skip anonymous compounds. @@ -1195,12 +1213,12 @@ static void generateXMLForClass(ClassDef *cd,FTextStream &ti) msg("Generating XML output for class %s\n",cd->name().data()); - ti << " getOutputFileBase() + ti << " compoundTypeString() << "\">" << convertToXML(cd->name()) << "" << endl; QCString outputDirectory = Config_getString("XML_OUTPUT"); - QCString fileName=outputDirectory+"/"+cd->getOutputFileBase()+".xml"; + QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml"; QFile f(fileName); if (!f.open(IO_WriteOnly)) { @@ -1212,7 +1230,7 @@ static void generateXMLForClass(ClassDef *cd,FTextStream &ti) writeXMLHeader(t); t << " getOutputFileBase() << "\" kind=\"" + << classOutputFileBase(cd) << "\" kind=\"" << cd->compoundTypeString() << "\" prot=\""; switch (cd->protection()) { @@ -1234,7 +1252,7 @@ static void generateXMLForClass(ClassDef *cd,FTextStream &ti) t << " classDef->isLinkable()) { - t << "refid=\"" << bcd->classDef->getOutputFileBase() << "\" "; + t << "refid=\"" << classOutputFileBase(bcd->classDef) << "\" "; } t << "prot=\""; switch (bcd->prot) @@ -1273,7 +1291,7 @@ static void generateXMLForClass(ClassDef *cd,FTextStream &ti) for (bcli.toFirst();(bcd=bcli.current());++bcli) { t << " classDef->getOutputFileBase() + << classOutputFileBase(bcd->classDef) << "\" prot=\""; switch (bcd->prot) { diff --git a/winbuild/Doxygen.vcproj b/winbuild/Doxygen.vcproj index 0f29ba3..26cb2d2 100644 --- a/winbuild/Doxygen.vcproj +++ b/winbuild/Doxygen.vcproj @@ -88,6 +88,7 @@ GenerateDebugInformation="true" ProgramDatabaseFile=".\Debug/Doxygen.pdb" SubSystem="1" + LargeAddressAware="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" @@ -187,6 +188,7 @@ AdditionalLibraryDirectories="Release" ProgramDatabaseFile=".\Release/Doxygen.pdb" SubSystem="1" + LargeAddressAware="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/winbuild/Doxytag.vcproj b/winbuild/Doxytag.vcproj index 486465a..a852a5e 100644 --- a/winbuild/Doxytag.vcproj +++ b/winbuild/Doxytag.vcproj @@ -87,6 +87,7 @@ GenerateDebugInformation="true" ProgramDatabaseFile=".\Debug/Doxytag.pdb" SubSystem="1" + LargeAddressAware="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" @@ -182,6 +183,7 @@ AdditionalLibraryDirectories="Release" ProgramDatabaseFile=".\Release/Doxytag.pdb" SubSystem="1" + LargeAddressAware="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" diff --git a/winbuild/Doxywizard.vcproj b/winbuild/Doxywizard.vcproj index 9598628..880dc51 100644 --- a/winbuild/Doxywizard.vcproj +++ b/winbuild/Doxywizard.vcproj @@ -81,6 +81,7 @@ GenerateDebugInformation="true" ProgramDatabaseFile="" SubSystem="2" + LargeAddressAware="2" LinkTimeCodeGeneration="0" RandomizedBaseAddress="1" DataExecutionPrevention="0" @@ -176,6 +177,7 @@ GenerateDebugInformation="false" ProgramDatabaseFile="" SubSystem="2" + LargeAddressAware="2" LinkTimeCodeGeneration="0" RandomizedBaseAddress="1" DataExecutionPrevention="0" -- cgit v0.12