From 8a65c23b74c33c38b4d1234e76cec74bd08cea69 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 26 Dec 2011 14:28:40 +0000 Subject: Release-1.7.6.1-20111226 --- INSTALL | 4 +- README | 4 +- configure | 2 +- doc/Doxyfile | 2 +- doc/customize.doc | 238 ++++++++++++----- doc/docblocks.doc | 2 +- doc/starting.doc | 4 +- qtools/Doxyfile | 8 +- src/classdef.cpp | 8 +- src/code.l | 54 +++- src/definition.cpp | 25 +- src/definition.h | 5 +- src/dirdef.cpp | 8 +- src/docparser.cpp | 1 + src/docparser.h | 1 + src/dot.cpp | 43 ++- src/doxygen.cpp | 101 ++------ src/filedef.h | 7 +- src/ftvhelp.cpp | 36 ++- src/groupdef.cpp | 21 +- src/groupdef.h | 7 +- src/htmldocvisitor.cpp | 26 +- src/htmlgen.cpp | 81 +++--- src/htmlgen.h | 8 +- src/htmlhelp.cpp | 17 +- src/htmlhelp.h | 1 + src/index.cpp | 690 +++++++++++++++++++++++++++++-------------------- src/index.h | 1 + src/latexgen.cpp | 15 +- src/latexgen.h | 8 +- src/layout.cpp | 68 ++++- src/layout.h | 6 +- src/mangen.cpp | 2 +- src/mangen.h | 8 +- src/memberdef.cpp | 35 ++- src/memberdef.h | 2 + src/memberlist.cpp | 4 +- src/namespacedef.cpp | 10 +- src/navtree.js | 205 ++++++--------- src/navtree_js.h | 205 ++++++--------- src/outputgen.h | 10 +- src/outputlist.cpp | 5 +- src/outputlist.h | 21 +- src/pagedef.h | 1 + src/portable.cpp | 1 + src/pre.l | 75 +++++- src/pycode.l | 123 +++++---- src/pyscanner.l | 116 ++++++--- src/rtfgen.cpp | 4 +- src/rtfgen.h | 8 +- src/searchindex.cpp | 9 +- src/tclscanner.l | 4 +- src/util.cpp | 44 +++- src/util.h | 5 +- src/vhdldocgen.cpp | 98 +++---- src/vhdldocgen.h | 2 + src/vhdlscanner.l | 54 ++-- 57 files changed, 1470 insertions(+), 1083 deletions(-) diff --git a/INSTALL b/INSTALL index 0d5d47b..d374629 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.7.6.1 +DOXYGEN Version 1.7.6.1-20111226 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (10 December 2011) +Dimitri van Heesch (26 December 2011) diff --git a/README b/README index f625b3b..bafcc8a 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.7.6.1 +DOXYGEN Version 1.7.6.1_20111226 Please read INSTALL for compilation instructions. @@ -26,4 +26,4 @@ forum. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (10 December 2011) +Dimitri van Heesch (dimitri@stack.nl) (26 December 2011) diff --git a/configure b/configure index 2653c4b..68e628a 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ doxygen_version_minor=7 doxygen_version_revision=6.1 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=NO +doxygen_version_mmn=20111226 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` diff --git a/doc/Doxyfile b/doc/Doxyfile index b0f281e..5c666af 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -12,7 +12,7 @@ # Documents produced by Doxygen are derivative works derived from the # input used in their production; they are not affected by this license. -PROJECT_NAME = "Doxygen manual" +PROJECT_NAME = OUTPUT_DIRECTORY = .. HTML_HEADER = HTML_FOOTER = diff --git a/doc/customize.doc b/doc/customize.doc index 1a8b3dd..d1be915 100644 --- a/doc/customize.doc +++ b/doc/customize.doc @@ -17,21 +17,83 @@ /*! \page customize Customizing the output Doxygen provides various levels of customization. -The \ref minor_tweaks "first section" discusses what to +The section \ref minor_tweaks "Minor Tweaks" discusses what to do if you want to do minor tweaking to the look and feel of the output. -The \ref layout "next" section show how to reorder and hide certain +The section \ref layout "Layout" show how to reorder and hide certain information on a page. -The \ref xmlgenerator "last" section show how to generate whatever output -you want based on the XML output produced by doxygen. +The section \ref xmlgenerator "XML output" show how to generate +whatever output you want based on the XML output produced by doxygen. \section minor_tweaks Minor Tweaks -To simply tweak things like fonts or colors, margins, or other look \& feel -expects of the HTML output you can create a different +The next subsections describe some aspects that can be tweaked with +little effort. + +\subsection minor_tweaks_colors Overall Color + +To change the overall color of the HTML output doxygen provides three options +- \ref cfg_html_colorstyle_hue "HTML_COLORSTYLE_HUE" +- \ref cfg_html_colorstyle_sat "HTML_COLORSTYLE_SAT" +- \ref cfg_html_colorstyle_gamma "HTML_COLORSTYLE_GAMMA" + +to change the hue, saturation, and gamma correction of the colors respectively. + +For your convenience the GUI frontend \ref doxywizard_usage "Doxywizard" +has a control that allows you to see the effect of changing the values of these options +on the output in real time. + +\subsection minor_tweaks_treeview Navigation + +By default doxygen shows navigation tabs on top of every HTML page, +corresponding with the following settings: + +- \ref cfg_disable_index "DISABLE_INDEX" = \c NO +- \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c NO + +you can switch to an interactive navigation tree as sidebar using + +- \ref cfg_disable_index "DISABLE_INDEX" = \c YES +- \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c YES + +or even have both forms of navigation: + +- \ref cfg_disable_index "DISABLE_INDEX" = \c NO +- \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c YES + +if you already use an external index (i.e. have one of the following +options enabled +\ref cfg_generate_htmlhelp "GENERATE_HTMLHELP", +\ref cfg_generate_eclipsehelp "GENERATE_ECLIPSEHELP", +\ref cfg_generate_qhp "GENERATE_QHP", or +\ref cfg_generate_docset "GENERATE_DOCSET") +then you can also disable all indices, like so: + +- \ref cfg_disable_index "DISABLE_INDEX" = \c YES +- \ref cfg_generate_treeview "GENERATE_TREEVIEW" = \c NO + +\subsection minor_tweaks_dynsection Dynamic Content + +To make the HTML output more interactive, doxygen provides a number of options +that are disabled by default: +- enabling \ref cfg_html_dynamic_sections "HTML_DYNAMIC_SECTIONS" will make + doxygen hide certain content (like graphs) in the HTML by default, + and let the reader expand these sections on request. +- enabling \ref cfg_use_inline_trees "USE_INLINE_TREES" will make some + tree structures in the output dynamically expandable. +- enabling \ref cfg_have_dot "HAVE_DOT" along + with \ref cfg_interactive_svg "INTERACTIVE_SVG" while setting + \ref cfg_dot_image_format "DOT_IMAGE_FORMAT" to \c svg, will make doxygen + produce SVG images that will allow the user to zoom and pan (this only + happens when th size of the images exceeds a certain size). + +\subsection minor_tweaks_header_css Header, Footer, and Stylesheet changes + +To tweak things like fonts or colors, margins, or other look \& feel +aspects of the HTML output in detail, you can create a different cascading style sheet. You can also let doxygen use a custom header and footer for each HTML -page it generates, for instance to include a logo or to make the -doxygen output blend in with the rest of the web site. +page it generates, for instance to make the output comform to the style +used on the rest of your web site. To do this first run doxygen as follows: \verbatim @@ -50,14 +112,13 @@ This will create 3 files: used by doxygen. You should edit these files and then reference them from the config file. -\verbatim -HTML_HEADER = header.html -HTML_FOOTER = footer.html -HTML_STYLESHEET = customdoxygen.css -\endverbatim +- \ref cfg_html_header "HTML_HEADER" = \c header.html +- \ref cfg_html_footer "HTML_FOOTER" = \c footer.html +- \ref cfg_html_stylesheet "HTML_STYLESHEET" = \c customdoxygen.css See the documentation of the \ref cfg_html_header "HTML_HEADER" tag -for more information about the possible meta commands. +for more information about the possible meta commands you can use inside +your custom header. \note You should not put the style sheet in the HTML output directory. Treat it is a source file. Doxygen will copy it for you. @@ -67,7 +128,6 @@ need to make sure these end up in the HTML output directory yourself, for instance by writing a script that runs doxygen can then copies the images to the output. - \section layout Changing the layout of pages In some cases you may want to change the way the output is structured. @@ -91,7 +151,7 @@ The next step is to mention the layout file in the config file \verbatim LAYOUT_FILE = DoxygenLayout.xml \endverbatim -The change the layout all you need to do is edit the layout file. +To change the layout all you need to do is edit the layout file. The toplevel structure of the file looks as follows: \verbatim @@ -117,66 +177,90 @@ The toplevel structure of the file looks as follows: \endverbatim -The root tag of the XML is \c doxygenlayout, it has an attribute named +The root element of the XML file is \c doxygenlayout, it has an attribute named \c version, which will be used in the future to cope with changes that are not backward compatible. -The first section, enclosed by \c navindex tags represents the layout of -the navigation tabs displayed at the top of each HTML page. -Each tab is represented by a \c tab tag in the XML file. +The first section, identified by the \c navindex element, represents the +layout of the navigation tabs displayed at the top of each HTML page. At the +same time it also controls the items in the navigation tree in case +\ref cfg_generate_treeview "GENERATE_TREEVIEW" is enabled. +Each tab is represented by a \c tab element in the XML file. You can hide tabs by setting the \c visible attribute to \c no. You can also override the default title of a tab by specifying it as the value of the \c title attribute. If the title field is the empty string -(the default) then doxygen will fill in an appropriate title. -You can reorder the tabs by moving the tab tags in the XML file -within the \c navindex section and even change the tree structure. +(the default) then doxygen will fill in an appropriate language specific title. + +You can reorder the tabs by moving the tab elements in the XML file +within the \c navindex element and even change the tree structure. Do not change the value of the \c type attribute however. Only a fixed set of types are supported, each representing a link to a specific index. -The sections after \c navindex represent the layout of the different +You can also add custom tabs using a type with name "user". Here is an +example that shows how to add a tab with title "Google" pointing to +www.google.com: + +\verbatim + + ... + + ... + +\endverbatim + +The url field can also be a relative URL. If the URL starts with \@ref +the link will point to a documented entities, such as a class, a function, +a group, or a related page. Suppose we have defined a page using \@page with +label mypage, then a tab with label "My Page" to this page would look +as follows: + +\verbatim + + ... + + ... + +\endverbatim + +You can also group tabs together in a custom group using a tab with +type "usergroup". The following example puts the above tabs in a user +defined group with title "My Group": + +\verbatim + + ... + + + + + ... + +\endverbatim + +Groups can be nested to form a hierarchy. + +The elements after \c navindex represent the layout of the different pages generated by doxygen: -- The \c class section represents the layout of all pages generated for +- The \c class element represents the layout of all pages generated for documented classes, structs, unions, and interfaces. -- The \c namespace section represents the layout of all pages generated for +- The \c namespace element represents the layout of all pages generated for documented namespaces (and also Java packages). -- The \c file section represents the layout of all pages generated for +- The \c file element represents the layout of all pages generated for documented files. -- The \c group section represents the layout of all pages generated for +- The \c group element represents the layout of all pages generated for documented groups (or modules). -- The \c directory section represents the layout of all pages generated for +- The \c directory element represents the layout of all pages generated for documented directories. -Each XML tag within one of the above page sections represents a certain +Each XML element within one of the above page elements represents a certain piece of information. Some pieces can appear in each type of page, others are specific for a certain type of page. Doxygen will list the pieces in the order in which they appear in the XML file. -Some tags have a \c visible attribute which can be -used to hide the fragment from the generated output, by setting the attribute's -value to "no". You can also use the value of a configuration option to -determine the visibility, by using -its name prefixed with a dollar sign, e.g. -\verbatim - ... - - ... -\endverbatim -This was mainly added for backward compatibility. -Note that the \c visible attribute is just a hint for doxygen. -If no relevant information is available for a certain piece it is -omitted even if it is set to \c yes (i.e. no empty sections are generated). - -Some tags have a \c title attribute. This attribute can be used -to customize the title doxygen will use as a header for the piece. - -@warning at the moment you should not remove tags from the layout file -as a way to hide information. Doing so can cause broken links in the -generated output! - -At the moment the following generic tags are possible for each page: +The following generic elements are possible for each page:
\c briefdescription
Represents the brief description on a page. @@ -186,18 +270,17 @@ At the moment the following generic tags are possible for each page:
Represents the author section of a page (only used for man pages).
\c memberdecl
Represents the quick overview of members on a page (member declarations). - This tag has child tags each representing a list of - members of a certain type. - The possible child tags are not listed in detail in the document, - but the name of the tag should be a good indication of the type - of members that the tag represents. + This elements has child elements per type of member list. + The possible child elements are not listed in detail in the document, + but the name of the element should be a good indication of the type + of members that the element represents.
\c memberdef
Represents the detailed member list on a page (member definition). - Like the \c memberdecl tag, also this tag has a number of - possible child tags. + Like the \c memberdecl element, also this element has a number of + possible child elements.
-The class page has the following specific tags: +The class page has the following specific elements:
\c includes
Represents the include file needed to obtain the definition for @@ -216,7 +299,7 @@ The class page has the following specific tags: extracted.
-The file page has the following specific tags: +The file page has the following specific elements:
\c includes
Represents the list of \#include statements contained in this file. @@ -228,13 +311,36 @@ The file page has the following specific tags:
Represents the link to the source code of this file.
-The group page has a specific \c groupgraph tag which represents the +The group page has a specific \c groupgraph element which represents the graph showing the dependencies between groups. -Similarly, the directory page has a specific \c directorygraph tag +Similarly, the directory page has a specific \c directorygraph element which represents the graph showing the dependencies between the directories based on the \#include relations of the files inside the directories. +Some elements have a \c visible attribute which can be +used to hide the fragment from the generated output, by setting the attribute's +value to "no". You can also use the value of a configuration option to +determine the visibility, by using +its name prefixed with a dollar sign, e.g. +\verbatim + ... + + ... +\endverbatim +This was mainly added for backward compatibility. +Note that the \c visible attribute is just a hint for doxygen. +If no relevant information is available for a certain piece it is +omitted even if it is set to \c yes (i.e. no empty sections are generated). + +Some elements have a \c title attribute. This attribute can be used +to customize the title doxygen will use as a header for the piece. + +@warning at the moment you should not remove elements from the layout file +as a way to hide information. Doing so can cause broken links in the +generated output! + + \section xmlgenerator Using the XML output If the above two methods still do not provide enough flexibility, you @@ -260,4 +366,8 @@ files that you implicitly load via navigating through the index. As a result this works even for very large projects where reading all XML files as one big DOM tree would not fit into memory. +See the Breathe project for +a example that uses doxygen XML output from Python to bridge it with the +Sphinx document generator. + */ diff --git a/doc/docblocks.doc b/doc/docblocks.doc index 2e6878d..bf0466a 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -113,7 +113,7 @@ or -For the brief description there are also several posibilities: +For the brief description there are also several possibilities:
  1. One could use the \ref cmdbrief "\\brief" command with one of the above comment blocks. This command ends at the end of a paragraph, diff --git a/doc/starting.doc b/doc/starting.doc index e6edf1d..caed175 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -42,8 +42,8 @@ tries to be complete): First, assure that your programming language has a reasonable chance of being recognized by Doxygen. These languages are supported by default: C, C++, C#, -Objective-C, IDL, Java, VHDL, PHP, Python, Fortran, and D. It -is possible to configure certain filetype extensions to use certain parsers: +Objective-C, IDL, Java, VHDL, PHP, Python, Tcl, Fortran, and D. It +is possible to configure certain file type extensions to use certain parsers: see the \ref cfg_extension_mapping "Configuration/ExtensionMappings" for details. Also, completely different languages can be supported by using preprocessor programs: see the Helpers page diff --git a/qtools/Doxyfile b/qtools/Doxyfile index ddf9909..8980dfe 100644 --- a/qtools/Doxyfile +++ b/qtools/Doxyfile @@ -164,8 +164,8 @@ QHP_SECT_FILTER_ATTRS = QHG_LOCATION = GENERATE_ECLIPSEHELP = YES ECLIPSE_DOC_ID = org.doxygen.qtools -DISABLE_INDEX = NO -GENERATE_TREEVIEW = NO +DISABLE_INDEX = YES +GENERATE_TREEVIEW = YES ENUM_VALUES_PER_LINE = 4 USE_INLINE_TREES = YES TREEVIEW_WIDTH = 250 @@ -266,8 +266,8 @@ UML_LOOK = NO TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO +CALL_GRAPH = YES +CALLER_GRAPH = YES GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = svg diff --git a/src/classdef.cpp b/src/classdef.cpp index a0b1527..be7429e 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1745,7 +1745,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade Doxygen::tagFile << " " << convertToXML(name()) << "" << endl; } - ol.startMemberItem(FALSE); + ol.startMemberItem(anchor(),FALSE); QCString ctype = compoundTypeString(); QCString cname; if (localNames) @@ -1792,7 +1792,7 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade // add the brief description if available if (!briefDescription().isEmpty()) { - ol.startMemberDescription(); + ol.startMemberDescription(anchor()); ol.parseDoc(briefFile(),briefLine(),this,0, briefDescription(),FALSE,FALSE,0,TRUE,FALSE); if (isLinkableInProject()) @@ -2001,7 +2001,7 @@ void ClassDef::writeMemberPages(OutputList &ol) { if (ml->listType()&MemberList::detailedLists) { - ml->writeDocumentationPage(ol,name(),this); + ml->writeDocumentationPage(ol,displayName(),this); } } @@ -3737,7 +3737,7 @@ void ClassDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,c { //printf("%s: ClassDef::writeMemberDocumentation()\n",name().data()); MemberList * ml = getMemberList(lt); - if (ml) ml->writeDocumentation(ol,name(),this,title,FALSE,showInline); + if (ml) ml->writeDocumentation(ol,displayName(),this,title,FALSE,showInline); } void ClassDef::writeSimpleMemberDocumentation(OutputList &ol,MemberList::ListType lt) diff --git a/src/code.l b/src/code.l index ffcc64c..36ebec6 100644 --- a/src/code.l +++ b/src/code.l @@ -140,6 +140,7 @@ static int g_braceCount=0; static void saveObjCContext(); static void restoreObjCContext(); +static QCString g_forceTagReference; //------------------------------------------------------------------- @@ -780,7 +781,9 @@ static MemberDef *setCallContextForVar(const QCString &name) // in case there are multiple members we could link to, we // only link to members if defined in the same file or // defined as external. - if (!md->isStatic() || md->getBodyDef()==g_sourceFileDef) + if ((!md->isStatic() || md->getBodyDef()==g_sourceFileDef) && + (g_forceTagReference.isEmpty() || g_forceTagReference==md->getReference()) + ) { g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); //printf("returning member %s in source file %s\n",md->name().data(),g_sourceFileDef->name().data()); @@ -868,7 +871,7 @@ static bool getLinkInScope(const QCString &c, // scope NamespaceDef *nd; GroupDef *gd; //fprintf(stderr,"getLinkInScope: trying `%s'::`%s' varOnly=%d\n",c.data(),m.data(),varOnly); - if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) && + if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef,FALSE,g_forceTagReference) && md->isLinkable() && (!varOnly || md->isVariable())) { if (g_exampleBlock) @@ -887,7 +890,6 @@ static bool getLinkInScope(const QCString &c, // scope Definition *d = md->getOuterScope()==Doxygen::globalScope ? md->getBodyDef() : md->getOuterScope(); if (md->getGroupDef()) d = md->getGroupDef(); - //fprintf(stderr,"d=%p linkable=%d\n",d,d?d->isLinkable():0); if (d && d->isLinkable()) { g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); @@ -1062,9 +1064,26 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, //fprintf(stderr,"is a global md=%p g_currentDefinition=%s linkable=%d\n",md,g_currentDefinition?g_currentDefinition->name().data():"",md->isLinkable()); if (md->isLinkable()) { + QCString text; + if (!g_forceTagReference.isEmpty()) // explicit reference to symbol in tag file + { + text=g_forceTagReference; + if (text.right(4)==".tag") // strip .tag if present + { + text=text.left(text.length()-4); + } + text+=getLanguageSpecificSeparator(md->getLanguage()); + text+=clName; + md->setName(text); + md->setLocalName(text); + } + else // normal reference + { + text=clName; + } ol.linkableSymbol(g_yyLineNr,md->name(),md, g_currentMemberDef ? g_currentMemberDef : g_currentDefinition); - writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName,md->briefDescriptionAsTooltip()); + writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),text,md->briefDescriptionAsTooltip()); addToSearchIndex(clName); if (g_currentMemberDef) { @@ -1260,6 +1279,13 @@ static void generateMemberLink(CodeOutputInterface &ol,const QCString &varName, static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) { + //CodeClassDef *ccd=0; + ClassDef *ccd=0; + QCString locScope=g_classScope; + QCString locFunc=removeRedundantWhiteSpace(funcName); + //fprintf(stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data()); + int len=2; + int i=locFunc.findRev("::"); if (g_currentMemberDef && g_currentMemberDef->getClassDef() && funcName==g_currentMemberDef->localName() && g_currentMemberDef->getDefLine()==g_yyLineNr && @@ -1272,15 +1298,8 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) // in case of overloaded methods, this will make sure that we link to // the correct method, and thereby get the correct reimplemented relations. // See also bug 549022. - return; + goto exit; } - //CodeClassDef *ccd=0; - ClassDef *ccd=0; - QCString locScope=g_classScope; - QCString locFunc=removeRedundantWhiteSpace(funcName); - //fprintf(stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data()); - int len=2; - int i=locFunc.findRev("::"); if (i==-1) i=locFunc.findRev("."),len=1; if (i==-1) i=locFunc.findRev("\\"),len=1; // for PHP if (i>0) @@ -1314,7 +1333,7 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) { if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) { - return; + goto exit; } } } @@ -1323,6 +1342,8 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName) { generateClassOrGlobalLink(ol,funcName); } +exit: + g_forceTagReference.resize(0); return; } @@ -3216,6 +3237,12 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP} endFontClass(); } } +<*>"/*[tag:"[^\]\n]*"]*/"{B}* { // special pattern /*[tag:filename]*/ to force linking to a tag file + g_forceTagReference=yytext; + int s=g_forceTagReference.find(':'); + int e=g_forceTagReference.findRev(']'); + g_forceTagReference = g_forceTagReference.mid(s+1,e-s-1); + } <*>\n{B}*"/*"[!*]/[^/*] { if (Config_getBool("STRIP_CODE_COMMENTS")) { @@ -3381,6 +3408,7 @@ static void restoreObjCContext() void resetCCodeParserState() { //printf("***initParseCodeContext()\n"); + g_forceTagReference.resize(0); g_theVarContext.clear(); g_classScopeLengthStack.setAutoDelete(TRUE); g_classScopeLengthStack.clear(); diff --git a/src/definition.cpp b/src/definition.cpp index 911e156..3a61b7b 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -37,6 +37,7 @@ #include "parserintf.h" #include "marshal.h" #include "debug.h" +#include "vhdldocgen.h" #define START_MARKER 0x4445465B // DEF[ #define END_MARKER 0x4445465D // DEF] @@ -864,6 +865,14 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) //printf("Read:\n`%s'\n\n",codeFragment.data()); MemberDef *thisMd = 0; if (definitionType()==TypeMember) thisMd = (MemberDef *)this; + + // vhdl parser can' t start at an arbitrary point in the source code + if(this->getLanguage()==SrcLangExt_VHDL) + { + if (thisMd) VhdlDocGen::writeCodeFragment(ol,actualStart,codeFragment,thisMd); + return; + } + ol.startCodeFragment(); pIntf->parseCode(ol, // codeOutIntf scopeName, // scope @@ -1112,12 +1121,12 @@ void Definition::addInnerCompound(Definition *) QCString Definition::qualifiedName() const { - static int count=0; - count++; + //static int count=0; + //count++; makeResident(); if (!m_impl->qualifiedName.isEmpty()) { - count--; + //count--; return m_impl->qualifiedName; } @@ -1126,12 +1135,12 @@ QCString Definition::qualifiedName() const { if (m_impl->localName=="") { - count--; + //count--; return ""; } else { - count--; + //count--; return m_impl->localName; } } @@ -1142,10 +1151,12 @@ QCString Definition::qualifiedName() const } else { - m_impl->qualifiedName = m_impl->outerScope->qualifiedName()+"::"+m_impl->localName; + m_impl->qualifiedName = m_impl->outerScope->qualifiedName()+ + getLanguageSpecificSeparator(getLanguage())+ + m_impl->localName; } //printf("end %s::qualifiedName()=%s\n",name().data(),m_impl->qualifiedName.data()); - count--; + //count--; return m_impl->qualifiedName; }; diff --git a/src/definition.h b/src/definition.h index 94d1edc..8c6bda3 100644 --- a/src/definition.h +++ b/src/definition.h @@ -116,6 +116,9 @@ class Definition : public DefinitionIntf, public LockableObj /*! Returns the name of the definition */ const QCString& name() const { return m_name; } + /*! Returns the name of the definition as it appears in the output */ + virtual QCString displayName() const = 0; + /*! Returns the local name without any scope qualifiers. */ QCString localName() const; @@ -323,9 +326,9 @@ class Definition : public DefinitionIntf, public LockableObj * the Doxygen::tagFile stream. */ void writeDocAnchorsToTagFile(); + void setLocalName(const QCString name); protected: - void setLocalName(const QCString name); virtual void flushToDisk() const; virtual void loadFromDisk() const; diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 582bdb0..05ab52f 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -213,7 +213,7 @@ void DirDef::writeSubDirList(OutputList &ol) DirDef *dd=m_subdirs.first(); while (dd) { - ol.startMemberItem(0); + ol.startMemberItem(dd->getOutputFileBase(),0); ol.parseText(theTranslator->trDir(FALSE,TRUE)+" "); ol.insertMemberAlign(); ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName()); @@ -224,7 +224,7 @@ void DirDef::writeSubDirList(OutputList &ol) } if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startMemberDescription(); + ol.startMemberDescription(dd->getOutputFileBase()); ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(), FALSE, // indexWords FALSE, // isExample @@ -253,7 +253,7 @@ void DirDef::writeFileList(OutputList &ol) FileDef *fd=m_fileList->first(); while (fd) { - ol.startMemberItem(0); + ol.startMemberItem(fd->getOutputFileBase(),0); ol.docify(theTranslator->trFile(FALSE,TRUE)+" "); ol.insertMemberAlign(); if (fd->isLinkable()) @@ -285,7 +285,7 @@ void DirDef::writeFileList(OutputList &ol) ol.endMemberItem(); if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startMemberDescription(); + ol.startMemberDescription(fd->getOutputFileBase()); ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(), FALSE, // indexWords FALSE, // isExample diff --git a/src/docparser.cpp b/src/docparser.cpp index 480a77a..48810ed 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -5771,6 +5771,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName) break; case HTML_P: // ignore

    tag + retval=TK_NEWPARA; break; case HTML_DL: retval=RetVal_EndDesc; diff --git a/src/docparser.h b/src/docparser.h index 7c0c6a9..1e1fb0e 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -1244,6 +1244,7 @@ class DocRoot : public CompAccept, public DocNode void parse(); bool indent() const { return m_indent; } bool singleLine() const { return m_singleLine; } + const QList &children() const { return m_children; } private: bool m_indent; diff --git a/src/dot.cpp b/src/dot.cpp index 5d21b43..f3e524d 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1517,7 +1517,7 @@ static QCString escapeTooltip(const QCString &tooltip) static void writeBoxMemberList(FTextStream &t, char prot,MemberList *ml,ClassDef *scope, - bool isStatic=FALSE) + bool isStatic=FALSE,const QDict *skipNames=0) { (void)isStatic; if (ml) @@ -1527,7 +1527,8 @@ static void writeBoxMemberList(FTextStream &t, int totalCount=0; for (mlia.toFirst();(mma = mlia.current());++mlia) { - if (mma->getClassDef() == scope) + if (mma->getClassDef()==scope && + (skipNames==0 || skipNames->find(mma->name())==0)) { totalCount++; } @@ -1536,7 +1537,8 @@ static void writeBoxMemberList(FTextStream &t, int count=0; for (mlia.toFirst();(mma = mlia.current());++mlia) { - if (mma->getClassDef() == scope) + if (mma->getClassDef() == scope && + (skipNames==0 || skipNames->find(mma->name())==0)) { if (totalCount>=15 && count>=10) { @@ -1565,7 +1567,7 @@ static void writeBoxMemberList(FTextStream &t, { if (mg->members()) { - writeBoxMemberList(t,prot,mg->members(),scope); + writeBoxMemberList(t,prot,mg->members(),scope,isStatic,skipNames); } } } @@ -1588,21 +1590,34 @@ void DotNode::writeBox(FTextStream &t, if (m_classDef && umlLook && (gt==Inheritance || gt==Collaboration)) { + // add names shown as relation to a dictionary, so we don't show + // them as attributes as well + QDict arrowNames(17); + QListIterator li(*m_edgeInfo); + EdgeInfo *ei; + for (li.toFirst();(ei=li.current());++li) + { + if (!ei->m_label.isEmpty()) + { + arrowNames.insert(ei->m_label,(void*)0x8); + } + } + //printf("DotNode::writeBox for %s\n",m_classDef->name().data()); static bool extractPrivate = Config_getBool("EXTRACT_PRIVATE"); t << "{" << convertLabel(m_label); t << "\\n|"; - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubAttribs),m_classDef); - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubStaticAttribs),m_classDef,TRUE); - writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::properties),m_classDef); - writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacAttribs),m_classDef); - writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacStaticAttribs),m_classDef,TRUE); - writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proAttribs),m_classDef); - writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proStaticAttribs),m_classDef,TRUE); + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubStaticAttribs),m_classDef,TRUE,&arrowNames); + writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::properties),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacStaticAttribs),m_classDef,TRUE,&arrowNames); + writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proStaticAttribs),m_classDef,TRUE,&arrowNames); if (extractPrivate) { - writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priAttribs),m_classDef); - writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticAttribs),m_classDef,TRUE); + writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priAttribs),m_classDef,FALSE,&arrowNames); + writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticAttribs),m_classDef,TRUE,&arrowNames); } t << "|"; writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubMethods),m_classDef); @@ -1628,7 +1643,7 @@ void DotNode::writeBox(FTextStream &t, { if (mg->members()) { - writeBoxMemberList(t,'*',mg->members(),m_classDef); + writeBoxMemberList(t,'*',mg->members(),m_classDef,FALSE,&arrowNames); } } } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index b790410..d200a47 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -922,7 +922,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name,int level) else if (nd==0 && cd==0) // scope is not known! { // introduce bogus namespace - //printf("++ adding dummy namespace %s to %s\n",nsName.data(),prevScope->name().data()); + printf("++ adding dummy namespace %s to %s\n",nsName.data(),prevScope->name().data()); nd=new NamespaceDef( "[generated]",1,fullScope); @@ -2226,13 +2226,14 @@ static MemberDef *addVariableToFile( Entry *root = rootNav->entry(); Debug::print(Debug::Variables,0, " global variable:\n" - " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d mtype=%d\n", + " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d mtype=%d lang=%d\n", root->type.data(), scope.data(), name.data(), root->args.data(), root->protection, - mtype + mtype, + root->lang ); FileDef *fd = rootNav->fileDef(); @@ -2421,18 +2422,21 @@ static MemberDef *addVariableToFile( /*! See if the return type string \a type is that of a function pointer * \returns -1 if this is not a function pointer variable or - * the index at which the brace of (...*name) was found. + * the index at which the closing brace of (...*name) was found. */ static int findFunctionPtr(const QCString &type,int lang, int *pLength=0) { if (lang == SrcLangExt_Fortran) return -1; // Fortran does not have function pointers static const QRegExp re("([^)]*[\\*\\^][^)]*)"); int i=-1,l; + int bb=type.find('<'); + int be=type.findRev('>'); if (!type.isEmpty() && // return type is non-empty (i=re.match(type,0,&l))!=-1 && // contains (...*...) type.find("operator")==-1 && // not an operator - (type.find(")(")==-1 || type.find("typedef ")!=-1) + (type.find(")(")==-1 || type.find("typedef ")!=-1) && // not a function pointer return type + !(bb type" as a function pointer ) { if (pLength) *pLength=l; @@ -2610,6 +2614,7 @@ static void addVariable(EntryNav *rootNav,int isFuncPtr=-1) { int i=isFuncPtr; if (i==-1) i=findFunctionPtr(root->type,root->lang); // for typedefs isFuncPtr is not yet set + Debug::print(Debug::Variables,0," functionPtr? %s\n",i!=-1?"yes":"no"); if (i!=-1) // function pointer { int ai = root->type.find('[',i); @@ -10212,7 +10217,7 @@ void parseInput() **************************************************************************/ LayoutDocManager::instance().init(); - QCString layoutFileName = Config_getString("LAYOUT_FILE"); + QCString &layoutFileName = Config_getString("LAYOUT_FILE"); bool defaultLayoutUsed = FALSE; if (layoutFileName.isEmpty()) { @@ -10406,7 +10411,10 @@ void parseInput() computeTemplateClassRelations(); flushUnresolvedRelations(); computeClassRelations(); - //VhdlDocGen::computeVhdlComponentRelations(); // @MARTIN: removed because it breaks non-vhdl code + if (Config_getBool("OPTIMIZE_OUTPUT_VHDL")) + { + VhdlDocGen::computeVhdlComponentRelations(); + } g_classEntries.clear(); msg("Add enum values to enums...\n"); @@ -10528,19 +10536,6 @@ void generateOutput() **************************************************************************/ //// dump all symbols - //SDict::Iterator sdi(Doxygen::symbolMap); - //DefinitionList *dl; - //for (sdi.toFirst();(dl=sdi.current());++sdi) - //{ - // DefinitionListIterator dli(*dl); - // Definition *d; - // printf("Symbol: "); - // for (dli.toFirst();(d=dli.current());++dli) - // { - // printf("%s ",d->qualifiedName().data()); - // } - // printf("\n"); - //} if (g_dumpSymbolMap) { dumpSymbolMap(); @@ -10555,11 +10550,12 @@ void generateOutput() g_outputList->add(new HtmlGenerator); HtmlGenerator::init(); - bool generateHtmlHelp = Config_getBool("GENERATE_HTMLHELP"); + // add HTML indexers that are enabled + bool generateHtmlHelp = Config_getBool("GENERATE_HTMLHELP"); bool generateEclipseHelp = Config_getBool("GENERATE_ECLIPSEHELP"); - bool generateQhp = Config_getBool("GENERATE_QHP"); - bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); - bool generateDocSet = Config_getBool("GENERATE_DOCSET"); + bool generateQhp = Config_getBool("GENERATE_QHP"); + bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); + bool generateDocSet = Config_getBool("GENERATE_DOCSET"); if (generateEclipseHelp) Doxygen::indexList.addIndex(new EclipseHelp); if (generateHtmlHelp) Doxygen::indexList.addIndex(new HtmlHelp); if (generateQhp) Doxygen::indexList.addIndex(new Qhp); @@ -10568,10 +10564,7 @@ void generateOutput() Doxygen::indexList.initialize(); HtmlGenerator::writeTabData(); -#if 0 - if (Config_getBool("GENERATE_INDEXLOG")) Doxygen::indexList.addIndex(new IndexLog); -#endif - //if (Config_getBool("HTML_DYNAMIC_SECTIONS")) HtmlGenerator::generateSectionImages(); + // copy static stuff copyStyleSheet(); copyLogo(); copyExtraFiles(); @@ -10672,17 +10665,6 @@ void generateOutput() } } - //statistics(); - - // count the number of documented elements in the lists we have built. - // If the result is 0 we do not generate the lists and omit the - // corresponding links in the index. - //msg("Generating index page...\n"); - //writeIndex(*g_outputList); - - //msg("Generating page index...\n"); - //writePageIndex(*g_outputList); - msg("Generating example documentation...\n"); generateExampleDocs(); @@ -10701,24 +10683,12 @@ void generateOutput() msg("Generating group documentation...\n"); generateGroupDocs(); - //msg("Generating group index...\n"); - //writeGroupIndex(*g_outputList); - msg("Generating class documentation...\n"); generateClassDocs(); - //if (Config_getBool("HAVE_DOT") && Config_getBool("GRAPHICAL_HIERARCHY")) - //{ - // msg("Generating graphical class hierarchy...\n"); - // writeGraphicalClassHierarchy(*g_outputList); - //} - msg("Generating namespace index...\n"); generateNamespaceDocs(); - //msg("Generating namespace member index...\n"); - //writeNamespaceMemberIndex(*g_outputList); - if (Config_getBool("GENERATE_LEGEND")) { msg("Generating graph info page...\n"); @@ -10731,24 +10701,6 @@ void generateOutput() generateDirDocs(*g_outputList); } - //msg("Generating file index...\n"); - //writeFileIndex(*g_outputList); - - //if (Config_getBool("SHOW_DIRECTORIES")) - //{ - // msg("Generating directory index...\n"); - // writeDirIndex(*g_outputList); - //} - - //msg("Generating example index...\n"); - //writeExampleIndex(*g_outputList); - - //msg("Generating file member index...\n"); - //writeFileMemberIndex(*g_outputList); - - - //writeDirDependencyGraph(Config_getString("HTML_OUTPUT")); - if (Doxygen::formulaList.count()>0 && Config_getBool("GENERATE_HTML") && !Config_getBool("USE_MATHJAX")) { @@ -10756,15 +10708,6 @@ void generateOutput() Doxygen::formulaList.generateBitmaps(Config_getString("HTML_OUTPUT")); } - //if (Config_getBool("GENERATE_HTML") && Config_getBool("GENERATE_HTMLHELP")) - //{ - // HtmlHelp::getInstance()->finalize(); - //} - //if (Config_getBool("GENERATE_HTML") && Config_getBool("GENERATE_TREEVIEW")) - //{ - // FTVHelp::getInstance()->finalize(); - //} - writeIndexHierarchy(*g_outputList); msg("finalizing index lists...\n"); @@ -10897,8 +10840,6 @@ void generateOutput() * Start cleaning up * **************************************************************************/ - //Doxygen::symbolCache->printStats(); - //Doxygen::symbolStorage->printStats(); cleanUpDoxygen(); finializeDocParser(); diff --git a/src/filedef.h b/src/filedef.h index 6cecbdf..34b6424 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -80,11 +80,8 @@ class FileDef : public Definition else return Definition::name(); } - - QCString fileName() const - { - return filename; - } + QCString displayName() const { return name(); } + QCString fileName() const { return filename; } QCString getOutputFileBase() const { return convertNameToFile(diskname); } diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 9ed02c9..7dd03c4 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -578,6 +578,26 @@ void FTVHelp::addContentsItem(bool isDir, } +static QCString node2URL(FTVNode *n) +{ + QCString url = n->file; + if (!url.isEmpty() && url.at(0)=='!') // relative URL + { + // remove leading ! + url = url.mid(1); + } + else if (!url.isEmpty() && url.at(0)=='^') // absolute URL + { + // skip, keep ^ in the output + } + else // local file (with optional anchor) + { + url+=Doxygen::htmlFileExtension; + if (!n->anchor.isEmpty()) url+="#"+n->anchor; + } + return url; +} + void FTVHelp::generateIndent(FTextStream &t, FTVNode *n,int level) { @@ -645,8 +665,7 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n) } t << "href=\""; t << externalRef("",n->ref,TRUE); - t << n->file << Doxygen::htmlFileExtension; - if (!n->anchor.isEmpty()) t << "#" << n->anchor; + t << node2URL(n); if (m_topLevelIndex) t << "\" target=\"basefrm\">"; else @@ -672,8 +691,7 @@ void FTVHelp::generateJSLink(FTextStream &t,FTVNode *n) // TODO: use m_topLevelIndex t << "\"" << convertToJSString(n->name) << "\", \""; t << externalRef("",n->ref,TRUE); - t << n->file << Doxygen::htmlFileExtension; - if (!n->anchor.isEmpty()) t << "#" << n->anchor; + t << node2URL(n); t << "\", "; } } @@ -756,9 +774,7 @@ bool FTVHelp::generateJSTree(FTextStream &tidx,FTextStream &t, const QListfile.isEmpty() && !childOfHierarchy(n->parent)) if (n->addToNavIndex) { - tidx << "," << endl << "\"" << n->file << Doxygen::htmlFileExtension; - if (!n->anchor.isEmpty()) tidx << "#" << n->anchor; - tidx << "\":["; + tidx << "," << endl << "\"" << node2URL(n) << "\":["; writePathToNode(tidx,n,n); tidx << "]"; } @@ -847,9 +863,11 @@ void FTVHelp::generateTreeViewScripts() bool first=TRUE; generateJSTree(tidx,t,m_indentNodes[0],1,first); - if (first) t << "]"; - t << endl << " ] ]" << endl; + if (first) + t << "]" << endl; + else + t << endl << " ] ]" << endl; t << "];" << endl; t << endl << navtree_script; diff --git a/src/groupdef.cpp b/src/groupdef.cpp index a12fc42..8452aa2 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -646,7 +646,7 @@ void GroupDef::writeFiles(OutputList &ol,const QCString &title) FileDef *fd=fileList->first(); while (fd) { - ol.startMemberItem(0); + ol.startMemberItem(fd->getOutputFileBase(),0); ol.docify(theTranslator->trFile(FALSE,TRUE)+" "); ol.insertMemberAlign(); ol.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),0,fd->name()); @@ -657,7 +657,7 @@ void GroupDef::writeFiles(OutputList &ol,const QCString &title) ol.endMemberItem(); if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startMemberDescription(); + ol.startMemberDescription(fd->getOutputFileBase()); ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE); ol.endMemberDescription(); } @@ -685,7 +685,7 @@ void GroupDef::writeNestedGroups(OutputList &ol,const QCString &title) GroupDef *gd=groupList->first(); while (gd) { - ol.startMemberItem(0); + ol.startMemberItem(gd->getOutputFileBase(),0); //ol.docify(theTranslator->trGroup(FALSE,TRUE)); //ol.docify(" "); ol.insertMemberAlign(); @@ -697,7 +697,7 @@ void GroupDef::writeNestedGroups(OutputList &ol,const QCString &title) ol.endMemberItem(); if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startMemberDescription(); + ol.startMemberDescription(gd->getOutputFileBase()); ol.parseDoc(briefFile(),briefLine(),gd,0,gd->briefDescription(),FALSE,FALSE); ol.endMemberDescription(); } @@ -719,7 +719,7 @@ void GroupDef::writeDirs(OutputList &ol,const QCString &title) DirDef *dd=dirList->first(); while (dd) { - ol.startMemberItem(0); + ol.startMemberItem(dd->getOutputFileBase(),0); ol.parseText(theTranslator->trDir(FALSE,TRUE)); ol.insertMemberAlign(); ol.writeObjectLink(dd->getReference(),dd->getOutputFileBase(),0,dd->shortName()); @@ -730,8 +730,8 @@ void GroupDef::writeDirs(OutputList &ol,const QCString &title) } if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startMemberDescription(); - ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE); + ol.startMemberDescription(dd->getOutputFileBase()); + ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE,0,TRUE,FALSE); ol.endMemberDescription(); } dd=dirList->next(); @@ -776,7 +776,7 @@ void GroupDef::writePageDocumentation(OutputList &ol) ol.endSection(si->label,SectionInfo::Subsection); } ol.startTextBlock(); - ol.parseDoc(pd->docFile(),pd->docLine(),pd,0,pd->documentation()+pd->inbodyDocumentation(),TRUE,FALSE); + ol.parseDoc(pd->docFile(),pd->docLine(),pd,0,pd->documentation()+pd->inbodyDocumentation(),TRUE,FALSE,0,TRUE,FALSE); ol.endTextBlock(); } } @@ -1443,3 +1443,8 @@ void GroupDef::removeMemberFromList(MemberList::ListType lt,MemberDef *md) if (ml) ml->remove(md); } +void GroupDef::sortSubGroups() +{ + groupList->sort(); +} + diff --git a/src/groupdef.h b/src/groupdef.h index effefac..002b037 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -49,9 +49,10 @@ class GroupDef : public Definition DefType definitionType() const { return TypeGroup; } QCString getOutputFileBase() const; QCString anchor() const { return QCString(); } + QCString displayName() const { return hasGroupTitle() ? title : Definition::name(); } const char *groupTitle() const { return title; } void setGroupTitle( const char *newtitle ); - bool hasGroupTitle( ) { return titleSet; } + bool hasGroupTitle( ) const { return titleSet; } void addFile(const FileDef *def); bool addClass(const ClassDef *def); bool addNamespace(const NamespaceDef *def); @@ -87,7 +88,7 @@ class GroupDef : public Definition bool visited; // number of times accessed for output - KPW - friend void writeGroupTreeNode(OutputList&, GroupDef*, int, FTVHelp*); + //friend void writeGroupTreeNode(OutputList&, GroupDef*, int, FTVHelp*); // make accessible for writing tree view of group in index.cpp - KPW void setGroupScope(Definition *d) { groupScope = d; } @@ -105,7 +106,9 @@ class GroupDef : public Definition GroupList * getSubGroups() const { return groupList; } PageSDict * getPages() const { return pageDict; } DirList * getDirs() const { return dirList; } + PageSDict * getExamples() const { return exampleDict; } //MemberList* getMembers() const { return allMemberList; } + void sortSubGroups(); protected: void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const); diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index a35d92a..16c5b46 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -83,8 +83,8 @@ static bool mustBeOutsideParagraph(DocNode *n) /* \internal */ case DocNode::Kind_Internal: /*
    */ - case DocNode::Kind_Verbatim: case DocNode::Kind_Include: + case DocNode::Kind_Verbatim: case DocNode::Kind_Image: case DocNode::Kind_SecRefList: /*
    */ @@ -107,8 +107,6 @@ static bool mustBeOutsideParagraph(DocNode *n) return FALSE; } - - static QString htmlAttribsToString(const HtmlAttribList &attribs) { QString result; @@ -849,16 +847,6 @@ void HtmlDocVisitor::visitPre(DocPara *p) void HtmlDocVisitor::visitPost(DocPara *p) { -// if (m_hide) return; -// if (!p->isLast() && // omit

    for last paragraph -// !(p->parent() && // and for parameter sections -// p->parent()->kind()==DocNode::Kind_ParamSect -// ) -// ) -// { -// m_t << "

    \n"; -// } - bool needsTag = FALSE; if (p && p->parent()) { @@ -1209,11 +1197,7 @@ void HtmlDocVisitor::visitPost(DocInternal *) void HtmlDocVisitor::visitPre(DocHRef *href) { if (m_hide) return; - QCString url = href->url(); - if (url.left(5)!="http:" && url.left(6)!="https:" && url.left(4)!="ftp:") - { - url.prepend(href->relPath()); - } + QCString url = correctURL(href->url(),href->relPath()); m_t << "attribs()) << ">"; } @@ -1261,11 +1245,7 @@ void HtmlDocVisitor::visitPre(DocImage *img) } else { - if (url.left(5)!="http:" && url.left(6)!="https:" && url.left(4)!="ftp:") - { - url.prepend(img->relPath()); - } - m_t << "relPath()) << "\" " << htmlAttribsToString(img->attribs()) << "/>" << endl; } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 24bf523..4a203b1 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1857,7 +1857,7 @@ void HtmlGenerator::endMemberList() // 0 = single column right aligned // 1 = double column left aligned // 2 = single column left aligned -void HtmlGenerator::startMemberItem(int annoType) +void HtmlGenerator::startMemberItem(const char *anchor,int annoType) { DBG_HTML(t << "" << endl) if (Config_getBool("HTML_ALIGN_MEMBERS")) @@ -1867,7 +1867,7 @@ void HtmlGenerator::startMemberItem(int annoType) t << "" << endl; m_emptySection=FALSE; } - t << ""; + t << ""; switch(annoType) { case 0: t << "" << endl; - t << "
    "; break; @@ -1896,12 +1896,12 @@ void HtmlGenerator::startMemberTemplateParams() { } -void HtmlGenerator::endMemberTemplateParams() +void HtmlGenerator::endMemberTemplateParams(const char *anchor) { if (Config_getBool("HTML_ALIGN_MEMBERS")) { t << "
    "; + t << "
    "; } } @@ -1916,7 +1916,7 @@ void HtmlGenerator::insertMemberAlign(bool templ) } } -void HtmlGenerator::startMemberDescription() +void HtmlGenerator::startMemberDescription(const char *anchor) { DBG_HTML(t << "" << endl) if (Config_getBool("HTML_ALIGN_MEMBERS")) @@ -1926,7 +1926,7 @@ void HtmlGenerator::startMemberDescription() t << "" << endl; m_emptySection=FALSE; } - t << "
     "; + t << "
     "; } else { @@ -2446,15 +2446,15 @@ static void startQuickIndexItem(FTextStream &t,const char *l, { t << " class=\"current\""; } - t << ">"; + t << ">"; + if (l) t << ""; t << ""; } -static void endQuickIndexItem(FTextStream &t) +static void endQuickIndexItem(FTextStream &t,const char *l) { t << ""; - t << ""; + if (l) t << ""; t << "\n"; } @@ -2469,6 +2469,7 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind) { case LayoutNavEntry::MainPage: return TRUE; case LayoutNavEntry::User: return TRUE; + case LayoutNavEntry::UserGroup: return TRUE; case LayoutNavEntry::Pages: return indexedPages>0; case LayoutNavEntry::Modules: return documentedGroups>0; case LayoutNavEntry::Namespaces: return documentedNamespaces>0; @@ -2505,18 +2506,10 @@ static void renderQuickLinksAsTree(FTextStream &t,const QCString &relPath,Layout { if (entry->visible() && quickLinkVisible(entry->kind())) { - QCString url = entry->baseFile(); - if (entry->kind()!=LayoutNavEntry::User) - { - url+=Doxygen::htmlFileExtension; - } - t << ""; - t << ""; + QCString url = entry->url(); + t << "
  2. "; t << fixSpaces(entry->title()); - t << ""; - t << "\n"; + t << "\n"; // recursive into child list renderQuickLinksAsTree(t,relPath,entry); t << "
  3. "; @@ -2531,7 +2524,6 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath, LayoutNavEntry *hlEntry,LayoutNavEntry::Kind kind, bool highlightParent,bool highlightSearch) { - //static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); if (hlEntry->parent()) // first draw the tabs for the parent of hlEntry { renderQuickLinksAsTabs(t,relPath,hlEntry->parent(),kind,highlightParent,highlightSearch); @@ -2554,11 +2546,7 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath, { if (entry->visible() && quickLinkVisible(entry->kind())) { - QCString url = entry->baseFile(); - if (entry->kind()!=LayoutNavEntry::User) - { - url+=Doxygen::htmlFileExtension; - } + QCString url = entry->url(); startQuickIndexItem(t,url, entry==hlEntry && (entry->children().count()>0 || @@ -2566,27 +2554,23 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath, ), TRUE,relPath); t << fixSpaces(entry->title()); - endQuickIndexItem(t); + endQuickIndexItem(t,url); } } - if (hlEntry->parent()==LayoutDocManager::instance().rootNavEntry()) // first row + if (hlEntry->parent()==LayoutDocManager::instance().rootNavEntry()) // first row is special as it contains the search box { - //static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); static bool searchEngine = Config_getBool("SEARCHENGINE"); static bool serverBasedSearch = Config_getBool("SERVER_BASED_SEARCH"); - if (searchEngine /* && !generateTreeView */) + if (searchEngine) { + t << "
  4. \n"; if (!serverBasedSearch) // pure client side search { - //t << "
  5. \n"; - t << "
  6. \n"; writeClientSearchBox(t,relPath); t << "
  7. \n"; } - else // if (!generateTreeView) // server based search + else // server based search { - //t << "
  8. \n"; - t << "
  9. \n"; writeServerSearchBox(t,relPath,highlightSearch); if (!highlightSearch) { @@ -2594,13 +2578,13 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath, } } } - if (!highlightSearch) // on the search page the page will be ended by the + if (!highlightSearch) // on the search page the index will be ended by the // page itself { endQuickIndexList(t,TRUE); } } - else // normal case + else // normal case for other rows than first one { endQuickIndexList(t,TRUE); } @@ -2609,7 +2593,9 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath, } static void writeDefaultQuickLinks(FTextStream &t,bool compact, - HighlightedItem hli,const QCString &relPath) + HighlightedItem hli, + const char *file, + const QCString &relPath) { LayoutNavEntry *root = LayoutDocManager::instance().rootNavEntry(); LayoutNavEntry::Kind kind = (LayoutNavEntry::Kind)-1; @@ -2630,6 +2616,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, case HLI_Globals: kind = LayoutNavEntry::FileGlobals; break; case HLI_Pages: kind = LayoutNavEntry::Pages; break; case HLI_Examples: kind = LayoutNavEntry::Examples; break; + case HLI_UserGroup: kind = LayoutNavEntry::UserGroup; break; case HLI_ClassVisible: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes; highlightParent = TRUE; break; case HLI_NamespaceVisible: kind = LayoutNavEntry::NamespaceList; altKind = LayoutNavEntry::Namespaces; @@ -2643,7 +2630,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, if (compact) { // find highlighted index item - LayoutNavEntry *hlEntry = root->find(kind); + LayoutNavEntry *hlEntry = root->find(kind,kind==LayoutNavEntry::UserGroup ? file : 0); if (!hlEntry && altKind!=(LayoutNavEntry::Kind)-1) { hlEntry=root->find(altKind); kind=altKind; } if (!hlEntry) // highlighted item not found in the index! -> just show the level 1 index... { @@ -2654,6 +2641,14 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, return; // argl, empty index! } } + if (kind==LayoutNavEntry::UserGroup) + { + LayoutNavEntry *e = hlEntry->children().getFirst(); + if (e) + { + hlEntry = e; + } + } renderQuickLinksAsTabs(t,relPath,hlEntry,kind,highlightParent,hli==HLI_Search); } else @@ -2710,9 +2705,9 @@ void HtmlGenerator::endContents() t << "" << endl; } -void HtmlGenerator::writeQuickLinks(bool compact,HighlightedItem hli) +void HtmlGenerator::writeQuickLinks(bool compact,HighlightedItem hli,const char *file) { - writeDefaultQuickLinks(t,compact,hli,relPath); + writeDefaultQuickLinks(t,compact,hli,file,relPath); } // PHP based search script @@ -2788,7 +2783,7 @@ void HtmlGenerator::writeSearchPage() } if (!Config_getBool("DISABLE_INDEX")) { - writeDefaultQuickLinks(t,TRUE,HLI_Search,""); + writeDefaultQuickLinks(t,TRUE,HLI_Search,0,""); } else { diff --git a/src/htmlgen.h b/src/htmlgen.h index b31f6e1..b5d82da 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -120,10 +120,10 @@ class HtmlGenerator : public OutputGenerator void endInlineHeader(); void startAnonTypeScope(int) {} void endAnonTypeScope(int) {} - void startMemberItem(int); + void startMemberItem(const char *anchor,int); void endMemberItem(); void startMemberTemplateParams(); - void endMemberTemplateParams(); + void endMemberTemplateParams(const char *anchor); void startMemberGroupHeader(bool); void endMemberGroupHeader(); @@ -133,7 +133,7 @@ class HtmlGenerator : public OutputGenerator void endMemberGroup(bool); void insertMemberAlign(bool); - void startMemberDescription(); + void startMemberDescription(const char *anchor); void endMemberDescription(); void writeRuler() { t << "
    "; } @@ -197,7 +197,7 @@ class HtmlGenerator : public OutputGenerator void endQuickIndices(); void writeSplitBar(const char *name); void writeLogo(); - void writeQuickLinks(bool compact,HighlightedItem hli); + void writeQuickLinks(bool compact,HighlightedItem hli,const char *file); void startContents(); void endContents(); void writeNonBreakableSpace(int); diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 21cdbcc..dd2311e 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -60,7 +60,7 @@ class IndexFieldSDict : public SDict class HtmlHelpIndex { public: - HtmlHelpIndex(); + HtmlHelpIndex(HtmlHelp *help); ~HtmlHelpIndex(); void addItem(const char *first,const char *second, const char *url, const char *anchor, @@ -68,10 +68,11 @@ class HtmlHelpIndex void writeFields(FTextStream &t); private: IndexFieldSDict *dict; + HtmlHelp *m_help; }; /*! Constructs a new HtmlHelp index */ -HtmlHelpIndex::HtmlHelpIndex() +HtmlHelpIndex::HtmlHelpIndex(HtmlHelp *help) : m_help(help) { dict = new IndexFieldSDict; dict->setAutoDelete(TRUE); @@ -198,7 +199,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t) t << "url << Doxygen::htmlFileExtension; if (!f->anchor.isEmpty() && f->reversed) t << "#" << f->anchor; t << "\">"; - t << "" + t << "recode(level1) << "\">" "\n"; } else @@ -209,14 +210,14 @@ void HtmlHelpIndex::writeFields(FTextStream &t) t << "url << Doxygen::htmlFileExtension; if (!f->anchor.isEmpty() && f->reversed) t << "#" << f->anchor; t << "\">"; - t << "" + t << "recode(level1) << "\">" "\n"; } else { t << "
  10. "; - t << ""; - t << "" + t << "recode(level1) << "\">"; + t << "recode(level1) << "\">" "\n"; } } @@ -237,7 +238,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t) t << "url << Doxygen::htmlFileExtension; if (!f->anchor.isEmpty()) t << "#" << f->anchor; t << "\">"; - t << "" + t << "recode(level2) << "\">" "\n"; } lastLevel1 = level1.copy(); @@ -258,7 +259,7 @@ HtmlHelp::HtmlHelp() : indexFileDict(1009) /* initial depth */ dc = 0; cf = kf = 0; - index = new HtmlHelpIndex; + index = new HtmlHelpIndex(this); m_fromUtf8 = (void *)(-1); } diff --git a/src/htmlhelp.h b/src/htmlhelp.h index bba4efe..8dafd15 100644 --- a/src/htmlhelp.h +++ b/src/htmlhelp.h @@ -85,6 +85,7 @@ class HtmlHelp : public IndexIntf void addStyleSheetFile(const char *) {} private: + friend class HtmlHelpIndex; void createProjectFile(); QFile *cf,*kf; diff --git a/src/index.cpp b/src/index.cpp index adb82f3..7d094d8 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -291,7 +291,7 @@ void startFile(OutputList &ol,const char *name,const char *manName, ol.startQuickIndices(); if (!disableIndex) { - ol.writeQuickLinks(TRUE,hli); + ol.writeQuickLinks(TRUE,hli,name); } if (!additionalIndices) { @@ -417,7 +417,10 @@ static bool classHasVisibleChildren(ClassDef *cd) return FALSE; } -static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv) +//---------------------------------------------------------------------------- +/*! Generates HTML Help tree of classes */ + +static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv,bool addToIndex) { if (bcl==0) return; BaseClassListIterator bcli(*bcl); @@ -440,9 +443,14 @@ static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int if (!started) { startIndexHierarchy(ol,level); - Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.incContentsDepth(); + } if (ftv) + { ftv->incContentsDepth(); + } started=TRUE; } ol.startIndexListItem(); @@ -461,18 +469,28 @@ static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int ol.docify(" [external]"); ol.endTypewriter(); } - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); + } if (ftv) + { ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); + } } else { ol.startIndexItem(0,0); ol.parseText(cd->name()); ol.endIndexItem(0,0); - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),0,0,0); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),0,0,0); + } if (ftv) + { ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0); + } } if (hasChildren) { @@ -481,11 +499,11 @@ static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int cd->visited=TRUE; if (cd->getLanguage()==SrcLangExt_VHDL) { - writeClassTree(ol,cd->baseClasses(),wasVisited,level+1,ftv); + writeClassTree(ol,cd->baseClasses(),wasVisited,level+1,ftv,addToIndex); } else { - writeClassTree(ol,cd->subClasses(),wasVisited,level+1,ftv); + writeClassTree(ol,cd->subClasses(),wasVisited,level+1,ftv,addToIndex); } } ol.endIndexListItem(); @@ -494,54 +512,20 @@ static void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int if (started) { endIndexHierarchy(ol,level); - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } if (ftv) - ftv->decContentsDepth(); - } -} - - -//---------------------------------------------------------------------------- -/*! Generates HTML Help tree of classes */ - -static void writeClassTree(BaseClassList *cl,int level) -{ - if (cl==0) return; - BaseClassListIterator cli(*cl); - bool started=FALSE; - for ( ; cli.current() ; ++cli) - { - ClassDef *cd=cli.current()->classDef; - if (cd->isVisibleInHierarchy() && hasVisibleRoot(cd->baseClasses())) - //if (cd->isVisibleInHierarchy() && !cd->visited) { - if (!started) - { - Doxygen::indexList.incContentsDepth(); - started=TRUE; - } - bool hasChildren = !cd->visited && classHasVisibleChildren(cd); - //printf("tree2: Has children %s: %d\n",cd->name().data(),hasChildren); - if (cd->isLinkable()) - { - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); - } - if (hasChildren) - { - writeClassTree(cd->subClasses(),level+1); - } - cd->visited=TRUE; + ftv->decContentsDepth(); } } - if (started) - { - Doxygen::indexList.decContentsDepth(); - } } //---------------------------------------------------------------------------- -static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FTVHelp* ftv) +static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FTVHelp* ftv,bool addToIndex) { ClassSDict::Iterator cli(*cl); for (;cli.current(); ++cli) @@ -573,7 +557,10 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT if (!started) { startIndexHierarchy(ol,0); - Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.incContentsDepth(); + } started=TRUE; } ol.startIndexListItem(); @@ -592,27 +579,37 @@ 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(),cd->anchor(),FALSE,FALSE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor(),FALSE,FALSE); + } if (ftv) + { ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor()); + } } else { ol.startIndexItem(0,0); ol.parseText(cd->displayName()); ol.endIndexItem(0,0); - Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),0,0,0,FALSE,FALSE); + } if (ftv) + { ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0); + } } if (cd->getLanguage()==SrcLangExt_VHDL && hasChildren) { - writeClassTree(ol,cd->baseClasses(),cd->visited,1,ftv); + writeClassTree(ol,cd->baseClasses(),cd->visited,1,ftv,addToIndex); cd->visited=TRUE; } else if (hasChildren) { - writeClassTree(ol,cd->subClasses(),cd->visited,1,ftv); + writeClassTree(ol,cd->subClasses(),cd->visited,1,ftv,addToIndex); cd->visited=TRUE; } ol.endIndexListItem(); @@ -621,7 +618,7 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FT } } -static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv) +static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex) { initClassHierarchy(Doxygen::classSDict); initClassHierarchy(Doxygen::hiddenClasses); @@ -631,12 +628,15 @@ static void writeClassHierarchy(OutputList &ol, FTVHelp* ftv) ol.disable(OutputGenerator::Html); } bool started=FALSE; - writeClassTreeForList(ol,Doxygen::classSDict,started,ftv); - writeClassTreeForList(ol,Doxygen::hiddenClasses,started,ftv); + writeClassTreeForList(ol,Doxygen::classSDict,started,ftv,addToIndex); + writeClassTreeForList(ol,Doxygen::hiddenClasses,started,ftv,addToIndex); if (started) { endIndexHierarchy(ol,0); - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } } if (ftv) ol.popGeneratorState(); @@ -682,15 +682,23 @@ static void writeHierarchicalIndex(OutputList &ol) if (hierarchyClasses==0) return; ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); + LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy); QCString title = lne ? lne->title() : theTranslator->trClassHierarchy(); + bool addToIndex = lne==0 || lne->visible(); + startFile(ol,"hierarchy",0, title, HLI_Hierarchy); startTitle(ol,0); ol.parseText(title); endTitle(ol,0,0); ol.startContents(); ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"hierarchy",0,TRUE,TRUE); + + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"hierarchy",0,TRUE,TRUE); + } + if (Config_getBool("HAVE_DOT") && Config_getBool("GRAPHICAL_HIERARCHY")) { ol.disable(OutputGenerator::Latex); @@ -713,7 +721,7 @@ static void writeHierarchicalIndex(OutputList &ol) ftv = new FTVHelp(FALSE); } - writeClassHierarchy(ol,ftv); + writeClassHierarchy(ol,ftv,addToIndex); if (ftv) { @@ -799,6 +807,8 @@ static void writeFileIndex(OutputList &ol) LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileList); if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files); // fall back QCString title = lne ? lne->title() : theTranslator->trFileList(); + bool addToIndex = lne==0 || lne->visible(); + startFile(ol,"files",0,title,HLI_Files); startTitle(ol,0); //if (!Config_getString("PROJECT_NAME").isEmpty()) @@ -809,8 +819,13 @@ static void writeFileIndex(OutputList &ol) endTitle(ol,0,0); ol.startContents(); ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"files",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); + + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"files",0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } + ol.parseText(lne ? lne->intro() : theTranslator->trFileListDescription(Config_getBool("EXTRACT_ALL"))); ol.endTextBlock(); @@ -888,14 +903,20 @@ static void writeFileIndex(OutputList &ol) if (doc) { ol.writeObjectLink(0,fd->getOutputFileBase(),0,fd->name()); - addMembersToIndex(fd,LayoutDocManager::File,fullName,QCString()); + if (addToIndex) + { + addMembersToIndex(fd,LayoutDocManager::File,fullName,QCString()); + } } else { ol.startBold(); ol.docify(fd->name()); ol.endBold(); - Doxygen::indexList.addContentsItem(FALSE,fullName,0,0,0); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(FALSE,fullName,0,0,0); + } } if (src) { @@ -943,7 +964,12 @@ static void writeFileIndex(OutputList &ol) } } ol.endIndexList(); - Doxygen::indexList.decContentsDepth(); + + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } + endFile(ol); ol.popGeneratorState(); } @@ -971,18 +997,18 @@ static void writeNamespaceIndex(OutputList &ol) LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceList); if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces); // fall back QCString title = lne ? lne->title() : theTranslator->trNamespaceList(); + bool addToIndex = lne==0 || lne->visible(); startFile(ol,"namespaces",0,title,HLI_Namespaces); startTitle(ol,0); - //if (!Config_getString("PROJECT_NAME").isEmpty()) - //{ - // longTitle.prepend(Config_getString("PROJECT_NAME")+" "); - //} ol.parseText(title); endTitle(ol,0,0); ol.startContents(); ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"namespaces",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"namespaces",0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } ol.parseText(lne ? lne->intro() : theTranslator->trNamespaceListDescription(Config_getBool("EXTRACT_ALL"))); ol.endTextBlock(); @@ -1011,6 +1037,7 @@ static void writeNamespaceIndex(OutputList &ol) ol.writeObjectLink(0,nd->getOutputFileBase(),0,nd->displayName()); } ol.endIndexKey(); + bool hasBrief = !nd->briefDescription().isEmpty(); ol.startIndexValue(hasBrief); if (hasBrief) @@ -1029,11 +1056,26 @@ static void writeNamespaceIndex(OutputList &ol) //ol.docify(")"); } ol.endIndexValue(nd->getOutputFileBase(),hasBrief); - addMembersToIndex(nd,LayoutDocManager::Namespace,nd->displayName(),QCString()); + + if (addToIndex) + { + if (nd->getLanguage()==SrcLangExt_VHDL) + { + ClassDef* ccd=getClass(nd->displayName().data()); + if (ccd) Doxygen::indexList.addContentsItem(FALSE,ccd->displayName(),ccd->getReference(),ccd->getOutputFileBase(),0); + } + else + { + addMembersToIndex(nd,LayoutDocManager::Namespace,nd->displayName(),QCString()); + } + } } } if (!first) ol.endIndexList(); - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } endFile(ol); ol.popGeneratorState(); } @@ -1064,61 +1106,15 @@ static int countAnnotatedClasses(int *cp) static void writeAnnotatedClassList(OutputList &ol) { + LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList); + bool addToIndex = lne==0 || lne->visible(); + ol.startIndexList(); ClassSDict::Iterator cli(*Doxygen::classSDict); ClassDef *cd; -#if 0 - // clear index - int x,y; - for (y=0;yisLinkableInProject() && cd->templateMaster()==0) - { - QCString dispName = cd->displayName(); - int c = dispName.at(getPrefixIndex(dispName)); - g_classIndexLetterUsed[CHL_All][c]=TRUE; - switch(cd->compoundType()) - { - case ClassDef::Class: - g_classIndexLetterUsed[CHL_Classes][c]=TRUE; - break; - case ClassDef::Struct: - g_classIndexLetterUsed[CHL_Structs][c]=TRUE; - break; - case ClassDef::Union: - g_classIndexLetterUsed[CHL_Unions][c]=TRUE; - break; - case ClassDef::Interface: - g_classIndexLetterUsed[CHL_Interfaces][c]=TRUE; - break; - case ClassDef::Protocol: - g_classIndexLetterUsed[CHL_Protocols][c]=TRUE; - break; - case ClassDef::Category: - g_classIndexLetterUsed[CHL_Categories][c]=TRUE; - break; - case ClassDef::Exception: - g_classIndexLetterUsed[CHL_Exceptions][c]=TRUE; - break; - - } - } - } -#endif - - for (cli.toFirst();(cd=cli.current());++cli) - { - if (cd->getLanguage()==SrcLangExt_VHDL &&(!(VhdlDocGen::VhdlClasses)cd->protection()==VhdlDocGen::ENTITYCLASS )) continue; @@ -1157,7 +1153,10 @@ static void writeAnnotatedClassList(OutputList &ol) } ol.endIndexValue(cd->getOutputFileBase(),hasBrief); - addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(),cd->anchor()); + if (addToIndex) + { + addMembersToIndex(cd,LayoutDocManager::Class,cd->displayName(),cd->anchor()); + } } ol.popGeneratorState(); } @@ -1490,17 +1489,23 @@ static void writeAlphabeticalIndex(OutputList &ol) ol.disableAllBut(OutputGenerator::Html); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassIndex); QCString title = lne ? lne->title() : theTranslator->trCompoundIndex(); + bool addToIndex = lne==0 || lne->visible(); + startFile(ol,"classes",0,title,HLI_Classes); startTitle(ol,0); ol.parseText(title); - Doxygen::indexList.addContentsItem(TRUE,title,0,"classes",0,TRUE,TRUE); endTitle(ol,0,0); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"classes",0,TRUE,TRUE); + } + ol.startContents(); writeAlphabeticalClassList(ol); - endFile(ol); // contains ol.endContents() + ol.popGeneratorState(); } @@ -1522,6 +1527,13 @@ static void writeAnnotatedIndex(OutputList &ol) LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassList); if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes); // fall back QCString title = lne ? lne->title() : theTranslator->trCompoundList(); + bool addToIndex = lne==0 || lne->visible(); + + if (Config_getBool("OPTIMIZE_OUTPUT_VHDL")) + { + VhdlDocGen::findConstraintFile(lne); + } + startFile(ol,"annotated",0,title,HLI_Annotated); startTitle(ol,0); @@ -1530,13 +1542,22 @@ static void writeAnnotatedIndex(OutputList &ol) ol.startContents(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"annotated",0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } + ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"annotated",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); ol.parseText(lne ? lne->intro() : theTranslator->trCompoundListDescription()); ol.endTextBlock(); + writeAnnotatedClassList(ol); - Doxygen::indexList.decContentsDepth(); + + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } endFile(ol); // contains ol.endContents() ol.popGeneratorState(); @@ -1977,10 +1998,14 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers); QCString title = lne ? lne->title() : theTranslator->trCompoundMembers(); if (hl!=CMHL_All) title+=(QCString)" - "+getCmhlInfo(hl)->title; + bool addToIndex = lne==0 || lne->visible(); - Doxygen::indexList.addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,0, - getCmhlInfo(hl)->fname,0,multiPageIndex,TRUE); - if (multiPageIndex) Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(multiPageIndex,getCmhlInfo(hl)->title,0, + getCmhlInfo(hl)->fname,0,multiPageIndex,TRUE); + if (multiPageIndex) Doxygen::indexList.incContentsDepth(); + } int page; bool first=TRUE; @@ -1998,7 +2023,10 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h char cs[2]; cs[0]=page; cs[1]=0; - Doxygen::indexList.addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE); + } } bool quickIndex = documentedClassMembers[hl]>maxItemsBeforeQuickIndex; @@ -2006,7 +2034,7 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h ol.startQuickIndices(); if (!disableIndex) { - ol.writeQuickLinks(TRUE,HLI_Functions); + ol.writeQuickLinks(TRUE,HLI_Functions,0); startQuickIndexList(ol); // index item for global member list @@ -2045,8 +2073,6 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h ol.writeSplitBar(fileName); } - //Doxygen::indexList.addContentsItem(FALSE,title,0,fileName,0); - ol.startContents(); if (hl==CMHL_All) @@ -2071,16 +2097,18 @@ static void writeClassMemberIndexFiltered(OutputList &ol, ClassMemberHighlight h } } - if (multiPageIndex) Doxygen::indexList.decContentsDepth(); + if (multiPageIndex && addToIndex) Doxygen::indexList.decContentsDepth(); ol.popGeneratorState(); } static void writeClassMemberIndex(OutputList &ol) { - if (documentedClassMembers[CMHL_All]>0) + LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers); + bool addToIndex = lne==0 || lne->visible(); + + if (documentedClassMembers[CMHL_All]>0 && addToIndex) { - LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassMembers); Doxygen::indexList.addContentsItem(TRUE,lne ? lne->title() : theTranslator->trCompoundMembers(),0,"functions",0); Doxygen::indexList.incContentsDepth(); } @@ -2093,7 +2121,7 @@ static void writeClassMemberIndex(OutputList &ol) writeClassMemberIndexFiltered(ol,CMHL_Properties); writeClassMemberIndexFiltered(ol,CMHL_Events); writeClassMemberIndexFiltered(ol,CMHL_Related); - if (documentedClassMembers[CMHL_All]>0) + if (documentedClassMembers[CMHL_All]>0 && addToIndex) { Doxygen::indexList.decContentsDepth(); } @@ -2150,10 +2178,14 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl) QCString extension=Doxygen::htmlFileExtension; LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals); QCString title = lne ? lne->title() : theTranslator->trFileMembers(); + bool addToIndex = lne==0 || lne->visible(); - Doxygen::indexList.addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,0, - getFmhlInfo(hl)->fname,0,multiPageIndex,TRUE); - if (multiPageIndex) Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(multiPageIndex,getFmhlInfo(hl)->title,0, + getFmhlInfo(hl)->fname,0,multiPageIndex,TRUE); + if (multiPageIndex) Doxygen::indexList.incContentsDepth(); + } int page; bool first=TRUE; @@ -2171,7 +2203,10 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl) char cs[2]; cs[0]=page; cs[1]=0; - Doxygen::indexList.addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE); + } } bool quickIndex = documentedFileMembers[hl]>maxItemsBeforeQuickIndex; @@ -2179,7 +2214,7 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl) ol.startQuickIndices(); if (!disableIndex) { - ol.writeQuickLinks(TRUE,HLI_Globals); + ol.writeQuickLinks(TRUE,HLI_Globals,0); startQuickIndexList(ol); // index item for all file member lists @@ -2240,15 +2275,16 @@ static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl) first=FALSE; } } - if (multiPageIndex) Doxygen::indexList.decContentsDepth(); + if (multiPageIndex && addToIndex) Doxygen::indexList.decContentsDepth(); ol.popGeneratorState(); } static void writeFileMemberIndex(OutputList &ol) { - if (documentedFileMembers[FMHL_All]>0) + LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals); + bool addToIndex = lne==0 || lne->visible(); + if (documentedFileMembers[FMHL_All]>0 && addToIndex) { - LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileGlobals); Doxygen::indexList.addContentsItem(FALSE,lne ? lne->title() : theTranslator->trFileMembers(),0,"globals",0); Doxygen::indexList.incContentsDepth(); } @@ -2259,7 +2295,7 @@ static void writeFileMemberIndex(OutputList &ol) writeFileMemberIndexFiltered(ol,FMHL_Enums); writeFileMemberIndexFiltered(ol,FMHL_EnumValues); writeFileMemberIndexFiltered(ol,FMHL_Defines); - if (documentedFileMembers[FMHL_All]>0) + if (documentedFileMembers[FMHL_All]>0 && addToIndex) { Doxygen::indexList.decContentsDepth(); } @@ -2304,6 +2340,7 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol, static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); static bool disableIndex = Config_getBool("DISABLE_INDEX"); + bool multiPageIndex=FALSE; int numPages=1; if (documentedNamespaceMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX) @@ -2318,10 +2355,14 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol, QCString extension=Doxygen::htmlFileExtension; LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers); QCString title = lne ? lne->title() : theTranslator->trNamespaceMembers(); + bool addToIndex = lne==0 || lne->visible(); - Doxygen::indexList.addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,0, - getNmhlInfo(hl)->fname,0,multiPageIndex,TRUE); - if (multiPageIndex) Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(multiPageIndex,getNmhlInfo(hl)->title,0, + getNmhlInfo(hl)->fname,0,multiPageIndex,TRUE); + if (multiPageIndex) Doxygen::indexList.incContentsDepth(); + } int page; bool first=TRUE; @@ -2339,7 +2380,10 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol, char cs[2]; cs[0]=page; cs[1]=0; - Doxygen::indexList.addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(FALSE,cs,0,fileName,0,FALSE,TRUE); + } } bool quickIndex = documentedNamespaceMembers[hl]>maxItemsBeforeQuickIndex; @@ -2347,7 +2391,7 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol, ol.startQuickIndices(); if (!disableIndex) { - ol.writeQuickLinks(TRUE,HLI_NamespaceMembers); + ol.writeQuickLinks(TRUE,HLI_NamespaceMembers,0); startQuickIndexList(ol); // index item for all namespace member lists @@ -2409,15 +2453,16 @@ static void writeNamespaceMemberIndexFiltered(OutputList &ol, endFile(ol); } } - if (multiPageIndex) Doxygen::indexList.decContentsDepth(); + if (multiPageIndex && addToIndex) Doxygen::indexList.decContentsDepth(); ol.popGeneratorState(); } static void writeNamespaceMemberIndex(OutputList &ol) { - if (documentedNamespaceMembers[NMHL_All]>0) + LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers); + bool addToIndex = lne==0 || lne->visible(); + if (documentedNamespaceMembers[NMHL_All]>0 && addToIndex) { - LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceMembers); Doxygen::indexList.addContentsItem(FALSE,lne ? lne->title() : theTranslator->trNamespaceMembers(),0,"namespacemembers",0); Doxygen::indexList.incContentsDepth(); } @@ -2428,7 +2473,7 @@ static void writeNamespaceMemberIndex(OutputList &ol) writeNamespaceMemberIndexFiltered(ol,NMHL_Typedefs); writeNamespaceMemberIndexFiltered(ol,NMHL_Enums); writeNamespaceMemberIndexFiltered(ol,NMHL_EnumValues); - if (documentedNamespaceMembers[NMHL_All]>0) + if (documentedNamespaceMembers[NMHL_All]>0 && addToIndex) { Doxygen::indexList.decContentsDepth(); } @@ -2446,16 +2491,26 @@ static void writeExampleIndex(OutputList &ol) ol.disable(OutputGenerator::Man); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Examples); QCString title = lne ? lne->title() : theTranslator->trExamples(); + bool addToIndex = lne==0 || lne->visible(); + startFile(ol,"examples",0,title,HLI_Examples); + startTitle(ol,0); ol.parseText(title); endTitle(ol,0,0); + ol.startContents(); + + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"examples",0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } + ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"examples",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); ol.parseText(lne ? lne->intro() : theTranslator->trExamplesDescription()); ol.endTextBlock(); + ol.startItemList(); PageSDict::Iterator pdi(*Doxygen::exampleSDict); PageDef *pd=0; @@ -2466,18 +2521,28 @@ static void writeExampleIndex(OutputList &ol) if (!pd->title().isEmpty()) { ol.writeObjectLink(0,n,0,pd->title()); - Doxygen::indexList.addContentsItem(FALSE,filterTitle(pd->title()),pd->getReference(),n,0,FALSE,TRUE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(FALSE,filterTitle(pd->title()),pd->getReference(),n,0,FALSE,TRUE); + } } else { ol.writeObjectLink(0,n,0,pd->name()); - Doxygen::indexList.addContentsItem(FALSE,pd->name(),pd->getReference(),n,0,FALSE,TRUE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(FALSE,pd->name(),pd->getReference(),n,0,FALSE,TRUE); + } } ol.endItemListItem(); ol.writeString("\n"); } ol.endItemList(); - Doxygen::indexList.decContentsDepth(); + + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } endFile(ol); ol.popGeneratorState(); } @@ -2666,9 +2731,13 @@ static void countRelatedPages(int &docPages,int &indexPages) static void writeSubPages(PageDef *pd) { + LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Pages); + bool addToIndex = lne==0 || lne->visible(); //printf("Write subpages(%s #=%d)\n",pd->name().data(),pd->getSubPages() ? pd->getSubPages()->count() : 0 ); - Doxygen::indexList.incContentsDepth(); - + if (addToIndex) + { + Doxygen::indexList.incContentsDepth(); + } PageSDict *subPages = pd->getSubPages(); if (subPages) { @@ -2685,12 +2754,17 @@ static void writeSubPages(PageDef *pd) bool hasSubPages = subPage->hasSubPages(); - Doxygen::indexList.addContentsItem(hasSubPages,pageTitle,subPage->getReference(),subPage->getOutputFileBase(),0,hasSubPages,TRUE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(hasSubPages,pageTitle,subPage->getReference(),subPage->getOutputFileBase(),0,hasSubPages,TRUE); + } writeSubPages(subPage); } } - Doxygen::indexList.decContentsDepth(); - + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } } static void writePageIndex(OutputList &ol) @@ -2702,16 +2776,16 @@ static void writePageIndex(OutputList &ol) QCString title = lne ? lne->title() : theTranslator->trRelatedPages(); startFile(ol,"pages",0,title,HLI_Pages); startTitle(ol,0); - //if (!Config_getString("PROJECT_NAME").isEmpty()) - //{ - // title.prepend(Config_getString("PROJECT_NAME")+" "); - //} ol.parseText(title); endTitle(ol,0,0); ol.startContents(); ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"pages",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); + bool addToIndex = lne==0 || lne->visible(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"pages",0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } ol.parseText(lne ? lne->intro() : theTranslator->trRelatedPagesDescription()); ol.endTextBlock(); startIndexHierarchy(ol,0); @@ -2741,13 +2815,19 @@ static void writePageIndex(OutputList &ol) ol.endTypewriter(); } ol.writeString("\n"); - Doxygen::indexList.addContentsItem(hasSubPages,filterTitle(pageTitle),pd->getReference(),pd->getOutputFileBase(),0,hasSubPages,TRUE); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(hasSubPages,filterTitle(pageTitle),pd->getReference(),pd->getOutputFileBase(),0,hasSubPages,TRUE); + } writeSubPages(pd); ol.endIndexListItem(); } } endIndexHierarchy(ol,0); - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } endFile(ol); ol.popGeneratorState(); } @@ -2852,7 +2932,7 @@ static void writeGroupIndexItem(GroupDef *gd,MemberList *ml,const QCString &titl /*! * write groups as hierarchical trees */ -void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) +static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv, bool addToIndex) { bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); @@ -2873,8 +2953,8 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) { //printf("gd->name()=%s #members=%d\n",gd->name().data(),gd->countMembers()); // write group info - bool hasSubGroups = gd->groupList->count()>0; - bool hasSubPages = gd->pageDict->count()>0; + bool hasSubGroups = gd->getSubGroups()->count()>0; + bool hasSubPages = gd->getPages()->count()>0; int numSubItems = 0; if ( Config_getBool("TOC_EXPAND")) { @@ -2887,16 +2967,19 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) numSubItems += ml->count(); } } - numSubItems += gd->namespaceSDict->count(); - numSubItems += gd->classSDict->count(); - numSubItems += gd->fileList->count(); - numSubItems += gd->exampleDict->count(); + numSubItems += gd->getNamespaces()->count(); + numSubItems += gd->getClasses()->count(); + numSubItems += gd->getFiles()->count(); + numSubItems += gd->getExamples()->count(); } bool isDir = hasSubGroups || hasSubPages || numSubItems>0; //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count()); - Doxygen::indexList.addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0,isDir,TRUE); - Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0,isDir,TRUE); + Doxygen::indexList.incContentsDepth(); + } if (ftv) { ftv->addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0); @@ -2921,57 +3004,59 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) // write pages - PageSDict::Iterator pli(*gd->pageDict); - PageDef *pd = 0; - for (pli.toFirst();(pd=pli.current());++pli) + if (addToIndex) { - SectionInfo *si=0; - if (!pd->name().isEmpty()) si=Doxygen::sectionDict[pd->name()]; - Doxygen::indexList.addContentsItem(FALSE, - convertToHtml(pd->title(),TRUE), - gd->getReference(), - gd->getOutputFileBase(), - si ? si->label.data() : 0, - FALSE, - TRUE); // addToNavIndex + PageSDict::Iterator pli(*gd->getPages()); + PageDef *pd = 0; + for (pli.toFirst();(pd=pli.current());++pli) + { + SectionInfo *si=0; + if (!pd->name().isEmpty()) si=Doxygen::sectionDict[pd->name()]; + Doxygen::indexList.addContentsItem(FALSE, + convertToHtml(pd->title(),TRUE), + gd->getReference(), + gd->getOutputFileBase(), + si ? si->label.data() : 0, + FALSE, + TRUE); // addToNavIndex + } } // write subgroups if (hasSubGroups) { startIndexHierarchy(ol,level+1); - if (Config_getBool("SORT_GROUP_NAMES")) - gd->groupList->sort(); - QListIterator gli(*gd->groupList); + if (Config_getBool("SORT_GROUP_NAMES")) gd->sortSubGroups(); + QListIterator gli(*gd->getSubGroups()); GroupDef *subgd = 0; for (gli.toFirst();(subgd=gli.current());++gli) { - writeGroupTreeNode(ol,subgd,level+1,ftv); + writeGroupTreeNode(ol,subgd,level+1,ftv,addToIndex); } endIndexHierarchy(ol,level+1); } - if (Config_getBool("TOC_EXPAND")) + if (Config_getBool("TOC_EXPAND") && addToIndex) { - writeGroupIndexItem(gd,gd->getMemberList(MemberList::docDefineMembers), + writeGroupIndexItem(gd,gd->getMemberList(MemberList::docDefineMembers), theTranslator->trDefines()); - writeGroupIndexItem(gd,gd->getMemberList(MemberList::docTypedefMembers), + writeGroupIndexItem(gd,gd->getMemberList(MemberList::docTypedefMembers), theTranslator->trTypedefs()); - writeGroupIndexItem(gd,gd->getMemberList(MemberList::docEnumMembers), + writeGroupIndexItem(gd,gd->getMemberList(MemberList::docEnumMembers), theTranslator->trEnumerations()); - writeGroupIndexItem(gd,gd->getMemberList(MemberList::docFuncMembers), + writeGroupIndexItem(gd,gd->getMemberList(MemberList::docFuncMembers), fortranOpt ? theTranslator->trSubprograms() : vhdlOpt ? VhdlDocGen::trFunctionAndProc() : theTranslator->trFunctions() ); - writeGroupIndexItem(gd,gd->getMemberList(MemberList::docVarMembers), + writeGroupIndexItem(gd,gd->getMemberList(MemberList::docVarMembers), theTranslator->trVariables()); - writeGroupIndexItem(gd,gd->getMemberList(MemberList::docProtoMembers), + writeGroupIndexItem(gd,gd->getMemberList(MemberList::docProtoMembers), theTranslator->trFuncProtos()); // write namespaces - NamespaceSDict *namespaceSDict=gd->namespaceSDict; + NamespaceSDict *namespaceSDict=gd->getNamespaces(); if (namespaceSDict->count()>0) { Doxygen::indexList.addContentsItem(TRUE,convertToHtml(fortranOpt?theTranslator->trModules():theTranslator->trNamespaces(),TRUE),gd->getReference(), gd->getOutputFileBase(), 0); @@ -2987,13 +3072,13 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) } // write classes - if (gd->classSDict->count()>0) + if (gd->getClasses()->count()>0) { Doxygen::indexList.addContentsItem(TRUE,convertToHtml(fortranOpt?theTranslator->trDataTypes():theTranslator->trClasses(),TRUE), gd->getReference(), gd->getOutputFileBase(), 0); Doxygen::indexList.incContentsDepth(); ClassDef *cd; - ClassSDict::Iterator cdi(*gd->classSDict); + ClassSDict::Iterator cdi(*gd->getClasses()); for (cdi.toFirst();(cd=cdi.current());++cdi) { if (cd->isLinkable()) @@ -3008,7 +3093,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) } // write file list - FileList *fileList=gd->fileList; + FileList *fileList=gd->getFiles(); if (fileList->count()>0) { Doxygen::indexList.addContentsItem(TRUE, @@ -3027,12 +3112,12 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) } // write examples - if (gd->exampleDict->count()>0) + if (gd->getExamples()->count()>0) { Doxygen::indexList.addContentsItem(TRUE, convertToHtml(theTranslator->trExamples(),TRUE),gd->getReference(), gd->getOutputFileBase(), 0); Doxygen::indexList.incContentsDepth(); - PageSDict::Iterator eli(*(gd->exampleDict)); + PageSDict::Iterator eli(*(gd->getExamples())); PageDef *pd=eli.toFirst(); while (pd) { @@ -3045,14 +3130,19 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) } ol.endIndexListItem(); - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } if (ftv) + { ftv->decContentsDepth(); + } //gd->visited=TRUE; } } -static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv) +static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex) { if (ftv) { @@ -3061,12 +3151,14 @@ static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv) } startIndexHierarchy(ol,0); if (Config_getBool("SORT_GROUP_NAMES")) + { Doxygen::groupSDict->sort(); + } GroupSDict::Iterator gli(*Doxygen::groupSDict); GroupDef *gd; for (gli.toFirst();(gd=gli.current());++gli) { - writeGroupTreeNode(ol,gd,0,ftv); + writeGroupTreeNode(ol,gd,0,ftv,addToIndex); } endIndexHierarchy(ol,0); if (ftv) @@ -3076,7 +3168,7 @@ static void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv) } //---------------------------------------------------------------------------- -static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv) +static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv,bool addToIndex) { if (level>20) { @@ -3093,8 +3185,11 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv dd->getFiles() && dd->getFiles()->count()>0 // there are files ); //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count()); - Doxygen::indexList.addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } if (ftv) { ftv->addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0); @@ -3120,12 +3215,12 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv DirDef *subdd = 0; for (dli.toFirst();(subdd=dli.current());++dli) { - writeDirTreeNode(ol,subdd,level+1,ftv); + writeDirTreeNode(ol,subdd,level+1,ftv,addToIndex); } endIndexHierarchy(ol,level+1); } - if (tocExpand) + if (tocExpand && addToIndex) { // write files of this directory FileList *fileList=dd->getFiles(); @@ -3144,12 +3239,17 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv } ol.endIndexListItem(); - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } if (ftv) + { ftv->decContentsDepth(); + } } -static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv) +static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv,bool addToIndex) { if (ftv) { @@ -3161,11 +3261,13 @@ static void writeDirHierarchy(OutputList &ol, FTVHelp* ftv) DirDef *dd; for (dli.toFirst();(dd=dli.current());++dli) { - if (dd->getOuterScope()==Doxygen::globalScope) writeDirTreeNode(ol,dd,0,ftv); + if (dd->getOuterScope()==Doxygen::globalScope) writeDirTreeNode(ol,dd,0,ftv,addToIndex); } endIndexHierarchy(ol,0); if (ftv) + { ol.popGeneratorState(); + } } //---------------------------------------------------------------------------- @@ -3177,19 +3279,19 @@ static void writeGroupIndex(OutputList &ol) ol.disable(OutputGenerator::Man); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Modules); QCString title = lne ? lne->title() : theTranslator->trModules(); + bool addToIndex = lne==0 || lne->visible(); + startFile(ol,"modules",0,title,HLI_Modules); startTitle(ol,0); - //QCString title = theTranslator->trModules(); - //if (!Config_getString("PROJECT_NAME").isEmpty()) - //{ - // title.prepend(Config_getString("PROJECT_NAME")+" "); - //} ol.parseText(title); endTitle(ol,0,0); ol.startContents(); ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"modules",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"modules",0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } ol.parseText(lne ? lne->intro() : theTranslator->trModulesDescription()); ol.endTextBlock(); @@ -3200,9 +3302,12 @@ static void writeGroupIndex(OutputList &ol) ftv = new FTVHelp(FALSE); } - writeGroupHierarchy(ol,ftv); + writeGroupHierarchy(ol,ftv,addToIndex); - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } if (ftv) { QGString outStr; @@ -3227,18 +3332,20 @@ static void writeDirIndex(OutputList &ol) ol.disable(OutputGenerator::Man); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Dirs); QCString title = lne ? lne->title() : theTranslator->trDirectories(); + bool addToIndex=lne==0 || lne->visible(); + startFile(ol,"dirs",0,title,HLI_Directories); startTitle(ol,0); - //if (!Config_getString("PROJECT_NAME").isEmpty()) - //{ - // title.prepend(Config_getString("PROJECT_NAME")+" "); - //} ol.parseText(title); endTitle(ol,0,0); ol.startContents(); ol.startTextBlock(); - Doxygen::indexList.addContentsItem(TRUE,title,0,"dirs",0,TRUE,TRUE); - Doxygen::indexList.incContentsDepth(); + + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,title,0,"dirs",0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + } ol.parseText(lne ? lne->intro() : theTranslator->trDirDescription()); ol.endTextBlock(); @@ -3249,7 +3356,7 @@ static void writeDirIndex(OutputList &ol) ftv = new FTVHelp(FALSE); } - writeDirHierarchy(ol,ftv); + writeDirHierarchy(ol,ftv,addToIndex); if (ftv) { @@ -3262,7 +3369,44 @@ static void writeDirIndex(OutputList &ol) ol.popGeneratorState(); delete ftv; } - Doxygen::indexList.decContentsDepth(); + if (addToIndex) + { + Doxygen::indexList.decContentsDepth(); + } + endFile(ol); + ol.popGeneratorState(); +} + +//---------------------------------------------------------------------------- + +static void writeUserGroupStubPage(OutputList &ol,LayoutNavEntry *lne) +{ + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + startFile(ol,lne->baseFile(),0,lne->title(),HLI_UserGroup); + startTitle(ol,0); + ol.parseText(lne->title()); + endTitle(ol,0,0); + QListIterator li(lne->children()); + LayoutNavEntry *entry; + int count=0; + for (li.toFirst();(entry=li.current());++li) + { + if (entry->visible()) count++; + } + if (count>0) + { + ol.writeString("\n"); + } endFile(ol); ol.popGeneratorState(); } @@ -3292,22 +3436,6 @@ static void writeIndex(OutputList &ol) projPrefix=Config_getString("PROJECT_NAME")+" "; } -#if 0 - { - QFile f(Config_getString("HTML_OUTPUT")+"/navindex.js"); - if (f.open(IO_WriteOnly)) - { - FTextStream t(&f); - t << "var NAVINDEX =" << endl; - LayoutNavEntry *layout = LayoutDocManager::instance().rootNavEntry(); - bool first=TRUE; - writeFullNavIndex(t,layout,0,first); - t << endl << "];" << endl; - t << endl << navindex_script; - } - } -#endif - //-------------------------------------------------------------------- // write HTML index //-------------------------------------------------------------------- @@ -3329,7 +3457,6 @@ static void writeIndex(OutputList &ol) } static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); - //QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index"; QCString indexName="index"; ol.startFile(indexName,0,title); @@ -3346,7 +3473,7 @@ static void writeIndex(OutputList &ol) ol.startQuickIndices(); if (!Config_getBool("DISABLE_INDEX")) { - ol.writeQuickLinks(TRUE,HLI_Main); + ol.writeQuickLinks(TRUE,HLI_Main,0); } ol.endQuickIndices(); if (generateTreeView) @@ -3381,23 +3508,11 @@ static void writeIndex(OutputList &ol) ol.endTitleHead(0,0); ol.endHeaderSection(); } + ol.startContents(); -#if 0 - // ol.newParagraph(); // FIXME:PARA - if (!Config_getString("PROJECT_NUMBER").isEmpty()) - { - ol.startProjectNumber(); - ol.parseDoc(defFileName,defLine, - Doxygen::mainPage,0, - Config_getString("PROJECT_NUMBER"), - TRUE,FALSE,0, - TRUE,FALSE); - ol.endProjectNumber(); - } -#endif if (Config_getBool("DISABLE_INDEX") && Doxygen::mainPage==0) { - ol.writeQuickLinks(FALSE,HLI_Main); + ol.writeQuickLinks(FALSE,HLI_Main,0); } if (Doxygen::mainPage) @@ -3654,6 +3769,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QListtitle().data(),lne->kind()); + bool addToIndex=lne==0 || lne->visible(); bool needsClosing=FALSE; if (!indexWritten.at(index)) { @@ -3673,7 +3789,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList0) + if (documentedNamespaces>0 && addToIndex) { Doxygen::indexList.addContentsItem(TRUE,lne->title(),0,0,0); Doxygen::indexList.incContentsDepth(); @@ -3695,7 +3811,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList0) + if (annotatedClasses>0 && addToIndex) { Doxygen::indexList.addContentsItem(TRUE,lne->title(),0,0,0); Doxygen::indexList.incContentsDepth(); @@ -3729,7 +3845,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList0) + if (documentedHtmlFiles>0 && addToIndex) { Doxygen::indexList.addContentsItem(TRUE,lne->title(),0,0,0); Doxygen::indexList.incContentsDepth(); @@ -3761,10 +3877,31 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QListtitle(),0,lne->baseFile(),0); + { + // prepend a ! or ^ marker to the URL to avoid tampering with it + QCString url = correctURL(lne->url(),"!"); // add ! to relative URL + if (!url.isEmpty() && url.at(0)!='!') // absolute URL + { + url.prepend("^"); // prepend ^ to absolute URL + } + bool isRef = lne->baseFile().left(4)=="@ref" || lne->baseFile().left(4)=="\\ref"; + Doxygen::indexList.addContentsItem(TRUE,lne->title(),0,url,0,FALSE,isRef); + } break; + case LayoutNavEntry::UserGroup: + if (addToIndex) + { + Doxygen::indexList.addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0,TRUE,TRUE); + Doxygen::indexList.incContentsDepth(); + needsClosing=TRUE; + } + writeUserGroupStubPage(ol,lne); + break; + } + if (kind!=LayoutNavEntry::User && kind!=LayoutNavEntry::UserGroup) // User entry may appear multiple times + { + indexWritten.at(index)=TRUE; } - indexWritten.at(index)=TRUE; } writeIndexHierarchyEntries(ol,lne->children()); if (needsClosing) @@ -3774,6 +3911,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList #include @@ -55,7 +56,8 @@ static bool elemIsVisible(const QXmlAttributes &attrib,bool defVal=TRUE) //--------------------------------------------------------------------------------- -LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind) const +LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind, + const char *file) const { LayoutNavEntry *result=0; QListIterator li(m_children); @@ -64,9 +66,9 @@ LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind) const { // depth first search, needed to find the entry furthest from the // root in case an entry is in the tree twice - result = entry->find(kind); + result = entry->find(kind,file); if (result) return result; - if (entry->kind()==kind) + if (entry->kind()==kind && (file==0 || entry->baseFile()==file)) { return entry; } @@ -74,6 +76,39 @@ LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind) const return result; } +QCString LayoutNavEntry::url() const +{ + QCString url = baseFile().stripWhiteSpace(); + if (kind()!=LayoutNavEntry::User) + { + url+=Doxygen::htmlFileExtension; + } + else if (url.left(5)=="@ref " || url.left(5)=="\\ref ") + { + Definition *d; + QCString anchor; + bool found=FALSE; + if (resolveLink(0,url.mid(5).stripWhiteSpace(),TRUE,&d,anchor)) + { + if (d && d->isLinkable()) + { + url=d->getOutputFileBase()+Doxygen::htmlFileExtension; + if (!anchor.isEmpty()) + { + url+="#"+anchor; + } + found=TRUE; + } + } + if (!found) + { + msg("warning: explicit link request to '%s' in layout file '%s' could not be resolved\n",qPrint(url.mid(5)),qPrint(Config_getString("LAYOUT_FILE"))); + } + } + //printf("LayoutNavEntry::url()=%s\n",url.data()); + return url; +} + //--------------------------------------------------------------------------------- class LayoutParser : public QXmlDefaultHandler @@ -771,13 +806,13 @@ class LayoutParser : public QXmlDefaultHandler { m_scope="navindex/"; m_rootNav = LayoutDocManager::instance().rootNavEntry(); - m_rootNav->clear(); + if (m_rootNav) m_rootNav->clear(); } void endNavIndex() { m_scope=""; - if (!m_rootNav->find(LayoutNavEntry::MainPage)) + if (m_rootNav && !m_rootNav->find(LayoutNavEntry::MainPage)) { // no MainPage node... add one the first item of the root node... new LayoutNavEntry(m_rootNav,LayoutNavEntry::MainPage, TRUE, @@ -923,6 +958,13 @@ class LayoutParser : public QXmlDefaultHandler QCString(), "user" }, + { "usergroup", + LayoutNavEntry::UserGroup, + QCString(), + QCString(), + QCString(), + "usergroup" + }, { 0, // end of list (LayoutNavEntry::Kind)0, QCString(), @@ -952,8 +994,9 @@ class LayoutParser : public QXmlDefaultHandler } else { - err("error: the type '%s' is not supported for the entry tag within a navindex! Check your layout file!\n"); + err("error: the type '%s' is not supported for the entry tag within a navindex! Check your layout file!\n",type.data()); } + m_invalidEntry=TRUE; return; } QCString baseFile = mapping[i].baseFile; @@ -978,6 +1021,10 @@ class LayoutParser : public QXmlDefaultHandler { baseFile=url; } + else if (kind==LayoutNavEntry::UserGroup) + { + baseFile+=QCString().sprintf("%d",m_userGroupCount++); + } // create new item and make it the new root m_rootNav = new LayoutNavEntry(m_rootNav,kind,kind==LayoutNavEntry::MainPage?TRUE:isVisible,baseFile,title,intro); } @@ -985,7 +1032,8 @@ class LayoutParser : public QXmlDefaultHandler void endNavEntry() { // set the root back to the parent - m_rootNav = m_rootNav->parent(); + if (m_rootNav && !m_invalidEntry) m_rootNav = m_rootNav->parent(); + m_invalidEntry=FALSE; } void startClass(const QXmlAttributes &) @@ -1142,15 +1190,19 @@ class LayoutParser : public QXmlDefaultHandler } private: - LayoutParser() : m_sHandler(163), m_eHandler(17) { } + LayoutParser() : m_sHandler(163), m_eHandler(17), m_invalidEntry(FALSE) { } QDict m_sHandler; QDict m_eHandler; QString m_scope; int m_part; LayoutNavEntry *m_rootNav; + bool m_invalidEntry; + static int m_userGroupCount; }; +int LayoutParser::m_userGroupCount=0; + //--------------------------------------------------------------------------------- class LayoutErrorHandler : public QXmlErrorHandler diff --git a/src/layout.h b/src/layout.h index 867a058..0b26690 100644 --- a/src/layout.h +++ b/src/layout.h @@ -127,7 +127,8 @@ struct LayoutNavEntry FileGlobals, Dirs, Examples, - User + User, + UserGroup }; LayoutNavEntry(LayoutNavEntry *parent,Kind k,bool vs,const QCString &bf, const QCString &tl,const QCString &intro,bool prepend=FALSE) @@ -140,12 +141,13 @@ struct LayoutNavEntry QCString baseFile() const { return m_baseFile; } QCString title() const { return m_title; } QCString intro() const { return m_intro; } + QCString url() const; bool visible() { return m_visible; } void clear() { m_children.clear(); } void addChild(LayoutNavEntry *e) { m_children.append(e); } void prependChild(LayoutNavEntry *e) { m_children.prepend(e); } const QList &children() const { return m_children; } - LayoutNavEntry *find(LayoutNavEntry::Kind k) const; + LayoutNavEntry *find(LayoutNavEntry::Kind k,const char *file=0) const; private: LayoutNavEntry() : m_parent(0) {} diff --git a/src/mangen.cpp b/src/mangen.cpp index 88bfba3..c44044b 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -524,7 +524,7 @@ void ManGenerator::endAnonTypeScope(int indentLevel) } -void ManGenerator::startMemberItem(int) +void ManGenerator::startMemberItem(const char *,int) { if (firstCol && !insideTabbing) t << ".in +1c\n"; t << "\n.ti -1c\n.RI \""; diff --git a/src/mangen.h b/src/mangen.h index c2c1ba2..d7c58a5 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -111,10 +111,10 @@ class ManGenerator : public OutputGenerator void endInlineHeader(); void startAnonTypeScope(int); void endAnonTypeScope(int); - void startMemberItem(int); + void startMemberItem(const char *,int); void endMemberItem(); void startMemberTemplateParams() {} - void endMemberTemplateParams() {} + void endMemberTemplateParams(const char *) {} void startMemberGroupHeader(bool); void endMemberGroupHeader(); @@ -158,7 +158,7 @@ class ManGenerator : public OutputGenerator void endCenter() {} void startSmall() {} void endSmall() {} - void startMemberDescription() { t << "\n.RI \"\\fI"; firstCol=FALSE; } + void startMemberDescription(const char *) { t << "\n.RI \"\\fI"; firstCol=FALSE; } void endMemberDescription() { t << "\\fP\""; firstCol=FALSE; } void startDescList(SectionTypes); void endDescList() {} @@ -183,7 +183,7 @@ class ManGenerator : public OutputGenerator void endQuickIndices() {} void writeSplitBar(const char *) {} void writeLogo() {} - void writeQuickLinks(bool,HighlightedItem) {} + void writeQuickLinks(bool,HighlightedItem,const char *) {} void startContents() {} void endContents() {} void writeNonBreakableSpace(int n) { int i; for (i=0;iisObjCMethod()?"dummy":0); + ol.startParameterType(first,0); paramTypeStarted=TRUE; if (isDefine) { @@ -1306,6 +1306,7 @@ void MemberDef::writeDeclaration(OutputList &ol, } QCString cname = d->name(); + QCString cdname = d->displayName(); QCString cfname = getOutputFileBase(); //QCString osname = cname; // in case of class members that are put in a group the name of the outerscope @@ -1322,14 +1323,17 @@ void MemberDef::writeDeclaration(OutputList &ol, // start a new member declaration bool isAnonymous = annoClassDef || m_impl->annMemb || m_impl->annEnumType; ///printf("startMemberItem for %s\n",name().data()); - ol.startMemberItem( isAnonymous ? 1 : m_impl->tArgList ? 3 : 0); + ol.startMemberItem( anchor(), isAnonymous ? 1 : m_impl->tArgList ? 3 : 0); // If there is no detailed description we need to write the anchor here. bool detailsVisible = isDetailedSectionLinkable(); if (!detailsVisible && !m_impl->annMemb) { QCString doxyName=name().copy(); - if (!cname.isEmpty()) doxyName.prepend(cname+"::"); + if (!cname.isEmpty()) + { + doxyName.prepend(cdname+getLanguageSpecificSeparator(getLanguage())); + } QCString doxyArgs=argsString(); ol.startDoxyAnchor(cfname,cname,anchor(),doxyName,doxyArgs); @@ -1354,7 +1358,7 @@ void MemberDef::writeDeclaration(OutputList &ol, { if (!isAnonymous) ol.startMemberTemplateParams(); writeTemplatePrefix(ol,m_impl->tArgList); - if (!isAnonymous) ol.endMemberTemplateParams(); + if (!isAnonymous) ol.endMemberTemplateParams(anchor()); } // *** write type @@ -1378,7 +1382,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ol.startAnonTypeScope(s_indentLevel++); annoClassDef->writeDeclaration(ol,m_impl->annMemb,inGroup); //printf(">>>>>>>>>>>>>> startMemberItem(2)\n"); - ol.startMemberItem(2); + ol.startMemberItem(anchor(),2); int j; for (j=0;j< s_indentLevel-1;j++) { @@ -1644,7 +1648,7 @@ void MemberDef::writeDeclaration(OutputList &ol, /* && !annMemb */ ) { - ol.startMemberDescription(); + ol.startMemberDescription(anchor()); ol.parseDoc(briefFile(),briefLine(), getOuterScope()?getOuterScope():d,this,briefDescription(), TRUE,FALSE,0,TRUE,FALSE); @@ -1791,16 +1795,18 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, KEEP_RESIDENT_DURING_CALL; SrcLangExt lang = getLanguage(); + //printf("member=%s lang=%d\n",name().data(),lang); bool optVhdl = lang==SrcLangExt_VHDL; + QCString sep = getLanguageSpecificSeparator(lang); QCString scopeName = scName; QCString memAnchor = anchor(); QCString ciname = container->name(); if (container->definitionType()==TypeGroup) { - if (getClassDef()) scopeName=getClassDef()->name(); - else if (getNamespaceDef()) scopeName=getNamespaceDef()->name(); - else if (getFileDef()) scopeName=getFileDef()->name(); + if (getClassDef()) scopeName=getClassDef()->displayName(); + else if (getNamespaceDef()) scopeName=getNamespaceDef()->displayName(); + else if (getFileDef()) scopeName=getFileDef()->displayName(); ciname = ((GroupDef *)container)->groupTitle(); } else if (container->definitionType()==TypeFile && getNamespaceDef()) @@ -1809,14 +1815,17 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, memAnchor.prepend("file_"); } - QCString cname = container->name(); - QCString cfname = getOutputFileBase(); + QCString cname = container->name(); + QCString cfname = getOutputFileBase(); QCString cfiname = container->getOutputFileBase(); // get member name QCString doxyName=name(); // prepend scope if there is any. TODO: make this optional for C only docs - if (scopeName) doxyName.prepend((QCString)scopeName+"::"); + if (!scopeName.isEmpty()) + { + doxyName.prepend(scopeName+sep); + } QCString doxyArgs=argsString(); QCString ldef = definition(); @@ -1985,7 +1994,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } else { - linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),ldef); + linkifyText(TextGeneratorOLImpl(ol),container,getBodyDef(),name(),substitute(ldef,"::",sep)); hasParameterList=writeDefArgumentList(ol,cd,scopeName,this); } diff --git a/src/memberdef.h b/src/memberdef.h index 548410e..5ec91b3 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -237,6 +237,8 @@ class MemberDef : public Definition ClassDef *category() const; + QCString displayName() const { return Definition::name(); } + //----------------------------------------------------------------------------------- // ---- setters ----- //----------------------------------------------------------------------------------- diff --git a/src/memberlist.cpp b/src/memberlist.cpp index b98d86f..f35f5b7 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -319,14 +319,14 @@ void MemberList::writePlainDeclarations(OutputList &ol, ol.startMemberList(); first=FALSE; } - ol.startMemberItem(0); + ol.startMemberItem(md->anchor(),0); ol.writeString("enum "); ol.insertMemberAlign(); md->writeEnumDeclaration(ol,cd,nd,fd,gd); ol.endMemberItem(); if (!md->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startMemberDescription(); + ol.startMemberDescription(md->anchor()); ol.parseDoc( md->briefFile(),md->briefLine(), cd,md, diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 7a51f14..18d2801 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -591,7 +591,7 @@ void NamespaceDef::writeMemberPages(OutputList &ol) { if (ml->listType()&MemberList::documentationLists) { - ml->writeDocumentationPage(ol,name(),this); + ml->writeDocumentationPage(ol,displayName(),this); } } ol.popGeneratorState(); @@ -836,7 +836,7 @@ void NamespaceSDict::writeDeclaration(OutputList &ol,const char *title,bool loca if (nd->isLinkable()) { SrcLangExt lang = nd->getLanguage(); - ol.startMemberItem(0); + ol.startMemberItem(nd->getOutputFileBase(),0); if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp) { ol.docify("package "); @@ -867,8 +867,8 @@ void NamespaceSDict::writeDeclaration(OutputList &ol,const char *title,bool loca ol.endMemberItem(); if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { - ol.startMemberDescription(); - ol.parseDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE); + ol.startMemberDescription(nd->getOutputFileBase()); + ol.parseDoc(nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription(),FALSE,FALSE,0,TRUE); ol.endMemberDescription(); } } @@ -950,7 +950,7 @@ void NamespaceDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType l void NamespaceDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title) { MemberList * ml = getMemberList(lt); - if (ml) ml->writeDocumentation(ol,name(),this,title); + if (ml) ml->writeDocumentation(ol,displayName(),this,title); } diff --git a/src/navtree.js b/src/navtree.js index f3c0380..b0c4936 100644 --- a/src/navtree.js +++ b/src/navtree.js @@ -26,80 +26,54 @@ function getScript(scriptName,func,show) function createIndent(o,domNode,node,level) { - if (node.parentNode && node.parentNode.parentNode) - { + if (node.parentNode && node.parentNode.parentNode) { createIndent(o,domNode,node.parentNode,level+1); } var imgNode = document.createElement("img"); imgNode.width = 16; imgNode.height = 22; - if (level==0 && node.childrenData) - { + if (level==0 && node.childrenData) { node.plus_img = imgNode; node.expandToggle = document.createElement("a"); node.expandToggle.href = "javascript:void(0)"; - node.expandToggle.onclick = function() - { - if (node.expanded) - { + node.expandToggle.onclick = function() { + if (node.expanded) { $(node.getChildrenUL()).slideUp("fast"); - if (node.isLast) - { + if (node.isLast) { node.plus_img.src = node.relpath+"ftv2plastnode.png"; - } - else - { + } else { node.plus_img.src = node.relpath+"ftv2pnode.png"; } node.expanded = false; - } - else - { + } else { expandNode(o, node, false, false); } } node.expandToggle.appendChild(imgNode); domNode.appendChild(node.expandToggle); - } - else - { + } else { domNode.appendChild(imgNode); } - if (level==0) - { - if (node.isLast) - { - if (node.childrenData) - { + if (level==0) { + if (node.isLast) { + if (node.childrenData) { imgNode.src = node.relpath+"ftv2plastnode.png"; - } - else - { + } else { imgNode.src = node.relpath+"ftv2lastnode.png"; domNode.appendChild(imgNode); } - } - else - { - if (node.childrenData) - { + } else { + if (node.childrenData) { imgNode.src = node.relpath+"ftv2pnode.png"; - } - else - { + } else { imgNode.src = node.relpath+"ftv2node.png"; domNode.appendChild(imgNode); } } - } - else - { - if (node.isLast) - { + } else { + if (node.isLast) { imgNode.src = node.relpath+"ftv2blank.png"; - } - else - { + } else { imgNode.src = node.relpath+"ftv2vertline.png"; } } @@ -134,37 +108,45 @@ function newNode(o, po, text, link, childrenData, lastNode) node.label = document.createTextNode(text); node.expanded = false; a.appendChild(node.label); - if (link) - { + if (link) { + var url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } a.className = stripPath(link.replace('#',':')); - if (link.indexOf('#')!=-1) - { + if (link.indexOf('#')!=-1) { var aname = '#'+link.split('#')[1]; var srcPage = stripPath($(location).attr('pathname')); var targetPage = stripPath(link.split('#')[0]); - a.href = srcPage!=targetPage ? node.relpath+link : '#'; + a.href = srcPage!=targetPage ? url : '#'; a.onclick = function(){ $('.item').removeClass('selected'); $('.item').removeAttr('id'); $(a).parent().parent().addClass('selected'); $(a).parent().parent().attr('id','selected'); - var anchor = $(aname); - $("#doc-content").animate({ - scrollTop: anchor.position().top + - $('#doc-content').scrollTop() - - $('#doc-content').offset().top - },500,function(){ + var pos, anchor = $(aname), docContent = $('#doc-content'); + if (anchor.parent().attr('class')=='memItemLeft') { + pos = anchor.parent().position().top; + } else { + pos = anchor.position().top; + } + var dist = Math.abs(Math.min( + pos-docContent.offset().top, + docContent[0].scrollHeight- + docContent.height()-docContent.scrollTop())); + docContent.animate({ + scrollTop: pos + docContent.scrollTop() - docContent.offset().top + },Math.max(50,Math.min(500,dist)),function(){ window.location.replace(aname); }); }; + } else { + a.href = url; } - else - { - a.href = node.relpath+link; - } - } - else - { + } else { if (childrenData != null) { a.className = "nolink"; @@ -174,10 +156,8 @@ function newNode(o, po, text, link, childrenData, lastNode) } node.childrenUL = null; - node.getChildrenUL = function() - { - if (!node.childrenUL) - { + node.getChildrenUL = function() { + if (!node.childrenUL) { node.childrenUL = document.createElement("ul"); node.childrenUL.className = "children_ul"; node.childrenUL.style.display = "none"; @@ -205,36 +185,24 @@ function showRoot() function expandNode(o, node, imm, showRoot) { - if (node.childrenData && !node.expanded) - { - if (typeof(node.childrenData)==='string') - { + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { var varName = node.childrenData; getScript(node.relpath+varName,function(){ node.childrenData = getData(varName); expandNode(o, node, imm, showRoot); }, showRoot); - } - else - { - if (!node.childrenVisited) - { + } else { + if (!node.childrenVisited) { getNode(o, node); - } - if (imm) - { + } if (imm) { $(node.getChildrenUL()).show(); - } - else - { + } else { $(node.getChildrenUL()).slideDown("fast"); } - if (node.isLast) - { + if (node.isLast) { node.plus_img.src = node.relpath+"ftv2mlastnode.png"; - } - else - { + } else { node.plus_img.src = node.relpath+"ftv2mnode.png"; } node.expanded = true; @@ -244,72 +212,53 @@ function expandNode(o, node, imm, showRoot) function showNode(o, node, index) { - if (node.childrenData && !node.expanded) - { - if (typeof(node.childrenData)==='string') - { + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { var varName = node.childrenData; getScript(node.relpath+varName,function(){ node.childrenData = getData(varName); showNode(o,node,index); },true); - } - else - { - if (!node.childrenVisited) - { + } else { + if (!node.childrenVisited) { getNode(o, node); } $(node.getChildrenUL()).show(); - if (node.isLast) - { + if (node.isLast) { node.plus_img.src = node.relpath+"ftv2mlastnode.png"; - } - else - { + } else { node.plus_img.src = node.relpath+"ftv2mnode.png"; } node.expanded = true; var n = node.children[o.breadcrumbs[index]]; - if (index+11){ var anchor = $(window.location.hash); - var targetDiv = anchor.next(); - $(targetDiv).children('.memproto,.memdoc').effect("highlight",{},1500); - var docContent = $('#doc-content'); - if (docContent && anchor && anchor[0] && anchor[0].ownerDocument){ - docContent.scrollTop(anchor.position().top+docContent.scrollTop()-docContent.offset().top); + if (anchor.parent().attr('class')=='memItemLeft'){ + var rows = $('.memberdecls tr[class$=\""'+ + window.location.hash.substring(1)+'"\"]').children(); + rows.effect('highlight',{},1500); + } else { + var targetDiv = anchor.next(); + $(targetDiv).children('.memproto,.memdoc').effect("highlight",{},1500); } var a; if ($(location).attr('hash')){ @@ -385,9 +335,6 @@ function initNavTree(toroot,relpath) var targetDiv = anchor.next(); showRoot(); } - } else { - var docContent = $('#doc-content'); - if (docContent){ docContent.scrollTop(0); } } }) diff --git a/src/navtree_js.h b/src/navtree_js.h index 2ad1fc1..c231b6b 100644 --- a/src/navtree_js.h +++ b/src/navtree_js.h @@ -26,80 +26,54 @@ "\n" "function createIndent(o,domNode,node,level)\n" "{\n" -" if (node.parentNode && node.parentNode.parentNode)\n" -" {\n" +" if (node.parentNode && node.parentNode.parentNode) {\n" " createIndent(o,domNode,node.parentNode,level+1);\n" " }\n" " var imgNode = document.createElement(\"img\");\n" " imgNode.width = 16;\n" " imgNode.height = 22;\n" -" if (level==0 && node.childrenData)\n" -" {\n" +" if (level==0 && node.childrenData) {\n" " node.plus_img = imgNode;\n" " node.expandToggle = document.createElement(\"a\");\n" " node.expandToggle.href = \"javascript:void(0)\";\n" -" node.expandToggle.onclick = function() \n" -" {\n" -" if (node.expanded) \n" -" {\n" +" node.expandToggle.onclick = function() {\n" +" if (node.expanded) {\n" " $(node.getChildrenUL()).slideUp(\"fast\");\n" -" if (node.isLast)\n" -" {\n" +" if (node.isLast) {\n" " node.plus_img.src = node.relpath+\"ftv2plastnode.png\";\n" -" }\n" -" else\n" -" {\n" +" } else {\n" " node.plus_img.src = node.relpath+\"ftv2pnode.png\";\n" " }\n" " node.expanded = false;\n" -" } \n" -" else \n" -" {\n" +" } else {\n" " expandNode(o, node, false, false);\n" " }\n" " }\n" " node.expandToggle.appendChild(imgNode);\n" " domNode.appendChild(node.expandToggle);\n" -" }\n" -" else\n" -" {\n" +" } else {\n" " domNode.appendChild(imgNode);\n" " }\n" -" if (level==0)\n" -" {\n" -" if (node.isLast)\n" -" {\n" -" if (node.childrenData)\n" -" {\n" +" if (level==0) {\n" +" if (node.isLast) {\n" +" if (node.childrenData) {\n" " imgNode.src = node.relpath+\"ftv2plastnode.png\";\n" -" }\n" -" else\n" -" {\n" +" } else {\n" " imgNode.src = node.relpath+\"ftv2lastnode.png\";\n" " domNode.appendChild(imgNode);\n" " }\n" -" }\n" -" else\n" -" {\n" -" if (node.childrenData)\n" -" {\n" +" } else {\n" +" if (node.childrenData) {\n" " imgNode.src = node.relpath+\"ftv2pnode.png\";\n" -" }\n" -" else\n" -" {\n" +" } else {\n" " imgNode.src = node.relpath+\"ftv2node.png\";\n" " domNode.appendChild(imgNode);\n" " }\n" " }\n" -" }\n" -" else\n" -" {\n" -" if (node.isLast)\n" -" {\n" +" } else {\n" +" if (node.isLast) {\n" " imgNode.src = node.relpath+\"ftv2blank.png\";\n" -" }\n" -" else\n" -" {\n" +" } else {\n" " imgNode.src = node.relpath+\"ftv2vertline.png\";\n" " }\n" " }\n" @@ -134,37 +108,45 @@ " node.label = document.createTextNode(text);\n" " node.expanded = false;\n" " a.appendChild(node.label);\n" -" if (link) \n" -" {\n" +" if (link) {\n" +" var url;\n" +" if (link.substring(0,1)=='^') {\n" +" url = link.substring(1);\n" +" link = url;\n" +" } else {\n" +" url = node.relpath+link;\n" +" }\n" " a.className = stripPath(link.replace('#',':'));\n" -" if (link.indexOf('#')!=-1)\n" -" {\n" +" if (link.indexOf('#')!=-1) {\n" " var aname = '#'+link.split('#')[1];\n" " var srcPage = stripPath($(location).attr('pathname'));\n" " var targetPage = stripPath(link.split('#')[0]);\n" -" a.href = srcPage!=targetPage ? node.relpath+link : '#';\n" +" a.href = srcPage!=targetPage ? url : '#';\n" " a.onclick = function(){\n" " $('.item').removeClass('selected');\n" " $('.item').removeAttr('id');\n" " $(a).parent().parent().addClass('selected');\n" " $(a).parent().parent().attr('id','selected');\n" -" var anchor = $(aname);\n" -" $(\"#doc-content\").animate({\n" -" scrollTop: anchor.position().top +\n" -" $('#doc-content').scrollTop() -\n" -" $('#doc-content').offset().top\n" -" },500,function(){\n" +" var pos, anchor = $(aname), docContent = $('#doc-content');\n" +" if (anchor.parent().attr('class')=='memItemLeft') {\n" +" pos = anchor.parent().position().top;\n" +" } else {\n" +" pos = anchor.position().top;\n" +" }\n" +" var dist = Math.abs(Math.min(\n" +" pos-docContent.offset().top,\n" +" docContent[0].scrollHeight-\n" +" docContent.height()-docContent.scrollTop()));\n" +" docContent.animate({\n" +" scrollTop: pos + docContent.scrollTop() - docContent.offset().top\n" +" },Math.max(50,Math.min(500,dist)),function(){\n" " window.location.replace(aname);\n" " });\n" " };\n" +" } else {\n" +" a.href = url;\n" " }\n" -" else\n" -" {\n" -" a.href = node.relpath+link;\n" -" }\n" -" } \n" -" else \n" -" {\n" +" } else {\n" " if (childrenData != null) \n" " {\n" " a.className = \"nolink\";\n" @@ -174,10 +156,8 @@ " }\n" "\n" " node.childrenUL = null;\n" -" node.getChildrenUL = function() \n" -" {\n" -" if (!node.childrenUL) \n" -" {\n" +" node.getChildrenUL = function() {\n" +" if (!node.childrenUL) {\n" " node.childrenUL = document.createElement(\"ul\");\n" " node.childrenUL.className = \"children_ul\";\n" " node.childrenUL.style.display = \"none\";\n" @@ -205,36 +185,24 @@ "\n" "function expandNode(o, node, imm, showRoot)\n" "{\n" -" if (node.childrenData && !node.expanded) \n" -" {\n" -" if (typeof(node.childrenData)==='string')\n" -" {\n" +" if (node.childrenData && !node.expanded) {\n" +" if (typeof(node.childrenData)==='string') {\n" " var varName = node.childrenData;\n" " getScript(node.relpath+varName,function(){\n" " node.childrenData = getData(varName);\n" " expandNode(o, node, imm, showRoot);\n" " }, showRoot);\n" -" }\n" -" else\n" -" {\n" -" if (!node.childrenVisited) \n" -" {\n" +" } else {\n" +" if (!node.childrenVisited) {\n" " getNode(o, node);\n" -" }\n" -" if (imm)\n" -" {\n" +" } if (imm) {\n" " $(node.getChildrenUL()).show();\n" -" } \n" -" else \n" -" {\n" +" } else {\n" " $(node.getChildrenUL()).slideDown(\"fast\");\n" " }\n" -" if (node.isLast)\n" -" {\n" +" if (node.isLast) {\n" " node.plus_img.src = node.relpath+\"ftv2mlastnode.png\";\n" -" }\n" -" else\n" -" {\n" +" } else {\n" " node.plus_img.src = node.relpath+\"ftv2mnode.png\";\n" " }\n" " node.expanded = true;\n" @@ -244,72 +212,53 @@ "\n" "function showNode(o, node, index)\n" "{\n" -" if (node.childrenData && !node.expanded) \n" -" {\n" -" if (typeof(node.childrenData)==='string')\n" -" {\n" +" if (node.childrenData && !node.expanded) {\n" +" if (typeof(node.childrenData)==='string') {\n" " var varName = node.childrenData;\n" " getScript(node.relpath+varName,function(){\n" " node.childrenData = getData(varName);\n" " showNode(o,node,index);\n" " },true);\n" -" }\n" -" else\n" -" {\n" -" if (!node.childrenVisited) \n" -" {\n" +" } else {\n" +" if (!node.childrenVisited) {\n" " getNode(o, node);\n" " }\n" " $(node.getChildrenUL()).show();\n" -" if (node.isLast)\n" -" {\n" +" if (node.isLast) {\n" " node.plus_img.src = node.relpath+\"ftv2mlastnode.png\";\n" -" }\n" -" else\n" -" {\n" +" } else {\n" " node.plus_img.src = node.relpath+\"ftv2mnode.png\";\n" " }\n" " node.expanded = true;\n" " var n = node.children[o.breadcrumbs[index]];\n" -" if (index+11){\n" " var anchor = $(window.location.hash);\n" -" var targetDiv = anchor.next();\n" -" $(targetDiv).children('.memproto,.memdoc').effect(\"highlight\",{},1500);\n" -" var docContent = $('#doc-content');\n" -" if (docContent && anchor && anchor[0] && anchor[0].ownerDocument){\n" -" docContent.scrollTop(anchor.position().top+docContent.scrollTop()-docContent.offset().top);\n" +" if (anchor.parent().attr('class')=='memItemLeft'){\n" +" var rows = $('.memberdecls tr[class$=\\\"\"'+\n" +" window.location.hash.substring(1)+'\"\\\"]').children();\n" +" rows.effect('highlight',{},1500);\n" +" } else {\n" +" var targetDiv = anchor.next();\n" +" $(targetDiv).children('.memproto,.memdoc').effect(\"highlight\",{},1500);\n" " }\n" " var a;\n" " if ($(location).attr('hash')){\n" @@ -385,9 +335,6 @@ " var targetDiv = anchor.next();\n" " showRoot();\n" " }\n" -" } else {\n" -" var docContent = $('#doc-content');\n" -" if (docContent){ docContent.scrollTop(0); }\n" " }\n" " })\n" "\n" diff --git a/src/outputgen.h b/src/outputgen.h index 740940e..ba77605 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -340,10 +340,10 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endInlineHeader() = 0; virtual void startAnonTypeScope(int) = 0; virtual void endAnonTypeScope(int) = 0; - virtual void startMemberItem(int) = 0; + virtual void startMemberItem(const char *,int) = 0; virtual void endMemberItem() = 0; virtual void startMemberTemplateParams() = 0; - virtual void endMemberTemplateParams() = 0; + virtual void endMemberTemplateParams(const char *) = 0; virtual void startMemberGroupHeader(bool) = 0; virtual void endMemberGroupHeader() = 0; virtual void startMemberGroupDocs() = 0; @@ -362,7 +362,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name) = 0; virtual void writeEndAnnoItem(const char *name) = 0; - virtual void startMemberDescription() = 0; + virtual void startMemberDescription(const char *anchor) = 0; virtual void endMemberDescription() = 0; virtual void startIndent() = 0; virtual void endIndent() = 0; @@ -384,7 +384,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endQuickIndices() = 0; virtual void writeSplitBar(const char *) = 0; virtual void writeLogo() = 0; - virtual void writeQuickLinks(bool compact,HighlightedItem hli) = 0; + virtual void writeQuickLinks(bool compact,HighlightedItem hli,const char *file) = 0; virtual void startContents() = 0; virtual void endContents() = 0; virtual void startTextBlock(bool) = 0; @@ -394,7 +394,7 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endMemberDocPrefixItem() = 0; virtual void startMemberDocName(bool) = 0; virtual void endMemberDocName() = 0; - virtual void startParameterType(bool,const char *) = 0; + virtual void startParameterType(bool,const char *key) = 0; virtual void endParameterType() = 0; virtual void startParameterName(bool) = 0; virtual void endParameterName(bool,bool,bool) = 0; diff --git a/src/outputlist.cpp b/src/outputlist.cpp index 57f4f67..738d540 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -289,16 +289,17 @@ FORALL1(SectionTypes a1,a1) FORALL1(bool a1,a1) FORALL2(bool a1,int a2,a1,a2) FORALL2(bool a1,bool a2,a1,a2) +FORALL2(const char *a1,bool a2,a1,a2) FORALL4(const char *a1,const char *a2,const char *a3,bool a4,a1,a2,a3,a4) #endif FORALL2(int a1,bool a2,a1,a2) -FORALL2(bool a1,HighlightedItem a2,a1,a2) FORALL2(bool a1,const char *a2,a1,a2) FORALL2(ParamListTypes a1,const char *a2,a1,a2) FORALL1(IndexSections a1,a1) FORALL2(const char *a1,const char *a2,a1,a2) -FORALL2(const char *a1,bool a2,a1,a2) +FORALL2(const char *a1,int a2,a1,a2) FORALL2(const char *a1,SectionInfo::SectionType a2,a1,a2) +FORALL3(bool a1,HighlightedItem a2,const char *a3,a1,a2,a3) FORALL3(bool a1,bool a2,bool a3,a1,a2,a3) FORALL3(const ClassDiagram &a1,const char *a2,const char *a3,a1,a2,a3) FORALL3(const char *a1,const char *a2,const char *a3,a1,a2,a3) diff --git a/src/outputlist.h b/src/outputlist.h index e832175..2e863e3 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -201,14 +201,14 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startAnonTypeScope,i1); } void endAnonTypeScope(int i1) { forall(&OutputGenerator::endAnonTypeScope,i1); } - void startMemberItem(int i1) - { forall(&OutputGenerator::startMemberItem,i1); } + void startMemberItem(const char *anchor,int i1) + { forall(&OutputGenerator::startMemberItem,anchor,i1); } void endMemberItem() { forall(&OutputGenerator::endMemberItem); } void startMemberTemplateParams() { forall(&OutputGenerator::startMemberTemplateParams); } - void endMemberTemplateParams() - { forall(&OutputGenerator::endMemberTemplateParams); } + void endMemberTemplateParams(const char *anchor) + { forall(&OutputGenerator::endMemberTemplateParams,anchor); } void startMemberGroupHeader(bool b) { forall(&OutputGenerator::startMemberGroupHeader,b); } void endMemberGroupHeader() @@ -295,8 +295,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startBold); } void endBold() { forall(&OutputGenerator::endBold); } - void startMemberDescription() - { forall(&OutputGenerator::startMemberDescription); } + void startMemberDescription(const char *anchor) + { forall(&OutputGenerator::startMemberDescription,anchor); } void endMemberDescription() { forall(&OutputGenerator::endMemberDescription); } void startSimpleSect(SectionTypes t,const char *file,const char *anchor, @@ -338,8 +338,8 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::writeSplitBar,name); } void writeLogo() { forall(&OutputGenerator::writeLogo); } - void writeQuickLinks(bool compact,HighlightedItem hli) - { forall(&OutputGenerator::writeQuickLinks,compact,hli); } + void writeQuickLinks(bool compact,HighlightedItem hli,const char *file) + { forall(&OutputGenerator::writeQuickLinks,compact,hli,file); } void startContents() { forall(&OutputGenerator::startContents); } void endContents() @@ -489,15 +489,16 @@ class OutputList : public OutputDocInterface FORALLPROTO1(bool); FORALLPROTO2(bool,int); FORALLPROTO2(bool,bool); + FORALLPROTO2(const char *,bool); FORALLPROTO4(const char *,const char *,const char *,int); #endif FORALLPROTO2(int,bool); - FORALLPROTO2(bool,HighlightedItem); FORALLPROTO2(bool,const char *); FORALLPROTO2(ParamListTypes,const char *); FORALLPROTO2(const char *,const char *); - FORALLPROTO2(const char *,bool); + FORALLPROTO2(const char *,int); FORALLPROTO2(const char *,SectionInfo::SectionType); + FORALLPROTO3(bool,HighlightedItem,const char *); FORALLPROTO3(bool,bool,bool); FORALLPROTO3(const char *,const char *,bool); FORALLPROTO3(const char *,const char *,SectionInfo::SectionType); diff --git a/src/pagedef.h b/src/pagedef.h index b0c24d4..136a997 100644 --- a/src/pagedef.h +++ b/src/pagedef.h @@ -52,6 +52,7 @@ class PageDef : public Definition bool hasParentPage() const; void setPageScope(Definition *d){ m_pageScope = d; } Definition *getPageScope() const { return m_pageScope; } + QCString displayName() const { return !m_title.isEmpty() ? m_title : Definition::name(); } private: void setNestingLevel(int l); diff --git a/src/portable.cpp b/src/portable.cpp index 6dadcd1..f2d1166 100644 --- a/src/portable.cpp +++ b/src/portable.cpp @@ -2,6 +2,7 @@ #include #if defined(_WIN32) && !defined(__CYGWIN__) #undef UNICODE +#define _WIN32_DCOM #include #else #include diff --git a/src/pre.l b/src/pre.l index 20a9938..fea32f8 100644 --- a/src/pre.l +++ b/src/pre.l @@ -63,19 +63,28 @@ struct FileState QCString fileName; }; -/** @brief Singleton that manages the defines available while proprocessing files. */ +/** @brief Singleton that manages the defines available while + * proprocessing files. + */ class DefineManager { + /** Local class used to hold the defines for a single file */ class DefinesPerFile { public: + /** Creates an empty container for defines */ DefinesPerFile() : m_defines(257), m_includedFiles(17) { m_defines.setAutoDelete(TRUE); } + /** Destroys the object */ virtual ~DefinesPerFile() { } + /** Adds a define in the context of a file. Will replace + * an existing define with the same name (redefinition) + * @param def The Define object to add. + */ void addDefine(Define *def) { Define *d = m_defines.find(def->name); @@ -85,6 +94,9 @@ class DefineManager } m_defines.insert(def->name,def); } + /** Adds an include file for this file + * @param fileName The name of the include file + */ void addInclude(const char *fileName) { m_includedFiles.insert(fileName,(void*)0x8); @@ -97,26 +109,48 @@ class DefineManager public: friend class DefinesPerFile; + /** Returns a reference to the singleton */ static DefineManager &instance() { if (theInstance==0) theInstance = new DefineManager; return *theInstance; } + /** Deletes the singleton */ static void deleteInstance() { delete theInstance; theInstance = 0; } - void startContext() + /** Starts a context in which defines are collected. + * Called at the start of a new file that is preprocessed. + * @param fileName the name of the file to process. + */ + void startContext(const char *fileName) { //printf("DefineManager::startContext()\n"); m_contextDefines.clear(); + if (fileName==0) return; + DefinesPerFile *dpf = m_fileMap.find(fileName); + if (dpf==0) + { + //printf("New file!\n"); + dpf = new DefinesPerFile; + m_fileMap.insert(fileName,dpf); + } } + /** Ends the context started with startContext() freeing any + * defines collected within in this context. + */ void endContext() { //printf("DefineManager::endContext()\n"); m_contextDefines.clear(); } + /** Add an included file to the current context. + * If the file has been pre-processed already, all defines are added + * to the context. + * @param fileName The name of the include file to add to the context. + */ void addFileToContext(const char *fileName) { if (fileName==0) return; @@ -135,6 +169,11 @@ class DefineManager dpf->collectDefines(&m_contextDefines,includeStack); } } + + /** Add a define to the manager object. + * @param fileName The file in which the define was found + * @param def The Define object to add. + */ void addDefine(const char *fileName,Define *def) { if (fileName==0) return; @@ -153,6 +192,11 @@ class DefineManager } dpf->addDefine(def); } + + /** Add an include relation to the manager object. + * @param fromFileName file name in which the include was found. + * @param toFileName file name that is included. + */ void addInclude(const char *fromFileName,const char *toFileName) { //printf("DefineManager::addInclude(%s,%s)\n",fromFileName,toFileName); @@ -164,16 +208,22 @@ class DefineManager } dpf->addInclude(toFileName); } + /** Returns a Define object given its name or 0 if the Define does + * not exist. + */ Define *isDefined(const char *name) const { return m_contextDefines.find(name); } + /** Returns a reference to the defines found in the current context. */ const DefineDict &defineContext() const { return m_contextDefines; } private: static DefineManager *theInstance; + + /** Helper function to collect all define for a given file */ void collectDefinesForFile(const char *fileName,DefineDict *dict) { if (fileName==0) return; @@ -184,25 +234,41 @@ class DefineManager dpf->collectDefines(dict,includeStack); } } + + /** Helper function to return the DefinesPerFile object for a given file name. */ DefinesPerFile *find(const char *fileName) const { if (fileName==0) return 0; return m_fileMap.find(fileName); } + + /** Creates a new DefineManager object */ DefineManager() : m_fileMap(1009), m_contextDefines(1009) { m_fileMap.setAutoDelete(TRUE); } + + /** Destroys the object */ virtual ~DefineManager() { } + QDict m_fileMap; DefineDict m_contextDefines; }; +/** Singleton instance */ DefineManager *DefineManager::theInstance = 0; -void DefineManager::DefinesPerFile::collectDefines(DefineDict *dict,QDict &includeStack) +/** Collects all defines for a file and all files that the file includes. + * This function will recursively call itself for each file. + * @param dict The dictionary to fill with the defines. A redefine will + * replace a previous definition. + * @param includeStack The stack of includes, used to stop recursion in + * case there is a cyclic include dependency. + */ +void DefineManager::DefinesPerFile::collectDefines( + DefineDict *dict,QDict &includeStack) { //printf("DefinesPerFile::collectDefines #defines=%d\n",m_defines.count()); { @@ -2773,10 +2839,9 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output) g_condStack.setAutoDelete(TRUE); //g_fileDefineDict->clear(); - DefineManager::instance().startContext(); setFileName(fileName); g_inputFileDef = g_yyFileDef; - DefineManager::instance().addFileToContext(g_yyFileName); + DefineManager::instance().startContext(g_yyFileName); static bool firstTime=TRUE; if (firstTime) diff --git a/src/pycode.l b/src/pycode.l index 0116e80..1eb762d 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -296,7 +296,7 @@ static void addToSearchIndex(const char *text) } -static ClassDef *stripClassName(const char *s) +static ClassDef *stripClassName(const char *s,Definition *d=g_currentDefinition) { int pos=0; QCString type = s; @@ -309,11 +309,11 @@ static ClassDef *stripClassName(const char *s) ClassDef *cd=0; if (!g_classScope.isEmpty()) { - cd=getResolvedClass(g_currentDefinition,g_sourceFileDef,g_classScope+"::"+clName); + cd=getResolvedClass(d,g_sourceFileDef,g_classScope+"::"+clName); } if (cd==0) { - cd=getResolvedClass(g_currentDefinition,g_sourceFileDef,clName); + cd=getResolvedClass(d,g_sourceFileDef,clName); } if (cd) { @@ -516,7 +516,7 @@ static bool getLinkInScope(const QCString &c, // scope if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable()) { - g_theCallContext.setClass(stripClassName(md->typeString())); + g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); //printf("g_currentDefinition=%p g_currentMemberDef=%p\n", // g_currentDefinition,g_currentMemberDef); @@ -563,18 +563,16 @@ static bool getLink(const char *className, /* For a given string in the source code, finds its class or global id and links to it. - - As of June 1, '05, this ONLY finds classes */ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, - bool /*typeOnly*/=FALSE) + bool typeOnly=FALSE) { QCString className=clName; // Don't do anything for empty text if (className.isEmpty()) return; - //printf("generateClassOrGlobalLink(className=%s)\n",className.data()); + //fprintf(stderr,"generateClassOrGlobalLink(className=%s)\n",className.data()); ClassDef *cd=0,*lcd=0; /** Class def that we may find */ MemberDef *md=0; /** Member def that we may find */ @@ -583,15 +581,25 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, if ((lcd=g_theVarContext.findVariable(className))==0) // not a local variable { Definition *d = g_currentDefinition; + QCString scope = substitute(className,".","::"); - cd = getResolvedClass(d,g_sourceFileDef,className,&md); + cd = getResolvedClass(d,g_sourceFileDef,substitute(className,".","::"),&md); - //printf("d=%p g_sourceFileDef=%p\n",d,g_currentDefinition); - //printf("is found as a type %s\n",cd?cd->name().data():""); + //fprintf(stderr,"d=%s g_sourceFileDef=%s\n", + // d?d->displayName().data():"", + // g_currentDefinition?g_currentDefinition->displayName().data():""); + //fprintf(stderr,"is found as a type %s\n",cd?cd->name().data():""); if (cd==0 && md==0) // also see if it is variable or enum or enum value { - if (getLink(g_classScope,clName,ol,clName)) + NamespaceDef *nd = getResolvedNamespace(scope); + if (nd) + { + writeMultiLineCodeLink(ol,nd->getReference(),nd->getOutputFileBase(),nd->anchor(),clName,nd->briefDescriptionAsTooltip()); + addToSearchIndex(className); + return; + } + else if (getLink(g_classScope,clName,ol,clName)) { return; } @@ -624,50 +632,55 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName, } else // not a class, maybe a global member { - //printf("Checking if '%s' is a global function\n",clName); - - /* - This code requires a going-over in order to - make it work for Python - - //printf("class %s not linkable! cd=%p md=%p typeOnly=%d\n",clName,cd,md,typeOnly); - if (!isLocal && (md!=0 || (cd==0 && !typeOnly))) // not a class, see if it is a global enum/variable/typedef. + int scopeEnd = className.findRev("."); + if (scopeEnd!=-1 && !typeOnly) // name with explicit scope { - if (md==0) // not found as a typedef - { - md = setCallContextForVar(clName); - //printf("setCallContextForVar(%s) md=%p g_currentDefinition=%p\n",clName,md,g_currentDefinition); - if (md && g_currentDefinition) - { - //fprintf(stderr,"%s accessible from %s? %d md->getOuterScope=%s\n", - // md->name().data(),g_currentDefinition->name().data(), - // isAccessibleFrom(g_currentDefinition,g_sourceFileDef,md), - // md->getOuterScope()->name().data()); - } - - if (md && g_currentDefinition && - isAccessibleFrom(g_currentDefinition,g_sourceFileDef,md)==-1) - { - md=0; // variable not accessible - } - } - if (md) + QCString scope = substitute(className.left(scopeEnd),".","::"); + QCString locName = className.right(className.length()-scopeEnd-1); + ClassDef *mcd = getClass(scope); + //fprintf(stderr,"scope=%s locName=%s mcd=%p\n",scope.data(),locName.data(),mcd); + if (mcd) { - //printf("is a global md=%p g_currentDefinition=%s\n",md,g_currentDefinition?g_currentDefinition->name().data():""); - if (md->isLinkable()) + MemberDef *md = mcd->getMemberByName(locName); + if (md) { - writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName,md->briefDescriptionAsTooltip()); - addToSearchIndex(clName); - if (g_currentMemberDef) + g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); + writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName,md->briefDescriptionAsTooltip()); + addToSearchIndex(className); + Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); + if (md->getGroupDef()) d = md->getGroupDef(); + if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef) { addDocCrossReference(g_currentMemberDef,md); } return; } } + else // check namespace as well + { + NamespaceDef *mnd = getResolvedNamespace(scope); + if (mnd) + { + MemberDef *md=mnd->getMemberByName(locName); + if (md) + { + //printf("name=%s scope=%s\n",locName.data(),scope.data()); + g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope())); + writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName,md->briefDescriptionAsTooltip()); + addToSearchIndex(className); + Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); + if (md->getGroupDef()) d = md->getGroupDef(); + if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef) + { + addDocCrossReference(g_currentMemberDef,md); + } + return; + } + } + } } - - */ // nothing found, just write out the word codifyLines(clName); @@ -738,10 +751,11 @@ static bool findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *s addDocCrossReference(g_currentMemberDef,(MemberDef*)sym); } } + //fprintf(stderr,"cd=%s thisCd=%s\n",cd?cd->name().data():"",thisCd?thisCd->name().data():""); // TODO: find the nearest base class in case cd is a base class of // thisCd - if (cd==thisCd) + if (cd==thisCd || (thisCd && thisCd->isBaseClass(cd,TRUE))) { writeMultiLineCodeLink(ol,sym->getReference(), sym->getOutputFileBase(), @@ -994,7 +1008,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT codify(yytext); } - {IDENTIFIER} { + ({IDENTIFIER}".")*{IDENTIFIER} { // The parser // is assuming // that ALL identifiers @@ -1114,10 +1128,11 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT ({IDENTIFIER}".")*{IDENTIFIER}/"(" { generateClassOrGlobalLink(*g_code,yytext); } - {IDENTIFIER} { - codify(yytext); - //generateClassOrGlobalLink(*g_code,yytext); + ({IDENTIFIER}".")+{IDENTIFIER} { + generateClassOrGlobalLink(*g_code,yytext,TRUE); } + {IDENTIFIER} { codify(yytext); } + } @@ -1127,6 +1142,12 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT {BB} { codify(yytext); } + "pass" { + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + BEGIN(Body); + } {KEYWORD} { startFontClass("keyword"); codifyLines(yytext); diff --git a/src/pyscanner.l b/src/pyscanner.l index 3d6e158..1c29c57 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -103,7 +103,7 @@ static int g_atomCount; static QCString g_moduleScope; static QCString g_packageName; -static bool g_hideClassDocs; +//static bool g_hideClassDocs; static QCString g_defVal; static int g_braceCount; @@ -225,8 +225,17 @@ static QCString findPackageScope(const char *fileName) static void lineCount() { - for( const char* c = yytext ; *c ; ++c ) - yyLineNr += (*c == '\n') ; + //fprintf(stderr,"yyLineNr=%d\n",yyLineNr); + for (const char *p = yytext; *p; ++p) + { + yyLineNr += (*p == '\n') ; + } +} + +static void incLineNr() +{ + //fprintf(stderr,"yyLineNr=%d\n",yyLineNr); + yyLineNr++; } #if 0 @@ -407,6 +416,7 @@ static void searchFoundClass() current->argList->clear(); current->type += "class" ; current->fileName = yyFileName; + current->startLine = yyLineNr; current->bodyLine = yyLineNr; g_packageCommentAllowed = FALSE; } @@ -526,6 +536,7 @@ STARTDOCSYMS "##" { ^{B}"def"{BB} { // start of a function/method definition with indent + //fprintf(stderr,"Found def at %d\n",yyLineNr); g_indent=computeIndent(yytext); searchFoundDef(); BEGIN( FunctionDec ); @@ -536,6 +547,7 @@ STARTDOCSYMS "##" } ^{B}"class"{BB} { // start of a class definition with indent + //fprintf(stderr,"Found class at %d\n",yyLineNr); g_indent=computeIndent(yytext); searchFoundClass(); BEGIN( ClassDec ) ; @@ -635,7 +647,7 @@ STARTDOCSYMS "##" BEGIN(FromModItem); } \n { - yyLineNr++; + incLineNr(); BEGIN(Search); } {B} { @@ -658,6 +670,16 @@ STARTDOCSYMS "##" initEntry(); BEGIN(Search); } + {IDENTIFIER}/{B}","{B} { + QCString item=g_packageName+"."+yytext; + current->name=removeRedundantWhiteSpace(substitute(item,".","::")); + current->fileName = yyFileName; + //printf("Adding using declaration: found:%s:%d name=%s\n",yyFileName.data(),yyLineNr,current->name.data()); + current->section=Entry::USINGDECL_SEC; + current_root->addSubEntry(current); + current = new Entry ; + initEntry(); + } {IDENTIFIER} { QCString item=g_packageName+"."+yytext; current->name=removeRedundantWhiteSpace(substitute(item,".","::")); @@ -670,11 +692,13 @@ STARTDOCSYMS "##" BEGIN(Search); } \n { - yyLineNr++; + incLineNr(); BEGIN(Search); } {B} { } + "," { + } . { unput(*yytext); BEGIN(Search); @@ -693,7 +717,7 @@ STARTDOCSYMS "##" BEGIN(Search); } \n { - yyLineNr++; + incLineNr(); BEGIN(Search); } {B} { @@ -706,7 +730,7 @@ STARTDOCSYMS "##" { "self."{IDENTIFIER}/{B}"=" { - //printf("Found member variable %s in %s\n",&yytext[5],current_root->name.data()); + //fprintf(stderr,"Found member variable %s in %s at %d\n",&yytext[5],current_root->name.data(),yyLineNr); current->name=&yytext[5]; current->section=Entry::VARIABLE_SEC; current->fileName = yyFileName; @@ -749,9 +773,9 @@ STARTDOCSYMS "##" g_copyString=0; BEGIN( DoubleQuoteString ); } - \n { yyLineNr++; } + \n { incLineNr(); } {IDENTIFIER} // identifiers - [^'"\.#a-z_A-Z]+ // other uninteresting stuff + [^'"\.#a-z_A-Z\n]+ // other uninteresting stuff . // anything else } @@ -771,7 +795,7 @@ STARTDOCSYMS "##" } else { - yyLineNr++; + incLineNr(); current->program+=yytext; } } @@ -789,7 +813,7 @@ STARTDOCSYMS "##" } else { - yyLineNr++; + incLineNr(); current->program+=yytext; } } @@ -834,7 +858,8 @@ STARTDOCSYMS "##" "#".* { // comment half way current->program+=yytext; } - {NEWLINE} { yyLineNr++; + {NEWLINE} { + incLineNr(); current->program+=yytext; } . { // any character @@ -876,6 +901,7 @@ STARTDOCSYMS "##" {B}":" { // function without arguments g_specialBlock = TRUE; // expecting a docstring bodyEntry = current; + current->bodyLine = yyLineNr; BEGIN( FunctionBody ); } @@ -910,6 +936,7 @@ STARTDOCSYMS "##" ":"{B} { g_specialBlock = TRUE; // expecting a docstring bodyEntry = current; + current->bodyLine = yyLineNr; BEGIN( FunctionBody ); } {POUNDCOMMENT} { // a comment @@ -945,23 +972,23 @@ STARTDOCSYMS "##" } \n { g_defVal+=*yytext; - yyLineNr++; + incLineNr(); } } { \n/{IDENTIFIER}{BB} { // new def at indent 0 - yyLineNr++; + incLineNr(); endOfDef(); - g_hideClassDocs = FALSE; + //g_hideClassDocs = FALSE; //YY_CURRENT_BUFFER->yy_at_bol=TRUE; BEGIN(Search); } \n/"##"[^#] { // start of a special comment at indent 0 - yyLineNr++; + incLineNr(); endOfDef(); - g_hideClassDocs = FALSE; + //g_hideClassDocs = FALSE; //YY_CURRENT_BUFFER->yy_at_bol=TRUE; BEGIN(Search); } @@ -982,7 +1009,7 @@ STARTDOCSYMS "##" g_indent=g_curIndent; // make sure the next rule matches ^... //YY_CURRENT_BUFFER->yy_at_bol=TRUE; - g_hideClassDocs = FALSE; + //g_hideClassDocs = FALSE; BEGIN(Search); } else @@ -1007,11 +1034,11 @@ STARTDOCSYMS "##" [^ \t\n#'"]+ { // non-special stuff current->program+=yytext; g_specialBlock = FALSE; - g_hideClassDocs = FALSE; + //g_hideClassDocs = FALSE; } {NEWLINE} { current->program+=*yytext; - yyLineNr++; + incLineNr(); } {POUNDCOMMENT} { // normal comment current->program+=yytext; @@ -1021,13 +1048,15 @@ STARTDOCSYMS "##" current->program+=*yytext; } {TRIDOUBLEQUOTE} { // start of a comment block - if (!g_hideClassDocs) current->program+=yytext; + //if (!g_hideClassDocs) + current->program+=yytext; initTriDoubleQuoteBlock(); BEGIN(TripleComment); } {TRISINGLEQUOTE} { // start of a comment block - if (!g_hideClassDocs) current->program+=yytext; + //if (!g_hideClassDocs) + current->program+=yytext; initTriSingleQuoteBlock(); BEGIN(TripleComment); } @@ -1065,6 +1094,8 @@ STARTDOCSYMS "##" ":" { // begin of the class definition g_specialBlock = TRUE; // expecting a docstring + current->bodyLine = yyLineNr; + current->program.resize(0); BEGIN(ClassCaptureIndent); } @@ -1081,26 +1112,29 @@ STARTDOCSYMS "##" "\n"|({BB}"\n") { // Blankline - ignore, keep looking for indentation. lineCount(); + current->program+=yytext; } {TRIDOUBLEQUOTE} { // start of a comment block initTriDoubleQuoteBlock(); + current->program+=yytext; BEGIN(TripleComment); } {TRISINGLEQUOTE} { // start of a comment block initTriSingleQuoteBlock(); + current->program+=yytext; BEGIN(TripleComment); } ^{BB} { - current->program=yytext; - current->startLine = yyLineNr; + current->program+=yytext; + //current->startLine = yyLineNr; g_curIndent=computeIndent(yytext); bodyEntry = current; //fprintf(stderr,"setting indent %d\n",g_curIndent); //printf("current->program=[%s]\n",current->program.data()); - g_hideClassDocs = TRUE; + //g_hideClassDocs = TRUE; BEGIN(ClassBody); } @@ -1109,6 +1143,7 @@ STARTDOCSYMS "##" // Just pushback an empty class, and // resume parsing the body. newEntry(); + current->program+=yytext; // printf("Failed to find indent - skipping!"); BEGIN( Search ); @@ -1238,14 +1273,14 @@ STARTDOCSYMS "##" } \n { current->initializer+=*yytext; - yyLineNr++; + incLineNr(); } } { \n { - yyLineNr++; + incLineNr(); newVariable(); BEGIN(Search); } @@ -1287,15 +1322,17 @@ STARTDOCSYMS "##" actualDoc.prepend("\\namespace "+g_moduleScope+"\\_linebr "); handleCommentBlock(actualDoc, FALSE); } - if ((docBlockContext==ClassBody && !g_hideClassDocs) || + if ((docBlockContext==ClassBody /*&& !g_hideClassDocs*/) || docBlockContext==FunctionBody) { current->program+=docBlock; current->program+=yytext; } - if (g_hideClassDocs) - current->startLine = yyLineNr; - g_hideClassDocs=FALSE; + //if (g_hideClassDocs) + //{ + // current->startLine = yyLineNr; + //} + //g_hideClassDocs=FALSE; BEGIN(docBlockContext); } else @@ -1324,7 +1361,7 @@ STARTDOCSYMS "##" docBlock += yytext; } \n { - yyLineNr++; + incLineNr(); docBlock += yytext; } . { @@ -1339,14 +1376,14 @@ STARTDOCSYMS "##" docBlock+='\n'; docBrief = FALSE; startCommentBlock(FALSE); - yyLineNr++; + incLineNr(); } [^#\n]+ { // any other stuff docBlock+=yytext; } \n { // new line that ends the comment handleCommentBlock(docBlock, docBrief); - yyLineNr++; + incLineNr(); BEGIN(docBlockContext); } . { // anything we missed @@ -1357,7 +1394,7 @@ STARTDOCSYMS "##" { \\{B}\n { // line continuation addToString(yytext); - yyLineNr++; + incLineNr(); } \\. { // espaced char addToString(yytext); @@ -1380,7 +1417,7 @@ STARTDOCSYMS "##" { \\{B}\n { // line continuation addToString(yytext); - yyLineNr++; + incLineNr(); } \\. { // espaced char addToString(yytext); @@ -1416,7 +1453,7 @@ STARTDOCSYMS "##" *g_copyString += yytext; } \n { - yyLineNr++; + incLineNr(); *g_copyString += yytext; } . { @@ -1480,9 +1517,10 @@ static void parseCompounds(Entry *rt) BEGIN( SearchMemVars ); } yyFileName = ce->fileName; - yyLineNr = ce->startLine ; + yyLineNr = ce->bodyLine ; if (current) delete current; current = new Entry; + initEntry(); groupEnterCompound(yyFileName,yyLineNr,ce->name); @@ -1537,6 +1575,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) } current = new Entry; + initEntry(); current->name = g_moduleScope; current->section = Entry::NAMESPACE_SEC; current->type = "namespace"; @@ -1553,6 +1592,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) groupEnterFile(yyFileName,yyLineNr); current->reset(); + initEntry(); pyscanYYrestart( pyscanYYin ); BEGIN( Search ); pyscanYYlex(); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 578cda5..7f37f92 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -1571,7 +1571,7 @@ void RTFGenerator::endDescItem() newParagraph(); } -void RTFGenerator::startMemberDescription() +void RTFGenerator::startMemberDescription(const char *) { DBG_RTF(t << "{\\comment (startMemberDescription)}" << endl) t << "{" << endl; @@ -1837,7 +1837,7 @@ void RTFGenerator::endClassDiagram(const ClassDiagram &d, // t << text; //} -void RTFGenerator::startMemberItem(int) +void RTFGenerator::startMemberItem(const char *,int) { DBG_RTF(t <<"{\\comment startMemberItem }" << endl) t << rtf_Style_Reset << rtf_BList_DepthStyle() << endl; // set style to apropriate depth diff --git a/src/rtfgen.h b/src/rtfgen.h index 33798d5..1970f12 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -111,10 +111,10 @@ class RTFGenerator : public OutputGenerator void endInlineHeader(); void startAnonTypeScope(int) {} void endAnonTypeScope(int) {} - void startMemberItem(int); + void startMemberItem(const char *,int); void endMemberItem(); void startMemberTemplateParams() {} - void endMemberTemplateParams() {} + void endMemberTemplateParams(const char *) {} void insertMemberAlign(bool) {} void writeRuler() { rtfwriteRuler_thin(); } @@ -154,7 +154,7 @@ class RTFGenerator : public OutputGenerator void startSmall() { t << "{\\sub "; } void endSmall() { t << "}"; } - void startMemberDescription(); + void startMemberDescription(const char *); void endMemberDescription(); void startDescList(SectionTypes); void startSimpleSect(SectionTypes,const char *,const char *,const char *); @@ -178,7 +178,7 @@ class RTFGenerator : public OutputGenerator void endQuickIndices() {} void writeSplitBar(const char *) {} void writeLogo() {} - void writeQuickLinks(bool,HighlightedItem) {} + void writeQuickLinks(bool,HighlightedItem,const char *) {} void startContents() {} void endContents() {} void writeNonBreakableSpace(int); diff --git a/src/searchindex.cpp b/src/searchindex.cpp index bc560c6..ad9f8ba 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -374,10 +374,13 @@ static void addMemberToSearchIndex( ClassDef *cd=0; NamespaceDef *nd=0; FileDef *fd=0; + GroupDef *gd=0; if (isLinkable && - (cd=md->getClassDef()) && - cd->isLinkable() && - cd->templateMaster()==0) + ( + ((cd=md->getClassDef()) && cd->isLinkable() && cd->templateMaster()==0) || + ((gd=md->getGroupDef()) && gd->isLinkable()) + ) + ) { QCString n = md->name(); uchar charCode = (uchar)n.at(0); diff --git a/src/tclscanner.l b/src/tclscanner.l index a70f018..08b330e 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -1656,7 +1656,7 @@ D int myCmd=0; for (unsigned int i=0;i &members) { //printf(" Function with global scope name `%s' args=`%s'\n", @@ -3661,16 +3662,15 @@ static void findMembersWithSpecificName(MemberName *mn, { FileDef *fd=md->getFileDef(); GroupDef *gd=md->getGroupDef(); - //printf(" md->name()=`%s' md->args=`%s' fd=%p gd=%p current=%p\n", - // md->name().data(),args,fd,gd,currentFile); + //printf(" md->name()=`%s' md->args=`%s' fd=%p gd=%p current=%p ref=%s\n", + // md->name().data(),args,fd,gd,currentFile,md->getReference().data()); if ( ((gd && gd->isLinkable()) || (fd && fd->isLinkable()) || md->isReference()) && md->getNamespaceDef()==0 && md->isLinkable() && (!checkStatics || (!md->isStatic() && !md->isDefine()) || currentFile==0 || fd==currentFile) // statics must appear in the same file - ) + ) { - //printf(" fd=%p gd=%p args=`%s'\n",fd,gd,args); bool match=TRUE; ArgumentList *argList=0; if (args && !md->isDefine() && strcmp(args,"()")!=0) @@ -3684,7 +3684,7 @@ static void findMembersWithSpecificName(MemberName *mn, checkCV); delete argList; argList=0; } - if (match) + if (match && (forceTagFile==0 || md->getReference()==forceTagFile)) { //printf("Found match!\n"); members.append(md); @@ -3721,7 +3721,8 @@ bool getDefs(const QCString &scName,const QCString &memberName, ClassDef *&cd, FileDef *&fd, NamespaceDef *&nd, GroupDef *&gd, bool forceEmptyScope, FileDef *currentFile, - bool checkCV + bool checkCV, + const char *forceTagFile ) { fd=0, md=0, cd=0, nd=0, gd=0; @@ -4030,12 +4031,13 @@ bool getDefs(const QCString &scName,const QCString &memberName, { QList members; // search for matches with strict static checking - findMembersWithSpecificName(mn,args,TRUE,currentFile,checkCV,members); + findMembersWithSpecificName(mn,args,TRUE,currentFile,checkCV,forceTagFile,members); if (members.count()==0) // nothing found { // search again without strict static checking - findMembersWithSpecificName(mn,args,FALSE,currentFile,checkCV,members); + findMembersWithSpecificName(mn,args,FALSE,currentFile,checkCV,forceTagFile,members); } + //printf("found %d members\n",members.count()); if (members.count()!=1 && args && !strcmp(args,"()")) { // no exact match found, but if args="()" an arbitrary @@ -4645,7 +4647,12 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) if (fn->count()==1) { FileDef *fd = fn->getFirst(); - if (path.isEmpty() || fd->getPath().right(path.length())==path) +#if defined(_WIN32) || defined(__MACOSX__) // Windows or MacOSX + bool isSamePath = fd->getPath().right(path.length()).lower()==path.lower(); +#else // Unix + bool isSamePath = fd->getPath().right(path.length())==path; +#endif + if (path.isEmpty() || isSamePath) { cachedResult->fileDef = fd; g_findFileDefCache.insert(key,cachedResult); @@ -5760,7 +5767,7 @@ QCString stripTemplateSpecifiersFromScope(const QCString &fullName, if (getClass(result+fullName.mid(i,e-i))!=0) { result+=fullName.mid(i,e-i); - //printf(" 2:result+=%s cd=%s\n",fullName.mid(i,e-i-1).data(),cd->name().data()); + //printf(" 2:result+=%s\n",fullName.mid(i,e-i-1).data()); } else if (pLastScopeStripped) { @@ -6068,7 +6075,7 @@ void filterLatexString(FTextStream &t,const char *str, default: //if (!insideTabbing && forceBreaks && c!=' ' && *p!=' ') if (!insideTabbing && - ((c>='A' && c<='Z' && pc!=' ') || (c==':' && pc!=':') || (pc=='.' && isId(c))) + ((c>='A' && c<='Z' && pc!=' ' && pc!='\0') || (c==':' && pc!=':') || (pc=='.' && isId(c))) ) { t << "\\-"; @@ -7217,3 +7224,18 @@ QCString getLanguageSpecificSeparator(SrcLangExt lang) } } +/** Corrects URL \a url according to the relative path \a relPath. + * Returns the corrected URL. For absolute URLs no correction will be done. + */ +QCString correctURL(const QCString &url,const QCString &relPath) +{ + QCString result = url; + if (!relPath.isEmpty() && + url.left(5)!="http:" && url.left(6)!="https:" && + url.left(4)!="ftp:" && url.left(5)!="file:") + { + result.prepend(relPath); + } + return result; +} + diff --git a/src/util.h b/src/util.h index fd8c54e..f99d7a6 100644 --- a/src/util.h +++ b/src/util.h @@ -137,7 +137,8 @@ bool getDefs(const QCString &scopeName, GroupDef *&gd, bool forceEmptyScope=FALSE, FileDef *currentFile=0, - bool checkCV=FALSE + bool checkCV=FALSE, + const char *forceTagFile=0 ); QCString getFileFilter(const char* name,bool isSourceCode); @@ -412,5 +413,7 @@ QCString replaceColorMarkers(const char *str); bool copyFile(const QCString &src,const QCString &dest); QCString extractBlock(const QCString text,const QCString marker); +QCString correctURL(const QCString &url,const QCString &relPath); + #endif diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 7de52c1..06a5c8c 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -1540,7 +1540,7 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, // start a new member declaration bool isAnonymous = annoClassDef; // || m_impl->annMemb || m_impl->annEnumType; ///printf("startMemberItem for %s\n",name().data()); - ol.startMemberItem( isAnonymous ); //? 1 : m_impl->tArgList ? 3 : 0); + ol.startMemberItem( mdef->anchor(), isAnonymous ); //? 1 : m_impl->tArgList ? 3 : 0); // If there is no detailed description we need to write the anchor here. bool detailsVisible = mdef->isDetailedSectionLinkable(); @@ -1772,7 +1772,7 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, ol.endMemberItem(); if (!mdef->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC") /* && !annMemb */) { - ol.startMemberDescription(); + ol.startMemberDescription(mdef->anchor()); ol.parseDoc(mdef->briefFile(),mdef->briefLine(), mdef->getOuterScope()?mdef->getOuterScope():d, mdef,mdef->briefDescription(),TRUE,FALSE,0,TRUE,FALSE); @@ -2159,34 +2159,26 @@ void VhdlDocGen::writeCodeFragment( MemberDef *mdef,OutputList& ol) void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname) { - // 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); - - 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 - ); + int len = qsl.count(); + QCString lineNumber; + int j; + for (j=0;jwriteSourceDef(ol,cname); mdef->writeSourceRefs(ol,cname); @@ -2219,8 +2211,8 @@ void VhdlDocGen::parseUCF(const char* input, Entry* entity,QCString fileName,b { QCString ucFile(input); int lineNo=0; - QCString newLine="\n"; - QCString comment("##"); + QCString newLine="\n"; + QCString comment("#!"); QCString brief; while(!ucFile.isEmpty()) @@ -2230,14 +2222,16 @@ void VhdlDocGen::parseUCF(const char* input, Entry* entity,QCString fileName,b lineNo++; QCString temp=ucFile.left(i); temp=temp.stripWhiteSpace(); + bool bb=temp.stripPrefix("//"); + if (!temp.isEmpty()) { - if (temp.stripPrefix("##") || temp.stripPrefix("//") ) + if (temp.stripPrefix(comment) ) { brief+=temp; brief.append("\\n"); } - else if (!temp.stripPrefix("#")) + else if (!temp.stripPrefix("#") && !bb) { if (altera) { @@ -2372,7 +2366,7 @@ bool VhdlDocGen::findConstraintFile(LayoutNavEntry *lne) LayoutNavEntry *kk = lne->parent();// find(LayoutNavEntry::Files); // LayoutNavEntry *kks = kk->parent();// find(LayoutNavEntry::Files); QCString file; - QCString co("Constraints"); + QCString co("Constraint File"); while (fn) { FileDef *fd=fn->first(); @@ -2381,7 +2375,7 @@ bool VhdlDocGen::findConstraintFile(LayoutNavEntry *lne) file = convertNameToFile(fd->name().data(),FALSE,FALSE); LayoutNavEntry *ucf=new LayoutNavEntry(lne,LayoutNavEntry::MainPage,TRUE,file,co,""); kk->addChild(ucf); - // break; + break; } fn=Doxygen::inputNameList->next(); } @@ -2600,18 +2594,11 @@ void assignConfiguration(ConfNode* rootNode,QCString label) */ void VhdlDocGen::computeVhdlComponentRelations() { - ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cl; - for ( cli.toFirst() ; (cl=cli.current()) ; ++cli) - { - // @MARTIN: THE FOLLOWING IS DONE FOR ALL LANGUAGES, WHICH IS WRONG!!! - cl->setLanguage(SrcLangExt_VHDL); - } - + QCString entity,inst,arch,vhd; QList confList = getVhdlConfiguration(); - for(uint iter=0;itertype; } - ClassDef *classEntity=Doxygen::classSDict->find(entity.data()); + ClassDef *classEntity=Doxygen::classSDict->find(entity); inst=VhdlDocGen::getIndexWord(cur->args.data(),0); - ClassDef *cd=Doxygen::classSDict->find(inst.data()); - ClassDef *ar=Doxygen::classSDict->find(cur->args.data()); - + ClassDef *cd=Doxygen::classSDict->find(inst); + ClassDef *ar=Doxygen::classSDict->find(cur->args); if (cd==0 || classEntity==0 ) continue; @@ -2728,5 +2714,27 @@ void VhdlDocGen::writeRecUnitDocu( first=FALSE; } -}// +}//# + +void VhdlDocGen::writeCodeFragment(OutputList& ol,int start, QCString & codeFragment,const MemberDef* mdef) +{ + QStringList qsl=QStringList::split("\n",codeFragment); + ol.startCodeFragment(); + int len = qsl.count(); + QCString lineNumber; + int j; + for (j=0;jtype="misc"; // global code like library ieee... current_root->addSubEntry(temp); } - + strComment.resize(0); gBlock.reset(); @@ -531,7 +550,11 @@ BR [ \t\n\r] ^{B}*"--!"[^\n]* { if (iDocLine==-1) iDocLine=yyLineNr; strComment+=vhdlScanYYtext; - + int index=strComment.find("\\code"); + if (index>0) + { + startCodeBlock(index); + } lineCount(); } @@ -541,22 +564,7 @@ BR [ \t\n\r] int index =strComment.find("\\code"); if (index>0) { - int ll=strComment.length(); - iCodeLen=inputVhdlString.findRev(strComment.data(),num_chars)+ll; - - gBlock.reset(); - int len=strComment.length(); - QCString name=strComment.right(len-index);// - name=VhdlDocGen::getIndexWord(name.data(),1); - if (!name) - gBlock.name="misc"+ VhdlDocGen::getRecordNumber(); - else - gBlock.name=name; - strComment=strComment.left(index); - gBlock.startLine=yyLineNr+1; - gBlock.bodyLine=yyLineNr+1; - VhdlDocGen::prepareComment(strComment); - gBlock.brief+=strComment; + startCodeBlock(index); } VhdlDocGen::prepareComment(strComment); @@ -575,11 +583,19 @@ BR [ \t\n\r] bool isEndCode=qcs.contains("\\endcode"); + int index = qcs.find("\\code"); if (isEndCode) { int end=inputVhdlString.find(qcs.data(),iCodeLen); makeInlineDoc(end); } + else if (index > 0 ) + { + // assert(false); + strComment=qcs; + startCodeBlock(index); + strComment.resize(0); + } //printf("--> handleCommentBlock line %d\n",yyLineNr); Entry* pTemp=getEntryAtLine(current_root,yyLineNr); -- cgit v0.12