diff options
Diffstat (limited to 'src')
47 files changed, 1882 insertions, 533 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 5d7c980..457a06b 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -232,11 +232,11 @@ void ClassDef::writeDocumentation(OutputList &ol) } pageTitle+=pageType+" Reference"; startFile(ol,fileName,pageTitle); - startTitle(ol); + startTitle(ol,getOutputFileBase()); //ol.docify(name()+" "+pageType.right(pageType.length()-1)+" "); //parseText(ol,theTranslator->trReference()); parseText(ol,theTranslator->trCompoundReference(name(),compType)); - endTitle(ol,name()); + endTitle(ol,getOutputFileBase(),name()); // write brief description OutputList briefOutput(&ol); @@ -694,9 +694,9 @@ void ClassDef::writeMemberList(OutputList &ol) // do not generate Latex output ol.disableAllBut(OutputGenerator::Html); startFile(ol,memListFileName,theTranslator->trMemberList()); - startTitle(ol); + startTitle(ol,0); parseText(ol,name()+" "+theTranslator->trMemberList()); - endTitle(ol,0); + endTitle(ol,0,0); parseText(ol,theTranslator->trThisIsTheListOfAllMembers()); ol.writeObjectLink(getReference(),fileName,0,name()); parseText(ol,theTranslator->trIncludingInheritedMembers()); @@ -746,7 +746,8 @@ void ClassDef::writeMemberList(OutputList &ol) ol.writeListItem(); ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(), md->anchor(),name); - if ( md->isFunction() || md->isSignal() || md->isSlot() ) + if ( md->isFunction() || md->isSignal() || md->isSlot() || + (md->isFriend() && md->argsString())) ol.docify(md->argsString()); else if (md->isEnumerate()) parseText(ol," "+theTranslator->trEnumName()); @@ -786,7 +787,8 @@ void ClassDef::writeMemberList(OutputList &ol) memberWritten=TRUE; } if ((protect!=Public || md->isStatic() || virt!=Normal || - md->isFriend() || md->isRelated() + md->isFriend() || md->isRelated() || + (md->isInline() && Config::inlineInfoFlag) ) && memberWritten) { @@ -797,6 +799,8 @@ void ClassDef::writeMemberList(OutputList &ol) else if (md->isRelated()) sl.append("related"); else { + if (Config::inlineInfoFlag && md->isInline()) + sl.append("inline"); if (protect==Protected) sl.append("protected"); else if (protect==Private) sl.append("private"); if (virt==Virtual) sl.append("virtual"); @@ -831,11 +835,11 @@ void ClassDef::writeIncludeFile(OutputList &ol) //printf("incFile=%s\n",incFile->absFilePath().data()); ol.disableAllBut(OutputGenerator::Html); startFile(ol,fileName+"-include",name()+" Include File"); - startTitle(ol); + startTitle(ol,0); QCString n=incName.copy(); if (incName.isNull()) n=incFile->name(); parseText(ol,n); - endTitle(ol,0); + endTitle(ol,0,0); parseText(ol,theTranslator->trVerbatimText(incFile->name())); ol.writeRuler(); ol.startCodeFragment(); @@ -992,15 +996,25 @@ bool ClassDef::hasNonReferenceSuperClass() // htmlHelp->decContentsDepth(); //} -void ClassDef::writeDeclaration(OutputList &ol) +void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md) { //ol.insertMemberAlign(); + //printf("ClassName=`%s'\n",name().data()); switch(compType) { - case Class: ol.docify("class {"); break; - case Struct: ol.docify("struct {"); break; - default: ol.docify("union {"); break; + case Class: ol.docify("class"); break; + case Struct: ol.docify("struct"); break; + default: ol.docify("union"); break; } + int ri=name().findRev("::"); + if (ri==-1) ri=name().length(); + QCString cn=name().right(name().length()-ri-2); + if (!cn.isEmpty() && cn.at(0)!='@' && md) + { + ol.docify(" "); + ol.writeObjectLink(0,0,md->anchor(),cn); + } + ol.docify(" {"); ol.endMemberItem(FALSE,0,0,FALSE); // TODO: pass correct group parameters // insert members of this class diff --git a/src/classdef.h b/src/classdef.h index ed2aa9d..afdcffb 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -39,6 +39,7 @@ class BaseClassList; class MemberInfoList; class MemberInfoDict; class NamespaceDef; +class MemberDef; class ClassDef : public Definition { @@ -76,7 +77,7 @@ class ClassDef : public Definition void writeMemberList(OutputList &ol); void writeIncludeFile(OutputList &ol); //void writeMembersToContents(); - void writeDeclaration(OutputList &ol); + void writeDeclaration(OutputList &ol,MemberDef *md); bool addExample(const char *anchor,const char *name, const char *file); bool hasExamples(); //void writeExample(OutputList &ol); @@ -84,9 +85,9 @@ class ClassDef : public Definition Protection protection() const { return prot; } /*! a link to this class is possible within this project */ bool isLinkableInProject() - { int i = name().findRev("::"); - if (i==-1) i=0; else i+=2; - return !name().isEmpty() && name().at(i)!='@' && + { //int i = name().findRev("::"); + //if (i==-1) i=0; else i+=2; + return !name().isEmpty() && name().find('@')==-1 && (prot!=Private || Config::extractPrivateFlag) && hasDocumentation() && !isReference(); } @@ -167,6 +168,7 @@ struct BaseClassDef class BaseClassList : public QList<BaseClassDef> { public: + ~BaseClassList() {} int compareItems(GCI item1,GCI item2) { ClassDef *c1=((BaseClassDef *)item1)->classDef; @@ -213,7 +213,10 @@ static bool getLink(const char *className, // exampleFile.data()); if (md->addExample(anchor,exampleName,exampleFile)) { + bool latexEnabled = result.isEnabled(OutputGenerator::Latex); + if (latexEnabled) result.disable(OutputGenerator::Latex); result.writeAnchor(anchor); + if (latexEnabled) result.enable(OutputGenerator::Latex); anchorCount++; } } @@ -222,6 +225,7 @@ static bool getLink(const char *className, if (d) { + //printf("d->getOutputBase()=`%s' name=`%s'\n",d->getOutputFileBase().data(),md->name().data()); result.writeCodeLink(d->getReference(),d->getOutputFileBase(), md->anchor(),memberName); return TRUE; @@ -384,7 +388,7 @@ ID [a-z_A-Z][a-z_A-Z0-9]* if ((fd=findFileDef(&inputNameDict,yytext,ambig)) && fd->isLinkable()) { - code->writeCodeLink(0,fd->getOutputFileBase(),0,yytext); + code->writeCodeLink(fd->getReference(),fd->getOutputFileBase(),0,yytext); } else { diff --git a/src/config.h b/src/config.h index 9d04582..2bc8ce5 100644 --- a/src/config.h +++ b/src/config.h @@ -39,6 +39,7 @@ struct Config static QCString manOutputDir; // the directory to put the man pages static QCString outputLanguage; // the output language static QCString headerFile; // the name of the personal HTML header + static QCString latexHeaderFile; // the name of the personal LaTeX header static QCString footerFile; // the name of the personal HTML footer static QCString cgiName; // the name of the CGI binary static QCString cgiURL; // the absolute URL to the CGI binary @@ -91,6 +92,9 @@ struct Config static bool autoBriefFlag; // javadoc comments behaves as Qt comments. static bool htmlHelpFlag; // should html help files be generated? static bool alphaIndexFlag; // should an alphabetical index be generated? + static bool pdfHyperFlag; // generate latex prepared creating hyperlinked pdfs. + static bool inheritDocsFlag; // inheritance of documentation enabled? + static bool inlineInfoFlag; // show info about inline members? }; #endif diff --git a/src/config.l b/src/config.l index 515de4d..1e420c2 100644 --- a/src/config.l +++ b/src/config.l @@ -71,6 +71,7 @@ QCString Config::latexOutputDir; QCString Config::manOutputDir; QCString Config::outputLanguage; QCString Config::headerFile; +QCString Config::latexHeaderFile; QCString Config::footerFile; QCString Config::cgiName; QCString Config::cgiURL; @@ -111,6 +112,7 @@ bool Config::caseSensitiveNames = FALSE; bool Config::includeSourceFlag = FALSE; bool Config::htmlHelpFlag = FALSE; bool Config::alphaIndexFlag = FALSE; +bool Config::pdfHyperFlag = FALSE; bool Config::autoBriefFlag = TRUE; bool Config::warningFlag = TRUE; bool Config::generateHtml = TRUE; @@ -123,6 +125,8 @@ bool Config::classDiagramFlag = TRUE; bool Config::repeatBriefFlag = TRUE; bool Config::verbatimHeaderFlag = TRUE; bool Config::htmlAlignMemberFlag = TRUE; +bool Config::inheritDocsFlag = TRUE; +bool Config::inlineInfoFlag = TRUE; /* ----------------------------------------------------------------- * @@ -180,6 +184,7 @@ static int yyread(char *buf,int max_size) <Start>"LATEX_OUTPUT"[ \t]*"=" { BEGIN(GetString); s=&Config::latexOutputDir; } <Start>"HTML_HEADER"[ \t]*"=" { BEGIN(GetString); s=&Config::headerFile; } <Start>"HTML_FOOTER"[ \t]*"=" { BEGIN(GetString); s=&Config::footerFile; } +<Start>"LATEX_HEADER"[ \t]*"=" { BEGIN(GetString); s=&Config::latexHeaderFile; } <Start>"CGI_NAME"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiName; } <Start>"CGI_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::cgiURL; } <Start>"DOC_URL"[ \t]*"=" { BEGIN(GetString); s=&Config::docURL; } @@ -232,6 +237,9 @@ static int yyread(char *buf,int max_size) <Start>"JAVADOC_AUTOBRIEF"[ \t]*"=" { BEGIN(GetBool); b=&Config::autoBriefFlag; } <Start>"GENERATE_HTMLHELP"[ \t]*"=" { BEGIN(GetBool); b=&Config::htmlHelpFlag; } <Start>"ALPHABETICAL_INDEX"[ \t]*"=" { BEGIN(GetBool); b=&Config::alphaIndexFlag; } +<Start>"PDF_HYPERLINKS"[ \t]*"=" { BEGIN(GetBool); b=&Config::pdfHyperFlag; } +<Start>"INHERIT_DOCS"[ \t]*"=" { BEGIN(GetBool); b=&Config::inheritDocsFlag; } +<Start>"INLINE_INFO"[ \t]*"=" { BEGIN(GetBool); b=&Config::inlineInfoFlag; } <Start>[a-z_A-Z0-9]+ { err("Warning: ignoring unknown tag `%s' at line %d\n",yytext,yyLineNr); } <GetString,GetBool>\n { yyLineNr++; BEGIN(Start); } <GetStrList>\n { @@ -375,6 +383,7 @@ void Config::init() Config::manOutputDir ="man"; Config::outputLanguage = "English"; Config::headerFile.resize(0); + Config::latexHeaderFile.resize(0); Config::footerFile.resize(0); Config::cgiName = "search.cgi"; Config::cgiURL.resize(0); @@ -415,6 +424,7 @@ void Config::init() Config::includeSourceFlag = FALSE; Config::htmlHelpFlag = FALSE; Config::alphaIndexFlag = FALSE; + Config::pdfHyperFlag = FALSE; Config::warningFlag = TRUE; Config::generateHtml = TRUE; Config::generateLatex = TRUE; @@ -427,6 +437,8 @@ void Config::init() Config::verbatimHeaderFlag = TRUE; Config::htmlAlignMemberFlag = TRUE; Config::autoBriefFlag = TRUE; + Config::inheritDocsFlag = TRUE; + Config::inlineInfoFlag = TRUE; } void writeTemplateConfig(QFile *f,bool sl) @@ -636,7 +648,7 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; - t << "# If the JAVADOC_NO_AUTOBRIEF is set to YES (the default) then Doxygen\n"; + t << "# If the JAVADOC_AUTOBRIEF tag is set to YES (the default) then Doxygen\n"; t << "# will interpret the first line (until the first dot) of a JavaDoc-style\n"; t << "# comment as the brief description. If set to NO, the Javadoc-style will\n"; t << "# behave just like the Qt-style comments.\n"; @@ -646,6 +658,23 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# if the INHERIT_DOCS tag is set to YES (the default) then an undocumented\n"; + t << "# member inherits the documentation from any documented member that it\n"; + t << "# reimplements.\n"; + t << "\n"; + } + t << "INHERIT_DOCS = YES\n"; + if (!sl) + { + t << "\n"; + t << "# if the INLINE_INFO tag is set to YES (the default) then a tag [inline]\n"; + t << "# is inserted in the documentation for inline members.\n"; + t << "\n"; + } + t << "INLINE_INFO = YES\n"; + if (!sl) + { + t << "\n"; } t << "#---------------------------------------------------------------------------\n"; t << "# configuration options related to the input files\n"; @@ -841,6 +870,26 @@ void writeTemplateConfig(QFile *f,bool sl) if (!sl) { t << "\n"; + t << "# The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n"; + t << "# the generated latex document. The header should contain everything until\n"; + t << "# the first chapter. If it is left blank doxygen will generate a \n"; + t << "# standard header. Notice: only use this tag if you know what you are doing!\n"; + t << "\n"; + } + t << "LATEX_HEADER =\n"; + if (!sl) + { + t << "\n"; + t << "# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated\n"; + t << "# is prepared for conversion to pdf (using ps2pdf). The pdf file will\n"; + t << "# contain links (just like the HTML output) instead of page references\n"; + t << "# This makes the output suitable for online browsing using a pdf viewer.\n"; + t << "\n"; + } + t << "PDF_HYPERLINKS = NO\n"; + if (!sl) + { + t << "\n"; } t << "#---------------------------------------------------------------------------\n"; t << "# configuration options related to the man page output\n"; @@ -1177,6 +1226,17 @@ void checkConfig() exit(1); } } + // Test to see if LaTeX header is valid + if (Config::latexHeaderFile.length()>0) + { + QFileInfo fi(Config::latexHeaderFile); + if (!fi.exists()) + { + err("Error: tag LATEX_HEADER: header file `%s' " + "does not exist\n",Config::latexHeaderFile.data()); + exit(1); + } + } // check include path char *s=Config::includePath.first(); while (s) diff --git a/src/declinfo.l b/src/declinfo.l index df5c2ea..c071192 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -171,11 +171,11 @@ ID [a-z_A-Z][a-z_A-Z0-9]* <Template>. { name+=*yytext; } -<Operator>{B}*"()"{B}*"<>"{B}*/"(" { +<Operator>{B}*"("{B}*")"{B}*"<>"{B}*/"(" { name+="() <>"; BEGIN(ReadArgs); } -<Operator>{B}*"()"{B}*/"(" { +<Operator>{B}*"("{B}*")"{B}*/"(" { name+="()"; BEGIN(ReadArgs); } diff --git a/src/definition.cpp b/src/definition.cpp index 4474113..59c9ac9 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -73,3 +73,17 @@ void Definition::addSectionsToDefinition(QList<QCString> *anchorList) s=anchorList->next(); } } + +void Definition::setBriefDescription(const char *b) +{ + brief=QCString(b).stripWhiteSpace(); + int bl=brief.length(); + if (bl>0) // add puntuation if needed + { + switch(brief.at(bl-1)) + { + case '.': case '!': case '?': break; + default: brief+='.'; break; + } + } +} diff --git a/src/definition.h b/src/definition.h index 40e8316..87b3c18 100644 --- a/src/definition.h +++ b/src/definition.h @@ -50,19 +50,7 @@ class Definition /*! sets the brief description of this definition to \a b. * A dot is added to the sentence if not available. */ - void setBriefDescription(const char *b) - { - brief=((QCString) b).stripWhiteSpace(); - int bl=brief.length(); - if (bl>0) // add puntuation if needed - { - switch(brief.at(bl-1)) - { - case '.': case '!': case '?': break; - default: brief+='.'; break; - } - } - } + void setBriefDescription(const char *b); /*! returns TRUE iff the definition is documented */ virtual bool hasDocumentation() { return !doc.isNull() || !brief.isNull() || Config::extractAllFlag; } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 01ac9b6..9c0a97b 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -90,6 +90,8 @@ FormulaDict formulaNameDict(1009); // dictionary of the label name of all f // a member group OutputList *outputList; // list of output generating objects + +PageInfo *mainPage=0; //bool unrelatedFunctionsUsed; @@ -357,8 +359,10 @@ static bool addNamespace(Entry *root,ClassDef *cd) if (e->section==Entry::NAMESPACE_SEC) { NamespaceDef *nd=0; - if (!e->name.isEmpty() && e->name.at(0)!='@' && - (nd=namespaceDict[e->name]) + //printf("addNameSpace() trying: %s\n",e->name.data()); + QCString nsName = stripAnnonymousNamespaceScope(e->name); + if (!nsName.isEmpty() && nsName.at(0)!='@' && + (nd=namespaceDict[nsName]) ) { cd->setNamespace(nd); @@ -393,7 +397,7 @@ void buildClassList(Entry *root) } else { - fullName=stripAnnonymousScope(fullName); + fullName=stripAnnonymousNamespaceScope(fullName); //printf("new class with name %s\n",fullName.data()); bool ambig; @@ -506,14 +510,8 @@ void buildNamespaceList(Entry *root) root->name.length()>0 ) { - QCString fullName=root->name.copy(); - if (fullName.length()==0) - { - // this should not be called - warn("Warning: invalid namespace found in file %s at %d\n", - root->fileName.data(),root->startLine); - } - else + QCString fullName=stripAnnonymousNamespaceScope(root->name.copy()); + if (fullName.length()>0) { //printf("Found namespace %s in %s at line %d\n",root->name.data(), // root->fileName.data(), root->startLine); @@ -596,6 +594,8 @@ void buildNamespaceList(Entry *root) } } +//---------------------------------------------------------------------- + static MemberDef *addVariableToClass(Entry *root,ClassDef *cd, MemberDef::MemberType mtype,const QCString &scope,const QCString &name, bool fromAnnScope,int indentDepth,MemberDef *fromAnnMemb) @@ -642,7 +642,8 @@ static MemberDef *addVariableToClass(Entry *root,ClassDef *cd, MemberDef *md=mn->first(); while (md) { - if (md->memberClass()==cd) // member already in the scope + if (md->memberClass()==cd && root->type==md->typeString()) + // member already in the scope { addMemberDocs(root,md,def,FALSE); return md; @@ -668,9 +669,6 @@ static MemberDef *addVariableToClass(Entry *root,ClassDef *cd, // add the member to the global list if (mn) { - //printf("Member already found! %s\n",md->name()); - //addMemberDocs(root,mn->first(),def,FALSE); - //delete md; mn->inSort(md); } else // new variable name @@ -690,6 +688,107 @@ static MemberDef *addVariableToClass(Entry *root,ClassDef *cd, } //---------------------------------------------------------------------- + +static MemberDef *addVariableToFile(Entry *root,MemberDef::MemberType mtype, + const QCString &scope,const QCString &name, + bool fromAnnScope,int indentDepth,MemberDef *fromAnnMemb) +{ + Debug::print(Debug::Variables,0, + " global variable:\n" + " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d\n", + root->type.data(), + scope.data(), + name.data(), + root->args.data(), + root->protection + ); + + // new global variable, enum value or typedef + MemberDef *md=new MemberDef(root->type,name,root->args,0, + Public, Normal,root->stat,FALSE, + mtype,0,0); + md->setDefFile(root->fileName); + md->setDefLine(root->startLine); + md->setDocumentation(root->doc); + md->setBriefDescription(root->brief); + md->addSectionsToDefinition(root->anchors); + md->setFromAnnonymousScope(fromAnnScope); + md->setFromAnnonymousMember(fromAnnMemb); + md->setIndentDepth(indentDepth); + + // see if the function is inside a namespace + NamespaceDef *nd = 0; + if (scope.length()>0) + { + nd = namespaceDict[scope]; + } + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + { + nd->insertMember(md); + md->setNamespace(nd); + } + else + { + // find file definition + FileDef *fd=0; + bool ambig; + if (root->fileName.length()>0 && + (fd=findFileDef(&inputNameDict,root->fileName,ambig)) + ) + { + fd->insertMember(md); + md->setFileDef(fd); + } + } + + QCString def; + // determine the definition of the global variable + if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') + // variable is inside a namespace, so put the scope before the name + { + if (root->type.length()>0) + { + def=root->type+" "+nd->name()+"::"+name+root->args; + } + else + { + def=nd->name()+"::"+name+root->args; + } + } + else + { + if (root->type.length()>0) + { + if (name.at(0)=='@') // dummy variable representing annonymous union + def=root->type; + else + def=root->type+" "+name+root->args; + } + else + { + def=name+root->args; + } + } + if (def.left(7)=="static ") def=def.right(def.length()-7); + md->setDefinition(def); + + MemberName *mn = 0; + // add member definition to the list of globals + if ((mn=functionNameDict[name])) + { + mn->inSort(md); + } + else + { + mn = new MemberName(name); + mn->inSort(md); + functionNameDict.insert(name,mn); + functionNameList.inSort(mn); + } + return md; +} + +//---------------------------------------------------------------------- // Searches the Entry tree for Variable documentation sections. // If found they are stored in their class or in the global list. @@ -698,7 +797,7 @@ void buildVarList(Entry *root) QRegExp re("([^)]*)"); int i=-1; if (root->name.length()>0 && - root->type!="class" && + root->type!="class" && root->type!="interface" && ( (root->section==Entry::VARIABLE_SEC ) || @@ -751,7 +850,8 @@ void buildVarList(Entry *root) Entry *p = root->parent; while ((p->section & Entry::SCOPE_MASK)) { - QCString scopeName = stripAnnonymousScope(p->name); + //QCString scopeName = stripAnnonymousScope(p->name); + QCString scopeName = p->name.copy(); if (!scopeName.isEmpty()) { scope.prepend(scopeName); @@ -769,6 +869,10 @@ void buildVarList(Entry *root) // scope=scope.left(i); //} + MemberDef::MemberType mtype; + QCString type=root->type.stripWhiteSpace(); + ClassDef *cd=0; + int ni; if ((ni=root->name.findRev("::"))!=-1) goto nextMember; /* skip this member, because it is a @@ -778,9 +882,6 @@ void buildVarList(Entry *root) * inserted in the correct list! */ - MemberDef::MemberType mtype; -// NamespaceDef *nd = 0; - QCString type=root->type.stripWhiteSpace(); if (type=="@") mtype=MemberDef::EnumValue; else if (type.left(8)=="typedef ") @@ -790,17 +891,34 @@ void buildVarList(Entry *root) else mtype=MemberDef::Variable; - ClassDef *cd=0; + //printf("name=`%s' scope=%s\n",name.data(),scope.data()); + QCString classScope=stripAnnonymousNamespaceScope(scope); + QCString annScopePrefix=scope.left(scope.length()-classScope.length()); + scope=classScope; if (scope.length()>0 && name.length()>0 && (cd=getClass(scope))) { MemberDef *md=0; // if cd is an annonymous scope we insert the member // into a non-annonymous scope as well. int indentDepth=0; - if (scope.find('@')!=-1) + int si=scope.find('@'); + if (si!=-1) { - QCString pScope = scope.copy(); + //printf("name=`%s' scope=%s\n",name.data(),scope.data()); + QCString pScope; ClassDef *pcd=0; + pScope = scope.left(QMAX(si-2,0)); + indentDepth = scope.right(scope.length()-si).contains("::")+1; +#if 0 + // Find the last annonymous scope while search from right to left + // Keep track of the number of scope names we skipped. + while ((i=pScope.findRev("::"))!=-1 && (int)pScope.length()>i+2 && + pScope.at(i+2)!='@' + ) + { + pScope=pScope.left(i); + indentDepth++; + } while ((i=pScope.findRev("::"))!=-1 && (int)pScope.length()>i+2 && pScope.at(i+2)=='@' ) @@ -808,102 +926,37 @@ void buildVarList(Entry *root) pScope=pScope.left(i); indentDepth++; } - if ((pcd=getClass(pScope))) + if (pScope.length()>0 && pScope.at(0)=='@') + { + pScope.resize(0); + indentDepth++; + } +#endif + if (!pScope.isEmpty()) + pScope.prepend(annScopePrefix); + else if (annScopePrefix.length()>2) + pScope=annScopePrefix.left(annScopePrefix.length()-2); + //printf("pScope=`%s'\n",pScope.data()); + if (!name.isEmpty() && name.at(0)!='@') { - //printf("Inserting member in parent scope!\n"); - md=addVariableToClass(root,pcd,mtype,pScope,name,TRUE,indentDepth,0); + if (pScope.length()>0 && (pcd=getClass(pScope))) + { + //printf("Inserting member in parent scope!\n"); + md=addVariableToClass(root,pcd,mtype,pScope,name,TRUE,indentDepth,0); + } + else // annonymous scope inside namespace or file => put variable in the global scope + { + //printf("Inserting member in global scope %s!\n",pScope.data()); + md=addVariableToFile(root,mtype,pScope,name,!pScope.isEmpty(),indentDepth,0); + } } } addVariableToClass(root,cd,mtype,scope,name,FALSE,indentDepth,md); } else if (name.length()>0) // global variable { - Debug::print(Debug::Variables,0, - " global variable:\n" - " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d\n", - root->type.data(), - scope.data(), - name.data(), - root->args.data(), - root->protection - ); - - // new global variable, enum value or typedef - MemberDef *md=new MemberDef(root->type,name,root->args,0, - Public, Normal,root->stat,FALSE, - mtype,0,0); - md->setDefFile(root->fileName); - md->setDefLine(root->startLine); - md->setDocumentation(root->doc); - md->setBriefDescription(root->brief); - md->addSectionsToDefinition(root->anchors); - QCString def; - - // see if the function is inside a namespace - NamespaceDef *nd = 0; - if (scope.length()>0) - { - nd = namespaceDict[scope]; - } - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') - { - nd->insertMember(md); - md->setNamespace(nd); - } - else - { - // find file definition - FileDef *fd=0; - bool ambig; - if (root->fileName.length()>0 && - (fd=findFileDef(&inputNameDict,root->fileName,ambig)) - ) - { - fd->insertMember(md); - md->setFileDef(fd); - } - } - - // determine the definition of the global variable - if (nd && !nd->name().isEmpty() && nd->name().at(0)!='@') - // variable is inside a namespace, so put the scope before the name - { - if (root->type.length()>0) - { - def=root->type+" "+nd->name()+"::"+name+root->args; - } - else - { - def=nd->name()+"::"+name+root->args; - } - } - else - { - if (root->type.length()>0) - { - def=root->type+" "+name+root->args; - } - else - { - def=name+root->args; - } - } - if (def.left(7)=="static ") def=def.right(def.length()-7); - md->setDefinition(def); - - MemberName *mn; - // add member definition to the list of globals - if ((mn=functionNameDict[name])) - { - mn->inSort(md); - } - else - { - mn = new MemberName(name); - mn->inSort(md); - functionNameDict.insert(name,mn); - functionNameList.inSort(mn); - } + //printf("Inserting member in global scope %s!\n",scope.data()); + addVariableToFile(root,mtype,scope,name,FALSE,0,0); } } nextMember: @@ -948,7 +1001,7 @@ void buildMemberList(Entry *root) //printf("root->parent=`%s' cd=%p root->type.find(re,0)=%d\n", // root->parent->name.data(),getClass(root->parent->name), // root->type.find(re,0)); - QCString scope=stripAnnonymousScope(root->parent->name.copy()); + QCString scope=stripAnnonymousNamespaceScope(root->parent->name.copy()); int i; if (root->parent && root->parent->name.length()>0 && @@ -1002,6 +1055,7 @@ void buildMemberList(Entry *root) md->setBriefDescription(root->brief); md->setBody(root->body); md->setGroupId(root->mGrpId); + md->setInline(root->inLine); //md->setScopeTemplateArguments(root->tArgList); md->addSectionsToDefinition(root->anchors); QCString def; @@ -1095,7 +1149,7 @@ void buildMemberList(Entry *root) root->name.find("::")==-1 && root->relates.length()==0 && root->type.left(7)!="extern " && - root->type.left(8)!="typedef " + root->type.left(8)!="typedef " ) // no member => unrelated function { @@ -1151,6 +1205,7 @@ void buildMemberList(Entry *root) md->setBody(root->body); md->addSectionsToDefinition(root->anchors); md->setGroupId(root->mGrpId); + md->setInline(root->inLine); QCString def; if (root->type.length()>0) { @@ -1369,7 +1424,9 @@ void computeClassRelations(Entry *root) ) { ClassDef *cd; - if ((cd=getClass(root->name))) + QCString bName=stripAnnonymousNamespaceScope(root->name); + //printf("Class %s\n",bName.data()); + if ((cd=getClass(bName))) { //printf("Class %s %d\n",cd->name().data(),root->extends->count()); if (!cd->visited) @@ -1423,7 +1480,7 @@ void computeClassRelations(Entry *root) ClassDef *baseClass=getClass(baseClassName); //printf("baseClass %s of %s found (%s and %s)\n", // baseClassName.data(), - // root->name.data(), + // bName.data(), // (bi->prot==Private)?"private":((bi->prot==Protected)?"protected":"public"), // (bi->virt==Normal)?"normal":"virtual" // ); @@ -1481,7 +1538,7 @@ void computeClassRelations(Entry *root) } // class has no base classes } // else class is already found } - else if (root->name.right(2)!="::") + else if (bName.right(2)!="::") { if (root->name.length()>0 && root->name[0]!='@') warn("Warning: Compound %s\n" @@ -1605,6 +1662,7 @@ void addMemberDocs(Entry *root,MemberDef *md, const char *funcDecl, } md->setDefFile(root->fileName); md->setDefLine(root->startLine); + if (root->inLine && !md->isInline()) md->setInline(TRUE); md->addSectionsToDefinition(root->anchors); if (cd) cd->insertUsedFile(root->fileName); if (root->mGrpId!=-1) @@ -1823,10 +1881,12 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, bool isFunc) { Debug::print(Debug::FindMembers,0, - "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d,isFunc=%d mGrpId=%d tArgList=%p=\"%s\" scopeSpec=%s memberSpec=%s\n", + "findMember(root=%p,funcDecl=`%s',related=`%s',overload=%d," + "isFunc=%d mGrpId=%d tArgList=%p=\"%s\" scopeSpec=%s " + "memberSpec=%s inLine=%d\n", root,funcDecl.data(),related.data(),overloaded,isFunc,root->mGrpId, root->tArgList,tempArgListToString(root->tArgList).data(), - root->scopeSpec.data(),root->memberSpec.data() + root->scopeSpec.data(),root->memberSpec.data(),root->inLine ); if (Config::includeSourceFlag && !root->body.isEmpty()) { @@ -1851,6 +1911,11 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, funcDecl=funcDecl.right(funcDecl.length()-7); isFriend=TRUE; } + if (funcDecl.left(7)=="inline ") + { + funcDecl=funcDecl.right(funcDecl.length()-7); + root->inLine=TRUE; + } // delete any ; from the function declaration int sep; @@ -2229,6 +2294,8 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, } if (matching) { + //printf("addMemberDocs root->inLine=%d md->isInline()=%d\n", + // root->inLine,md->isInline()); addMemberDocs(root,md,funcDecl,overloaded); count++; } @@ -2309,6 +2376,7 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, md->setPrototype(root->proto); md->addSectionsToDefinition(root->anchors); md->setBody(root->body); + md->setInline(root->inLine); mn->inSort(md); cd->insertMember(md); cd->insertUsedFile(root->fileName); @@ -2374,6 +2442,7 @@ void findMember(Entry *root,QCString funcDecl,QCString related,bool overloaded, md->setDefLine(root->startLine); md->setPrototype(root->proto); md->setBody(root->body); + md->setInline(root->inLine); md->addSectionsToDefinition(root->anchors); mn->inSort(md); cd->insertMember(md); @@ -2421,8 +2490,8 @@ void findMemberDocumentation(Entry *root) int i,l; QRegExp re("([a-zA-Z0-9: ]*\\*+[ \\*]*"); Debug::print(Debug::FindMembers,0, - "root->type=`%s' root->name=`%s' root->args=`%s' section=%x\n", - root->type.data(),root->name.data(),root->args.data(),root->section + "root->type=`%s' root->name=`%s' root->args=`%s' section=%x root->inLine=%d\n", + root->type.data(),root->name.data(),root->args.data(),root->section,root->inLine ); bool isFunc=TRUE; if ((i=re.match(root->type,0,&l))!=-1) // func variable/typedef to func ptr @@ -2458,6 +2527,7 @@ void findMemberDocumentation(Entry *root) (root->section==Entry::FUNCTION_SEC && (!root->doc.isEmpty() || !root->brief.isEmpty() || !root->body.isEmpty() || root->mGrpId!=-1 /*|| Config::extractAllFlag*/ + || root->inLine ) ) { @@ -3149,6 +3219,39 @@ void generateClassDocs() //---------------------------------------------------------------------------- +void inheritDocumentation() +{ + MemberNameListIterator mnli(memberNameList); + MemberName *mn; + //int count=0; + for (;(mn=mnli.current());++mnli) + { + MemberNameIterator mni(*mn); + MemberDef *md; + for (;(md=mni.current());++mni) + { + //printf("%04d Member `%s'\n",count++,md->name().data()); + if (md->documentation().isEmpty() && md->briefDescription().isEmpty()) + { // no documentation yet + MemberDef *bmd = md->reimplements(); + while (bmd && bmd->documentation().isEmpty() && + bmd->briefDescription().isEmpty() + ) + { // search up the inheritance tree for a documentation member + bmd = bmd->reimplements(); + } + if (bmd) // copy the documentation from the reimplemented member + { + md->setDocumentation(bmd->documentation()); + md->setBriefDescription(bmd->briefDescription()); + } + } + } + } +} + +//---------------------------------------------------------------------------- + void findDefineDocumentation(Entry *root) { if ((root->section==Entry::DEFINEDOC_SEC || @@ -3286,6 +3389,30 @@ void buildPageList(Entry *root) } } +void findMainPage(Entry *root) +{ + if (root->section == Entry::MAINPAGEDOC_SEC) + { + if (mainPage==0) + { + //printf("Found main page! \n======\n%s\n=======\n",root->doc.data()); + mainPage = new PageInfo("index", root->doc, + root->args.stripWhiteSpace()); + } + else + { + warn("Warning: found more than one \\mainpage comment block!\n Skipping the " + "block at line %d of %s\n",root->startLine,root->fileName.data()); + } + } + EntryListIterator eli(*root->sublist); + Entry *e; + for (;(e=eli.current());++eli) + { + findMainPage(e); + } +} + //---------------------------------------------------------------------------- void resolveUserReferences() @@ -3309,6 +3436,25 @@ void resolveUserReferences() //---------------------------------------------------------------------------- // generate all separate documentation pages +//void generateMainPageDocs() +//{ +// if (mainPage) +// { +// msg("Generating docs for the main page\n",mainPage->name.data()); +// outputList->disable(OutputGenerator::Man); +// startFile(*outputList,mainPage->name,mainPage->title); +// SectionInfo *si=0; +// if (mainPage->title.length()>0 && mainPage->name.length()>0 && +// (si=sectionDict[mainPage->name])!=0) +// { +// outputList->writeSection(si->label,si->title,FALSE); +// } +// parseDoc(*outputList,0,0,mainPage->doc); +// endFile(*outputList); +// outputList->enable(OutputGenerator::Man); +// } +//} + void generatePageDocs() { PageInfo *pi=pageList.first(); @@ -3661,7 +3807,7 @@ bool patternMatch(QFileInfo *fi,QStrList *patList) #else // unix QRegExp re(pattern,TRUE,TRUE); // case sensitive match #endif - found = found || re.match(fi->fileName())!=-1; + found = found || re.match(fi->fileName())!=-1 || re.match(fi->filePath())!=-1; pattern=patList->next(); } } @@ -3766,9 +3912,10 @@ void readFiles(BufStr &output) copyAndFilterFile(fileName,output); } + output.addChar('\n'); /* to prevent problems under Windows ? */ + s=inputFiles.next(); //printf("-------> adding new line\n"); - output.addChar('\n'); /* to prevent problems under Windows ? */ } // *p++='\0'; output.addChar(0); @@ -4232,6 +4379,9 @@ int main(int argc,char **argv) msg("Building page list...\n"); buildPageList(root); + + msg("Search for main page...\n"); + findMainPage(root); // msg("Adding compounds to file pages...\n"); // findClassDefsInFiles(root); @@ -4283,6 +4433,12 @@ int main(int argc,char **argv) computeMemberGroupDocumentation(); //unrelatedFunctionsUsed=hasUnrelatedFunctions(); + + if (Config::inheritDocsFlag) + { + msg("Inheriting documentation...\n"); + inheritDocumentation(); + } /************************************************************************** * Generate documentation * diff --git a/src/doxygen.h b/src/doxygen.h index 00803c0..d22d55a 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -113,6 +113,7 @@ extern NamespaceDict namespaceDict; extern FormulaList formulaList; extern FormulaDict formulaDict; extern FormulaDict formulaNameDict; +extern PageInfo *mainPage; extern int annotatedClasses; extern int hierarchyClasses; diff --git a/src/entry.cpp b/src/entry.cpp index c330f8b..e66e584 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -65,6 +65,7 @@ Entry::Entry(const Entry &e) fileName = e.fileName.copy(); startLine = e.startLine; mGrpId = e.mGrpId; + inLine = e.inLine; sublist = new QList<Entry>; sublist->setAutoDelete(TRUE); extends = new QList<BaseInfo>; @@ -207,6 +208,7 @@ void Entry::reset() slot = FALSE; stat = FALSE; proto = FALSE; + inLine = FALSE; protection = Public; sublist->clear(); extends->clear(); diff --git a/src/entry.h b/src/entry.h index 18ee013..faf54bb 100644 --- a/src/entry.h +++ b/src/entry.h @@ -62,6 +62,7 @@ struct Argument class ArgumentList : public QList<Argument> { public: + ~ArgumentList() {} ArgumentList() : QList<Argument>(), constSpecifier(FALSE), volatileSpecifier(FALSE), @@ -106,6 +107,7 @@ class Entry NAMESPACEDOC_SEC = 0x02000000, INTERFACE_SEC = 0x04000000, INTERFACEDOC_SEC = 0x08000000, + MAINPAGEDOC_SEC = 0x10000000, COMPOUND_MASK = CLASS_SEC | STRUCT_SEC | UNION_SEC | INTERFACE_SEC, COMPOUNDDOC_MASK = CLASSDOC_SEC | STRUCTDOC_SEC | UNIONDOC_SEC | INTERFACEDOC_SEC, SCOPE_MASK = COMPOUND_MASK | NAMESPACE_SEC, @@ -126,6 +128,7 @@ class Entry bool slot; // a Qt slot ? bool stat; // static ? bool proto; // prototype ? + bool inLine; // inline ? Specifier virt; // virtualness of the entry Entry *parent; // parent node in the tree QCString type; // member type diff --git a/src/filedef.cpp b/src/filedef.cpp index f038e2e..d4caa71 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -37,6 +37,7 @@ FileDef::FileDef(const char *p,const char *nm,const char *ref) path=p; filepath=path+nm; filename=nameToFile(nm); + diskname=filename.copy(); setReference(ref); memList = new MemberList; classList = new ClassList; @@ -72,9 +73,9 @@ void FileDef::writeDocumentation(OutputList &ol) QCString pageTitle=name()+" File Reference"; startFile(ol,diskname,pageTitle); - startTitle(ol); + startTitle(ol,getOutputFileBase()); parseText(ol,theTranslator->trFileReference(name())); - endTitle(ol,name()); + endTitle(ol,getOutputFileBase(),name()); //ol.newParagraph(); if (Config::genTagFile.length()>0) tagFile << "&" << name() << ":\n"; @@ -184,8 +185,8 @@ void FileDef::writeDocumentation(OutputList &ol) ol.endMemberItem(FALSE,0,0,FALSE); } cd=classList->next(); - if (found) ol.endMemberList(); } + if (found) ol.endMemberList(); } memList->writeDeclarations(ol,0,0,this,0,0); @@ -265,14 +266,11 @@ void FileDef::writeDocumentation(OutputList &ol) memList->writeDocumentation(ol,name(),MemberDef::EnumValue); } - int cnt; - if ( (cnt=memList->funcCount()>0) ) + if ( memList->funcCount()>0 ) { ol.writeRuler(); ol.startGroupHeader(); - QCString cntString; - cntString.sprintf(" (%d)",cnt); - parseText(ol,theTranslator->trFunctionDocumentation()+cntString); + parseText(ol,theTranslator->trFunctionDocumentation()); ol.endGroupHeader(); memList->writeDocumentation(ol,name(),MemberDef::Function); } diff --git a/src/filename.h b/src/filename.h index cb39ce5..a7deffe 100644 --- a/src/filename.h +++ b/src/filename.h @@ -59,6 +59,7 @@ class FileNameDict : public QDict<FileName> { public: FileNameDict(uint size) : QDict<FileName>(size) {} + ~FileNameDict() {} }; #endif diff --git a/src/formula.h b/src/formula.h index 9edd583..8f38433 100644 --- a/src/formula.h +++ b/src/formula.h @@ -52,6 +52,7 @@ class FormulaDict : public QDict<Formula> public: FormulaDict(uint size) : QDict<Formula>(size) {} + ~FormulaDict() {} }; #endif diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 6f0133a..846bb58 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -78,9 +78,9 @@ void GroupDef::writeDocumentation(OutputList &ol) { ol.disable(OutputGenerator::Man); startFile(ol,fileName,title); - startTitle(ol); + startTitle(ol,getOutputFileBase()); ol.docify(title); - endTitle(ol,name()); + endTitle(ol,getOutputFileBase(),name()); //brief=brief.stripWhiteSpace(); //int bl=brief.length(); @@ -112,13 +112,18 @@ void GroupDef::writeDocumentation(OutputList &ol) } if (classList->count()>0) { - ol.startMemberHeader(); - parseText(ol,theTranslator->trCompounds()); - ol.endMemberHeader(); - ol.startIndexList(); ClassDef *cd=classList->first(); + bool found=FALSE; while (cd) { + if (!found) + { + ol.startMemberHeader(); + parseText(ol,theTranslator->trCompounds()); + ol.endMemberHeader(); + ol.startIndexList(); + found=TRUE; + } QCString type; switch (cd->compoundType()) { diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 53b20b9..76c1832 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -170,17 +170,25 @@ void HtmlGenerator::writeStyleInfo(int part) t << "DL.el { margin-left: -1cm }" << endl; t << "DIV.fragment { width: 100%; border: none; background-color: #eeeeee }" << endl; t << "DIV.in { margin-left: 16 }" << endl; + t << "DIV.ah { background-color: black; margin-bottom: 3; margin-top: 3 }" << endl; t << "A.gl:link { color: #ffffff }" << endl; t << "A.gl:visited { color: #ffffff }" << endl; t << "A.gl { text-decoration: none; font-weight: bold; background-color: " << GROUP_COLOR << " }" << endl; + t << "TD.md { background-color: #f2f2ff }" << endl; t << endl; endPlainFile(); } } -void HtmlGenerator::writeDoxyAnchor(const char *,const char *anchor, const char *name) +void HtmlGenerator::startDoxyAnchor(const char *,const char *, + const char *anchor, const char *name) +{ + t << "<a name=\"" << anchor << "\" doxytag=\"" << name << "\">"; +} + +void HtmlGenerator::endDoxyAnchor() { - t << "<a name=\"" << anchor << "\" doxytag=\"" << name << "\"></a>"; + t << "</a>" << endl; } void HtmlGenerator::newParagraph() @@ -601,17 +609,40 @@ void HtmlGenerator::endIndexList() //} } -void HtmlGenerator::startAlfabeticalIndexList() +void HtmlGenerator::startAlphabeticalIndexList() { - t << "<multicol cols=5><dl compact>" << endl; + t << "<table width=95% border=0 cellspacing=0 cellpadding=0>" << endl; } -void HtmlGenerator::endAlfabeticalIndexList() +void HtmlGenerator::endAlphabeticalIndexList() { - t << "</dl></multicol>" << endl; + t << "</table>" << endl; } void HtmlGenerator::writeIndexHeading(const char *s) { - t << "<dt><b><big>" << s << "</big></b><dd>" << endl; + //t << "<dt><b><big>" << s << "</big></b><dd>" << endl; + t << "<div class=\"ah\"><font color=\"white\"><b> " << s + << " </b></font></div>"; +} + +void HtmlGenerator::writeImage(const char *name,const char *,const char *) +{ + QCString baseName=name; + int i; + if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) + { + baseName=baseName.right(baseName.length()-i); + } + t << "<img src=" << name << " alt=\"" << baseName << "\">" << endl; +} + +void HtmlGenerator::startMemberDoc(const char *,const char *,const char *,const char *) +{ + t << endl << "<p><table width=100%% cellpadding=2 cellspacing=0 border=0><tr><td class=\"md\"><b>" << endl; +} + +void HtmlGenerator::endMemberDoc() +{ + t << endl << "</b></td></tr></table>" << endl; } diff --git a/src/htmlgen.h b/src/htmlgen.h index f742761..01d8903 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -54,8 +54,8 @@ class HtmlGenerator : public OutputGenerator void startProjectNumber(); void endProjectNumber(); void writeStyleInfo(int part); - void startTitleHead() { startTitle(); } - void endTitleHead(const char *) { endTitle(); } + void startTitleHead(const char *) { startTitle(); } + void endTitleHead(const char *,const char *) { endTitle(); } void startTitle() { t << "<h1>"; } void endTitle() { t << "</h1>"; } @@ -67,8 +67,8 @@ class HtmlGenerator : public OutputGenerator void endItemList() { t << "</ul>" << endl; } void startEnumList() { t << "<ol>" << endl; } void endEnumList() { t << "</ol>" << endl; } - void startAlfabeticalIndexList(); - void endAlfabeticalIndexList(); + void startAlphabeticalIndexList(); + void endAlphabeticalIndexList(); void writeIndexHeading(const char *s); void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); @@ -120,13 +120,15 @@ class HtmlGenerator : public OutputGenerator void endDescItem() { t << "<dd>"; } void lineBreak() { t << "<br>" << endl; } void writeChar(char c); - void startMemberDoc(const char *,const char *,const char *) - { t << endl << "<h3>"; } - void endMemberDoc() { t << "</h3>" << endl; } - void writeDoxyAnchor(const char *clName,const char *anchor, - const char *name); + void startMemberDoc(const char *,const char *,const char *,const char *); + void endMemberDoc(); + //void writeDoxyAnchor(const char *fName,const char *clName, + // const char *anchor,const char *name); + void startDoxyAnchor(const char *fName,const char *clName, + const char *anchor,const char *name); + void endDoxyAnchor(); void writeLatexSpacing() {} - void writeLatexLabel(const char *,const char *) {} + //void writeLatexLabel(const char *,const char *) {} void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); void writeEndAnnoItem(const char *) { t << endl; } @@ -144,7 +146,7 @@ class HtmlGenerator : public OutputGenerator void endSuperscript() { t << "</sup>"; } void startTable(int) { t << "<table border=1 cellspacing=3 cellpadding=3>"; } void endTable() { t << "</table>" << endl; } - void nextTableRow() { t << endl << "<tr><td>"; } + void nextTableRow() { t << "<tr><td>"; } void endTableRow() { t << "</tr>" << endl; } void nextTableColumn() { t << "<td>"; } void endTableColumn() { t << "</td>"; } @@ -171,11 +173,13 @@ class HtmlGenerator : public OutputGenerator void endClassDiagram(ClassDiagram &,const char *,const char *); void startColorFont(uchar r,uchar g,uchar b); void endColorFont(); - void writePageRef(const char *,const char *) {} + void startPageRef() {} + void endPageRef(const char *,const char *) {} void startQuickIndexItem(const char *,const char *); void endQuickIndexItem(); void writeFormula(const char *,const char *); void writeNonBreakableSpace() { t << " "; } + void writeImage(const char *,const char *,const char *); //static void docifyStatic(QTextStream &t,const char *str); diff --git a/src/index.cpp b/src/index.cpp index 3ad97d9..2df55a1 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -275,10 +275,10 @@ void writeHierarchicalIndex(OutputList &ol) if (hierarchyClasses==0) return; ol.disable(OutputGenerator::Man); startFile(ol,"hierarchy","Hierarchical Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trClassHierarchy(); parseText(ol,title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; if (Config::generateHtml && Config::htmlHelpFlag) { @@ -318,10 +318,10 @@ void writeFileIndex(OutputList &ol) if (documentedFiles==0) return; ol.disable(OutputGenerator::Man); startFile(ol,"files","File Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trFileList(); parseText(ol,title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; bool hasHtmlHelp = Config::generateHtml && Config::htmlHelpFlag; if (hasHtmlHelp) @@ -410,10 +410,10 @@ void writeNamespaceIndex(OutputList &ol) if (documentedNamespaces==0) return; ol.disable(OutputGenerator::Man); startFile(ol,"namespaces","Namespace Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trNamespaceList(); parseText(ol,title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; bool hasHtmlHelp = Config::generateHtml && Config::htmlHelpFlag; if (hasHtmlHelp) @@ -536,31 +536,126 @@ void writeAnnotatedClassList(OutputList &ol) //---------------------------------------------------------------------------- -void writeAlfabeticalClassList(OutputList &ol) +// write an alphabetical index of all class with a header for each letter +void writeAlphabeticalClassList(OutputList &ol) { - ol.startAlfabeticalIndexList(); - //ClassDef *cd=classList.first(); - //while (cd) + ol.startAlphabeticalIndexList(); + + // first count the number of headers ClassListIterator cli(classList); ClassDef *cd; char startLetter=0; + int headerItems=0; for (;(cd=cli.current());++cli) { if (cd->isLinkableInProject()) { + if (cd->name().at(0)!=startLetter) // new begin letter => new header + { + startLetter=cd->name().at(0); + headerItems++; + } + } + } + + // the number of columns in the table + const int columns = 5; + + int i,j; + int totalItems = headerItems + annotatedClasses; // number of items in the table + int rows = (totalItems + columns - 1)/columns; // number of rows in the table + int itemsInLastRow = (totalItems + columns -1)%columns + 1; // number of items in the last row + + //printf("headerItems=%d totalItems=%d columns=%d rows=%d itemsInLastRow=%d\n", + // headerItems,totalItems,columns,rows,itemsInLastRow); + + // create one class list for each column + ClassList *colList = new ClassList[columns]; + + // fill the columns with the class list (row elements in each column, + // expect for the columns with number >= itemsInLastRow, which get on + // item less. + int col=0,row=0; + //int icount=0; + startLetter=0; + for (cli.toFirst();(cd=cli.current());++cli) + { + if (cd->isLinkableInProject()) + { if (cd->name().at(0)!=startLetter) { + // insert a new header using a dummy class pointer. startLetter=cd->name().at(0); - char s[2]; s[0]=startLetter; s[1]=0; - ol.writeIndexHeading(s); + colList[col].append((ClassDef *)8); // insert dummy for the header + row++; + if ( row >= rows + ((col<itemsInLastRow) ? 0 : -1)) + { + // if the header is the last item in the row, we add an extra + // row to make it easier to find the text of the header (this + // is then contained in the next cell) + colList[col].append(cd); + col++; + row=0; + } } - ol.writeObjectLink(cd->getReference(), - cd->getOutputFileBase(),0,cd->name()); - ol.lineBreak(); + // add the class definition to the correct column list + colList[col].append(cd); + row++; + if ( row >= rows + ((col<itemsInLastRow) ? 0 : -1)) { col++; row=0; } } - cd=classList.next(); } - ol.endAlfabeticalIndexList(); + + // create iterators for each column + ClassListIterator **colIterators = new ClassListIterator*[columns]; + for (i=0;i<columns;i++) + { + colIterators[i] = new ClassListIterator(colList[i]); + } + + // generate table + for (i=0;i<rows;i++) // forarch table row + { + ol.nextTableRow(); + // the last column may contain less items then the others + int colsInRow = (i<rows-1) ? columns : itemsInLastRow; + //printf("row [%d]\n",i); + for (j=0;j<colsInRow;j++) // foreach table column + { + ClassDef *cd = colIterators[j]->current(); + //printf("columns [%d] cd=%p\n",j,cd); + if (cd==(ClassDef *)8) // the class pointer is really a header + { + cd=++(*colIterators[j]); // get the next item + if (cd) + { + //printf("head ClassDef=%p %s\n",cd,cd ? cd->name().data() : "<none>"); + startLetter=cd->name().at(0); + char s[2]; s[0]=startLetter; s[1]=0; + ol.writeIndexHeading(s); + } + } + else if (cd) // a real class, insert a link + { + ol.writeObjectLink(cd->getReference(), + cd->getOutputFileBase(),0,cd->name()); + ol.writeNonBreakableSpace(); + //printf("item ClassDef=%p %s\n",cd,cd ? cd->name().data() : "<none>"); + ++(*colIterators[j]); + } + ol.endTableColumn(); + if (j<colsInRow-1) ol.nextTableColumn(); + } + ol.endTableRow(); + } + ol.endAlphabeticalIndexList(); + + // release the temporary memory + for (i=0;i<columns;i++) + { + delete colIterators[i]; + } + delete[] colIterators; + delete[] colList; } //---------------------------------------------------------------------------- @@ -569,11 +664,11 @@ void writeAlphabeticalIndex(OutputList &ol) { ol.disableAllBut(OutputGenerator::Html); if (annotatedClasses==0) return; - startFile(ol,"classes.html","Alfabetical index"); - startTitle(ol); + startFile(ol,"classes.html","Alphabetical index"); + startTitle(ol,0); parseText(ol,Config::projectName+" "+theTranslator->trCompoundIndex()); - endTitle(ol,0); - writeAlfabeticalClassList(ol); + endTitle(ol,0,0); + writeAlphabeticalClassList(ol); endFile(ol); ol.enableAll(); } @@ -587,10 +682,10 @@ void writeAnnotatedIndex(OutputList &ol) //if (classList.count()==0) return; ol.disable(OutputGenerator::Man); startFile(ol,"annotated","Annotated Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trCompoundList(); parseText(ol,title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; if (Config::generateHtml && Config::htmlHelpFlag) { @@ -728,9 +823,9 @@ void writeMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); startFile(ol,"functions","Compound Member Index"); - startTitle(ol); + startTitle(ol,0); parseText(ol,Config::projectName+" "+theTranslator->trCompoundMembers()); - endTitle(ol,0); + endTitle(ol,0,0); parseText(ol,theTranslator->trCompoundMembersDescription(Config::extractAllFlag)); writeMemberList(ol); endFile(ol); @@ -921,9 +1016,9 @@ void writeFileMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); startFile(ol,"globals","File Member Index"); - startTitle(ol); + startTitle(ol,0); parseText(ol,Config::projectName+" "+theTranslator->trFileMembers()); - endTitle(ol,0); + endTitle(ol,0,0); parseText(ol,theTranslator->trFileMembersDescription(Config::extractAllFlag)); writeFileMemberList(ol); endFile(ol); @@ -939,9 +1034,9 @@ void writeNamespaceMemberIndex(OutputList &ol) ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); startFile(ol,"namespacemembers","Namespace Member Index"); - startTitle(ol); + startTitle(ol,0); parseText(ol,Config::projectName+" "+theTranslator->trNamespaceMembers()); - endTitle(ol,0); + endTitle(ol,0,0); parseText(ol,theTranslator->trNamespaceMemberDescription(Config::extractAllFlag)); writeNamespaceMemberList(ol); endFile(ol); @@ -1007,10 +1102,10 @@ void writeHeaderIndex(OutputList &ol) ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); startFile(ol,"headers","Header File Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trHeaderFiles(); parseText(ol,title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; if (Config::generateHtml && Config::htmlHelpFlag) { @@ -1036,10 +1131,10 @@ void writeExampleIndex(OutputList &ol) if (exampleList.count()==0) return; ol.disable(OutputGenerator::Man); startFile(ol,"examples","Example Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trExamples(); parseText(ol,title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; bool hasHtmlHelp = Config::generateHtml && Config::htmlHelpFlag; if (hasHtmlHelp) @@ -1084,10 +1179,10 @@ void writePageIndex(OutputList &ol) if (pageList.count()==0) return; ol.disable(OutputGenerator::Man); startFile(ol,"pages","Page Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trRelatedPages(); ol.docify(title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; bool hasHtmlHelp = Config::generateHtml && Config::htmlHelpFlag; if (hasHtmlHelp) @@ -1173,10 +1268,10 @@ void writeGroupIndex(OutputList &ol) if (documentedGroups==0) return; ol.disable(OutputGenerator::Man); startFile(ol,"modules","Module Index"); - startTitle(ol); + startTitle(ol,0); QCString title = Config::projectName+" "+theTranslator->trModules(); parseText(ol,title); - endTitle(ol,0); + endTitle(ol,0,0); HtmlHelp *htmlHelp = 0; bool hasHtmlHelp = Config::generateHtml && Config::htmlHelpFlag; if (hasHtmlHelp) @@ -1212,9 +1307,16 @@ void writeIndex(OutputList &ol) ol.disable(OutputGenerator::Latex); ol.startFile("index","Main Index",FALSE); if (!Config::noIndexFlag) writeQuickLinks(ol,TRUE); - ol.startTitleHead(); - parseText(ol,projPrefix+theTranslator->trDocumentation()); - ol.endTitleHead(0); + ol.startTitleHead(0); + if (mainPage && !mainPage->title.isEmpty()) + { + parseDoc(ol,0,0,mainPage->title); + } + else + { + parseText(ol,projPrefix+theTranslator->trDocumentation()); + } + ol.endTitleHead(0,0); ol.newParagraph(); if (!Config::projectNumber.isEmpty()) { @@ -1223,6 +1325,12 @@ void writeIndex(OutputList &ol) ol.endProjectNumber(); } if (Config::noIndexFlag) writeQuickLinks(ol,FALSE); + + if (mainPage) + { + parseDoc(ol,0,0,mainPage->doc); + } + endFile(ol); ol.disable(OutputGenerator::Html); @@ -1241,6 +1349,19 @@ void writeIndex(OutputList &ol) ol.startIndexSection(isTitlePageAuthor); parseText(ol,theTranslator->trGeneratedBy()); ol.endIndexSection(isTitlePageAuthor); + if (mainPage) + { + ol.startIndexSection(isMainPage); + if (!mainPage->title.isEmpty()) + { + parseDoc(ol,0,0,mainPage->title); + } + else + { + parseText(ol,projPrefix+theTranslator->trMainPage()); + } + ol.endIndexSection(isMainPage); + } if (documentedGroups>0) { ol.startIndexSection(isModuleIndex); diff --git a/src/index.h b/src/index.h index ad17339..a3b3816 100644 --- a/src/index.h +++ b/src/index.h @@ -25,6 +25,7 @@ enum IndexSections { isTitlePageStart, isTitlePageAuthor, + isMainPage, isModuleIndex, isNamespaceIndex, isClassHierarchyIndex, diff --git a/src/language.cpp b/src/language.cpp index cee63a8..a04b18e 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -15,6 +15,7 @@ */ #include "language.h" +#if !defined(ENGLISH_ONLY) #include "translator_nl.h" #include "translator_se.h" #include "translator_cz.h" @@ -23,6 +24,7 @@ #include "translator_de.h" #include "translator_jp.h" #include "translator_es.h" +#endif #define L_EQUAL(a) !stricmp(langName,a) @@ -34,6 +36,7 @@ bool setTranslator(const char *langName) { theTranslator=new Translator; } +#if !defined(ENGLISH_ONLY) else if (L_EQUAL("dutch")) { theTranslator=new TranslatorDutch; @@ -66,6 +69,7 @@ bool setTranslator(const char *langName) { theTranslator=new TranslatorSpanish; } +#endif else // use the default language (i.e. english) { theTranslator=new Translator; diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 3834871..9ac5cac 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -26,6 +26,25 @@ #include "diagram.h" #include "language.h" +static QCString filterTitle(const char *s) +{ + QCString tmp=s,result; + uint i;for (i=0;i<tmp.length();i++) + { + char c=tmp.at(i); + switch(c) + { + case '#': result+="\\#"; break; + case '"': result+="\\\""; break; + case '%': result+="\\%"; break; + case '[': result+="{"; break; + case ']': result+="}"; break; + default: result+=c; break; + } + } + return result; +} + //static QCString escapeLabelName(const QCString &s) //{ // QCString result; @@ -49,6 +68,7 @@ LatexGenerator::LatexGenerator() { dir=Config::latexOutputDir; col=0; + //printf("LatexGenerator::LatexGenerator() insideTabbing=FALSE\n"); insideTabbing=FALSE; } @@ -66,8 +86,17 @@ void LatexGenerator::append(const OutputGenerator *g) { t << g->getContents(); col+=((LatexGenerator *)g)->col; + insideTabbing=insideTabbing || ((LatexGenerator *)g)->insideTabbing; + //printf("LatexGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(), + // insideTabbing ? "TRUE" : "FALSE" ); } +OutputGenerator *LatexGenerator::copy() +{ + LatexGenerator *result = new LatexGenerator; + result->insideTabbing=insideTabbing; + return result; +} void LatexGenerator::init() { @@ -91,6 +120,9 @@ void LatexGenerator::init() << endl << "ps: refman.ps" << endl << endl + << "pdf: ps" << endl + << "\tps2pdf refman.ps refman.pdf" << endl + << endl << "refman.ps: refman.dvi" << endl << "\tdvips -o refman.ps refman.dvi" << endl << endl @@ -102,7 +134,7 @@ void LatexGenerator::init() << "\techo \"Rerunning latex....\"" << endl << "\tlatex refman.tex" << endl << "clean:" << endl - << "\trm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log" << endl; + << "\trm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out" << endl; } void LatexGenerator::startFile(const char *name,const char *,bool) @@ -134,42 +166,67 @@ void LatexGenerator::startIndexSection(IndexSections is) { case isTitlePageStart: { - if (Config::paperType=="a4wide") paperName="a4"; else paperName=Config::paperType; - t << "\\documentclass[" << paperName << "paper]{"; - if (Config::compactLatexFlag) t << "article"; else t << "book"; - t << "}\n"; - if (Config::paperType=="a4wide") t << "\\usepackage{a4wide}\n"; - t << "\\usepackage{makeidx}\n" - "\\usepackage{fancyheadings}\n" - "\\usepackage{epsf}\n" - "\\usepackage{float}\n" - "\\usepackage{doxygen}\n"; - if (!theTranslator->latexBabelPackage().isEmpty()) + if (Config::latexHeaderFile.isEmpty()) { - t << "\\usepackage{" << theTranslator->latexBabelPackage() << "}\n"; + if (Config::paperType=="a4wide") paperName="a4"; else paperName=Config::paperType; + t << "\\documentclass[" << paperName << "paper"; + if (Config::pdfHyperFlag) t << ",ps2pdf"; + t << "]{"; + if (Config::compactLatexFlag) t << "article"; else t << "book"; + t << "}\n"; + if (Config::paperType=="a4wide") t << "\\usepackage{a4wide}\n"; + t << "\\usepackage{makeidx}\n" + "\\usepackage{fancyheadings}\n" + "\\usepackage{epsfig}\n" + "\\usepackage{float}\n" + "\\usepackage{doxygen}\n"; + if (Config::pdfHyperFlag) + { + t << "\\usepackage{times}" << endl + << "\\usepackage[backref=true," << endl + << " pagebackref=true," << endl + << " colorlinks=true," << endl + << " linkcolor=blue" << endl + << " ]{hyperref}" << endl; + } + if (!theTranslator->latexBabelPackage().isEmpty()) + { + t << "\\usepackage{" << theTranslator->latexBabelPackage() << "}\n"; + } + const char *s=Config::extraPackageList.first(); + while (s) + { + t << "\\usepackage{" << s << "}\n"; + s=Config::extraPackageList.next(); + } + t << "\\makeindex\n" + "\\setcounter{tocdepth}{1}\n" + "\\setlength{\\footrulewidth}{0.4pt}\n" + "\\begin{document}\n" + "\\title{"; + //docify(projectName); + //t << " Reference Manual"; + //if (!projectNumber.isEmpty()) + //{ + // t << "\\\\[1ex]\\large "; + // docify(projectNumber); + //} } - const char *s=Config::extraPackageList.first(); - while (s) + else { - t << "\\usepackage{" << s << "}\n"; - s=Config::extraPackageList.next(); + t << fileToString(Config::latexHeaderFile); } - t << "\\makeindex\n" - "\\setcounter{tocdepth}{1}\n" - "\\setlength{\\footrulewidth}{0.4pt}\n" - "\\begin{document}\n" - "\\title{"; - //docify(projectName); - //t << " Reference Manual"; - //if (!projectNumber.isEmpty()) - //{ - // t << "\\\\[1ex]\\large "; - // docify(projectNumber); - //} } break; case isTitlePageAuthor: - t << "}\n\\author{"; + if (Config::latexHeaderFile.isEmpty()) + { + t << "}\n\\author{"; + } + break; + case isMainPage: + if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; + t << "{"; //Introduction}\n" break; case isModuleIndex: if (Config::compactLatexFlag) t << "\\section"; else t << "\\chapter"; @@ -288,14 +345,20 @@ void LatexGenerator::endIndexSection(IndexSections is) case isTitlePageStart: break; case isTitlePageAuthor: - t << " Doxygen}\n" - "\\date{" << dateToString(TRUE) << "}\n" - "\\maketitle\n" - "\\pagenumbering{roman}\n"; - if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; - t << "\\tableofcontents\n"; - if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; - t << "\\pagenumbering{arabic}\n"; + if (Config::latexHeaderFile.isEmpty()) + { + t << " Doxygen}\n" + "\\date{" << dateToString(TRUE) << "}\n" + "\\maketitle\n" + "\\pagenumbering{roman}\n"; + if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; + t << "\\tableofcontents\n"; + if (!Config::compactLatexFlag) t << "\\clearemptydoublepage\n"; + t << "\\pagenumbering{arabic}\n"; + } + break; + case isMainPage: + t << "}\n\\input{index}\n"; break; case isModuleIndex: t << "}\n\\input{modules}\n"; @@ -495,14 +558,14 @@ void LatexGenerator::writeStyleInfo(int part) break; case 2: { - t << " Dimitri van Heesch \\copyright 1997-1999}]{}\n"; + t << " Dimitri van Heesch (c) 1997-1999}]{}\n"; //QCString dtString=dateToString(FALSE); t << "\\lfoot[]{\\fancyplain{}{\\bfseries\\scriptsize "; } break; case 4: { - t << " Dimitri van Heesch \\copyright 1997-1999}}\n"; + t << " Dimitri van Heesch (c) 1997-1999}}\n"; t << "\\cfoot{}\n"; t << "\\newenvironment{CompactList}\n"; t << "{\\begin{list}{}{\n"; @@ -553,19 +616,6 @@ void LatexGenerator::writeStyleInfo(int part) } } -void LatexGenerator::endTitleHead(const char *name) -{ - t << "}" << endl; - if (name) - { - t << "\\label{" << name << "}\\index{" - << name << "@{"; - docify(name); - t << "}}"; - } - t << endl; -} - void LatexGenerator::newParagraph() { t << endl << endl; @@ -584,7 +634,7 @@ void LatexGenerator::writeIndexItem(const char *ref,const char *fn, { t << "\\contentsline{section}{"; docify(name); - t << "}{\\pageref{" << name << "}}" << endl; + t << "}{\\pageref{" << name << "}}{}" << endl; } else docify(name); @@ -620,7 +670,7 @@ void LatexGenerator::writeStartAnnoItem(const char *,const char *, void LatexGenerator::writeEndAnnoItem(const char *name) { - t << "}{\\pageref{" << name << "}}" << endl; + t << "}{\\pageref{" << name << "}}{}" << endl; } //void LatexGenerator::writeClassLink(const char *,const char *, @@ -631,17 +681,34 @@ void LatexGenerator::writeEndAnnoItem(const char *name) // t << "}"; //} -void LatexGenerator::writeObjectLink(const char *, const char *, - const char *, const char *text) +void LatexGenerator::writeObjectLink(const char *ref, const char *f, + const char *anchor, const char *text) { - t << "{\\bf "; - docify(text); - t << "}"; + if (!ref && Config::pdfHyperFlag) + { + t << "\\hyperlink{"; + if (f) t << f; + if (anchor) t << "_" << anchor; + t << "}{"; + docify(text); + t << "}"; + } + else + { + t << "{\\bf "; + docify(text); + t << "}"; + } +} + +void LatexGenerator::startPageRef() +{ + t << " {\\rm ("; } -void LatexGenerator::writePageRef(const char *clname, const char *anchor) +void LatexGenerator::endPageRef(const char *clname, const char *anchor) { - t << " {\\rm (p.~\\pageref{"; + t << "~\\pageref{"; if (clname) t << clname; if (anchor) t << "_" << anchor; t << "})}"; @@ -654,6 +721,30 @@ void LatexGenerator::writeCodeLink(const char *,const char *, col+=strlen(name); } +void LatexGenerator::startTitleHead(const char *fileName) +{ + if (Config::pdfHyperFlag && fileName) + { + t << "\\hypertarget{" << fileName << "}{" << endl; + } + if (Config::compactLatexFlag) t << "\\subsection{"; else t << "\\section{"; +} + +void LatexGenerator::endTitleHead(const char *fileName,const char *name) +{ + t << "}" << endl; + if (name) + { + t << "\\label{" << name << "}\\index{" + << name << "@{"; + docify(name); + t << "}}" << endl; + if (Config::pdfHyperFlag && fileName) + { + t << "}" << endl; + } + } +} void LatexGenerator::startTitle() { @@ -671,7 +762,9 @@ void LatexGenerator::endGroupHeader() } void LatexGenerator::startMemberDoc(const char *clname, - const char *memname,const char *) + const char *memname, + const char *, + const char *title) { t << "\\index{"; if (clname) @@ -695,23 +788,41 @@ void LatexGenerator::startMemberDoc(const char *clname, } t << "}" << endl; // - if (Config::compactLatexFlag) t << "\\subsubsection{"; else t << "\\subsection{"; - t << "\\setlength{\\rightskip}{0pt plus 5cm}"; + if (Config::compactLatexFlag) t << "\\subsubsection"; else t << "\\subsection"; + if (Config::pdfHyperFlag && title) t << "[" << filterTitle(title) << "]"; + t << "{\\setlength{\\rightskip}{0pt plus 5cm}"; } -void LatexGenerator::writeDoxyAnchor(const char *clname,const char *anchor,const char *) +void LatexGenerator::startDoxyAnchor(const char *fName,const char *clname, + const char *anchor,const char *) { t << "\\label{"; if (clname) t << clname; if (anchor) t << "_" << anchor; t << "}" << endl; + if (Config::pdfHyperFlag) + { + t << "\\hypertarget{"; + if (fName) t << fName; + if (anchor) t << "_" << anchor; + t << "}{" << endl; + } } -void LatexGenerator::writeLatexLabel(const char *clName,const char *anchor) +void LatexGenerator::endDoxyAnchor() { - writeDoxyAnchor(clName,anchor,0); + if (Config::pdfHyperFlag) + { + t << "}" << endl; + } } + +//void LatexGenerator::writeLatexLabel(const char *clName,const char *anchor) +//{ +// writeDoxyAnchor(0,clName,anchor,0); +//} + void LatexGenerator::addToIndex(const char *s1,const char *s2) { if (s1) @@ -748,7 +859,7 @@ void LatexGenerator::writeSectionRefItem(const char *,const char *lab, { t << "\\contentsline{section}{"; docify(title); - t << "}{\\ref{" << lab << "}}" << endl; + t << "}{\\ref{" << lab << "}}{}" << endl; } void LatexGenerator::writeSectionRefAnchor(const char *,const char *lab, @@ -793,8 +904,16 @@ void LatexGenerator::docify(const char *str) case '>': t << "$>$"; break; case '|': t << "$|$"; break; case '~': t << "$\\sim$"; break; + case '[': if (Config::pdfHyperFlag) + t << "\\mbox{[}"; + else + t << "["; + break; case ']': if (pc=='[') t << "$\\,$"; - t << "]"; + if (Config::pdfHyperFlag) + t << "\\mbox{]}"; + else + t << "]"; break; case '-': if (*p=='>') { t << " $\\rightarrow$ "; p++; } @@ -966,6 +1085,7 @@ void LatexGenerator::startMemberItem(bool,int annType) default: t << "\\begin{tabbing}" << endl; t << "xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=xx\\=\\kill" << endl; + //printf("LatexGenerator::startMemberItem() insideTabbing=TRUE\n"); insideTabbing=TRUE; break; } @@ -974,9 +1094,10 @@ void LatexGenerator::startMemberItem(bool,int annType) void LatexGenerator::endMemberItem(bool,const char *,const char *,bool endItem) { - if (endItem) + if (insideTabbing && endItem) { t << endl << "\\end{tabbing}"; + //printf("LatexGenerator::endMemberItem() insideTabbing=FALSE\n"); insideTabbing=FALSE; } if (insideTabbing) @@ -1006,3 +1127,12 @@ void LatexGenerator::endMemberList() t << "\\end{CompactItemize}" << endl; } +void LatexGenerator::writeImage(const char *name,const char *w,const char *h) +{ + t << "\\mbox{\\epsfig{file=" << name; + if (w) + t << "," << w; + else if (h) + t << "," << h; + t << "}}" << endl; +} diff --git a/src/latexgen.h b/src/latexgen.h index 06f8ea8..e736491 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -27,7 +27,7 @@ class LatexGenerator : public OutputGenerator LatexGenerator(); ~LatexGenerator(); - OutputGenerator *copy() { return new LatexGenerator; } + OutputGenerator *copy(); //OutputGenerator *clone() { return new LatexGenerator(*this); } void append(const OutputGenerator *o); void enable() { active=TRUE; } @@ -50,9 +50,9 @@ class LatexGenerator : public OutputGenerator void startProjectNumber(); void endProjectNumber() {} void writeStyleInfo(int part); - void startTitleHead() { startTitle(); } + void startTitleHead(const char *); void startTitle(); - void endTitleHead(const char *name); + void endTitleHead(const char *,const char *name); void endTitle() { t << "}"; } void newParagraph(); @@ -63,8 +63,8 @@ class LatexGenerator : public OutputGenerator void endItemList() { t << "\\end{CompactItemize}" << endl; } void startEnumList() { t << "\\begin{enumerate}" << endl; } void endEnumList() { t << "\\end{enumerate}" << endl; } - void startAlfabeticalIndexList() {} - void endAlfabeticalIndexList() {} + void startAlphabeticalIndexList() {} + void endAlphabeticalIndexList() {} void writeIndexHeading(const char *) {} void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); @@ -96,7 +96,7 @@ class LatexGenerator : public OutputGenerator void memberGroupSeparator() {} void insertMemberAlign() {} - void writeRuler() { t << "\\vspace{0.4cm}\\hrule\\vspace{0.2cm}"; } + void writeRuler() { t << "\\vspace{0.4cm}\\hrule\\vspace{0.2cm}" << endl; } void writeAnchor(const char *name) { t << "\\label{" << name << "}" << endl; } void startCodeFragment() { t << "\\small\\begin{verbatim}"; } void endCodeFragment() { t << "\\end{verbatim}\\normalsize " << endl; } @@ -111,12 +111,13 @@ class LatexGenerator : public OutputGenerator void startDescItem() { t << "\\item["; } void endDescItem() { t << "]" << endl; } void lineBreak() { t << "\\par\n"; } - void startMemberDoc(const char *,const char *,const char *); + void startMemberDoc(const char *,const char *,const char *,const char *); void endMemberDoc() { t << "}"; } - void writeDoxyAnchor(const char *,const char *,const char *); + void startDoxyAnchor(const char *,const char *,const char *,const char *); + void endDoxyAnchor(); void writeChar(char c); void writeLatexSpacing() { t << "\\hspace{0.3cm}"; } - void writeLatexLabel(const char *scope,const char *anchor); + //void writeLatexLabel(const char *scope,const char *anchor); void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); void writeEndAnnoItem(const char *name); @@ -157,10 +158,10 @@ class LatexGenerator : public OutputGenerator void writeTilde(char c) { t << "\\~{" << c << "}"; } void startMemberDescription() { t << "\\begin{CompactList}\\small\\item\\em "; } void endMemberDescription() { t << "\\item\\end{CompactList}"; } - void startDescList() { t << "\\begin{Desc}\\item["; } + void startDescList() { t << "\\begin{Desc}\n\\item["; } void endDescTitle() { t << "]"; } void writeDescItem() { t << "\\par" << endl; } - void endDescList() { t << "\\end{Desc}"; } + void endDescList() { t << "\\end{Desc}" << endl; } void writeSection(const char *,const char *,bool); void writeSectionRef(const char *,const char *,const char *); void writeSectionRefItem(const char *,const char *,const char *); @@ -174,11 +175,13 @@ class LatexGenerator : public OutputGenerator void endClassDiagram(ClassDiagram &,const char *,const char *); void startColorFont(uchar,uchar,uchar) {} void endColorFont() {} - void writePageRef(const char *,const char *); + void startPageRef(); + void endPageRef(const char *,const char *); void startQuickIndexItem(const char *,const char *) {} void endQuickIndexItem() {} void writeFormula(const char *,const char *); void writeNonBreakableSpace(); + void writeImage(const char *,const char *,const char *); //static void docifyStatic(QTextStream &t,const char *str); diff --git a/src/mangen.cpp b/src/mangen.cpp index 963460b..ec2b8ce 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -92,11 +92,7 @@ void ManGenerator::endFile() endPlainFile(); } -void ManGenerator::writeDoxyAnchor(const char *, const char *,const char *) -{ -} - -void ManGenerator::endTitleHead(const char *name) +void ManGenerator::endTitleHead(const char *,const char *name) { t << ".TH " << name << " 3 \"" << dateToString(FALSE) << "\" \""; if (Config::projectName.isEmpty()) @@ -284,7 +280,7 @@ void ManGenerator::endCodeFragment() col=0; } -void ManGenerator::startMemberDoc(const char *,const char *,const char *) +void ManGenerator::startMemberDoc(const char *,const char *,const char *,const char *) { if (!firstCol) t << endl; t << ".SS "; diff --git a/src/mangen.h b/src/mangen.h index 0df3268..ad512e4 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -50,8 +50,8 @@ class ManGenerator : public OutputGenerator void startProjectNumber() {} void endProjectNumber() {} void writeStyleInfo(int) {} - void startTitleHead() {} - void endTitleHead(const char *); + void startTitleHead(const char *) {} + void endTitleHead(const char *,const char *); void startTitle(); void endTitle() {} @@ -63,8 +63,8 @@ class ManGenerator : public OutputGenerator void endItemList() {} void startEnumList() {} void endEnumList() {} - void startAlfabeticalIndexList() {} - void endAlfabeticalIndexList() {} + void startAlphabeticalIndexList() {} + void endAlphabeticalIndexList() {} void writeIndexHeading(const char *) {} void writeIndexItem(const char *ref,const char *file,const char *name); void docify(const char *text); @@ -110,11 +110,13 @@ class ManGenerator : public OutputGenerator void endDescItem(); void lineBreak() { t << "\n.br" << endl; } void writeChar(char c); - void startMemberDoc(const char *,const char *,const char *); + void startMemberDoc(const char *,const char *,const char *,const char *); void endMemberDoc() {} - void writeDoxyAnchor(const char *clName,const char *anchor,const char *name); + void startDoxyAnchor(const char *,const char *, + const char *,const char *) {} + void endDoxyAnchor() {} void writeLatexSpacing() {} - void writeLatexLabel(const char *,const char *) {} + //void writeLatexLabel(const char *,const char *) {} void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name); void writeEndAnnoItem(const char *) { t << endl; firstCol=TRUE; } @@ -162,11 +164,13 @@ class ManGenerator : public OutputGenerator void endClassDiagram(ClassDiagram &,const char *,const char *) {} void startColorFont(uchar,uchar,uchar) {} void endColorFont() {} - void writePageRef(const char *,const char *) {} + void startPageRef() {} + void endPageRef(const char *,const char *) {} void startQuickIndexItem(const char *,const char *) {} void endQuickIndexItem() {} void writeFormula(const char *,const char *) {} void writeNonBreakableSpace() { t << " "; } + void writeImage(const char *,const char *,const char *) {} private: bool firstCol; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 34061f0..ec70870 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -235,8 +235,10 @@ MemberDef::MemberDef(const char *t,const char *na,const char *a,const char *e, eUsed=FALSE; proto=FALSE; annScope=FALSE; + inLine=FALSE; annMemb=0; annUsed=FALSE; + annShown=FALSE; indDepth=0; docEnumValues=FALSE; // copy function template arguments (if any) @@ -500,27 +502,47 @@ void MemberDef::writeDeclaration(OutputList &ol,ClassDef *cd,NamespaceDef *nd,Fi // search for the last annonymous scope in the member type ClassDef *annoClassDef=0; - while (i!=-1 && cname.find(type.mid(i,l))!=-1) - { - i=r.match(type,i+l,&l); - } - if (i!=-1) + //while (i!=-1 && cname.find(type.mid(i,l))!=-1) + //{ + // i=r.match(type,i+l,&l); + //} + int il=i-1,ir=i+l; + if (i!=-1) // found annonymous scope in type { - // get the definition of the annonymous class that is - // the type of this member - annoClassDef=getClass(cname+"::"+type.mid(i,l)); + // extract annonymous scope + while (il>=0 && (isId(type.at(il)) || type.at(il)==':' || type.at(il)=='@')) il--; + if (il>0) il++; + while (ir<(int)type.length() && (isId(type.at(ir)) || type.at(ir)==':' || type.at(ir)=='@')) ir++; + + //QCString annName = type.mid(i,l); + QCString annName = type.mid(il,ir-il); + + // if inside a class or namespace try to prepend the scope name + if ((cd || nd) && annName.left(cname.length())!=cname) + { + QCString ts=stripAnnonymousNamespaceScope(cname+"::"+annName); + //printf("Member::writeDeclaration: Trying %s\n",ts.data()); + annoClassDef=getClass(ts); + } + // if not found yet, try without scope name + if (annoClassDef==0) + { + QCString ts=stripAnnonymousNamespaceScope(annName); + //printf("Member::writeDeclaration: Trying %s\n",ts.data()); + annoClassDef=getClass(ts); + } } // start a new member declaration - ol.startMemberItem(gId!=-1,((i!=-1) || annMemb) ? 1 : 0); - + ol.startMemberItem(gId!=-1,(annoClassDef || annMemb) ? 1 : 0); + // If there is no detailed description we need to write the anchor here. bool detailsVisible = detailsAreVisible(); if (!detailsVisible && !Config::extractAllFlag && !annMemb) { QCString doxyName=name().copy(); if (!cname.isEmpty()) doxyName.prepend(cname+"::"); - ol.writeDoxyAnchor(cname,anchor(),doxyName); + ol.startDoxyAnchor(cfname,cname,anchor(),doxyName); ol.addToIndex(name(),cname); ol.addToIndex(cname,name()); if (hasHtmlHelp) @@ -538,12 +560,8 @@ void MemberDef::writeDeclaration(OutputList &ol,ClassDef *cd,NamespaceDef *nd,Fi // ol.writeLatexLabel(cname,anchor()); //} - if (tArgList) - { - writeTemplatePrefix(ol,tArgList,FALSE); - } - - if (i!=-1 || annMemb) + //printf("member name=%s indDepth=%d\n",name().data(),indDepth); + if (annoClassDef || annMemb) { int j; for (j=0;j<indDepth;j++) @@ -552,6 +570,11 @@ void MemberDef::writeDeclaration(OutputList &ol,ClassDef *cd,NamespaceDef *nd,Fi } } + if (tArgList) + { + writeTemplatePrefix(ol,tArgList,FALSE); + } + if (i!=-1) { //printf("scopeName=`%s' annonymous=`%s'\n", @@ -560,15 +583,23 @@ void MemberDef::writeDeclaration(OutputList &ol,ClassDef *cd,NamespaceDef *nd,Fi if (annoClassDef) { //printf("class found!\n"); - annoClassDef->writeDeclaration(ol); + annoClassDef->writeDeclaration(ol,annMemb); ol.startMemberItem(gId!=-1,2); int j; for (j=0;j<indDepth;j++) { ol.writeNonBreakableSpace(); } + QCString varName=type.right(type.length()-ir).stripWhiteSpace(); ol.docify("}"); - ol.docify(type.right(type.length()-i-l).stripWhiteSpace()); + if (varName.isEmpty() && (name().isEmpty() || name().at(0)=='@')) + { + ol.docify(";"); + } + else + { + ol.docify(varName); + } } else { @@ -605,35 +636,43 @@ void MemberDef::writeDeclaration(OutputList &ol,ClassDef *cd,NamespaceDef *nd,Fi ol.insertMemberAlign(); // write name - if (grpId!=-1) + if (!name().isEmpty() && name().at(0)!='@') { - if (annMemb) + if (grpId!=-1) { - //printf("anchor=%s ann_anchor=%s\n",anchor(),annMemb->anchor()); - annMemb->writeLink(ol,cd,nd,fd,inGroup ? memberGroup : 0); - annMemb->annUsed=annUsed=TRUE; + if (annMemb) + { + //printf("anchor=%s ann_anchor=%s\n",anchor(),annMemb->anchor()); + annMemb->writeLink(ol,cd,nd,fd,inGroup ? memberGroup : 0); + annMemb->annUsed=annUsed=TRUE; + } + else + writeLink(ol,0,0,0,memberGroup); + //ol.writeBoldString(name()); } - else - writeLink(ol,0,0,0,memberGroup); - //ol.writeBoldString(name()); - } - else if (isLinkable()) - { - if (annMemb) + else if (isLinkable()) { - //printf("anchor=%s ann_anchor=%s\n",anchor(),annMemb->anchor()); - annMemb->writeLink(ol,annMemb->memberClass(),nd,fd,inGroup ? memberGroup : 0); - annMemb->annUsed=annUsed=TRUE; + if (annMemb) + { + //printf("anchor=%s ann_anchor=%s\n",anchor(),annMemb->anchor()); + annMemb->writeLink(ol, + annMemb->memberClass(), + annMemb->getNamespace(), + annMemb->getFileDef(), + inGroup ? memberGroup : 0 + ); + annMemb->annUsed=annUsed=TRUE; + } + else + //printf("writeLink %s->%d\n",name.data(),hasDocumentation()); + writeLink(ol,cd,nd,fd,inGroup ? memberGroup : 0); + } + else // there is a brief member description and brief member + // descriptions are enabled or there is no detailed description. + { + if (annMemb) annMemb->annUsed=annUsed=TRUE; + ol.writeBoldString(name()); } - else - //printf("writeLink %s->%d\n",name.data(),hasDocumentation()); - writeLink(ol,cd,nd,fd,inGroup ? memberGroup : 0); - } - else // there is a brief member description and brief member - // descriptions are enabled or there is no detailed description. - { - if (annMemb) annMemb->annUsed=annUsed=TRUE; - ol.writeBoldString(name()); } // if member template specifiers are not part of the name, but they are @@ -657,8 +696,14 @@ void MemberDef::writeDeclaration(OutputList &ol,ClassDef *cd,NamespaceDef *nd,Fi ol.docify(excpString()); } - ol.endMemberItem(gId!=-1,gFile,gHeader,annoClassDef!=0 && indDepth==0); + if (!detailsVisible && !Config::extractAllFlag && !annMemb) + { + ol.endDoxyAnchor(); + } + ol.endMemberItem(gId!=-1,gFile,gHeader,annoClassDef!=0 && indDepth==0); + + //ol.endMemberItem(gId!=-1,gFile,gHeader,annoClassDef || annMemb); // write brief description if (!briefDescription().isEmpty() && Config::briefMemDescFlag && gId==-1 && !inGroup && !annMemb) @@ -743,27 +788,28 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco { if (vmd->isEnumerate() && def.mid(i,l)==vmd->name()) { - ol.startMemberDoc(cname,name(),anchor()); + ol.startDoxyAnchor(cfname,cname,anchor(),doxyName); + ol.startMemberDoc(cname,name(),anchor(),name()); if (hasHtmlHelp) { htmlHelp->addIndexItem(cname,name(),cfname,anchor()); } - ol.writeDoxyAnchor(cname,anchor(),doxyName); linkifyText(ol,scopeName,name(),def.left(i)); ol+=*vmd->enumDecl(); linkifyText(ol,scopeName,name(),def.right(def.length()-i-l)); + //ol.endDoxyAnchor(); found=TRUE; } } if (!found) // anonymous compound { //printf("Annonymous compound `%s'\n",cname.data()); - ol.startMemberDoc(cname,name(),anchor()); + ol.startDoxyAnchor(cfname,cname,anchor(),doxyName); + ol.startMemberDoc(cname,name(),anchor(),name()); if (hasHtmlHelp) { htmlHelp->addIndexItem(cname,name(),cfname,anchor()); } - ol.writeDoxyAnchor(cname,anchor(),doxyName); // strip annonymous compound names from definition int si=def.find(' '),pi,ei=i+l; if (si==-1) si=0; @@ -772,17 +818,19 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco ol.docify(def.left(si)); ol.docify(" { ... } "); // last ei characters of def contain pointer/reference specifiers + int ni=def.findRev("::"); + if (ni>=ei) ei=ni+2; linkifyText(ol,scopeName,name(),def.right(def.length()-ei)); } } else { - ol.startMemberDoc(cname,name(),anchor()); + ol.startDoxyAnchor(cfname,cname,anchor(),doxyName); + ol.startMemberDoc(cname,name(),anchor(),name()); if (hasHtmlHelp) { htmlHelp->addIndexItem(cname,name(),cfname,anchor()); } - ol.writeDoxyAnchor(cname,anchor(),doxyName); ArgumentList *scopeAl=scopeDefTemplateArguments(); if (scopeAl==0 && cd) scopeAl=cd->templateArguments(); @@ -840,7 +888,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco if (isStatic() || protection()!=Public || virt!=Normal || isSignal() || isFriend() || - isRelated() || isSlot() + isRelated() || isSlot() || + (isInline() && Config::inlineInfoFlag) ) { // write the member specifier list @@ -852,6 +901,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco else if (isRelated()) sl.append("related"); else { + if (Config::inlineInfoFlag && isInline()) + sl.append("inline"); if (isStatic()) sl.append("static"); if (protection()==Protected) sl.append("protected"); else if (protection()==Private) sl.append("private"); @@ -871,6 +922,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco ol.endTypewriter(); } ol.endMemberDoc(); + ol.endDoxyAnchor(); ol.startIndent(); ol.newParagraph(); @@ -915,7 +967,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco ol.endBold(); ol.startItemList(); } - ol.writeDoxyAnchor(cname,fmd->anchor(),fmd->name()); ol.addToIndex(fmd->name(),cname); ol.addToIndex(cname,fmd->name()); if (Config::generateHtml && Config::htmlHelpFlag) @@ -923,10 +974,12 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco HtmlHelp::getInstance()->addIndexItem(cname,fmd->name(),cfname,fmd->anchor()); } ol.writeListItem(); + ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name()); first=FALSE; ol.startBold(); ol.docify(fmd->name()); ol.endBold(); + ol.endDoxyAnchor(); ol.newParagraph(); if (!fmd->briefDescription().isEmpty()) @@ -979,18 +1032,18 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco { ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), bmd->anchor(),bcd->name()); - if ( bcd->isLinkableInProject()) + if ( bcd->isLinkableInProject() && !Config::pdfHyperFlag ) { - ol.writePageRef(bcd->name(),bmd->anchor()); + writePageRef(ol,bcd->name(),bmd->anchor()); } } else { ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), 0,bcd->name()); - if (bcd->isLinkableInProject()) + if (bcd->isLinkableInProject() && !Config::pdfHyperFlag ) { - ol.writePageRef(bcd->name(),0); + writePageRef(ol,bcd->name(),0); } } parseText(ol,reimplFromLine.right( @@ -1041,7 +1094,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco count=0; // find the entryIndex-th documented entry in the inheritance list. - for (mli.toFirst();(bmd=mli.current()) && (bcd=bmd->memberClass());++mli) + for (mli.toLast();(bmd=mli.current()) && (bcd=bmd->memberClass());--mli) { if ( bmd->isLinkable() && bcd->isLinkable()) { @@ -1058,9 +1111,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,const char *sco //{ ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(), bmd->anchor(),bcd->name()); - if (bcd->isLinkableInProject()) + if (bcd->isLinkableInProject() && !Config::pdfHyperFlag ) { - ol.writePageRef(bcd->name(),bmd->anchor()); + writePageRef(ol,bcd->name(),bmd->anchor()); } //} //else diff --git a/src/memberdef.h b/src/memberdef.h index 68d9ad8..8570f1f 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -84,12 +84,14 @@ class MemberDef : public Definition void setFileDec(FileDef *fd) { fileDec=fd; } void setAnchor(const char *a) { anc=a; } void setProtection(Protection p) { prot=p; } - void setBody(const QCString &b) { body=b; } + void setBody(const QCString &b) { body=b; } + void setInline(bool in) { inLine=in; } FileDef *getFileDef() { return fileDef; } FileDef *getFileDec() { return fileDec; } void setMemberClass(ClassDef *cd) { classDef=cd; } bool isRelated() const { return related; } bool isStatic() const { return stat; } + bool isInline() const { return inLine; } bool hasDocumentation() // overrides hasDocumentation in definition.h { return Definition::hasDocumentation() || !body.isEmpty(); } @@ -212,12 +214,14 @@ class MemberDef : public Definition Protection prot; // protection type [Public/Protected/Private] bool related; // is this a member that is only related to a class bool stat; // is it a static function? + bool inLine; // is it an inline function? MemberType mtype; // returns the kind of member bool eUsed; // is the enumerate already placed in a list bool proto; // is it a prototype; bool docEnumValues; // is an enum with documented enum values. bool annScope; bool annUsed; + bool annShown; int indDepth; MemberDef *annMemb; ArgumentList *argList; // argument list of this member diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 883bfe2..2ed41fb 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -62,9 +62,9 @@ void MemberGroup::writeDocumentation(OutputList &ol) } ol.disable(OutputGenerator::Man); startFile(ol,fileName,title); - startTitle(ol); + startTitle(ol,getOutputFileBase()); ol.docify(title); - endTitle(ol,name()); + endTitle(ol,getOutputFileBase(),name()); OutputList briefOutput(&ol); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 4f6bad9..bdca206 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -256,11 +256,11 @@ void MemberList::writePlainDeclarations(OutputList &ol,ClassDef *cd, // ) // ) // ) - if (md->hasDocumentation() || md->hasDocumentedEnumValues()) + if (md->isLinkableInProject() || md->hasDocumentedEnumValues()) { if (Config::genTagFile.length()>0) tagFile << md->name() << " " << md->anchor() - << " \"" << md->argsString() << "\""; + << " \"\"" << endl; md->writeLink(typeDecl,cd,nd,fd,0); } else diff --git a/src/membername.h b/src/membername.h index a9454f9..5d5d55b 100644 --- a/src/membername.h +++ b/src/membername.h @@ -86,6 +86,7 @@ class MemberNameInfoIterator : public QListIterator<MemberInfo> class MemberNameInfoList : public QList<MemberNameInfo> { public: + ~MemberNameInfoList() {} int compareItems(GCI item1,GCI item2) { return stricmp( ((MemberNameInfo *)item1)->memberName(), @@ -98,6 +99,7 @@ class MemberNameInfoDict : public QDict<MemberNameInfo> { public: MemberNameInfoDict(int size) : QDict<MemberNameInfo>(size) {} + ~MemberNameInfoDict() {} }; class MemberNameInfoListIterator : public QListIterator<MemberNameInfo> diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index d8388a0..19ed1c4 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -63,10 +63,10 @@ void NamespaceDef::writeDocumentation(OutputList &ol) { QCString pageTitle=name()+" Namespace Reference"; startFile(ol,fileName,pageTitle); - startTitle(ol); + startTitle(ol,getOutputFileBase()); //ol.docify(pageTitle); parseText(ol,theTranslator->trNamespaceReference(name())); - endTitle(ol,name()); + endTitle(ol,getOutputFileBase(),name()); if (Config::genTagFile.length()>0) tagFile << "%" << name() << ":\n"; @@ -94,7 +94,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) bool found=FALSE; while (cd) { - if (cd->isLinkable()) + if (cd->name().find('@')==-1) { if (!found) { @@ -120,7 +120,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) } ol.writeString(" "); ol.insertMemberAlign(); - if (cd->hasDocumentation()) + if (cd->isLinkable()) { ol.writeObjectLink(cd->getReference(), cd->getOutputFileBase(), diff --git a/src/namespacedef.h b/src/namespacedef.h index e68fa3f..b34c65b 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -76,6 +76,7 @@ class NamespaceDef : public Definition class NamespaceList : public QList<NamespaceDef> { public: + ~NamespaceList() {} int compareItems(GCI item1,GCI item2) { return strcmp(((NamespaceDef *)item1)->name(), @@ -95,6 +96,7 @@ class NamespaceDict : public QDict<NamespaceDef> { public: NamespaceDict(int size) : QDict<NamespaceDef>(size) {} + ~NamespaceDict() {} }; #endif diff --git a/src/outputgen.h b/src/outputgen.h index 778705c..8ff6a92 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -53,8 +53,8 @@ class OutputGenerator virtual void startProjectNumber() = 0; virtual void endProjectNumber() = 0; virtual void writeStyleInfo(int part) = 0; - virtual void startTitleHead() = 0; - virtual void endTitleHead(const char *name) = 0; + virtual void startTitleHead(const char *) = 0; + virtual void endTitleHead(const char *fileName,const char *name) = 0; virtual void startTitle() = 0; virtual void endTitle() = 0; virtual void newParagraph() = 0; @@ -67,8 +67,8 @@ class OutputGenerator virtual void endEnumList() = 0; virtual void startBold() = 0; virtual void endBold() = 0; - virtual void startAlfabeticalIndexList() = 0; - virtual void endAlfabeticalIndexList() = 0; + virtual void startAlphabeticalIndexList() = 0; + virtual void endAlphabeticalIndexList() = 0; virtual void writeIndexHeading(const char *s) = 0; virtual void writeIndexItem(const char *ref,const char *file, const char *text) = 0; @@ -109,11 +109,14 @@ class OutputGenerator virtual void startEmphasis() = 0; virtual void endEmphasis() = 0; virtual void writeChar(char c) = 0; - virtual void startMemberDoc(const char *,const char *,const char *) = 0; + virtual void startMemberDoc(const char *,const char *, + const char *,const char *) = 0; virtual void endMemberDoc() = 0; - virtual void writeDoxyAnchor(const char *clName,const char *anchor,const char *name) = 0; + virtual void startDoxyAnchor(const char *fileName,const char *clName, + const char *anchor,const char *name) = 0; + virtual void endDoxyAnchor() = 0; virtual void writeLatexSpacing() = 0; - virtual void writeLatexLabel(const char *clName,const char *anchor) = 0; + //virtual void writeLatexLabel(const char *clName,const char *anchor) = 0; virtual void writeStartAnnoItem(const char *type,const char *file, const char *path,const char *name) = 0; virtual void writeEndAnnoItem(const char *name) = 0; @@ -166,11 +169,13 @@ class OutputGenerator virtual void endClassDiagram(ClassDiagram &,const char *,const char *) = 0; virtual void startColorFont(uchar r,uchar g,uchar b) = 0; virtual void endColorFont() = 0; - virtual void writePageRef(const char *,const char *) = 0; + virtual void startPageRef() = 0; + virtual void endPageRef(const char *,const char *) = 0; virtual void startQuickIndexItem(const char *s,const char *l) = 0; virtual void endQuickIndexItem() = 0; virtual void writeFormula(const char *,const char *) = 0; virtual void writeNonBreakableSpace() = 0; + virtual void writeImage(const char *,const char *,const char *) = 0; void clear() { b.close(); a.resize(0); b.setBuffer(a); b.open(IO_WriteOnly); t.setDevice(&b); } diff --git a/src/outputlist.cpp b/src/outputlist.cpp index ae86c89..47354eb 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -226,12 +226,14 @@ void OutputList::forall(void (OutputGenerator::*func)(a1,a2,a3,a4),a1,a2,a3,a4) FORALL1(const char *a1,a1) FORALL1(char a1,a1) FORALL1(int a1,a1) +#if defined(HAS_BOOL_TYPE) FORALL1(bool a1,a1) -FORALL1(IndexSections a1,a1) -FORALL2(const char *a1,const char *a2,a1,a2) -FORALL2(int a1,bool a2,a1,a2) FORALL2(bool a1,int a2,a1,a2) FORALL2(bool a1,bool a2,a1,a2) +#endif +FORALL2(int a1,bool a2,a1,a2) +FORALL1(IndexSections a1,a1) +FORALL2(const char *a1,const char *a2,a1,a2) FORALL3(ClassDiagram &a1,const char *a2,const char *a3,a1,a2,a3) FORALL3(const char *a1,const char *a2,const char *a3,a1,a2,a3) FORALL3(const char *a1,const char *a2,bool a3,a1,a2,a3) diff --git a/src/outputlist.h b/src/outputlist.h index 79ee93f..8e57ed6 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -72,10 +72,10 @@ class OutputList { forall(&OutputGenerator::endFile); } void endPlainFile() { forall(&OutputGenerator::endPlainFile); } - void startTitleHead() - { forall(&OutputGenerator::startTitleHead); } - void endTitleHead(const char *name) - { forall(&OutputGenerator::endTitleHead,name); } + void startTitleHead(const char *fileName) + { forall(&OutputGenerator::startTitleHead,fileName); } + void endTitleHead(const char *fileName,const char *name) + { forall(&OutputGenerator::endTitleHead,fileName,name); } void startTitle() { forall(&OutputGenerator::startTitle); } void endTitle() @@ -96,10 +96,10 @@ class OutputList { forall(&OutputGenerator::startEnumList); } void endEnumList() { forall(&OutputGenerator::endEnumList); } - void startAlfabeticalIndexList() - { forall(&OutputGenerator::startAlfabeticalIndexList); } - void endAlfabeticalIndexList() - { forall(&OutputGenerator::endAlfabeticalIndexList); } + void startAlphabeticalIndexList() + { forall(&OutputGenerator::startAlphabeticalIndexList); } + void endAlphabeticalIndexList() + { forall(&OutputGenerator::endAlphabeticalIndexList); } void writeIndexHeading(const char *s) { forall(&OutputGenerator::writeIndexHeading,s); } void writeIndexItem(const char *ref,const char *file,const char *text) @@ -177,16 +177,20 @@ class OutputList { forall(&OutputGenerator::endEmphasis); } void writeChar(char c) { forall(&OutputGenerator::writeChar,c); } - void startMemberDoc(const char *clName,const char *memName,const char *anchor) - { forall(&OutputGenerator::startMemberDoc,clName,memName,anchor); } + void startMemberDoc(const char *clName,const char *memName, + const char *anchor,const char *title) + { forall(&OutputGenerator::startMemberDoc,clName,memName,anchor,title); } void endMemberDoc() { forall(&OutputGenerator::endMemberDoc); } - void writeDoxyAnchor(const char *clName,const char *anchor,const char *name) - { forall(&OutputGenerator::writeDoxyAnchor,clName,anchor,name); } + void startDoxyAnchor(const char *fn, const char *cn, + const char *anchor,const char *name) + { forall(&OutputGenerator::startDoxyAnchor,fn,cn,anchor,name); } + void endDoxyAnchor() + { forall(&OutputGenerator::endDoxyAnchor); } void writeLatexSpacing() { forall(&OutputGenerator::writeLatexSpacing); } - void writeLatexLabel(const char *scope,const char *anchor) - { forall(&OutputGenerator::writeLatexLabel,scope,anchor); } + //void writeLatexLabel(const char *scope,const char *anchor) + //{ forall(&OutputGenerator::writeLatexLabel,scope,anchor); } void startDescription() { forall(&OutputGenerator::startDescription); } void endDescription() @@ -289,8 +293,10 @@ class OutputList { forall(&OutputGenerator::startColorFont,r,g,b); } void endColorFont() { forall(&OutputGenerator::endColorFont); } - void writePageRef(const char *c,const char *a) - { forall(&OutputGenerator::writePageRef,c,a); } + void startPageRef() + { forall(&OutputGenerator::startPageRef); } + void endPageRef(const char *c,const char *a) + { forall(&OutputGenerator::endPageRef,c,a); } void startQuickIndexItem(const char *s,const char *l) { forall(&OutputGenerator::startQuickIndexItem,s,l); } void endQuickIndexItem() @@ -299,6 +305,8 @@ class OutputList { forall(&OutputGenerator::writeFormula,n,t); } void writeNonBreakableSpace() { forall(&OutputGenerator::writeNonBreakableSpace); } + void writeImage(const char *n,const char *w,const char *h) + { forall(&OutputGenerator::writeImage,n,w,h); } private: void debug(); @@ -307,13 +315,15 @@ class OutputList void forall(void (OutputGenerator::*func)()); FORALLPROTO1(const char *); FORALLPROTO1(char); + FORALLPROTO1(IndexSections); FORALLPROTO1(int); +#if defined(HAS_BOOL_TYPE) FORALLPROTO1(bool); - FORALLPROTO1(IndexSections); - FORALLPROTO2(const char *,const char *); - FORALLPROTO2(int,bool); FORALLPROTO2(bool,int); FORALLPROTO2(bool,bool); +#endif + FORALLPROTO2(int,bool); + FORALLPROTO2(const char *,const char *); FORALLPROTO3(const char *,const char *,bool); FORALLPROTO3(uchar,uchar,uchar); FORALLPROTO3(const char *,const char *,const char *); @@ -1155,7 +1155,7 @@ BN [ \t\r\n] ifcount++; //printf("#if... depth=%d\n",ifcount); } -<SkipCommand>"else"/[^a-z_A-Z0-9] { +<SkipCommand>"else" { //printf("Else! ifcount=%d otherCaseDone=%d\n",ifcount,otherCaseDone()); if (ifcount==0 && !otherCaseDone()) { @@ -1179,7 +1179,7 @@ BN [ \t\r\n] } } } -<SkipCommand>"endif"/[^a-z_A-Z0-9] { +<SkipCommand>"endif" { decrLevel(); if (--ifcount<0) { diff --git a/src/scanner.l b/src/scanner.l index c3c4ade..602dcc8 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -115,6 +115,7 @@ static int includeFileLength = 0; static bool firstLine; static bool isTypedef; static bool inParamBlock; +static bool inRetValBlock; static bool inExceptionBlock; static bool inSeeBlock; static bool inReturnBlock; @@ -149,6 +150,7 @@ static QCString *copyArgString; static ArgumentList *currentArgumentList; static QCString *currentTemplateSpec; +static QCString curImageName; //----------------------------------------------------------------------------- @@ -186,6 +188,7 @@ static void initParser() firstLine = TRUE; isTypedef = FALSE; inParamBlock = FALSE; + inRetValBlock = FALSE; inExceptionBlock = FALSE; inSeeBlock = FALSE; inReturnBlock = FALSE; @@ -534,7 +537,7 @@ static void newDocState(); static bool inBlock() { - return inParamBlock || inSeeBlock || inReturnBlock || inAuthorBlock || + return inParamBlock || inRetValBlock || inSeeBlock || inReturnBlock || inAuthorBlock || inVersionBlock || inDateBlock || inWarningBlock || inBugBlock || inParBlock || inExceptionBlock; } @@ -542,7 +545,7 @@ static bool inBlock() static void endBlock() { outDoc->endDescList(); - inParamBlock=inSeeBlock=inReturnBlock=inAuthorBlock= + inParamBlock=inRetValBlock=inSeeBlock=inReturnBlock=inAuthorBlock= inVersionBlock=inDateBlock=inBugBlock=inWarningBlock= inParBlock=inExceptionBlock=FALSE; } @@ -692,6 +695,7 @@ VAR [vV][aA][rR] %x ClassName %x ClassVar %x Bases +%x BasesProt %x NextSemi %x FindMembers %x FindMemberName @@ -803,6 +807,10 @@ VAR [vV][aA][rR] %x DocRefArgStart %x DocRefItem %x DocRefItemName +%x DocImage +%x DocHtmlImageName +%x DocLatexImageName +%x DocLatexImageWidth %x SectionLabel %x SectionTitle %x SkipTemplate @@ -1031,7 +1039,7 @@ VAR [vV][aA][rR] outDoc->writeDescItem(); } } -<DocScan>("\\"|"@")"bug"{BN}+ { +<DocScan>("\\"|"@")"bug"[s]?{BN}+ { endArgumentList(); if (!inBugBlock) { @@ -1107,7 +1115,7 @@ VAR [vV][aA][rR] outDoc->docify(", "); } } -<DocScan>("\\"|"@")"return"{BN}+ { +<DocScan>("\\"|"@")("return"([s])?|"result"){BN}+ { endArgumentList(); if (!inReturnBlock) { @@ -1150,7 +1158,6 @@ VAR [vV][aA][rR] if (inBlock()) endBlock(); inParamBlock=TRUE; outDoc->startDescList(); - //outDoc->writeBoldString("Parameters: "); outDoc->startBold(); scanString(theTranslator->trParameters()+": "); outDoc->endBold(); @@ -1158,6 +1165,20 @@ VAR [vV][aA][rR] } BEGIN(DocParam); } +<DocScan>("\\"|"@")"retval"{BN}+ { + endArgumentList(); + if (!inRetValBlock) + { + if (inBlock()) endBlock(); + inRetValBlock=TRUE; + outDoc->startDescList(); + outDoc->startBold(); + scanString(theTranslator->trReturnValues()+": "); + outDoc->endBold(); + outDoc->endDescTitle(); + } + BEGIN(DocParam); + } <DocScan>("\\"|"@")"exception"{BN}+ { endArgumentList(); if (!inExceptionBlock) @@ -1174,7 +1195,7 @@ VAR [vV][aA][rR] BEGIN(DocException); } <DocScan>"\\capt".* -<DocParam>{SCOPENAME} { +<DocParam>[a-z_A-Z0-9:]+ { outDoc->writeDescItem(); outDoc->startEmphasis(); outDoc->docify(yytext); @@ -1290,6 +1311,52 @@ VAR [vV][aA][rR] } BEGIN(DocScan); } +<DocScan>("\\"|"@")"image"{B}+ { + BEGIN(DocImage); + } +<DocImage>[hH][tT][mM][lL] { + BEGIN(DocHtmlImageName); + } +<DocImage>[lL][aA][tT][eE][xX] { + BEGIN(DocLatexImageName); + } +<DocHtmlImageName>{FILE}|{URLMASK} { + outDoc->disableAllBut(OutputGenerator::Html); + outDoc->writeImage(yytext,0,0); + outDoc->enableAll(); + BEGIN(DocScan); + } +<DocLatexImageName>{FILE} { + curImageName = yytext; + BEGIN(DocLatexImageWidth); + } +<DocLatexImageWidth>\n { // no width specified + outDoc->disableAllBut(OutputGenerator::Html); + outDoc->writeImage(curImageName,0,0); + outDoc->enableAll(); + BEGIN(DocScan); + } +<DocLatexImageWidth>"width"{B}*"="{B}*[0-9\.]+({B}*{ID})? { + outDoc->disableAllBut(OutputGenerator::Latex); + outDoc->writeImage(curImageName,yytext,0); + outDoc->enableAll(); + BEGIN(DocScan); + } +<DocLatexImageWidth>"height"{B}*"="{B}*[0-9\.]+({B}*{ID})? { + outDoc->disableAllBut(OutputGenerator::Latex); + outDoc->writeImage(curImageName,0,yytext); + outDoc->enableAll(); + BEGIN(DocScan); + } +<DocImage>[a-z_A-Z0-9\.\-]+ { + warn("Warning: %s is an unsupported output format for \\image\n",yytext); + } +<DocImage,DocHtmlImageName,DocLatexImageName>\n { + warn("Warning: invalid \\image command found!\n"); + yyLineNr++; + outDoc->enableAll(); + BEGIN(DocScan); + } <DocScan>("\\"|"@")"code"/{BN}+ { outDoc->startCodeFragment(); codeBlock.resize(0); @@ -1697,9 +1764,6 @@ VAR [vV][aA][rR] current->argList->clear(); lineCount() ; } - /* -<FindMembers>"inline" - */ <FindMembers>{BN}+ { lineCount(); } @@ -1715,7 +1779,9 @@ VAR [vV][aA][rR] current->virt = Virtual; lineCount(); } -<FindMembers>{B}*"inline"{BN}+ { lineCount(); } +<FindMembers>{B}*"inline"{BN}+ { current->inLine = TRUE; + lineCount(); + } <FindMembers>{B}*"typename"{BN}+ { lineCount(); } <FindMembers>{B}*"namespace"{BN}+ { isTypedef=FALSE; @@ -2177,7 +2243,8 @@ VAR [vV][aA][rR] else { QCString &cn = current->name; - QCString rn = stripAnnonymousScope(current_root->name); + //QCString rn = stripAnnonymousScope(current_root->name); + QCString rn = current_root->name.copy(); //printf("cn=`%s' rn=`%s'\n",cn.data(),rn.data()); if (!cn.isEmpty() && !rn.isEmpty() && (current_root->section & Entry::SCOPE_MASK)) @@ -2202,8 +2269,10 @@ VAR [vV][aA][rR] //printf("adding `%s' `%s' `%s' brief=%s\n",current->type.data(),current->name.data(),current->args.data(),current->brief.data()); current_root->addSubEntry( current ) ; current = new Entry(*current); - if (current->section == Entry::NAMESPACE_SEC) - { // a namespace ends with a closing bracket + if (current->section==Entry::NAMESPACE_SEC || + current->section==Entry::INTERFACE_SEC + ) + { // namespaces and interfaces ends with a closing bracket without semicolon current->reset(); current->protection = protection ; current->sig = sig; @@ -2254,7 +2323,33 @@ VAR [vV][aA][rR] msType = yytext; msType=msType.left(i); } <MemberSpec>[,;] { - if (msName.length()>0) + if (msName.isEmpty() && !current->name.isEmpty()) + /* && (current->section & Entry::COMPOUND_MASK)) */ + { + // see if the compound does not have a name or is inside another + // annonymous compound. If so we insert a + // special `annonymous' variable. + Entry *p=current_root; + while (p) + { + // only look for class scopes, not namespace scopes + if (p->section & Entry::COMPOUND_MASK) + { + //printf("Trying scope `%s'\n",p->name.data()); + int i=p->name.findRev("::"); + int pi = (i==-1) ? 0 : i+2; + if (p->name.at(pi)=='@') + { + // annonymous compound inside -> insert dummy variable name + //printf("Adding annonymous variable for scope %s\n",p->name.data()); + msName.sprintf("@%d",anonCount++); + break; + } + } + p=p->parent; + } + } + if (!msName.isEmpty()) { Entry *varEntry=new Entry; varEntry->protection = current->protection ; @@ -2518,6 +2613,11 @@ VAR [vV][aA][rR] lineCount() ; BEGIN( ExcpRound ) ; } +<FuncQual>{BN}*"raises"{BN}*"(" { + current->exception = " raises(" ; + lineCount() ; + BEGIN( ExcpRound ) ; + } <ExcpRound>"(" { current->exception += *yytext ; ++bracketCount ; } @@ -2588,7 +2688,8 @@ VAR [vV][aA][rR] { //printf("Scanner.l: prototype? type=`%s' name=`%s' args=`%s'\n",current->type.data(),current->name.data(),current->args.data()); QRegExp re("([^)]*)"); - if (!current->type.isNull() && current->type.find(re,0)!=-1) + if (!current->type.isNull() && + (current->type.find(re,0)!=-1 || current->type.left(8)=="typedef ")) { //printf("Scanner.l: found function variable!\n"); current->section = Entry::VARIABLE_SEC; @@ -2600,9 +2701,8 @@ VAR [vV][aA][rR] current->proto = TRUE; } } - //printf("Adding entry `%s' groupId=%d groupHeader=`%s'\n", - // current->name.data(),current->mGrpId,current->mGrpId!=-1 ? - // memberGroupDict[current->mGrpId]->header().data() : ""); + //printf("Adding entry `%s' inLine`%d'\n", + // current->name.data(),current->inLine); previous = current; current_root->addSubEntry(current); current = new Entry ; @@ -2615,6 +2715,8 @@ VAR [vV][aA][rR] lastCurlyContext = FindMembers; if( *yytext == '{' ) { + if (current_root->section & Entry::COMPOUND_MASK) + previous->inLine = TRUE; addToBody(yytext); BEGIN( SkipCurly ) ; } @@ -2779,7 +2881,7 @@ VAR [vV][aA][rR] baseProt=Private; baseVirt=Normal; baseName.resize(0); - BEGIN( Bases ) ; + BEGIN( BasesProt ) ; } <ClassVar>[;=*&] { unput(*yytext); @@ -2792,17 +2894,25 @@ VAR [vV][aA][rR] current->name.sprintf("@%d",anonCount++); BEGIN( Curly ) ; } -<Bases>"virtual" { baseVirt = Virtual; } -<Bases>"public" { baseProt = Public; } -<Bases>"protected" { baseProt = Protected; } -<Bases>"private" { baseProt = Private; } -<Bases>({ID}{BN}*"::"{BN}*)*{ID} { +<BasesProt>"virtual" { baseVirt = Virtual; } +<BasesProt>"public" { baseProt = Public; } +<BasesProt>"protected" { baseProt = Protected; } +<BasesProt>"private" { baseProt = Private; } +<BasesProt>{BN} {} +<BasesProt>. { unput(*yytext); BEGIN(Bases); } +<Bases>("::")*{BN}*({ID}{BN}*"::"{BN}*)*{ID} { //current->extends->append( // new BaseInfo(yytext,baseProt,baseVirt) //) ; - baseName += yytext; - current->args += ' ' ; - current->args += yytext ; + if (*yytext != ':') + baseName += yytext; + else + baseName += (yytext+2); + current->args += ' '; + if (*yytext != ':') + current->args += yytext; + else + current->args += (yytext+2); } <ClassVar>"<" { current->name += *yytext; sharpCount=1; @@ -2845,6 +2955,7 @@ VAR [vV][aA][rR] baseProt=Private; baseVirt=Normal; baseName.resize(0); + BEGIN(BasesProt); } <Bases>{B}*"{"{B}* { current->fileName = yyFileName ; current->startLine = yyLineNr ; @@ -2940,6 +3051,10 @@ VAR [vV][aA][rR] lastBriefContext=Doc; BEGIN( ClassDocBrief ); } +<JavaDoc>"\\brief"{B}+ { + lastBriefContext=tmpDocType; + BEGIN( ClassDocBrief ); + } <JavaDoc>^(({B}*"*"+)?){BL} { lineCount(); if (!current->brief.stripWhiteSpace().isEmpty()) @@ -3061,6 +3176,12 @@ VAR [vV][aA][rR] current->startLine = yyLineNr; BEGIN( PageDocArg1 ); } +<Doc,JavaDoc>{B}*("\\"|"@")"mainpage"{B}* { + current->section = Entry::MAINPAGEDOC_SEC; + current->fileName = yyFileName; + current->startLine = yyLineNr; + BEGIN( PageDocArg2 ); + } <Doc,JavaDoc>{B}*("\\"|"@")"file"{B}* { current->section = Entry::FILEDOC_SEC; current->fileName = yyFileName; @@ -3150,8 +3271,6 @@ VAR [vV][aA][rR] newDocState(); } <FileDocArg1>"\n" { - //warn("Warning: missing argument after " - // "\\file at line %d of %s.\n",yyLineNr,yyFileName); current->name = yyFileName; yyLineNr++; newDocState(); @@ -3430,17 +3549,18 @@ VAR [vV][aA][rR] current->brief=current->brief.stripWhiteSpace(); BEGIN( lastBriefContext ); } +<ClassDocBrief>{BS}/("\\"|"@")"image" { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\"|"@")"author" { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\"|"@")"internal" { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\"|"@")"version" { BEGIN( lastBriefContext ); } -<ClassDocBrief>{BS}/"\\date" { BEGIN( lastBriefContext ); } +<ClassDocBrief>{BS}/("\\"|"@")"date" { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\"|"@")"param" { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\"|"@")"exception" { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\"|"@")"return" { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\sa"|"@see") { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\"|"@")"bug" { BEGIN( lastBriefContext ); } -<ClassDocBrief>{BS}/("\\"|"@")"warning" { BEGIN( lastBriefContext ); } -<ClassDocBrief>{BS}/("\\"|"@")"par"{BN}+ { BEGIN( lastBriefContext ); } +<ClassDocBrief>{BS}/("\\"|"@")"warning" { BEGIN( lastBriefContext ); } +<ClassDocBrief>{BS}/("\\"|"@")"par"{BN}+ { BEGIN( lastBriefContext ); } <ClassDocBrief>{BS}/("\\brief"|"@short"){BN}+ { lastBriefContext=YY_START; BEGIN( ClassDocBrief ); @@ -3529,6 +3649,7 @@ VAR [vV][aA][rR] current->name = current->name.stripWhiteSpace(); newDocState(); } +<Doc>[a-z_A-Z0-9]+ { current->doc += yytext; } <Doc>. { current->doc += *yytext; } <DefLineDoc,LineDoc>. { current->brief += *yytext; } <Doc>\n { yyLineNr++; current->doc += *yytext; } @@ -3564,6 +3685,12 @@ VAR [vV][aA][rR] BEGIN(lastAfterDocContext); } <AfterDocBrief>"."/{BN} { BEGIN(AfterDoc); } +<LineDoc,AfterDocBrief,AfterDocLine>("\\"|"@")"internal" { + current->brief+="\\internal"; + } +<Doc,AfterDoc>("\\"|"@")"internal" { + current->doc+="\\internal"; + } <AfterDoc>("\\"|"@")"brief" { BEGIN(AfterDocBrief); } <AfterDoc>"/*"|"//" { current->doc+=yytext; } <AfterDoc>^{B}*"*"+/[^/] diff --git a/src/section.h b/src/section.h index aa9a674..20d1c6a 100644 --- a/src/section.h +++ b/src/section.h @@ -44,6 +44,7 @@ class SectionDict : public QDict<SectionInfo> { public: SectionDict(int size) : QDict<SectionInfo>(size) {} + ~SectionDict() {} }; #endif @@ -63,7 +63,7 @@ static void addClass(const char *name,const char *fileName) static void addFile(const char *name) { - //printf("adding file %s\n",name); + //printf("adding file %s tagName=`%s'\n",name,tagName.data()); fd = new FileDef(0,name,tagName); FileName *mn; if ((mn=inputNameDict[name])) diff --git a/src/translator.h b/src/translator.h index e81ff92..6d91eac 100644 --- a/src/translator.h +++ b/src/translator.h @@ -687,7 +687,7 @@ class Translator case ClassDef::Union: result+="union"; break; case ClassDef::Interface: result+="interface"; break; } - result+="was generated from the following file"; + result+=" was generated from the following file"; if (single) result+=":"; else result+="s:"; return result; } @@ -696,9 +696,26 @@ class Translator * list. */ virtual QCString trAlphabeticalList() - { - return "Alphabetical List"; - } + { return "Alphabetical List"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990901 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the heading text for the retval command. */ + virtual QCString trReturnValues() + { return "Return values"; } + + /*! This is in the (quick) index as a link to the main page (index.html) + */ + virtual QCString trMainPage() + { return "Main Page"; } + + /*! This is used in references to page that are put in the LaTeX + * documentation. It should be an abbreviation of the word page. + */ + virtual QCString trPageAbbreviation() + { return "p."; } }; diff --git a/src/translator_es.h b/src/translator_es.h index 0aba0a8..3c5d25f 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -16,7 +16,7 @@ /** - * translator_es.h modifief by Francisco Oltra + * translator_es.h modified by Francisco Oltra * Some notes: * - Computer related use of the spanish language differs from * country to country, so some words might not sound so good diff --git a/src/translator_fr.h b/src/translator_fr.h index 8214221..586a48a 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -24,89 +24,138 @@ class TranslatorFrench : public Translator { public: + /*! returns the name of the package that is included by LaTeX */ QCString latexBabelPackage() { return "french"; } - QCString trInherits() - { return "Hérite de"; } - QCString trAnd() - { return "et"; } - QCString trInheritedBy() - { return "Dérivée par"; } + + /*! used in the compound documentation before a list of related functions. */ QCString trRelatedFunctions() { return "Fonctions associées"; } + + /*! subscript for the related functions. */ QCString trRelatedSubscript() { return "(Noter que ces fonctions ne sont pas des méthodes de la classe)"; } + + /*! header that is put before the detailed description of files, classes and namespaces. */ QCString trDetailedDescription() { return "Description détaillée"; } + + /*! header that is put before the list of typedefs. */ QCString trMemberTypedefDocumentation() { return "Documentation des types imbriqués"; } + + /*! header that is put before the list of enumerations. */ QCString trMemberEnumerationDocumentation() { return "Documentation des énumérations imbriqués"; } + + /*! header that is put before the list of member functions. */ QCString trMemberFunctionDocumentation() { return "Documentation des méthodes"; } + + /*! header that is put before the list of member attributes. */ QCString trMemberDataDocumentation() { return "Documentation des données imbriqués"; } - QCString trGeneratedFrom(const char *s,bool single) - { - QCString result=(QCString)"La documentation pour cette"+s+ - " a été générée à partir "; - if (single) result+="du fichier suivant:"; - else result+="des fichiers suivants:"; - return result; - } + + /*! this is the text of a link put after brief descriptions. */ QCString trMore() { return "Plus de détails..."; } - QCString trReference() - { return "Référence"; } + + /*! put in the class documentation */ QCString trListOfAllMembers() { return "Liste de tous les membres"; } + + /*! used as the title of the "list of all members" page of a class */ QCString trMemberList() { return "Liste des membres"; } + + /*! this is the first part of a sentence that is followed by a class name */ QCString trThisIsTheListOfAllMembers() { return "Ceci est la liste complète des membres de"; } + + /*! this is the remainder of the sentence after the class name */ QCString trIncludingInheritedMembers() { return "y compris des membres des classes héritées."; } + + /*! this is put at the author sections at the bottom of man pages. + * parameter s is name of the project name. + */ QCString trGeneratedAutomatically(const char *s) { QCString result="Généré automatiquement par Doxygen"; if (s) result+=(QCString)" pour "+s; result+=" à partir du code source."; return result; } + + /*! put after an enum name in the list of all members */ QCString trEnumName() { return "énumération"; } + + /*! put after an enum value in the list of all members */ QCString trEnumValue() { return "élément d'une énumération"; } + + /*! put after an undocumented member in the list of all members */ QCString trDefinedIn() { return "défini dans"; } + + /*! put as in introduction in the verbatim header file of a class. + * parameter f is the name of the include file. + */ QCString trIncludeFile() { return "Fichier inclu"; } QCString trVerbatimText(const char *f) { return (QCString)"Ce texte provient du fichier inclu "+f+"."; } + // quick reference sections + /*! This is put above each page as a link to the list of all groups of + * compounds or files (see the \group command). + */ QCString trModules() { return "Modules"; } + + /*! This is put above each page as a link to the class hierarchy */ QCString trClassHierarchy() { return "Hiérarchie des classes"; } + + /*! This is put above each page as a link to the list of annotated classes */ QCString trCompoundList() - { return "Liste des composants"; } + { return "Liste des composants"; + + /*! This is put above each page as a link to the list of documented files */} QCString trFileList() { return "Liste des fichiers"; } + + /*! This is put above each page as a link to the list of all verbatim headers */ QCString trHeaderFiles() { return "Fichiers d'entête"; } + + /*! This is put above each page as a link to all members of compounds. */ QCString trCompoundMembers() { return "Composants"; } + + /*! This is put above each page as a link to all members of files. */ QCString trFileMembers() { return "Déclarations"; } + + /*! This is put above each page as a link to all related pages. */ QCString trRelatedPages() { return "Pages associées"; } + + /*! This is put above each page as a link to all examples. */ QCString trExamples() { return "Exemples"; } + + /*! This is put above each page as a link to the search engine. */ QCString trSearch() { return "Recherche"; } + + /*! This is an introduction to the class hierarchy. */ QCString trClassHierarchyDescription() { return "Cette liste d'héritage est, autant que possible, " "classée par ordre alphabétique"; } + + /*! This is an introduction to the list with all files. */ QCString trFileListDescription(bool extractAll) { QCString result="Liste de tous les fichiers "; @@ -114,10 +163,14 @@ class TranslatorFrench : public Translator result+="avec une brève description :"; return result; } + + /*! This is an introduction to the annotated compound list. */ QCString trCompoundListDescription() { return "Liste des classes, des strutures et des unions " "avec une brève description :"; } + + /*! This is an introduction to the page with all class members. */ QCString trCompoundMembersDescription(bool extractAll) { QCString result="Liste de tous les membres de classe "; @@ -127,6 +180,8 @@ class TranslatorFrench : public Translator else result+="les classes auxquelles ils appartiennent :"; return result; } + + /*! This is an introduction to the page with all file members. */ QCString trFileMembersDescription(bool extractAll) { QCString result="Liste de toutes les déclarations"; @@ -137,79 +192,198 @@ class TranslatorFrench : public Translator else result+="les fichiers dans lesquels elles sont définies :"; return result; } + + /*! This is an introduction to the page with the list of all header files. */ QCString trHeaderFilesDescription() { return "Liste de tous les fichiers d'entête constituant " "l'interface de programmation :"; } + + /*! This is an introduction to the page with the list of all examples */ QCString trExamplesDescription() { return "Liste de tous les exemples :"; } + + /*! This is an introduction to the page with the list of related pages */ QCString trRelatedPagesDescription() { return "Liste de toutes les pages de documentation associées :"; } + + /*! This is an introduction to the page with the list of class/file groups */ QCString trModulesDescription() { return "Liste de tous les modules"; } + + /*! This sentences is used in the annotated class/file lists if no brief + * description is given. + */ QCString trNoDescriptionAvailable() { return "Aucune description n'est disponible"; } + + // index titles (the project name is prepended for these) + + /*! This is used in HTML as the title of index.html. */ QCString trDocumentation() { return "Documentation"; } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all groups. + */ QCString trModuleIndex() { return "Index des modules"; } + + /*! This is used in LaTeX as the title of the chapter with the + * class hierarchy. + */ QCString trHierarchicalIndex() { return "Index hiérarchique"; } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index. + */ QCString trCompoundIndex() { return "Index des composants"; } + + /*! This is used in LaTeX as the title of the chapter with the + * list of all files. + */ QCString trFileIndex() { return "Index des fichiers"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all groups. + */ QCString trModuleDocumentation() { return "Documentation du module"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all classes, structs and unions. + */ QCString trClassDocumentation() { return "Documentation de la classe"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all files. + */ QCString trFileDocumentation() { return "Documentation du fichier"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all examples. + */ QCString trExampleDocumentation() { return "Documentation de l'exemple"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all related pages. + */ QCString trPageDocumentation() { return "Documentation de la page"; } + + /*! This is used in LaTeX as the title of the document */ QCString trReferenceManual() { return "Manuel de référence"; } - + + /*! This is used in the documentation of a file as a header before the + * list of defines + */ QCString trDefines() { return "Définitions des macros"; } + + /*! This is used in the documentation of a file as a header before the + * list of function prototypes + */ QCString trFuncProtos() { return "Prototypes des fonctions"; } + + /*! This is used in the documentation of a file as a header before the + * list of typedefs + */ QCString trTypedefs() { return "Définitions des types"; } + + /*! This is used in the documentation of a file as a header before the + * list of enumerations + */ QCString trEnumerations() { return "Enumérations"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) functions + */ QCString trFunctions() { return "Fonctions"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ QCString trVariables() { return "Variables"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ QCString trEnumerationValues() { return "Eléments énumérés"; } - QCString trReimplementedFrom() - { return "Redéfini à partir de"; } - QCString trReimplementedIn() - { return "Redéfini dans"; } + + /*! This is used in man pages as the author section. */ QCString trAuthor() { return "Auteur"; } + + /*! This is used in the documentation of a file before the list of + * documentation blocks for defines + */ QCString trDefineDocumentation() { return "Documentation de la macro"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for function prototypes + */ QCString trFunctionPrototypeDocumentation() { return "Documentation du prototype de la fonction"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for typedefs + */ QCString trTypedefDocumentation() { return "Documentation du type"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration types + */ QCString trEnumerationTypeDocumentation() { return "Documentation du type de l'énumeration"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ QCString trEnumerationValueDocumentation() { return "Documentation de l'élément de l'énumeration"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for functions + */ QCString trFunctionDocumentation() { return "Documentation de la fonction"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for variables + */ QCString trVariableDocumentation() { return "Documentation de la variable"; } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds + */ QCString trCompounds() { return "Composants"; } + + /*! This is used in the documentation of a group before the list of + * links to documented files + */ QCString trFiles() { return "Fichiers"; } + + /*! This is used in the standard footer of each page and indicates when + * the page was generated + */ QCString trGeneratedAt(const char *date,const char *projName) { QCString result=(QCString)"Généré le "+date; @@ -217,47 +391,75 @@ class TranslatorFrench : public Translator result+=(QCString)" par "; return result; } + /*! This is part of the sentence used in the standard footer of each page. + */ QCString trWrittenBy() { return "écrit par"; } + + /*! this text is put before a class diagram */ QCString trClassDiagram(const char *clName) { return (QCString)"Graphe d'héritage de la classe "+clName; } + + /*! this text is generated when the \internal command is used. */ QCString trForInternalUseOnly() { return "A usage interne uniquement."; } + + /*! this text is generated when the \reimp command is used. */ QCString trReimplementedForInternalReasons() { return "Redéfini pour des raisons internes; " "l'interface n'est pas modifiée"; } + + /*! this text is generated when the \warning command is used. */ QCString trWarning() { return "Avertissement"; } + + /*! this text is generated when the \bug command is used. */ QCString trBugsAndLimitations() { return "Bogues et limitations"; } + + /*! this text is generated when the \version command is used. */ QCString trVersion() { return "Version"; } + + /*! this text is generated when the \date command is used. */ QCString trDate() { return "Date"; } + + /*! this text is generated when the \author command is used. */ QCString trAuthors() { return "Auteur(s)"; } + + /*! this text is generated when the \return command is used. */ QCString trReturns() { return "Renvoie"; } + + /*! this text is generated when the \sa command is used. */ QCString trSeeAlso() { return "Voir également"; } + + /*! this text is generated when the \param command is used. */ QCString trParameters() { return "Paramètres"; } + + /*! this text is generated when the \exception command is used. */ QCString trExceptions() { return "Exceptions"; } + + /*! this text is used in the title page of a LaTeX document. */ QCString trGeneratedBy() { return "Généré par"; } // new since 0.49-990307 - virtual QCString trNamespaces() - { return "Namespaces"; } virtual QCString trNamespaceList() { return "Liste des Namespaces"; } + + /*! used as an introduction to the namespace list */ virtual QCString trNamespaceListDescription(bool extractAll) { QCString result="Liste de tous les namespaces "; @@ -265,13 +467,213 @@ class TranslatorFrench : public Translator result+="avec une brève description :"; return result; } + + /*! used in the class documentation as a header before the list of all + * friends of a class + */ virtual QCString trFriends() { return "Friends"; } - // new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + /*! used in the class documentation as a header before the list of all + * related classes + */ virtual QCString trRelatedFunctionDocumentation() { return "Documentation des fonctions amies et associées"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of the HTML page of a class/struct/union */ + virtual QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType) + { + QCString result="Référence de "; + switch(compType) + { + case ClassDef::Class: result+="la classe "; break; + case ClassDef::Struct: result+="la structure "; break; + case ClassDef::Union: result+="l'union "; break; + case ClassDef::Interface: result+="l'interface "; break; + } + + result+=(QCString)clName; + return result; + } + + /*! used as the title of the HTML page of a file */ + virtual QCString trFileReference(const char *fileName) + { + QCString result= "Référence du fichier "; + result += fileName; + return result; + } + + /*! used as the title of the HTML page of a namespace */ + virtual QCString trNamespaceReference(const char *namespaceName) + { + QCString result= "Référence du namespace "; + result += namespaceName; + return result; + } + + /*! \mgroup Class sections + * these are for the member sections of a class, struct or union + */ + virtual QCString trPublicMembers() + { return "Membres publiques"; } + virtual QCString trPublicSlots() + { return "Connecteurs publiques"; } + virtual QCString trSignals() + { return "Signaux"; } + virtual QCString trStaticPublicMembers() + { return "Membres publiques statiques"; } + virtual QCString trProtectedMembers() + { return "Membres protégés"; } + virtual QCString trProtectedSlots() + { return "Connecteurs protégés"; } + virtual QCString trStaticProtectedMembers() + { return "Membres protégés statiques"; } + virtual QCString trPrivateMembers() + { return "Membres privés"; } + virtual QCString trPrivateSlots() + { return "Connecteurs privés"; } + virtual QCString trStaticPrivateMembers() + { return "Membres privés statiques"; } + /*! \endmgroup */ + + /*! this function is used to produce a comma-separated list of items. + * use generateMarker(i) to indicate where item i should be put. + */ + virtual QCString trWriteList(int numEntries) + { + QCString result; + int i; + // the inherits list contain `numEntries' classes + for (i=0;i<numEntries;i++) + { + // use generateMarker to generate placeholders for the class links! + result+=generateMarker(i); // generate marker for entry i in the list + // (order is left to right) + + if (i!=numEntries-1) // not the last entry, so we need a separator + { + if (i<numEntries-2) // not the fore last entry + result+=", "; + else // the fore last entry + result+=", and "; + } + } + return result; + } + + /*! used in class documentation to produce a list of base classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritsList(int numEntries) + { + return "Est dérivée de "+trWriteList(numEntries)+"."; + } + + /*! used in class documentation to produce a list of super classes, + * if class diagrams are disabled. + */ + virtual QCString trInheritedByList(int numEntries) + { + return "Dérivée par "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * members that are hidden by this one. + */ + virtual QCString trReimplementedFromList(int numEntries) + { + return "Redéfinie à partir de "+trWriteList(numEntries)+"."; + } + + /*! used in member documentation blocks to produce a list of + * all member that overwrite the implementation of this member. + */ + virtual QCString trReimplementedInList(int numEntries) + { + return "Redéfinie dans "+trWriteList(numEntries)+"."; + } + + /*! This is put above each page as a link to all members of namespaces. */ + virtual QCString trNamespaceMembers() + { return "Menbres des namespaces"; } + + /*! This is an introduction to the page with all namespace members */ + virtual QCString trNamespaceMemberDescription(bool extractAll) + { + QCString result="Voici une list de tous les membres de namespace"; + if (!extractAll) result+="documentés "; + result+=" avec liens vers "; + if (extractAll) + result+="les documentations des namespaces associés :"; + else + result+="les namespaces auxquels ils appartiennent :"; + return result; + } + /*! This is used in LaTeX as the title of the chapter with the + * index of all namespaces. + */ + virtual QCString trNamespaceIndex() + { return "Index des Namespaces"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all namespaces. + */ + virtual QCString trNamespaceDocumentation() + { return "Documentation des Namespaces"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990522 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in the documentation before the list of all + * namespaces in a file. + */ + virtual QCString trNamespaces() + { return "Namespaces"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + /*! This is put at the bottom of a class documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)"La documentation associée à cette "; + switch(compType) + { + case ClassDef::Class: result+="classe"; break; + case ClassDef::Struct: result+="structure"; break; + case ClassDef::Union: result+="union"; break; + case ClassDef::Interface: result+="interface"; break; + } + result+=" a été générée à partir "; + if (single) result+=" du fichier suivant :"; + else result+="des fichiers suivants :"; + return result; + } + + /*! This is in the (quick) index as a link to the alphabetical compound + * list. + */ + virtual QCString trAlphabeticalList() + { + return "Liste par ordre alphabétique"; + } + }; #endif diff --git a/src/translator_it.h b/src/translator_it.h index 34d5660..74f0b75 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -6,6 +6,9 @@ * * Initial Italian Translation by Ahmed Aldo Faisal * Revised and completed by Alessandro Falappa (June 1999) + * Updates: + * 1999/09/10: corrected some small typos in the "new since 0.49-990425" section + * added the "new since 0.49-990728" section * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -293,15 +296,15 @@ class TranslatorItalian : public Translator QCString trCompoundReference(const char *clName, ClassDef::CompoundType compType) { - QCString result="Riferimenti per la"; + QCString result="Riferimenti per "; switch(compType) { - case ClassDef::Class: result+=" classe"; break; - case ClassDef::Struct: result+=" struct"; break; - case ClassDef::Union: result+=" union"; break; - case ClassDef::Interface: result+=" interface"; break; + case ClassDef::Class: result+="la classe "; break; + case ClassDef::Struct: result+="la struct "; break; + case ClassDef::Union: result+="la union "; break; + case ClassDef::Interface: result+="l'interfaccia "; break; } - result+=" "+(QCString)clName; + result+=(QCString)clName; return result; } QCString trFileReference(const char *fileName) @@ -375,6 +378,40 @@ class TranslatorItalian : public Translator { return "Indice dei namespaces"; } QCString trNamespaceDocumentation() { return "Documentazione dei namespaces"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + /*! This is put at the bottom of a class documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)"La documentazione per questa "; + switch(compType) + { + case ClassDef::Class: result+="classe"; break; + case ClassDef::Struct: result+="struct"; break; + case ClassDef::Union: result+="union"; break; + case ClassDef::Interface: result+="interfaccia"; break; + } + result+=" è stata generata a partire "; + if (single) result+="dal seguente file:"; + else result+="dai seguenti files:"; + return result; + } + + /*! This is in the (quick) index as a link to the alphabetical compound + * list. + */ + virtual QCString trAlphabeticalList() + { + return "Lista in ordine alfabetico"; + } + }; #endif diff --git a/src/translator_nl.h b/src/translator_nl.h index 4c105f1..a526ac1 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -384,6 +384,55 @@ class TranslatorDutch : public Translator // This is used in LaTeX as the title of the chapter containing // the documentation of all namespaces. { return "Namespace Documentatie"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + /*! This is put at the bottom of a class documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)"De documentatie voor deze "; + switch(compType) + { + case ClassDef::Class: result+="class"; break; + case ClassDef::Struct: result+="struct"; break; + case ClassDef::Union: result+="union"; break; + case ClassDef::Interface: result+="interface"; break; + } + result+=" is gegenereerd op grond van de volgende file"; + if (single) result+=":"; else result+="s:"; + return result; + } + + /*! This is in the (quick) index as a link to the alphabetical compound + * list. + */ + virtual QCString trAlphabeticalList() + { return "Alphabetical List"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990901 +////////////////////////////////////////////////////////////////////////// + + /*! This is used as the heading text for the retval command. */ + virtual QCString trReturnValues() + { return "Retour waarden"; } + + /*! This is in the (quick) index as a link to the main page (index.html) + */ + virtual QCString trMainPage() + { return "Hoofd Pagina"; } + + /*! This is used in references to page that are put in the LaTeX + * documentation. It should be an abbreviation of the word page. + */ + virtual QCString trPageAbbreviation() + { return "p."; } }; #endif diff --git a/src/translator_se.h b/src/translator_se.h index 2a04ff3..2d7fa87 100644 --- a/src/translator_se.h +++ b/src/translator_se.h @@ -47,10 +47,15 @@ Uppdateringar. =================================================================================== Problem! - Namespace och slot: har de nån hygglig svensk översättning??? + Slot: nån hygglig svensk översättning??? Skicka gärna synpunkter. =================================================================================== +1999/09/01 +* Det verkar som om "namnrymd" är en hyggligt vedertagen svensk översättning + av "namnepace", så jag kör med det från och med nu. +* "interface" heter numera "gränssnitt" + */ #ifndef TRANSLATOR_SE_H @@ -349,13 +354,13 @@ class TranslatorSwedish : public Translator // new since 0.49-990307 virtual QCString trNamespaceList() - { return "Namespacelista"; } + { return "Namnrymdlista"; } virtual QCString trNamespaceListDescription(bool extractAll) { QCString result="Här är en lista över alla "; if (!extractAll) result+="dokumenterade "; - result+="namespaces med en kort förklaring:"; + result+="namnrymder med en kort förklaring:"; return result; } @@ -379,10 +384,10 @@ class TranslatorSwedish : public Translator QCString result=(QCString)clName+" "; switch(compType) { - case ClassDef::Class: result+=" Klass"; break; - case ClassDef::Struct: result+=" Strukt"; break; - case ClassDef::Union: result+=" Union"; break; - case ClassDef::Interface: result+=" Interface"; break; + case ClassDef::Class: result+=" klass"; break; + case ClassDef::Struct: result+=" strukt"; break; + case ClassDef::Union: result+=" union"; break; + case ClassDef::Interface: result+=" gränssnitt"; break; } result+="referens"; return result; @@ -398,7 +403,7 @@ class TranslatorSwedish : public Translator virtual QCString trNamespaceReference(const char *namespaceName) { QCString result=namespaceName; - result+=" namespacereferens"; + result+=" namnrymdreferens"; return result; } @@ -474,25 +479,65 @@ class TranslatorSwedish : public Translator } virtual QCString trNamespaceMembers() - { return "Namespacemedlemmar"; } + { return "Namnrymdsmedlemmar"; } virtual QCString trNamespaceMemberDescription(bool extractAll) { QCString result="Här är en lista över alla "; if (!extractAll) result+="dokumenterade "; - result+="namespacemedlemmar med länkar till "; + result+="namnrymdsmedlemmar med länkar till "; if (extractAll) - result+=" namespace-dokumentationen för varje medlem:"; + result+=" namnrymd-dokumentationen för varje medlem:"; else - result+="de namespaces de tillhör:"; + result+="de namnrymder de tillhör:"; return result; } virtual QCString trNamespaceIndex() - { return "Namespaceindex"; } + { return "Namnrymdsindex"; } virtual QCString trNamespaceDocumentation() + { return "Namnrymd-dokumentation"; } + ////////////////////////////////////////////////////////////////////////// +// new since 0.49-990522 +////////////////////////////////////////////////////////////////////////// + + /*! This is used in the documentation before the list of all + * namespaces in a file. + */ + virtual QCString trNamespaces() + { return "Namnrymder"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + /*! This is put at the bottom of a class documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { // here s is one of " Class", " Struct" or " Union" + // single is true implies a single file + QCString result=(QCString)"Dokumentationen för "; + switch(compType) + { + case ClassDef::Class: result+="denna klass "; break; + case ClassDef::Struct: result+="denna strukt "; break; + case ClassDef::Union: result+="denna union "; break; + case ClassDef::Interface: result+="detta gränssnitt "; break; + } + result+="var genererad från följande fil"; + if (single) result+=":"; else result+="er:"; + return result; + } -{ return "Namespace-dokumentation"; } + /*! This is in the (quick) index as a link to the alphabetical compound + * list. + */ + virtual QCString trAlphabeticalList() + { + return "Alfabetisk lista"; + } }; #endif diff --git a/src/util.cpp b/src/util.cpp index 167ba3f..d714912 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -39,18 +39,52 @@ bool isId(char c) return c=='_' || isalnum(c); } -// strip annonymous part of the scope -QCString stripAnnonymousScope(const QCString &s) +// strip annonymous left hand side part of the scope +//QCString stripAnnonymousScope(const QCString &s) +//{ +// QCString result=s; +// int i=0; +// while (!result.isEmpty() && result.at(0)=='@' && (i=result.find("::"))!=-1) +// { +// result=result.right(result.length()-i-2); +// } +// //if (result.at(0)=='@') +// //{ +// // result.resize(0); +// //} +// return result; +//} + +// strip annonymous left hand side part of the scope +QCString stripAnnonymousNamespaceScope(const QCString &s) { - QCString result=s; - int i=0; - while (!result.isEmpty() && result.at(0)=='@' && (i=result.find("::"))!=-1) - { - result=result.right(result.length()-i-2); + int oi=0,i=0,p=0; + if (s.isEmpty()) return s; + while (s.at(p)=='@' && (i=s.find("::",p))!=-1 && + namespaceDict[s.left(i)]!=0) { oi=i; p=i+2; } + if (oi==0) + { + //printf("stripAnnonymousNamespaceScope(`%s')=`%s'\n",s.data(),s.data()); + return s; + } + else + { + //printf("stripAnnonymousNamespaceScope(`%s')=`%s'\n",s.data(),s.right(s.length()-oi-2).data()); + return s.right(s.length()-oi-2); } - return result; } +void writePageRef(OutputList &ol,const char *cn,const char *mn) +{ + bool htmlOn = ol.isEnabled(OutputGenerator::Html); + bool manOn = ol.isEnabled(OutputGenerator::Man); + ol.startPageRef(); + ol.disableAllBut(OutputGenerator::Latex); + ol.docify(theTranslator->trPageAbbreviation()); + ol.endPageRef(cn,mn); + if (htmlOn) ol.enable(OutputGenerator::Html); + if (manOn) ol.enable(OutputGenerator::Man); +} QCString generateMarker(int id) { @@ -159,8 +193,6 @@ QCString removeRedundantWhiteSpace(const QCString &s) return result; } - - bool rightScopeMatch(const QCString &scope, const QCString &name) { return (name==scope || // equal @@ -244,12 +276,14 @@ void linkifyText(OutputList &ol,const char *scName,const char *name,const char * } } while (!found && scopeOffset>=0); + //if (!found) printf("Trying to link %s in %s\n",word.data(),scName); if (!found && getDefs(scName,word,0,md,cd,fd,nd) && - (md->isTypedef() || md->isEnumerate()) && + (md->isTypedef() || md->isEnumerate() || md->isReference()) && md->isLinkable() ) { + //printf("Found ref\n"); Definition *d=0; if (cd) d=cd; else if (nd) d=nd; else d=fd; if (d && d->isLinkable()) @@ -369,17 +403,17 @@ QCString tempArgListToString(ArgumentList *al) static bool manIsEnabled; -void startTitle(OutputList &ol) +void startTitle(OutputList &ol,const char *fileName) { - ol.startTitleHead(); + ol.startTitleHead(fileName); manIsEnabled=ol.isEnabled(OutputGenerator::Man); if (manIsEnabled) ol.disable(OutputGenerator::Man); } -void endTitle(OutputList &ol,const char *name) +void endTitle(OutputList &ol,const char *fileName,const char *name) { if (manIsEnabled) ol.enable(OutputGenerator::Man); - ol.endTitleHead(name); + ol.endTitleHead(fileName,name); } void writeQuickLinks(OutputList &ol,bool compact,bool ext) @@ -391,6 +425,12 @@ void writeQuickLinks(OutputList &ol,bool compact,bool ext) if (manEnabled) ol.disable(OutputGenerator::Man); if (texEnabled) ol.disable(OutputGenerator::Latex); if (compact) ol.startCenter(); else ol.startItemList(); + + if (!compact) ol.writeListItem(); + ol.startQuickIndexItem(extLink,absPath+"index.html"); + parseText(ol,theTranslator->trMainPage()); + ol.endQuickIndexItem(); + if (documentedGroups>0) { if (!compact) ol.writeListItem(); @@ -1428,15 +1468,19 @@ void generateRef(OutputList &ol,const char *scName, { ol.writeObjectLink(cd->getReference(), cd->getOutputFileBase(),0,linkText); - if (!cd->isReference()) - ol.writePageRef(cd->name(),0); + if (!cd->isReference() && !Config::pdfHyperFlag) + { + writePageRef(ol,cd->name(),0); + } } else // scope matches that of a namespace { ol.writeObjectLink(nd->getReference(), nd->getOutputFileBase(),0,linkText); - if (!nd->getReference()) - ol.writePageRef(nd->name(),0); + if (!nd->getReference() && !Config::pdfHyperFlag) + { + writePageRef(ol,nd->name(),0); + } } // link has been written, stop now. return; @@ -1532,15 +1576,15 @@ void generateRef(OutputList &ol,const char *scName, } // generate the page reference (for LaTeX) - if (cName.length()>0 || aName.length()>0) + if (!Config::pdfHyperFlag && (cName.length()>0 || aName.length()>0)) { if ( (cd && cd->isLinkableInProject()) || (fd && !fd->isReference()) || - (nd /* TODO: && !nd->isReference() */) + (nd && !nd->isReference()) ) { - ol.writePageRef(cName,aName); + writePageRef(ol,cName,aName); } } return; @@ -72,8 +72,8 @@ extern int guessSection(const char *name); //extern QCString nameToFile(const char *name); extern bool isId(char c); extern QCString removeRedundantWhiteSpace(const QCString &s); -extern void startTitle(OutputList &ol); -extern void endTitle(OutputList &ol,const char *name); +extern void startTitle(OutputList &ol,const char *fileName); +extern void endTitle(OutputList &ol,const char *fileName,const char *name); void startFile(OutputList &ol,const char *name, const char *title,bool external=FALSE); void endFile(OutputList &ol,bool external=FALSE); @@ -84,6 +84,7 @@ QCString generateMarker(int id); void writeExample(OutputList &ol,ExampleList *el); void setFileNameForSections(QList<QCString> *anchorList,const char *fileName); QCString stripAnnonymousScope(const QCString &s); +QCString stripAnnonymousNamespaceScope(const QCString &s); //void writeLink(OutputList &ol,ClassDef *cd,NamespaceDef *nd, @@ -92,5 +93,6 @@ QCString stripAnnonymousScope(const QCString &s); QCString stripFromPath(const QCString &path); bool rightScopeMatch(const QCString &scope, const QCString &name); bool leftScopeMatch(const QCString &scope, const QCString &name); +void writePageRef(OutputList &ol,const char *cn,const char *mn); #endif |