diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-02-27 20:01:29 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-02-27 20:01:29 (GMT) |
commit | d745dd3737ece0f328e515b1cf10306da0901597 (patch) | |
tree | 2d189d04d6f9413eb324fae5f56f273f3855ff8b | |
parent | 11de530ba769e4e2735a20a74262380d51f8772f (diff) | |
download | Doxygen-d745dd3737ece0f328e515b1cf10306da0901597.zip Doxygen-d745dd3737ece0f328e515b1cf10306da0901597.tar.gz Doxygen-d745dd3737ece0f328e515b1cf10306da0901597.tar.bz2 |
Release-1.4.1-20050227
42 files changed, 1422 insertions, 849 deletions
@@ -1,7 +1,7 @@ -DOXYGEN Version 1.4.1-20050210 +DOXYGEN Version 1.4.1-20050227 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (10 February 2005) +Dimitri van Heesch (27 February 2005) @@ -1,4 +1,4 @@ -DOXYGEN Version 1.4.1_20050210 +DOXYGEN Version 1.4.1_20050227 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (10 February 2005) +Dimitri van Heesch (dimitri@stack.nl) (27 February 2005) @@ -1 +1 @@ -1.4.1-20050210 +1.4.1-20050227 diff --git a/doc/config.doc b/doc/config.doc index 99fc475..dd6408b 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -186,6 +186,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_rtf_stylesheet_file RTF_STYLESHEET_FILE \refitem cfg_search_includes SEARCH_INCLUDES \refitem cfg_searchengine SEARCHENGINE +\refitem cfg_separate_member_pages SEPARATE_MEMBER_PAGES \refitem cfg_short_names SHORT_NAMES \refitem cfg_show_dirs SHOW_DIRECTORIES \refitem cfg_show_include_files SHOW_INCLUDE_FILES @@ -410,6 +411,13 @@ followed by the descriptions of the tags grouped by category. member in the group (if any) for the other members of the group. By default all members of a group must be documented explicitly. +\anchor cfg_separate_member_pages +<dt>\c SEPARATE_MEMBER_PAGES <dd> + \addindex SEPARATE_MEMBER_PAGES + If the \c SEPARATE_MEMBER_PAGES tag is set to \c YES, then doxygen will produce + a new page for each member. If set to \c NO, the documentation of a member will + be part of the file/class/namespace that contains it. + \anchor cfg_tab_size <dt>\c TAB_SIZE <dd> \addindex TAB_SIZE diff --git a/doc/language.doc b/doc/language.doc index 8a0058e..8528efa 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -23,7 +23,7 @@ text fragments, generated by doxygen, can be produced in languages other than English (the default). The output language is chosen through the configuration file (with default name and known as Doxyfile). -Currently (version 1.4.1-20050129), 30 languages +Currently (version 1.4.1-20050227), 30 languages are supported (sorted alphabetically): Afrikaans, Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, diff --git a/doc/translator_report.txt b/doc/translator_report.txt index ea0bb38..0832fc1 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -1,4 +1,4 @@ -(1.4.1-20050129) +(1.4.1-20050227) Doxygen supports the following 30 languages (sorted alphabetically): @@ -20,7 +20,7 @@ still may be some details listed even for them: TranslatorBrazilian -- Remove the obsolete methods (never used). TranslatorChinese -- Remove the obsolete methods (never used). TranslatorCroatian -- Remove the obsolete methods (never used). - TranslatorCzech -- Remove the obsolete methods (never used). + TranslatorCzech TranslatorDutch -- Remove the obsolete methods (never used). TranslatorEnglish -- Remove the obsolete methods (never used). TranslatorFrench -- Remove the obsolete methods (never used). @@ -226,25 +226,6 @@ TranslatorCroatian (Translator) QCString trNoDescriptionAvailable() -TranslatorCzech (Translator) ---------------- - - Implements 191 of the required methods. - - Obsolete methods (should be removed, never used): - - virtual QCString trHeaderFilesDescription() - virtual QCString trField(bool first_capital, bool singular) - virtual QCString trPackageDocumentation() - virtual QCString trSources() - virtual QCString trReimplementedForInternalReasons() - virtual QCString trInterfaces() - virtual QCString trHeaderFiles() - virtual QCString trBugsAndLimitations() - virtual QCString trEnumerationValueDocumentation() - virtual QCString trNoDescriptionAvailable() - - TranslatorDanish (TranslatorAdapter_1_3_9) 6 methods to implement ---------------- diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index 9b58e02..db1c429 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,6 +1,6 @@ Summary: A documentation system for C/C++. Name: doxygen -Version: 1.4.1_20050210 +Version: 1.4.1_20050227 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index 5d7da7c..b50931a 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1340,6 +1340,11 @@ void ClassDef::writeDocumentation(OutputList &ol) writeDetailedDescription(ol,pageType,exampleFlag); } + + /////////////////////////////////////////////////////////////////////////// + //// Member declarations + brief descriptions + /////////////////////////////////////////////////////////////////////////// + // write member groups ol.startMemberSections(); @@ -1428,7 +1433,7 @@ void ClassDef::writeDocumentation(OutputList &ol) // nested classes m_innerClasses->writeDeclaration(ol,0,0,TRUE); - + ol.endMemberSections(); // write detailed description @@ -1436,6 +1441,54 @@ void ClassDef::writeDocumentation(OutputList &ol) writeDetailedDescription(ol,pageType,exampleFlag); } + writeMemberDocumentation(ol); + + ///////////////////////////////////////////////////////////////////// + ol.startTextBlock(); + + // write the list of used files (not for man pages) + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Man); + + showUsedFiles(ol); + + // write Author section (Man only) + ol.enable(OutputGenerator::Man); + ol.disableAllBut(OutputGenerator::Man); + ol.writeString("\n"); + ol.startGroupHeader(); + ol.parseText(theTranslator->trAuthor(TRUE,TRUE)); + ol.endGroupHeader(); + ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME"))); + ol.popGeneratorState(); + + ol.endTextBlock(); + ///////////////////////////////////////////////////////////////////// + + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + writeDocAnchorsToTagFile(); + Doxygen::tagFile << " </compound>" << endl; + } + + endFile(ol); + + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + writeMemberPages(ol); + } +} + +void ClassDef::writeMemberDocumentation(OutputList &ol) +{ + /////////////////////////////////////////////////////////////////////////// + //// Member definitions + detailed documentation + /////////////////////////////////////////////////////////////////////////// + + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + ol.disable(OutputGenerator::Html); + } typedefMembers.writeDocumentation(ol,name(),this, theTranslator->trMemberTypedefDocumentation()); @@ -1461,36 +1514,77 @@ void ClassDef::writeDocumentation(OutputList &ol) eventMembers.writeDocumentation(ol,name(),this, theTranslator->trEventDocumentation()); - ol.startTextBlock(); + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + ol.enable(OutputGenerator::Html); + } +} - // write the list of used files (not for man pages) - ol.pushGeneratorState(); - ol.disable(OutputGenerator::Man); +void ClassDef::writeMemberPages(OutputList &ol) +{ + /////////////////////////////////////////////////////////////////////////// + //// Member definitions on separate pages + /////////////////////////////////////////////////////////////////////////// - showUsedFiles(ol); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + + typedefMembers.writeDocumentationPage(ol,name(),this); + enumMembers.writeDocumentationPage(ol,name(),this); + constructors.writeDocumentationPage(ol,name(),this); + functionMembers.writeDocumentationPage(ol,name(),this); + relatedMembers.writeDocumentationPage(ol,name(),this); + variableMembers.writeDocumentationPage(ol,name(),this); + propertyMembers.writeDocumentationPage(ol,name(),this); + eventMembers.writeDocumentationPage(ol,name(),this); - // write Author section (Man only) - ol.enable(OutputGenerator::Man); - ol.disableAllBut(OutputGenerator::Man); - ol.writeString("\n"); - ol.startGroupHeader(); - ol.parseText(theTranslator->trAuthor(TRUE,TRUE)); - ol.endGroupHeader(); - ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME"))); ol.popGeneratorState(); +} - ol.endTextBlock(); +void ClassDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +{ + ol.writeString(" <div class=\"navtab\">\n"); + ol.writeString(" <table>\n"); - if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + MemberNameInfoSDict::Iterator mnili(*m_allMemberNameInfoSDict); + MemberNameInfo *mni; + for (;(mni=mnili.current());++mnili) { - writeDocAnchorsToTagFile(); - Doxygen::tagFile << " </compound>" << endl; + MemberNameInfoIterator mnii(*mni); + MemberInfo *mi; + for (mnii.toFirst();(mi=mnii.current());++mnii) + { + MemberDef *md=mi->memberDef; + if (md->getClassDef()==this && md->isLinkable()) + { + ol.writeString(" <tr><td class=\"navtab\">"); + if (md->isLinkableInProject()) + { + if (md==currentMd) // selected item => highlight + { + ol.writeString("<a class=\"qindexHL\" "); + } + else + { + ol.writeString("<a class=\"qindex\" "); + } + ol.writeString("href=\""); + ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); + ol.writeString("\">"); + ol.writeString(md->localName()); + ol.writeString("</a>"); + } + ol.writeString("</td></tr>\n"); + } + } } - - endFile(ol); + ol.writeString(" </table>\n"); + ol.writeString(" </div>\n"); } + + void ClassDef::writeDocumentationForInnerClasses(OutputList &ol) { // write inner classes after the parent, so the tag files contain diff --git a/src/classdef.h b/src/classdef.h index 1da2d90..81d7bf2 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -67,7 +67,7 @@ class ClassDef : public Definition Category=Entry::CATEGORY_SEC, Exception=Entry::EXCEPTION_SEC }; - DefType definitionType() { return TypeClass; } + DefType definitionType() const { return TypeClass; } QCString getOutputFileBase() const; QCString getInstanceOutputFileBase() const; QCString getFileBase() const; @@ -104,9 +104,12 @@ class ClassDef : public Definition void writeDocumentation(OutputList &ol); void writeDocumentationForInnerClasses(OutputList &ol); + void writeMemberDocumentation(OutputList &ol); + void writeMemberPages(OutputList &ol); void writeMemberList(OutputList &ol); void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup); void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag); + void writeQuickMemberLinks(OutputList &ol,MemberDef *md) const; /*! Return the protection level (Public,Protected,Private) in which * this compound was found. @@ -752,6 +752,85 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst) } +static bool getLinkInScope(const QCString &c, // scope + const QCString &m, // member + const char *memberText, // exact text + BaseCodeDocInterface &ol, + const char *text + ) +{ + MemberDef *md; + ClassDef *cd; + FileDef *fd; + NamespaceDef *nd; + GroupDef *gd; + //printf("Trying `%s'::`%s'\n",c.data(),m.data()); + if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) && + md->isLinkable()) + { + //printf("Found!\n"); + if (g_exampleBlock) + { + QCString anchor; + anchor.sprintf("a%d",g_anchorCount); + //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),g_exampleName.data(), + // g_exampleFile.data()); + if (md->addExample(anchor,g_exampleName,g_exampleFile)) + { + ol.writeCodeAnchor(anchor); + g_anchorCount++; + } + } + //Definition *d=0; + //if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd; + + Definition *d = md->getOuterScope()==Doxygen::globalScope ? + md->getBodyDef() : md->getOuterScope(); + if (md->getGroupDef()) d = md->getGroupDef(); + if (d && d->isLinkable()) + { + g_theCallContext.setClass(stripClassName(md->typeString())); + //printf("g_currentDefinition=%p g_currentMemberDef=%p g_insideBody=%d\n", + // g_currentDefinition,g_currentMemberDef,g_insideBody); + + if (g_currentDefinition && g_currentMemberDef && + md!=g_currentMemberDef && g_insideBody) + { + addDocCrossReference(g_currentMemberDef,md); + } + //printf("d->getReference()=`%s' d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data()); + + writeMultiLineCodeLink(ol,md->getReference(), + md->getOutputFileBase(), + md->anchor(), + text ? text : memberText); + addToSearchIndex(text ? text : memberText); + return TRUE; + } + } + return FALSE; +} + +static bool getLink(const char *className, + const char *memberName, + BaseCodeDocInterface &ol, + const char *text=0) +{ + QCString m=removeRedundantWhiteSpace(memberName); + QCString c=className; + if (!getLinkInScope(c,m,memberName,ol,text)) + { + if (!g_curClassName.isEmpty()) + { + if (!c.isEmpty()) c.prepend("::"); + c.prepend(g_curClassName); + return getLinkInScope(c,m,memberName,ol,text); + } + return FALSE; + } + return TRUE; +} + static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, bool typeOnly=FALSE) { @@ -780,7 +859,14 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, { cd=getResolvedClass(d,g_sourceFileDef,className.left(i),&md); } - //fprintf(stderr,"is found as a type %s\n",cd?cd->name().data():"<null>"); + //print("is found as a type %s\n",cd?cd->name().data():"<null>"); + if (cd==0 && md==0) // also see if it is variable or enum or enum value + { + if (getLink(g_classScope,clName,ol,clName)) + { + return; + } + } } else { @@ -825,8 +911,8 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, { if (md==0) // not found as a typedef { - //printf("setCallContextForVar(%s)\n",clName); 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", @@ -863,85 +949,6 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName, } } -static bool getLinkInScope(const QCString &c, // scope - const QCString &m, // member - const char *memberText, // exact text - BaseCodeDocInterface &ol, - const char *text - ) -{ - MemberDef *md; - ClassDef *cd; - FileDef *fd; - NamespaceDef *nd; - GroupDef *gd; - //printf("Trying `%s'::`%s'\n",c.data(),m.data()); - if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) && - md->isLinkable()) - { - //printf("Found!\n"); - if (g_exampleBlock) - { - QCString anchor; - anchor.sprintf("a%d",g_anchorCount); - //printf("addExampleFile(%s,%s,%s)\n",anchor.data(),g_exampleName.data(), - // g_exampleFile.data()); - if (md->addExample(anchor,g_exampleName,g_exampleFile)) - { - ol.writeCodeAnchor(anchor); - g_anchorCount++; - } - } - //Definition *d=0; - //if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd; - - Definition *d = md->getOuterScope()==Doxygen::globalScope ? - md->getBodyDef() : md->getOuterScope(); - if (md->getGroupDef()) d = md->getGroupDef(); - if (d && d->isLinkable()) - { - g_theCallContext.setClass(stripClassName(md->typeString())); - //printf("g_currentDefinition=%p g_currentMemberDef=%p g_insideBody=%d\n", - // g_currentDefinition,g_currentMemberDef,g_insideBody); - - if (g_currentDefinition && g_currentMemberDef && - md!=g_currentMemberDef && g_insideBody) - { - addDocCrossReference(g_currentMemberDef,md); - } - //printf("d->getReference()=`%s' d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data()); - - writeMultiLineCodeLink(ol,md->getReference(), - md->getOutputFileBase(), - md->anchor(), - text ? text : memberText); - addToSearchIndex(text ? text : memberText); - return TRUE; - } - } - return FALSE; -} - -static bool getLink(const char *className, - const char *memberName, - BaseCodeDocInterface &ol, - const char *text=0) -{ - QCString m=removeRedundantWhiteSpace(memberName); - QCString c=className; - if (!getLinkInScope(c,m,memberName,ol,text)) - { - if (!g_curClassName.isEmpty()) - { - if (!c.isEmpty()) c.prepend("::"); - c.prepend(g_curClassName); - return getLinkInScope(c,m,memberName,ol,text); - } - return FALSE; - } - return TRUE; -} - static bool generateClassMemberLink(BaseCodeDocInterface &ol,ClassDef *mcd,const char *memName) { if (mcd) @@ -2404,8 +2411,11 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP} } } <MemberCall2,FuncCall>{OPERATOR} { // operator + if (strcmp(yytext,"*") && strcmp(yytext,"&")) // typically a pointer or reference + { + g_parmType.resize(0);g_parmName.resize(0); + } g_code->codify(yytext); - g_parmType.resize(0);g_parmName.resize(0); } <MemberCall,MemberCall2,FuncCall>")" { g_theVarContext.addVariable(g_parmType,g_parmName); diff --git a/src/commentscan.l b/src/commentscan.l index f489d32..f25af0f 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -112,6 +112,7 @@ struct DocCmdMap DocCmdFunc handler; }; +// map of command to handler function static DocCmdMap docCmdMap[] = { { "brief", &handleBrief }, @@ -246,7 +247,8 @@ enum XRefKind XRef_Todo, XRef_Test, XRef_Bug, - XRef_Deprecated + XRef_Deprecated, + XRef_None }; enum OutputContext @@ -294,6 +296,7 @@ static QCString *pOutputString; // pointer to string to which the o static QCString outputXRef; // temp argument of todo/test/../xrefitem commands static QCString blockName; // preformatted block name (e.g. verbatim, latexonly,...) static XRefKind xrefKind; // kind of cross-reference command +static XRefKind newXRefKind; // static GuardType guardType; // kind of guard for conditional section static QCString nameHeader; // heading of the @name command static QCString functionProto; // function prototype @@ -308,10 +311,14 @@ static bool needNewEntry; static QCString sectionLabel; static QCString sectionTitle; static QCString xrefItemKey; +static QCString newXRefItemKey; static QCString xrefItemTitle; static QCString xrefListTitle; static Protection protection; +static bool xrefAppendToPrev; +static bool xrefAppendFlag; + //----------------------------------------------------------------------------- static void initParser() @@ -323,12 +330,53 @@ static void initParser() //----------------------------------------------------------------------------- +static QCString getDocSectionName(int s) +{ + switch(s) + { + case Entry::CLASSDOC_SEC: return "@class"; + case Entry::STRUCTDOC_SEC: return "@struct"; + case Entry::UNIONDOC_SEC: return "@union"; + case Entry::EXCEPTIONDOC_SEC: return "@exception"; + case Entry::NAMESPACEDOC_SEC: return "@namespace"; + case Entry::PROTOCOLDOC_SEC: return "@protocol"; + case Entry::CATEGORYDOC_SEC: return "@category"; + case Entry::ENUMDOC_SEC: return "@enum"; + case Entry::PAGEDOC_SEC: return "@page"; + case Entry::MEMBERDOC_SEC: return "@fn"; + case Entry::OVERLOADDOC_SEC: return "@overload"; + case Entry::FILEDOC_SEC: return "@file"; + case Entry::DEFINEDOC_SEC: return "@def"; + case Entry::GROUPDOC_SEC: return "@defgroup"; + case Entry::MAINPAGEDOC_SEC: return "@mainpage"; + case Entry::PACKAGEDOC_SEC: return "@package"; + case Entry::DIRDOC_SEC: return "@dir"; + case Entry::EXAMPLE_SEC: return "@example"; + case Entry::MEMBERGRP_SEC: return "@name"; + default: return ""; + } +} + +//----------------------------------------------------------------------------- + static void makeStructuralIndicator(Entry::Sections s) { - needNewEntry = TRUE; - current->section = s; - current->fileName = yyFileName; - current->startLine = yyLineNr; + if (!getDocSectionName(current->section).isEmpty()) + { + warn(yyFileName,yyLineNr, + "Warning: found a structural command %s for a section already " + "marked with structural command %s. Ignoring the latter command.", + getDocSectionName(s).data(), + getDocSectionName(current->section).data() + ); + } + else + { + needNewEntry = TRUE; + current->section = s; + current->fileName = yyFileName; + current->startLine = yyLineNr; + } } static void lineCount() @@ -352,13 +400,13 @@ static QCString stripQuotes(const char *s) //----------------------------------------------------------------- -static void addXRefItem(const char *listName,const char *itemTitle,const char *listTitle) +static void addXRefItem(const char *listName,const char *itemTitle, + const char *listTitle,bool append) { Entry *docEntry = current; // inBody && previous ? previous : current; - //printf("docEntry=%p\n",docEntry); if (listName==0) return; - //printf("addXRefItem(%s,%s,%s)\n",listName,itemTitle,listTitle); + //printf("addXRefItem(%s,%s,%s,%d)\n",listName,itemTitle,listTitle,append); ListItemInfo *lii=0; RefList *refList = Doxygen::xrefLists->find(listName); if (refList==0) // new list @@ -379,9 +427,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,const char *l } } } -#if 0 // with this code multiple @todo items can be put under the same - // heading, I removed it because it changes the text flow. - if (lii) // already found item of same type before + if (lii && append) // already found item of same type just before this one { //printf("listName=%s item id = %d existing\n",listName,lii->itemId); RefItem *item = refList->getRefItem(lii->itemId); @@ -391,7 +437,6 @@ static void addXRefItem(const char *listName,const char *itemTitle,const char *l //printf("%s: text +=%s\n",listName,item->text.data()); } else // new item -#endif { int itemId = refList->addRefItem(); //printf("listName=%s item id = %d new current=%p\n",listName,itemId,current); @@ -412,9 +457,8 @@ static void addXRefItem(const char *listName,const char *itemTitle,const char *l sectionTitle,SectionInfo::Anchor); Doxygen::sectionDict.insert(anchorLabel,si); docEntry->anchors->append(si); - outputXRef.resize(0); } - //current->brief = slString; // restore orginial brief desc. + outputXRef.resize(0); } //----------------------------------------------------------------------------- @@ -492,27 +536,59 @@ static void addSection() //----------------------------------------------------------------------------- -// determines the string to write to +// selects the output to write to static inline void setOutput(OutputContext ctx) { + //printf("setOutput(inContext=%d ctx=%d)\n",inContext,ctx); if (inContext==OutputXRef) // end of XRef section => add the item { + // See if we can append this new xref item to the previous one. + // We know this at the start of the next item of the same + // type and need to remember this until the end of that item. + xrefAppendToPrev = xrefAppendFlag; + xrefAppendFlag = ctx==OutputXRef && newXRefKind==xrefKind && + (xrefKind!=XRef_Item || newXRefItemKey==xrefItemKey); + //printf("refKind=%d newXRefKind=%d xrefAppendToPrev=%d xrefAppendFlag=%d\n", + // xrefKind,newXRefKind,xrefAppendToPrev,xrefAppendFlag); switch(xrefKind) { case XRef_Todo: - addXRefItem("todo",theTranslator->trTodo(),theTranslator->trTodoList()); + addXRefItem("todo", + theTranslator->trTodo(), + theTranslator->trTodoList(), + xrefAppendToPrev + ); break; case XRef_Test: - addXRefItem("test",theTranslator->trTest(),theTranslator->trTestList()); + addXRefItem("test", + theTranslator->trTest(), + theTranslator->trTestList(), + xrefAppendToPrev + ); break; case XRef_Bug: - addXRefItem("bug",theTranslator->trBug(),theTranslator->trBugList()); + addXRefItem("bug", + theTranslator->trBug(), + theTranslator->trBugList(), + xrefAppendToPrev + ); break; case XRef_Deprecated: - addXRefItem("deprecated",theTranslator->trDeprecated(),theTranslator->trDeprecatedList()); + addXRefItem("deprecated", + theTranslator->trDeprecated(), + theTranslator->trDeprecatedList(), + xrefAppendToPrev + ); break; - case XRef_Item: - addXRefItem(xrefItemKey,xrefItemTitle,xrefListTitle); + case XRef_Item: // user defined list + addXRefItem(xrefItemKey, + xrefItemTitle, + xrefListTitle, + xrefAppendToPrev + ); + break; + case XRef_None: + ASSERT(0); break; } } @@ -527,6 +603,8 @@ static inline void setOutput(OutputContext ctx) break; case OutputXRef: pOutputString = &outputXRef; + // first item found, so can't append to previous + xrefAppendFlag = FALSE; break; } } @@ -638,8 +716,8 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) * directories (e.g. \doxygen\src\) * autolist end. (e.g. a dot on an otherwise empty line) * newlines. - * end of brief due to blank line. - * end of brief due to some command (@command, or <command>). + * end of brief description due to blank line. + * end of brief description due to some command (@command, or <command>). * words and whitespace and other characters (#,?!, etc). * grouping commands (e.g. @{ and @}) */ @@ -651,7 +729,7 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) addOutput(yytext); } <Comment>{DETAILEDCMD}/[^a-z_A-Z] { // command that can end a brief description - setOutput(OutputDoc); + if (inContext!=OutputXRef) setOutput(OutputDoc); // continue with the same input REJECT; } @@ -668,7 +746,7 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) DocCmdFunc *funcPtr = DocCmdMapper::map(cmdName); if (funcPtr) // special action is required { - //printf("Special command %s\n",yytext); + //printf("Special command '%s'\n",yytext); (*funcPtr)(cmdName); } else // command not relevant @@ -1001,7 +1079,6 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) addOutput('\n'); } <FileDocArg1>{DOCNL} { // no file name specfied - current->name = yyFileName; if (*yytext=='\n') yyLineNr++; addOutput('\n'); BEGIN( Comment ); @@ -1012,7 +1089,9 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) /* --------- handle arguments of the xrefitem command ------------ */ <XRefItemParam1>{ID} { // first argument - xrefItemKey=yytext; + newXRefItemKey=yytext; + setOutput(OutputXRef); + xrefItemKey==yytext; BEGIN(XRefItemParam2); } <XRefItemParam1>{LC} { // line continuation @@ -1053,6 +1132,7 @@ SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) <XRefItemParam3>"\""[^\n\"]*"\"" { // third argument xrefListTitle = stripQuotes(yytext); + xrefKind = XRef_Item; BEGIN( Comment ); } <XRefItemParam2>{LC} { // line continuation @@ -1570,18 +1650,21 @@ static void handleMainpage(const QCString &) static void handleFile(const QCString &) { makeStructuralIndicator(Entry::FILEDOC_SEC); + current->name = yyFileName; BEGIN( FileDocArg1 ); } static void handleDir(const QCString &) { makeStructuralIndicator(Entry::DIRDOC_SEC); + current->name = yyFileName; BEGIN( FileDocArg1 ); } static void handleExample(const QCString &) { makeStructuralIndicator(Entry::EXAMPLE_SEC); + current->name = yyFileName; BEGIN( FileDocArg1 ); } @@ -1599,32 +1682,34 @@ static void handleName(const QCString &) static void handleTodo(const QCString &) { - xrefKind = XRef_Todo; + newXRefKind = XRef_Todo; setOutput(OutputXRef); + xrefKind = XRef_Todo; } static void handleTest(const QCString &) { - xrefKind = XRef_Test; + newXRefKind = XRef_Test; setOutput(OutputXRef); + xrefKind = XRef_Test; } static void handleBug(const QCString &) { - xrefKind = XRef_Bug; + newXRefKind = XRef_Bug; setOutput(OutputXRef); + xrefKind = XRef_Bug; } static void handleDeprecated(const QCString &) { - xrefKind = XRef_Deprecated; + newXRefKind = XRef_Deprecated; setOutput(OutputXRef); + xrefKind = XRef_Deprecated; } static void handleXRefItem(const QCString &) { - xrefKind = XRef_Item; - setOutput(OutputXRef); BEGIN(XRefItemParam1); } @@ -1846,6 +1931,8 @@ bool parseCommentBlock(/* in,out */ Entry *curEntry, //inBody = foundInBody; protection = prot; needNewEntry = FALSE; + xrefKind = XRef_None; + xrefAppendFlag = FALSE; outputXRef.resize(0); setOutput( isBrief || isJavaDocStyle ? OutputBrief : OutputDoc ); briefEndsAtDot = isJavaDocStyle; diff --git a/src/config.l b/src/config.l index b09e47b..fa951cf 100644 --- a/src/config.l +++ b/src/config.l @@ -1479,12 +1479,19 @@ void Config::create() "all members of a group must be documented explicitly.\n", FALSE ); + cb = addBool( + "SEPARATE_MEMBER_PAGES", + "If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n" + "a new page for each member. If set to NO, the documentation of a member will \n" + "be part of the file/class/namespace that contains it.\n", + FALSE + ); ci = addInt( "TAB_SIZE", "The TAB_SIZE tag can be used to set the number of spaces in a tab. \n" "Doxygen uses this value to replace tabs by spaces in code fragments. \n", 1,16,8 - ); + ); cl = addList( "ALIASES", "This tag can be used to specify a number of aliases that acts \n" diff --git a/src/definition.cpp b/src/definition.cpp index 53968b2..c672125 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -785,7 +785,14 @@ void Definition::writePathFragment(OutputList &ol) const } if (isLinkable()) { - ol.writeObjectLink(getReference(),getOutputFileBase(),0,m_localName); + if (definitionType()==Definition::TypeGroup && ((const GroupDef*)this)->groupTitle()) + { + ol.writeObjectLink(getReference(),getOutputFileBase(),0,((const GroupDef*)this)->groupTitle()); + } + else + { + ol.writeObjectLink(getReference(),getOutputFileBase(),0,m_localName); + } } else { diff --git a/src/definition.h b/src/definition.h index a357f12..d4e4f7a 100644 --- a/src/definition.h +++ b/src/definition.h @@ -51,7 +51,7 @@ class Definition TypeNamespace, TypePackage, TypePage, TypeDir }; /*! Use this for dynamic inspection of the type of the derived class */ - virtual DefType definitionType() = 0; + virtual DefType definitionType() const = 0; /*! Create a new definition */ Definition( @@ -195,6 +195,7 @@ class Definition void writePathFragment(OutputList &ol) const; void writeNavigationPath(OutputList &ol) const; + virtual void writeQuickMemberLinks(OutputList &,MemberDef *) const {} protected: void setLocalName(const QCString name) { m_localName=name; } diff --git a/src/dirdef.h b/src/dirdef.h index 3eb9a68..57730d1 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -49,7 +49,7 @@ class DirDef : public Definition virtual ~DirDef(); // accessors - virtual DefType definitionType() { return TypeDir; } + virtual DefType definitionType() const { return TypeDir; } virtual QCString getOutputFileBase() const; virtual bool isLinkableInProject() const; virtual bool isLinkable() const; diff --git a/src/docparser.cpp b/src/docparser.cpp index 9a60a6b..03d30e1 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -3457,7 +3457,7 @@ int DocPara::handleXRefItem() { m_children.append(ref); } - else + else { delete ref; } diff --git a/src/docparser.h b/src/docparser.h index 6e24b4d..37a2036 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -557,6 +557,7 @@ class DocXRefItem : public CompAccept<DocXRefItem>, public DocNode QString title() const { return m_title; } DocNode *parent() const { return m_parent; } QString relPath() const { return m_relPath; } + QString key() const { return m_key; } void accept(DocVisitor *v) { CompAccept<DocXRefItem>::accept(this,v); } bool parse(); diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 063887a..a245cf0 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -369,6 +369,7 @@ static void buildFileList(Entry *root) { bool ambig; FileDef *fd=findFileDef(Doxygen::inputNameDict,root->name,ambig); + //printf("**************** root->name=%s fd=%p\n",root->name.data(),fd); if (fd && !ambig) { if ((!root->doc.isEmpty() && !fd->documentation().isEmpty()) || @@ -383,6 +384,7 @@ static void buildFileList(Entry *root) } else { + //printf("Adding documentation!\n"); // using FALSE in setDocumentation is small hack to make sure a file // is documented even if a \file command is used without further // documentation @@ -627,30 +629,47 @@ ArgumentList *getTemplateArgumentsFromName( static void addClassToContext(Entry *root) { - QCString fullName=removeRedundantWhiteSpace(root->name); - if (fullName.isEmpty()) - { - // this should not be called - warn(root->fileName,root->startLine, - "Warning: invalid class name found!" - ); - return; - } - Debug::print(Debug::Classes,0," Found class with raw name %s\n",fullName.data()); - - fullName=stripAnonymousNamespaceScope(fullName); - fullName=stripTemplateSpecifiersFromScope(fullName); - - Debug::print(Debug::Classes,0," Found class with name %s\n",fullName.data()); +// QCString fullName=removeRedundantWhiteSpace(root->name); +// +// if (fullName.isEmpty()) +// { +// // this should not be called +// warn(root->fileName,root->startLine, +// "Warning: invalid class name found!" +// ); +// return; +// } +// Debug::print(Debug::Classes,0," Found class with raw name %s\n",fullName.data()); +// +// fullName=stripAnonymousNamespaceScope(fullName); +// fullName=stripTemplateSpecifiersFromScope(fullName); +// +// Debug::print(Debug::Classes,0," Found class with name %s\n",fullName.data()); bool ambig; - ClassDef *cd; - //printf("findFileDef(%s)\n",root->fileName.data()); - FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); - if ((cd=getClass(fullName))) + NamespaceDef *nd = 0; + FileDef *fd = findFileDef(Doxygen::inputNameDict,root->fileName,ambig); + + // see if the using statement was found inside a namespace or inside + // the global file scope. + if (root->parent->section == Entry::NAMESPACE_SEC) + { + QCString scName=root->parent->name; + if (!scName.isEmpty()) + { + nd = getResolvedNamespace(scName); + } + } + QCString fullName = root->name; + ClassDef *cd = getResolvedClass(nd,fd,root->name,0,0,TRUE); + Debug::print(Debug::Classes,0, " Found class with name %s (cd=%p)\n", + cd ? cd->name().data() : root->name.data(), cd); + + if (cd) { - Debug::print(Debug::Classes,0," Existing class!\n",fullName.data()); + fullName=cd->name(); + Debug::print(Debug::Classes,0," Existing class %s!\n",cd->name().data()); //if (cd->templateArguments()==0) //{ // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data()); @@ -693,7 +712,7 @@ static void addClassToContext(Entry *root) cd->setBodyDef(findFileDef(Doxygen::inputNameDict,root->fileName,ambig)); } cd->addSectionsToDefinition(root->anchors); - cd->setName(fullName); // change name to match docs + //cd->setName(fullName); // change name to match docs } cd->setFileDef(fd); if (cd->hasDocumentation()) @@ -719,7 +738,7 @@ static void addClassToContext(Entry *root) // this happens if a template class declared with @class is found // before the actual definition. ArgumentList *tArgList = - getTemplateArgumentsFromName(fullName,root->tArgLists); + getTemplateArgumentsFromName(cd->name(),root->tArgLists); cd->setTemplateArguments(tArgList); } } @@ -1703,7 +1722,7 @@ static MemberDef *addVariableToFile( */ static int findFunctionPtr(const QCString &type,int *pLength=0) { - static const QRegExp re("([^)]*\\*"); + static const QRegExp re("([^)]*)"); int i=-1,l; if (!type.isEmpty() && // return type is non-empty (i=re.match(type,0,&l))!=-1 && // contains a (* @@ -2424,27 +2443,52 @@ static void buildFunctionList(Entry *root) md->addSectionsToDefinition(root->anchors); md->setMemberSpecifiers(root->memSpec); md->setMemberGroupId(root->mGrpId); + + // see if the function is inside a namespace + NamespaceDef *nd = 0; + QCString scope; + if (root->parent->section == Entry::NAMESPACE_SEC ) + { + QCString nscope=removeAnonymousScopes(root->parent->name); + if (!nscope.isEmpty()) + { + nd = getResolvedNamespace(nscope); + if (nd) + { + scope+=nd->name(); + if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) + { + scope+="."; + } + else + { + scope+="::"; + } + } + } + } + QCString def; if (!root->type.isEmpty()) { if (root->argList) { - def=root->type+" "+name; + def=root->type+" "+scope+name; } else { - def=root->type+" "+name+root->args; + def=root->type+" "+scope+name+root->args; } } else { if (root->argList) { - def=name.copy(); + def=scope+name.copy(); } else { - def=name+root->args; + def=scope+name+root->args; } } Debug::print(Debug::Functions,0, @@ -2465,17 +2509,6 @@ static void buildFunctionList(Entry *root) // md->setMemberGroup(memberGroupDict[root->mGrpId]); //} - // see if the function is inside a namespace - NamespaceDef *nd = 0; - if (root->parent->section == Entry::NAMESPACE_SEC ) - { - QCString nscope=removeAnonymousScopes(root->parent->name); - if (!nscope.isEmpty()) - { - nd = getResolvedNamespace(nscope); - } - } - md->setRefItems(root->sli); if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') { diff --git a/src/filedef.cpp b/src/filedef.cpp index ce8a38d..fba0573 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -501,6 +501,38 @@ void FileDef::writeDocumentation(OutputList &ol) writeDetailedDocumentation(ol); } + writeMemberDocumentation(ol); + + // write Author section (Man only) + ol.disableAllBut(OutputGenerator::Man); + ol.startGroupHeader(); + ol.parseText(theTranslator->trAuthor(TRUE,TRUE)); + ol.endGroupHeader(); + ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME"))); + ol.enableAll(); + + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + writeDocAnchorsToTagFile(); + Doxygen::tagFile << " </compound>" << endl; + } + + endFile(ol); + + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + allMemberList.sort(); + writeMemberPages(ol); + } +} + +void FileDef::writeMemberDocumentation(OutputList &ol) +{ + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + ol.disable(OutputGenerator::Html); + } + docDefineMembers.writeDocumentation(ol,name(),this, theTranslator->trDefineDocumentation()); @@ -518,22 +550,62 @@ void FileDef::writeDocumentation(OutputList &ol) docVarMembers.writeDocumentation(ol,name(),this, theTranslator->trVariableDocumentation()); + + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + ol.enable(OutputGenerator::Html); + } +} + +void FileDef::writeMemberPages(OutputList &ol) +{ + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); - // write Author section (Man only) - ol.disableAllBut(OutputGenerator::Man); - ol.startGroupHeader(); - ol.parseText(theTranslator->trAuthor(TRUE,TRUE)); - ol.endGroupHeader(); - ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME"))); - ol.enableAll(); + docDefineMembers.writeDocumentationPage(ol,name(),this); + docProtoMembers.writeDocumentationPage(ol,name(),this); + docTypedefMembers.writeDocumentationPage(ol,name(),this); + docEnumMembers.writeDocumentationPage(ol,name(),this); + docFuncMembers.writeDocumentationPage(ol,name(),this); + docVarMembers.writeDocumentationPage(ol,name(),this); + + ol.popGeneratorState(); +} - if (!Config_getString("GENERATE_TAGFILE").isEmpty()) +void FileDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +{ + ol.writeString(" <div class=\"navtab\">\n"); + ol.writeString(" <table>\n"); + + MemberListIterator mli(allMemberList); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) { - writeDocAnchorsToTagFile(); - Doxygen::tagFile << " </compound>" << endl; + if (md->getFileDef()==this && md->getNamespaceDef()==0 && md->isLinkable()) + { + ol.writeString(" <tr><td class=\"navtab\">"); + if (md->isLinkableInProject()) + { + if (md==currentMd) // selected item => highlight + { + ol.writeString("<a class=\"qindexHL\" "); + } + else + { + ol.writeString("<a class=\"qindex\" "); + } + ol.writeString("href=\""); + ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); + ol.writeString("\">"); + ol.writeString(md->localName()); + ol.writeString("</a>"); + } + ol.writeString("</td></tr>\n"); + } } - endFile(ol); + ol.writeString(" </table>\n"); + ol.writeString(" </div>\n"); } /*! Write a source listing of this file to the output */ diff --git a/src/filedef.h b/src/filedef.h index 6815117..6dcd726 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -69,7 +69,7 @@ class FileDef : public Definition FileDef(const char *p,const char *n,const char *ref=0,const char *dn=0); ~FileDef(); - DefType definitionType() { return TypeFile; } + DefType definitionType() const { return TypeFile; } /*! Returns the unique file name (this may include part of the path). */ QCString name() const @@ -126,6 +126,10 @@ class FileDef : public Definition void writeDetailedDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol); + void writeMemberDocumentation(OutputList &ol); + void writeMemberPages(OutputList &ol); + void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; + void writeSource(OutputList &ol); void parseSource(); friend void generatedFileNames(); diff --git a/src/groupdef.cpp b/src/groupdef.cpp index a39ec53..b3af64c 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -687,6 +687,32 @@ void GroupDef::writeDocumentation(OutputList &ol) } } + writeMemberDocumentation(ol); + + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + writeDocAnchorsToTagFile(); + Doxygen::tagFile << " </compound>" << endl; + } + + endFile(ol); + ol.popGeneratorState(); + + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + allMemberList->sort(); + writeMemberPages(ol); + } + +} + +void GroupDef::writeMemberDocumentation(OutputList &ol) +{ + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + ol.disable(OutputGenerator::Html); + } + docDefineMembers.writeDocumentation(ol,name(),this, theTranslator->trDefineDocumentation()); @@ -705,16 +731,65 @@ void GroupDef::writeDocumentation(OutputList &ol) docVarMembers.writeDocumentation(ol,name(),this, theTranslator->trVariableDocumentation()); - if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + if (Config_getBool("SEPARATE_MEMBER_PAGES")) { - writeDocAnchorsToTagFile(); - Doxygen::tagFile << " </compound>" << endl; + ol.enable(OutputGenerator::Html); } +} + +void GroupDef::writeMemberPages(OutputList &ol) +{ + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + + docDefineMembers.writeDocumentationPage(ol,name(),this); + docProtoMembers.writeDocumentationPage(ol,name(),this); + docTypedefMembers.writeDocumentationPage(ol,name(),this); + docEnumMembers.writeDocumentationPage(ol,name(),this); + docFuncMembers.writeDocumentationPage(ol,name(),this); + docVarMembers.writeDocumentationPage(ol,name(),this); - endFile(ol); ol.popGeneratorState(); } +void GroupDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +{ + ol.writeString(" <div class=\"navtab\">\n"); + ol.writeString(" <table>\n"); + + MemberListIterator mli(*allMemberList); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) + { + if (md->getGroupDef()==this && md->isLinkable()) + { + ol.writeString(" <tr><td class=\"navtab\">"); + if (md->isLinkableInProject()) + { + if (md==currentMd) // selected item => highlight + { + ol.writeString("<a class=\"qindexHL\" "); + } + else + { + ol.writeString("<a class=\"qindex\" "); + } + ol.writeString("href=\""); + ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); + ol.writeString("\">"); + ol.writeString(md->localName()); + ol.writeString("</a>"); + } + ol.writeString("</td></tr>\n"); + } + } + + ol.writeString(" </table>\n"); + ol.writeString(" </div>\n"); +} + + + //---- helper functions ------------------------------------------------------ void addClassToGroups(Entry *root,ClassDef *cd) diff --git a/src/groupdef.h b/src/groupdef.h index 5b48d52..1f594a0 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -45,7 +45,7 @@ class GroupDef : public Definition public: GroupDef(const char *fileName,int line,const char *name,const char *title,const char *refFileName=0); ~GroupDef(); - DefType definitionType() { return TypeGroup; } + DefType definitionType() const { return TypeGroup; } QCString getOutputFileBase() const; const char *groupTitle() const { return title; } void setGroupTitle( const char *newtitle ); @@ -63,6 +63,9 @@ class GroupDef : public Definition bool containsGroup(const GroupDef *def); // true if def is already a subgroup void writeDetailedDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol); + void writeMemberDocumentation(OutputList &ol); + void writeMemberPages(OutputList &ol); + void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; int countMembers() const; bool isLinkableInProject() const { diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index d40c6d1..a9583e6 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -78,6 +78,17 @@ static const char *defaultStyleSheet = " padding: 2px;\n" " line-height: 140%;\n" "}\n" +"DIV.navtab {\n" +" background-color: #eeeeff;\n" +" border: 1px solid #b0b0b0;\n" +" text-align: center;\n" +" margin: 2px;\n" +" margin-right: 15px;\n" +" padding: 2px;\n" +"}\n" +"TD.navtab {\n" +" font-size: 70%;\n" +"}\n" "A.qindex {\n" " text-decoration: none;\n" " font-weight: bold;\n" @@ -495,34 +506,6 @@ void HtmlGenerator::startFile(const char *name,const char *, << versionString << " -->" << endl; } -//void HtmlGenerator::startQuickIndexItem(const char *s,const char *l) -//{ -// QCString *dest; -// if (s) -// { -// t << "<a class=\"qindexRef\" "; -// t << "doxygen=\"" << s << ":"; -// if ((dest=Doxygen::tagDestinationDict[s])) t << *dest; -// if (strcmp(s,"_cgi")!=0) t << "/"; // small hack to get the cgi binary link right -// t << "\" "; -// } -// else -// { -// t << "<a class=\"qindex\" "; -// } -// t << "href=\""; -// if (s) -// { -// if ((dest=Doxygen::tagDestinationDict[s])) t << *dest; -// if (strcmp(s,"_cgi")!=0) t << "/"; -// } -// t << l << "\">"; -//} -// -//void HtmlGenerator::endQuickIndexItem() -//{ -// t << "</a> "; -//} static void writePageFooter(QTextStream &t,const QCString &lastTitle, const QCString relPath) diff --git a/src/htmlgen.h b/src/htmlgen.h index ba1b4b7..e6e99c9 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -36,7 +36,8 @@ class HtmlGenerator : public OutputGenerator static void writeHeaderFile(QFile &f); static void writeFooterFile(QFile &f); - void enable() { active=TRUE; } + void enable() + { if (genStack->top()) active=*genStack->top(); else active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==Html) active=TRUE; } void disableIf(OutputType o) { if (o==Html) active=FALSE; } diff --git a/src/index.cpp b/src/index.cpp index bb22283..b4f2d36 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -38,6 +38,9 @@ #include "pagedef.h" #include "dirdef.h" +#define MAX_ITEMS_BEFORE_MULTIPAGE_INDEX 200 +#define MAX_ITEMS_BEFORE_QUICK_INDEX 30 + int annotatedClasses; int hierarchyClasses; int documentedFiles; @@ -122,7 +125,7 @@ static bool g_fileIndexLetterUsed[FMHL_Total][256]; static bool g_namespaceIndexLetterUsed[NMHL_Total][256]; static bool g_classIndexLetterUsed[CHL_Total][256]; -const int maxItemsBeforeQuickIndex = 30; +const int maxItemsBeforeQuickIndex = MAX_ITEMS_BEFORE_QUICK_INDEX; //---------------------------------------------------------------------------- @@ -1508,7 +1511,8 @@ void writeAnnotatedIndex(OutputList &ol) //---------------------------------------------------------------------------- -void writeMemberList(OutputList &ol,bool useSections,ClassMemberHighlight filter) +void writeMemberList(OutputList &ol,bool useSections, + ClassMemberHighlight filter,char sectionFilter) { bool first = TRUE; char lastChar = 0; @@ -1517,89 +1521,92 @@ void writeMemberList(OutputList &ol,bool useSections,ClassMemberHighlight filter MemberName *mn=0; for (mnli.toFirst();(mn=mnli.current());++mnli) { - MemberDef *md=mn->first(); - bool found=FALSE; - bool isFunc=FALSE; - while (md && !found) + if (sectionFilter==0 || tolower(sectionFilter)==tolower(mn->memberName()[0])) { - ClassDef *cd; - bool isFriendToHide = Config_getBool("HIDE_FRIEND_COMPOUNDS") && - (QCString(md->typeString())=="friend class" || - QCString(md->typeString())=="friend struct" || - QCString(md->typeString())=="friend union"); - if ( - md->isLinkableInProject() && - (cd=md->getClassDef()) && - cd->isLinkableInProject() && cd->templateMaster()==0 && - ( filter==CMHL_All && !(md->isFriend() && isFriendToHide) || - (filter==CMHL_Functions && (md->isFunction() || md->isSlot() || md->isSignal())) || - (filter==CMHL_Variables && md->isVariable()) || - (filter==CMHL_Typedefs && md->isTypedef()) || - (filter==CMHL_Enums && md->isEnumerate()) || - (filter==CMHL_EnumValues && md->isEnumValue()) || - (filter==CMHL_Properties && md->isProperty()) || - (filter==CMHL_Events && md->isEvent()) || - (filter==CMHL_Related && (md->isRelated() || (md->isFriend() && !isFriendToHide))) - ) - ) - { - found=TRUE; - isFunc=!md->isObjCMethod() && - (md->isFunction() || md->isSlot() || md->isSignal()); + MemberDef *md=mn->first(); + bool found=FALSE; + bool isFunc=FALSE; + while (md && !found) + { + ClassDef *cd; + bool isFriendToHide = Config_getBool("HIDE_FRIEND_COMPOUNDS") && + (QCString(md->typeString())=="friend class" || + QCString(md->typeString())=="friend struct" || + QCString(md->typeString())=="friend union"); + if ( + md->isLinkableInProject() && + (cd=md->getClassDef()) && + cd->isLinkableInProject() && cd->templateMaster()==0 && + ( (filter==CMHL_All && !(md->isFriend() && isFriendToHide)) || + (filter==CMHL_Functions && (md->isFunction() || md->isSlot() || md->isSignal())) || + (filter==CMHL_Variables && md->isVariable()) || + (filter==CMHL_Typedefs && md->isTypedef()) || + (filter==CMHL_Enums && md->isEnumerate()) || + (filter==CMHL_EnumValues && md->isEnumValue()) || + (filter==CMHL_Properties && md->isProperty()) || + (filter==CMHL_Events && md->isEvent()) || + (filter==CMHL_Related && (md->isRelated() || (md->isFriend() && !isFriendToHide))) + ) + ) + { + found=TRUE; + isFunc=!md->isObjCMethod() && + (md->isFunction() || md->isSlot() || md->isSignal()); + } + md=mn->next(); } - md=mn->next(); - } - if (found) - { - if (useSections) + if (found) { - QCString name = mn->memberName(); - if (tolower(name.at(0))!=lastChar) + if (useSections) + { + QCString name = mn->memberName(); + if (tolower(name.at(0))!=lastChar) + { + if (!first) ol.endItemList(); + char cs[2]; + lastChar=cs[0]=tolower(name.at(0));cs[1]='\0'; + QCString anchor=(QCString)"index_"+cs; + QCString title=(QCString)"- "+cs+" -"; + ol.startSection(anchor,title,SectionInfo::Subsection); + ol.docify(title); + ol.endSection(anchor,SectionInfo::Subsection); + ol.startItemList(); + first=FALSE; + } + } + else if (first) { - if (!first) ol.endItemList(); - char cs[2]; - lastChar=cs[0]=tolower(name.at(0));cs[1]='\0'; - QCString anchor=(QCString)"index_"+cs; - QCString title=(QCString)"- "+cs+" -"; - ol.startSection(anchor,title,SectionInfo::Subsection); - ol.docify(title); - ol.endSection(anchor,SectionInfo::Subsection); - ol.startItemList(); first=FALSE; + ol.startItemList(); } - } - else if (first) - { - first=FALSE; - ol.startItemList(); - } - ol.writeListItem(); - ol.docify(mn->memberName()); - if (isFunc) ol.docify("()"); - ol.writeString("\n"); - - int count=0; - md=mn->last(); - QCString prevName; - while (md) - { - ClassDef *cd=md->getClassDef(); - if ( - md->isLinkableInProject() && - prevName!=cd->displayName() && - cd->templateMaster()==0 - ) + ol.writeListItem(); + ol.docify(mn->memberName()); + if (isFunc) ol.docify("()"); + ol.writeString("\n"); + + int count=0; + md=mn->last(); + QCString prevName; + while (md) { - if (count==0) - ol.docify(": "); - else - ol.docify(", "); - ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(), - cd->displayName()); - count++; - prevName=cd->displayName(); + ClassDef *cd=md->getClassDef(); + if ( + md->isLinkableInProject() && + prevName!=cd->displayName() && + cd->templateMaster()==0 + ) + { + if (count==0) + ol.docify(": "); + else + ol.docify(", "); + ol.writeObjectLink(md->getReference(),md->getOutputFileBase(),md->anchor(), + cd->displayName()); + count++; + prevName=cd->displayName(); + } + md=mn->prev(); } - md=mn->prev(); } } } @@ -1657,18 +1664,26 @@ int countClassMembers(int filter) //---------------------------------------------------------------------------- -void writeQuickMemberIndex(OutputList &ol,bool *charUsed) +void writeQuickMemberIndex(OutputList &ol,bool *charUsed,int page, + QCString fullName,bool multiPage) { bool first=TRUE; int i; ol.writeString("<div class=\"qindex\">"); for (i=33;i<127;i++) { - QCString anchor="#index_"; char is[2];is[0]=(char)i;is[1]='\0'; if (charUsed[i]) { - startQuickIndexItem(ol,anchor+is,FALSE,TRUE,first); + QCString anchor; + QCString extension=Doxygen::htmlFileExtension; + if (!multiPage) + anchor="#index_"; + else if (first) + anchor=fullName+extension+"#index_"; + else + anchor=fullName+QCString().sprintf("_0x%02x",i)+extension+"#index_"; + startQuickIndexItem(ol,anchor+is,i==page,TRUE,first); ol.writeString(is); endQuickIndexItem(ol); first=FALSE; @@ -1680,133 +1695,146 @@ void writeQuickMemberIndex(OutputList &ol,bool *charUsed) //---------------------------------------------------------------------------- -static void writeMemberIndexFiltered(OutputList &ol, - const char *fileName,ClassMemberHighlight hl, - const QCString& title) +static void writeMemberIndexFiltered(OutputList &ol, ClassMemberHighlight hl) { if (documentedClassMembers[hl]==0) return; + + bool multiPageIndex=FALSE; + int numPages=1; + if (documentedClassMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX) + { + multiPageIndex=TRUE; + numPages=127; + } + + struct + { + const char *fname; + QCString title; + } cmhlInfo[] = + { + { "functions", 0 }, + { "functions_func",0 }, + { "functions_vars",0 }, + { "functions_type",0 }, + { "functions_enum",0 }, + { "functions_eval",0 }, + { "functions_rela",0 }, + { "functions_prop",0 }, + { "functions_evnt",0 }, + { "functions_rela",0 }, + }; + + cmhlInfo[0].title=theTranslator->trAll(); + cmhlInfo[1].title=theTranslator->trFunctions(); + cmhlInfo[2].title=theTranslator->trVariables(); + cmhlInfo[3].title=theTranslator->trTypedefs(); + cmhlInfo[4].title=theTranslator->trEnumerations(); + cmhlInfo[5].title=theTranslator->trEnumerationValues(); + cmhlInfo[6].title=theTranslator->trProperties(); + cmhlInfo[7].title=theTranslator->trEvents(); + cmhlInfo[8].title=theTranslator->trRelatedFunctions(); + ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - startFile(ol,fileName,0,title.data(),HLI_Functions); - QCString htmlHelpTitle = title; - QCString ftvHelpTitle = title; - - ol.writeString("<div class=\"qindex\">"); + QCString extension=Doxygen::htmlFileExtension; + QCString title = theTranslator->trCompoundMembers(); + if (hl!=CMHL_All) title+=(QCString)" - "+cmhlInfo[hl].title; + + int page; bool first=TRUE; - startQuickIndexItem(ol, - "functions"+Doxygen::htmlFileExtension,hl==CMHL_All,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trAll())); - endQuickIndexItem(ol); - - if (documentedClassMembers[CMHL_Functions]>0) - { - startQuickIndexItem(ol, - "functions_func"+Doxygen::htmlFileExtension,hl==CMHL_Functions,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trFunctions())); - endQuickIndexItem(ol); - } - if (documentedClassMembers[CMHL_Variables]>0) - { - startQuickIndexItem(ol, - "functions_vars"+Doxygen::htmlFileExtension,hl==CMHL_Variables,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trVariables())); - endQuickIndexItem(ol); - } - if (documentedClassMembers[CMHL_Typedefs]>0) - { - startQuickIndexItem(ol, - "functions_type"+Doxygen::htmlFileExtension,hl==CMHL_Typedefs,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trTypedefs())); - endQuickIndexItem(ol); - } - if (documentedClassMembers[CMHL_Enums]>0) + for (page=0;page<numPages;page++) { - startQuickIndexItem(ol, - "functions_enum"+Doxygen::htmlFileExtension,hl==CMHL_Enums,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trEnumerations())); - endQuickIndexItem(ol); - } - if (documentedClassMembers[CMHL_EnumValues]>0) - { - startQuickIndexItem(ol, - "functions_eval"+Doxygen::htmlFileExtension,hl==CMHL_EnumValues,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trEnumerationValues())); - endQuickIndexItem(ol); - } - if (documentedClassMembers[CMHL_Properties]>0) - { - startQuickIndexItem(ol, - "functions_prop"+Doxygen::htmlFileExtension,hl==CMHL_Properties,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trProperties())); - endQuickIndexItem(ol); - } - if (documentedClassMembers[CMHL_Events]>0) - { - startQuickIndexItem(ol, - "functions_evnt"+Doxygen::htmlFileExtension,hl==CMHL_Events,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trEvents())); - endQuickIndexItem(ol); - } - if (documentedClassMembers[CMHL_Related]>0) - { - startQuickIndexItem(ol, - "functions_rela"+Doxygen::htmlFileExtension,hl==CMHL_Related,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trRelatedFunctions())); - endQuickIndexItem(ol); - } - ol.writeString("</div>\n"); - - bool quickIndex = documentedClassMembers[hl]>maxItemsBeforeQuickIndex; - if (quickIndex) - { - writeQuickMemberIndex(ol,g_memberIndexLetterUsed[hl]); - } - ol.newParagraph(); - if (hl==CMHL_All) - { - bool &generateHtml = Config_getBool("GENERATE_HTML") ; - bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); - bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); - if (hasHtmlHelp) + if (!multiPageIndex || g_memberIndexLetterUsed[hl][page]) { - HtmlHelp *htmlHelp = HtmlHelp::getInstance(); - htmlHelp->addContentsItem(FALSE,htmlHelpTitle,"functions"); - } - if (hasFtvHelp) - { - FTVHelp *ftvHelp = FTVHelp::getInstance(); - ftvHelp->addContentsItem(FALSE,0,"functions",0,ftvHelpTitle); + QCString fileName = cmhlInfo[hl].fname; + if (multiPageIndex && !first) + { + fileName+=QCString().sprintf("_0x%02x",page); + } + + startFile(ol,fileName+extension,0,title,HLI_Functions); + + ol.writeString("<div class=\"qindex\">"); + + // index item for global member list + startQuickIndexItem(ol, + cmhlInfo[0].fname+Doxygen::htmlFileExtension,hl==CMHL_All,TRUE,first); + ol.writeString(fixSpaces(cmhlInfo[0].title)); + endQuickIndexItem(ol); + + // index items per category member lists + int i; + for (i=1;i<CMHL_Total;i++) + { + if (documentedClassMembers[i]>0) + { + startQuickIndexItem(ol,cmhlInfo[i].fname+Doxygen::htmlFileExtension,hl==i,TRUE,first); + ol.writeString(fixSpaces(cmhlInfo[i].title)); + //printf("multiPageIndex=%d first=%d fileName=%s file=%s title=%s\n", + // multiPageIndex,first,fileName.data(),cmhlInfo[i].fname,cmhlInfo[i].title.data()); + endQuickIndexItem(ol); + } + } + + ol.writeString("</div>\n"); + + // quick alphabetical index + bool quickIndex = documentedClassMembers[hl]>maxItemsBeforeQuickIndex; + if (quickIndex) + { + writeQuickMemberIndex(ol,g_memberIndexLetterUsed[hl],page, + cmhlInfo[hl].fname,multiPageIndex); + } + if (hl==CMHL_All) + { + ol.parseText(theTranslator->trCompoundMembersDescription(Config_getBool("EXTRACT_ALL"))); + } + ol.newParagraph(); + writeMemberList(ol,quickIndex,hl,page); + endFile(ol); + first=FALSE; } - ol.parseText(theTranslator->trCompoundMembersDescription(Config_getBool("EXTRACT_ALL"))); } - writeMemberList(ol,quickIndex,hl); - endFile(ol); + ol.popGeneratorState(); } void writeMemberIndex(OutputList &ol) { - QCString ext=Doxygen::htmlFileExtension; - QCString title = theTranslator->trCompoundMembers(); - writeMemberIndexFiltered(ol,"functions"+ext,CMHL_All,title); - title += " - "; - writeMemberIndexFiltered(ol,"functions_func"+ext,CMHL_Functions, title + theTranslator->trFunctions()); - writeMemberIndexFiltered(ol,"functions_vars"+ext,CMHL_Variables, title + theTranslator->trVariables()); - writeMemberIndexFiltered(ol,"functions_type"+ext,CMHL_Typedefs, title + theTranslator->trTypedefs()); - writeMemberIndexFiltered(ol,"functions_enum"+ext,CMHL_Enums, title + theTranslator->trEnumerations()); - writeMemberIndexFiltered(ol,"functions_eval"+ext,CMHL_EnumValues, title + theTranslator->trEnumerationValues()); - writeMemberIndexFiltered(ol,"functions_prop"+ext,CMHL_Properties, title + theTranslator->trProperties()); - writeMemberIndexFiltered(ol,"functions_evnt"+ext,CMHL_Events, title + theTranslator->trEvents()); - writeMemberIndexFiltered(ol,"functions_rela"+ext,CMHL_Related, title + theTranslator->trRelatedFunctions()); + writeMemberIndexFiltered(ol,CMHL_All); + writeMemberIndexFiltered(ol,CMHL_Functions); + writeMemberIndexFiltered(ol,CMHL_Variables); + writeMemberIndexFiltered(ol,CMHL_Typedefs); + writeMemberIndexFiltered(ol,CMHL_Enums); + writeMemberIndexFiltered(ol,CMHL_EnumValues); + writeMemberIndexFiltered(ol,CMHL_Properties); + writeMemberIndexFiltered(ol,CMHL_Events); + writeMemberIndexFiltered(ol,CMHL_Related); + QCString title = theTranslator->trCompoundMembers(); + bool &generateHtml = Config_getBool("GENERATE_HTML") ; + bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); + bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); + if (hasHtmlHelp) + { + HtmlHelp *htmlHelp = HtmlHelp::getInstance(); + htmlHelp->addContentsItem(FALSE,title,"functions"); + } + if (hasFtvHelp) + { + FTVHelp *ftvHelp = FTVHelp::getInstance(); + ftvHelp->addContentsItem(FALSE,0,"functions",0,title); + } } //---------------------------------------------------------------------------- static void writeFileMemberList(OutputList &ol, bool useSections, - FileMemberHighlight filter) + FileMemberHighlight filter, + char sectionFilter) { char lastChar=0; bool first=TRUE; @@ -1814,83 +1842,86 @@ static void writeFileMemberList(OutputList &ol, MemberName *mn=0; for (mnli.toFirst();(mn=mnli.current());++mnli) { - MemberDef *md=mn->first(); - bool found=FALSE; - while (md && !found) + if (sectionFilter==0 || tolower(sectionFilter)==tolower(mn->memberName()[0])) { - FileDef *fd=md->getFileDef(); - bool hasDocs = md->getFileDef() && - md->getFileDef()->isLinkableInProject(); - - if (fd && hasDocs && - md->isLinkableInProject() && - ( filter==FMHL_All || - (filter==FMHL_Functions && md->isFunction()) || - (filter==FMHL_Variables && md->isVariable()) || - (filter==FMHL_Typedefs && md->isTypedef()) || - (filter==FMHL_Enums && md->isEnumerate()) || - (filter==FMHL_EnumValues && md->isEnumValue()) || - (filter==FMHL_Defines && md->isDefine()) - ) - ) + MemberDef *md=mn->first(); + bool found=FALSE; + while (md && !found) { - found=TRUE; - } - else - { - md=mn->next(); + FileDef *fd=md->getFileDef(); + bool hasDocs = md->getFileDef() && + md->getFileDef()->isLinkableInProject(); + + if (fd && hasDocs && + md->isLinkableInProject() && + ( filter==FMHL_All || + (filter==FMHL_Functions && md->isFunction()) || + (filter==FMHL_Variables && md->isVariable()) || + (filter==FMHL_Typedefs && md->isTypedef()) || + (filter==FMHL_Enums && md->isEnumerate()) || + (filter==FMHL_EnumValues && md->isEnumValue()) || + (filter==FMHL_Defines && md->isDefine()) + ) + ) + { + found=TRUE; + } + else + { + md=mn->next(); + } } - } - if (found) // function is documented - { - if (useSections) + if (found) // function is documented { - QCString name = mn->memberName(); - if (tolower(name.at(0))!=lastChar) + if (useSections) + { + QCString name = mn->memberName(); + if (tolower(name.at(0))!=lastChar) + { + if (!first) ol.endItemList(); + char cs[2]; + lastChar=cs[0]=tolower(name.at(0));cs[1]='\0'; + QCString anchor=(QCString)"index_"+cs; + QCString title=(QCString)"- "+cs+" -"; + ol.startSection(anchor,title,SectionInfo::Subsection); + ol.docify(title); + ol.endSection(anchor,SectionInfo::Subsection); + ol.startItemList(); + first=FALSE; + } + } + else if (first) { - if (!first) ol.endItemList(); - char cs[2]; - lastChar=cs[0]=tolower(name.at(0));cs[1]='\0'; - QCString anchor=(QCString)"index_"+cs; - QCString title=(QCString)"- "+cs+" -"; - ol.startSection(anchor,title,SectionInfo::Subsection); - ol.docify(title); - ol.endSection(anchor,SectionInfo::Subsection); - ol.startItemList(); first=FALSE; + ol.startItemList(); } - } - else if (first) - { - first=FALSE; - ol.startItemList(); - } - ol.writeListItem(); - ol.docify(md->name()); - if (md->isFunction()) ol.docify("()"); - ol.writeString("\n"); - - int count=0; - md=mn->last(); - QCString prevName; - while (md) - { - FileDef *fd=md->getFileDef(); - if (fd && fd->isLinkableInProject() && - md->isLinkableInProject() && - prevName!=fd->name()) + ol.writeListItem(); + ol.docify(md->name()); + if (md->isFunction()) ol.docify("()"); + ol.writeString("\n"); + + int count=0; + md=mn->last(); + QCString prevName; + while (md) { - if (count==0) - ol.docify(": "); - else - ol.docify(", "); - QCString baseName=fd->name(); - ol.writeObjectLink(md->getReference(), - md->getOutputFileBase(),md->anchor(), baseName); - count++; - prevName=fd->name(); + FileDef *fd=md->getFileDef(); + if (fd && fd->isLinkableInProject() && + md->isLinkableInProject() && + prevName!=fd->name()) + { + if (count==0) + ol.docify(": "); + else + ol.docify(", "); + QCString baseName=fd->name(); + ol.writeObjectLink(md->getReference(), + md->getOutputFileBase(),md->anchor(), baseName); + count++; + prevName=fd->name(); + } + md=mn->prev(); } - md=mn->prev(); } } } @@ -1900,7 +1931,8 @@ static void writeFileMemberList(OutputList &ol, //---------------------------------------------------------------------------- void writeNamespaceMemberList(OutputList &ol,bool useSections, - NamespaceMemberHighlight filter) + NamespaceMemberHighlight filter, + char sectionFilter) { char lastChar=0; bool first=TRUE; @@ -1908,77 +1940,80 @@ void writeNamespaceMemberList(OutputList &ol,bool useSections, MemberName *mn=0; for (mnli.toFirst();(mn=mnli.current());++mnli) { - MemberDef *md=mn->first(); - bool found=FALSE; - while (md && !found) + if (sectionFilter==0 || tolower(sectionFilter)==tolower(mn->memberName()[0])) { - NamespaceDef *nd=md->getNamespaceDef(); - if (nd && nd->isLinkableInProject() && md->isLinkableInProject() && - ( filter==NMHL_All || - (filter==NMHL_Functions && md->isFunction()) || - (filter==NMHL_Variables && md->isVariable()) || - (filter==NMHL_Typedefs && md->isTypedef()) || - (filter==NMHL_Enums && md->isEnumerate()) || - (filter==NMHL_EnumValues && md->isEnumValue()) - ) - ) - { - found=TRUE; - } - else + MemberDef *md=mn->first(); + bool found=FALSE; + while (md && !found) { - md=mn->next(); + NamespaceDef *nd=md->getNamespaceDef(); + if (nd && nd->isLinkableInProject() && md->isLinkableInProject() && + ( filter==NMHL_All || + (filter==NMHL_Functions && md->isFunction()) || + (filter==NMHL_Variables && md->isVariable()) || + (filter==NMHL_Typedefs && md->isTypedef()) || + (filter==NMHL_Enums && md->isEnumerate()) || + (filter==NMHL_EnumValues && md->isEnumValue()) + ) + ) + { + found=TRUE; + } + else + { + md=mn->next(); + } } - } - if (found) // member is documented and in a documented namespace - { - if (useSections) + if (found) // member is documented and in a documented namespace { - QCString name = mn->memberName(); - if (tolower(name.at(0))!=lastChar) + if (useSections) + { + QCString name = mn->memberName(); + if (tolower(name.at(0))!=lastChar) + { + if (!first) ol.endItemList(); + char cs[2]; + lastChar=cs[0]=tolower(name.at(0));cs[1]='\0'; + QCString anchor=(QCString)"index_"+cs; + QCString title=(QCString)"- "+cs+" -"; + ol.startSection(anchor,title,SectionInfo::Subsection); + ol.docify(title); + ol.endSection(anchor,SectionInfo::Subsection); + ol.startItemList(); + first=FALSE; + } + } + else if (first) { - if (!first) ol.endItemList(); - char cs[2]; - lastChar=cs[0]=tolower(name.at(0));cs[1]='\0'; - QCString anchor=(QCString)"index_"+cs; - QCString title=(QCString)"- "+cs+" -"; - ol.startSection(anchor,title,SectionInfo::Subsection); - ol.docify(title); - ol.endSection(anchor,SectionInfo::Subsection); ol.startItemList(); first=FALSE; } - } - else if (first) - { - ol.startItemList(); - first=FALSE; - } - ol.writeListItem(); - ol.docify(md->name()); - if (md->isFunction()) ol.docify("()"); - ol.writeString("\n"); - - int count=0; - md=mn->last(); - QCString prevName; - while (md) - { - NamespaceDef *nd=md->getNamespaceDef(); - if (nd && nd->isLinkableInProject() && md->isLinkableInProject() && - prevName!=nd->name() - ) + ol.writeListItem(); + ol.docify(md->name()); + if (md->isFunction()) ol.docify("()"); + ol.writeString("\n"); + + int count=0; + md=mn->last(); + QCString prevName; + while (md) { - if (count==0) - ol.docify(": "); - else - ol.docify(", "); - ol.writeObjectLink(md->getReference(),md->getOutputFileBase(), - md->anchor(),nd->name()); - count++; - prevName=nd->name(); + NamespaceDef *nd=md->getNamespaceDef(); + if (nd && nd->isLinkableInProject() && md->isLinkableInProject() && + prevName!=nd->name() + ) + { + if (count==0) + ol.docify(": "); + else + ol.docify(", "); + ol.writeObjectLink(md->getReference(),md->getOutputFileBase(), + md->anchor(),nd->name()); + count++; + prevName=nd->name(); + } + md=mn->prev(); } - md=mn->prev(); } } } @@ -2067,215 +2102,248 @@ int countFileMembers(int filter) //---------------------------------------------------------------------------- -static void writeFileMemberIndexFiltered(OutputList &ol, - const char *fileName,FileMemberHighlight hl, - const QCString& title) +static void writeFileMemberIndexFiltered(OutputList &ol, FileMemberHighlight hl) { if (documentedFileMembers[hl]==0) return; - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - startFile(ol,fileName,0,title.data(),HLI_Globals); - QCString htmlHelpTitle = title; - QCString ftvHelpTitle = title; - ol.writeString("<div class=\"qindex\">"); - - bool first=TRUE; - startQuickIndexItem(ol, - "globals"+Doxygen::htmlFileExtension,hl==FMHL_All,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trAll())); - endQuickIndexItem(ol); - - if (documentedFileMembers[FMHL_Functions]>0) - { - startQuickIndexItem(ol, - "globals_func"+Doxygen::htmlFileExtension,hl==FMHL_Functions,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trFunctions())); - endQuickIndexItem(ol); - } - if (documentedFileMembers[FMHL_Variables]>0) - { - startQuickIndexItem(ol, - "globals_vars"+Doxygen::htmlFileExtension,hl==FMHL_Variables,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trVariables())); - endQuickIndexItem(ol); - } - if (documentedFileMembers[FMHL_Typedefs]>0) - { - startQuickIndexItem(ol, - "globals_type"+Doxygen::htmlFileExtension,hl==FMHL_Typedefs,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trTypedefs())); - endQuickIndexItem(ol); - } - if (documentedFileMembers[FMHL_Enums]>0) + bool multiPageIndex=FALSE; + int numPages=1; + if (documentedFileMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX) { - startQuickIndexItem(ol, - "globals_enum"+Doxygen::htmlFileExtension,hl==FMHL_Enums,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trEnumerations())); - endQuickIndexItem(ol); + multiPageIndex=TRUE; + numPages=127; } - if (documentedFileMembers[FMHL_EnumValues]>0) + + struct { - startQuickIndexItem(ol, - "globals_eval"+Doxygen::htmlFileExtension,hl==FMHL_EnumValues,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trEnumerationValues())); - endQuickIndexItem(ol); - } - if (documentedFileMembers[FMHL_Defines]>0) + const char *fname; + QCString title; + } fmhlInfo[] = { - startQuickIndexItem(ol, - "globals_defs"+Doxygen::htmlFileExtension,hl==FMHL_Defines,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trDefines())); - endQuickIndexItem(ol); - } - ol.writeString("</div>\n"); - + { "globals", 0 }, + { "globals_func",0 }, + { "globals_vars",0 }, + { "globals_type",0 }, + { "globals_enum",0 }, + { "globals_eval",0 }, + { "globals_defs",0 } + }; + fmhlInfo[0].title=theTranslator->trAll(); + fmhlInfo[1].title=theTranslator->trFunctions(); + fmhlInfo[2].title=theTranslator->trVariables(); + fmhlInfo[3].title=theTranslator->trTypedefs(); + fmhlInfo[4].title=theTranslator->trEnumerations(); + fmhlInfo[5].title=theTranslator->trEnumerationValues(); + fmhlInfo[6].title=theTranslator->trDefines(); - bool quickIndex = documentedFileMembers[hl]>maxItemsBeforeQuickIndex; - if (quickIndex) - { - writeQuickMemberIndex(ol,g_fileIndexLetterUsed[hl]); - } - ol.newParagraph(); - if (hl==FMHL_All) + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + + QCString extension=Doxygen::htmlFileExtension; + QCString title = theTranslator->trCompoundMembers(); + + int page; + bool first=TRUE; + for (page=0;page<numPages;page++) { - bool &generateHtml = Config_getBool("GENERATE_HTML") ; - bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); - bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); - if (hasHtmlHelp) + if (!multiPageIndex || g_fileIndexLetterUsed[hl][page]) { - HtmlHelp *htmlHelp = HtmlHelp::getInstance(); - htmlHelp->addContentsItem(FALSE,htmlHelpTitle,"globals"); - } - if (hasFtvHelp) - { - FTVHelp *ftvHelp = FTVHelp::getInstance(); - ftvHelp->addContentsItem(FALSE,0,"globals",0,ftvHelpTitle); + QCString fileName = fmhlInfo[hl].fname; + if (multiPageIndex && !first) + { + fileName+=QCString().sprintf("_0x%02x",page); + } + + startFile(ol,fileName+extension,0,title.data(),HLI_Globals); + + ol.writeString("<div class=\"qindex\">"); + + // index item for all member lists + startQuickIndexItem(ol, + fmhlInfo[0].fname+Doxygen::htmlFileExtension,hl==FMHL_All,TRUE,first); + ol.writeString(fixSpaces(fmhlInfo[0].title)); + endQuickIndexItem(ol); + + int i; + // index items for per category member lists + for (i=1;i<FMHL_Total;i++) + { + if (documentedFileMembers[i]>0) + { + startQuickIndexItem(ol, + fmhlInfo[i].fname+Doxygen::htmlFileExtension,hl==i,TRUE,first); + ol.writeString(fixSpaces(fmhlInfo[i].title)); + endQuickIndexItem(ol); + } + } + + ol.writeString("</div>\n"); + + bool quickIndex = documentedFileMembers[hl]>maxItemsBeforeQuickIndex; + if (quickIndex) + { + writeQuickMemberIndex(ol,g_fileIndexLetterUsed[hl],page, + fmhlInfo[hl].fname,multiPageIndex); + } + + if (hl==FMHL_All) + { + ol.parseText(theTranslator->trFileMembersDescription(Config_getBool("EXTRACT_ALL"))); + } + ol.newParagraph(); + writeFileMemberList(ol,quickIndex,hl,page); + endFile(ol); + first=FALSE; } - ol.parseText(theTranslator->trFileMembersDescription(Config_getBool("EXTRACT_ALL"))); } - writeFileMemberList(ol,quickIndex,hl); - endFile(ol); ol.popGeneratorState(); } void writeFileMemberIndex(OutputList &ol) { - QCString ext=Doxygen::htmlFileExtension; + writeFileMemberIndexFiltered(ol,FMHL_All); + writeFileMemberIndexFiltered(ol,FMHL_Functions); + writeFileMemberIndexFiltered(ol,FMHL_Variables); + writeFileMemberIndexFiltered(ol,FMHL_Typedefs); + writeFileMemberIndexFiltered(ol,FMHL_Enums); + writeFileMemberIndexFiltered(ol,FMHL_EnumValues); + writeFileMemberIndexFiltered(ol,FMHL_Defines); + QCString title = theTranslator->trFileMembers(); - writeFileMemberIndexFiltered(ol,"globals"+ext,FMHL_All, title); - title += " - "; - writeFileMemberIndexFiltered(ol,"globals_func"+ext,FMHL_Functions, title + theTranslator->trFunctions()); - writeFileMemberIndexFiltered(ol,"globals_vars"+ext,FMHL_Variables, title + theTranslator->trVariables()); - writeFileMemberIndexFiltered(ol,"globals_type"+ext,FMHL_Typedefs, title + theTranslator->trTypedefs()); - writeFileMemberIndexFiltered(ol,"globals_enum"+ext,FMHL_Enums, title + theTranslator->trEnumerations()); - writeFileMemberIndexFiltered(ol,"globals_eval"+ext,FMHL_EnumValues, title + theTranslator->trEnumerationValues()); - writeFileMemberIndexFiltered(ol,"globals_defs"+ext,FMHL_Defines, title + theTranslator->trDefines()); + bool &generateHtml = Config_getBool("GENERATE_HTML") ; + bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); + bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); + if (hasHtmlHelp) + { + HtmlHelp *htmlHelp = HtmlHelp::getInstance(); + htmlHelp->addContentsItem(FALSE,title,"globals"); + } + if (hasFtvHelp) + { + FTVHelp *ftvHelp = FTVHelp::getInstance(); + ftvHelp->addContentsItem(FALSE,0,"globals",0,title); + } } //---------------------------------------------------------------------------- static void writeNamespaceMemberIndexFiltered(OutputList &ol, - const char *fileName, - NamespaceMemberHighlight hl, - const QCString& title) + NamespaceMemberHighlight hl) { if (documentedNamespaceMembers[hl]==0) return; - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - startFile(ol,fileName,0,title.data(),HLI_NamespaceMembers); - QCString htmlHelpTitle = title; - QCString ftvHelpTitle = title; - //if (!Config_getString("PROJECT_NAME").isEmpty()) title.prepend(Config_getString("PROJECT_NAME")+" "); - //startTitle(ol,0); - //ol.parseText(title); - //endTitle(ol,0,0); - - ol.writeString("<div class=\"qindex\">"); - bool first=TRUE; - startQuickIndexItem(ol, - "namespacemembers"+Doxygen::htmlFileExtension,hl==NMHL_All,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trAll())); - endQuickIndexItem(ol); - - if (documentedNamespaceMembers[NMHL_Functions]>0) - { - startQuickIndexItem(ol, - "namespacemembers_func"+Doxygen::htmlFileExtension,hl==NMHL_Functions,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trFunctions())); - endQuickIndexItem(ol); - } - if (documentedNamespaceMembers[NMHL_Variables]>0) - { - startQuickIndexItem(ol, - "namespacemembers_vars"+Doxygen::htmlFileExtension,hl==NMHL_Variables,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trVariables())); - endQuickIndexItem(ol); - } - if (documentedNamespaceMembers[NMHL_Typedefs]>0) + bool multiPageIndex=FALSE; + int numPages=1; + if (documentedNamespaceMembers[hl]>MAX_ITEMS_BEFORE_MULTIPAGE_INDEX) { - startQuickIndexItem(ol, - "namespacemembers_type"+Doxygen::htmlFileExtension,hl==NMHL_Typedefs,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trTypedefs())); - endQuickIndexItem(ol); + multiPageIndex=TRUE; + numPages=127; } - if (documentedNamespaceMembers[NMHL_Enums]>0) + + struct { - startQuickIndexItem(ol, - "namespacemembers_enum"+Doxygen::htmlFileExtension,hl==NMHL_Enums,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trEnumerations())); - endQuickIndexItem(ol); - } - if (documentedNamespaceMembers[NMHL_EnumValues]>0) + const char *fname; + QCString title; + } nmhlInfo[] = { - startQuickIndexItem(ol, - "namespacemembers_eval"+Doxygen::htmlFileExtension,hl==NMHL_EnumValues,TRUE,first); - ol.writeString(fixSpaces(theTranslator->trEnumerationValues())); - endQuickIndexItem(ol); - } - ol.writeString("</div>\n"); - - bool quickIndex = documentedNamespaceMembers[hl]>maxItemsBeforeQuickIndex; - if (quickIndex) - { - writeQuickMemberIndex(ol,g_namespaceIndexLetterUsed[hl]); - } - ol.newParagraph(); - if (hl==NMHL_All) + { "namespacemembers", 0 }, + { "namespacemembers_func",0 }, + { "namespacemembers_vars",0 }, + { "namespacemembers_type",0 }, + { "namespacemembers_enum",0 }, + { "namespacemembers_eval",0 } + }; + nmhlInfo[0].title=theTranslator->trAll(); + nmhlInfo[1].title=theTranslator->trFunctions(); + nmhlInfo[2].title=theTranslator->trVariables(); + nmhlInfo[3].title=theTranslator->trTypedefs(); + nmhlInfo[4].title=theTranslator->trEnumerations(); + nmhlInfo[5].title=theTranslator->trEnumerationValues(); + + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + + QCString extension=Doxygen::htmlFileExtension; + QCString title = theTranslator->trCompoundMembers(); + + int page; + bool first=TRUE; + for (page=0;page<numPages;page++) { - bool &generateHtml = Config_getBool("GENERATE_HTML") ; - bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); - bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); - if (hasHtmlHelp) - { - HtmlHelp *htmlHelp = HtmlHelp::getInstance(); - htmlHelp->addContentsItem(FALSE,htmlHelpTitle,"namespacemembers"); - } - if (hasFtvHelp) + if (!multiPageIndex || g_namespaceIndexLetterUsed[hl][page]) { - FTVHelp *ftvHelp = FTVHelp::getInstance(); - ftvHelp->addContentsItem(FALSE,0,"namespacemembers",0,ftvHelpTitle); + QCString fileName = nmhlInfo[hl].fname; + if (multiPageIndex && !first) + { + fileName+=QCString().sprintf("_0x%02x",page); + } + + startFile(ol,fileName+extension,0,title,HLI_NamespaceMembers); + + ol.writeString("<div class=\"qindex\">"); + + startQuickIndexItem(ol, + nmhlInfo[0].fname+Doxygen::htmlFileExtension,hl==NMHL_All,TRUE,first); + ol.writeString(fixSpaces(nmhlInfo[0].title)); + endQuickIndexItem(ol); + + int i; + for (i=1;i<NMHL_Total;i++) + { + if (documentedNamespaceMembers[i]>0) + { + startQuickIndexItem(ol, + nmhlInfo[i].fname+Doxygen::htmlFileExtension,hl==i,TRUE,first); + ol.writeString(fixSpaces(nmhlInfo[i].title)); + endQuickIndexItem(ol); + } + } + + ol.writeString("</div>\n"); + + bool quickIndex = documentedNamespaceMembers[hl]>maxItemsBeforeQuickIndex; + if (quickIndex) + { + writeQuickMemberIndex(ol,g_namespaceIndexLetterUsed[hl],page, + nmhlInfo[hl].fname,multiPageIndex); + } + if (hl==NMHL_All) + { + ol.parseText(theTranslator->trNamespaceMemberDescription(Config_getBool("EXTRACT_ALL"))); + } + ol.newParagraph(); + + writeNamespaceMemberList(ol,quickIndex,hl,page); + endFile(ol); } - ol.parseText(theTranslator->trNamespaceMemberDescription(Config_getBool("EXTRACT_ALL"))); } - writeNamespaceMemberList(ol,quickIndex,hl); - endFile(ol); ol.popGeneratorState(); } void writeNamespaceMemberIndex(OutputList &ol) { - QCString ext=Doxygen::htmlFileExtension; + writeNamespaceMemberIndexFiltered(ol,NMHL_All); + writeNamespaceMemberIndexFiltered(ol,NMHL_Functions); + writeNamespaceMemberIndexFiltered(ol,NMHL_Variables); + writeNamespaceMemberIndexFiltered(ol,NMHL_Typedefs); + writeNamespaceMemberIndexFiltered(ol,NMHL_Enums); + writeNamespaceMemberIndexFiltered(ol,NMHL_EnumValues); + QCString title = theTranslator->trNamespaceMembers(); - writeNamespaceMemberIndexFiltered(ol,"namespacemembers"+ext,NMHL_All, title); - title += " - "; - writeNamespaceMemberIndexFiltered(ol,"namespacemembers_func"+ext,NMHL_Functions, title + theTranslator->trFunctions()); - writeNamespaceMemberIndexFiltered(ol,"namespacemembers_vars"+ext,NMHL_Variables, title + theTranslator->trVariables()); - writeNamespaceMemberIndexFiltered(ol,"namespacemembers_type"+ext,NMHL_Typedefs, title + theTranslator->trTypedefs()); - writeNamespaceMemberIndexFiltered(ol,"namespacemembers_enum"+ext,NMHL_Enums, title + theTranslator->trEnumerations()); - writeNamespaceMemberIndexFiltered(ol,"namespacemembers_eval"+ext,NMHL_EnumValues, title + theTranslator->trEnumerationValues()); + bool &generateHtml = Config_getBool("GENERATE_HTML") ; + bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP"); + bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW"); + if (hasHtmlHelp) + { + HtmlHelp *htmlHelp = HtmlHelp::getInstance(); + htmlHelp->addContentsItem(FALSE,title,"namespacemembers"); + } + if (hasFtvHelp) + { + FTVHelp *ftvHelp = FTVHelp::getInstance(); + ftvHelp->addContentsItem(FALSE,0,"namespacemembers",0,title); + } } //---------------------------------------------------------------------------- diff --git a/src/index.h b/src/index.h index bf2c737..cb782c4 100644 --- a/src/index.h +++ b/src/index.h @@ -97,9 +97,9 @@ enum ClassMemberHighlight CMHL_Typedefs, CMHL_Enums, CMHL_EnumValues, - CMHL_Related, CMHL_Properties, CMHL_Events, + CMHL_Related, CMHL_Total = CMHL_Events+1 }; diff --git a/src/latexgen.h b/src/latexgen.h index 00b2a05..3aa8334 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -34,7 +34,8 @@ class LatexGenerator : public OutputGenerator //OutputGenerator *copy(); //OutputGenerator *clone() { return new LatexGenerator(*this); } //void append(const OutputGenerator *o); - void enable() { active=TRUE; } + void enable() + { if (genStack->top()) active=*genStack->top(); else active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==Latex) active=TRUE; } void disableIf(OutputType o) { if (o==Latex) active=FALSE; } diff --git a/src/mangen.h b/src/mangen.h index 66aa69c..085b7ad 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -31,7 +31,8 @@ class ManGenerator : public OutputGenerator //OutputGenerator *copy() { return new ManGenerator; } //OutputGenerator *clone() { return new ManGenerator(*this); } //void append(const OutputGenerator *o); - void enable() { active=TRUE; } + void enable() + { if (genStack->top()) active=*genStack->top(); else active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==Man) active=TRUE; } void disableIf(OutputType o) { if (o==Man) active=FALSE; } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 265a6a3..10f8898 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -232,11 +232,13 @@ static bool writeDefArgumentList(OutputList &ol,ClassDef *cd, first=FALSE; } ol.pushGeneratorState(); + bool htmlOn = ol.isEnabled(OutputGenerator::Html); ol.disable(OutputGenerator::Html); //if (!first) ol.writeString(" "); if (!md->isObjCMethod()) ol.docify(")"); // end argument list ol.enableAll(); ol.disableAllBut(OutputGenerator::Html); + if (!htmlOn) ol.disable(OutputGenerator::Html); if (!md->isDefine()) { if (first) ol.startParameterName(defArgList->count()<2); @@ -506,31 +508,48 @@ bool MemberDef::hasExamples() QCString MemberDef::getOutputFileBase() const { + QCString baseName; if (m_templateMaster) { return m_templateMaster->getOutputFileBase(); } else if (group) { - return group->getOutputFileBase(); + baseName=group->getOutputFileBase(); } else if (classDef) { - return classDef->getOutputFileBase(); + baseName=classDef->getOutputFileBase(); } else if (nspace) { - return nspace->getOutputFileBase(); + baseName=nspace->getOutputFileBase(); } else if (fileDef) { - return fileDef->getOutputFileBase(); + baseName=fileDef->getOutputFileBase(); } - warn(m_defFileName,m_defLine, + + if (baseName.isEmpty()) + { + warn(m_defFileName,m_defLine, "Warning: Internal inconsistency: member %s does not belong to any" " container!",name().data() ); - return "dummy"; + return "dummy"; + } + else if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + if (getEnumScope()) // enum value, which is part of enum's documentation + { + baseName+="_"+getEnumScope()->anchor(); + } + else + { + baseName+="_"+anchor(); + } + } + return baseName; } QCString MemberDef::getReference() const @@ -880,7 +899,6 @@ void MemberDef::writeDeclaration(OutputList &ol, // differs from the cname. if (getOuterScope()) osname=getOuterScope()->name(); - HtmlHelp *htmlHelp=0; bool hasHtmlHelp = Config_getBool("GENERATE_HTML") && Config_getBool("GENERATE_HTMLHELP"); if (hasHtmlHelp) htmlHelp = HtmlHelp::getInstance(); @@ -1235,7 +1253,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, QCString cname = container->name(); QCString cfname = getOutputFileBase(); - if (Config_getBool("GENERATE_HTML") && Config_getBool("GENERATE_HTMLHELP")) { HtmlHelp *htmlHelp = HtmlHelp::getInstance(); @@ -1598,6 +1615,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.endParamList(); } + // For enum, we also write the documented enum values if (isEnumerate()) { bool first=TRUE; @@ -1749,7 +1767,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, // write the list of classes that overwrite this member ol.disable(OutputGenerator::RTF); ol.newParagraph(); - ol.enableAll(); + ol.enable(OutputGenerator::RTF); QCString reimplInLine; if (virt==Pure || (classDef && classDef->compoundType()==ClassDef::Interface)) @@ -1799,6 +1817,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.parseText(reimplInLine.right(reimplInLine.length()-index)); } } + // write the list of examples that use this member if (hasExamples()) { @@ -1808,14 +1827,14 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, //ol.endDescItem(); ol.endSimpleSect(); } + // write reference to the source writeSourceDef(ol,cname); writeSourceRefs(ol,cname); writeSourceReffedBy(ol,cname); writeInlineCode(ol,cname); - ol.endIndent(); - + // write call graph if ((m_hasCallGraph || Config_getBool("CALL_GRAPH")) && isFunction() && Config_getBool("HAVE_DOT") ) @@ -1833,6 +1852,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } } + ol.endIndent(); + // enable LaTeX again //if (Config_getBool("EXTRACT_ALL") && !hasDocs) ol.enable(OutputGenerator::Latex); ol.popGeneratorState(); @@ -2058,19 +2079,21 @@ void MemberDef::addListReference(Definition *) memLabel=theTranslator->trMember(TRUE,TRUE); } QCString memName = name(); - if (!Config_getBool("HIDE_SCOPE_NAMES")) + Definition *pd=getOuterScope(); + if ((!Config_getBool("HIDE_SCOPE_NAMES") && // there is a scope + pd && pd!=Doxygen::globalScope) // and we can show it + || + ((pd=getClassDef()) && !isRelated()) // it's a class so we + // show the scope anyway + ) { - Definition *pd=getOuterScope(); - if (pd && pd!=Doxygen::globalScope) + if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) { - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA")) - { - memName.prepend(pd->name()+"."); - } - else - { - memName.prepend(pd->name()+"::"); - } + memName.prepend(pd->name()+"."); + } + else + { + memName.prepend(pd->name()+"::"); } } if (xrefListItems()) diff --git a/src/memberdef.h b/src/memberdef.h index acdce15..e90a975 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -71,7 +71,7 @@ class MemberDef : public Definition bool related,MemberType t,const ArgumentList *tal, const ArgumentList *al); ~MemberDef(); - DefType definitionType() { return TypeMember; } + DefType definitionType() const { return TypeMember; } // link id QCString getOutputFileBase() const; diff --git a/src/membergroup.cpp b/src/membergroup.cpp index da8284f..c2808cb 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -115,6 +115,12 @@ void MemberGroup::writeDocumentation(OutputList &ol,const char *scopeName, memberList->writeDocumentation(ol,scopeName,container,0); } +void MemberGroup::writeDocumentationPage(OutputList &ol,const char *scopeName, + Definition *container) +{ + memberList->writeDocumentationPage(ol,scopeName,container); +} + /*! Add this group as a subsection of the declaration section, instead * of rendering it in its own section */ diff --git a/src/membergroup.h b/src/membergroup.h index f69082c..7552e38 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -50,6 +50,8 @@ class MemberGroup void writeDocumentation(OutputList &ol,const char *scopeName, Definition *container); + void writeDocumentationPage(OutputList &ol,const char *scopeName, + Definition *container); QCString documentation() { return doc; } bool allMembersInSameSection() { return inSameSection; } void addToDeclarationSection(); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 9ab8028..87a3974 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -387,6 +387,47 @@ void MemberList::writeDocumentation(OutputList &ol, } } +void MemberList::writeDocumentationPage(OutputList &ol, + const char *scopeName, Definition *container) +{ + MemberListIterator mli(*this); + MemberDef *md; + for ( ; (md=mli.current()) ; ++mli) + { + QCString diskName=md->getOutputFileBase(); + QCString title=md->qualifiedName(); + startFile(ol,diskName,md->name(),title); + container->writeNavigationPath(ol); + + ol.writeString("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n" + " <tr>\n" + " <td valign=\"top\">\n"); + + container->writeQuickMemberLinks(ol,md); + + ol.writeString(" </td>\n"); + ol.writeString(" <td valign=\"top\">\n"); + + md->writeDocumentation(this,ol,scopeName,container,m_inGroup); + + ol.writeString(" </td>\n"); + ol.writeString(" </tr>\n"); + ol.writeString("</table>\n"); + + endFile(ol); + } + if (memberGroupList) + { + //printf("MemberList::writeDocumentation() -- member groups\n"); + MemberGroupListIterator mgli(*memberGroupList); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + mg->writeDocumentationPage(ol,scopeName,container); + } + } +} + void MemberList::addMemberGroup(MemberGroup *mg) { if (memberGroupList==0) diff --git a/src/memberlist.h b/src/memberlist.h index ec6a91f..c834fdc 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -54,6 +54,8 @@ class MemberList : public QList<MemberDef> const char *title,const char *subtitle); void writeDocumentation(OutputList &ol,const char *scopeName, Definition *container,const char *title); + void writeDocumentationPage(OutputList &ol, + const char *scopeName, Definition *container); void addMemberGroup(MemberGroup *mg); void setInGroup(bool group) { m_inGroup=group; } void addListReferences(Definition *def); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 8ced35a..5e629e9 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -360,6 +360,39 @@ void NamespaceDef::writeDocumentation(OutputList &ol) writeDetailedDocumentation(ol); } + writeMemberDocumentation(ol); + + // write Author section (Man only) + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Man); + ol.startGroupHeader(); + ol.parseText(theTranslator->trAuthor(TRUE,TRUE)); + ol.endGroupHeader(); + ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME"))); + + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + { + writeDocAnchorsToTagFile(); + Doxygen::tagFile << " </compound>" << endl; + } + + ol.popGeneratorState(); + endFile(ol); + + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + allMemberList.sort(); + writeMemberPages(ol); + } +} + +void NamespaceDef::writeMemberDocumentation(OutputList &ol) +{ + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + ol.disable(OutputGenerator::Html); + } + docDefineMembers.writeDocumentation(ol,name(),this, theTranslator->trDefineDocumentation()); @@ -378,22 +411,61 @@ void NamespaceDef::writeDocumentation(OutputList &ol) docVarMembers.writeDocumentation(ol,name(),this, theTranslator->trVariableDocumentation()); - // write Author section (Man only) + if (Config_getBool("SEPARATE_MEMBER_PAGES")) + { + ol.enable(OutputGenerator::Html); + } +} + +void NamespaceDef::writeMemberPages(OutputList &ol) +{ ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Man); - ol.startGroupHeader(); - ol.parseText(theTranslator->trAuthor(TRUE,TRUE)); - ol.endGroupHeader(); - ol.parseText(theTranslator->trGeneratedAutomatically(Config_getString("PROJECT_NAME"))); + ol.disableAllBut(OutputGenerator::Html); - if (!Config_getString("GENERATE_TAGFILE").isEmpty()) + docDefineMembers.writeDocumentationPage(ol,name(),this); + docProtoMembers.writeDocumentationPage(ol,name(),this); + docTypedefMembers.writeDocumentationPage(ol,name(),this); + docEnumMembers.writeDocumentationPage(ol,name(),this); + docFuncMembers.writeDocumentationPage(ol,name(),this); + docVarMembers.writeDocumentationPage(ol,name(),this); + + ol.popGeneratorState(); +} + +void NamespaceDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const +{ + ol.writeString(" <div class=\"navtab\">\n"); + ol.writeString(" <table>\n"); + + MemberListIterator mli(allMemberList); + MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) { - writeDocAnchorsToTagFile(); - Doxygen::tagFile << " </compound>" << endl; + if (md->getNamespaceDef()==this && md->isLinkable()) + { + ol.writeString(" <tr><td class=\"navtab\">"); + if (md->isLinkableInProject()) + { + if (md==currentMd) // selected item => highlight + { + ol.writeString("<a class=\"qindexHL\" "); + } + else + { + ol.writeString("<a class=\"qindex\" "); + } + ol.writeString("href=\""); + ol.writeString(md->getOutputFileBase()+Doxygen::htmlFileExtension+"#"+md->anchor()); + ol.writeString("\">"); + ol.writeString(md->localName()); + ol.writeString("</a>"); + } + ol.writeString("</td></tr>\n"); + } } - ol.popGeneratorState(); - endFile(ol); + ol.writeString(" </table>\n"); + ol.writeString(" </div>\n"); } int NamespaceDef::countMembers() diff --git a/src/namespacedef.h b/src/namespacedef.h index 90c55c2..caedfde 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -41,12 +41,15 @@ class NamespaceDef : public Definition const char *name,const char *ref=0, const char *refFile=0); ~NamespaceDef(); - DefType definitionType() { return TypeNamespace; } + DefType definitionType() const { return TypeNamespace; } QCString getOutputFileBase() const; void insertUsedFile(const char *fname); void writeDetailedDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol); + void writeMemberDocumentation(OutputList &ol); + void writeMemberPages(OutputList &ol); + void writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const; void insertClass(ClassDef *cd); void insertNamespace(NamespaceDef *nd); diff --git a/src/outputgen.h b/src/outputgen.h index 94af534..de788db 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -372,11 +372,11 @@ class OutputGenerator : public BaseOutputDocInterface QFile *file; QCString dir; bool active; + QStack<bool> *genStack; private: OutputGenerator(const OutputGenerator &o); OutputGenerator &operator=(const OutputGenerator &o); - QStack<bool> *genStack; }; /*! \brief Interface used for generating documentation. diff --git a/src/pagedef.h b/src/pagedef.h index 98053d7..462584f 100644 --- a/src/pagedef.h +++ b/src/pagedef.h @@ -23,7 +23,7 @@ class PageDef : public Definition public: PageDef(const char *f,int l,const char *n,const char *d,const char *t); ~PageDef(); - DefType definitionType() { return TypePage; } + DefType definitionType() const { return TypePage; } bool isLinkableInProject() const { return hasDocumentation() && !isReference(); diff --git a/src/rtfgen.h b/src/rtfgen.h index a528501..24de6b2 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -34,7 +34,8 @@ class RTFGenerator : public OutputGenerator //OutputGenerator *copy(); //OutputGenerator *clone() { return new RTFGenerator(*this); } //void append(const OutputGenerator *o); - void enable() { active=TRUE; } + void enable() + { if (genStack->top()) active=*genStack->top(); else active=TRUE; } void disable() { active=FALSE; } void enableIf(OutputType o) { if (o==RTF) active=TRUE; } void disableIf(OutputType o) { if (o==RTF) active=FALSE; } diff --git a/src/scanner.l b/src/scanner.l index 4e4b720..c06225a 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -877,6 +877,7 @@ IDLATTR ("["[^\]]*"]"){BN}* %x SectionLabel %x SectionTitle %x CopyArgString +%x CopyArgPHPString %x CopyArgRound %x CopyArgSharp %x CopyArgComment @@ -2563,8 +2564,9 @@ IDLATTR ("["[^\]]*"]"){BN}* */ <ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/]* { current->program += yytext ; } <ReadBody,ReadNSBody,ReadBodyIntf>"//".* { current->program += yytext ; } -<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (! insidePHP) +<ReadBody,ReadNSBody,ReadBodyIntf>"#".* { if (!insidePHP) REJECT; + // append PHP comment. current->program += yytext ; } <ReadBody,ReadNSBody,ReadBodyIntf>@\" { current->program += yytext ; @@ -3005,7 +3007,7 @@ IDLATTR ("["[^\]]*"]"){BN}* <ReadFuncArgType>[^ \/\r\t\n\)\(\"\'#]+ { *copyArgString+=yytext; fullArgString+=yytext; } -<CopyArgString>[^\n\\\"\']+ { *copyArgString+=yytext; +<CopyArgString,CopyArgPHPString>[^\n\\\"\']+ { *copyArgString+=yytext; fullArgString+=yytext; } <CopyArgRound>[^\/\n\)\(\"\']+ { @@ -3080,17 +3082,19 @@ IDLATTR ("["[^\]]*"]"){BN}* lastCContext = YY_START; BEGIN( SkipCxxComment ); } -<ReadFuncArgType,ReadTempArgs>"'#" { if (! insidePHP) + /* +<ReadFuncArgType,ReadTempArgs>"'#" { if (insidePHP) REJECT; *copyArgString+=yytext; fullArgString+=yytext; } <ReadFuncArgType,ReadTempArgs>"#" { - if (! insidePHP) + if (!insidePHP) REJECT; lastCContext = YY_START; BEGIN( SkipCxxComment ); } + */ /* `)' followed by a special comment */ <ReadFuncArgType>")"{BN}*("/*"[*!]|"//"[/!])"<" { lineCount(); @@ -3191,7 +3195,7 @@ IDLATTR ("["[^\]]*"]"){BN}* //printf("end of argSharpCount\n"); } } -<CopyArgString>\\. { +<CopyArgString,CopyArgPHPString>\\. { *copyArgString+=yytext; fullArgString+=yytext; } @@ -3200,6 +3204,11 @@ IDLATTR ("["[^\]]*"]"){BN}* fullArgString+=*yytext; BEGIN( lastCopyArgStringContext ); } +<CopyArgPHPString>\' { + *copyArgString+=*yytext; + fullArgString+=*yytext; + BEGIN( lastCopyArgStringContext ); + } <ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>{CHARLIT} { if (insidePHP) { @@ -3211,12 +3220,24 @@ IDLATTR ("["[^\]]*"]"){BN}* fullArgString+=yytext; } } -<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgRound,CopyArgSharp>\n { +<ReadFuncArgType,ReadTempArgs,CopyArgRound,CopyArgSharp>\' { + if (insidePHP) + { + lastCopyArgStringContext=YY_START; + BEGIN(CopyArgPHPString); + } + else + { + *copyArgString+=yytext; + fullArgString+=yytext; + } + } +<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSharp>\n { yyLineNr++; *copyArgString+=*yytext; fullArgString+=*yytext; } -<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgRound,CopyArgSharp>. { +<ReadFuncArgType,ReadTempArgs,CopyArgString,CopyArgPHPString,CopyArgRound,CopyArgSharp>. { *copyArgString+=*yytext; fullArgString+=*yytext; } @@ -3665,19 +3686,22 @@ IDLATTR ("["[^\]]*"]"){BN}* BEGIN( FindMembers ); } <SkipInits,SkipCurly,SkipCurlyCpp>"#" { - if (! insidePHP) + if (!insidePHP) REJECT; //addToBody(yytext); lastCContext = YY_START; BEGIN(SkipCxxComment); } <SkipInits,SkipCurly,SkipCurlyCpp>@\" { - if (! insideCS) REJECT; + if (!insideCS) REJECT; // C# verbatim string lastSkipVerbStringContext=YY_START; pSkipVerbString=¤t->initializer; BEGIN(SkipVerbString); } +<SkipInits,SkipCurly,SkipCurlyCpp>{CHARLIT} { + if (insidePHP) REJECT; + } <SkipInits,SkipCurly,SkipCurlyCpp>\' { if (insidePHP) { @@ -3685,9 +3709,6 @@ IDLATTR ("["[^\]]*"]"){BN}* BEGIN(SkipPHPString); } } -<SkipInits,SkipCurly,SkipCurlyCpp>{CHARLIT} { - if (insidePHP) REJECT; - } <SkipInits,SkipCurly,SkipCurlyCpp>. { } <SkipString,SkipPHPString>\\. { } <SkipString>\" { @@ -3757,6 +3778,7 @@ IDLATTR ("["[^\]]*"]"){BN}* } <CompoundName>{SCOPENAME}{BN}*";" { // forward declaration unput(';'); + current->reset(); if (isTypedef) // typedef of a class, put typedef keyword back { current->type.prepend("typedef"); @@ -6113,7 +6135,7 @@ IDLATTR ("["[^\]]*"]"){BN}* } } <*>"#" { - if (! insidePHP) + if (!insidePHP) REJECT; lastCContext = YY_START ; BEGIN( SkipCxxComment ) ; diff --git a/src/translator_cz.h b/src/translator_cz.h index 8cff2c0..5984e80 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -131,6 +131,7 @@ // 2004/02/27 - Text inside the trCallGraph() corrected. // 2004/06/16 - The new method "since 1.3.8" implemented. // 2004/09/14 - The new methods "since 1.3.9" implemented. +// 2005/02/11 - The "never used" methods removed. // Todo // ---- @@ -301,10 +302,6 @@ class TranslatorCzech : public Translator virtual QCString trFileList() { return decode("Seznam souborů"); } - /*! This is put above each page as a link to the list of all verbatim headers */ - virtual QCString trHeaderFiles() - { return decode("Seznam hlavičkových souborů"); } - /*! This is put above each page as a link to all members of compounds. */ virtual QCString trCompoundMembers() { @@ -447,11 +444,6 @@ class TranslatorCzech : public Translator return decode(result); } - /*! This is an introduction to the page with the list of all header files. */ - virtual QCString trHeaderFilesDescription() - { return decode("Zde naleznete hlavičkové soubory, které tvoří " - "aplikační programátorské rozhraní (API):"); } - /*! This is an introduction to the page with the list of all examples */ virtual QCString trExamplesDescription() { return decode("Zde naleznete seznam všech příkladů:"); } @@ -464,12 +456,6 @@ class TranslatorCzech : public Translator virtual QCString trModulesDescription() { return decode("Zde naleznete seznam všech modulů:"); } - /*! This sentences is used in the annotated class/file lists if no brief - * description is given. - */ - virtual QCString trNoDescriptionAvailable() - { return decode("Popis není k dispozici"); } - // index titles (the project name is prepended for these) @@ -620,12 +606,6 @@ class TranslatorCzech : public Translator { return decode("Dokumentace výčtových typů"); } /*! This is used in the documentation of a file/namespace before the list - * of documentation blocks for enumeration values - */ - virtual QCString trEnumerationValueDocumentation() - { return decode("Dokumentace výčtových hodnot"); } - - /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for functions */ virtual QCString trFunctionDocumentation() @@ -679,19 +659,10 @@ class TranslatorCzech : public Translator virtual QCString trForInternalUseOnly() { return decode("Pouze pro vnitřní použití."); } - /*! this text is generated when the \\reimp command is used. */ - virtual QCString trReimplementedForInternalReasons() - { return decode("Reimplementováno z interních důvodů; " - "aplikační rozhraní zachováno."); } - /*! this text is generated when the \\warning command is used. */ virtual QCString trWarning() { return decode("Pozor"); } - /*! this text is generated when the \\bug command is used. */ - virtual QCString trBugsAndLimitations() - { return decode("Chyby a omezení"); } - /*! this text is generated when the \\version command is used. */ virtual QCString trVersion() { return decode("Verze"); } @@ -979,10 +950,6 @@ class TranslatorCzech : public Translator // new since 0.49-991003 ////////////////////////////////////////////////////////////////////////// - virtual QCString trSources() - { - return decode("Zdroje"); - } virtual QCString trDefinedAtLineInSourceFile() { return decode("Definice je uvedena na řádku @0 v souboru @1."); @@ -1304,11 +1271,6 @@ class TranslatorCzech : public Translator // new since 1.2.4 ////////////////////////////////////////////////////////////////////////// - /*! Used for Java interfaces in the summary section of Java packages */ - virtual QCString trInterfaces() - { - return decode("Rozhraní"); - } /*! Used for Java classes in the summary section of Java packages */ virtual QCString trClasses() { @@ -1335,11 +1297,6 @@ class TranslatorCzech : public Translator { return decode("Balíky"); } - /*! Used as a chapter title for Latex & RTF output */ - virtual QCString trPackageDocumentation() - { - return decode("Dokumentace balíku"); - } /*! Text shown before a multi-line define */ virtual QCString trDefineValue() { @@ -1450,17 +1407,6 @@ class TranslatorCzech : public Translator return decode(result); } - /*! This is used for translation of the word that will possibly - * be followed by a single name or by a list of names - * of the category. - */ - virtual QCString trField(bool first_capital, bool singular) - { - QCString result((first_capital ? "Položk" : "položk")); - result+=(singular ? "a" : "y"); - return decode(result); - } - /*! ??? Jak to prelozit? Bylo by dobre, kdyby se ozval nekdo, * kdo to pouziva. */ diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 2030789..aa7cb6c 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -825,7 +825,19 @@ static void generateXMLSection(Definition *d,QTextStream &ti,QTextStream &t, MemberList *ml,const char *kind,const char *header=0, const char *documentation=0) { - if (ml->count()==0) return; // empty list + MemberListIterator mli(*ml); + MemberDef *md; + int count=0; + for (mli.toFirst();(md=mli.current());++mli) + { + // namespace members are also inserted in the file scope, but + // to prevent this duplication in the XML output, we filter those here. + if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) + { + count++; + } + } + if (count==0) return; // empty list t << " <sectiondef kind=\"" << kind << "\">" << endl; if (header) @@ -838,11 +850,14 @@ static void generateXMLSection(Definition *d,QTextStream &ti,QTextStream &t, writeXMLDocBlock(t,d->docFile(),d->docLine(),d,0,documentation); t << "</description>" << endl; } - MemberListIterator mli(*ml); - MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { - generateXMLForMember(md,ti,t,d); + // namespace members are also inserted in the file scope, but + // to prevent this duplication in the XML output, we filter those here. + if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) + { + generateXMLForMember(md,ti,t,d); + } } t << " </sectiondef>" << endl; } |