From cd8d9d90f0ded716840cd405d88c8b711428e899 Mon Sep 17 00:00:00 2001 From: dimitri Date: Sun, 12 Oct 2008 11:30:16 +0000 Subject: Release-1.5.7.1-20081012 --- INSTALL | 4 +- README | 4 +- configure | 2 +- doc/config.doc | 22 ++++++++ doc/features.doc | 4 +- doc/index.doc | 2 +- doc/install.doc | 8 +-- doc/lists.doc | 2 +- src/code.l | 16 +++++- src/commentscan.l | 17 ++++-- src/config.l | 67 +++++++++++++++++++----- src/definition.cpp | 3 ++ src/diagram.cpp | 4 +- src/docparser.cpp | 4 +- src/docsets.h | 2 + src/dot.cpp | 7 +++ src/doxygen.cpp | 5 ++ src/doxygen.css | 4 -- src/doxygen_css.h | 4 -- src/ftvhelp.h | 2 + src/htmlgen.cpp | 9 ++-- src/htmlhelp.h | 2 + src/index.h | 6 +++ src/namespacedef.cpp | 20 +++++++ src/namespacedef.h | 3 +- src/qhp.cpp | 145 +++++++++++++++++++++++++++++++-------------------- src/qhp.h | 18 ++++--- src/rtfgen.cpp | 18 +++++-- src/scanner.l | 2 +- src/util.cpp | 145 ++++++++++++++++++++++++++++++++++++++++++--------- src/util.h | 4 +- src/vhdldocgen.cpp | 30 ++++++++++- src/vhdlscanner.l | 4 +- 33 files changed, 443 insertions(+), 146 deletions(-) diff --git a/INSTALL b/INSTALL index 4f01e0d..bb690b4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.5.7.1 +DOXYGEN Version 1.5.7.1-20081012 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (04 October 2008) +Dimitri van Heesch (12 October 2008) diff --git a/README b/README index 987185d..5652fb8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.5.7.1 +DOXYGEN Version 1.5.7.1_20081012 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (04 October 2008) +Dimitri van Heesch (dimitri@stack.nl) (12 October 2008) diff --git a/configure b/configure index 4421668..fc2180d 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ doxygen_version_minor=5 doxygen_version_revision=7.1 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=NO +doxygen_version_mmn=20081012 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` diff --git a/doc/config.doc b/doc/config.doc index db181dd..db7cd16 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -195,6 +195,9 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_project_number PROJECT_NUMBER \refitem cfg_qhp_namespace QHP_NAMESPACE \refitem cfg_qhp_virtual_folder QHP_VIRTUAL_FOLDER +\refitem cfg_qhp_custom_filter_name QHP_CUSTOM_FILTER_NAME +\refitem cfg_qhp_cust_filter_attrs QHP_CUST_FILTER_ATTRS +\refitem cfg_qhp_sect_filter_attrs QHP_SECT_FILTER_ATTRS \refitem cfg_qhg_location QHG_LOCATION \refitem cfg_qt_autobrief QT_AUTOBRIEF \refitem cfg_quiet QUIET @@ -1384,6 +1387,25 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" generating Qt Help Project output. For more information please see Qt Help Project / Virtual Folders. +\anchor cfg_qhp_custom_filter_name +
\c QHP_CUSTOM_FILTER_NAME
+ \addindex QHP_CUSTOM_FILTER_NAME + If QHP_CUSTOM_FILTER_NAME is set, it specifies the name of a custom filter to add. For more information please see + Qt Help Project / Custom Filters. + +\anchor cfg_qhp_cust_filter_attrs +
\c QHP_CUST_FILTER_ATTRS
+ \addindex QHP_CUST_FILTER_ATTRS + The QHP_CUST_FILTER_ATTRIBUTES tag specifies the list of the attributes of the custom filter to add. + For more information please see + Qt Help Project / Custom Filters. + +\anchor cfg_qhp_sect_filter_attrs +
\c QHP_SECT_FILTER_ATTRS
+ \addindex QHP_SECT_FILTER_ATTRS + The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's filter section matches. + Qt Help Project / Filter Attributes. + \anchor cfg_qhg_location
\c QHG_LOCATION
\addindex QHG_LOCATION diff --git a/doc/features.doc b/doc/features.doc index bfc62b5..b1ebf0c 100644 --- a/doc/features.doc +++ b/doc/features.doc @@ -80,11 +80,11 @@ Although doxygen can now be used in any project written in a language that is supported by doxygen, initially it was specifically designed to be used for projects -that make use of Troll Tech's +that make use of Qt Software's Qt toolkit. I have tried to make doxygen `Qt-compatible'. That is: Doxygen can read the documentation contained in the Qt source code and create a class browser that looks quite similar to the -one that is generated by Troll Tech. Doxygen understands the C++ extensions +one that is generated by Qt Software. Doxygen understands the C++ extensions used by Qt such as signals and slots and many of the markup commands used in the Qt sources. Doxygen can also automatically generate links to existing documentation diff --git a/doc/index.doc b/doc/index.doc index 87e419f..0debece 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -175,7 +175,7 @@ Thanks go to: The first version of doxygen borrowed some code of an old version of DOC++. Although I have rewritten practically all code since then, DOC++ has still given me a good start in writing doxygen. -
  • All people at Troll Tech, for creating a beautiful GUI Toolkit +
  • All people at Qt Software, for creating a beautiful GUI Toolkit (which is very useful as a Windows/Unix platform abstraction layer :-)
  • Kevin McBride for maintaining the subversion reporsitory for doxygen.
  • My brother Frank diff --git a/doc/install.doc b/doc/install.doc index 41961ec..77530fa 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -55,7 +55,7 @@ To take full advantage of doxygen's features the following additional tools should be installed.
      -
    • Troll Tech's GUI toolkit +
    • Qt Software's GUI toolkit Qt \latexonly(see {\tt http://www.trolltech.com/products/qt.html})\endlatexonly \addindex Qt @@ -505,7 +505,7 @@ Here is what is required: For doxywizard, a complete Qt library is still a requirement however. A commercial license to build doxywizard with the latest Qt library was kindly donated to me - by the nice people at TrollTech. + by the nice people at Qt Software. See doxygen download page for a link.
    • If you used WinZip to extract the tar archive it will (apparently) not @@ -589,7 +589,7 @@ You can download it from If you want to produce Qt Compressed Help files (see \ref cfg_qhg_location "QHG_LOCATION") in the config file, then you need qhelpgenerator which is part of Qt. -You can download Qt from Trolltech Downloads. +You can download Qt from Qt Software Downloads. In order to generate PDF output or use scientific formulas you will also need to install LaTeX and @@ -662,7 +662,7 @@ features: cfg_qhelgenerator_loc "QHG_LOCATION") in the config file, then you need qhelpgenerator which is part of Qt. You can download Qt from - Trolltech Downloads. + Qt Software Downloads.
    • the Graph visualization toolkit version 1.8.10
      diff --git a/doc/lists.doc b/doc/lists.doc index 649d83c..c55277a 100644 --- a/doc/lists.doc +++ b/doc/lists.doc @@ -103,7 +103,7 @@ Here is the above example with HTML commands: Using \\arg or \@li -For compatibility with the Troll Tech's internal documentation tool and +For compatibility with the Qt Software's internal documentation tool qdoc and with KDoc, doxygen has two commands that can be used to create simple unnested lists. diff --git a/src/code.l b/src/code.l index 85d23b5..8c22012 100644 --- a/src/code.l +++ b/src/code.l @@ -687,7 +687,7 @@ static MemberDef *setCallContextForVar(const QCString &name) QCString scope = name.left(scopeEnd); QCString locName = name.right(name.length()-scopeEnd-2); //printf("explicit scope: name=%s scope=%s\n",locName.data(),scope.data()); - ClassDef *mcd = getClass(scope); // TODO: check namespace as well + ClassDef *mcd = getClass(scope); if (mcd && !locName.isEmpty()) { MemberDef *md=mcd->getMemberByName(locName); @@ -698,6 +698,20 @@ static MemberDef *setCallContextForVar(const QCString &name) return md; } } + else // check namespace as well + { + NamespaceDef *mnd = getResolvedNamespace(scope); + if (mnd && !locName.isEmpty()) + { + MemberDef *md=mnd->getMemberByName(locName); + if (md) + { + //printf("name=%s scope=%s\n",locName.data(),scope.data()); + g_theCallContext.setClass(stripClassName(md->typeString())); + return md; + } + } + } } MemberName *mn; diff --git a/src/commentscan.l b/src/commentscan.l index 8c8aa2e..2652c6c 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -151,11 +151,11 @@ static DocCmdMap docCmdMap[] = { "example", &handleExample, FALSE }, { "details", &handleDetails, TRUE }, { "name", &handleName, FALSE }, - { "todo", &handleTodo, TRUE }, - { "test", &handleTest, TRUE }, - { "bug", &handleBug, TRUE }, - { "deprecated", &handleDeprecated, TRUE }, - { "xrefitem", &handleXRefItem, TRUE }, + { "todo", &handleTodo, FALSE }, // end brief will be done differently + { "test", &handleTest, FALSE }, // end brief will be done differently + { "bug", &handleBug, FALSE }, // end brief will be done differently + { "deprecated", &handleDeprecated, FALSE }, // end brief will be done differently + { "xrefitem", &handleXRefItem, FALSE }, // end brief will be done differently { "related", &handleRelated, TRUE }, { "relates", &handleRelated, TRUE }, { "relatedalso", &handleRelatedAlso, TRUE }, @@ -624,6 +624,13 @@ static inline void setOutput(OutputContext ctx) newXRefKind==xrefKind && // of the same kind (xrefKind!=XRef_Item || newXRefItemKey==xrefItemKey); // with the same key if \xrefitem + //printf("%d && %d && %d && (%d || %d)\n", + // inContext==OutputXRef, + // ctx==OutputXRef, + // newXRefKind==xrefKind, + // xrefKind!=XRef_Item, + // newXRefItemKey==xrefItemKey); + //printf("refKind=%d newXRefKind=%d xrefAppendToPrev=%d xrefAppendFlag=%d\n", // xrefKind,newXRefKind,xrefAppendToPrev,xrefAppendFlag); diff --git a/src/config.l b/src/config.l index 79795a8..6d1fc3e 100644 --- a/src/config.l +++ b/src/config.l @@ -1270,19 +1270,28 @@ void Config::check() // check QHP creation requirements if (Config_getBool("GENERATE_QHP")) { + bool quit = false; if (!Config_getBool("GENERATE_HTML")) { config_err("Warning: GENERATE_QHP=YES requires GENERATE_HTML=YES.\n"); + quit = true; } if (Config_getString("QHP_NAMESPACE").isEmpty()) { config_err("Warning: GENERATE_QHP=YES requires QHP_NAMESPACE to be set.\n"); + quit = true; } if (Config_getString("QHP_VIRTUAL_FOLDER").isEmpty()) { config_err("Warning: GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set.\n"); + quit = true; + } + + if (quit) + { + exit(1); } } @@ -1751,6 +1760,16 @@ void Config::create() "VHDL. \n", FALSE ); + cl = addList( "EXTENSION_MAPPING", + "Doxygen selects the parser to use depending on the extension of the files it parses. \n" + "With this tag you can assign which parser to use for a given extension. \n" + "Doxygen has a built-in mapping, but you can override or extend it using this tag. \n" + "The format is ext=language, where ext is a file extension, and language is one of \n" + "the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, \n" + "Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat \n" + ".inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), \n" + "use: inc=Fortran f=C\n" + ); cb = addBool( "BUILTIN_STL_SUPPORT", "If you use STL classes (i.e. std::string, std::vector, etc.) but do not want \n" @@ -1774,15 +1793,15 @@ void Config::create() "instead of private inheritance when no explicit protection keyword is present. \n", FALSE ); - cb = addBool( "IDL_PROPERTY_SUPPORT", - "For Microsoft's IDL there are propget and propput attributes to indicate getter \n" - "and setter methods for a property. Setting this option to YES (the default) \n" - "will make doxygen to replace the get and set methods by a property in the \n" - "documentation. This will only work if the methods are indeed getting or \n" - "setting a simple type. If this is not the case, or you want to show the \n" - "methods anyway, you should set this option to NO. \n", - TRUE - ); + cb = addBool( "IDL_PROPERTY_SUPPORT", + "For Microsoft's IDL there are propget and propput attributes to indicate getter \n" + "and setter methods for a property. Setting this option to YES (the default) \n" + "will make doxygen to replace the get and set methods by a property in the \n" + "documentation. This will only work if the methods are indeed getting or \n" + "setting a simple type. If this is not the case, or you want to show the \n" + "methods anyway, you should set this option to NO. \n", + TRUE + ); cb = addBool( "DISTRIBUTE_GROUP_DOC", "If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n" @@ -2565,18 +2584,42 @@ void Config::create() "QHP_NAMESPACE", "The QHP_NAMESPACE tag specifies the namespace to use when generating \n" "Qt Help Project output. For more information please see \n" - "Qt Help Project / Namespace. \n" + "http://doc.trolltech.com/qthelpproject.html#namespace \n" ); - cs->setDefaultValue("org.doxygen.Project"); cs->addDependency("GENERATE_QHP"); cs = addString( "QHP_VIRTUAL_FOLDER", "The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating \n" "Qt Help Project output. For more information please see \n" - "Qt Help Project / Virtual Folders. \n" + "http://doc.trolltech.com/qthelpproject.html#virtual-folders \n" ); cs->setDefaultValue("doc"); cs->addDependency("GENERATE_QHP"); + + cs = addString( + "QHP_CUSTOM_FILTER_NAME", + "If QHP_CUSTOM_FILTER_NAME is set, it specifies the name of a custom filter to add. \n" + "For more information please see \n" + "http://doc.trolltech.com/qthelpproject.html#custom-filters \n" + ); + cs->addDependency("GENERATE_QHP"); + + cs = addString( + "QHP_CUST_FILTER_ATTRS", + "The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add." + "For more information please see \n" + "Qt Help Project / Custom Filters. \n" + ); + cs->addDependency("GENERATE_QHP"); + + cs = addString( + "QHP_SECT_FILTER_ATTRS", + "The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's \n" + "filter section matches. \n" + "Qt Help Project / Filter Attributes. \n" + ); + cs->addDependency("GENERATE_QHP"); + cs = addString( "QHG_LOCATION", "If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can \n" diff --git a/src/definition.cpp b/src/definition.cpp index ac8e044..c9db4bd 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -1238,8 +1238,11 @@ QCString Definition::briefDescriptionAsTooltip() const static bool reentering=FALSE; if (!reentering) { + MemberDef *md = definitionType()==TypeMember ? (MemberDef*)this : 0; + const Definition *scope = definitionType()==TypeMember ? getOuterScope() : this; reentering=TRUE; // prevent requests for tooltips while parsing a tooltip m_impl->brief->tooltip = parseCommentAsText( + scope,md, m_impl->brief->doc, m_impl->brief->file, m_impl->brief->line); diff --git a/src/diagram.cpp b/src/diagram.cpp index 7374622..bed02e1 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -30,10 +30,9 @@ #include "config.h" #include "message.h" #include "util.h" -//#include "latexgen.h" -//#include "htmlgen.h" #include "doxygen.h" #include "portable.h" +#include "index.h" //----------------------------------------------------------------------------- @@ -1291,6 +1290,7 @@ void ClassDiagram::writeImage(QTextStream &t,const char *path, super->drawConnectors(t,&image,FALSE,TRUE,baseRows,superRows,cellWidth,cellHeight); image.save((QCString)path+"/"+fileName+".png"); + Doxygen::indexList.addImageFile(QCString(fileName)+".png"); if (generateMap) t << "" << endl; } diff --git a/src/docparser.cpp b/src/docparser.cpp index 3a3c999..6b29189 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2122,6 +2122,7 @@ DocRef::DocRef(DocNode *parent,const QString &target,const QString &context) : { Definition *compound = 0; QCString anchor; + //printf("DocRef::DocRef(target=%s,context=%s\n",target.data(),context.data()); ASSERT(!target.isEmpty()); m_relPath = g_relPath; SectionInfo *sec = Doxygen::sectionDict[target]; @@ -6086,6 +6087,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, { g_context = ""; } + //printf("g_context=%s\n",g_context.data()); if (indexWords && md && Config_getBool("SEARCHENGINE")) { @@ -6216,7 +6218,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, // restore original parser state docParserPopContext(); - //printf("end validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"", + //printf(">>>>>> end validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"", // md?md->name().data():""); return root; diff --git a/src/docsets.h b/src/docsets.h index 5ef6eb2..cc285e4 100644 --- a/src/docsets.h +++ b/src/docsets.h @@ -50,6 +50,8 @@ class DocSets : public IndexIntf const char *contRef, const char *memRef, const char *anchor,const MemberDef *md); void addIndexFile(const char *name); + void addImageFile(const char *) {} + void addStyleSheetFile(const char *) {} private: void writeToken(QTextStream &t, const Definition *d, diff --git a/src/dot.cpp b/src/dot.cpp index b8da01c..3f0a4ff 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1123,6 +1123,7 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) const checkDotResult(imgName); if (Config_getBool("DOT_CLEANUP")) thisDir.remove(dotName); } + Doxygen::indexList.addImageFile(imgName); // write image and map in a table row QCString mapLabel = convertNameToFile(n->m_label); out << "\"\"(&IndexIntf::addIndexFile,name); } + void addImageFile(const char *name) + { foreach(&IndexIntf::addImageFile,name); } + void addStyleSheetFile(const char *name) + { foreach(&IndexIntf::addStyleSheetFile,name); } }; diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index ceebc6d..6adb9e1 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -51,6 +51,7 @@ NamespaceDef::NamespaceDef(const char *df,int dl, m_innerCompounds = new SDict(17); usingDirList = 0; usingDeclList = 0; + m_allMembersDict = 0; setReference(lref); memberGroupSDict = new MemberGroupSDict; memberGroupSDict->setAutoDelete(TRUE); @@ -183,6 +184,12 @@ void NamespaceDef::insertMember(MemberDef *md) m_memberLists.append(allMemberList); } allMemberList->append(md); + if (m_allMembersDict==0) + { + m_allMembersDict = new MemberSDict; + } + //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data()); + m_allMembersDict->append(md->localName(),md); //::addNamespaceMemberNameToIndex(md); //static bool sortBriefDocs=Config_getBool("SORT_BRIEF_DOCS"); switch(md->memberType()) @@ -935,3 +942,16 @@ bool NamespaceDef::isLinkable() const { return isLinkableInProject() || isReference(); } + + +MemberDef * NamespaceDef::getMemberByName(const QCString &n) const +{ + MemberDef *md = 0; + if (m_allMembersDict && !n.isEmpty()) + { + md = m_allMembersDict->find(n); + //printf("%s::m_allMembersDict->find(%s)=%p\n",name().data(),n.data(),md); + } + return md; +} + diff --git a/src/namespacedef.h b/src/namespacedef.h index b492e7e..50f4c1f 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -74,6 +74,7 @@ class NamespaceDef : public Definition MemberList *getMemberList(MemberList::ListType lt) const; const QList &getMemberLists() const { return m_memberLists; } + MemberDef *getMemberByName(const QCString &) const; /*! Returns the user defined member groups */ MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; } @@ -109,7 +110,7 @@ class NamespaceDef : public Definition SDict *usingDeclList; SDict *m_innerCompounds; - //MemberList *allMemberList; + MemberSDict *m_allMembersDict; QList m_memberLists; MemberGroupSDict *memberGroupSDict; ClassSDict *classSDict; diff --git a/src/qhp.cpp b/src/qhp.cpp index 52966b2..e870ef5 100644 --- a/src/qhp.cpp +++ b/src/qhp.cpp @@ -19,15 +19,16 @@ #include "message.h" #include "config.h" +#include #include -static QCString makeFileName(char const * withoutExtension) +static QCString makeFileName(const char * withoutExtension) { if (!withoutExtension) return QCString(); return QCString(withoutExtension)+".html"; } -static QCString makeRef(char const * withoutExtension, char const * anchor) +static QCString makeRef(const char * withoutExtension, const char * anchor) { if (!withoutExtension) return QCString(); QCString result = makeFileName(withoutExtension); @@ -65,26 +66,57 @@ void Qhp::initialize() */ QCString nameSpace = Config_getString("QHP_NAMESPACE"); QCString virtualFolder = Config_getString("QHP_VIRTUAL_FOLDER"); - QCString projectTitle = getFullProjectName(); - QCString filterIdent = projectTitle; - QCString filterAttribute = projectTitle; - char const * rootAttributes[] = + const char * rootAttributes[] = { "version", "1.0", 0 }; - char const * customFilterAttributes[] = - { "name", filterIdent, 0 }; m_doc.open("QtHelpProject", rootAttributes); m_doc.openCloseContent("namespace", nameSpace); m_doc.openCloseContent("virtualFolder", virtualFolder); - m_doc.open("customFilter", customFilterAttributes); - m_doc.openCloseContent("filterAttribute", filterAttribute); - m_doc.close("customFilter"); + // Add custom filter + QCString filterName = Config_getString("QHP_CUSTOM_FILTER_NAME"); + if (!filterName.isEmpty()) + { + const char * tagAttributes[] = + { "name", filterName, 0 }; + m_doc.open("customFilter", tagAttributes); + + QStringList customFilterAttributes = QStringList::split(' ', Config_getString("QHP_CUST_FILTER_ATTRS")); + for (int i = 0; i < (int)customFilterAttributes.count(); i++) + { + m_doc.openCloseContent("filterAttribute", customFilterAttributes[i]); + } + m_doc.close("customFilter"); + } + m_doc.open("filterSection"); - m_doc.openCloseContent("filterAttribute", filterAttribute); + + // Add section attributes + QStringList sectionFilterAttributes = QStringList::split(' ', + Config_getString("QHP_SECT_FILTER_ATTRS")); + if (!sectionFilterAttributes.contains(QString("doxygen"))) + { + sectionFilterAttributes << "doxygen"; + } + for (int i = 0; i < (int)sectionFilterAttributes.count(); i++) + { + m_doc.openCloseContent("filterAttribute", sectionFilterAttributes[i]); + } m_toc.open("toc"); + + // Add extra root node + QCString fullProjectname = getFullProjectName(); + const char * const attributes[] = + { "title", fullProjectname, + "ref", "index.html", + NULL + }; + m_toc.open("section", attributes); + m_prevSectionLevel = 1; + m_sectionLevel = 1; + m_index.open("keywords"); m_files.open("files"); } @@ -93,6 +125,10 @@ void Qhp::finalize() { // Finish TOC handlePrevSection(); + for (int i = m_prevSectionLevel; i > 0; i--) + { + m_toc.close("section"); + } m_toc.close("toc"); m_doc.insert(m_toc); @@ -101,12 +137,6 @@ void Qhp::finalize() m_doc.insert(m_index); // Finish files - addFile("doxygen.css"); - addFile("doxygen.png"); - addFile("tab_b.gif"); - addFile("tab_l.gif"); - addFile("tab_r.gif"); - addFile("tabs.css"); m_files.close("files"); m_doc.insert(m_files); @@ -137,9 +167,9 @@ void Qhp::decContentsDepth() m_sectionLevel--; } -void Qhp::addContentsItem(bool /*isDir*/, char const * name, - char const * /*ref*/, char const * file, - char const * /*anchor*/) +void Qhp::addContentsItem(bool /*isDir*/, const char * name, + const char * /*ref*/, const char * file, + const char * /*anchor*/) { // Backup difference before modification int diff = m_prevSectionLevel - m_sectionLevel; @@ -154,9 +184,9 @@ void Qhp::addContentsItem(bool /*isDir*/, char const * name, } } -void Qhp::addIndexItem(char const * level1, char const * level2, - char const * contRef, char const * /*memRef*/, - char const * anchor, const MemberDef * /*md*/) +void Qhp::addIndexItem(const char * level1, const char * level2, + const char * contRef, const char * /*memRef*/, + const char * anchor, const MemberDef * /*md*/) { /* @@ -165,7 +195,7 @@ void Qhp::addIndexItem(char const * level1, char const * level2, QCString id(level1); id += "::"; id += level2; - char const * attributes[] = + const char * attributes[] = { "name", level2, "id", id, "ref", ref, @@ -175,7 +205,7 @@ void Qhp::addIndexItem(char const * level1, char const * level2, } void -Qhp::addIndexFile(char const * name) +Qhp::addIndexFile(const char * name) { addFile(name); } @@ -183,7 +213,6 @@ Qhp::addIndexFile(char const * name) /*static*/ QCString Qhp::getQhpFileName() { - return "index.qhp"; } @@ -215,39 +244,33 @@ Qhp::handlePrevSection() return; } - // Replace "Main Page" with in TOC - QCString finalTitle; - if (m_prevSectionLevel==0 && m_prevSectionTitle=="Main Page") + // We skip "Main Page" as our extra root is pointing to that + if (!((m_prevSectionLevel==1) && (m_prevSectionTitle=="Main Page"))) { - finalTitle = getFullProjectName(); - } - if (finalTitle.isEmpty()) - { - finalTitle = m_prevSectionTitle; - } - QCString finalRef = makeFileName(m_prevSectionRef); - - char const * const attributes[] = - { "title", finalTitle, - "ref", finalRef, - NULL - }; - - if (m_prevSectionLevel < m_sectionLevel) - { - // Section with children - m_toc.open("section", attributes); - } - else - { - // Section without children - m_toc.openClose("section", attributes); + QCString finalRef = makeFileName(m_prevSectionRef); + + const char * const attributes[] = + { "title", m_prevSectionTitle, + "ref", finalRef, + NULL + }; + + if (m_prevSectionLevel < m_sectionLevel) + { + // Section with children + m_toc.open("section", attributes); + } + else + { + // Section without children + m_toc.openClose("section", attributes); + } } clearPrevSection(); } -void Qhp::setPrevSection(char const * title, char const * ref, int level) +void Qhp::setPrevSection(const char * title, const char * ref, int level) { m_prevSectionTitle = title; m_prevSectionRef = ref; @@ -258,10 +281,20 @@ void Qhp::clearPrevSection() { m_prevSectionTitle.resize(0); m_prevSectionRef.resize(0); - m_prevSectionLevel = m_sectionLevel; } -void Qhp::addFile(char const * fileName) +void Qhp::addFile(const char * fileName) { m_files.openCloseContent("file", fileName); } + +void Qhp::addImageFile(const char *fileName) +{ + addFile(fileName); +} + +void Qhp::addStyleSheetFile(const char *fileName) +{ + addFile(fileName); +} + diff --git a/src/qhp.h b/src/qhp.h index 9310a75..38d17fd 100644 --- a/src/qhp.h +++ b/src/qhp.h @@ -31,12 +31,14 @@ class Qhp : public IndexIntf void finalize(); void incContentsDepth(); void decContentsDepth(); - void addContentsItem(bool isDir, char const * name, char const * ref, - char const * file, char const * anchor); - void addIndexItem(char const * level1, char const * level2, - char const * contRef, char const * memRef, - char const * anchor, const MemberDef * md); - void addIndexFile(char const * name); + void addContentsItem(bool isDir, const char * name, const char * ref, + const char * file, const char * anchor); + void addIndexItem(const char * level1, const char * level2, + const char * contRef, const char * memRef, + const char * anchor, const MemberDef * md); + void addIndexFile(const char * name); + void addImageFile(const char * name); + void addStyleSheetFile(const char * name); // END IndexIntf static QCString getQhpFileName(); @@ -44,8 +46,8 @@ class Qhp : public IndexIntf private: void handlePrevSection(); void clearPrevSection(); - void setPrevSection(char const * title, char const * ref, int level); - void addFile(char const * fileName); + void setPrevSection(const char * title, const char * ref, int level); + void addFile(const char * fileName); static QCString getFullProjectName(); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index bd4630a..0560a70 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -922,10 +922,13 @@ void RTFGenerator::startIndexList() void RTFGenerator::endIndexList() { DBG_RTF(t << "{\\comment (endIndexList)}" << endl) - t << "\\par"; + if (!m_omitParagraph) + { + t << "\\par"; + m_omitParagraph = TRUE; + } t << "}"; decrementIndentLevel(); - m_omitParagraph = TRUE; } /*! start bullet list */ @@ -990,6 +993,12 @@ void RTFGenerator::writeListItem() void RTFGenerator::startIndexItem(const char *,const char *) { DBG_RTF(t << "{\\comment (startIndexItem)}" << endl) + + if (!m_omitParagraph) + { + t << "\\par" << endl; + m_omitParagraph = TRUE; + } } void RTFGenerator::endIndexItem(const char *ref,const char *fn) @@ -1006,7 +1015,6 @@ void RTFGenerator::endIndexItem(const char *ref,const char *fn) t << endl; } m_omitParagraph = TRUE; - newParagraph(); } //void RTFGenerator::writeIndexFileItem(const char *,const char *text) @@ -2607,15 +2615,17 @@ void RTFGenerator::postProcess(QByteArray &a) QByteArray enc(a.size()*4); // worst case int off=0; uint i; + bool mbFlag=FALSE; for (i=0;i0x80) + if (c>0x80 || mbFlag) { char s[10]; sprintf(s,"\\'%X",c); qstrcpy(enc.data()+off,s); off+=qstrlen(s); + mbFlag=c>0x80; } else { diff --git a/src/scanner.l b/src/scanner.l index 3bd0fad..37fc323 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -5383,7 +5383,7 @@ static void handleCommentBlock(const QCString &doc,bool brief) //printf("parseCommentBlock [%s]\n",doc.data()); while (parseCommentBlock( g_thisParser, - docBlockInBody ? previous : current, + docBlockInBody && previous ? previous : current, doc, // text yyFileName, // file brief ? current->briefLine : current->docLine, // line of block start diff --git a/src/util.cpp b/src/util.cpp index 670e8b7..d5322ba 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -49,6 +49,18 @@ #include "textdocvisitor.h" #include "portable.h" +#define ENABLE_TRACINGSUPPORT 0 + +#if defined(_OS_MAC_) && ENABLE_TRACINGSUPPORT +#define TRACINGSUPPORT +#endif + +#ifdef TRACINGSUPPORT +#include +#include +#endif + + //------------------------------------------------------------------------ // selects one of the name to sub-dir mapping algorithms that is used @@ -6355,35 +6367,85 @@ void stringToSearchIndex(const QCString &docBaseUrl,const QCString &title, } } +//-------------------------------------------------------------------------- + +static QDict g_extLookup; + +static struct Lang2ExtMap +{ + const char *langName; + SrcLangExt parserId; +} +g_lang2extMap[] = +{ + { "idl", SrcLangExt_IDL }, + { "java", SrcLangExt_Java }, + { "javascript", SrcLangExt_JS }, + { "c#", SrcLangExt_CSharp }, + { "d", SrcLangExt_D }, + { "php", SrcLangExt_PHP }, + { "objective-c", SrcLangExt_ObjC }, + { "python", SrcLangExt_Python }, + { "fortran", SrcLangExt_F90 }, + { "vhdl", SrcLangExt_VHDL }, + { "c", SrcLangExt_Cpp }, + { "c++", SrcLangExt_Cpp }, + { 0, (SrcLangExt)0 } +}; + +bool updateLanguageMapping(const QCString &extension,const QCString &parser) +{ + getLanguageFromFileName("dummy"); // force initializion of the g_extLookup map + const Lang2ExtMap *p = g_lang2extMap; + QCString langName = parser.lower(); + while (p->langName) + { + if (langName==p->langName) break; + p++; + } + if (!p->langName) return FALSE; + + // found the parser + SrcLangExt parserId = p->parserId; + QCString extName = extension; + if (extName.isEmpty()) return FALSE; + if (extName.at(0)!='.') extName.prepend("."); + if (g_extLookup.find(extension)!=0) // parser was already register for this ext + { + g_extLookup.remove(extension); + } + g_extLookup.insert(extension,new int(parserId)); + return TRUE; +} + SrcLangExt getLanguageFromFileName(const QCString fileName) { int i = fileName.findRev('.'); static bool init=FALSE; - static QDict extLookup; - extLookup.setAutoDelete(TRUE); + g_extLookup.setAutoDelete(TRUE); if (!init) // one time initialization { - extLookup.insert(".idl", new int(SrcLangExt_IDL)); - extLookup.insert(".ddl", new int(SrcLangExt_IDL)); - extLookup.insert(".odl", new int(SrcLangExt_IDL)); - extLookup.insert(".java", new int(SrcLangExt_Java)); - extLookup.insert(".as", new int(SrcLangExt_JS)); - extLookup.insert(".js", new int(SrcLangExt_JS)); - extLookup.insert(".cs", new int(SrcLangExt_CSharp)); - extLookup.insert(".d", new int(SrcLangExt_D)); - extLookup.insert(".php", new int(SrcLangExt_PHP)); - extLookup.insert(".php4", new int(SrcLangExt_PHP)); - extLookup.insert(".php5", new int(SrcLangExt_PHP)); - extLookup.insert(".inc", new int(SrcLangExt_PHP)); - extLookup.insert(".phtml", new int(SrcLangExt_PHP)); - extLookup.insert(".m", new int(SrcLangExt_ObjC)); - extLookup.insert(".M", new int(SrcLangExt_ObjC)); - extLookup.insert(".mm", new int(SrcLangExt_ObjC)); - extLookup.insert(".py", new int(SrcLangExt_Python)); - extLookup.insert(".f", new int(SrcLangExt_F90)); - extLookup.insert(".f90", new int(SrcLangExt_F90)); - extLookup.insert(".vhd", new int(SrcLangExt_VHDL)); - extLookup.insert(".vhdl", new int(SrcLangExt_VHDL)); + g_extLookup.insert(".idl", new int(SrcLangExt_IDL)); + g_extLookup.insert(".ddl", new int(SrcLangExt_IDL)); + g_extLookup.insert(".odl", new int(SrcLangExt_IDL)); + g_extLookup.insert(".java", new int(SrcLangExt_Java)); + g_extLookup.insert(".as", new int(SrcLangExt_JS)); + g_extLookup.insert(".js", new int(SrcLangExt_JS)); + g_extLookup.insert(".cs", new int(SrcLangExt_CSharp)); + g_extLookup.insert(".d", new int(SrcLangExt_D)); + g_extLookup.insert(".php", new int(SrcLangExt_PHP)); + g_extLookup.insert(".php4", new int(SrcLangExt_PHP)); + g_extLookup.insert(".php5", new int(SrcLangExt_PHP)); + g_extLookup.insert(".inc", new int(SrcLangExt_PHP)); + g_extLookup.insert(".phtml", new int(SrcLangExt_PHP)); + g_extLookup.insert(".m", new int(SrcLangExt_ObjC)); + g_extLookup.insert(".M", new int(SrcLangExt_ObjC)); + g_extLookup.insert(".mm", new int(SrcLangExt_ObjC)); + g_extLookup.insert(".py", new int(SrcLangExt_Python)); + g_extLookup.insert(".f", new int(SrcLangExt_F90)); + g_extLookup.insert(".f90", new int(SrcLangExt_F90)); + g_extLookup.insert(".vhd", new int(SrcLangExt_VHDL)); + g_extLookup.insert(".vhdl", new int(SrcLangExt_VHDL)); init=TRUE; } if (i!=-1) // name has an extension @@ -6391,7 +6453,7 @@ SrcLangExt getLanguageFromFileName(const QCString fileName) QCString extStr=fileName.right(fileName.length()-i); if (!extStr.isEmpty()) // non-empty extension { - int *pVal=extLookup.find(extStr); + int *pVal=g_extLookup.find(extStr); if (pVal) // listed extension { return (SrcLangExt)*pVal; // cast void* address to enum value @@ -6401,6 +6463,8 @@ SrcLangExt getLanguageFromFileName(const QCString fileName) return SrcLangExt_Cpp; // not listed => assume C-ish language. } +//-------------------------------------------------------------------------- + /*! Returns true iff the given name string appears to be a typedef in scope. */ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n) { @@ -6471,12 +6535,14 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n) return FALSE; } -QCString parseCommentAsText(const QString &doc,const QCString &fileName,int lineNr) +QCString parseCommentAsText(const Definition *scope,const MemberDef *md, + const QString &doc,const QCString &fileName,int lineNr) { QString result; if (doc.isEmpty()) return result.data(); QTextStream t(&result,IO_WriteOnly); - DocNode *root = validatingParseDoc(fileName,lineNr,Doxygen::globalScope,0,doc,FALSE,FALSE); + DocNode *root = validatingParseDoc(fileName,lineNr, + (Definition*)scope,(MemberDef*)md,doc,FALSE,FALSE); TextDocVisitor *visitor = new TextDocVisitor(t); root->accept(visitor); delete visitor; @@ -6689,3 +6755,30 @@ bool usingTreeIndex() return TreeView=="FRAME" || TreeView=="ALL" || TreeView=="YES"; } +void stackTrace() +{ +#ifdef TRACINGSUPPORT + void *backtraceFrames[128]; + int frameCount = backtrace(backtraceFrames, 128); + static char cmd[40960]; + char *p = cmd; + p += sprintf(p,"/usr/bin/atos -p %d ", (int)getpid()); + for (int x = 0; x < frameCount; x++) + { + p += sprintf(p,"%p ", backtraceFrames[x]); + } + fprintf(stderr,"========== STACKTRACE START ==============\n"); + if (FILE *fp = popen(cmd, "r")) + { + char resBuf[512]; + while (size_t len = fread(resBuf, 1, sizeof(resBuf), fp)) + { + fwrite(resBuf, 1, len, stderr); + } + pclose(fp); + } + fprintf(stderr,"============ STACKTRACE END ==============\n"); + //fprintf(stderr,"%s\n", frameStrings[x]); +#endif +} + diff --git a/src/util.h b/src/util.h index e836e0e..c87673e 100644 --- a/src/util.h +++ b/src/util.h @@ -328,6 +328,7 @@ void stringToSearchIndex(const QCString &docUrlBase,const QCString &title, const QCString &str, bool priority=FALSE, const QCString &anchor=""); +bool updateLanguageMapping(const QCString &extension,const QCString &parser); SrcLangExt getLanguageFromFileName(const QCString fileName); bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n); @@ -337,7 +338,7 @@ ClassDef *newResolveTypedef(FileDef *fileScope,MemberDef *md, QCString *pResolvedType=0, ArgumentList *actTemplParams=0); -QCString parseCommentAsText(const QString &doc,const QCString &fileName,int lineNr); +QCString parseCommentAsText(const Definition *scope,const MemberDef *member,const QString &doc,const QCString &fileName,int lineNr); QCString transcodeCharacterStringToUTF8(const QCString &input); @@ -357,6 +358,7 @@ void writeTypeConstraints(OutputList &ol,Definition *d,ArgumentList *al); QCString convertCharEntitiesToUTF8(const QCString &s); bool usingTreeIndex(); +void stackTrace(); #endif diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 44ffcfb..04fa62a 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -1209,7 +1209,7 @@ QCString VhdlDocGen::trTypeString(int type) case VhdlDocGen::SHAREDVARIABLE: return "Shared Variable"; case VhdlDocGen::GROUP: return "Group"; case VhdlDocGen::VFILE: return "File"; - case VhdlDocGen::COMPONENT_INST: return "Component Instantination"; + case VhdlDocGen::COMPONENT_INST: return "Component Instantiation"; case VhdlDocGen::ALIAS: return "Alias"; case VhdlDocGen::CONFIG: return "Configuration"; default: return ""; @@ -1926,6 +1926,34 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, VhdlDocGen::writeProcedureProto(ol,alp.pointer(),mdef); break; + case VhdlDocGen::USE: + kl=VhdlDocGen::getClass(mdef->name()); + if (kl && ((VhdlDocGen::VhdlClasses)kl->protection()==VhdlDocGen::ENTITYCLASS)) break; + writeLink(mdef,ol); + ol.insertMemberAlign(); + ol.docify(" "); + + if (kl) + { + nn=kl->getOutputFileBase(); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.docify(" "); + QCString name=theTranslator_vhdlType(VhdlDocGen::PACKAGE,TRUE); + ol.startBold(); + ol.docify(name.data()); + name.resize(0); + ol.endBold(); + name+=" <"+mdef->name()+">"; + ol.startEmphasis(); + ol.writeObjectLink(kl->getReference(),kl->getOutputFileBase(),0,name.data()); + ol.popGeneratorState(); + } + break; + case VhdlDocGen::LIBRARY: + writeLink(mdef,ol); + ol.insertMemberAlign(); + break; case VhdlDocGen::GENERIC: case VhdlDocGen::PORT: writeLink(mdef,ol); diff --git a/src/vhdlscanner.l b/src/vhdlscanner.l index c3d4bae..3e3d4af 100644 --- a/src/vhdlscanner.l +++ b/src/vhdlscanner.l @@ -809,9 +809,9 @@ ALLID [^;()\t ] BEGIN(FindEntityName); } -{MAPCOMPONENT}|{MAPCOMPONENT1} { // found new mapped component aaa: bbb port map +{MAPCOMPONENT}|{MAPCOMPONENT1} { // found component instantiation - lineCount(); + // lineCount(); QCString type; QCString tt(yytext); QRegExp regg("[ \n\t:.()-]"); -- cgit v0.12