From 55d2ef8412008e1560b0d5a2ecc2031f269af4a1 Mon Sep 17 00:00:00 2001 From: dimitri Date: Mon, 26 Aug 2002 17:33:07 +0000 Subject: Release-1.2.17-20020826 --- INSTALL | 4 +- README | 4 +- VERSION | 2 +- configure | 4 +- doc/config.doc | 9 + doc/history.doc | 2 +- doc/index.doc | 6 +- doc/install.doc | 20 +- doc/language.doc | 30 +- doc/language.tpl | 6 +- doc/maintainers.txt | 3 + doc/starting.doc | 2 +- packages/rpm/doxygen.spec | 2 +- src/classdef.cpp | 6 +- src/config.l | 13 +- src/definition.cpp | 1 - src/doc.l | 106 ++-- src/docparser.cpp | 530 ++++++++++++++++- src/docparser.h | 287 +++++---- src/doctokenizer.l | 100 +++- src/docvisitor.h | 5 +- src/dot.h | 4 + src/doxygen.cpp | 201 +++---- src/groupdef.cpp | 1 + src/htmldocvisitor.cpp | 67 +++ src/htmldocvisitor.h | 244 +++++--- src/htmlgen.cpp | 5 +- src/lang_cfg.h | 1 + src/language.cpp | 3 + src/latexdocvisitor.cpp | 48 ++ src/latexdocvisitor.h | 788 +++++++++++++++++++++++++ src/latexgen.cpp | 330 +---------- src/latexgen.h | 7 +- src/libdoxygen.pro.in | 18 +- src/memberdef.cpp | 70 ++- src/memberdef.h | 2 + src/namespacedef.cpp | 3 +- src/outputgen.h | 107 ++-- src/printdocvisitor.h | 35 +- src/scanner.l | 106 ++-- src/translator_ca.h | 1405 +++++++++++++++++++++++++++++++++++++++++++++ src/util.cpp | 384 ++++++++++++- src/util.h | 2 + src/xmlgen.cpp | 4 +- wintools/Doxygen.dsp | 18 +- 45 files changed, 4095 insertions(+), 900 deletions(-) create mode 100644 src/htmldocvisitor.cpp create mode 100644 src/latexdocvisitor.cpp create mode 100644 src/latexdocvisitor.h create mode 100644 src/translator_ca.h diff --git a/INSTALL b/INSTALL index f6399f6..809cc8e 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,6 @@ -DOXYGEN Version 1.2.17-20020811 +DOXYGEN Version 1.2.17-20020825 Please read the installation section of the manual for instructions. -------- -Dimitri van Heesch (11 August 2002) +Dimitri van Heesch (25 August 2002) diff --git a/README b/README index d8b4355..e987d37 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.2.17_20020811 +DOXYGEN Version 1.2.17_20020825 Please read INSTALL for compilation instructions. @@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (11 August 2002) +Dimitri van Heesch (dimitri@stack.nl) (25 August 2002) diff --git a/VERSION b/VERSION index d5e9194..9e2faab 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.17-20020811 +1.2.17-20020825 diff --git a/configure b/configure index ba80dc8..f2bdb2c 100755 --- a/configure +++ b/configure @@ -27,7 +27,7 @@ f_prefix=/usr f_insttool=NO f_english=NO f_wizard=NO -f_langs=nl,se,cz,fr,it,de,jp,es,fi,ru,hr,pl,pt,hu,kr,ro,si,cn,no,br,dk,sk,ua,gr,tw,sr +f_langs=nl,se,cz,fr,it,de,jp,es,fi,ru,hr,pl,pt,hu,kr,ro,si,cn,no,br,dk,sk,ua,gr,tw,sr,ca while test -n "$1"; do case $1 in @@ -493,7 +493,7 @@ echo -n " Generating src/lang_cfg.h..." echo $f_langs | $f_perl -e '@l=split(/,/,); chomp @l; @allowed=(NL,SE,CZ,FR,IT,DE,JP,ES,FI,RU,HR,PL,PT,HU,KR,RO,SI,CN,NO,BR, - DK,SK,UA,GR,TW,SR); + DK,SK,UA,GR,TW,SR,CA); foreach my $elem (@l){ $elem =~ tr/a-z/A-Z/; $r=0; diff --git a/doc/config.doc b/doc/config.doc index 1c3d995..3f38ee0 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -116,6 +116,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_graphical_hierarchy GRAPHICAL_HIERARCHY \refitem cfg_have_dot HAVE_DOT \refitem cfg_hhc_location HHC_LOCATION +\refitem cfg_hide_friend_compounds HIDE_FRIEND_COMPOUNDS \refitem cfg_hide_scope_names HIDE_SCOPE_NAMES \refitem cfg_hide_undoc_classes HIDE_UNDOC_CLASSES \refitem cfg_hide_undoc_members HIDE_UNDOC_MEMBERS @@ -278,6 +279,14 @@ followed by the descriptions of the tags grouped by category. various overviews. This option has no effect if \c EXTRACT_ALL is enabled. +\anchor cfg_hide_friend_compounds +
\c HIDE_FRIEND_COMPOUNDS
+ \addindex HIDE_FRIEND_COMPOUNDS + If the \c HIDE_FRIEND_COMPOUNDS tag is set to \c YES, Doxygen will hide all + friend (class|struct|union) declarations. + If set to \c NO (the default) these declarations will be included in the + documentation. + \anchor cfg_brief_member_desc
\c BRIEF_MEMBER_DESC
\addindex BRIEF_MEMBER_DESC diff --git a/doc/history.doc b/doc/history.doc index 96314e8..3b1129a 100644 --- a/doc/history.doc +++ b/doc/history.doc @@ -76,7 +76,7 @@
  • Many new commands (there are now more than 60!) to document more entities, to make the documentation look nicer, and to include examples or pieces of examples. -
  • Enum types, enum values, typedefs, #defines, and files can now be +
  • Enum types, enum values, typedefs, \#defines, and files can now be documented.
  • Completely new documentation, that is now generated by Doxygen.
  • A lot of small examples are now included. diff --git a/doc/index.doc b/doc/index.doc index 6c1aa66..da5246a 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -27,7 +27,7 @@ Version: $(VERSION)

    Introduction

    Doxygen is a documentation system for C++, C, Java, IDL -(Corba, Microsoft, and KDE-DCOP flavors) and to some extend PHP. +(Corba, Microsoft, and KDE-DCOP flavors) and to some extent PHP. It can help you in three ways:
      @@ -179,8 +179,8 @@ Thanks go to:
    1. Petr Prikryl for coordinating the internationalisation support. All language maintainers for providing translations into many languages.
    2. Erik Jan Lingen of Habanera, Mark - Roddy, Paul Schwartz, Charles Duffy, Vadym Voznyuk, Philip Walton and - Dwight Browne for donating money. + Roddy, Paul Schwartz, Charles Duffy, Vadym Voznyuk, Philip Walton, + Dwight Browne, and Andreas Fredriksson for donating money.
    3. The Comms group of Symbian for donating an ultra cool Revo plus organizer! diff --git a/doc/install.doc b/doc/install.doc index fe7fd55..1387f13 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -58,12 +58,12 @@ tools should be installed. \addindex Qt This is needed to build the GUI front-end.
    4. A \f$\mbox{\LaTeX}\f$ distribution: for instance - teTeX 1.0.
      - \latexonly(see {\tt http://www.tug.org/})\endlatexonly. + teTeX 1.0 + \latexonly \\par (see {\tt http://www.tug.org/})\endlatexonly. This is needed for generating LaTeX, Postscript, and PDF output.
    5. - the Graph visualization toolkit version 1.5
      - \latexonly(see {\tt http://www.research.att.com/sw/tools/graphviz/})\endlatexonly. + the Graph visualization toolkit version 1.5 + \latexonly \\par (see {\tt http://www.research.att.com/sw/tools/graphviz/})\endlatexonly. Needed for the include dependency graphs, the graphical inheritance graphs, and the collaboration graphs. If you compile graphviz yourself, make sure you do include @@ -142,17 +142,17 @@ Compilation is now done by performing the following steps: index.html in the html directory). -
    6. Optional: Generate a PostScript and PDF version of the manual - (you will need latex and dvips and - the ghostscript package for this). +
    7. Optional: Generate a PDF version of the manual + (you will need pdflatex, makeindex, and + egrep for this). \verbatim make pdf \endverbatim - The PostScript manual doxygen_manual.ps will be located - in the latex directory of the distribution. Just send it to a - PostScript printer to print it or use ghostview to view it. + The PDF manual doxygen_manual.pdf will be located + in the latex directory of the distribution. Just + view and print it via the acrobat reader.
    diff --git a/doc/language.doc b/doc/language.doc index f850044..5f259fa 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -25,14 +25,14 @@ Doxygen has built-in support for multiple languages. This means that the text fragments that doxygen generates can be produced in languages other than English (the default) at configuration time. -Currently (version 1.2.17-20020804), 27 languages +Currently (version 1.2.14-20020317), 28 languages are supported (sorted alphabetically): -Brazilian Portuguese, Chinese, Chinese Traditional, Croatian, Czech, -Danish, Dutch, English, Finnish, French, -German, Greek, Hungarian, Italian, Japanese, -Korean, Norwegian, Polish, Portuguese, Romanian, -Russian, Serbian, Slovak, Slovene, Spanish, -Swedish, and Ukrainian. +Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian, +Czech, Danish, Dutch, English, Finnish, +French, German, Greek, Hungarian, Italian, +Japanese, Korean, Norwegian, Polish, Portuguese, +Romanian, Russian, Serbian, Slovak, Slovene, +Spanish, Swedish, and Ukrainian. The table of information related to the supported languages follows. It is sorted by language alphabetically. The Status column @@ -58,6 +58,12 @@ when the translator was updated. up-to-date + Catalan + Albert Mora + amora@NOSPAM.iua.upf.es + up-to-date + + Chinese Wei Liu
    Wang Weihan liuwei@NOSPAM.asiainfo.com
    wangweihan@NOSPAM.capinfo.com.cn @@ -157,7 +163,7 @@ when the translator was updated. Polish Piotr Kaminski
    Grzegorz Kowal Piotr.Kaminski@NOSPAM.ctm.gdynia.pl
    g_kowal@NOSPAM.poczta.onet.pl - 1.2.16 + 1.2.17 Portuguese @@ -181,7 +187,7 @@ when the translator was updated. Serbian Dejan Milosavljevic dmilos@NOSPAM.email.com - 1.2.16 + 1.2.17 Slovak @@ -226,6 +232,8 @@ when the translator was updated. \hline Brazilian Portuguese & Fabio "FJTC" Jun Takada Chino & {\tt chino@icmc.sc.usp.br} & up-to-date \\ \hline + Catalan & Albert Mora & {\tt amora@iua.upf.es} & up-to-date \\ + \hline Chinese & Wei Liu & {\tt liuwei@asiainfo.com} & 1.2.13 \\ & Wang Weihan & {\tt wangweihan@capinfo.com.cn} & \\ \hline @@ -262,7 +270,7 @@ when the translator was updated. \hline Norwegian & Lars Erik Jordet & {\tt lej@circuitry.no} & 1.2.2 \\ \hline - Polish & Piotr Kaminski & {\tt Piotr.Kaminski@ctm.gdynia.pl} & 1.2.16 \\ + Polish & Piotr Kaminski & {\tt Piotr.Kaminski@ctm.gdynia.pl} & 1.2.17 \\ & Grzegorz Kowal & {\tt g\_kowal@poczta.onet.pl} & \\ \hline Portuguese & Rui Godinho Lopes & {\tt ruiglopes@yahoo.com} & up-to-date \\ @@ -271,7 +279,7 @@ when the translator was updated. \hline Russian & Alexandr Chelpanov & {\tt cav@cryptopro.ru} & up-to-date \\ \hline - Serbian & Dejan Milosavljevic & {\tt dmilos@email.com} & 1.2.16 \\ + Serbian & Dejan Milosavljevic & {\tt dmilos@email.com} & 1.2.17 \\ \hline Slovak & Stanislav Kudl\'{a}\v{c} & {\tt skudlac@pobox.sk} & up-to-date \\ \hline diff --git a/doc/language.tpl b/doc/language.tpl index a0dc352..fcf6da0 100644 --- a/doc/language.tpl +++ b/doc/language.tpl @@ -62,8 +62,8 @@ Just follow these steps: defines which language translators will be compiled into doxygen executable. It is a kind of configuration file. If you are sure that you do not need some of the languages, you can remove (comment out) - definitions of symbols for the languages, or you can say \c #undef - instead of \c #define for them. + definitions of symbols for the languages, or you can say \c \#undef + instead of \c \#define for them.
  • Edit language.cpp: Add a \verbatim @@ -93,7 +93,7 @@ Just follow these steps:
  • Edit translator_xx.h:
    • Rename TRANSLATOR_EN_H to TRANSLATOR_XX_H - twice (i.e. in the \c #ifndef and \c #define preprocessor commands at + twice (i.e. in the \c \#ifndef and \c \#define preprocessor commands at the beginning of the file).
    • Rename TranslatorEnglish to TranslatorYourLanguage
    • In the member idLanguage() change "english" into the diff --git a/doc/maintainers.txt b/doc/maintainers.txt index 4673c16..44f387c 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -4,6 +4,9 @@ Brazilian Fabio "FJTC" Jun Takada Chino: chino@icmc.sc.usp.br +Catalan +Albert Mora: amora@iua.upf.es + Chinese Wei Liu: liuwei@asiainfo.com Wang Weihan: wangweihan@capinfo.com.cn diff --git a/doc/starting.doc b/doc/starting.doc index 85341e3..39bb117 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -42,10 +42,10 @@ recursively scanned. To simplify the creation of a configuration file, doxygen can create a template configuration file for you. To do this call \c doxygen with the \c -g option: - \verbatim doxygen -g \endverbatim + where \ is the name of the configuration file. If you omit the file name, a file named \c Doxyfile will be created. If a file with the name \ already exists, doxygen will rename it to diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index efa0314..ff9d860 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,6 +1,6 @@ Summary: A documentation system for C/C++. Name: doxygen -Version: 1.2.17_20020811 +Version: 1.2.17_20020825 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index d8be5e5..2d4864f 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -433,11 +433,7 @@ void ClassDef::internalInsertMember(MemberDef *md, enumValMembers.append(md); break; case MemberDef::Function: - if (md->name()==localName() || // constructor - (md->name().find('~')!=-1 && // hack to detect destructor - md->name().find("operator")==-1 - ) - ) + if (md->isConstructor() || md->isDestructor()) { constructors.append(md); } diff --git a/src/config.l b/src/config.l index 7c8865c..86b11eb 100644 --- a/src/config.l +++ b/src/config.l @@ -1247,7 +1247,7 @@ void Config::create() "documentation generated by doxygen is written. Doxygen will use this \n" "information to generate all constant output in the proper language. \n" "The default language is English, other supported languages are: \n" - "Brazilian, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, \n" + "Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, \n" "Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en \n" "(Japanese with english messages), Korean, Norwegian, Polish, Portuguese, \n" "Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish and Ukrainian.\n", @@ -1256,6 +1256,9 @@ void Config::create() #ifdef LANG_BR ce->addValue("Brazilian"); #endif +#ifdef LANG_CA + ce->addValue("Catalan"); +#endif #ifdef LANG_CN ce->addValue("Chinese"); #endif @@ -1377,6 +1380,14 @@ void Config::create() "overviews. This option has no effect if EXTRACT_ALL is enabled. \n", FALSE ); + cb = addBool( + "HIDE_FRIEND_COMPOUNDS", + "If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n" + "friend (class|struct|union) declarations. \n" + "If set to NO (the default) these declarations will be included in the \n" + "documentation. \n", + FALSE + ); cb = addBool( "BRIEF_MEMBER_DESC", "If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n" diff --git a/src/definition.cpp b/src/definition.cpp index 1e7652b..75de348 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -55,7 +55,6 @@ Definition::Definition(const char *df,int dl, m_partOfGroups=0; m_specialListItems=0; m_briefLine=1; - m_docFile=1; } Definition::~Definition() diff --git a/src/doc.l b/src/doc.l index 23b96ec..009cfb2 100644 --- a/src/doc.l +++ b/src/doc.l @@ -982,7 +982,7 @@ static void checkArgName(const QCString &name,bool isParam) * @retval TRUE if name was found. * @retval FALSE if name was not found. */ -bool findDocsForMemberOrCompound(const char *commandName, +static bool findDocsForMemberOrCompound(const char *commandName, QCString *pDoc, Definition **pDef) { @@ -1919,11 +1919,16 @@ LINKMASK [a-z_A-Z0-9:#.,~&*/\[\]<>()\-\+]+({B}*("const"|"volatile"))? QCString secName=&yytext[8]; secName=secName.left(secName.length()-1); SectionInfo *sec; + //printf("secName=%s\n",secName.data()); if ((sec=Doxygen::sectionDict[secName])) { //printf("writeAnchor %s_%s\n",sec->fileName.data(),sec->label.data()); outDoc->writeAnchor(sec->fileName,sec->label); } + else + { + //printf("Section %s not found!\n",secName.data()); + } } "\\_internalref"{B}+ { // for internal use only! internalRefFile.resize(0); @@ -2128,6 +2133,7 @@ LINKMASK [a-z_A-Z0-9:#.,~&*/\[\]<>()\-\+]+({B}*("const"|"volatile"))? } \n { writeImage(IT_RTF,0); + BEGIN(DocScan); } \"[^\n"]*\" { curImageCaption=stripQuotes(yytext); @@ -2947,64 +2953,68 @@ void parseDoc(OutputDocInterface &od,const char *fileName,int startLine, const char *clName,MemberDef *md,const QCString &docStr) { + //printf("parseDoc doc=`%s'\n",docStr.data()); + if (Debug::isFlagSet(Debug::Validate)) { od.parseDoc(fileName,startLine,clName,md,docStr); } - - strcpy(yyFileName,fileName); - yyLineNr = startLine; - - QCString docString=docStr; - resolveCopyDocCommands(clName,docString); - - yyLineNr = startLine; - //printf("parseDoc(file=`%s',line=%d)\n",fileName,startLine); - initParser(); - initParseCodeContext(); - exampleDoc=FALSE; // do not cross reference with member docs - className=clName; - memberDef = md; - hasParamCommand = FALSE; - paramsFound.setAutoDelete(FALSE); - paramsFound.clear(); - parseDocument(od,docString); - - if (md && hasParamCommand && Config_getBool("WARN_IF_UNDOCUMENTED")) + else { - ArgumentList *al=memberDef->isDocsForDefinition() ? - memberDef->argumentList() : - memberDef->declArgumentList(); - if (al) + strcpy(yyFileName,fileName); + yyLineNr = startLine; + + QCString docString=docStr; + resolveCopyDocCommands(clName,docString); + + yyLineNr = startLine; + //printf("parseDoc(file=`%s',line=%d)\n",fileName,startLine); + initParser(); + initParseCodeContext(); + exampleDoc=FALSE; // do not cross reference with member docs + className=clName; + memberDef = md; + hasParamCommand = FALSE; + paramsFound.setAutoDelete(FALSE); + paramsFound.clear(); + parseDocument(od,docString); + + if (md && hasParamCommand && Config_getBool("WARN_IF_UNDOCUMENTED")) { - ArgumentListIterator ali(*al); - Argument *a; - bool found=FALSE; - for (ali.toFirst();(a=ali.current());++ali) - { - QCString argName = memberDef->isDefine() ? a->type : a->name; - if (argName.right(3)=="...") argName=argName.left(argName.length()-3); - if (!argName.isEmpty() && paramsFound.find(argName)==0) - { - found = TRUE; - break; - } - } - if (found) + ArgumentList *al=memberDef->isDocsForDefinition() ? + memberDef->argumentList() : + memberDef->declArgumentList(); + if (al) { - QCString scope=memberDef->getScopeString(); - if (!scope.isEmpty()) scope+="::"; else scope=""; - warn(memberDef->docFile(),memberDef->docLine(), - "Warning: The following parameters of " - "%s%s%s are not documented:", - scope.data(),memberDef->name().data(), - argListToString(al).data()); + ArgumentListIterator ali(*al); + Argument *a; + bool found=FALSE; for (ali.toFirst();(a=ali.current());++ali) { - QCString argName = memberDef->isDefine() ? a->type : a->name; + QCString argName = memberDef->isDefine() ? a->type : a->name; + if (argName.right(3)=="...") argName=argName.left(argName.length()-3); if (!argName.isEmpty() && paramsFound.find(argName)==0) { - warn_cont( " parameter %s\n",argName.data()); + found = TRUE; + break; + } + } + if (found) + { + QCString scope=memberDef->getScopeString(); + if (!scope.isEmpty()) scope+="::"; else scope=""; + warn(memberDef->docFile(),memberDef->docLine(), + "Warning: The following parameters of " + "%s%s%s are not documented:", + scope.data(),memberDef->name().data(), + argListToString(al).data()); + for (ali.toFirst();(a=ali.current());++ali) + { + QCString argName = memberDef->isDefine() ? a->type : a->name; + if (!argName.isEmpty() && paramsFound.find(argName)==0) + { + warn_cont( " parameter %s\n",argName.data()); + } } } } diff --git a/src/docparser.cpp b/src/docparser.cpp index da1d808..9502eeb 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "doxygen.h" #include "debug.h" @@ -40,11 +41,18 @@ //--------------------------------------------------------------------------- +// include file state +static QCString g_includeFileText; +static uint g_includeFileOffset; +static uint g_includeFileLength; + +// parser state static QCString g_context; static bool g_inSeeBlock; static bool g_insideHtmlLink; static QStack g_nodeStack; static QStack g_styleStack; +static QList g_copyStack; struct DocParserContext { @@ -53,6 +61,7 @@ struct DocParserContext bool insideHtmlLink; QStack nodeStack; QStack styleStack; + QList copyStack; }; static QStack g_parserStack; @@ -63,22 +72,24 @@ static void docParserPushContext() { doctokenizerYYpushContext(); DocParserContext *ctx = new DocParserContext; - ctx->context = g_context; - ctx->inSeeBlock = g_inSeeBlock; + ctx->context = g_context; + ctx->inSeeBlock = g_inSeeBlock; ctx->insideHtmlLink = g_insideHtmlLink; - ctx->nodeStack = g_nodeStack; - ctx->styleStack = g_styleStack; + ctx->nodeStack = g_nodeStack; + ctx->styleStack = g_styleStack; + ctx->copyStack = g_copyStack; g_parserStack.push(ctx); } static void docParserPopContext() { DocParserContext *ctx = g_parserStack.pop(); - g_context = ctx->context; - g_inSeeBlock = ctx->inSeeBlock; + g_context = ctx->context; + g_inSeeBlock = ctx->inSeeBlock; g_insideHtmlLink = ctx->insideHtmlLink; - g_nodeStack = ctx->nodeStack; - g_styleStack = ctx->styleStack; + g_nodeStack = ctx->nodeStack; + g_styleStack = ctx->styleStack; + g_copyStack = ctx->copyStack; delete ctx; doctokenizerYYpopContext(); } @@ -171,6 +182,112 @@ static bool insideLang(DocNode *n) //--------------------------------------------------------------------------- +/*! Looks for a documentation block with name commandName in the current + * context (g_context). The resulting documentation string is + * put in pDoc, the definition in which the documentation was found is + * put in pDef. + * @retval TRUE if name was found. + * @retval FALSE if name was not found. + */ +static bool findDocsForMemberOrCompound(const char *commandName, + QCString *pDoc, + Definition **pDef) +{ + pDoc->resize(0); + *pDef=0; + QCString cmdArg=commandName; + int l=cmdArg.length(); + if (l==0) return FALSE; + + int funcStart=cmdArg.find('('); + if (funcStart==-1) funcStart=l; + //int lastScopeStart=cmdArg.findRev("::",funcStart); + //int lastScopeEnd = lastScopeStart==-1 ? 0 : lastScopeStart+2; + //QCString scope=cmdArg.left(QMAX(lastScopeStart,0)); + //QCString name=cmdArg.mid(lastScopeEnd,funcStart-lastScopeEnd); + QCString name=cmdArg.left(funcStart); + QCString args=cmdArg.right(l-funcStart); + + // try if the link is to a member + MemberDef *md=0; + ClassDef *cd=0; + FileDef *fd=0; + NamespaceDef *nd=0; + GroupDef *gd=0; + PageInfo *pi=0; + bool found = getDefs(g_context,name,args,md,cd,fd,nd,gd,FALSE,0,TRUE); + if (found && md) + { + *pDoc=md->documentation(); + *pDef=md; + return TRUE; + } + + + int scopeOffset=g_context.length(); + do // for each scope + { + QCString fullName=cmdArg; + if (scopeOffset>0) + { + fullName.prepend(g_context.left(scopeOffset)+"::"); + } + //printf("Trying fullName=`%s'\n",fullName.data()); + + // try class, namespace, group, page, file reference + cd = Doxygen::classSDict[fullName]; + if (cd) // class + { + *pDoc=cd->documentation(); + *pDef=cd; + return TRUE; + } + nd = Doxygen::namespaceSDict[fullName]; + if (nd) // namespace + { + *pDoc=nd->documentation(); + *pDef=nd; + return TRUE; + } + gd = Doxygen::groupSDict[cmdArg]; + if (gd) // group + { + *pDoc=gd->documentation(); + *pDef=gd; + return TRUE; + } + pi = Doxygen::pageSDict->find(cmdArg); + if (pi) // page + { + *pDoc=pi->doc; + *pDef=(Definition *)pi; + return TRUE; + } + bool ambig; + fd = findFileDef(Doxygen::inputNameDict,cmdArg,ambig); + if (fd && !ambig) // file + { + *pDoc=fd->documentation(); + *pDef=fd; + return TRUE; + } + + if (scopeOffset==0) + { + scopeOffset=-1; + } + else + { + scopeOffset = g_context.findRev("::",scopeOffset-1); + if (scopeOffset==-1) scopeOffset=0; + } + } while (scopeOffset>=0); + + + return FALSE; +} +//--------------------------------------------------------------------------- + // forward declaration static bool defaultHandleToken(DocNode *parent,int tok, QList &children,bool @@ -422,7 +539,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList &children tokToString(tok),tokenName.data(),doctokenizerYYlineno); break; } - DocAnchor *anchor = new DocAnchor(parent,g_token->name); + DocAnchor *anchor = new DocAnchor(parent,g_token->name,FALSE); children.append(anchor); } break; @@ -657,6 +774,10 @@ static int internalValidatingParseDoc(DocNode *parent,QList &children, children.append(par); lastPar=par; } + else + { + delete par; + } } while (retval==TK_NEWPARA); if (lastPar) lastPar->markLast(); @@ -665,6 +786,231 @@ static int internalValidatingParseDoc(DocNode *parent,QList &children, //--------------------------------------------------------------------------- +static void readTextFileByName(const QCString &file,QCString &text) +{ + bool ambig; + FileDef *fd; + if ((fd=findFileDef(Doxygen::exampleNameDict,file,ambig))) + { + text = fileToString(fd->absFilePath()); + } + else if (ambig) + { + printf("Error: included file name %s at line %d is ambigious.\n" + "Possible candidates:\n%s",file.data(),doctokenizerYYlineno, + showFileDefMatches(Doxygen::exampleNameDict,file).data() + ); + } + else + { + printf("Error: included file %s at line %d is not found. " + "Check you EXAMPLE_PATH",file.data(),doctokenizerYYlineno); + } +} + +//--------------------------------------------------------------------------- + +DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) + : m_parent(parent) +{ + if (id.isEmpty()) + { + printf("Error: Empty anchor label at line %d!\n",doctokenizerYYlineno); + } + if (newAnchor) // found + { + m_anchor = id; + } + else // found \anchor label + { + SectionInfo *sec = Doxygen::sectionDict[id]; + if (sec) + { + m_file = sec->fileName; + m_anchor = sec->label; + } + else + { + printf("Error: Invalid anchor id `%s' at line %d\n",id.data(),doctokenizerYYlineno); + } + } +} + +//--------------------------------------------------------------------------- + +void DocInclude::parse() +{ + switch(m_type) + { + case Include: + // fall through + case DontInclude: + readTextFileByName(m_file,m_text); + g_includeFileText = m_text; + g_includeFileOffset = 0; + g_includeFileLength = m_text.length(); + break; + case VerbInclude: + // fall through + case HtmlInclude: + readTextFileByName(m_file,m_text); + break; + } +} + +//--------------------------------------------------------------------------- + +void DocIncOperator::parse() +{ + const char *p = g_includeFileText; + uint l = g_includeFileLength; + uint o = g_includeFileOffset; + //printf("DocIncOperator::parse() text=%s off=%d len=%d\n",p,o,l); + uint so = o,bo; + bool nonEmpty = FALSE; + switch(type()) + { + case Line: + while (oname(); + g_styleStack.clear(); + g_nodeStack.clear(); + g_copyStack.append(def); + internalValidatingParseDoc(this,m_children,doc); + ASSERT(g_copyStack.remove(def)); + ASSERT(g_styleStack.isEmpty()); + ASSERT(g_nodeStack.isEmpty()); + docParserPopContext(); + } + else // oops, recursion + { + printf("Error: recursive call chain of \\copydoc commands detected at %d\n", + doctokenizerYYlineno); + } + } + else + { + printf("Error: target %s of \\copydoc command at line %d not found\n", + m_link.data(),doctokenizerYYlineno); + } +} + +//--------------------------------------------------------------------------- + void DocXRefItem::parse() { QCString listName; @@ -765,6 +1111,28 @@ void DocSecRefItem::parse() } doctokenizerYYsetStatePara(); handlePendingStyleCommands(this,m_children); + + SectionInfo *sec=0; + if (!m_target.isEmpty()) + { + sec=Doxygen::sectionDict[m_target]; + if (sec) + { + m_file = sec->fileName; + m_anchor = sec->label; + } + else + { + printf("Error reference to unknown section %s at line %d\n", + m_target.data(),doctokenizerYYlineno); + } + } + else + { + printf("Error reference to empty target at line %d\n", + doctokenizerYYlineno); + } + DBG(("DocSecRefItem::parse() end\n")); DocNode *n = g_nodeStack.pop(); ASSERT(n==this); @@ -817,6 +1185,10 @@ void DocSecRefList::parse() goto endsecreflist; } } + else if (tok==TK_WHITESPACE) + { + // ignore whitespace + } else { printf("Error: Unexpected token %s inside section reference list at line %d\n", @@ -1094,9 +1466,47 @@ void DocDotFile::parse() } } } + tok=doctokenizerYYlex(); + while (tok==TK_WORD) // there are values following the title + { + if (g_token->name=="width") + { + m_width=g_token->chars; + } + else if (g_token->name=="height") + { + m_height=g_token->chars; + } + else + { + printf("Error: Unknown option %s after image title at line %d\n", + g_token->name.data(),doctokenizerYYlineno); + } + tok=doctokenizerYYlex(); + } + ASSERT(tok==0); doctokenizerYYsetStatePara(); - handlePendingStyleCommands(this,m_children); + + bool ambig; + FileDef *fd = findFileDef(Doxygen::dotFileNameDict,m_name,ambig); + if (fd) + { + m_file = fd->absFilePath(); + } + else if (ambig) + { + printf("Error: included dot file name %s at line %d is ambigious.\n" + "Possible candidates:\n%s",m_name.data(),doctokenizerYYlineno, + showFileDefMatches(Doxygen::exampleNameDict,m_name).data() + ); + } + else + { + printf("Error: included dot file %s at line %d is not found " + "in any of the paths specified via DOTFILE_DIRS!",m_name.data(),doctokenizerYYlineno); + } + DBG(("DocDotFile::parse() end\n")); DocNode *n=g_nodeStack.pop(); ASSERT(n==this); @@ -1133,6 +1543,25 @@ void DocImage::parse() } } } + tok=doctokenizerYYlex(); + while (tok==TK_WORD) // there are values following the title + { + if (g_token->name=="width") + { + m_width=g_token->chars; + } + else if (g_token->name=="height") + { + m_height=g_token->chars; + } + else + { + printf("Error: Unknown option %s after image title at line %d\n", + g_token->name.data(),doctokenizerYYlineno); + } + tok=doctokenizerYYlex(); + } + ASSERT(tok==0); doctokenizerYYsetStatePara(); handlePendingStyleCommands(this,m_children); @@ -1300,6 +1729,10 @@ int DocInternal::parse() m_children.append(par); lastPar=par; } + else + { + delete par; + } if (retval==TK_LISTITEM) { printf("Error: Invalid list item found at line %d!\n",doctokenizerYYlineno); @@ -1473,6 +1906,9 @@ int DocHtmlRow::parse() DBG(("DocHtmlRow::parse() start\n")); bool isHeading=FALSE; + bool isFirst=TRUE; + DocHtmlCell *cell=0; + // get next token int tok=doctokenizerYYlex(); // skip whitespace @@ -1511,12 +1947,15 @@ int DocHtmlRow::parse() // parse one or more cells do { - DocHtmlCell *td=new DocHtmlCell(this,isHeading); - m_children.append(td); - retval=td->parse(); + cell=new DocHtmlCell(this,isHeading); + cell->markFirst(isFirst); + isFirst=FALSE; + m_children.append(cell); + retval=cell->parse(); isHeading = retval==RetVal_TableHCell; } while (retval==RetVal_TableCell || retval==RetVal_TableHCell); + if (cell) cell->markLast(TRUE); endrow: DBG(("DocHtmlRow::parse() end\n")); @@ -2089,6 +2528,7 @@ int DocParamSect::parse(const QCString &cmdName) //-------------------------------------------------------------------------- + int DocPara::handleSimpleSection(DocSimpleSect::Type t) { DocSimpleSect *ss=0; @@ -2168,8 +2608,30 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type tokToString(tok),cmdName.data(),doctokenizerYYlineno); return; } - DocIncOperator *op = new DocIncOperator(this,t,g_token->name); + DocIncOperator *op = new DocIncOperator(this,t,g_token->name,g_context); + DocNode *n1 = m_children.last(); + DocNode *n2 = n1!=0 ? m_children.prev() : 0; + bool isFirst = n1==0 || // no last node + (n1->kind()!=DocNode::Kind_IncOperator && + n1->kind()!=DocNode::Kind_WhiteSpace + ) || // last node is not operator or whitespace + (n1->kind()==DocNode::Kind_WhiteSpace && + n2!=0 && n2->kind()!=DocNode::Kind_IncOperator + ); // previous not is not operator + op->markFirst(isFirst); + op->markLast(TRUE); + if (n1!=0 && n1->kind()==DocNode::Kind_IncOperator) + { + ((DocIncOperator *)n1)->markLast(FALSE); + } + else if (n1!=0 && n1->kind()==DocNode::Kind_WhiteSpace && + n2!=0 && n2->kind()==DocNode::Kind_IncOperator + ) + { + ((DocIncOperator *)n2)->markLast(FALSE); + } m_children.append(op); + op->parse(); } void DocPara::handleImage(const QCString &cmdName) @@ -2365,8 +2827,9 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t) tokToString(tok),cmdName.data(),doctokenizerYYlineno); return; } - DocInclude *inc = new DocInclude(this,g_token->name,t); + DocInclude *inc = new DocInclude(this,g_token->name,g_context,t); m_children.append(inc); + inc->parse(); } @@ -2594,7 +3057,7 @@ int DocPara::handleCommand(const QCString &cmdName) tokToString(tok),cmdName.data(),doctokenizerYYlineno); break; } - DocAnchor *anchor = new DocAnchor(this,g_token->name); + DocAnchor *anchor = new DocAnchor(this,g_token->name,FALSE); m_children.append(anchor); } break; @@ -2632,6 +3095,7 @@ int DocPara::handleCommand(const QCString &cmdName) } DocCopy *cpy = new DocCopy(this,g_token->name); m_children.append(cpy); + cpy->parse(); } break; case CMD_INCLUDE: @@ -2830,7 +3294,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const QList... +/*! @brief Node representing an anchor */ class DocAnchor : public DocNode { public: - DocAnchor(DocNode *parent,const QCString &anchor) : - m_parent(parent), m_anchor(anchor) {} + DocAnchor(DocNode *parent,const QCString &id,bool newAnchor); Kind kind() const { return Kind_Anchor; } DocNode *parent() const { return m_parent; } QCString anchor() const { return m_anchor; } + QCString file() const { return m_file; } void accept(DocVisitor *v) { v->visit(this); } private: DocNode *m_parent; QCString m_anchor; + QCString m_file; }; -/*! Node representing a style change */ +/*! @brief Node representing a style change */ class DocStyleChange : public DocNode { public: @@ -258,7 +258,7 @@ class DocStyleChange : public DocNode bool m_enable; }; -/*! Node representing a special symbol */ +/*! @brief Node representing a special symbol */ class DocSymbol : public DocNode { public: @@ -281,7 +281,7 @@ class DocSymbol : public DocNode char m_letter; }; -/*! Node representing some amount of white space */ +/*! @brief Node representing some amount of white space */ class DocWhiteSpace : public DocNode { public: @@ -296,8 +296,7 @@ class DocWhiteSpace : public DocNode QCString m_chars; }; -/*! Verbatim, unparsed text fragment */ -// TODO: parse code +/*! @brief Node representing a verbatim, unparsed text fragment */ class DocVerbatim : public DocNode { public: @@ -319,65 +318,64 @@ class DocVerbatim : public DocNode Type m_type; }; -/*! "to be copied" documentation block */ -// TODO: Find the matching block and insert it. -// (This should be a separate pass, or can we do it in one pass?). -class DocCopy : public DocNode -{ - public: - DocCopy(DocNode *parent,const QCString &link) : - m_parent(parent), m_link(link) {} - Kind kind() const { return Kind_Copy; } - QCString link() const { return m_link; } - DocNode *parent() const { return m_parent; } - void accept(DocVisitor *v) { v->visit(this); } - - private: - DocNode *m_parent; - QCString m_link; -}; - -/*! include/dontinclude block */ -// TODO: locate the file and handle it. +/*! @brief Node representing an included text block from file */ class DocInclude : public DocNode { public: enum Type { Include, DontInclude, VerbInclude, HtmlInclude }; - DocInclude(DocNode *parent,const QCString &file,Type t) : - m_parent(parent), m_file(file), m_type(t) {} - Kind kind() const { return Kind_Include; } - QCString file() const { return m_file; } - Type type() const { return m_type; } - DocNode *parent() const { return m_parent; } + DocInclude(DocNode *parent,const QCString &file, + const QCString context, Type t) : + m_parent(parent), m_file(file), m_context(context), m_type(t) {} + Kind kind() const { return Kind_Include; } + QCString file() const { return m_file; } + Type type() const { return m_type; } + QCString text() const { return m_text; } + QCString context() const { return m_context; } + DocNode *parent() const { return m_parent; } void accept(DocVisitor *v) { v->visit(this); } + void parse(); private: DocNode *m_parent; QCString m_file; + QCString m_context; + QCString m_text; Type m_type; }; -/*! include/dontinclude operator block */ -// TODO: check which file we should be working on and do the operation +/*! @brief Node representing a include/dontinclude operator block */ class DocIncOperator : public DocNode { public: enum Type { Line, SkipLine, Skip, Until }; - DocIncOperator(DocNode *parent,Type t,const QCString &pat) : - m_parent(parent), m_type(t), m_pattern(pat) {} + DocIncOperator(DocNode *parent,Type t,const QCString &pat, + const QCString &context) : + m_parent(parent), m_type(t), m_pattern(pat), m_context(context), + m_isFirst(FALSE), m_isLast(FALSE) {} Kind kind() const { return Kind_IncOperator; } Type type() const { return m_type; } + QCString text() const { return m_text; } QCString pattern() const { return m_pattern; } + QCString context() const { return m_context; } DocNode *parent() const { return m_parent; } void accept(DocVisitor *v) { v->visit(this); } + void parse(); + bool isFirst() const { return m_isFirst; } + bool isLast() const { return m_isLast; } + void markFirst(bool v=TRUE) { m_isFirst = v; } + void markLast(bool v=TRUE) { m_isLast = v; } private: DocNode *m_parent; Type m_type; + QCString m_text; QCString m_pattern; + QCString m_context; + bool m_isFirst; + bool m_isLast; }; -/*! Item of a cross-referenced list */ +/*! @brief Node representing an item of a cross-referenced list */ class DocFormula : public DocNode { public: @@ -396,7 +394,24 @@ class DocFormula : public DocNode //----------------------------------------------------------------------- -/*! Node representing a entry in the index. */ +/*! @brief Node representing a entry in the index. */ +class DocCopy : public CompAccept, public DocNode +{ + public: + DocCopy(DocNode *parent,const QCString &link) + : m_parent(parent), m_link(link) { } + Kind kind() const { return Kind_IndexEntry; } + QCString link() const { return m_link; } + void parse(); + DocNode *parent() const { return m_parent; } + void accept(DocVisitor *v) { CompAccept::accept(this,v); } + + private: + DocNode *m_parent; + QCString m_link; +}; + +/*! @brief Node representing a entry in the index. */ class DocIndexEntry : public CompAccept, public DocNode { public: @@ -410,7 +425,7 @@ class DocIndexEntry : public CompAccept, public DocNode DocNode *m_parent; }; -/*! Auto List */ +/*! @brief Node representing an auto List */ class DocAutoList : public CompAccept, public DocNode { public: @@ -430,7 +445,7 @@ class DocAutoList : public CompAccept, public DocNode }; -/*! Simple section title */ +/*! @brief Node representing a simple section title */ class DocTitle : public CompAccept, public DocNode { public: @@ -444,7 +459,7 @@ class DocTitle : public CompAccept, public DocNode DocNode *m_parent; }; -/*! Item of a cross-referenced list */ +/*! @brief Node representing an item of a cross-referenced list */ class DocXRefItem : public CompAccept, public DocNode { public: @@ -469,44 +484,56 @@ class DocXRefItem : public CompAccept, public DocNode QCString m_title; }; -/*! Image */ +/*! @brief Node representing an image */ class DocImage : public CompAccept, public DocNode { public: enum Type { Html, Latex, Rtf }; DocImage(DocNode *parent,const QCString &name,Type t) : m_parent(parent), m_name(name), m_type(t) {} - void parse(); - Kind kind() const { return Kind_Image; } - Type type() const { return m_type; } - QCString name() const { return m_name; } - DocNode *parent() const { return m_parent; } + Kind kind() const { return Kind_Image; } + Type type() const { return m_type; } + QCString name() const { return m_name; } + DocNode *parent() const { return m_parent; } + bool hasCaption() const { return !m_children.isEmpty(); } + QCString width() const { return m_width; } + QCString height() const { return m_height; } void accept(DocVisitor *v) { CompAccept::accept(this,v); } + void parse(); private: DocNode *m_parent; QCString m_name; Type m_type; + QCString m_width; + QCString m_height; }; -/*! Node representing a dot file */ +/*! @brief Node representing a dot file */ class DocDotFile : public CompAccept, public DocNode { public: DocDotFile(DocNode *parent,const QCString &name) : m_parent(parent), m_name(name) { } void parse(); - Kind kind() const { return Kind_DotFile; } - QCString name() const { return m_name; } - DocNode *parent() const { return m_parent; } + Kind kind() const { return Kind_DotFile; } + QCString name() const { return m_name; } + QCString file() const { return m_file; } + bool hasCaption() const { return !m_children.isEmpty(); } + QCString width() const { return m_width; } + QCString height() const { return m_height; } + DocNode *parent() const { return m_parent; } void accept(DocVisitor *v) { CompAccept::accept(this,v); } private: DocNode *m_parent; QCString m_name; + QCString m_file; + QCString m_width; + QCString m_height; }; -/*! Node representing a link to some item */ +/*! @brief Node representing a link to some item */ class DocLink : public CompAccept, public DocNode { public: @@ -526,7 +553,7 @@ class DocLink : public CompAccept, public DocNode QCString m_anchor; }; -/*! Node representing a reference to some item */ +/*! @brief Node representing a reference to some item */ class DocRef : public CompAccept, public DocNode { public: @@ -553,7 +580,7 @@ class DocRef : public CompAccept, public DocNode QCString m_text; }; -/*! Node representing an internal reference to some item */ +/*! @brief Node representing an internal reference to some item */ class DocInternalRef : public CompAccept, public DocNode { public: @@ -571,7 +598,7 @@ class DocInternalRef : public CompAccept, public DocNode QCString m_anchor; }; -/*! Language specific node */ +/*! @brief Node representing a Language specific section */ class DocLanguage : public CompAccept, public DocNode { public: @@ -588,7 +615,7 @@ class DocLanguage : public CompAccept, public DocNode QCString m_id; }; -/*! Hypertext reference */ +/*! @brief Node representing a Hypertext reference */ class DocHRef : public CompAccept, public DocNode { public: @@ -605,7 +632,7 @@ class DocHRef : public CompAccept, public DocNode QCString m_url; }; -/*! Html heading */ +/*! @brief Node Html heading */ class DocHtmlHeader : public CompAccept, public DocNode { public: @@ -622,7 +649,7 @@ class DocHtmlHeader : public CompAccept, public DocNode int m_level; }; -/*! Html description item */ +/*! @brief Node representing a Html description item */ class DocHtmlDescTitle : public CompAccept, public DocNode { public: @@ -636,7 +663,7 @@ class DocHtmlDescTitle : public CompAccept, public DocNode DocNode * m_parent; }; -/*! Html description list */ +/*! @brief Node representing a Html description list */ class DocHtmlDescList : public CompAccept, public DocNode { public: @@ -650,43 +677,53 @@ class DocHtmlDescList : public CompAccept, public DocNode DocNode * m_parent; }; -/*! Normal section */ +/*! @brief Node representing a normal section */ class DocSection : public CompAccept, public DocNode { public: DocSection(DocNode *parent,int level,const QCString &id) : m_parent(parent), m_level(level), m_id(id) {} - int parse(); - Kind kind() const { return Kind_Section; } - int level() const { return m_level; } - QCString id() const { return m_id; } - DocNode *parent() const { return m_parent; } + Kind kind() const { return Kind_Section; } + int level() const { return m_level; } + QCString title() const { return m_title; } + QCString anchor() const { return m_anchor; } + QCString id() const { return m_id; } + QCString file() const { return m_file; } + DocNode *parent() const { return m_parent; } void accept(DocVisitor *v) { CompAccept::accept(this,v); } + int parse(); private: DocNode *m_parent; int m_level; QCString m_id; + QCString m_title; + QCString m_anchor; + QCString m_file; }; -/*! Reference to a section */ +/*! @brief Node representing a reference to a section */ class DocSecRefItem : public CompAccept, public DocNode { public: DocSecRefItem(DocNode *parent,const QCString &target) : m_parent(parent), m_target(target) {} - void parse(); - Kind kind() const { return Kind_SecRefItem; } - QCString target() const { return m_target; } - DocNode *parent() const { return m_parent; } + Kind kind() const { return Kind_SecRefItem; } + QCString target() const { return m_target; } + QCString file() const { return m_file; } + QCString anchor() const { return m_anchor; } + DocNode *parent() const { return m_parent; } void accept(DocVisitor *v) { CompAccept::accept(this,v); } + void parse(); private: DocNode *m_parent; QCString m_target; + QCString m_file; + QCString m_anchor; }; -/*! List of section references */ +/*! @brief Node representing a list of section references */ class DocSecRefList : public CompAccept, public DocNode { public: @@ -700,9 +737,7 @@ class DocSecRefList : public CompAccept, public DocNode DocNode *m_parent; }; -/*! Internal section of documentation */ -// TODO: decide if it should be visible -// Separate pass to remove internal parts? +/*! @brief Node representing an internal section of documentation */ class DocInternal : public CompAccept, public DocNode { public: @@ -716,7 +751,7 @@ class DocInternal : public CompAccept, public DocNode DocNode *m_parent; }; -/*! Simple list */ +/*! @brief Node representing a simple list */ class DocSimpleList : public CompAccept, public DocNode { public: @@ -730,7 +765,7 @@ class DocSimpleList : public CompAccept, public DocNode DocNode *m_parent; }; -/*! Html list */ +/*! @brief Node representing a Html list */ class DocHtmlList : public CompAccept, public DocNode { public: @@ -747,7 +782,7 @@ class DocHtmlList : public CompAccept, public DocNode Type m_type; }; -/*! Simple section */ +/*! Node representing a simple section */ class DocSimpleSect : public CompAccept, public DocNode { public: @@ -770,7 +805,7 @@ class DocSimpleSect : public CompAccept, public DocNode DocTitle * m_title; }; -/*! Parameter section */ +/*! Node representing a parameter section */ class DocParamSect : public CompAccept, public DocNode { public: @@ -790,7 +825,7 @@ class DocParamSect : public CompAccept, public DocNode Type m_type; }; -/*! Paragraph in the documentation tree */ +/*! Node representing a paragraph in the documentation tree */ class DocPara : public CompAccept, public DocNode { public: @@ -820,7 +855,6 @@ class DocPara : public CompAccept, public DocNode void handleRef(const QCString &cmdName); int handleLanguageSwitch(); - private: DocNode *m_parent; QCString m_sectionId; @@ -828,7 +862,7 @@ class DocPara : public CompAccept, public DocNode bool m_isLast; }; -/*! Node representing a parameter list. */ +/*! @brief Node representing a parameter list. */ class DocParamList : public DocNode { public: @@ -853,7 +887,7 @@ class DocParamList : public DocNode QStrList m_params; }; -/*! Node representing an item of a auto list */ +/*! @brief Node representing an item of a auto list */ class DocAutoListItem : public DocNode { public: @@ -874,7 +908,7 @@ class DocAutoListItem : public DocNode DocPara *m_paragraph; }; -/*! Simple list item */ +/*! @brief Node representing a simple list item */ class DocSimpleListItem : public DocNode { public: @@ -896,7 +930,7 @@ class DocSimpleListItem : public DocNode DocPara *m_paragraph; }; -/*! Html list item */ +/*! @brief Node representing a Html list item */ class DocHtmlListItem : public CompAccept, public DocNode { public: @@ -910,7 +944,7 @@ class DocHtmlListItem : public CompAccept, public DocNode DocNode *m_parent; }; -/*! Html description data */ +/*! @brief Node representing a Html description data */ class DocHtmlDescData : public CompAccept, public DocNode { public: @@ -925,7 +959,7 @@ class DocHtmlDescData : public CompAccept, public DocNode }; -/*! Html list item */ +/*! @brief Node representing a Html list item */ class DocHtmlPre : public CompAccept, public DocNode { public: @@ -939,25 +973,31 @@ class DocHtmlPre : public CompAccept, public DocNode DocNode *m_parent; }; -/*! Html table cell */ +/*! @brief Node representing a Html table cell */ class DocHtmlCell : public CompAccept, public DocNode { public: DocHtmlCell(DocNode *parent,bool isHeading) : - m_parent(parent), m_isHeading(isHeading) {} + m_parent(parent), m_isHeading(isHeading), + m_isFirst(FALSE), m_isLast(FALSE) {} int parse(); bool isHeading() const { return m_isHeading; } + bool isFirst() const { return m_isFirst; } + bool isLast() const { return m_isLast; } Kind kind() const { return Kind_HtmlCell; } DocNode *parent() const { return m_parent; } - uint numCells() const { return m_children.count(); } void accept(DocVisitor *v) { CompAccept::accept(this,v); } + void markFirst(bool v=TRUE) { m_isFirst=v; } + void markLast(bool v=TRUE) { m_isLast=v; } private: DocNode * m_parent; bool m_isHeading; + bool m_isFirst; + bool m_isLast; }; -/*! Html table caption */ +/*! @brief Node representing a Html table caption */ class DocHtmlCaption : public CompAccept, public DocNode { public: @@ -971,7 +1011,7 @@ class DocHtmlCaption : public CompAccept, public DocNode DocNode * m_parent; }; -/*! Html table row */ +/*! @brief Node representing a Html table row */ class DocHtmlRow : public CompAccept, public DocNode { public: @@ -986,16 +1026,17 @@ class DocHtmlRow : public CompAccept, public DocNode DocNode * m_parent; }; -/*! Html table */ +/*! @brief Node representing a Html table */ class DocHtmlTable : public CompAccept, public DocNode { public: DocHtmlTable(DocNode *parent) : m_parent(parent) { m_caption=0; } - ~DocHtmlTable() { delete m_caption; } - int parse(); - Kind kind() const { return Kind_HtmlTable; } + ~DocHtmlTable() { delete m_caption; } + Kind kind() const { return Kind_HtmlTable; } DocNode *parent() const { return m_parent; } - uint numRows() const { return m_children.count(); } + uint numRows() const { return m_children.count(); } + bool hasCaption() { return m_caption!=0; } + int parse(); uint numCols() const { uint cols=0; @@ -1016,7 +1057,7 @@ class DocHtmlTable : public CompAccept, public DocNode }; -/*! Root node of documentation tree */ +/*! @brief Root node of documentation tree */ class DocRoot : public CompAccept, public DocNode { public: diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 7f43614..1ec3e44 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -235,7 +235,11 @@ OPCAST {BLANK}+[^(\r\n.,]+ OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG}) LNKWORD1 {SCOPEMASK}({FUNCARG}({BLANK}*("const"|"volatile"))?)? LNKWORD2 {SCOPEPRE}*"operator"{OPMASK} -WORD [^ \t\n\r\\@<>&$#,.]+ +WORD1 [^ \t\n\r\\@<>&$#,.]+ +WORD2 "."|"," +WORD1NQ [^ \t\n\r\\@<>&$#,."]+ +WORD2NQ "."|"," +HTMLTAG "<"(("/")?){ID}({BLANK}+{ATTRIB})*">" %option noyywrap %option yylineno @@ -243,6 +247,10 @@ WORD [^ \t\n\r\\@<>&$#,.]+ %x St_Para %x St_Comment %x St_Title +%x St_TitleN +%x St_TitleQ +%x St_TitleA +%x St_TitleV %x St_Code %x St_HtmlOnly %x St_LatexOnly @@ -317,13 +325,13 @@ WORD [^ \t\n\r\\@<>&$#,.]+ g_token->text = tagName.mid(i+1,tagName.length()-i-2); return TK_RCSTAG; } -"$("{ID}")" { /* environment variable */ +"$("{ID}")" { /* environment variable */ QCString name = &yytext[2]; name = name.left(name.length()-1); QCString value = getenv(name); for (int i=value.length()-1;i>=0;i--) unput(value.at(i)); } -"<"(("/")?){ID}({BLANK}+{ATTRIB})*">" { /* html tag */ +{HTMLTAG} { /* html tag */ g_token->name = yytext; int startNamePos=1; if (g_token->name.at(1)=='/') startNamePos++; @@ -349,11 +357,8 @@ WORD [^ \t\n\r\\@<>&$#,.]+ g_token->name = yytext; return TK_LNKWORD; } -"."|"," { - g_token->name = yytext; - return TK_WORD; - } -{WORD} { /* function call */ +{WORD1} | +{WORD2} { /* function call */ g_token->name = yytext; return TK_WORD; @@ -383,7 +388,7 @@ WORD [^ \t\n\r\\@<>&$#,.]+ {CMD}"endhtmlonly" { return RetVal_OK; } -[^\\@\n]+ | +[^\\@\n$]+ | \n | . { g_token->verb+=yytext; @@ -404,26 +409,87 @@ WORD [^ \t\n\r\\@<>&$#,.]+ . { /* Verbatim text */ g_token->verb+=yytext; } -"&"{ID}";" { /* symbol */ +"\"" { // quoted title + BEGIN(St_TitleQ); + } +[ \t]+ { + g_token->chars=yytext; + return TK_WHITESPACE; + } +. { // non-quoted title + unput(*yytext); + BEGIN(St_TitleN); + } +\n { + return 0; + } +"&"{ID}";" { /* symbol */ g_token->name = yytext; return TK_SYMBOL; } -{SPCMD1} | -{SPCMD2} { /* special command */ +{SPCMD1} | +{SPCMD2} { /* special command */ g_token->name = yytext+1; return TK_COMMAND; } -{WORD} { /* word */ +{WORD1} | +{WORD2} { /* word */ g_token->name = yytext; return TK_WORD; } -[ \t]+ { +[ \t]+ { + g_token->chars=yytext; + return TK_WHITESPACE; + } +\n { /* new line => end of title */ + unput(*yytext); + return 0; + } +"&"{ID}";" { /* symbol */ + g_token->name = yytext; + return TK_SYMBOL; + } +{SPCMD1} | +{SPCMD2} { /* special command */ + g_token->name = yytext+1; + return TK_COMMAND; + } +{WORD1NQ} | +{WORD2NQ} { /* word */ + g_token->name = yytext; + return TK_WORD; + } +[ \t]+ { g_token->chars=yytext; return TK_WHITESPACE; } -\n { /* new line => end of title */ +"\"" { /* closing quote => end of title */ + BEGIN(St_TitleA); + return 0; + } +\n { /* new line => end of title */ + unput(*yytext); return 0; } +{BLANK}*{ID}{BLANK}*"="{BLANK}* { // title attribute + g_token->name = yytext; + g_token->name = g_token->name.left( + g_token->name.find('=')).stripWhiteSpace(); + BEGIN(St_TitleV); + } +[^ \t\r\n]+ { // attribute value + g_token->chars = yytext; + BEGIN(St_TitleN); + return TK_WORD; + } +. { + unput(*yytext); + return 0; + } +\n { + return 0; + } + {ID} { g_token->name=yytext; return TK_WORD; @@ -458,8 +524,8 @@ WORD [^ \t\n\r\\@<>&$#,.]+ g_token->name = yytext+1; return TK_COMMAND; } -[^ \t\n\r\\@<&$"]+ | -[^ \t\n\r\\@<&$"]+"("[^\n")]*")"({BLANK}*("const"|"volatile"))? { +{WORD1NQ} | +{WORD2NQ} { /* word */ g_token->name = yytext; return TK_WORD; diff --git a/src/docvisitor.h b/src/docvisitor.h index b66161f..771971f 100644 --- a/src/docvisitor.h +++ b/src/docvisitor.h @@ -51,7 +51,6 @@ class DocAnchor; class DocIndexEntry; class DocInternal; class DocHRef; -class DocCopy; class DocInclude; class DocIncOperator; class DocHtmlHeader; @@ -67,6 +66,7 @@ class DocLinkedWord; class DocParamSect; class DocParamList; class DocInternalRef; +class DocCopy; /*! @brief Abstract visitor that participates in the visitor pattern. */ @@ -83,7 +83,6 @@ class DocVisitor virtual void visit(DocLineBreak *) = 0; virtual void visit(DocHorRuler *) = 0; virtual void visit(DocAnchor *) = 0; - virtual void visit(DocCopy *) = 0; virtual void visit(DocInclude *) = 0; virtual void visit(DocIncOperator *) = 0; virtual void visit(DocFormula *) = 0; @@ -158,6 +157,8 @@ class DocVisitor virtual void visitPost(DocXRefItem *) = 0; virtual void visitPre(DocInternalRef *) = 0; virtual void visitPost(DocInternalRef *) = 0; + virtual void visitPre(DocCopy *) = 0; + virtual void visitPost(DocCopy *) = 0; }; #endif diff --git a/src/dot.h b/src/dot.h index 48c631f..6c73fbf 100644 --- a/src/dot.h +++ b/src/dot.h @@ -16,6 +16,9 @@ * */ +#ifndef _DOT_H +#define _DOT_H + #include "qtbc.h" #include #include @@ -171,3 +174,4 @@ void generateGraphLegend(const char *path); void writeDotGraphFromFile(const char *inFile,const char *outDir, const char *outFile,GraphOutputFormat format); +#endif diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 95b723d..75481c9 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -199,6 +199,7 @@ static void addRelatedPage(Entry *root) { if (!g->groupname.isEmpty() && (gd=Doxygen::groupSDict[g->groupname])) break; } + //printf("addRelatedPage() %s gd=%p\n",root->name.data(),gd); addRelatedPage(root->name,root->args,root->doc,root->anchors, root->fileName,root->startLine, root->sli, @@ -1448,27 +1449,52 @@ static bool isVarWithConstructor(Entry *root) { static QRegExp initChars("[0-9\"'&*!^]+"); static QRegExp idChars("[a-z_A-Z][a-z_A-Z0-9]*"); - if (root->type.isEmpty()) return FALSE; + bool result=FALSE; + bool typeIsClass; Definition *ctx = 0; - //printf("isVarWithConstructor(%s,%s)\n",root->parent->name.data(), - // root->type.data()); + if (root->parent && root->parent->section&Entry::COMPOUND_MASK) + { // inside a class + result=FALSE; + goto done; + } + if (root->type.isEmpty()) + { + result=FALSE; + goto done; + } if (root->parent->name) ctx=Doxygen::namespaceSDict.find(root->parent->name); - bool typeIsClass=getResolvedClass(ctx,root->type)!=0; + typeIsClass=getResolvedClass(ctx,root->type)!=0; if (typeIsClass) // now we still have to check if the arguments are // types or values. Since we do not have complete type info // we need to rely on heuristics :-( { //printf("typeIsClass\n"); ArgumentList *al = root->argList; - if (al==0) return FALSE; // empty arg list -> function prototype. + if (al==0 || al->isEmpty()) + { + result=FALSE; // empty arg list -> function prototype. + goto done; + } ArgumentListIterator ali(*al); Argument *a; for (ali.toFirst();(a=ali.current());++ali) { //printf("a->name=%s a->type=%s\n",a->name.data(),a->type.data()); - if (!a->name.isEmpty() || !a->defval.isEmpty()) return FALSE; // arg has (type,name) pair -> function prototype - if (a->type.isEmpty() || getResolvedClass(ctx,a->type)!=0) return FALSE; // arg type is a known type - if (a->type.find(initChars)==0) return TRUE; // argument type starts with typical initializer char + if (!a->name.isEmpty() || !a->defval.isEmpty()) + { + result=FALSE; // arg has (type,name) pair -> function prototype + goto done; + } + if (a->type.isEmpty() || getResolvedClass(ctx,a->type)!=0) + { + result=FALSE; // arg type is a known type + goto done; + } + if (a->type.find(initChars)==0) + { + result=TRUE; // argument type starts with typical initializer char + goto done; + } QCString resType=resolveTypeDef(ctx,a->type); if (resType.isEmpty()) resType=a->type; int len; @@ -1480,14 +1506,17 @@ static bool isVarWithConstructor(Entry *root) resType=="double" || resType=="char" || resType=="signed" || resType=="const" || resType=="unsigned") { - return FALSE; // type keyword -> function prototype + result=FALSE; // type keyword -> function prototype + goto done; } } } - return TRUE; + result=TRUE; } - // return type not a class -> function prototype - return FALSE; +done: + //printf("isVarWithConstructor(%s,%s)=%d\n",root->parent->name.data(), + // root->type.data(),result); + return result; } //---------------------------------------------------------------------- @@ -3380,7 +3409,8 @@ static void computeClassRelations() bName.right(2)!="::") { if (!root->name.isEmpty() && root->name[0]!='@' && - (guessSection(root->fileName)==Entry::HEADER_SEC || Config_getBool("EXTRACT_LOCAL_CLASSES")) + (guessSection(root->fileName)==Entry::HEADER_SEC || Config_getBool("EXTRACT_LOCAL_CLASSES")) && + (root->protection!=Private || Config_getBool("EXTRACT_PRIVATE")) ) warn_undoc( root->fileName,root->startLine, @@ -3560,9 +3590,14 @@ static void addListReferences() PageInfo *pi=0; for (pdi.toFirst();(pi=pdi.current());++pdi) { + QCString name = pi->name; + if (pi->getGroupDef()) + { + name = pi->getGroupDef()->getOutputFileBase().copy(); + } addRefItem(pi->specialListItems, theTranslator->trPage(TRUE,TRUE), - pi->name,pi->title); + name,pi->title); } } @@ -5830,69 +5865,6 @@ static void findMainPage(Entry *root) //---------------------------------------------------------------------------- -///*! Search for all Java package statements -// */ -//static void buildPackageList(Entry *root) -//{ -// if (root->section == Entry::PACKAGE_SEC || root->section == Entry::PACKAGEDOC_SEC && !root->name.isEmpty()) -// { -// PackageDef *pd=0; -// if ((pd=Doxygen::packageDict.find(root->name))==0) -// { -// QCString tagName; -// if (root->tagInfo) -// { -// tagName=root->tagInfo->tagName; -// } -// pd = new PackageDef(root->fileName,root->startLine,root->name,tagName); -// Doxygen::packageDict.inSort(root->name,pd); -// pd->setDocumentation(root->doc,root->docFile,root->docLine); -// pd->setBriefDescription(root->brief,root->briefFile,root->briefLine); -// } -// else -// { -// if (!pd->documentation() && !root->doc.isEmpty()) -// { -// pd->setDocumentation(root->doc,root->docFile,root->docLine); -// } -// if (!pd->briefDescription() && !root->brief.isEmpty()) -// { -// pd->setBriefDescription(root->brief,root->briefFile,root->briefLine); -// } -// } -// bool ambig; -// FileDef *fd=findFileDef(Doxygen::inputNameDict,root->fileName,ambig); -// if (fd) -// { -// fd->setPackageDef(pd); -// } -// } -// EntryListIterator eli(*root->sublist); -// Entry *e; -// for (;(e=eli.current());++eli) -// { -// buildPackageList(e); -// } -//} - -//---------------------------------------------------------------------------- - -//---------------------------------------------------------------------------- - -/*! Add Java classes to their respective packages */ -//static void addClassesToPackages() -//{ -// ClassDef *cd; -// ClassSDict::Iterator cli(Doxygen::classSDict); -// for (;(cd=cli.current());++cli) -// { -// PackageDef *pd = cd->packageDef(); -// if (pd) pd->addClass(cd); -// } -//} - -//---------------------------------------------------------------------------- - static void resolveUserReferences() { QDictIterator sdi(Doxygen::sectionDict); @@ -5904,35 +5876,6 @@ static void resolveUserReferences() // si->fileName.data()); PageInfo *pi=0; - // if this section is in a page and the page is in a group, then we - // have to adjust the link file name to point to the group. - if (!si->fileName.isEmpty() && - (pi=Doxygen::pageSDict->find(si->fileName)) && - pi->getGroupDef()) - { - si->fileName=pi->getGroupDef()->getOutputFileBase().copy(); - } - - - if (si->definition) - { - // TODO: there should be one function in Definition that returns - // the file to link to, so we can avoid the following tests. - GroupDef *gd=0; - if (si->definition->definitionType()==Definition::TypeMember) - { - gd = ((MemberDef *)si->definition)->getGroupDef(); - } - - if (gd) - { - si->fileName=gd->getOutputFileBase().copy(); - } - else - { - si->fileName=si->definition->getOutputFileBase().copy(); - } - } // hack: the items of a todo/test/bug/deprecated list are all fragments from // different files, so the resulting section's all have the wrong file // name (not from the todo/test/bug/deprecated list, but from the file in @@ -5943,12 +5886,48 @@ static void resolveUserReferences() for (rli.toFirst();(rl=rli.current());++rli) { QCString label="_"+rl->listName(); // "_todo", "_test", ... - if (si->label==label) + if (si->label.left(label.length())==label) { + si->fileName=rl->listName(); si->generated=TRUE; break; } } + + //printf("start: si->label=%s si->fileName=%s\n",si->label.data(),si->fileName.data()); + if (!si->generated) + { + // if this section is in a page and the page is in a group, then we + // have to adjust the link file name to point to the group. + if (!si->fileName.isEmpty() && + (pi=Doxygen::pageSDict->find(si->fileName)) && + pi->getGroupDef()) + { + si->fileName=pi->getGroupDef()->getOutputFileBase().copy(); + } + + if (si->definition) + { + // TODO: there should be one function in Definition that returns + // the file to link to, so we can avoid the following tests. + GroupDef *gd=0; + if (si->definition->definitionType()==Definition::TypeMember) + { + gd = ((MemberDef *)si->definition)->getGroupDef(); + } + + if (gd) + { + si->fileName=gd->getOutputFileBase().copy(); + } + else + { + //si->fileName=si->definition->getOutputFileBase().copy(); + //printf("Setting si->fileName to %s\n",si->fileName.data()); + } + } + } + //printf("end: si->label=%s si->fileName=%s\n",si->label.data(),si->fileName.data()); } } @@ -5959,6 +5938,7 @@ static void resolveUserReferences() static void generatePageDocs() { + //printf("documentedPages=%d real=%d\n",documentedPages,Doxygen::pageSDict->count()); if (documentedPages==0) return; PageSDict::Iterator pdi(*Doxygen::pageSDict); PageInfo *pi=0; @@ -6756,9 +6736,10 @@ static int readFileOrDirectory(const char *s, if (resultList || resultDict) { rs=new QCString(fi.absFilePath()); + if (resultList) resultList->append(rs); + if (resultDict) resultDict->insert(fi.absFilePath(),rs); } - if (resultList) resultList->append(rs); - if (resultDict) resultDict->insert(fi.absFilePath(),rs); + if (killDict) killDict->insert(fi.absFilePath(),(void *)0x8); } } @@ -6858,6 +6839,7 @@ void initDoxygen() initPreprocessor(); + Doxygen::sectionDict.setAutoDelete(TRUE); } void readConfiguration(int argc, char **argv) @@ -7293,6 +7275,7 @@ void parseInput() QDict *killDict = new QDict(10007); int inputSize=0; QStrList &inputList=Config_getList("INPUT"); + inputFiles.setAutoDelete(TRUE); s=inputList.first(); while (s) { diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 758af1e..b2d3691 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -131,6 +131,7 @@ void GroupDef::addNamespace(const NamespaceDef *def) void GroupDef::addPage(PageInfo *def) { + //printf("Making page %s part of a group\n",def->name.data()); pageDict->append(def->name,def); def->makePartOfGroup(this); } diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp new file mode 100644 index 0000000..062f109 --- /dev/null +++ b/src/htmldocvisitor.cpp @@ -0,0 +1,67 @@ +/****************************************************************************** + * + * + * + * + * Copyright (C) 1997-2002 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#include "htmldocvisitor.h" + +void HtmlDocVisitor::filter(const char *str) +{ + if (str==0) return; + const char *p=str; + char c; + while (*p) + { + c=*p++; + switch(c) + { + case '<': m_t << "<"; break; + case '>': m_t << ">"; break; + case '&': m_t << "&"; break; + default: m_t << c; + } + } +} + +void HtmlDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor) +{ + QCString *dest; + if (!ref.isEmpty()) // link to entity imported via tag file + { + m_t << ""; +} + +void HtmlDocVisitor::endLink() +{ + m_t << ""; +} + diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h index 9f0f699..39956da 100644 --- a/src/htmldocvisitor.h +++ b/src/htmldocvisitor.h @@ -25,8 +25,9 @@ #include "doxygen.h" #include "outputgen.h" #include "code.h" +#include "dot.h" -/*! Concrete visitor implementation for pretty printing */ +/*! @brief Concrete visitor implementation for HTML output. */ class HtmlDocVisitor : public DocVisitor { public: @@ -34,6 +35,8 @@ class HtmlDocVisitor : public DocVisitor : m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE) {} //-------------------------------------- + // visitor functions for leaf nodes + //-------------------------------------- void visit(DocWord *w) { @@ -91,7 +94,7 @@ class HtmlDocVisitor : public DocVisitor void visit(DocURL *u) { if (m_hide) return; - m_t << "url() << "\">" << u->url() << " "; + m_t << "url() << "\">" << u->url() << ""; } void visit(DocLineBreak *) { @@ -159,39 +162,50 @@ class HtmlDocVisitor : public DocVisitor if (m_hide) return; m_t << ""; } - void visit(DocCopy *c) - { - if (m_hide) return; - // TODO - printf("",c->link().data()); - } void visit(DocInclude *inc) { if (m_hide) return; - // TODO - printf("file().data()); switch(inc->type()) { - case DocInclude::Include: printf("include"); break; - case DocInclude::DontInclude: printf("dontinclude"); break; - case DocInclude::HtmlInclude: printf("htmlinclude"); break; - case DocInclude::VerbInclude: printf("verbinclude"); break; + case DocInclude::Include: + m_t << "
      ";
      +          parseCode(m_ci,inc->context(),inc->text(),FALSE,0);
      +          m_t << "
      "; + break; + case DocInclude::DontInclude: + break; + case DocInclude::HtmlInclude: + m_t << inc->text(); + break; + case DocInclude::VerbInclude: + m_t << "
      ";
      +          filter(inc->text());
      +          m_t << "
      "; + break; } - printf("\"/>"); } void visit(DocIncOperator *op) { - if (m_hide) return; - // TODO - printf("pattern().data()); - switch(op->type()) + //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n", + // op->type(),op->isFirst(),op->isLast(),op->text().data()); + if (op->isFirst()) + { + m_t << "
      ";
      +        m_hide = TRUE;
      +      }
      +      if (op->type()!=DocIncOperator::Skip) 
      +      {
      +        parseCode(m_ci,op->context(),op->text(),FALSE,0);
      +      }
      +      if (op->isLast())  
      +      {
      +        m_hide = FALSE;
      +        m_t << "
      "; + } + else { - case DocIncOperator::Line: printf("line"); break; - case DocIncOperator::Skip: printf("skip"); break; - case DocIncOperator::SkipLine: printf("skipline"); break; - case DocIncOperator::Until: printf("until"); break; + m_t << endl; } - printf("\"/>"); } void visit(DocFormula *f) { @@ -205,9 +219,15 @@ class HtmlDocVisitor : public DocVisitor m_t << "\"middle\""; // assume Windows users use IE or HtmlHelp which on // displays formulas nicely with align == "middle" #endif - m_t << " src=\"" << f->name() << ".png\">" << endl; - if (f->text().at(0)=='\\') m_t << "

      " << endl; + m_t << " src=\"" << f->name() << ".png\">"; + if (f->text().at(0)=='\\') + m_t << endl << "

      " << endl; + else + m_t << " "; } + + //-------------------------------------- + // visitor functions for compound nodes //-------------------------------------- void visitPre(DocAutoList *l) @@ -249,15 +269,15 @@ class HtmlDocVisitor : public DocVisitor !(p->parent() && // and for parameter sections p->parent()->kind()==DocNode::Kind_ParamSect ) - ) m_t << "

      \n"; + ) m_t << "\n

      \n"; } void visitPre(DocRoot *) { - m_t << "


      New parser:

      \n"; + //m_t << "

      New parser:

      \n"; } void visitPost(DocRoot *) { - m_t << "

      Old parser:

      \n"; + //m_t << "

      Old parser:

      \n"; } void visitPre(DocSimpleSect *s) { @@ -295,12 +315,11 @@ class HtmlDocVisitor : public DocVisitor case DocSimpleSect::User: break; case DocSimpleSect::Unknown: break; } - m_t << ":"; // special case 1: user defined title if (s->type()!=DocSimpleSect::User) { - m_t << "
      "; + m_t << ":
      "; } } void visitPost(DocSimpleSect *) @@ -332,11 +351,14 @@ class HtmlDocVisitor : public DocVisitor } void visitPre(DocSection *s) { - m_t << "",s->level(); + m_t << "level()+1 << ">"; + m_t << "anchor(); + filter(s->title()); + m_t << "\"" << endl; + m_t << "level()+1 << ">\n"; } - void visitPost(DocSection *s) + void visitPost(DocSection *) { - m_t << "\n",s->level(); } void visitPre(DocHtmlList *s) { @@ -449,7 +471,7 @@ class HtmlDocVisitor : public DocVisitor } void visitPost(DocHRef *) { - m_t << "\n"; + m_t << ""; } void visitPre(DocHtmlHeader *header) { @@ -461,18 +483,68 @@ class HtmlDocVisitor : public DocVisitor } void visitPre(DocImage *img) { - m_t << "name() << "\">\n"; + if (img->type()==DocImage::Html) + { + QCString baseName=img->name(); + int i; + if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1) + { + baseName=baseName.right(baseName.length()-i-1); + } + m_t << "
      " << endl; + m_t << "name() << "\" alt=\"" + << baseName << "\">" << endl; + if (img->hasCaption()) + { + m_t << "

      "; + } + } + else // other format -> skip + { + m_hide=TRUE; + } } - void visitPost(DocImage *) + void visitPost(DocImage *img) { + if (img->type()==DocImage::Html) + { + if (img->hasCaption()) + { + m_t << "

      "; + } + m_t << "
      " << endl; + } + else // other format + { + m_hide=FALSE; + } } - void visitPre(DocDotFile *) + void visitPre(DocDotFile *df) { - // TODO + QCString baseName=df->file(); + int i; + if ((i=baseName.findRev('/'))!=-1) + { + baseName=baseName.right(baseName.length()-i-1); + } + QCString outDir = Config_getString("HTML_OUTPUT"); + writeDotGraphFromFile(df->file(),outDir,baseName,BITMAP); + m_t << "
      " << endl; + m_t << "\""" << endl; + if (df->hasCaption()) + { + m_t << "

      "; + } } - void visitPost(DocDotFile *) + void visitPost(DocDotFile *df) { - // TODO + if (df->hasCaption()) + { + m_t << "

      " << endl; + } + m_t << "
      " << endl; } void visitPre(DocLink *lnk) { @@ -490,30 +562,37 @@ class HtmlDocVisitor : public DocVisitor void visitPost(DocRef *) { endLink(); + m_t << " "; } - void visitPre(DocSecRefItem *) + void visitPre(DocSecRefItem *ref) { - // TODO + QCString refName=ref->file(); + if (refName.right(Doxygen::htmlFileExtension.length())!=Doxygen::htmlFileExtension) + { + refName+=Doxygen::htmlFileExtension; + } + m_t << "
    • anchor() << "\">"; + } void visitPost(DocSecRefItem *) { - // TODO + m_t << " "; } void visitPre(DocSecRefList *) { - // TODO + m_t << "" << endl; + m_t << "
        " << endl; } void visitPost(DocSecRefList *) { - // TODO + m_t << "
      " << endl; + m_t << "
      " << endl; } void visitPre(DocLanguage *) { - // TODO } void visitPost(DocLanguage *) { - // TODO } void visitPre(DocParamSect *s) { @@ -526,6 +605,8 @@ class HtmlDocVisitor : public DocVisitor m_t << theTranslator->trReturnValues(); break; case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break; + default: + ASSERT(0); } m_t << ":"; m_t << "
      " << endl; @@ -556,8 +637,9 @@ class HtmlDocVisitor : public DocVisitor void visitPre(DocXRefItem *x) { m_t << "
      file() << Doxygen::htmlFileExtension << "#" << x->anchor() << "\">" - << x->title() << ":
      "; + << x->file() << Doxygen::htmlFileExtension << "#" << x->anchor() << "\">"; + filter(x->title()); + m_t << ":
      "; } void visitPost(DocXRefItem *) { @@ -570,54 +652,30 @@ class HtmlDocVisitor : public DocVisitor void visitPost(DocInternalRef *) { endLink(); + m_t << " "; } - - private: - void filter(const char *str) - { - if (str==0) return; - const char *p=str; - char c; - while (*p) - { - c=*p++; - switch(c) - { - case '<': m_t << "<"; break; - case '>': m_t << ">"; break; - case '&': m_t << "&"; break; - default: m_t << c; - } - } - } - - void startLink(const QCString &ref,const QCString &file,const QCString &anchor) + void visitPre(DocCopy *) { - QCString *dest; - if (!ref.isEmpty()) // link to entity imported via tag file - { - m_t << ""; } - void endLink() + void visitPost(DocCopy *) { - m_t << " "; } + + private: + + //-------------------------------------- + // helper functions + //-------------------------------------- + + void filter(const char *str); + void startLink(const QCString &ref,const QCString &file, + const QCString &anchor); + void endLink(); + + //-------------------------------------- + // state variables + //-------------------------------------- + QTextStream &m_t; BaseCodeDocInterface &m_ci; bool m_insidePre; diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 37cd81f..61f2eef 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1239,14 +1239,11 @@ void HtmlGenerator::endSectionRefList() t << "" << endl; } + void HtmlGenerator::printDoc(DocNode *n) { -#ifdef ENABLE_NEW_PARSER HtmlDocVisitor *visitor = new HtmlDocVisitor(t,*this); n->accept(visitor); delete visitor; -#else - n=n; -#endif } diff --git a/src/lang_cfg.h b/src/lang_cfg.h index fe373e3..4e7adfe 100644 --- a/src/lang_cfg.h +++ b/src/lang_cfg.h @@ -24,3 +24,4 @@ #define LANG_GR #define LANG_TW #define LANG_SR +#define LANG_CA diff --git a/src/language.cpp b/src/language.cpp index 5711b07..28ed750 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -100,6 +100,9 @@ #ifdef LANG_SR #include "translator_sr.h" #endif +#ifdef LANG_CA +#include "translator_ca.h" +#endif //#ifdef LANG_JS //#include "translator_js.h" //#endif diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp new file mode 100644 index 0000000..ab310c8 --- /dev/null +++ b/src/latexdocvisitor.cpp @@ -0,0 +1,48 @@ +/****************************************************************************** + * + * + * + * + * Copyright (C) 1997-2002 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#include "latexdocvisitor.h" +#include "util.h" + +void LatexDocVisitor::filter(const char *str) +{ + filterLatexString(m_t,str,FALSE,m_insidePre); +} + +void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor) +{ + if (ref.isEmpty() && Config_getBool("PDF_HYPERLINKS")) + { + m_t << "\\hyperlink{"; + if (!file.isEmpty()) m_t << file; + if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_"; + if (!anchor.isEmpty()) m_t << anchor; + m_t << "}{"; + + } + else + { + m_t << "{\\bf "; + } +} + +void LatexDocVisitor::endLink() +{ + m_t << "}"; +} + diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h new file mode 100644 index 0000000..0de6510 --- /dev/null +++ b/src/latexdocvisitor.h @@ -0,0 +1,788 @@ +/****************************************************************************** + * + * + * + * + * Copyright (C) 1997-2002 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#ifndef _LATEXDOCVISITOR_H +#define _LATEXDOCVISITOR_H + +#include "docvisitor.h" +#include "docparser.h" +#include "language.h" +#include "doxygen.h" +#include "outputgen.h" +#include "code.h" +#include "dot.h" + +/*! @brief Concrete visitor implementation for LaTeX output. */ +class LatexDocVisitor : public DocVisitor +{ + public: + LatexDocVisitor(QTextStream &t,BaseCodeDocInterface &ci) + : m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE) {} + + //-------------------------------------- + // visitor functions for leaf nodes + //-------------------------------------- + + void visit(DocWord *w) + { + if (m_hide) return; + filter(w->word()); + } + void visit(DocLinkedWord *w) + { + if (m_hide) return; + startLink(w->ref(),w->file(),w->anchor()); + filter(w->word()); + endLink(); + } + void visit(DocWhiteSpace *w) + { + if (m_hide) return; + if (m_insidePre) + { + m_t << w->chars(); + } + else + { + m_t << " "; + } + } + void visit(DocSymbol *s) + { + if (m_hide) return; + switch(s->symbol()) + { + case DocSymbol::BSlash: m_t << "$\\backslash$"; break; + case DocSymbol::At: m_t << "@"; break; + case DocSymbol::Less: m_t << "$<$"; break; + case DocSymbol::Greater: m_t << "$>$"; break; + case DocSymbol::Amp: m_t << "\\&"; break; + case DocSymbol::Dollar: m_t << "\\$"; break; + case DocSymbol::Hash: m_t << "\\#"; break; + case DocSymbol::Percent: m_t << "\\%"; break; + case DocSymbol::Copy: m_t << "\\copyright"; break; + case DocSymbol::Apos: m_t << "'"; break; + case DocSymbol::Quot: m_t << "''"; break; + case DocSymbol::Uml: + if (s->letter()=='i') + m_t << "\\\"{\\i}"; + else + m_t << "\\\"{" << s->letter() << "}"; + break; + case DocSymbol::Acute: + if (s->letter()=='i') + m_t << "\\'{\\i}"; + else + m_t << "\\'{" << s->letter() << "}"; + break; + case DocSymbol::Grave: + if (s->letter()=='i') + m_t << "\\`{\\i}"; + else + m_t << "\\`{" << s->letter() << "}"; + break; + case DocSymbol::Circ: + if (s->letter()=='i') + m_t << "\\^{\\i}"; + else + m_t << "\\^{" << s->letter() << "}"; + break; + case DocSymbol::Tilde: m_t << "\\~{" << s->letter() << "}"; + case DocSymbol::Szlig: m_t << "\"s"; break; + case DocSymbol::Cedil: m_t << "\\c{" << s->letter() << "}"; break; + case DocSymbol::Ring: m_t << "\\" << s->letter() << s->letter(); break; + case DocSymbol::Nbsp: m_t << "\\ "; break; + default: + printf("Error: unknown symbol found\n"); + } + } + void visit(DocURL *u) + { + if (m_hide) return; + if (Config_getBool("PDF_HYPERLINKS")) + { + m_t << "\\href{" << u->url() << "}"; + } + m_t << "{\\tt " << u->url() << "}"; + } + void visit(DocLineBreak *) + { + if (m_hide) return; + m_t << "\\par\n"; + } + void visit(DocHorRuler *) + { + if (m_hide) return; + m_t << "\n\n"; + } + void visit(DocStyleChange *s) + { + if (m_hide) return; + switch (s->style()) + { + case DocStyleChange::Bold: + if (s->enable()) m_t << "{\\bf "; else m_t << "} "; + break; + case DocStyleChange::Italic: + if (s->enable()) m_t << "{\\em "; else m_t << "} "; + break; + case DocStyleChange::Code: + if (s->enable()) m_t << "{\\tt "; else m_t << "} "; + break; + case DocStyleChange::Subscript: + if (s->enable()) m_t << "$_{\\mbox{"; else m_t << "}}$ "; + break; + case DocStyleChange::Superscript: + if (s->enable()) m_t << "$^{\\mbox{"; else m_t << "}}$ "; + break; + case DocStyleChange::Center: + if (s->enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} "; + break; + case DocStyleChange::Small: + if (s->enable()) m_t << "\\footnotesize "; else m_t << "\\normalsize "; + break; + } + } + void visit(DocVerbatim *s) + { + if (m_hide) return; + switch(s->type()) + { + case DocVerbatim::Code: // fall though + m_t << "\n\n\\footnotesize\\begin{verbatim}"; + parseCode(m_ci,s->context(),s->text(),FALSE,0); + m_t << "\\end{verbatim}\\normalsize" << endl; + break; + case DocVerbatim::Verbatim: + m_t << "\n\n\\footnotesize\\begin{verbatim}"; + m_t << s->text(); + m_t << "\\end{verbatim}\\normalsize" << endl; + break; + case DocVerbatim::HtmlOnly: + /* nothing */ + break; + case DocVerbatim::LatexOnly: + m_t << s->text(); + break; + } + } + void visit(DocAnchor *anc) + { + if (m_hide) return; + m_t << "\\label{" << anc->anchor() << "}" << endl; + if (!anc->file().isEmpty() && Config_getBool("PDF_HYPERLINKS")) + { + m_t << "\\hypertarget{" << anc->file() << "_" << anc->anchor() + << "}{}" << endl; + } + } + void visit(DocInclude *inc) + { + if (m_hide) return; + switch(inc->type()) + { + case DocInclude::Include: + m_t << "\n\n\\footnotesize\\begin{verbatim}"; + parseCode(m_ci,inc->context(),inc->text(),FALSE,0); + m_t << "\\end{verbatim}\\normalsize" << endl; + break; + case DocInclude::DontInclude: + break; + case DocInclude::HtmlInclude: + break; + case DocInclude::VerbInclude: + m_t << "\n\n\\footnotesize\\begin{verbatim}"; + m_t << inc->text(); + m_t << "\\end{verbatim}\\normalsize" << endl; + break; + } + } + void visit(DocIncOperator *op) + { + //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n", + // op->type(),op->isFirst(),op->isLast(),op->text().data()); + if (op->isFirst()) + { + m_t << "\n\n\\footnotesize\\begin{verbatim}"; + m_hide = TRUE; + } + if (op->type()!=DocIncOperator::Skip) + { + parseCode(m_ci,op->context(),op->text(),FALSE,0); + } + if (op->isLast()) + { + m_hide = FALSE; + m_t << "\\end{verbatim}\\normalsize" << endl; + } + else + { + m_t << endl; + } + } + void visit(DocFormula *f) + { + if (m_hide) return; + m_t << f->text(); + } + + //-------------------------------------- + // visitor functions for compound nodes + //-------------------------------------- + + void visitPre(DocAutoList *l) + { + if (l->isEnumList()) + { + m_t << "\\begin{enumerate}" << endl; + } + else + { + m_t << "\\begin{itemize}" << endl; + } + } + void visitPost(DocAutoList *l) + { + if (l->isEnumList()) + { + m_t << "\\end{enumerate}" << endl; + } + else + { + m_t << "\\end{itemize}" << endl; + } + } + void visitPre(DocAutoListItem *) + { + m_t << "\\item "; + } + void visitPost(DocAutoListItem *) + { + } + void visitPre(DocPara *) + { + } + void visitPost(DocPara *p) + { + if (!p->isLast() && // omit

      for last paragraph + !(p->parent() && // and for parameter sections + p->parent()->kind()==DocNode::Kind_ParamSect + ) + ) m_t << endl << endl; + } + void visitPre(DocRoot *) + { + } + void visitPost(DocRoot *) + { + } + void visitPre(DocSimpleSect *s) + { + m_t << "\\begin{Desc}\n\\item["; + switch(s->type()) + { + case DocSimpleSect::See: + m_t << theTranslator->trSeeAlso(); break; + case DocSimpleSect::Return: + m_t << theTranslator->trReturns(); break; + case DocSimpleSect::Author: + m_t << theTranslator->trAuthor(TRUE,TRUE); break; + case DocSimpleSect::Authors: + m_t << theTranslator->trAuthor(TRUE,FALSE); break; + case DocSimpleSect::Version: + m_t << theTranslator->trVersion(); break; + case DocSimpleSect::Since: + m_t << theTranslator->trSince(); break; + case DocSimpleSect::Date: + m_t << theTranslator->trDate(); break; + case DocSimpleSect::Note: + m_t << theTranslator->trNote(); break; + case DocSimpleSect::Warning: + m_t << theTranslator->trWarning(); break; + case DocSimpleSect::Pre: + m_t << theTranslator->trPrecondition(); break; + case DocSimpleSect::Post: + m_t << theTranslator->trPostcondition(); break; + case DocSimpleSect::Invar: + m_t << theTranslator->trInvariant(); break; + case DocSimpleSect::Remark: + m_t << theTranslator->trRemarks(); break; + case DocSimpleSect::Attention: + m_t << theTranslator->trAttention(); break; + case DocSimpleSect::User: break; + case DocSimpleSect::Unknown: break; + } + + // special case 1: user defined title + if (s->type()!=DocSimpleSect::User) + { + m_t << ":]"; + } + } + void visitPost(DocSimpleSect *) + { + m_t << "\\end{Desc}" << endl; + } + void visitPre(DocTitle *) + { + } + void visitPost(DocTitle *) + { + m_t << "]"; + } + void visitPre(DocSimpleList *) + { + m_t << "\\begin{itemize}" << endl; + } + void visitPost(DocSimpleList *) + { + m_t << "\\end{itemize}" << endl; + } + void visitPre(DocSimpleListItem *) + { + m_t << "\\item "; + } + void visitPost(DocSimpleListItem *) + { + } + void visitPre(DocSection *s) + { + if (Config_getBool("PDF_HYPERLINKS")) + { + m_t << "\\hypertarget{" << s->file() << "_" << s->anchor() << "}{}"; + } + if (s->level()==1) + { + if (Config_getBool("COMPACT_LATEX")) + { + m_t << "\\subsubsection{"; + } + else + { + m_t << "\\subsection{"; + } + } + else if (s->level()==2) + { + if (Config_getBool("COMPACT_LATEX")) + { + m_t << "\\paragraph{"; + } + else + { + m_t << "\\subsubsection{"; + } + } + filter(s->title()); + m_t << "}\\label{" << s->anchor() << "}" << endl; + } + void visitPost(DocSection *) + { + } + void visitPre(DocHtmlList *s) + { + if (s->type()==DocHtmlList::Ordered) + m_t << "\\begin{enumerate}" << endl; + else + m_t << "\\begin{itemize}" << endl; + } + void visitPost(DocHtmlList *s) + { + if (s->type()==DocHtmlList::Ordered) + m_t << "\\end{enumerate}" << endl; + else + m_t << "\\end{itemize}" << endl; + } + void visitPre(DocHtmlListItem *) + { + m_t << "\\item "; + } + void visitPost(DocHtmlListItem *) + { + } + void visitPre(DocHtmlPre *) + { + m_t << "\\small\\begin{alltt}"; + m_insidePre=TRUE; + } + void visitPost(DocHtmlPre *) + { + m_insidePre=FALSE; + m_t << "\\end{alltt}\\normalsize " << endl; + } + void visitPre(DocHtmlDescList *) + { + m_t << "\\begin{description}" << endl; + } + void visitPost(DocHtmlDescList *) + { + m_t << "\\end{description}" << endl; + } + void visitPre(DocHtmlDescTitle *) + { + m_t << "\\item["; + } + void visitPost(DocHtmlDescTitle *) + { + m_t << "]"; + } + void visitPre(DocHtmlDescData *) + { + } + void visitPost(DocHtmlDescData *) + { + } + void visitPre(DocHtmlTable *t) + { + if (t->hasCaption()) + { + m_t << "\\begin{table}[h]"; + } + m_t << "\\begin{TabularC}{" << t->numCols() << "}\n\\hline\n"; + } + void visitPost(DocHtmlTable *t) + { + if (t->hasCaption()) + { + m_t << "\\end{table}\n"; + } + else + { + m_t << "\\\\\\hline\n\\end{TabularC}\n"; + } + } + void visitPre(DocHtmlCaption *) + { + m_t << "\\\\\\hline\n\\end{TabularC}\n\\centering\n\\caption{"; + } + void visitPost(DocHtmlCaption *) + { + m_t << "}\n"; + } + void visitPre(DocHtmlRow *) + { + } + void visitPost(DocHtmlRow *) + { + m_t << "\\\\\\hline\n"; + } + void visitPre(DocHtmlCell *) + { + } + void visitPost(DocHtmlCell *c) + { + if (!c->isLast()) m_t << "&"; + } + void visitPre(DocIndexEntry *) + { + m_hide = TRUE; + } + void visitPost(DocIndexEntry *) + { + m_hide = FALSE; + } + void visitPre(DocInternal *) + { + m_t << "\\begin{Desc}" << endl + << "\\item[" << theTranslator->trForInternalUseOnly() << "]" << endl; + } + void visitPost(DocInternal *) + { + m_t << "\\end{Desc}" << endl; + } + void visitPre(DocHRef *href) + { + if (Config_getBool("PDF_HYPERLINKS")) + { + m_t << "\\href{"; + m_t << href->url(); + m_t << "}"; + } + m_t << "{\\tt "; + } + void visitPost(DocHRef *) + { + m_t << "}"; + } + void visitPre(DocHtmlHeader *header) + { + if (Config_getBool("COMPACT_LATEX")) + { + switch(header->level()) + { + case 1: m_t << "\\subsection{"; break; + case 2: m_t << "\\subsubsection{"; break; + case 3: m_t << "\\paragraph{"; break; + } + } + else + { + switch(header->level()) + { + case 1: m_t << "\\section{"; break; + case 2: m_t << "\\subsection{"; break; + case 3: m_t << "\\subsubsection{"; break; + } + } + } + void visitPost(DocHtmlHeader *) + { + m_t << "}"; + } + void visitPre(DocImage *img) + { + if (img->type()==DocImage::Latex) + { + if (img->hasCaption()) + { + m_t << "\\begin{figure}[H]" << endl; + m_t << "\\begin{center}" << endl; + } + else + { + m_t << "\\mbox{"; + } + QCString gfxName = img->name(); + if (gfxName.right(4)==".eps" || gfxName.right(4)==".pdf") + { + gfxName=gfxName.left(gfxName.length()-4); + } + m_t << "\\includegraphics"; + if (!img->width().isEmpty()) + { + m_t << "[width=" << img->width() << "]"; + } + else if (!img->height().isEmpty()) + { + m_t << "[height=" << img->height() << "]"; + } + m_t << "{" << gfxName << "}"; + if (img->hasCaption()) + { + m_t << "\\caption{"; + } + } + else // other format -> skip + { + m_hide=TRUE; + } + } + void visitPost(DocImage *img) + { + if (img->type()==DocImage::Latex) + { + m_t << "}" << endl; // end mbox or caption + if (img->hasCaption()) + { + m_t << "\\end{center}" << endl; + m_t << "\\end{figure}" << endl; + } + } + else // other format + { + m_hide=FALSE; + } + } + void visitPre(DocDotFile *df) + { + QCString baseName=df->file(); + int i; + if ((i=baseName.findRev('/'))!=-1) + { + baseName=baseName.right(baseName.length()-i-1); + } + if (baseName.right(4)==".eps" || baseName.right(4)==".pdf") + { + baseName=baseName.left(baseName.length()-4); + } + QCString outDir = Config_getString("LATEX_OUTPUT"); + writeDotGraphFromFile(df->file(),outDir,baseName,EPS); + if (df->hasCaption()) + { + m_t << "\\begin{figure}[H]" << endl; + m_t << "\\begin{center}" << endl; + } + else + { + m_t << "\\mbox{"; + } + m_t << "\\includegraphics"; + if (!df->width().isEmpty()) + { + m_t << "[width=" << df->width() << "]"; + } + else if (!df->height().isEmpty()) + { + m_t << "[height=" << df->height() << "]"; + } + m_t << "{" << baseName << "}"; + + if (df->hasCaption()) + { + m_t << "\\caption{"; + } + } + void visitPost(DocDotFile *df) + { + m_t << "}" << endl; // end mbox or caption + if (df->hasCaption()) + { + m_t << "\\end{center}" << endl; + m_t << "\\end{figure}" << endl; + } + } + void visitPre(DocLink *lnk) + { + startLink(lnk->ref(),lnk->file(),lnk->anchor()); + } + void visitPost(DocLink *) + { + endLink(); + } + void visitPre(DocRef *ref) + { + startLink(ref->ref(),ref->file(),ref->anchor()); + if (!ref->hasLinkText()) filter(ref->targetTitle()); + } + void visitPost(DocRef *) + { + endLink(); + m_t << " "; + } + void visitPre(DocSecRefItem *) + { + m_t << "\\item \\contentsline{section}{"; + } + void visitPost(DocSecRefItem *ref) + { + m_t << "}{\\ref{" << ref->anchor() << "}}{}" << endl; + } + void visitPre(DocSecRefList *) + { + m_t << "\\footnotesize" << endl; + m_t << "\\begin{multicols}{2}" << endl; + m_t << "\\begin{CompactList}" << endl; + } + void visitPost(DocSecRefList *) + { + m_t << "\\end{CompactList}" << endl; + m_t << "\\end{multicols}" << endl; + m_t << "\\normalsize" << endl; + } + void visitPre(DocLanguage *) + { + } + void visitPost(DocLanguage *) + { + } + void visitPre(DocParamSect *s) + { + m_t << "\\begin{Desc}" << endl; + m_t << "\\item["; + switch(s->type()) + { + case DocParamSect::Param: + m_t << theTranslator->trParameters(); break; + case DocParamSect::RetVal: + m_t << theTranslator->trReturnValues(); break; + case DocParamSect::Exception: + m_t << theTranslator->trExceptions(); break; + default: + ASSERT(0); + } + m_t << ":]" << endl; + m_t << "\\begin{description}" << endl; + } + void visitPost(DocParamSect *) + { + m_t << "\\end{description}" << endl; + m_t << "\\end{Desc}" << endl; + } + void visitPre(DocParamList *pl) + { + m_t << "\\item[{\\em "; + QStrListIterator li(pl->parameters()); + const char *s; + bool first=TRUE; + for (li.toFirst();(s=li.current());++li) + { + if (!first) m_t << ","; else first=FALSE; + m_t << s; + } + m_t << "}]"; + } + void visitPost(DocParamList *) + { + } + void visitPre(DocXRefItem *x) + { + m_t << "\\begin{Desc}" << endl; + m_t << "\\item["; + if (Config_getBool("PDF_HYPERLINKS")) + { + m_t << "\\hyperlink{" << x->file() << "_" << x->anchor() << "}{"; + } + else + { + m_t << "{\\bf "; + } + filter(x->title()); + m_t << "}]"; + } + void visitPost(DocXRefItem *) + { + m_t << "\\end{Desc}" << endl; + } + void visitPre(DocInternalRef *ref) + { + startLink(0,ref->file(),ref->anchor()); + } + void visitPost(DocInternalRef *) + { + endLink(); + m_t << " "; + } + void visitPre(DocCopy *) + { + } + void visitPost(DocCopy *) + { + } + + private: + + //-------------------------------------- + // helper functions + //-------------------------------------- + + void filter(const char *str); + void startLink(const QCString &ref,const QCString &file, + const QCString &anchor); + void endLink(); + + //-------------------------------------- + // state variables + //-------------------------------------- + + QTextStream &m_t; + BaseCodeDocInterface &m_ci; + bool m_insidePre; + bool m_hide; +}; + +#endif diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 987538b..d9f7b24 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -29,6 +29,7 @@ #include "version.h" #include "dot.h" #include "page.h" +#include "latexdocvisitor.h" //static QCString filterTitle(const char *s) //{ @@ -242,6 +243,7 @@ static void writeDefaultHeaderPart1(QTextStream &t) t << "\\usepackage{makeidx}\n" "\\usepackage{fancyhdr}\n" "\\usepackage{graphicx}\n" + "\\usepackage{multicol}\n" "\\usepackage{float}\n" "\\usepackage{alltt}\n"; if (Config_getBool("PDF_HYPERLINKS")) @@ -1163,6 +1165,7 @@ void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor) void LatexGenerator::writeAnchor(const char *fName,const char *name) { + //printf("LatexGenerator::writeAnchor(%s,%s)\n",fName,name); t << "\\label{" << name << "}" << endl; if (fName && Config_getBool("PDF_HYPERLINKS")) { @@ -1283,158 +1286,42 @@ void LatexGenerator::writeSectionRefItem(const char *,const char *lab, // t << " (p.\\,\\pageref{" << lab << "})" << endl; //} -//void LatexGenerator::docify(const char *str) -//{ -// docifyStatic(t,str); -//} - -/*! - * Function converts Latin2 character to latex strin] representin the same - * character. - */ -void LatexGenerator::latin2ToLatex(unsigned char c) -{ - switch (c) - { - case 0xA1: t << c; break; - case 0xA2: t << c; break; - case 0xA3: t << c; break; - case 0xA4: t << c; break; - case 0xA5: t << c; break; - case 0xA6: t << "\\'{S}"; break; - case 0xA7: t << c; break; - case 0xA8: t << c; break; - case 0xA9: t << "\\v{S}"; break; - case 0xAA: t << "\\c{S}"; break; - case 0xAB: t << "\\v{T}"; break; - case 0xAC: t << "\\'{Z}"; break; - case 0xAD: t << c; break; - case 0xAE: t << "\\v{Z}"; break; - case 0xAF: t << "\\.{Z}"; break; - - case 0xB0: t << c; break; - case 0xB1: t << c; break; - case 0xB2: t << c; break; - case 0xB3: t << c; break; - case 0xB4: t << c; break; - case 0xB5: t << c; break; - case 0xB6: t << "\\'{s}"; break; - case 0xB7: t << c; break; - case 0xB8: t << c; break; - case 0xB9: t << "\\v{s}"; break; - case 0xBA: t << "\\c{s}"; break; - case 0xBB: t << "\\v{t}"; break; - case 0xBC: t << "\\'{z}"; break; - case 0xBD: t << c; break; - case 0xBE: t << "\\v{z}"; break; - case 0xBF: t << "\\.{z}"; break; - - case 0xC0: t << "\\'{R}"; break; - case 0xC1: t << "\\'{A}"; break; - case 0xC2: t << "\\^{A}"; break; - case 0xC3: t << "\\u{A}"; break; - case 0xC4: t << "\\\"{A}"; break; - case 0xC5: t << "\\'{L}"; break; - case 0xC6: t << "\\'{C}"; break; - case 0xC7: t << "\\c{C}"; break; - case 0xC8: t << "\\v{C}"; break; - case 0xC9: t << "\\'{E}"; break; - case 0xCA: t << "\\c{E}"; break; - case 0xCB: t << "\\\"{E}"; break; - case 0xCC: t << "\\v{E}"; break; - case 0xCD: t << "\\'{I}"; break; - case 0xCE: t << "\\^{I}"; break; - case 0xCF: t << "\\v{D}"; break; - - case 0xD0: t << "\\bar{D}"; break; - case 0xD1: t << "\\'{N}"; break; - case 0xD2: t << "\\v{N}"; break; - case 0xD3: t << "\\'{O}"; break; - case 0xD4: t << "\\^{O}"; break; - case 0xD5: t << "\\H{O}"; break; - case 0xD6: t << "\\\"{O}"; break; - case 0xD7: t << c; break; - case 0xD8: t << "\\v{R}"; break; - case 0xD9: t << c; break; - case 0xDA: t << "\\'{U}"; break; - case 0xDB: t << "\\H{U}"; break; - case 0xDC: t << "\\\"{U}"; break; - case 0xDD: t << "\\'{Y}"; break; - case 0xDE: t << "\\c{T}"; break; - case 0xDF: t << "\\ss"; break; - - case 0xE0: t << "\\'{r}"; break; - case 0xE1: t << "\\'{a}"; break; - case 0xE2: t << "\\^{a}"; break; - case 0xE3: t << c; break; - case 0xE4: t << "\\\"{a}"; break; - case 0xE5: t << "\\'{l}"; break; - case 0xE6: t << "\\'{c}"; break; - case 0xE7: t << "\\c{c}"; break; - case 0xE8: t << "\\v{c}"; break; - case 0xE9: t << "\\'{e}"; break; - case 0xEA: t << c; break; - case 0xEB: t << "\\\"{e}"; break; - case 0xEC: t << "\\v{e}"; break; - case 0xED: t << "\\'{\\i}"; break; - case 0xEE: t << "\\^{\\i}"; break; - case 0xEF: t << "\\v{d}"; break; - - case 0xF0: t << "\\bar{d}"; break; - case 0xF1: t << "\\'{n}"; break; - case 0xF2: t << "\\v{n}"; break; - case 0xF3: t << "\\'{o}"; break; - case 0xF4: t << "\\^{o}"; break; - case 0xF5: t << "\\H{o}"; break; - case 0xF6: t << "\\\"{o}"; break; - case 0xF7: t << c; break; - case 0xF8: t << "\\v{r}"; break; - case 0xF9: t << c; break; - case 0xFA: t << "\\'{u}"; break; - case 0xFB: t << "\\H{u}"; break; - case 0xFC: t << "\\\"{u}"; break; - case 0xFD: t << "\\'{y}"; break; - case 0xFE: t << c; break; - case 0xFF: t << c; break; - - default: t << c; - } -} //void LatexGenerator::docifyStatic(QTextStream &t,const char *str) void LatexGenerator::docify(const char *str) { - static bool isCzech = theTranslator->idLanguage()=="czech"; +#if 0 + //static bool isCzech = theTranslator->idLanguage()=="czech"; static bool isJapanese = theTranslator->idLanguage()=="japanese"; - static bool isKorean = theTranslator->idLanguage()=="korean"; - static bool isRussian = theTranslator->idLanguage()=="russian"; - static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; - static bool isChinese = theTranslator->idLanguage()=="chinese" || - theTranslator->idLanguage()=="chinese-traditional"; - static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; - static bool isGreek = theTranslator->idLanguage()=="greek"; + //static bool isKorean = theTranslator->idLanguage()=="korean"; + //static bool isRussian = theTranslator->idLanguage()=="russian"; + //static bool isUkrainian = theTranslator->idLanguage()=="ukrainian"; + //static bool isChinese = theTranslator->idLanguage()=="chinese" || + // theTranslator->idLanguage()=="chinese-traditional"; + //static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; + //static bool isGreek = theTranslator->idLanguage()=="greek"; if (str) { const unsigned char *p=(const unsigned char *)str; unsigned char c; unsigned char pc='\0'; + bool multiByte = FALSE; while (*p) { - static bool MultiByte = FALSE; c=*p++; if( isJapanese) { - if (MultiByte) + if (multiByte) { t << (char)c; - MultiByte = FALSE; + multiByte = FALSE; pc = c; continue; } if (c>=0x80) { - MultiByte = TRUE; + multiByte = TRUE; t << (char)c; pc = c; continue; @@ -1453,185 +1340,13 @@ void LatexGenerator::docify(const char *str) } else { - switch(c) - { - case '#': t << "\\#"; break; - case '$': t << "\\$"; break; - case '%': t << "\\%"; break; - case '^': t << "$^\\wedge$"; break; - case '&': t << "\\&"; break; - case '*': t << "$\\ast$"; break; - case '_': t << "\\_"; - if (!insideTabbing) t << "\\-"; - break; - case '{': t << "\\{"; break; - case '}': t << "\\}"; break; - case '<': t << "$<$"; break; - case '>': t << "$>$"; break; - case '|': t << "$|$"; break; - case '~': t << "$\\sim$"; break; - case '[': if (Config_getBool("PDF_HYPERLINKS")) - t << "\\mbox{[}"; - else - t << "["; - break; - case ']': if (pc=='[') t << "$\\,$"; - if (Config_getBool("PDF_HYPERLINKS")) - t << "\\mbox{]}"; - else - t << "]"; - break; - case '-': if (*p=='>') - { t << " $\\rightarrow$ "; p++; } - else - { t << (char)c; } - break; - case '\\': if (*p=='<') - { t << "$<$"; p++; } - else if (*p=='>') - { t << "$>$"; p++; } - else - { t << "$\\backslash$"; } - break; - case '"': { t << "\\char`\\\"{}"; } - break; - - default: - // Some languages uses wide characters - if (isJapanese || isKorean || isChinese) - { - if (c>=128) - { - t << (char)c; - if (*p) - { - c = *p++; - t << (char)c; - } - } - else // ascii char => see if we can insert a hypenation hint - { - if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-"; - t << (char)c; - } - } - else if (isCzech || isRussian || isUkrainian) - { - if (c>=128) - { - t << (char)c; - } - else // ascii char => see if we can insert a hypenation hint - { - if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-"; - t << (char)c; - } - } - else if (isLatin2) - { - if (c>=128) - { - latin2ToLatex(c); - } - else - { - // see if we can insert an hyphenation hint - if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-"; - t << (char)c; - } - } - else if (isGreek) - { - if (c<128) - { - t << "\\textlatin{" << (char)c << "}"; - } - else - { - t << (char)c; - } - } - else // language is other than Czech, Russian or Japanese - { - switch(c) - { - // the Latin-1 characters - case 161: t << "!`"; break; - case 181: t << "$\\mu$"; break; - case 191: t << "?`"; break; - case 192: t << "\\`{A}"; break; - case 193: t << "\\'{A}"; break; - case 194: t << "\\^{A}"; break; - case 195: t << "\\~{A}"; break; - case 196: t << "\\\"{A}"; break; - case 197: t << "\\AA{}"; break; - case 198: t << "\\AE{}"; break; - case 199: t << "\\c{C}"; break; - case 200: t << "\\`{E}"; break; - case 201: t << "\\'{E}"; break; - case 202: t << "\\^{E}"; break; - case 203: t << "\\\"{E}"; break; - case 204: t << "\\`{I}"; break; - case 205: t << "\\'{I}"; break; - case 206: t << "\\^{I}"; break; - case 207: t << "\\\"{I}"; break; - case 208: t << "D "; break; // anyone know the real code? - case 209: t << "\\~{N}"; break; - case 210: t << "\\`{O}"; break; - case 211: t << "\\'{O}"; break; - case 212: t << "\\^{O}"; break; - case 213: t << "\\~{O}"; break; - case 214: t << "\\\"{O}"; break; - case 215: t << "$\\times$"; break; - case 216: t << "\\O"; break; - case 217: t << "\\`{U}"; break; - case 218: t << "\\'{U}"; break; - case 219: t << "\\^{U}"; break; - case 220: t << "\\\"{U}"; break; - case 221: t << "\\'{Y}"; break; - case 223: t << "\\ss{}"; break; - case 224: t << "\\`{a}"; break; - case 225: t << "\\'{a}"; break; - case 226: t << "\\^{a}"; break; - case 227: t << "\\~{a}"; break; - case 228: t << "\\\"{a}"; break; - case 229: t << "\\aa{}"; break; - case 230: t << "\\ae{}"; break; - case 231: t << "\\c{c}"; break; - case 232: t << "\\`{e}"; break; - case 233: t << "\\'{e}"; break; - case 234: t << "\\^{e}"; break; - case 235: t << "\\\"{e}"; break; - case 236: t << "\\`{\\i}"; break; - case 237: t << "\\'{\\i}"; break; - case 238: t << "\\^{\\i}"; break; - case 239: t << "\\\"{\\i}"; break; - case 241: t << "\\~{n}"; break; - case 242: t << "\\`{o}"; break; - case 243: t << "\\'{o}"; break; - case 244: t << "\\^{o}"; break; - case 245: t << "\\~{o}"; break; - case 246: t << "\\\"{o}"; break; - case 248: t << "\\o{}"; break; - case 249: t << "\\`{u}"; break; - case 250: t << "\\'{u}"; break; - case 251: t << "\\^{u}"; break; - case 252: t << "\\\"{u}"; break; - case 253: t << "\\'{y}"; break; - case 255: t << "\\\"{y}"; break; - default: // normal ascii char - { - // see if we can insert an hyphenation hint - if (isupper(c) && islower(pc) && !insideTabbing) t << "\\-"; - t << (char)c; - } - } - } - } + filterLatexChar(t,c,insideTabbing); } pc = c; } } +#endif + filterLatexString(t,str,insideTabbing,insidePre); } void LatexGenerator::codify(const char *str) @@ -1965,3 +1680,10 @@ void LatexGenerator::endSectionRefList() t << "\\normalsize" << endl; } +void LatexGenerator::printDoc(DocNode *n) +{ + LatexDocVisitor *visitor = new LatexDocVisitor(t,*this); + n->accept(visitor); + delete visitor; +} + diff --git a/src/latexgen.h b/src/latexgen.h index cf36929..11a0516 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -15,8 +15,8 @@ * */ -#ifndef OUTPUT_H -#define OUTPUT_H +#ifndef LATEXGEN_H +#define LATEXGEN_H #include "outputgen.h" @@ -42,6 +42,8 @@ class LatexGenerator : public OutputGenerator bool isEnabled(OutputType o) { return (o==Latex && active); } OutputGenerator *get(OutputType o) { return (o==Latex) ? this : 0; } + void printDoc(DocNode *); + void startFile(const char *name,const char *manName, const char *title, bool external); void writeFooter(int,bool) {} @@ -287,7 +289,6 @@ class LatexGenerator : public OutputGenerator void writeCodeAnchor(const char *) {} private: - void latin2ToLatex(unsigned char); LatexGenerator(const LatexGenerator &); LatexGenerator &operator=(const LatexGenerator &); int col; diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in index ac5c03d..700c9da 100644 --- a/src/libdoxygen.pro.in +++ b/src/libdoxygen.pro.in @@ -22,12 +22,16 @@ HEADERS = bufstr.h \ cmdmapper.h \ code.h \ commentcnv.h \ + config.h \ constexp.h \ cppvalue.h \ debug.h \ + declinfo.h \ + defargs.h \ defgen.h \ - doxygen.h \ - scanner.h \ + define.h \ + definition.h \ + diagram.h \ doc.h \ docparser.h \ doctokenizer.h \ @@ -41,12 +45,14 @@ HEADERS = bufstr.h \ formula.h \ ftvhelp.h \ groupdef.h \ + htmldocvisitor.h \ htmlgen.h \ htmlhelp.h \ image.h \ index.h \ instdox.h \ language.h \ + latexdocvisitor.h \ latexgen.h \ logos.h \ mangen.h \ @@ -75,9 +81,11 @@ HEADERS = bufstr.h \ translator.h \ translator_adapter.h \ translator_br.h \ + translator_ca.h \ translator_cn.h \ translator_cz.h \ translator_de.h \ + translator_dk.h \ translator_en.h \ translator_es.h \ translator_fi.h \ @@ -96,6 +104,10 @@ HEADERS = bufstr.h \ translator_ru.h \ translator_se.h \ translator_si.h \ + translator_sk.h \ + translator_sr.h \ + translator_tw.h \ + translator_ua.h \ treeview.h \ unistd.h \ util.h \ @@ -127,12 +139,14 @@ SOURCES = ce_lex.cpp \ formula.cpp \ ftvhelp.cpp \ groupdef.cpp \ + htmldocvisitor.cpp \ htmlgen.cpp \ htmlhelp.cpp \ image.cpp \ index.cpp \ instdox.cpp \ language.cpp \ + latexdocvisitor.cpp \ latexgen.cpp \ logos.cpp \ mangen.cpp \ diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 64aeb4c..3127259 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -552,6 +552,8 @@ ClassDef *MemberDef::getClassDefOfAnonymousType() */ bool MemberDef::isBriefSectionVisible() const { + bool hasDocs = hasDocumentation(); + // only include static members with file/namespace scope if // explicitly enabled in the config file bool visibleIfStatic = !(getClassDef()==0 && @@ -562,7 +564,7 @@ bool MemberDef::isBriefSectionVisible() const // only include members is the are documented or // HIDE_UNDOC_MEMBERS is NO in the config file bool visibleIfDocumented = (!Config_getBool("HIDE_UNDOC_MEMBERS") || - hasDocumentation() || + hasDocs || isDocumentedFriendClass() ); @@ -574,6 +576,15 @@ bool MemberDef::isBriefSectionVisible() const !Config_getBool("REPEAT_BRIEF") ); + // Hide friend (class|struct|union) declarations if HIDE_FRIEND_COMPOUNDS is true + bool visibleIfFriendCompound = !(Config_getBool("HIDE_FRIEND_COMPOUNDS") && + isFriend() && + (type=="friend class" || + type=="friend struct" || + type=="friend union" + ) + ); + // only include members that are non-private unless EXTRACT_PRIVATE is // set to YES or the member is part of a group bool visibleIfPrivate = (protection()!=Private || @@ -581,8 +592,28 @@ bool MemberDef::isBriefSectionVisible() const mtype==Friend ); - bool visible = visibleIfStatic && visibleIfDocumented && - visibleIfEnabled && visibleIfPrivate && !annScope; + // hide member if it overrides a member in a superclass and has no + // documentation + bool visibleIfDocVirtual = (reimplements() || hasDocs); + + // true if this member is a constructor or destructor + bool cOrDTor = isConstructor() || isDestructor(); + + // hide default constructors or destructors (no args) without + // documentation + bool visibleIfNotDefaultCDTor = !(cOrDTor && + defArgList && + (defArgList->isEmpty() || + defArgList->first()->type == "void" + ) && + !hasDocs + ); + + bool visible = visibleIfStatic && visibleIfDocumented && + visibleIfEnabled && visibleIfPrivate && + visibleIfDocVirtual && visibleIfNotDefaultCDTor && + visibleIfFriendCompound && + !annScope; //printf("MemberDef::isBriefSectionVisible() %d\n",visible); return visible; } @@ -896,9 +927,11 @@ bool MemberDef::isDetailedSectionLinkable() const // is documented enum value (mtype==EnumValue && !briefDescription().isEmpty()) || // has brief description that is part of the detailed description - (!briefDescription().isEmpty() && - Config_getBool("ALWAYS_DETAILED_SEC") && - Config_getBool("REPEAT_BRIEF") + (!briefDescription().isEmpty() && // has brief docs + (Config_getBool("ALWAYS_DETAILED_SEC") && // they or visible in + Config_getBool("REPEAT_BRIEF") || // detailed section or + !Config_getBool("BRIEF_MEMBER_DESC") // they are explicitly not + ) // shown in brief section ) || // has a multi-line initialization block //(initLines>0 && initLinesisLinkable() && !isLinkable() && !isDocumentedFriendClass() - && name().find('@')==-1) + if (d && d->isLinkable() && !isLinkable() && + !isDocumentedFriendClass() && + name().find('@')==-1 && + (prot!=Private || Config_getBool("EXTRACT_PRIVATE")) + ) + { warn_undoc(m_defFileName,m_defLine,"Warning: Member %s of %s %s is not documented.", name().data(),t,d->name().data()); + } } @@ -1730,3 +1768,13 @@ Specifier MemberDef::virtualness() const return v; } +bool MemberDef::isConstructor() const +{ + return classDef ? name()==classDef->localName() : FALSE; +} + +bool MemberDef::isDestructor() const +{ + return name().find('~')!=-1 && name().find("operator")==-1; +} + diff --git a/src/memberdef.h b/src/memberdef.h index 073b5f6..8dd36f3 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -120,6 +120,8 @@ class MemberDef : public Definition bool isExplicit() const { return (memSpec&Entry::Explicit)!=0; } bool isMutable() const { return (memSpec&Entry::Mutable)!=0; } bool isExternal() const { return explExt; } + bool isConstructor() const; + bool isDestructor() const; bool hasOneLineInitializer() const; bool hasMultiLineInitializer() const; diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 76854bf..6403053 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -31,7 +31,8 @@ NamespaceDef::NamespaceDef(const char *df,int dl, const char *name,const char *lref) : Definition(df,dl,name) { - fileName=(QCString)"namespace"+name; + fileName="namespace"; + fileName+=name; classSDict = new ClassSDict(17); namespaceSDict = new NamespaceSDict(17); m_innerCompounds = new SDict(17); diff --git a/src/outputgen.h b/src/outputgen.h index 7390e45..48752cc 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -120,15 +120,6 @@ class BaseOutputDocInterface : public BaseCodeDocInterface /*! Starts a new paragraph */ virtual void newParagraph() = 0; - /*! Starts a enumeration list: e.g. \c

        in html. - * writeListItem() is used for the items. - */ - virtual void startEnumList() = 0; - - /*! Ends an enumeration list: e.g. \c
      in html. - */ - virtual void endEnumList() = 0; - /*! Writes a link to an object in the documentation. * \param ref If this is non-zero, the object is to be found in * an external documentation file. @@ -150,10 +141,6 @@ class BaseOutputDocInterface : public BaseCodeDocInterface */ virtual void endHtmlLink() = 0; - /*! Writes a (link to an) email address found in the documentation. - * \param url The email address, this is also used for the link text. - */ - virtual void writeMailLink(const char *url) = 0; /*! Changes the text font to bold face. The bold section ends with * endBold() @@ -190,21 +177,8 @@ class BaseOutputDocInterface : public BaseCodeDocInterface */ virtual void endCodeFragment() = 0; - /*! Starts a fragment of preformatted text. This means that - * spacing, tabs and newlines should be kept in the output - */ - virtual void startPreFragment() = 0; - - /*! Ends a preformatted text fragment. */ - virtual void endPreFragment() = 0; - /*! Starts a fragment of verbatim test. This is preformatted text, - * without any special internal structure. - */ - virtual void startVerbatimFragment() = 0; - /*! Ends a verbatim text fragment. */ - virtual void endVerbatimFragment() = 0; /*! Writes a horizontal ruler to the output */ virtual void writeRuler() = 0; @@ -224,14 +198,53 @@ class BaseOutputDocInterface : public BaseCodeDocInterface * description itself: e.g. \c
      in HTML. */ virtual void endDescItem() = 0; - virtual void startSubsection() = 0; - virtual void endSubsection() = 0; - virtual void startSubsubsection() = 0; - virtual void endSubsubsection() = 0; + virtual void startCenter() = 0; virtual void endCenter() = 0; virtual void startSmall() = 0; virtual void endSmall() = 0; + + virtual void startSimpleSect(SectionTypes t,const char *file, + const char *anchor,const char *title) = 0; + virtual void endSimpleSect() = 0; + virtual void startParamList(ParamListTypes t,const char *title) = 0; + virtual void endParamList() = 0; + + virtual void writeDescItem() = 0; + virtual void startTitle() = 0; + virtual void endTitle() = 0; + + virtual void writeAnchor(const char *fileName,const char *name) = 0; + virtual void startSection(const char *,const char *,SectionInfo::SectionType) = 0; + virtual void endSection(const char *,SectionInfo::SectionType) = 0; + + virtual void lineBreak() = 0; + virtual void addIndexItem(const char *s1,const char *s2) = 0; + + virtual void writeNonBreakableSpace(int) = 0; + virtual void startDescTable() = 0; + virtual void endDescTable() = 0; + virtual void startDescTableTitle() = 0; + virtual void endDescTableTitle() = 0; + virtual void startDescTableData() = 0; + virtual void endDescTableData() = 0; + virtual void startTextLink(const char *file,const char *anchor) = 0; + virtual void endTextLink() = 0; + virtual void startPageRef() = 0; + virtual void endPageRef(const char *,const char *) = 0; + + + /********************* Functions to remove *******************************/ + + virtual void writeMailLink(const char *url) = 0; + virtual void startPreFragment() = 0; + virtual void endPreFragment() = 0; + virtual void startVerbatimFragment() = 0; + virtual void endVerbatimFragment() = 0; + virtual void startSubsection() = 0; + virtual void endSubsection() = 0; + virtual void startSubsubsection() = 0; + virtual void endSubsubsection() = 0; virtual void startSubscript() = 0; virtual void endSubscript() = 0; virtual void startSuperscript() = 0; @@ -254,50 +267,26 @@ class BaseOutputDocInterface : public BaseCodeDocInterface virtual void writeRing(char) = 0; virtual void writeSharpS() = 0; virtual void writeCCedil(char) = 0; - virtual void startSimpleSect(SectionTypes t,const char *file, - const char *anchor,const char *title) = 0; - virtual void endSimpleSect() = 0; - virtual void startParamList(ParamListTypes t,const char *title) = 0; - virtual void endParamList() = 0; virtual void endDescTitle() = 0; - virtual void writeDescItem() = 0; - virtual void startTitle() = 0; - virtual void endTitle() = 0; - virtual void writeAnchor(const char *fileName,const char *name) = 0; - virtual void startSection(const char *,const char *,SectionInfo::SectionType) = 0; - virtual void endSection(const char *,SectionInfo::SectionType) = 0; virtual void writeSectionRef(const char *,const char *, const char *,const char *) = 0; virtual void writeSectionRefItem(const char *,const char *,const char *) = 0; - virtual void lineBreak() = 0; - virtual void addIndexItem(const char *s1,const char *s2) = 0; - virtual void writeFormula(const char *,const char *) = 0; - virtual void writeNonBreakableSpace(int) = 0; + virtual void startEnumList() = 0; + + virtual void endEnumList() = 0; virtual void startImage(const char *,const char *,bool) = 0; virtual void endImage(bool) = 0; virtual void startDotFile(const char *,bool) = 0; virtual void endDotFile(bool) = 0; - virtual void startDescTable() = 0; - virtual void endDescTable() = 0; - virtual void startDescTableTitle() = 0; - virtual void endDescTableTitle() = 0; - virtual void startDescTableData() = 0; - virtual void endDescTableData() = 0; - virtual void startTextLink(const char *file,const char *anchor) = 0; - virtual void endTextLink() = 0; - virtual void startPageRef() = 0; - virtual void endPageRef(const char *,const char *) = 0; - - - + virtual void writeFormula(const char *,const char *) = 0; virtual void startHtmlOnly() = 0; virtual void endHtmlOnly() = 0; virtual void startLatexOnly() = 0; virtual void endLatexOnly() = 0; - virtual void startSectionRefList() = 0; virtual void endSectionRefList() = 0; + /************************************************************************/ }; diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index 20595bc..9e2247f 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -147,11 +147,6 @@ class PrintDocVisitor : public DocVisitor indent_leaf(); printf("",a->anchor().data()); } - void visit(DocCopy *c) - { - indent_leaf(); - printf("",c->link().data()); - } void visit(DocInclude *inc) { indent_leaf(); @@ -456,7 +451,14 @@ class PrintDocVisitor : public DocVisitor void visitPre(DocImage *img) { indent_pre(); - printf("\n",img->name().data()); + printf("name().data()); + switch(img->type()) + { + case DocImage::Html: printf("html"); break; + case DocImage::Latex: printf("latex"); break; + case DocImage::Rtf: printf("rtf"); break; + } + printf("\" width=%s height=%s>\n",img->width().data(),img->height().data()); } void visitPost(DocImage *) { @@ -539,11 +541,12 @@ class PrintDocVisitor : public DocVisitor { printf("%s",s); } + printf("\n"); } void visitPost(DocParamList *) { indent_post(); - printf(""); + printf("\n"); } void visitPre(DocParamSect *ps) { @@ -556,23 +559,23 @@ class PrintDocVisitor : public DocVisitor case DocParamSect::Exception: printf("exception"); break; case DocParamSect::Unknown: printf("unknown"); break; } - printf(">"); + printf(">\n"); } void visitPost(DocParamSect *) { indent_post(); - printf(""); + printf("\n"); } void visitPre(DocXRefItem *x) { indent_pre(); - printf("", + printf("\n", x->file().data(),x->anchor().data(),x->title().data()); } void visitPost(DocXRefItem *) { indent_post(); - printf(""); + printf("\n"); } void visitPre(DocInternalRef *r) { @@ -584,6 +587,16 @@ class PrintDocVisitor : public DocVisitor indent_post(); printf("\n"); } + void visitPre(DocCopy *c) + { + indent_pre(); + printf("\n",c->link().data()); + } + void visitPost(DocCopy *) + { + indent_post(); + printf("\n"); + } private: // helper functions diff --git a/src/scanner.l b/src/scanner.l index ca13399..17dd7be 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -383,7 +383,7 @@ static QCString extractName(const QCString &s) static void setContext() { QCString fileName = yyFileName; - insideIDL = fileName.right(4)==".idl"; + insideIDL = fileName.right(4)==".idl" || fileName.right(4)==".odl"; insideJava = fileName.right(5)==".java"; insidePHP = fileName.right(4)==".php" || fileName.right(4)==".inc"; if ( insidePHP ) @@ -461,9 +461,12 @@ static void addSpecialItem(const char *listName) QCString cmdString; cmdString.sprintf("\\%s %d\n",listName,itemId); current->doc += cmdString; + QCString tmpName = current->name; + current->name = listName; sectionType=SectionInfo::Anchor; sectionLabel=anchorLabel; addSection(); + current->name = tmpName; } current->brief = slString.copy(); // restore orginial brief desc. } @@ -900,35 +903,59 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) BEGIN( CompoundName ); } {B}*"module"{BN}+ { - isTypedef=FALSE; - current->section = Entry::NAMESPACE_SEC; - current->type = "module" ; - current->fileName = yyFileName; - current->startLine = yyLineNr; - current->bodyLine = yyLineNr; lineCount(); - BEGIN( CompoundName ); + if (insideIDL) + { + isTypedef=FALSE; + current->section = Entry::NAMESPACE_SEC; + current->type = "module" ; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + BEGIN( CompoundName ); + } + else + { + addType( current ) ; + current->name = QCString(yytext).stripWhiteSpace(); + } } {B}*"library"{BN}+ { - isTypedef=FALSE; - current->section = Entry::NAMESPACE_SEC; - current->type = "library" ; - current->fileName = yyFileName; - current->startLine = yyLineNr; - current->bodyLine = yyLineNr; lineCount(); - BEGIN( CompoundName ); + if (insideIDL) + { + isTypedef=FALSE; + current->section = Entry::NAMESPACE_SEC; + current->type = "library" ; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + BEGIN( CompoundName ); + } + else + { + addType( current ) ; + current->name = QCString(yytext).stripWhiteSpace(); + } } {B}*((("disp")?"interface")|"valuetype"){BN}+ { // M$/Corba IDL interface - isTypedef=FALSE; - current->section = Entry::INTERFACE_SEC; - addType( current ) ; - current->type += " interface" ; - current->fileName = yyFileName; - current->startLine = yyLineNr; - current->bodyLine = yyLineNr; lineCount(); - BEGIN( CompoundName ); + if (insideIDL) + { + isTypedef=FALSE; + current->section = Entry::INTERFACE_SEC; + addType( current ) ; + current->type += " interface" ; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + BEGIN( CompoundName ); + } + else + { + addType( current ) ; + current->name = QCString(yytext).stripWhiteSpace(); + } } {B}*"exception"{BN}+ { // Corba IDL exception isTypedef=FALSE; @@ -950,19 +977,31 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) current->fileName = yyFileName; current->startLine = yyLineNr; current->bodyLine = yyLineNr; - //if (current->mtArgList) // transfer template arguments - //{ - // if (current->tArgList) - // { - // delete current->tArgList; - // } - // current->tArgList = current->mtArgList; - // current->mtArgList = 0; - //} lineCount() ; if (yytext[yyleng-1]=='{') unput('{'); BEGIN( CompoundName ) ; } +{B}*"coclass"{BN}+ { + if (insideIDL) + { + isTypedef=FALSE; + current->section = Entry::CLASS_SEC; + addType( current ) ; + current->type += " coclass" ; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + lineCount() ; + BEGIN( CompoundName ) ; + } + else + { + addType(current); + current->name = yytext; + current->name = current->name.stripWhiteSpace(); + lineCount(); + } + } {B}*(("typedef"{BN}+)?)("volatile"{BN}+)?"struct{" | {B}*(("typedef"{BN}+)?)("volatile"{BN}+)?"struct"/{BN}+ { isTypedef=((QCString)yytext).find("typedef")!=-1; @@ -4482,7 +4521,8 @@ static void parseCompounds(Entry *rt) { if (ce->fileName.right(5)==".java" || ce->fileName.right(4)==".php" || - ce->fileName.right(4)==".inc") + ce->fileName.right(4)==".inc" + ) current->protection = protection = Public ; // Actually this should be package scope! else current->protection = protection = Private ; diff --git a/src/translator_ca.h b/src/translator_ca.h new file mode 100644 index 0000000..51c5969 --- /dev/null +++ b/src/translator_ca.h @@ -0,0 +1,1405 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2002 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#ifndef TRANSLATOR_CA_H +#define TRANSLATOR_CA_H + +// When defining a translator class for the new language, follow +// the description in the documentation. One of the steps says +// that you should copy the translator_en.h (this) file to your +// translator_xx.h new file. Your new language should use the +// Translator class as the base class. This means that you need to +// implement exactly the same (pure virtual) methods as the +// TranslatorEnglish does. Because of this, it is a good idea to +// start with the copy of TranslatorEnglish and replace the strings +// one by one. +// +// It is not necessary to include "translator.h" or +// "translator_adapter.h" here. The files are included in the +// language.cpp correctly. Not including any of the mentioned +// files frees the maintainer from thinking about whether the +// first, the second, or both files should be included or not, and +// why. This holds namely for localized translators because their +// base class is changed occasionaly to adapter classes when the +// Translator class changes the interface, or back to the +// Translator class (by the local maintainer) when the localized +// translator is made up-to-date again. + +class TranslatorCatalan : public Translator +{ + public: + + // --- Language control methods ------------------- + + /*! Used for identification of the language. The identification + * should not be translated. It should be replaced by the name + * of the language in English using lower-case characters only + * (e.g. "czech", "japanese", "russian", etc.). It should be equal to + * the identification used in language.cpp. + */ + virtual QCString idLanguage() + { return "catalan"; } + + /*! Used to get the LaTeX command(s) for the language support. + * This method should return string with commands that switch + * LaTeX to the desired language. For example + *
      "\\usepackage[german]{babel}\n"
      +     *  
      + * or + *
      "\\usepackage{polski}\n"
      +     *  "\\usepackage[latin2]{inputenc}\n"
      +     *  "\\usepackage[T1]{fontenc}\n"
      +     *  
      + * + * The English LaTeX does not use such commands. Because of this + * the empty string is returned in this implementation. + */ + virtual QCString latexLanguageSupportCommand() + { + return "\\usepackage[catalan]{babel} \n\\usepackage[latin1]{inputenc}"; + } + + /*! return the language charset. This will be used for the HTML output */ + virtual QCString idLanguageCharset() + { + return "iso-8859-1"; + } + + // --- Language translation methods ------------------- + + /*! used in the compound documentation before a list of related functions. */ + virtual QCString trRelatedFunctions() + { return "Funcions Associades"; } + + /*! subscript for the related functions. */ + virtual QCString trRelatedSubscript() + { return "(Remarcar que aquestes funcions no són funcions membre.)"; } + + /*! header that is put before the detailed description of files, classes and namespaces. */ + virtual QCString trDetailedDescription() + { return "Descripció detallada"; } + + /*! header that is put before the list of typedefs. */ + virtual QCString trMemberTypedefDocumentation() + { return "Documentació de les Definicions de Tipus membre"; } + + /*! header that is put before the list of enumerations. */ + virtual QCString trMemberEnumerationDocumentation() + { return "Documentació de les Enumeracions membre"; } + + /*! header that is put before the list of member functions. */ + virtual QCString trMemberFunctionDocumentation() + { return "Documentació de les Funcions membre"; } + + /*! header that is put before the list of member attributes. */ + virtual QCString trMemberDataDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Documentació dels camps"; + } + else + { + return "Documentació de les dades membre"; + } + } + + /*! this is the text of a link put after brief descriptions. */ + virtual QCString trMore() + { return "Més..."; } + + /*! put in the class documentation */ + virtual QCString trListOfAllMembers() + { return "Llista de tots els membres."; } + + /*! used as the title of the "list of all members" page of a class */ + virtual QCString trMemberList() + { return "Llista dels membres"; } + + /*! this is the first part of a sentence that is followed by a class name */ + virtual QCString trThisIsTheListOfAllMembers() + { return "Aquesta és la llista complerta dels membres de "; } + + /*! this is the remainder of the sentence after the class name */ + virtual QCString trIncludingInheritedMembers() + { return ", incloent tots els membres heretats."; } + + /*! this is put at the author sections at the bottom of man pages. + * parameter s is name of the project name. + */ + virtual QCString trGeneratedAutomatically(const char *s) + { QCString result="Generat automàticament per Doxygen"; + if (s) result+=(QCString)" per a "+s; + result+=" a partir del codi font."; + return result; + } + + /*! put after an enum name in the list of all members */ + virtual QCString trEnumName() + { return "nom de la enum"; } + + /*! put after an enum value in the list of all members */ + virtual QCString trEnumValue() + { return "valors de la enum"; } + + /*! put after an undocumented member in the list of all members */ + virtual QCString trDefinedIn() + { return "definit a"; } + + // 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). + */ + virtual QCString trModules() + { return "Mòduls"; } + + /*! This is put above each page as a link to the class hierarchy */ + virtual QCString trClassHierarchy() + { return "Jerarquia de Classes"; } + + /*! This is put above each page as a link to the list of annotated classes */ + virtual QCString trCompoundList() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estructures de Dades"; + } + else + { + return "Llistes Compostes"; + } + } + + /*! This is put above each page as a link to the list of documented files */ + virtual QCString trFileList() + { return "Llista dels arxius"; } + + /*! This is put above each page as a link to the list of all verbatim headers */ + virtual QCString trHeaderFiles() + { return "Fitxers d'encapçalaments"; } + + /*! This is put above each page as a link to all members of compounds. */ + virtual QCString trCompoundMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Camps de dades"; + } + else + { + return "Membres compostos"; + } + } + + /*! This is put above each page as a link to all members of files. */ + virtual QCString trFileMembers() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Globals"; + } + else + { + return "Arxius membres"; + } + } + + /*! This is put above each page as a link to all related pages. */ + virtual QCString trRelatedPages() + { return "Pàgines relacionades"; } + + /*! This is put above each page as a link to all examples. */ + virtual QCString trExamples() + { return "Exemples"; } + + /*! This is put above each page as a link to the search engine. */ + virtual QCString trSearch() + { return "Cerca"; } + + /*! This is an introduction to the class hierarchy. */ + virtual QCString trClassHierarchyDescription() + { return "Aquesta llista d'herència està ordenada toscament, " + "però no completa, de forma alfabètica:"; + } + + /*! This is an introduction to the list with all files. */ + virtual QCString trFileListDescription(bool extractAll) + { + QCString result="Aquesta és la llista de tots els arxius "; + if (!extractAll) result+="documentats "; + result+="acompanyats amb breus descripcions:"; + return result; + } + + /*! This is an introduction to the annotated compound list. */ + virtual QCString trCompoundListDescription() + { + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Aquestes són les estructures de dades acompanyades amb breus descripcions:"; + } + else + { + return "Aquestes són les classes, estructures, " + "unions i interfícies acompnyades amb breus descripcions:"; + } + } + + /*! This is an introduction to the page with all class members. */ + virtual QCString trCompoundMembersDescription(bool extractAll) + { + QCString result="Aquesta és la llista de tots els "; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="camps d'estructures i unions"; + } + else + { + result+="membres de classe"; + } + if (!extractAll) + { + result+="documentats "; + } + result+=" amb enllaços a "; + if (extractAll) + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="la documentació de l'estructura/unió per a cada camp:"; + } + else + { + result+="la documentació de la classe per a cada membre:"; + } + } + else + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="les estructures/unions que pertanyen a:"; + } + else + { + result+="les classes que pertanyen:"; + } + } + return result; + } + /*! This is an introduction to the page with all file members. */ + virtual QCString trFileMembersDescription(bool extractAll) + { + QCString result="Aquesta és la llista de "; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="totes les funcions, variables, definicions, enumeracions, i definicions de tipus"; + if (!extractAll) result+="documentades "; + } + else + { + result+="tots els membres de l'arxiu"; + if (!extractAll) result+="documentat "; + } + result+=" amb enllaços "; + if (extractAll) + result+="als arxius als quals corresponen:"; + else + result+="a la documentació:"; + return result; + } + + /*! This is an introduction to the page with the list of all header files. */ + virtual QCString trHeaderFilesDescription() + { return "Aquesta és la llista d'arxius d'encapçalament que ofereix l'API:"; } + + /*! This is an introduction to the page with the list of all examples */ + virtual QCString trExamplesDescription() + { return "Aquesta és la llista de tots els exemples:"; } + + /*! This is an introduction to the page with the list of related pages */ + virtual QCString trRelatedPagesDescription() + { return "Aquesta és la llista de totes les pàgines de documentació associades:"; } + + /*! This is an introduction to the page with the list of class/file groups */ + virtual QCString trModulesDescription() + { return "Aquesta és la llista de mòduls:"; } + + /*! This sentences is used in the annotated class/file lists if no brief + * description is given. + */ + virtual QCString trNoDescriptionAvailable() + { return "No hi ha cap descripció disponible"; } + + // index titles (the project name is prepended for these) + + + /*! This is used in HTML as the title of index.html. */ + virtual QCString trDocumentation() + { return "Documentació"; } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all groups. + */ + virtual QCString trModuleIndex() + { return "Índex de Mòduls"; } + + /*! This is used in LaTeX as the title of the chapter with the + * class hierarchy. + */ + virtual QCString trHierarchicalIndex() + { return "Índex Jeràrquic"; } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index. + */ + virtual QCString trCompoundIndex() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Índex d'Estructures de Dades"; + } + else + { + return "Índex Compost"; + } + } + + /*! This is used in LaTeX as the title of the chapter with the + * list of all files. + */ + virtual QCString trFileIndex() + { return "Índex d'Arxius"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all groups. + */ + virtual QCString trModuleDocumentation() + { return "Documentació dels mòduls"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all classes, structs and unions. + */ + virtual QCString trClassDocumentation() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Documentació de les Estructures de Dades"; + } + else + { + return "Documentació de les Classes"; + } + } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all files. + */ + virtual QCString trFileDocumentation() + { return "Documentació dels Arxius"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all examples. + */ + virtual QCString trExampleDocumentation() + { return "Documentació dels Exemples"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all related pages. + */ + virtual QCString trPageDocumentation() + { return "Documentació de les pàgines"; } + + /*! This is used in LaTeX as the title of the document */ + virtual QCString trReferenceManual() + { return "Manual de Referència"; } + + /*! This is used in the documentation of a file as a header before the + * list of defines + */ + virtual QCString trDefines() + { return "Definicions"; } + + /*! This is used in the documentation of a file as a header before the + * list of function prototypes + */ + virtual QCString trFuncProtos() + { return "Prototipus de Funcions"; } + + /*! This is used in the documentation of a file as a header before the + * list of typedefs + */ + virtual QCString trTypedefs() + { return "Definicions de Tipus"; } + + /*! This is used in the documentation of a file as a header before the + * list of enumerations + */ + virtual QCString trEnumerations() + { return "Enumeracions"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) functions + */ + virtual QCString trFunctions() + { return "Funcions"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trVariables() + { return "Variables"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) variables + */ + virtual QCString trEnumerationValues() + { return "Valors de les Enumeracions"; } + + /*! This is used in the documentation of a file before the list of + * documentation blocks for defines + */ + virtual QCString trDefineDocumentation() + { return "Documentació de les Definicions"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for function prototypes + */ + virtual QCString trFunctionPrototypeDocumentation() + { return "Documentació de les Funcions Prototipus"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for typedefs + */ + virtual QCString trTypedefDocumentation() + { return "Documentació de les Definicions de Tipus"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration types + */ + virtual QCString trEnumerationTypeDocumentation() + { return "Documentació dels Tipus de les Enumeracions"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Documentació dels Valors de les Enumeracions"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for functions + */ + virtual QCString trFunctionDocumentation() + { return "Documentació de les Funcions"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for variables + */ + virtual QCString trVariableDocumentation() + { return "Documentació de les Variables"; } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds + */ + virtual QCString trCompounds() + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estructures de Dades"; + } + else + { + return "Compostos"; + } + } + + /*! This is used in the standard footer of each page and indicates when + * the page was generated + */ + virtual QCString trGeneratedAt(const char *date,const char *projName) + { + QCString result=(QCString)"Generat a "+date; + if (projName) result+=(QCString)" per a "+projName; + result+=(QCString)" per"; + return result; + } + /*! This is part of the sentence used in the standard footer of each page. + */ + virtual QCString trWrittenBy() + { + return "escrit per"; + } + + /*! this text is put before a class diagram */ + virtual QCString trClassDiagram(const char *clName) + { + return (QCString)"Diagrama d'Herència per a "+clName+":"; + } + + /*! this text is generated when the \\internal command is used. */ + virtual QCString trForInternalUseOnly() + { return "Tan sols per a ús intern."; } + + /*! this text is generated when the \\reimp command is used. */ + virtual QCString trReimplementedForInternalReasons() + { return "Reimplementat per raons internes; l'API no es veu afectada."; } + + /*! this text is generated when the \\warning command is used. */ + virtual QCString trWarning() + { return "Atenció"; } + + /*! this text is generated when the \\bug command is used. */ + virtual QCString trBugsAndLimitations() + { return "Errors i limitacions"; } + + /*! this text is generated when the \\version command is used. */ + virtual QCString trVersion() + { return "Versió"; } + + /*! this text is generated when the \\date command is used. */ + virtual QCString trDate() + { return "Data"; } + + /*! this text is generated when the \\return command is used. */ + virtual QCString trReturns() + { return "Retorna"; } + + /*! this text is generated when the \\sa command is used. */ + virtual QCString trSeeAlso() + { return "Mireu també"; } + + /*! this text is generated when the \\param command is used. */ + virtual QCString trParameters() + { return "Paràmetres"; } + + /*! this text is generated when the \\exception command is used. */ + virtual QCString trExceptions() + { return "Excepcions"; } + + /*! this text is used in the title page of a LaTeX document. */ + virtual QCString trGeneratedBy() + { return "Generat per"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + /*! used as the title of page containing all the index of all namespaces. */ + virtual QCString trNamespaceList() + { return "Llista dels Espais de Noms"; } + + /*! used as an introduction to the namespace list */ + virtual QCString trNamespaceListDescription(bool extractAll) + { + QCString result="Aquests són tots els espais de noms "; + if (!extractAll) result+="documentats "; + result+="amb breus descripcions:"; + return result; + } + + /*! used in the class documentation as a header before the list of all + * friends of a class + */ + virtual QCString trFriends() + { return "Classes Amigues"; } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + /*! used in the class documentation as a header before the list of all + * related classes + */ + virtual QCString trRelatedFunctionDocumentation() + { return "Documentació de funcions amigues i relacionades"; } + +////////////////////////////////////////////////////////////////////////// +// 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, + bool isTemplate) + { + QCString result="Referència de la"; + switch(compType) + { + case ClassDef::Class: result+=" Classe "; break; + case ClassDef::Struct: result+=" Estructura "; break; + case ClassDef::Union: result+=" Unió "; break; + case ClassDef::Interface: result+=" Interfície "; break; + case ClassDef::Exception: result+=" Excepció "; break; + } + if (isTemplate) result+="Template "; + result+=(QCString)clName; + return result; + } + + /*! used as the title of the HTML page of a file */ + virtual QCString trFileReference(const char *fileName) + { + QCString result="Referència de l'Arxiu "; + result+=fileName; + return result; + } + + /*! used as the title of the HTML page of a namespace */ + virtual QCString trNamespaceReference(const char *namespaceName) + { + QCString result="Referència de l'Espai de Noms "; + result+=namespaceName; + return result; + } + + virtual QCString trPublicMembers() + { return "Mètodes públics"; } + virtual QCString trPublicSlots() + { return "Slots públics"; } + virtual QCString trSignals() + { return "Senyals"; } + virtual QCString trStaticPublicMembers() + { return "Mètodes Públics Estàtics"; } + virtual QCString trProtectedMembers() + { return "Mètodes Protegits"; } + virtual QCString trProtectedSlots() + { return "Slots Protegits"; } + virtual QCString trStaticProtectedMembers() + { return "Mètodes Protegits Estàtics"; } + virtual QCString trPrivateMembers() + { return "Mètodes Privats"; } + virtual QCString trPrivateSlots() + { return "Slots Privats"; } + virtual QCString trStaticPrivateMembers() + { return "Mètodes Privats Estàtics"; } + + /*! 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