From 6c380ba91ae41c6d5c409a5163119318932ae2a3 Mon Sep 17 00:00:00 2001 From: Dmitry Soloviev Date: Mon, 13 Feb 2017 15:30:52 +0100 Subject: Add support for std::shared_ptr --- src/doxygen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index d3554cf..e6d655c 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -342,6 +342,7 @@ static STLInfo g_stlinfo[] = { "auto_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // deprecated { "smart_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 { "unique_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 + { "shared_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++14 { "weak_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11 { "ios_base", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 { "error_code", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11 @@ -515,7 +516,7 @@ static void addSTLClasses(EntryNav *rootNav) { addSTLMember(classEntryNav,info->templType2,info->templName2); } - if (fullName=="std::auto_ptr" || fullName=="std::smart_ptr" || + if (fullName=="std::auto_ptr" || fullName=="std::smart_ptr" || fullName=="std::shared_ptr" || fullName=="std::unique_ptr" || fullName=="std::weak_ptr") { Entry *memEntry = new Entry; -- cgit v0.12 From 65a3129eea3d3f807fa6a641087c26c3d0100eac Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 18 Jun 2018 18:51:21 +0200 Subject: Bug 734308 - Error message when using memberof in a C macro Made a better warning message, a 'define' is a global setting and cannot be made a member of a struct / class. --- src/classdef.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/classdef.cpp b/src/classdef.cpp index 4977760..1af4700 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -671,6 +671,10 @@ void ClassDef::internalInsertMember(MemberDef *md, case MemberType_Variable: addMemberToList(MemberListType_variableMembers,md,FALSE); break; + case MemberType_Define: + warn(md->getDefFileName(),md->getDefLine()-1,"A define (%s) cannot be made a member of %s", + md->name().data(), this->name().data()); + break; default: err("Unexpected member type %d found!\n",md->memberType()); } -- cgit v0.12 From 7e185a2e25e4bdbac422299f029a68d1c0c70d6e Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 10 Jul 2018 15:11:10 +0200 Subject: Section label with minus sign not recognized properly. This is a regression on: Bug 740046 - Negative sign in -Foo::Bar ruins hyperlink in generated output only the first character is has to be handled in the new way. (Reference to old github pull request #704 and issue #5677) --- src/doctokenizer.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index e6b8865..590bbe1 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -388,7 +388,7 @@ LNKWORD3 ([0-9a-z_A-Z\-]+("/"|"\\"))*[0-9a-z_A-Z\-]+("."[0-9a-z_A-Z]+)+ CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."='] ESCWORD ("%"{ID}(("::"|"."){ID})*)|("%'") CHARWORDQ1 [^ \-+0-9\t\n\r\\@<>()\[\]:;\?{}&%$#,."='] -WORD1 {ESCWORD}|{CHARWORDQ1}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"") +WORD1 {ESCWORD}|{CHARWORDQ1}{CHARWORDQ}*|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"") WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'" WORD1NQ {ESCWORD}|{CHARWORDQ}+|"{"|"}" WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'" -- cgit v0.12 From 657a6b5348d453fd1351b8c3238426e25acdbbb9 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 14 Jul 2018 16:43:17 +0200 Subject: Bug 520975 - Unnamed parameters parsed incorrectly Added "signed" and "unsigned" to the list of "special types" analogous to "const" and "volatile" Created a function for this that would make it possible to have also constructs like "const const" recognized. --- src/defargs.l | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/defargs.l b/src/defargs.l index 7f1e1bb..f925ffb 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -52,6 +52,7 @@ #include #include #include +#include #include "defargs.h" #include "entry.h" @@ -102,6 +103,17 @@ static int yyread(char *buf,int max_size) return c; } +/* bug_520975 */ +static bool checkSpecialType(QCString &typ) +{ + QStringList qsl=QStringList::split(' ',typ); + for(uint j=0;jtype.mid(sv)=="union" || a->type.mid(sv)=="class" || a->type.mid(sv)=="typename" || - a->type=="const" || - a->type=="volatile" + checkSpecialType(a->type) ) { a->type = a->type + " " + a->name; -- cgit v0.12 From 7ef7b137d38d7ddcbcef787704317531b44c2baf Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 14 Jul 2018 19:28:02 +0200 Subject: Bug 436883 - Handling of unnamed parameters (C/C++) unclear Also the name should not be a reserved type of word. --- src/defargs.l | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/defargs.l b/src/defargs.l index f925ffb..47fa763 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -104,8 +104,10 @@ static int yyread(char *buf,int max_size) } /* bug_520975 */ -static bool checkSpecialType(QCString &typ) +static bool checkSpecialType(QCString &typ, QCString &nam) { + if (nam == "unsigned" || nam == "signed" || + nam == "volatile" || nam == "const") return TRUE; QStringList qsl=QStringList::split(' ',typ); for(uint j=0;jtype.mid(sv)=="union" || a->type.mid(sv)=="class" || a->type.mid(sv)=="typename" || - checkSpecialType(a->type) + checkSpecialType(a->type, a->name) ) { a->type = a->type + " " + a->name; -- cgit v0.12 From d9b93a377237efd3f60186c5ba2ba344d4439173 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 20 Jul 2018 19:33:28 +0200 Subject: Bug 579628 - Merging of consecutive repeated commands creates poorly-structured HTML Most issues from this report were already implemented. Extended for cross reference lists with the possibility to "style" intermediate items as well. (also some code structure, i.e. mnemonics instead of numbers). --- src/htmldocvisitor.cpp | 105 +++++++++++++++++++++++++++++++-------------- templates/html/doxygen.css | 9 ++++ 2 files changed, 82 insertions(+), 32 deletions(-) diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 6a9c142..a9439c9 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -38,6 +38,31 @@ static const int NUM_HTML_LIST_TYPES = 4; static const char types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"}; +enum contexts_t +{ + NONE, // 0 + STARTLI, // 1 + STARTDD, // 2 + ENDLI, // 3 + ENDDD, // 4 + STARTTD, // 5 + ENDTD, // 6 + INTERLI, // 7 + INTERDD, // 8 + INTERTD // 9 +}; +static const char *contexts[10] = +{ "", // 0 + "startli", // 1 + "startdd", // 2 + "endli", // 3 + "enddd", // 4 + "starttd", // 5 + "endtd", // 6 + "interli", // 7 + "interdd", // 8 + "intertd" // 9 +}; static QCString convertIndexWordToAnchor(const QString &word) { @@ -887,24 +912,24 @@ static int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast) } isFirst=isFirstChildNode((DocParBlock*)p->parent(),p); isLast =isLastChildNode ((DocParBlock*)p->parent(),p); - t=0; + t=NONE; if (isFirst) { if (kind==DocNode::Kind_HtmlListItem || kind==DocNode::Kind_SecRefItem) { - t=1; + t=STARTLI; } else if (kind==DocNode::Kind_HtmlDescData || kind==DocNode::Kind_XRefItem || kind==DocNode::Kind_SimpleSect) { - t=2; + t=STARTDD; } else if (kind==DocNode::Kind_HtmlCell || kind==DocNode::Kind_ParamList) { - t=5; + t=STARTTD; } } if (isLast) @@ -912,18 +937,37 @@ static int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast) if (kind==DocNode::Kind_HtmlListItem || kind==DocNode::Kind_SecRefItem) { - t=3; + t=ENDLI; } else if (kind==DocNode::Kind_HtmlDescData || kind==DocNode::Kind_XRefItem || kind==DocNode::Kind_SimpleSect) { - t=4; + t=ENDDD; } else if (kind==DocNode::Kind_HtmlCell || kind==DocNode::Kind_ParamList) { - t=6; + t=ENDTD; + } + } + if (!isFirst && !isLast) + { + if (kind==DocNode::Kind_HtmlListItem || + kind==DocNode::Kind_SecRefItem) + { + t=INTERLI; + } + else if (kind==DocNode::Kind_HtmlDescData || + kind==DocNode::Kind_XRefItem || + kind==DocNode::Kind_SimpleSect) + { + t=INTERDD; + } + else if (kind==DocNode::Kind_HtmlCell || + kind==DocNode::Kind_ParamList) + { + t=INTERTD; } } break; @@ -931,47 +975,51 @@ static int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast) case DocNode::Kind_AutoListItem: isFirst=isFirstChildNode((DocAutoListItem*)p->parent(),p); isLast =isLastChildNode ((DocAutoListItem*)p->parent(),p); - t=1; // not used + t=STARTLI; // not used break; case DocNode::Kind_SimpleListItem: isFirst=TRUE; isLast =TRUE; - t=1; // not used + t=STARTLI; // not used break; case DocNode::Kind_ParamList: isFirst=TRUE; isLast =TRUE; - t=1; // not used + t=STARTLI; // not used break; case DocNode::Kind_HtmlListItem: isFirst=isFirstChildNode((DocHtmlListItem*)p->parent(),p); isLast =isLastChildNode ((DocHtmlListItem*)p->parent(),p); - if (isFirst) t=1; - if (isLast) t=3; + if (isFirst) t=STARTLI; + if (isLast) t=ENDLI; + if (!isFirst && !isLast) t = INTERLI; break; case DocNode::Kind_SecRefItem: isFirst=isFirstChildNode((DocSecRefItem*)p->parent(),p); isLast =isLastChildNode ((DocSecRefItem*)p->parent(),p); - if (isFirst) t=1; - if (isLast) t=3; + if (isFirst) t=STARTLI; + if (isLast) t=ENDLI; + if (!isFirst && !isLast) t = INTERLI; break; case DocNode::Kind_HtmlDescData: isFirst=isFirstChildNode((DocHtmlDescData*)p->parent(),p); isLast =isLastChildNode ((DocHtmlDescData*)p->parent(),p); - if (isFirst) t=2; - if (isLast) t=4; + if (isFirst) t=STARTDD; + if (isLast) t=ENDDD; + if (!isFirst && !isLast) t = INTERDD; break; case DocNode::Kind_XRefItem: isFirst=isFirstChildNode((DocXRefItem*)p->parent(),p); isLast =isLastChildNode ((DocXRefItem*)p->parent(),p); - if (isFirst) t=2; - if (isLast) t=4; + if (isFirst) t=STARTDD; + if (isLast) t=ENDDD; + if (!isFirst && !isLast) t = INTERDD; break; case DocNode::Kind_SimpleSect: isFirst=isFirstChildNode((DocSimpleSect*)p->parent(),p); isLast =isLastChildNode ((DocSimpleSect*)p->parent(),p); - if (isFirst) t=2; - if (isLast) t=4; + if (isFirst) t=STARTDD; + if (isLast) t=ENDDD; if (isSeparatedParagraph((DocSimpleSect*)p->parent(),p)) // if the paragraph is enclosed with separators it will // be included in
..
so avoid addition paragraph @@ -979,12 +1027,14 @@ static int getParagraphContext(DocPara *p,bool &isFirst,bool &isLast) { isFirst=isLast=TRUE; } + if (!isFirst && !isLast) t = INTERDD; break; case DocNode::Kind_HtmlCell: isFirst=isFirstChildNode((DocHtmlCell*)p->parent(),p); isLast =isLastChildNode ((DocHtmlCell*)p->parent(),p); - if (isFirst) t=5; - if (isLast) t=6; + if (isFirst) t=STARTTD; + if (isLast) t=ENDTD; + if (!isFirst && !isLast) t = INTERTD; break; default: break; @@ -1052,19 +1102,10 @@ void HtmlDocVisitor::visitPre(DocPara *p) } } - // check if this paragraph is the first or last child of a
  • or
    . + // check if this paragraph is the first or last or intermediate child of a
  • or
    . // this allows us to mark the tag with a special class so we can // fix the otherwise ugly spacing. int t; - static const char *contexts[7] = - { "", // 0 - "startli", // 1 - "startdd", // 2 - "endli", // 3 - "enddd", // 4 - "starttd", // 5 - "endtd" // 6 - }; bool isFirst; bool isLast; t = getParagraphContext(p,isFirst,isLast); diff --git a/templates/html/doxygen.css b/templates/html/doxygen.css index 8a1235a..500a70e 100644 --- a/templates/html/doxygen.css +++ b/templates/html/doxygen.css @@ -80,6 +80,15 @@ p.endtd { margin-bottom: 2px; } +p.interli { +} + +p.interdd { +} + +p.intertd { +} + /* @end */ caption { -- cgit v0.12 From bae4bd915ac018c4a3ce681067e0a1a51017e418 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 31 Jul 2018 18:29:25 +0200 Subject: Correct typing error in warning message. --- src/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index 6c7e3d5..0ebb57f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2591,7 +2591,7 @@ QCString dateToString(bool includeTime) static bool warnedOnce=FALSE; if (!warnedOnce) { - warn_uncond("Environment variable SOURCE_DATA_EPOCH must have a value smaller than or equal to %llu; actual value %llu\n",UINT_MAX,epoch); + warn_uncond("Environment variable SOURCE_DATE_EPOCH must have a value smaller than or equal to %llu; actual value %llu\n",UINT_MAX,epoch); warnedOnce=TRUE; } } -- cgit v0.12 From 35b7de3e692b127f8192900e1ae1152221afe76b Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 2 Aug 2018 11:50:32 +0200 Subject: Consistency of environment variables between config and code In a configuration file it was possible to have an environment variable like PROGRAMFILES(X86) but in the code this was not possible. --- src/doctokenizer.l | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index e6b8865..cad9a9f 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -658,7 +658,8 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->text = tagName.mid(text_begin,text_end-text_begin); return TK_RCSTAG; } -"$("{ID}")" { /* environment variable */ +"$("{ID}")" | /* environment variable */ +"$("{ID}"("{ID}"))" { /* environment variable */ QCString name = &yytext[2]; name = name.left(name.length()-1); QCString value = portable_getenv(name); -- cgit v0.12 From b1a7c9f513fd7c15d86d536cad64338dfd2b617c Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 2 Aug 2018 14:54:52 +0200 Subject: Consistency of environment variables between config and code Made consistent with pull request #6420 --- src/doctokenizer.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doctokenizer.l b/src/doctokenizer.l index cad9a9f..0a95661 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -658,8 +658,8 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->text = tagName.mid(text_begin,text_end-text_begin); return TK_RCSTAG; } -"$("{ID}")" | /* environment variable */ -"$("{ID}"("{ID}"))" { /* environment variable */ +"$("{ID}")" | /* environment variable */ +"$("{ID}"("{ID}"))" { /* environment variable */ QCString name = &yytext[2]; name = name.left(name.length()-1); QCString value = portable_getenv(name); -- cgit v0.12 From 43e606f185c7fb334062521eff4905d047f78503 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 5 Aug 2018 11:55:25 +0200 Subject: Include height item in XML output When width and height are given with the `\image` command only the `width=` is placed in the output. contrary to e.g. HTML. This has been corrected. Based on: https://stackoverflow.com/questions/38778067/doxygen-image-tag-size-specification-syntax --- src/xmldocvisitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 93765b1..3a656c9 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -65,7 +65,7 @@ static void visitPreStart(FTextStream &t, const char *cmd, const bool doCaption, { t << " width=\"" << convertToXML(width) << "\""; } - else if (!height.isEmpty()) + if (!height.isEmpty()) { t << " height=\"" << convertToXML(height) << "\""; } -- cgit v0.12 From 7e591135c56c3679c5ee63aa78f6baeae2cde63f Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 6 Aug 2018 19:11:01 +0200 Subject: 'self' keyword in PHP documentation In PHP the word `self` was not color coded and the functions were nor referenced in the CALL / CALLER graphs, / REFERENCES / REFERENCED lists. --- src/code.l | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/code.l b/src/code.l index 2c9b0ae..13d538b 100644 --- a/src/code.l +++ b/src/code.l @@ -1324,7 +1324,9 @@ static void generateFunctionLink(CodeOutputInterface &ol,const char *funcName) //CodeClassDef *ccd=0; ClassDef *ccd=0; QCString locScope=g_classScope; - QCString locFunc=removeRedundantWhiteSpace(funcName); + QString qq=removeRedundantWhiteSpace(funcName); + if (g_insidePHP && qq.startsWith("self::")) qq=qq.mid(4); + QCString locFunc(qq.data()); QCString funcScope; QCString funcWithScope=locFunc; QCString funcWithFullScope=locFunc; -- cgit v0.12 From fb7592546b89471e62f68892c945ab7db98875b6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 9 Aug 2018 12:55:44 +0200 Subject: Possibility to have a \image command inside a tag Enable the possibility to have a `\image` command inside a tag --- src/docparser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e050b3..2f77a31 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1561,6 +1561,9 @@ reparsetoken: doctokenizerYYsetStatePara(); } break; + case CMD_IMAGE: + ((DocPara *)parent) -> handleImage("image"); + break; default: return FALSE; } -- cgit v0.12 From 4682b91364247aafe66b6af472e321511e115e7c Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 9 Aug 2018 19:49:58 +0200 Subject: Inline images Create the possibility of inline images with the `\image` command by means of the option `inline`. --- doc/commands.doc | 6 ++++- src/docbookvisitor.cpp | 10 ++++---- src/docparser.cpp | 47 +++++++++++++++++++++++++++++++---- src/docparser.h | 4 ++- src/htmldocvisitor.cpp | 60 +++++++++++++++++++++++++++++++++++++-------- src/latexdocvisitor.cpp | 59 ++++++++++++++++++++++++++++++++------------ src/printdocvisitor.h | 2 +- src/rtfdocvisitor.cpp | 55 +++++++++++++++++++++++++++-------------- src/rtfdocvisitor.h | 4 +-- src/xmldocvisitor.cpp | 5 ++-- templates/html/doxygen.css | 2 +- templates/latex/doxygen.sty | 6 +++++ 12 files changed, 198 insertions(+), 62 deletions(-) diff --git a/doc/commands.doc b/doc/commands.doc index 6c680ee..a9973ce 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -3052,7 +3052,7 @@ class Receiver \ref cmddocbookonly "\\docbookonly".
    -\section cmdimage \\image ["caption"] [=] +\section cmdimage \\image['{'[option]'}'] ["caption"] [=] \addindex \\image Inserts an image into the documentation. This command is format @@ -3084,6 +3084,10 @@ class Receiver The size specifier in \LaTeX (for example `10cm` or `4in` or a symbolic width like `\\textwidth`). + Currently only the option `inline` is supported. In case the option `inline` is + specified the image is placed "in the line", when a caption s present it is shown + in HTML as tooltip (ignored for the other formats). + Here is example of a comment block: \verbatim diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index ab10da0..78d19a4 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -36,7 +36,7 @@ #include "htmlentity.h" #include "plantuml.h" -static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height) +static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height, const bool inlineImage = FALSE) { QCString tmpStr; t << "
    " << endl; @@ -50,7 +50,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, } else { - t << " width=\"50%\""; + if (!inlineImage) t << " width=\"50%\""; } if (!height.isEmpty()) { @@ -65,7 +65,7 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, } } -static void visitPostEnd(FTextStream &t, const bool hasCaption) +static void visitPostEnd(FTextStream &t, const bool hasCaption, const bool inlineImage = FALSE) { t << endl; if (hasCaption) @@ -910,7 +910,7 @@ void DocbookDocVisitor::visitPre(DocImage *img) { baseName=baseName.right(baseName.length()-i-1); } - visitPreStart(m_t, img -> hasCaption(), baseName, img -> width(), img -> height()); + visitPreStart(m_t, img -> hasCaption(), baseName, img -> width(), img -> height(),img -> isInlineImage()); } else { @@ -924,7 +924,7 @@ void DocbookDocVisitor::visitPost(DocImage *img) if (img->type()==DocImage::DocBook) { if (m_hide) return; - visitPostEnd(m_t, img -> hasCaption()); + visitPostEnd(m_t, img -> hasCaption(),img -> isInlineImage()); // copy the image to the output dir QCString baseName=img->name(); int i; diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e050b3..4cf7c4e 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2962,10 +2962,10 @@ void DocVhdlFlow::parse() //--------------------------------------------------------------------------- DocImage::DocImage(DocNode *parent,const HtmlAttribList &attribs,const QCString &name, - Type t,const QCString &url) : + Type t,const QCString &url, const bool inlineImage) : m_attribs(attribs), m_name(name), m_type(t), m_relPath(g_relPath), - m_url(url) + m_url(url), m_inlineImage(inlineImage) { m_parent = parent; } @@ -5065,13 +5065,50 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type void DocPara::handleImage(const QCString &cmdName) { QCString saveCmdName = cmdName; + bool inlineImage = FALSE; int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", + if (tok==TK_WORD) + { + if (g_token->name == "{") + { + while ((tok=doctokenizerYYlex())==TK_WHITESPACE); + if (g_token->name != "}") // non-empty option string + { + if (g_token->name.lower() != "inline") + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"currently only 'inline' suported as option of %s command", + qPrint(saveCmdName)); + } + else + { + inlineImage = TRUE; + } + while ((tok=doctokenizerYYlex())==TK_WHITESPACE); + } + if (!((tok==TK_WORD) && (g_token->name == "}"))) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected closing '}' at option of %s command", + qPrint(saveCmdName)); + return; + } + tok=doctokenizerYYlex(); + if (tok!=TK_WHITESPACE) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command with option", + qPrint(saveCmdName)); + return; + } + } + } + else + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", qPrint(saveCmdName)); - return; + return; + } } tok=doctokenizerYYlex(); if (tok!=TK_WORD && tok!=TK_LNKWORD) @@ -5110,7 +5147,7 @@ void DocPara::handleImage(const QCString &cmdName) return; } HtmlAttribList attrList; - DocImage *img = new DocImage(this,attrList,findAndCopyImage(g_token->name,t),t); + DocImage *img = new DocImage(this,attrList,findAndCopyImage(g_token->name,t),t,"",inlineImage); m_children.append(img); img->parse(); } diff --git a/src/docparser.h b/src/docparser.h index d7390c2..69259d6 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -737,7 +737,7 @@ class DocImage : public CompAccept public: enum Type { Html, Latex, Rtf, DocBook }; DocImage(DocNode *parent,const HtmlAttribList &attribs, - const QCString &name,Type t,const QCString &url=QCString()); + const QCString &name,Type t,const QCString &url=QCString(), const bool inlineImage = TRUE); Kind kind() const { return Kind_Image; } Type type() const { return m_type; } QCString name() const { return m_name; } @@ -746,6 +746,7 @@ class DocImage : public CompAccept QCString height() const { return m_height; } QCString relPath() const { return m_relPath; } QCString url() const { return m_url; } + bool isInlineImage() const { return m_inlineImage; } const HtmlAttribList &attribs() const { return m_attribs; } void parse(); @@ -757,6 +758,7 @@ class DocImage : public CompAccept QCString m_height; QCString m_relPath; QCString m_url; + bool m_inlineImage; }; /** Node representing a dot file */ diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 6a9c142..6bd5347 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -1485,7 +1485,19 @@ void HtmlDocVisitor::visitPre(DocImage *img) { if (img->type()==DocImage::Html) { - forceEndParagraph(img); + bool inlineImage = img->isInlineImage(); + bool typeSVG = FALSE; + + QCString url = img->url(); + if (url.isEmpty()) + { + typeSVG = (img->name().right(4)==".svg"); + } + else + { + typeSVG = (url.right(4)==".svg"); + } + if (!inlineImage && !typeSVG) forceEndParagraph(img); if (m_hide) return; QString baseName=img->name(); int i; @@ -1493,8 +1505,7 @@ void HtmlDocVisitor::visitPre(DocImage *img) { baseName=baseName.right(baseName.length()-i-1); } - m_t << "
    " << endl; - QCString url = img->url(); + if (!inlineImage && !typeSVG) m_t << "
    " << endl; QCString sizeAttribs; if (!img->width().isEmpty()) { @@ -1516,7 +1527,7 @@ void HtmlDocVisitor::visitPre(DocImage *img) { m_t << "relPath() << img->name() << "\" alt=\"" << baseName << "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) - << "/>" << endl; + << (inlineImage ? " class=\"inline\"" : "/>\n"); } } else @@ -1530,13 +1541,24 @@ void HtmlDocVisitor::visitPre(DocImage *img) { m_t << "relPath()) << "\"" << sizeAttribs << htmlAttribsToString(img->attribs(), TRUE) - << "/>" << endl; + << (inlineImage ? " class=\"inline\"" : "/>\n"); } } if (img->hasCaption()) { - m_t << "
    " << endl; - m_t << getHtmlDirEmbedingChar(getTextDirByConfig(img)); + if (inlineImage) + { + m_t << " title=\""; + } + else + { + m_t << "
    " << endl; + m_t << getHtmlDirEmbedingChar(getTextDirByConfig(img)); + } + } + else if (inlineImage) + { + m_t << "/>" << endl; } } else // other format -> skip @@ -1551,12 +1573,30 @@ void HtmlDocVisitor::visitPost(DocImage *img) if (img->type()==DocImage::Html) { if (m_hide) return; + bool inlineImage = img->isInlineImage(); + bool typeSVG = FALSE; + QCString url = img->url(); + if (url.isEmpty()) + { + typeSVG = (img->name().right(4)==".svg"); + } + else + { + typeSVG = (url.right(4)==".svg"); + } + //if (!inlineImage && img->hasCaption()) if (img->hasCaption()) { - m_t << "
    "; + if (inlineImage) + m_t << "\"/>\n "; + else + m_t << "
    "; + } + if (!inlineImage && !typeSVG) + { + m_t << "
    " << endl; + forceStartParagraph(img); } - m_t << "
    " << endl; - forceStartParagraph(img); } else // other format { diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index d2c4c5d..03f9872 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -48,16 +48,23 @@ static const char *getSectionName(int level) return secLabels[QMIN(maxLevels-1,l)]; } -static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height) +static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height, const bool inlineImage = FALSE) { - if (hasCaption) + if (inlineImage) { - t << "\n\\begin{DoxyImage}\n"; + t << "\n\\begin{DoxyInlineImage}\n"; } else { - t << "\n\\begin{DoxyImageNoCaption}\n" - " \\mbox{"; + if (hasCaption) + { + t << "\n\\begin{DoxyImage}\n"; + } + else + { + t << "\n\\begin{DoxyImageNoCaption}\n" + " \\mbox{"; + } } t << "\\includegraphics"; @@ -80,7 +87,14 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, if (width.isEmpty() && height.isEmpty()) { /* default setting */ - t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]"; + if (inlineImage) + { + t << "[height=\\baselineskip,keepaspectratio=true]"; + } + else + { + t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]"; + } } else { @@ -91,21 +105,36 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, if (hasCaption) { - t << "\n\\doxyfigcaption{"; + if (!inlineImage) + { + t << "\n\\doxyfigcaption{"; + } + else + { + t << "%"; // to catch the caption + } } } -static void visitPostEnd(FTextStream &t, const bool hasCaption) +static void visitPostEnd(FTextStream &t, const bool hasCaption, const bool inlineImage = FALSE) { - t << "}\n"; // end mbox or caption - if (hasCaption) + if (inlineImage) { - t << "\\end{DoxyImage}\n"; + t << "\n\\end{DoxyInlineImage}\n"; } - else{ - t << "\\end{DoxyImageNoCaption}\n"; + else + { + t << "}\n"; // end mbox or caption + if (hasCaption) + { + t << "\\end{DoxyImage}\n"; + } + else + { + t << "\\end{DoxyImageNoCaption}\n"; + } } } @@ -1280,7 +1309,7 @@ void LatexDocVisitor::visitPre(DocImage *img) gfxName=gfxName.left(gfxName.length()-4); } - visitPreStart(m_t,img->hasCaption(), gfxName, img->width(), img->height()); + visitPreStart(m_t,img->hasCaption(), gfxName, img->width(), img->height(), img->isInlineImage()); } else // other format -> skip { @@ -1294,7 +1323,7 @@ void LatexDocVisitor::visitPost(DocImage *img) if (img->type()==DocImage::Latex) { if (m_hide) return; - visitPostEnd(m_t,img->hasCaption()); + visitPostEnd(m_t,img->hasCaption(), img->isInlineImage()); } else // other format { diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index d1dbb74..4d1d765 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -490,7 +490,7 @@ class PrintDocVisitor : public DocVisitor case DocImage::Rtf: printf("rtf"); break; case DocImage::DocBook: printf("docbook"); break; } - printf("\" %s %s>\n",img->width().data(),img->height().data()); + printf("\" %s %s inline=\"%s\">\n",img->width().data(),img->height().data(),img->isInlineImage() ? "yes" : "no"); } void visitPost(DocImage *) { diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index ec6d015..fa7fb64 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -1088,27 +1088,37 @@ void RTFDocVisitor::visitPost(DocHtmlHeader *) void RTFDocVisitor::visitPre(DocImage *img) { DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocImage)}\n"); - includePicturePreRTF(img->name(), img->type()==DocImage::Rtf, img->hasCaption()); + includePicturePreRTF(img->name(), img->type()==DocImage::Rtf, img->hasCaption(), img->isInlineImage()); } - -void RTFDocVisitor::includePicturePreRTF(const QCString name, const bool isTypeRTF, const bool hasCaption) +void RTFDocVisitor::includePicturePreRTF(const QCString name, const bool isTypeRTF, const bool hasCaption, const bool inlineImage) { if (isTypeRTF) { - m_t << "\\par" << endl; - m_t << "{" << endl; - m_t << rtf_Style_Reset << endl; - if (hasCaption || m_lastIsPara) m_t << "\\par" << endl; - m_t << "\\pard \\qc { \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \""; + if (!inlineImage) + { + m_t << "\\par" << endl; + m_t << "{" << endl; + m_t << rtf_Style_Reset << endl; + if (hasCaption || m_lastIsPara) m_t << "\\par" << endl; + m_t << "\\pard \\qc "; + } + m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \""; m_t << name; m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}" << endl; - m_t << "\\par" << endl; - if (hasCaption) + if (!inlineImage) + { + m_t << "\\par" << endl; + if (hasCaption) + { + m_t << "\\pard \\qc \\b"; + m_t << "{Image \\field\\flddirty{\\*\\fldinst { SEQ Image \\\\*Arabic }}{\\fldrslt {\\noproof 1}} "; + } + m_lastIsPara=TRUE; + } + else { - m_t << "\\pard \\qc \\b"; - m_t << "{Image \\field\\flddirty{\\*\\fldinst { SEQ Image \\\\*Arabic }}{\\fldrslt {\\noproof 1}} "; + if (hasCaption) m_t << "{\\comment "; // to prevent caption to be shown } - m_lastIsPara=TRUE; } else // other format -> skip { @@ -1120,22 +1130,29 @@ void RTFDocVisitor::includePicturePreRTF(const QCString name, const bool isTypeR void RTFDocVisitor::visitPost(DocImage *img) { DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocImage)}\n"); - includePicturePostRTF(img->type()==DocImage::Rtf, img->hasCaption()); + includePicturePostRTF(img->type()==DocImage::Rtf, img->hasCaption(), img->isInlineImage()); } -void RTFDocVisitor::includePicturePostRTF(const bool isTypeRTF, const bool hasCaption) +void RTFDocVisitor::includePicturePostRTF(const bool isTypeRTF, const bool hasCaption, const bool inlineImage) { if (isTypeRTF) { if (m_hide) return; - if (hasCaption) + if (inlineImage) { - m_t << "}" < children) static void visitPreStart(FTextStream &t, const char *cmd, const bool doCaption, XmlDocVisitor *parent, QList children, const QCString &name, bool writeType, DocImage::Type type, const QCString &width, - const QCString &height) + const QCString &height, const bool inlineImage = FALSE) { t << "<" << cmd; if (writeType) @@ -69,6 +69,7 @@ static void visitPreStart(FTextStream &t, const char *cmd, const bool doCaption, { t << " height=\"" << convertToXML(height) << "\""; } + if (inlineImage) t << " inline=\"yes\">"; if (doCaption) { t << " caption=\""; @@ -767,7 +768,7 @@ void XmlDocVisitor::visitPre(DocImage *img) { baseName=baseName.right(baseName.length()-i-1); } - visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height()); + visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img ->isInlineImage()); // copy the image to the output dir FileDef *fd; diff --git a/templates/html/doxygen.css b/templates/html/doxygen.css index 8e87381..4b4c8ea 100644 --- a/templates/html/doxygen.css +++ b/templates/html/doxygen.css @@ -343,7 +343,7 @@ img.formulaDsp { } -img.formulaInl { +img.formulaInl, img.inline { vertical-align: middle; } diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty index 7798d48..d0d255c 100644 --- a/templates/latex/doxygen.sty +++ b/templates/latex/doxygen.sty @@ -190,6 +190,12 @@ \end{center}% } +% Used by @image +% (only if inline is specified) +\newenvironment{DoxyInlineImage}{% +}{% +} + % Used by @attention \newenvironment{DoxyAttention}[1]{% \begin{DoxyDesc}{#1}% -- cgit v0.12 From fcb7d9fb380b714e1db9a279ceeba5af4cf59965 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 10 Aug 2018 14:33:14 +0200 Subject: Correcting labels for citations The labels for RTF and XML were incorrect due to the fact that the wrong branch was chosen in the code (the newAnchor was set for the results of the `\cite ` command as well). Small readability issue with XML (when there are a lot of citations). --- src/docparser.cpp | 11 ++++++----- src/xmldocvisitor.cpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e050b3..0a9a10c 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1877,11 +1877,8 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) { warn_doc_error(g_fileName,doctokenizerYYlineno,"Empty anchor label"); } - if (newAnchor) // found
    - { - m_anchor = id; - } - else if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix) + + if (id.left(CiteConsts::anchorPrefix.length()) == CiteConsts::anchorPrefix) { CiteInfo *cite = Doxygen::citeDict->find(id.mid(CiteConsts::anchorPrefix.length())); if (cite) @@ -1896,6 +1893,10 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor) m_file = "invalid"; } } + else if (newAnchor) // found + { + m_anchor = id; + } else // found \anchor label { SectionInfo *sec = Doxygen::sectionDict->find(id); diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 93765b1..adb2e33 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -488,7 +488,7 @@ void XmlDocVisitor::visitPre(DocPara *) void XmlDocVisitor::visitPost(DocPara *) { if (m_hide) return; - m_t << ""; + m_t << "" << endl; } void XmlDocVisitor::visitPre(DocRoot *) -- cgit v0.12 From e2306e7ff24e72d49893eb9ebc568b468298e236 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 10 Aug 2018 14:44:13 +0200 Subject: Correcting labels for citations Corrected change in test. --- testing/012/citelist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/012/citelist.xml b/testing/012/citelist.xml index 96b94a3..f415968 100644 --- a/testing/012/citelist.xml +++ b/testing/012/citelist.xml @@ -9,7 +9,7 @@ - [1] + [1] DonaldE. Knuth. Tex and Metafont, New Directions in Typesetting. American Mathematical Society and Digital Press, Stanford, 1979. -- cgit v0.12 From 09af3e03a55a5b02ebb6254c39a09877c8bd671b Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 11 Aug 2018 11:35:40 +0200 Subject: Bug 748927 - Navigation incorrect with escaped symbols Due to the fact that constructs like `` in a page title are seen as an XML-tag (with a resulting warning) the `<` should be escaped but this leads to the fact that the escape sign is shown in the bars on top of a HTML page. The basic problem is due to the fact that page titles are not really interpreted by doxygen (as "nothing" can be, generically, handled in the title of a page. --- src/commentscan.l | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commentscan.l b/src/commentscan.l index e40d80f..6d3bec0 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1588,8 +1588,12 @@ RCSTAG "$"{ID}":"[^\n$]+"$" . { // ignore other stuff } .*"\n" { // second argument; page title - yyLineNr++; - current->args = yytext; + yyLineNr++; + // bug 748927 + QCString tmp = yytext; + tmp = substitute(substitute(tmp,"@<","<"),"@>",">"); + tmp = substitute(substitute(tmp,"\\<","<"),"\\>",">"); + current->args = tmp; addOutput('\n'); BEGIN( Comment ); } -- cgit v0.12 From 7508151230301113cf6531bfe631472fa4513d19 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 11 Aug 2018 16:28:18 +0200 Subject: Bug 634830 - Automatic links don't work correctly with operator< and operator<= A longer match was chosen by 'lex' resulting in that 'operator<' and 'operator<=' and the first argument were not correctly linked and color coded. We now test if the "operator" match is present, if so we use the right rule for operator. --- src/code.l | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/code.l b/src/code.l index 2c9b0ae..14a53ff 100644 --- a/src/code.l +++ b/src/code.l @@ -2597,6 +2597,13 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_name+=yytext+7; } {SCOPENAME}{B}*"<"[^\n\/\-\.\{\"\>]*">"("::"{ID})*/{B}* { // A *pt; + if (YY_START==Body) + { + // check for special case that starts with: operator{B}*<[=]?{B}*( + static QRegExp re("operator[ \t]*<[=]?[ \t]*("); + QString qq = yytext; + if (qq.find(re) == 0) REJECT; + } int i=QCString(yytext).find('<'); QCString kw = QCString(yytext).left(i).stripWhiteSpace(); if (kw.right(5)=="_cast" && YY_START==Body) -- cgit v0.12 From ed562f3ed5e3208a1351387441028c7831ad14fd Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 15 Aug 2018 14:40:07 +0200 Subject: Markdown list wrong displayed In some, rare, cases a markdown list was wrongly displayed (regression due to change of place of markdown handling) /** @mainpage * * * elem1 * * elem2 * Some text (actually found due to a table) */ --- src/markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index 0ca95a4..ab145c8 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1949,7 +1949,7 @@ void writeOneLineHeaderOrRuler(GrowBuf &out,const char *data,int size) out.addStr(data,size); if (hasLineBreak(data,size)) { - out.addStr("
    "); + out.addStr("\n"); } } } -- cgit v0.12 From e1a82714155889e16dd761557fb622476755aede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Tue, 21 Aug 2018 14:21:56 +0200 Subject: Update classdef.cpp --- src/classdef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classdef.cpp b/src/classdef.cpp index 657968e..6ad5534 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1223,7 +1223,7 @@ void ClassDef::writeInheritanceGraph(OutputList &ol) } } else if (Config_getBool(CLASS_DIAGRAMS) && count>0) - // write class diagram using build-in generator + // write class diagram using built-in generator { ClassDiagram diagram(this); // create a diagram of this class. ol.startClassDiagram(); -- cgit v0.12 From 74f0b492ddd3052c93525fc01d1bc56f8edcb0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Tue, 21 Aug 2018 14:23:44 +0200 Subject: Update mangen.cpp --- src/mangen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mangen.cpp b/src/mangen.cpp index d23b2fe..949f218 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -34,7 +34,7 @@ static QCString getExtension() { /* - * [.][nuber][rest] + * [.][number][rest] * in case of . missing, just ignore it * in case number missing, just place a 3 in front of it */ -- cgit v0.12 From 5f004ef003993c4a7928a5b6bff8d5a51dceb715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Tue, 21 Aug 2018 14:24:10 +0200 Subject: Update markdown.cpp --- src/markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index dff64ff..c19d6db 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -406,7 +406,7 @@ static int processEmphasis2(GrowBuf &out, const char *data, int size, char c) return 0; } -/** Parsing tripple emphasis. +/** Parsing triple emphasis. * Finds the first closing tag, and delegates to the other emph */ static int processEmphasis3(GrowBuf &out, const char *data, int size, char c) -- cgit v0.12 From 2863c7e0f3d88cb367ff5ecd79976b169c3322dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Tue, 21 Aug 2018 14:24:46 +0200 Subject: Update pycode.l --- src/pycode.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pycode.l b/src/pycode.l index 1b176d6..dfa383f 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -1311,7 +1311,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT \\. { // espaced char codify(yytext); } - {STRINGPREFIX}?{TRIDOUBLEQUOTE} { // tripple double quotes + {STRINGPREFIX}?{TRIDOUBLEQUOTE} { // triple double quotes codify(yytext); } "'" { // end of the string @@ -1334,7 +1334,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT \\. { // espaced char codify(yytext); } - {STRINGPREFIX}?{TRISINGLEQUOTE} { // tripple single quotes + {STRINGPREFIX}?{TRISINGLEQUOTE} { // triple single quotes codify(yytext); } "\"" { // end of the string -- cgit v0.12 From e93792d42eb5aecefc5fba1af431526d02f62070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Tue, 21 Aug 2018 14:25:05 +0200 Subject: Update pyscanner.l --- src/pyscanner.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyscanner.l b/src/pyscanner.l index 4718e3b..2adf632 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1508,7 +1508,7 @@ STARTDOCSYMS "##" \\. { // espaced char addToString(yytext); } - "\"\"\"" { // tripple double quotes + "\"\"\"" { // triple double quotes addToString(yytext); } "'" { // end of the string @@ -1531,7 +1531,7 @@ STARTDOCSYMS "##" \\. { // espaced char addToString(yytext); } - "'''" { // tripple single quotes + "'''" { // triple single quotes addToString(yytext); } "\"" { // end of the string -- cgit v0.12 From 98c9153820df44f1cf3c1990debd5fe99fb7c893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Tue, 21 Aug 2018 14:29:37 +0200 Subject: Update changelog.doc --- doc/changelog.doc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/changelog.doc b/doc/changelog.doc index 0b245b6..3ba6787 100644 --- a/doc/changelog.doc +++ b/doc/changelog.doc @@ -718,7 +718,7 @@
  • Bug 5569 - Fix a potential null pointer dereference in src/searchindex.cpp [view]
  • Bug 5570 - Fix wrong pointer initialization in src/definition.cpp [view]
  • Bug 5571 - Fix potential modulo by zero in src/template.cpp [view]
  • -
  • Bug 5572 - Reached end of file while still insided a (nested) comment in Markdown [view]
  • +
  • Bug 5572 - Reached end of file while still inside a (nested) comment in Markdown [view]
  • Bug 5573 - Fix a terminating null character after fread in src/filedef.cpp [view]
  • Bug 5574 - Remove not needed variable initialization in src/classdef.cpp [view]
  • Bug 5575 - Remove not needed pointer initialization in src/entry.cpp [view]
  • @@ -2803,7 +2803,7 @@ make sure you add the following:
  • id 3190: dropped support for a4wide paper format for LaTeX, since it is on the LaTeX taboo list.
  • id 3261: Behaviour of CLASS_DIAGRAM=NO in combination with - HAVE_DOT=YES, was not propely documented.
  • + HAVE_DOT=YES, was not properly documented.
  • id 3332: Python comments for next class or method could end up in code of a method/class when enabling INLINE_SOURCES.
  • id 3688: Fixed problem handling nested classes in Python.
  • -- cgit v0.12 From 0fc16d17963c50caa41959cc321d796a931aba44 Mon Sep 17 00:00:00 2001 From: aquayan <42374892+aquayan@users.noreply.github.com> Date: Fri, 24 Aug 2018 09:30:22 +0200 Subject: Update doxygen.cpp Reading a few thousands of input CPP/H files in alphabetical order is very slow because of using the inSort construct. The inSort function does a linear loop through the list to find the right alphabetical position, leading to a quadratic algorithm. During the creation of the file list there is no need to keep it sorted - it is not used at all yet. Therefore I propose to just append them and to a final sort at the end of the creation of the file list. For my use case with several thousands of input files, this reduces creating the file list from about an hour to a few seconds !! --- src/doxygen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index bf93a9b..ed3ffc9 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -9633,7 +9633,7 @@ int readDir(QFileInfo *fi, { fn = new FileName(cfi->absFilePath().utf8(),name); fn->append(fd); - if (fnList) fnList->inSort(fn); + if (fnList) fnList->append(fn); fnDict->insert(name,fn); } } @@ -9732,7 +9732,7 @@ int readFileOrDirectory(const char *s, { fn = new FileName(filePath,name); fn->append(fd); - if (fnList) fnList->inSort(fn); + if (fnList) fnList->append(fn); fnDict->insert(name,fn); } } @@ -10923,6 +10923,7 @@ void searchInputFiles() } s=inputList.next(); } + Doxygen::inputNameList->sort(); delete killDict; g_s.end(); } -- cgit v0.12 From 1f849a16671e1c9afff4ee30a5b5a33d271e8684 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 24 Aug 2018 10:56:38 +0200 Subject: Issue_6456 Using # in links causes errors in PDF generation - The # sign in an URL needs to be escaped as longtabu reads the table body as the argument to a command, so the self-escaping mechanism of \href cannot work (from https://tex.stackexchange.com/questions/447461/having-a-hash-sign-in-href-in-a-longtabu-cell) - a regression regarding the change from `\tt` to `\texttt` (needed `{ ... }` as `\href` has 2 arguments ) --- src/latexdocvisitor.cpp | 14 ++++++++------ src/latexgen.cpp | 4 ++-- src/util.cpp | 19 +++++++++++++++++++ src/util.h | 1 + 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index d2c4c5d..76e3a55 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -215,13 +215,14 @@ void LatexDocVisitor::visit(DocURL *u) if (m_hide) return; if (Config_getBool(PDF_HYPERLINKS)) { + m_t << endl << "%% AME " << u->url() <isEmail()) m_t << "mailto:"; - m_t << u->url() << "}"; + m_t << latexFilterURL(u->url()) << "}"; } - m_t << "\\texttt{ "; + m_t << "{\\texttt{ "; filter(u->url()); - m_t << "}"; + m_t << "}}"; } void LatexDocVisitor::visit(DocLineBreak *) @@ -1245,17 +1246,18 @@ void LatexDocVisitor::visitPre(DocHRef *href) if (m_hide) return; if (Config_getBool(PDF_HYPERLINKS)) { + m_t << endl << "%% AME " << href->url() <url(); + m_t << latexFilterURL(href->url()); m_t << "}"; } - m_t << "\\texttt{ "; + m_t << "{\\texttt{ "; } void LatexDocVisitor::visitPost(DocHRef *) { if (m_hide) return; - m_t << "}"; + m_t << "}}"; } void LatexDocVisitor::visitPre(DocHtmlHeader *header) diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 474d368..6d399c5 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1369,12 +1369,12 @@ void LatexGenerator::startHtmlLink(const char *url) t << url; t << "}"; } - t << "\\texttt{ "; + t << "{\\texttt{ "; } void LatexGenerator::endHtmlLink() { - t << "}"; + t << "}}"; } //void LatexGenerator::writeMailLink(const char *url) diff --git a/src/util.cpp b/src/util.cpp index b387a84..5fc8822 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6964,6 +6964,25 @@ QCString latexEscapePDFString(const char *s) return result.data(); } +QCString latexFilterURL(const char *s) +{ + QGString result; + FTextStream t(&result); + const char *p=s; + char c; + while ((c=*p++)) + { + switch (c) + { + case '#': t << "\\#"; break; + default: + t << c; + break; + } + } + return result.data(); +} + QCString rtfFormatBmkStr(const char *name) { diff --git a/src/util.h b/src/util.h index a9eee67..3626574 100644 --- a/src/util.h +++ b/src/util.h @@ -346,6 +346,7 @@ void filterLatexString(FTextStream &t,const char *str, QCString latexEscapeLabelName(const char *s,bool insideTabbing); QCString latexEscapeIndexChars(const char *s,bool insideTabbing); QCString latexEscapePDFString(const char *s); +QCString latexFilterURL(const char *s); QCString rtfFormatBmkStr(const char *name); -- cgit v0.12 From fdd10f2415c65a9a34d64c985ea5ff0a6f4b6654 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 24 Aug 2018 14:48:56 +0200 Subject: Correction of some coloring of code comments in VHDL, adding data type 'positive' --- src/vhdlcode.l | 69 +++++++++++++++++++++++++++--------------------------- src/vhdldocgen.cpp | 4 ++-- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 68dcafb..ee0731f 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -370,7 +370,7 @@ static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,b //g_code->codify(sp); if (comment) { - writeFont("keyword",line.data()); + writeFont("comment",line.data()); } else { @@ -381,7 +381,7 @@ static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,b else { if (comment) - writeFont("keyword",sp); + writeFont("comment",sp); else writeWord(sp,cl,classlink); done=TRUE; @@ -1478,11 +1478,11 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI writeFont("keyword",vhdlcodeYYtext); } -^{B}*{XILINX}[^\n]* { - writeWord(yytext); - //codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE); - } - +^{B}*{XILINX}/[^a-zA-Z0-9_] { + writeWord(yytext); + //codifyLines(vhdlcodeYYtext,g_CurrClass.data(),TRUE); + } + ^{B}*"set_"[^\n]* { writeWord(yytext); } @@ -1497,37 +1497,38 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI } <*>\n{TEXTT} { // found normal or special comment on its own line - QCString text(vhdlcodeYYtext); - int i=text.find("--"); - if (text.mid(i,3)=="--!" && // hide special comment - Config_getBool(STRIP_CODE_COMMENTS)) - { - g_yyLineNr++; // skip complete line - } - else // normal comment - { - // startFontClass("keyword"); - codifyLines(text,0,FALSE,TRUE); - // endFontClass(); - } + QCString text(vhdlcodeYYtext); + int i=text.find("--"); + if (text.mid(i,3)=="--!") // && // hide special comment + { + if (!Config_getBool(STRIP_CODE_COMMENTS)) + { + codifyLines(text,0,FALSE,TRUE); + } + g_yyLineNr++; // skip complete line + } + else // normal comment + { + codifyLines(text,0,FALSE,TRUE); + } } <*>{TEXTT} { // found normal or special comment after something - QCString text(vhdlcodeYYtext); - int i=text.find("--"); - if (text.mid(i,3)=="--!" && - Config_getBool(STRIP_CODE_COMMENTS)) - { - // hide special comment - } - else // normal comment - { - // startFontClass("keyword"); - codifyLines(text,0,FALSE,TRUE); - // endFontClass(); - } + QCString text(vhdlcodeYYtext); + int i=text.find("--"); + if (text.mid(i,3)=="--!") + { + // hide special comment + if (!Config_getBool(STRIP_CODE_COMMENTS)) + { + codifyLines(text,0,FALSE,TRUE); + } + } + else // normal comment + { + codifyLines(text,0,FALSE,TRUE); + } } - %% /*@ ---------------------------------------------------------------------------- diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 287565b..373e6de 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -602,7 +602,7 @@ const char* g_vhdlKeyWordMap1[] = { "natural","unsigned","signed","string","boolean", "bit","bit_vector","character", "std_ulogic","std_ulogic_vector","std_logic","std_logic_vector","integer", - "real","float","ufixed","sfixed","time",0 + "real","float","ufixed","sfixed","time","positive",0 }; // logic @@ -667,7 +667,7 @@ const char* g_vhdlKeyWordMap3[] = QCString* VhdlDocGen::findKeyWord(const QCString& tmp) { static QCString vhdlkeyword("vhdlkeyword"); - static QCString vhdltype("comment"); + static QCString vhdltype("keywordtype"); static QCString vhdllogic("vhdllogic"); static QCString preprocessor("keywordflow"); -- cgit v0.12 From a68e6c0724f99dfa6cea25f7d56fb6077100fc85 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 26 Aug 2018 13:13:01 +0200 Subject: Correcting warning messages and echoing unknown command - In case an unknown command is given this was shown as a warning but not as normal text in the output, for this also a distinction between `\`and `@` commands has to be made - corrected command name in warning messages when handling arguments - making handling of some warning messages consistent --- src/docparser.cpp | 202 ++++++++++++++++------------------------------------- src/docparser.h | 2 +- src/doctokenizer.h | 3 +- src/doctokenizer.l | 19 ++--- 4 files changed, 72 insertions(+), 154 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index 8efe8fa..2c51507 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -866,7 +866,30 @@ static bool findDocsForMemberOrCompound(const char *commandName, return FALSE; } //--------------------------------------------------------------------------- +inline void errorHandleDefaultToken(DocNode *parent,int tok, + QList &children,const char *txt) +{ + switch (tok) + { + case TK_COMMAND: + case TK_COMMAND1: + children.append(new DocWord(parent,(tok == TK_COMMAND ? '@' : '\\') + g_token->name)); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a %s", + qPrint((tok == TK_COMMAND ? '@' : '\\') + g_token->name), txt); + break; + case TK_SYMBOL: + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found found as part of a %s", + qPrint(g_token->name), txt); + break; + default: + children.append(new DocWord(parent,g_token->name)); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s found as part of a %s", + tokToString(tok), txt); + break; + } +} +//--------------------------------------------------------------------------- // forward declaration static bool defaultHandleToken(DocNode *parent,int tok, QList &children,bool @@ -876,6 +899,7 @@ static int handleStyleArgument(DocNode *parent,QList &children, const QCString &cmdName) { DBG(("handleStyleArgument(%s)\n",qPrint(cmdName))); + QCString saveCmdName = cmdName; int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { @@ -901,14 +925,6 @@ static int handleStyleArgument(DocNode *parent,QList &children, { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s as the argument of a \\%s command", - qPrint(g_token->name),qPrint(cmdName)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found while handling command %s", - qPrint(g_token->name),qPrint(cmdName)); - break; case TK_HTMLTAG: if (insideLI(parent) && Mappers::htmlTagMapper->map(g_token->name) && g_token->endTag) { // ignore
  • as the end of a style command @@ -917,8 +933,7 @@ static int handleStyleArgument(DocNode *parent,QList &children, return tok; break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s while handling command %s", - tokToString(tok),qPrint(cmdName)); + errorHandleDefaultToken(parent,tok,children,"\\" + saveCmdName + " command"); break; } break; @@ -1295,21 +1310,7 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QListname), Mappers::cmdMapper->find(cmd).data()); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(parent,tok,children,Mappers::cmdMapper->find(cmd).data()); } } // parse size attributes @@ -1368,7 +1369,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList &children { DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno)); if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL || - tok==TK_COMMAND || tok==TK_HTMLTAG + tok==TK_COMMAND || tok==TK_COMMAND1 || tok==TK_HTMLTAG ) { DBG((" name=%s",qPrint(g_token->name))); @@ -1379,6 +1380,7 @@ reparsetoken: switch (tok) { case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(tokenName)) { case CMD_BSLASH: @@ -2308,21 +2310,7 @@ void DocSecRefItem::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\refitem", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"\\refitem"); } } doctokenizerYYsetStatePara(); @@ -2370,7 +2358,7 @@ void DocSecRefList::parse() // handle items while (tok) { - if (tok==TK_COMMAND) + if (tok==TK_COMMAND || tok == TK_COMMAND1) { switch (Mappers::cmdMapper->map(g_token->name)) { @@ -2450,21 +2438,7 @@ void DocInternalRef::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\ref", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"\\ref"); } } @@ -2608,19 +2582,10 @@ void DocRef::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\ref", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; case TK_HTMLTAG: break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); + errorHandleDefaultToken(this,tok,m_children,"\\ref"); break; } } @@ -2732,6 +2697,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) switch (tok) { case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(g_token->name)) { case CMD_ENDLINK: @@ -2747,13 +2713,13 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink) } break; case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found as part of a \\link", qPrint(g_token->name)); break; case TK_HTMLTAG: if (g_token->name!="see" || !isXmlLink) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected xml/html command %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected xml/html command %s found as part of a \\link", qPrint(g_token->name)); } goto endlink; @@ -2931,21 +2897,7 @@ void DocVhdlFlow::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a \\vhdlflow", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"\\vhdlflow"); } } tok=doctokenizerYYlex(); @@ -2992,10 +2944,6 @@ int DocHtmlHeader::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a tag", - qPrint(g_token->name),m_level); - break; case TK_HTMLTAG: { int tagId=Mappers::htmlTagMapper->map(g_token->name); @@ -3073,14 +3021,10 @@ int DocHtmlHeader::parse() } break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; + char tmp[20]; + sprintf(tmp,"tag",m_level); + errorHandleDefaultToken(this,tok,m_children,tmp); } } } @@ -3112,14 +3056,6 @@ int DocHRef::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a .. block", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; case TK_HTMLTAG: { @@ -3136,8 +3072,7 @@ int DocHRef::parse() } break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok),doctokenizerYYlineno); + errorHandleDefaultToken(this,tok,m_children,".. block"); break; } } @@ -3271,6 +3206,7 @@ int DocIndexEntry::parse() } break; case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(g_token->name)) { case CMD_BSLASH: m_entry+='\\'; break; @@ -3358,14 +3294,6 @@ int DocHtmlCaption::parse() { switch (tok) { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a tag", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; case TK_HTMLTAG: { int tagId=Mappers::htmlTagMapper->map(g_token->name); @@ -3382,9 +3310,7 @@ int DocHtmlCaption::parse() } break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; + errorHandleDefaultToken(this,tok,m_children," tag"); } } } @@ -3898,6 +3824,7 @@ int DocHtmlDescTitle::parse() switch (tok) { case TK_COMMAND: + case TK_COMMAND1: { QCString cmdName=g_token->name; bool isJavaLink=FALSE; @@ -3908,7 +3835,7 @@ int DocHtmlDescTitle::parse() int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\%s command", qPrint(g_token->name)); } else @@ -3917,7 +3844,7 @@ int DocHtmlDescTitle::parse() tok=doctokenizerYYlex(); // get the reference id if (tok!=TK_WORD) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of \\%s command", tokToString(tok),qPrint(cmdName)); } else @@ -3938,7 +3865,7 @@ int DocHtmlDescTitle::parse() int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after \\%s command", qPrint(cmdName)); } else @@ -3947,7 +3874,7 @@ int DocHtmlDescTitle::parse() tok=doctokenizerYYlex(); if (tok!=TK_WORD) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"unexpected token %s as the argument of \\%s command", tokToString(tok),qPrint(cmdName)); } else @@ -3966,13 +3893,13 @@ int DocHtmlDescTitle::parse() break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a
    tag", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command \\%s found as part of a
    tag", qPrint(g_token->name)); } } break; case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol \\%s found as part of a
    tag", qPrint(g_token->name)); break; case TK_HTMLTAG: @@ -4013,7 +3940,7 @@ int DocHtmlDescTitle::parse() } break; default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s found as part of a
    tag", tokToString(tok)); break; } @@ -4518,21 +4445,7 @@ void DocTitle::parse() { if (!defaultHandleToken(this,tok,m_children)) { - switch (tok) - { - case TK_COMMAND: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Illegal command %s as part of a title section", - qPrint(g_token->name)); - break; - case TK_SYMBOL: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unsupported symbol %s found", - qPrint(g_token->name)); - break; - default: - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected token %s", - tokToString(tok)); - break; - } + errorHandleDefaultToken(this,tok,m_children,"title section"); } } doctokenizerYYsetStatePara(); @@ -5393,7 +5306,7 @@ void DocPara::handleInheritDoc() } -int DocPara::handleCommand(const QCString &cmdName) +int DocPara::handleCommand(const QCString &cmdName, const int tok) { DBG(("handleCommand(%s)\n",qPrint(cmdName))); int retval = RetVal_OK; @@ -5401,6 +5314,7 @@ int DocPara::handleCommand(const QCString &cmdName) switch (cmdId) { case CMD_UNKNOWN: + m_children.append(new DocWord(this,(tok == TK_COMMAND ? '@' : '\\') + cmdName)); warn_doc_error(g_fileName,doctokenizerYYlineno,"Found unknown command `\\%s'",qPrint(cmdName)); break; case CMD_EMPHASIS: @@ -6491,7 +6405,7 @@ int DocPara::parse() reparsetoken: DBG(("token %s at %d",tokToString(tok),doctokenizerYYlineno)); if (tok==TK_WORD || tok==TK_LNKWORD || tok==TK_SYMBOL || tok==TK_URL || - tok==TK_COMMAND || tok==TK_HTMLTAG + tok==TK_COMMAND || tok == TK_COMMAND1 || tok==TK_HTMLTAG ) { DBG((" name=%s",qPrint(g_token->name))); @@ -6589,7 +6503,7 @@ reparsetoken: } else // other section { - tok = TK_COMMAND; + tok = TK_COMMAND1; } DBG(("reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; @@ -6635,6 +6549,7 @@ reparsetoken: } break; case TK_COMMAND: + case TK_COMMAND1: { // see if we have to start a simple section int cmd = Mappers::cmdMapper->map(g_token->name); @@ -6670,7 +6585,7 @@ reparsetoken: } // handle the command - retval=handleCommand(g_token->name); + retval=handleCommand(g_token->name,tok); DBG(("handleCommand returns %x\n",retval)); // check the return value @@ -6688,7 +6603,7 @@ reparsetoken: } else // other section { - tok = TK_COMMAND; + tok = TK_COMMAND1; } DBG(("reparsing command %s\n",qPrint(g_token->name))); goto reparsetoken; @@ -6961,6 +6876,7 @@ void DocText::parse() } break; case TK_COMMAND: + case TK_COMMAND1: switch (Mappers::cmdMapper->map(g_token->name)) { case CMD_BSLASH: diff --git a/src/docparser.h b/src/docparser.h index d7390c2..2e932be 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -1151,7 +1151,7 @@ class DocPara : public CompAccept bool isFirst() const { return m_isFirst; } bool isLast() const { return m_isLast; } - int handleCommand(const QCString &cmdName); + int handleCommand(const QCString &cmdName,const int tok); int handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &tagHtmlAttribs); int handleHtmlEndTag(const QCString &tagName); int handleSimpleSection(DocSimpleSect::Type t,bool xmlContext=FALSE); diff --git a/src/doctokenizer.h b/src/doctokenizer.h index b3b9fa5..d0bdf06 100644 --- a/src/doctokenizer.h +++ b/src/doctokenizer.h @@ -34,12 +34,13 @@ enum Tokens TK_WHITESPACE = 3, TK_LISTITEM = 4, TK_ENDLIST = 5, - TK_COMMAND = 6, + TK_COMMAND = 6, //! Command starting with `@` TK_HTMLTAG = 7, TK_SYMBOL = 8, TK_NEWPARA = 9, TK_RCSTAG = 10, TK_URL = 11, + TK_COMMAND1 = 12, //! Command starting with `\` RetVal_OK = 0x10000, RetVal_SimpleSec = 0x10001, diff --git a/src/doctokenizer.l b/src/doctokenizer.l index a162fb3..dc56ca9 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -122,6 +122,7 @@ const char *tokToString(int token) case TK_NEWPARA: return "TK_NEWPARA"; case TK_RCSTAG: return "TK_RCSTAG"; case TK_URL: return "TK_URL"; + case TK_COMMAND1: return "TK_COMMAND1"; } return "ERROR"; } @@ -572,14 +573,14 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} bool ok; g_token->id = QCString(yytext).right((int)yyleng-6).toInt(&ok); ASSERT(ok); - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {CMD}"n"\n { /* \n followed by real newline */ yylineno++; g_token->name = yytext+1; g_token->name = g_token->name.stripWhiteSpace(); g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {SPCMD1} | {SPCMD2} | @@ -587,7 +588,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} g_token->name = yytext+1; g_token->name = g_token->name.stripWhiteSpace(); g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {PARAMIO} { /* param [in,out] command */ g_token->name = "param"; @@ -613,7 +614,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} { g_token->paramDir=TokenInfo::Unspecified; } - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } ("http:"|"https:"|"ftp:"|"file:"|"news:"){URLMASK}/\. { // URL. g_token->name=yytext; @@ -732,7 +733,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} } [\\@<>&$#%~] { g_token->name = yytext; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } ({BLANK}*\n)+{BLANK}*\n/{LISTITEM} { /* skip trailing paragraph followed by new list item */ if (g_insidePre || g_autoListLevel==0) @@ -925,7 +926,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} {SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {ID}"=" { /* attribute */ if (yytext[0]=='%') // strip % if present @@ -959,7 +960,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} {SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {WORD1NQ} | {WORD2NQ} { /* word */ @@ -1090,7 +1091,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} {SPCMD2} { /* special command */ g_token->name = yytext+1; g_token->paramDir=TokenInfo::Unspecified; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } {WORD1NQ} | {WORD2NQ} { @@ -1322,7 +1323,7 @@ REFWORD_NOCV {LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} <*>[\\@<>&$#%~"=] { /* unescaped special character */ //warn(g_fileName,yylineno,"Unexpected character `%s', assuming command \\%s was meant.",yytext,yytext); g_token->name = yytext; - return TK_COMMAND; + return (yytext[0] == '@' ? TK_COMMAND : TK_COMMAND1); } <*>. { warn(g_fileName,yylineno,"Unexpected character `%s'",yytext); -- cgit v0.12 From 172016e3d3b5cfe6f51470d43669f794b993da65 Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Wed, 29 Aug 2018 00:14:51 -0500 Subject: declares XMLCodeGenerator in xmlgen.h In order for sqlite3gen to re-use parts of the XML generator, XMLCodeGenerator needs to be declared in a header file. I parroted how other generators handle this and have it working in both the XML and sqlite3 outputs, but I don't have any sense of whether this is otherwise "right". --- src/xmlgen.cpp | 233 +++++++++++++++++++++++++-------------------------------- src/xmlgen.h | 42 +++++++++++ 2 files changed, 144 insertions(+), 131 deletions(-) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index e68c454..88350d3 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -222,146 +222,117 @@ class TextGeneratorXMLImpl : public TextGeneratorIntf /** Generator for producing XML formatted source code. */ -class XMLCodeGenerator : public CodeOutputInterface +void XMLCodeGenerator::codify(const char *text) { - public: - - XMLCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), m_isMemberRef(FALSE), m_col(0), - m_insideCodeLine(FALSE), m_normalHLNeedStartTag(TRUE), m_insideSpecialHL(FALSE) {} - virtual ~XMLCodeGenerator() { } - - void codify(const char *text) - { - XML_DB(("(codify \"%s\")\n",text)); - if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag) - { - m_t << ""; - m_normalHLNeedStartTag=FALSE; - } - writeXMLCodeString(m_t,text,m_col); - } - void writeCodeLink(const char *ref,const char *file, - const char *anchor,const char *name, - const char *tooltip) - { - XML_DB(("(writeCodeLink)\n")); - if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag) - { - m_t << ""; - m_normalHLNeedStartTag=FALSE; - } - writeXMLLink(m_t,ref,file,anchor,name,tooltip); - m_col+=qstrlen(name); - } - void writeTooltip(const char *, const DocLinkInfo &, const char *, - const char *, const SourceLinkInfo &, const SourceLinkInfo & - ) - { - XML_DB(("(writeToolTip)\n")); - } - void startCodeLine(bool) - { - XML_DB(("(startCodeLine)\n")); - m_t << ""; - m_insideCodeLine=TRUE; - m_col=0; - } - void endCodeLine() - { - XML_DB(("(endCodeLine)\n")); - if (!m_insideSpecialHL && !m_normalHLNeedStartTag) - { - m_t << ""; - m_normalHLNeedStartTag=TRUE; - } - m_t << "" << endl; // non DocBook - m_lineNumber = -1; - m_refId.resize(0); - m_external.resize(0); - m_insideCodeLine=FALSE; - } - void startFontClass(const char *colorClass) + XML_DB(("(codify \"%s\")\n",text)); + if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag) + { + m_t << ""; + m_normalHLNeedStartTag=FALSE; + } + writeXMLCodeString(m_t,text,m_col); +} +void XMLCodeGenerator::writeCodeLink(const char *ref,const char *file, + const char *anchor,const char *name, + const char *tooltip) +{ + XML_DB(("(writeCodeLink)\n")); + if (m_insideCodeLine && !m_insideSpecialHL && m_normalHLNeedStartTag) + { + m_t << ""; + m_normalHLNeedStartTag=FALSE; + } + writeXMLLink(m_t,ref,file,anchor,name,tooltip); + m_col+=qstrlen(name); +} +void XMLCodeGenerator::writeTooltip(const char *, const DocLinkInfo &, const char *, + const char *, const SourceLinkInfo &, const SourceLinkInfo & + ) +{ + XML_DB(("(writeToolTip)\n")); +} +void XMLCodeGenerator::startCodeLine(bool) +{ + XML_DB(("(startCodeLine)\n")); + m_t << ""; - m_normalHLNeedStartTag=TRUE; + m_t << " refkind=\"member\""; } - m_t << ""; // non DocBook - m_insideSpecialHL=TRUE; - } - void endFontClass() - { - XML_DB(("(endFontClass)\n")); - m_t << ""; // non DocBook - m_insideSpecialHL=FALSE; - } - void writeCodeAnchor(const char *) - { - XML_DB(("(writeCodeAnchor)\n")); - } - void writeLineNumber(const char *extRef,const char *compId, - const char *anchorId,int l) - { - XML_DB(("(writeLineNumber)\n")); - // we remember the information provided here to use it - // at the start tag. - m_lineNumber = l; - if (compId) + else { - m_refId=compId; - if (anchorId) m_refId+=(QCString)"_1"+anchorId; - m_isMemberRef = anchorId!=0; - if (extRef) m_external=extRef; + m_t << " refkind=\"compound\""; } } - void setCurrentDoc(Definition *,const char *,bool) - { - } - void addWord(const char *,bool) + if (!m_external.isEmpty()) { + m_t << " external=\"" << m_external << "\""; } - - void finish() - { - if (m_insideCodeLine) endCodeLine(); - } - - private: - FTextStream &m_t; - QCString m_refId; - QCString m_external; - int m_lineNumber; - bool m_isMemberRef; - int m_col; - - bool m_insideCodeLine; - bool m_normalHLNeedStartTag; - bool m_insideSpecialHL; -}; - + } + m_t << ">"; + m_insideCodeLine=TRUE; + m_col=0; +} +void XMLCodeGenerator::endCodeLine() +{ + XML_DB(("(endCodeLine)\n")); + if (!m_insideSpecialHL && !m_normalHLNeedStartTag) + { + m_t << ""; + m_normalHLNeedStartTag=TRUE; + } + m_t << "" << endl; // non DocBook + m_lineNumber = -1; + m_refId.resize(0); + m_external.resize(0); + m_insideCodeLine=FALSE; +} +void XMLCodeGenerator::startFontClass(const char *colorClass) +{ + XML_DB(("(startFontClass)\n")); + if (m_insideCodeLine && !m_insideSpecialHL && !m_normalHLNeedStartTag) + { + m_t << ""; + m_normalHLNeedStartTag=TRUE; + } + m_t << ""; // non DocBook + m_insideSpecialHL=TRUE; +} +void XMLCodeGenerator::endFontClass() +{ + XML_DB(("(endFontClass)\n")); + m_t << ""; // non DocBook + m_insideSpecialHL=FALSE; +} +void XMLCodeGenerator::writeCodeAnchor(const char *) +{ + XML_DB(("(writeCodeAnchor)\n")); +} +void XMLCodeGenerator::writeLineNumber(const char *extRef,const char *compId, + const char *anchorId,int l) +{ + XML_DB(("(writeLineNumber)\n")); + // we remember the information provided here to use it + // at the start tag. + m_lineNumber = l; + if (compId) + { + m_refId=compId; + if (anchorId) m_refId+=(QCString)"_1"+anchorId; + m_isMemberRef = anchorId!=0; + if (extRef) m_external=extRef; + } +} +void XMLCodeGenerator::finish() +{ + if (m_insideCodeLine) endCodeLine(); +} static void writeTemplateArgumentList(ArgumentList *al, FTextStream &t, diff --git a/src/xmlgen.h b/src/xmlgen.h index 0447591..0555546 100644 --- a/src/xmlgen.h +++ b/src/xmlgen.h @@ -15,6 +15,48 @@ #ifndef XMLGEN_H #define XMLGEN_H +#include "outputgen.h" + +class XMLCodeGenerator : public CodeOutputInterface +{ + public: + + XMLCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), m_isMemberRef(FALSE), m_col(0), + m_insideCodeLine(FALSE), m_normalHLNeedStartTag(TRUE), m_insideSpecialHL(FALSE) {} + virtual ~XMLCodeGenerator() { } + + void codify(const char *text); + void writeCodeLink(const char *ref,const char *file, + const char *anchor,const char *name, + const char *tooltip); + void writeTooltip(const char *, const DocLinkInfo &, const char *, + const char *, const SourceLinkInfo &, const SourceLinkInfo & + ); + void startCodeLine(bool); + void endCodeLine(); + void startFontClass(const char *colorClass); + void endFontClass(); + void writeCodeAnchor(const char *); + void writeLineNumber(const char *extRef,const char *compId, + const char *anchorId,int l); + void setCurrentDoc(Definition *,const char *,bool){} + void addWord(const char *,bool){} + + void finish(); + + private: + FTextStream &m_t; + QCString m_refId; + QCString m_external; + int m_lineNumber; + bool m_isMemberRef; + int m_col; + + bool m_insideCodeLine; + bool m_normalHLNeedStartTag; + bool m_insideSpecialHL; +}; + void generateXML(); #endif -- cgit v0.12 From f0cf6f2324a2f27214b0216be9f9f0d03d32f401 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 29 Aug 2018 11:21:33 +0200 Subject: Issue 6469: Java method calls are ignored in generating call/caller graph with Graphviz Added possibility for `List list = new ArrayList<>();` and `List list = new ArrayList();` i.e. the `<...>` in the `new` part --- src/code.l | 1 + 1 file changed, 1 insertion(+) diff --git a/src/code.l b/src/code.l index 2c9b0ae..fc3e7b7 100644 --- a/src/code.l +++ b/src/code.l @@ -2627,6 +2627,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" addType(); g_name=varname; } +{SCOPETNAME}{B}*"<"[^\n\/\-\.\{\"\>]*">"/{BN}*"(" | {SCOPETNAME}/{BN}*"(" { // a() or c::a() or t::a() or A\B\foo() addType(); generateFunctionLink(*g_code,yytext); -- cgit v0.12 From 080389ee153981831ea36e14726b49f756e081bf Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 30 Aug 2018 13:21:18 +0200 Subject: Sorting of index in case of LaTex In case of LaTeX the sorting was so that lowercase came after uppercase e.g.: `username` came after `useSsl`, although the index should be case insensitive. Te problem was that the sort key was filtered in such a way that a.o. uppercase symbols were preceded by `\+` for hyphenation. The key doesn't need this hyphenation (as there is a separate field for the display name). The `\+` has been filtered out now. --- src/util.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index b387a84..b524863 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6865,11 +6865,37 @@ void filterLatexString(FTextStream &t,const char *str, } } +static void reFilterLatexString(FTextStream &t,const char *str) +{ + if (str==0) return; + const unsigned char *p=(const unsigned char *)str; + unsigned char c; + unsigned char pc='\0'; + while (*p) + { + c=*p++; + + switch(c) + { + case '\\': + if (*p == '+') p++; + else t << '\\'; + break; + default: + t << (char)c; + break; + } + pc = c; + } +} + QCString latexEscapeLabelName(const char *s,bool insideTabbing) { QGString result; + QGString result1; QCString tmp(qstrlen(s)+1); FTextStream t(&result); + FTextStream t1(&result1); const char *p=s; char c; int i; @@ -6899,7 +6925,13 @@ QCString latexEscapeLabelName(const char *s,bool insideTabbing) break; } } - return result.data(); + if (!insideTabbing) + { + reFilterLatexString(t1,result.data()); + return result1.data(); + } + else + return result.data(); } QCString latexEscapeIndexChars(const char *s,bool insideTabbing) -- cgit v0.12 From fc40fd92baf913aa1a2f2ce6e15244fb1ff15a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Thu, 30 Aug 2018 19:06:41 +0200 Subject: Update README.txt --- testing/README.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testing/README.txt b/testing/README.txt index a5a0ad9..fd7536d 100644 --- a/testing/README.txt +++ b/testing/README.txt @@ -1,4 +1,4 @@ -Doxygen regession test suite +Doxygen regression test suite ============================ This directory contains a set of regression tests. Each test consists of a @@ -7,7 +7,7 @@ has the same 3 digit number. The directory contains one or more reference files that are compared against the XML output produced by doxygen. If the result is the same, there is no regression and the test passes. If there is a difference the test fails and the difference (in diff -u format) will be shown. -It is also possible to see whether or not the test can be build to a xhtml set +It is also possible to see whether or not the test can be built to an xhtml set of files (and tested against a DTD), it is also possible to create a pdf file for each test to see if the LaTeX / pdf generation is possible. @@ -57,4 +57,3 @@ There is also a CMakeLists.txt, which can be used from the build directory to run all tests by simply invoking 'make tests', to use the specific options use the flag TEST_FLAGS with make e.g. make tests TEST_FLAGS="--id=5 --id=10 --pdf --xhtml" - -- cgit v0.12 From a9f1c59479e316ab277521faa2a629f25fde25ba Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 31 Aug 2018 13:08:06 +0200 Subject: Missing opening round bracket in case of an exception In case of RTF / LaTeX the opening round bracket was missing after the word "throw" (see e.g. in the manual the `\fn` example the detailed function description) --- src/latexgen.cpp | 2 +- src/rtfgen.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 204683e..13a88a9 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -2159,7 +2159,7 @@ void LatexGenerator::endParameterName(bool last,bool /*emptyList*/,bool closeBra void LatexGenerator::exceptionEntry(const char* prefix,bool closeBracket) { if (prefix) - t << " " << prefix; + t << " " << prefix << "("; else if (closeBracket) t << ")"; t << " "; diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index e2de5ab..8a5b3c8 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -2795,7 +2795,7 @@ void RTFGenerator::exceptionEntry(const char* prefix,bool closeBracket) { DBG_RTF(t << "{\\comment (exceptionEntry)}" << endl) if (prefix) - t << " " << prefix; + t << " " << prefix << "("; else if (closeBracket) t << ")"; t << " "; -- cgit v0.12 From baba2724a4a76719d4bcff093d64ec50cd53db57 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 1 Sep 2018 11:30:50 +0200 Subject: Update mail address --- doc/faq.doc | 2 +- doc/index.doc | 4 ++-- doc/maintainers.txt | 4 ++-- doc/trouble.doc | 2 +- src/commentscan.l | 2 +- src/config.xml | 2 +- src/rtfgen.cpp | 2 +- src/util.cpp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/faq.doc b/doc/faq.doc index e9c93d8..f48e109 100644 --- a/doc/faq.doc +++ b/doc/faq.doc @@ -216,7 +216,7 @@ If you don't mind spending some time on it, there are several options: - If the grammar of X is somewhat different than you can write an input filter that translates X into something similar enough to C/C++ for doxygen to understand (this approach is taken for VB, Object Pascal, and - Javascript, see http://www.stack.nl/~dimitri/doxygen/download.html#helpers). + Javascript, see http://www.doxygen.org/download.html#helpers). - If the grammar is completely different one could write a parser for X and write a backend that produces a similar syntax tree as is done by \c src/scanner.l (and also by \c src/tagreader.cpp while reading tag files). diff --git a/doc/index.doc b/doc/index.doc index 5bb7b2b..b8f6e8e 100644 --- a/doc/index.doc +++ b/doc/index.doc @@ -119,7 +119,7 @@ The third part provides information for developers: \addindex GPL Copyright © 1997-2016 by -Dimitri van Heesch.

    +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 @@ -143,7 +143,7 @@ of real-life projects using doxygen. These are part of a larger list of projects that use doxygen. -If you know other projects, let me +If you know other projects, let me know and I'll add them.

    Future work

    diff --git a/doc/maintainers.txt b/doc/maintainers.txt index 3fa4fff..7ea40ac 100644 --- a/doc/maintainers.txt +++ b/doc/maintainers.txt @@ -50,10 +50,10 @@ Poul-Erik Hansen: pouhan at gnotometrics dot dk Erik Søe Sørensen: eriksoe+doxygen at daimi dot au dot dk TranslatorDutch -Dimitri van Heesch: dimitri at stack dot nl +Dimitri van Heesch: doxygen at gmail dot com TranslatorEnglish -Dimitri van Heesch: dimitri at stack dot nl +Dimitri van Heesch: doxygen at gmail dot com TranslatorEsperanto Ander Martínez: ander dot basaundi at gmail dot com diff --git a/doc/trouble.doc b/doc/trouble.doc index 6b05cd3..c490ae1 100644 --- a/doc/trouble.doc +++ b/doc/trouble.doc @@ -128,7 +128,7 @@ please use PATCH as a keyword in the bug entry form. If you have ideas how to fix existing bugs and limitations please discuss them on the developers mailing list -(subscription required). Patches can also be sent directly to dimitri@stack.nl if +(subscription required). Patches can also be sent directly to doxygen@gmail.com if you prefer not to send them via the bug tracker or mailing list. For patches please use diff --git a/src/commentscan.l b/src/commentscan.l index 39b0edc..159f256 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1005,7 +1005,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$" * words and whitespace and other characters (#,?!, etc). * grouping commands (e.g. @{ and @}) * language switch (e.g. \~english or \~). - * mail address (e.g. dimitri@stack.nl). + * mail address (e.g. doxygen@gmail.com). * quoted text, such as "foo@bar" * XML commands, */ diff --git a/src/config.xml b/src/config.xml index 2e0f430..e12141c 100644 --- a/src/config.xml +++ b/src/config.xml @@ -110,7 +110,7 @@ SEARCHENGINE = NO \endverbatim To generate the documentation for the -QdbtTabular package +QdbtTabular package I have used the following configuration file: \verbatim PROJECT_NAME = QdbtTabular diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index e2de5ab..e194777 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -2632,7 +2632,7 @@ void testRTFOutput(const char *name) err: err("RTF integrity test failed at line %d of %s due to a bracket mismatch.\n" " Please try to create a small code example that produces this error \n" - " and send that to dimitri@stack.nl.\n",line,name); + " and send that to doxygen@gmail.com.\n",line,name); } /** diff --git a/src/util.cpp b/src/util.cpp index b387a84..0d248e1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2665,7 +2665,7 @@ Protection classInheritedProtectionLevel(ClassDef *cd,ClassDef *bcd,Protection p if (level==256) { err("Internal inconsistency: found class %s seem to have a recursive " - "inheritance relation! Please send a bug report to dimitri@stack.nl\n",cd->name().data()); + "inheritance relation! Please send a bug report to doxygen@gmail.com\n",cd->name().data()); } else if (cd->baseClasses()) { -- cgit v0.12 From 92aae074ff9115e13295dcc9eb1515ed1d62319c Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 2 Sep 2018 21:22:47 +0200 Subject: Changed mail address and removed obsolete files --- README.md | 2 +- examples/dbusxml.cfg | 14 ---------- examples/dbusxml.xml | 78 ---------------------------------------------------- 3 files changed, 1 insertion(+), 93 deletions(-) delete mode 100644 examples/dbusxml.cfg delete mode 100644 examples/dbusxml.xml diff --git a/README.md b/README.md index 7035c6e..8b30cdf 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,4 @@ subversion to git hosted at GitHub Enjoy, -Dimitri van Heesch (dimitri at stack.nl) +Dimitri van Heesch (doxygen at gmail.com) diff --git a/examples/dbusxml.cfg b/examples/dbusxml.cfg deleted file mode 100644 index d964ea2..0000000 --- a/examples/dbusxml.cfg +++ /dev/null @@ -1,14 +0,0 @@ -PROJECT_NAME = "DBusXMLDocs" -OUTPUT_DIRECTORY = ../html/examples/dbusxml -GENERATE_LATEX = YES -GENERATE_MAN = NO -GENERATE_RTF = NO -CASE_SENSE_NAMES = NO -INPUT = dbusxml.xml -QUIET = YES -JAVADOC_AUTOBRIEF = YES -EXTRACT_ALL = YES -SEARCHENGINE = NO -EXTENSION_MAPPING = xml=dbusxml -COMPACT_LATEX = YES -LATEX_HIDE_INDICES = YES diff --git a/examples/dbusxml.xml b/examples/dbusxml.xml deleted file mode 100644 index 4ab7f78..0000000 --- a/examples/dbusxml.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v0.12 From 61cddaf2d440aff48868fc3a50185a2788917914 Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Sun, 2 Sep 2018 22:14:57 -0500 Subject: Expand sqlite3gen's breadth, depth, and quality Generated sqlite3 databases are roughly ready to support tools and projects that require a significant fraction of what Doxygen collects. output quality: - collect primary info for most major entities and relationships - fix causes of junk data in some columns (i.e. const * / QCString / string / memory issues) - convert decription field markup (mix of markdown, HTML, and Doxygen commands) into XML - eliminate duplicate/overlapping data (both rows and columns) usability: - abort if database already exists; prompt user to archive/delete it - record Doxygen and sql schema versions so tools/clients can target/message appropriately - refine schema to support and simplify common queries addon/doxypysql: - adopt schema changes - py3 compat --- addon/doxypysql/search.py | 124 +-- src/sqlite3gen.cpp | 2157 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 1689 insertions(+), 592 deletions(-) diff --git a/addon/doxypysql/search.py b/addon/doxypysql/search.py index c185138..5f820de 100755 --- a/addon/doxypysql/search.py +++ b/addon/doxypysql/search.py @@ -17,19 +17,19 @@ import json import re class MemberType: - Define="0" - Function="1" - Variable="2" - Typedef="3" - Enumeration="4" - EnumValue="5" - Signal="6" - Slot="7" - Friend="8" - DCOP="9" - Property="10" - Event="11" - File="12" + Define="macro definition" + Function="function" + Variable="variable" + Typedef="typedef" + Enumeration="enumeration" + EnumValue="enumvalue" + Signal="signal" + Slot="slot" + Friend="friend" + DCOP="dcop" + Property="property" + Event="event" + File="file" class RequestType: References="9901" @@ -69,27 +69,27 @@ class Finder: def match(self,row): if self.row_type is int: - return " id=?" + return " rowid=?" else: if g_use_regexp == True: return " REGEXP (?,%s)" %row else: return " %s=?" %row - def fileName(self,id_file): - if self.cn.execute("SELECT COUNT(*) FROM files WHERE rowid=?",[id_file]).fetchone()[0] > 1: - print >>sys.stderr,"WARNING: non-uniq fileid [%s]. Considering only the first match." % id_file + def fileName(self,file_id): + if self.cn.execute("SELECT COUNT(*) FROM path WHERE rowid=?",[file_id]).fetchone()[0] > 1: + sys.stderr.write("WARNING: non-uniq fileid [%s]. Considering only the first match." % file_id) - for r in self.cn.execute("SELECT * FROM files WHERE rowid=?",[id_file]).fetchall(): + for r in self.cn.execute("SELECT * FROM path WHERE rowid=?",[file_id]).fetchall(): return r['name'] return "" def fileId(self,name): - if self.cn.execute("SELECT COUNT(*) FROM files WHERE"+self.match("name"),[name]).fetchone()[0] > 1: - print >>sys.stderr,"WARNING: non-uniq file name [%s]. Considering only the first match." % name + if self.cn.execute("SELECT COUNT(*) FROM path WHERE"+self.match("name"),[name]).fetchone()[0] > 1: + sys.stderr.write("WARNING: non-uniq file name [%s]. Considering only the first match." % name) - for r in self.cn.execute("SELECT rowid FROM files WHERE"+self.match("name"),[name]).fetchall(): + for r in self.cn.execute("SELECT rowid FROM path WHERE"+self.match("name"),[name]).fetchall(): return r[0] return -1 @@ -97,23 +97,24 @@ class Finder: def references(self): o=[] cur = self.cn.cursor() - cur.execute("SELECT refid FROM memberdef WHERE"+self.match("name"),[self.name]) - refids = cur.fetchall() + cur.execute("SELECT rowid FROM memberdef WHERE"+self.match("name"),[self.name]) + rowids = cur.fetchall() - if len(refids) == 0: + if len(rowids) == 0: return o - refid = refids[0]['refid'] + rowid = rowids[0]['rowid'] cur = self.cn.cursor() - #TODO:SELECT rowid from refids where refid=refid - for info in cur.execute("SELECT * FROM xrefs WHERE refid_dst LIKE '%"+refid+"%'"): + #TODO:SELECT rowid from refid where refid=refid + for info in cur.execute("SELECT * FROM xrefs WHERE dst_rowid=?", [rowid]): item={} cur = self.cn.cursor() - for i2 in cur.execute("SELECT * FROM memberdef WHERE refid=?",[info['src']]): + for i2 in cur.execute("SELECT * FROM memberdef WHERE rowid=?",[info['src_rowid']]): item['name']=i2['name'] - item['src']=info['src'] - item['file']=self.fileName(info['id_file']) - item['line']=info['line'] + item['src']=info['src_rowid'] + # Below no longer directly supported on this entry; can be found from either memberdef + #item['file']=self.fileName(info['file_id']) + #item['line']=info['line'] o.append(item) return o @@ -126,7 +127,7 @@ class Finder: item['name'] = r['name'] item['definition'] = r['definition'] item['argsstring'] = r['argsstring'] - item['file'] = self.fileName(r['id_file']) + item['file'] = self.fileName(r['file_id']) item['line'] = r['line'] item['detaileddescription'] = r['detaileddescription'] o.append(item) @@ -134,7 +135,7 @@ class Finder: ############################################################################### def file(self): o=[] - for r in self.cn.execute("SELECT rowid,* FROM files WHERE"+self.match("name"),[self.name]).fetchall(): + for r in self.cn.execute("SELECT rowid,name FROM local_file WHERE"+self.match("name"),[self.name]).fetchall(): item={} item['name'] = r['name'] item['id'] = r['rowid'] @@ -151,7 +152,7 @@ class Finder: if r['argsstring']: item['argsstring'] = r['argsstring'] item['definition'] = r['initializer'] - item['file'] = self.fileName(r['id_file']) + item['file'] = self.fileName(r['file_id']) item['line'] = r['line'] o.append(item) return o @@ -163,7 +164,7 @@ class Finder: item={} item['name'] = r['name'] item['definition'] = r['definition'] - item['file'] = self.fileName(r['id_file']) + item['file'] = self.fileName(r['file_id']) item['line'] = r['line'] o.append(item) return o @@ -175,16 +176,16 @@ class Finder: item={} item['name'] = r['name'] item['definition'] = r['definition'] - item['file'] = self.fileName(r['id_file']) + item['file'] = self.fileName(r['file_id']) item['line'] = r['line'] o.append(item) return o ############################################################################### def params(self): o=[] - c=self.cn.execute('SELECT id FROM memberdef WHERE'+self.match("name"),[self.name]) + c=self.cn.execute('SELECT rowid FROM memberdef WHERE'+self.match("name"),[self.name]) for r in c.fetchall(): - #a=("SELECT * FROM params where id=(SELECT id_param FROM memberdef_params where id_memberdef=?",[id_memberdef]) + #a=("SELECT * FROM param where id=(SELECT param_id FROM memberdef_param where memberdef_id=?",[memberdef_id]) item={} item['id'] = r['id'] o.append(item) @@ -202,20 +203,20 @@ class Finder: def includers(self): o=[] fid = self.fileId(self.name) - c=self.cn.execute('SELECT * FROM includes WHERE id_dst=?',[fid]) + c=self.cn.execute('SELECT * FROM includes WHERE dst_id=?',[fid]) for r in c.fetchall(): item={} - item['name'] = self.fileName(r['id_src']) + item['name'] = self.fileName(r['src_id']) o.append(item) return o ############################################################################### def includees(self): o=[] fid = self.fileId(self.name) - c=self.cn.execute('SELECT * FROM includes WHERE id_src=?',[fid]) + c=self.cn.execute('SELECT * FROM includes WHERE src_id=?',[fid]) for r in c.fetchall(): item={} - item['name'] = self.fileName(r['id_dst']) + item['name'] = self.fileName(r['dst_id']) o.append(item) return o ############################################################################### @@ -227,7 +228,7 @@ class Finder: item['name'] = r['name'] item['definition'] = r['definition'] item['argsstring'] = r['argsstring'] - item['file'] = self.fileName(r['id_file']) + item['file'] = self.fileName(r['file_id']) item['line'] = r['line'] #item['documentation'] = r['documentation'] o.append(item) @@ -235,19 +236,19 @@ class Finder: ############################################################################### def baseClasses(self): o=[] - c=self.cn.execute('SELECT base FROM basecompoundref WHERE'+self.match("derived"),[self.name]) + c=self.cn.execute('SELECT compounddef.name FROM compounddef JOIN compoundref ON compounddef.rowid=compoundref.base_rowid WHERE compoundref.derived_rowid IN (SELECT rowid FROM compounddef WHERE'+self.match("name")+')',[self.name]) for r in c.fetchall(): item={} - item['name'] = r['base'] + item['name'] = r['name'] o.append(item) return o ############################################################################### def subClasses(self): o=[] - c=self.cn.execute('SELECT derived FROM basecompoundref WHERE'+self.match("base"),[self.name]) + c=self.cn.execute('SELECT compounddef.name FROM compounddef JOIN compoundref ON compounddef.rowid=compoundref.derived_rowid WHERE compoundref.base_rowid IN (SELECT rowid FROM compounddef WHERE'+self.match("name")+')',[self.name]) for r in c.fetchall(): item={} - item['name'] = r['derived'] + item['name'] = r['name'] o.append(item) return o ############################################################################### @@ -268,21 +269,23 @@ def process(f,kind): } return request_processors[kind]() ############################################################################### + +# the -H option isn't documented. It's one of the more recent additions, but it's treating refids as if they would be a string. I'm just taking a stab at updating it for now, converting to use rowid, and making other edits necessary to get it to run. def processHref(cn,ref): j={} # is it in memberdef ? table="memberdef" - if ( cn.execute("SELECT count(*) from %s WHERE refid=?"%table,[ref] ).fetchone()[0] > 0 ): - for r in cn.execute("SELECT kind,id FROM %s WHERE refid='%s'" % (table,ref) ).fetchall(): - f=Finder(cn,r['id'],int) + if ( cn.execute("SELECT count(*) from %s WHERE rowid=?"%table,[ref] ).fetchone()[0] > 0 ): + for r in cn.execute("SELECT kind,rowid FROM %s WHERE rowid=?" % table,[ref]).fetchall(): + f=Finder(cn,r['rowid'],int) j=process(f,str(r['kind'])) # is it in compounddef ? table="compounddef" - if ( cn.execute("SELECT count(*) from %s WHERE refid=?"%table,[ref]).fetchone()[0] > 0 ): - for r in cn.execute("SELECT id FROM %s WHERE refid=?"%table,[ref] ).fetchall(): - f=Finder(cn,r['id'],int) + if ( cn.execute("SELECT count(*) from %s WHERE rowid=?"%table,[ref]).fetchone()[0] > 0 ): + for r in cn.execute("SELECT rowid FROM %s WHERE rowid=?"%table,[ref] ).fetchall(): + f=Finder(cn,r[0],int) j=process(f,RequestType.Struct) return j @@ -290,7 +293,7 @@ def processHref(cn,ref): def serveCgi(): import cgi - print 'Content-Type: application/json\n' + print('Content-Type: application/json\n') fieldStorage = cgi.FieldStorage() form = dict((key, fieldStorage.getvalue(key)) for key in fieldStorage.keys()) @@ -298,17 +301,17 @@ def serveCgi(): if 'href' in form: ref = form['href'] else: - print '{"result": null, "error": "no refid given"}' + print('{"result": null, "error": "no refid given"}') sys.exit(0) cn=openDb('doxygen_sqlite3.db') j = processHref(cn,ref) - print json.dumps({"result":j,"error":None}) + print(json.dumps({"result":j,"error":None})) ############################################################################### def usage(): - print >>sys.stderr,"""Usage: search.py [Options] + sys.stderr.write("""Usage: search.py [Options] Options: -h, --help -d Use database for queries. @@ -323,7 +326,7 @@ Options: -M Get all members of class . -S Get the sub classes of class . -R Consider the search to be a regex. -""" +""") ############################################################################### def serveCli(argv): try: @@ -362,6 +365,8 @@ def serveCli(argv): elif a in ('-f'): kind=MemberType.Function elif a in ('-F'): + # undocumented + # seems to fit with the lower case "search" patterns? kind=MemberType.File elif a in ('-m'): kind=MemberType.Define @@ -370,6 +375,7 @@ def serveCli(argv): elif a in ('-v'): kind=MemberType.Variable elif a in ('-H'): + # undocumented ref = o cn=openDb(dbname) @@ -378,7 +384,7 @@ def serveCli(argv): j=processHref(cn,ref) else: j=process(f,kind) - print json.dumps(j,indent=4) + print(json.dumps(j,indent=4)) def main(argv): diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index 6cd9581..8e236c1 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -23,11 +23,15 @@ #include "qtbc.h" #include "sqlite3gen.h" #include "doxygen.h" +#include "xmlgen.h" +#include "xmldocvisitor.h" #include "config.h" #include "util.h" +#include "outputlist.h" #include "docparser.h" #include "language.h" +#include "version.h" #include "dot.h" #include "arguments.h" #include "classlist.h" @@ -35,65 +39,129 @@ #include "namespacedef.h" #include "filename.h" #include "groupdef.h" +#include "membername.h" +#include "memberdef.h" #include "pagedef.h" #include "dirdef.h" +#include "section.h" +#include #include #include #include -//#define DBG_CTX(x) printf x -#define DBG_CTX(x) do { } while(0) +// enable to show general debug messages +// #define SQLITE3_DEBUG -const char * schema_queries[][2] = { +// enable to print all executed SQL statements. +// I recommend using the smallest possible input list. +// #define SQLITE3_DEBUG_SQL + +# ifdef SQLITE3_DEBUG +# define DBG_CTX(x) printf x +# else // SQLITE3_DEBUG +# define DBG_CTX(x) do { } while(0) +# endif + +# ifdef SQLITE3_DEBUG_SQL +// used by sqlite3_trace in generateSqlite3() +static void sqlLog(void *dbName, const char *sql){ + msg("SQL: '%s'\n", sql); +} +# endif + +const char * table_schema[][2] = { + /* TABLES */ + { "meta", + "CREATE TABLE IF NOT EXISTS meta (\n" + "\t-- Information about this db and how it was generated.\n" + "\t-- Doxygen info\n" + "\tdoxygen_version TEXT PRIMARY KEY NOT NULL,\n" + /* + Doxygen's version is likely to rollover much faster than the schema, and + at least until it becomes a core output format, we might want to make + fairly large schema changes even on minor iterations for Doxygen itself. + If these tools just track a predefined semver schema version that can + iterate independently, it *might* not be as hard to keep them in sync? + */ + "\tschema_version TEXT NOT NULL, -- Schema-specific semver\n" + "\t-- run info\n" + "\tgenerated_at TEXT NOT NULL,\n" + "\tgenerated_on TEXT NOT NULL,\n" + "\t-- project info\n" + "\tproject_name TEXT NOT NULL,\n" + "\tproject_number TEXT,\n" + "\tproject_brief TEXT\n" + ");" + }, { "includes", "CREATE TABLE IF NOT EXISTS includes (\n" "\t-- #include relations.\n" "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" "\tlocal INTEGER NOT NULL,\n" - "\tid_src INTEGER NOT NULL, -- File id of the includer.\n" - "\tid_dst INTEGER NOT NULL -- File id of the includee.\n" - ");\n" - "CREATE UNIQUE INDEX idx_includes ON includes\n" - "\t(local, id_src, id_dst);" + "\tsrc_id INTEGER NOT NULL REFERENCES path, -- File id of the includer.\n" + "\tdst_id INTEGER NOT NULL REFERENCES path, -- File id of the includee.\n" + /* + In theory we could include name here to be informationally equivalent + with the XML, but I don't see an obvious use for it. + */ + "\tUNIQUE(local, src_id, dst_id) ON CONFLICT IGNORE\n" + ");" }, - { "innerclass", - "CREATE TABLE IF NOT EXISTS innerclass (\n" + { "contains", + "CREATE TABLE IF NOT EXISTS contains (\n" + "\t-- inner/outer relations (file, namespace, dir, class, group, page)\n" "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\trefid INTEGER NOT NULL,\n" - "\tprot INTEGER NOT NULL,\n" - "\tname TEXT NOT NULL\n" - ");" + "\tinner_rowid INTEGER NOT NULL REFERENCES compounddef,\n" + "\touter_rowid INTEGER NOT NULL REFERENCES compounddef\n" + ");" }, - { "files", - "CREATE TABLE IF NOT EXISTS files (\n" - "\t-- Names of source files and includes.\n" - "\tname TEXT PRIMARY KEY NOT NULL\n" - ");" + /* TODO: Path can also share rowids with refid/compounddef/def. (It could + * even collapse into that table...) + * + * I took a first swing at this by changing insertPath() to: + * - accept a FileDef + * - make its own call to insertRefid + * - return a refid struct. + * + * I rolled this back when I had trouble getting a FileDef for all types + * (PageDef in particular). + * + * Note: all colums referencing path would need an update. + */ + { "path", + "CREATE TABLE IF NOT EXISTS path (\n" + "\t-- Paths of source files and includes.\n" + "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" + "\ttype INTEGER NOT NULL, -- 1:file 2:dir\n" + "\tlocal INTEGER NOT NULL,\n" + "\tfound INTEGER NOT NULL,\n" + "\tname TEXT NOT NULL\n" + ");" }, - { "refids", - "CREATE TABLE IF NOT EXISTS refids (\n" - "\trefid TEXT PRIMARY KEY NOT NULL\n" - ");" + { "refid", + "CREATE TABLE IF NOT EXISTS refid (\n" + "\t-- Distinct refid for all documented entities.\n" + "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" + "\trefid TEXT NOT NULL UNIQUE\n" + ");" }, { "xrefs", "CREATE TABLE IF NOT EXISTS xrefs (\n" - "\t-- Cross reference relation.\n" + "\t-- Cross-reference relation\n" + "\t-- (combines xml and nodes).\n" "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\trefid_src INTEGER NOT NULL, -- referrer id.\n" - "\trefid_dst INTEGER NOT NULL, -- referee id.\n" - "\tid_file INTEGER NOT NULL, -- file where the reference is happening.\n" - "\tline INTEGER NOT NULL, -- line where the reference is happening.\n" - "\tcolumn INTEGER NOT NULL -- column where the reference is happening.\n" - ");\n" - "CREATE UNIQUE INDEX idx_xrefs ON xrefs\n" - "\t(refid_src, refid_dst, id_file, line, column);" + "\tsrc_rowid INTEGER NOT NULL REFERENCES refid, -- referrer id.\n" + "\tdst_rowid INTEGER NOT NULL REFERENCES refid, -- referee id.\n" + "\tcontext TEXT NOT NULL, -- inline, argument, initializer\n" + "\t-- Just need to know they link; ignore duplicates.\n" + "\tUNIQUE(src_rowid, dst_rowid, context) ON CONFLICT IGNORE\n" + ");\n" }, { "memberdef", "CREATE TABLE IF NOT EXISTS memberdef (\n" "\t-- All processed identifiers.\n" - "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\trefid INTEGER NOT NULL, -- see the refids table\n" + "\trowid INTEGER PRIMARY KEY NOT NULL,\n" "\tname TEXT NOT NULL,\n" "\tdefinition TEXT,\n" "\ttype TEXT,\n" @@ -107,7 +175,7 @@ const char * schema_queries[][2] = { "\tstatic INTEGER DEFAULT 0, -- 0:no 1:yes\n" "\tconst INTEGER DEFAULT 0, -- 0:no 1:yes\n" "\texplicit INTEGER DEFAULT 0, -- 0:no 1:yes\n" - "\tinline INTEGER DEFAULT 0, -- 0:no 1:yes\n" + "\tinline INTEGER DEFAULT 0, -- 0:no 1:yes 2:both (set after encountering inline and not-inline)\n" "\tfinal INTEGER DEFAULT 0, -- 0:no 1:yes\n" "\tsealed INTEGER DEFAULT 0, -- 0:no 1:yes\n" "\tnew INTEGER DEFAULT 0, -- 0:no 1:yes\n" @@ -138,55 +206,71 @@ const char * schema_queries[][2] = { "\taddable INTEGER DEFAULT 0, -- 0:no 1:yes\n" "\tremovable INTEGER DEFAULT 0, -- 0:no 1:yes\n" "\traisable INTEGER DEFAULT 0, -- 0:no 1:yes\n" - /// @todo make a `kind' table - "\tkind INTEGER DEFAULT 0, -- 0:define 1:function 2:variable 3:typedef 4:enum 5:enumvalue 6:signal 7:slot 8:friend 9:DCOP 10:property 11:event\n" + "\tkind TEXT NOT NULL, -- 'macro definition' 'function' 'variable' 'typedef' 'enumeration' 'enumvalue' 'signal' 'slot' 'friend' 'dcop' 'property' 'event' 'interface' 'service'\n" "\tbodystart INTEGER DEFAULT 0, -- starting line of definition\n" "\tbodyend INTEGER DEFAULT 0, -- ending line of definition\n" - "\tid_bodyfile INTEGER DEFAULT 0, -- file of definition\n" - "\tid_file INTEGER NOT NULL, -- file where this identifier is located\n" + "\tbodyfile_id INTEGER REFERENCES path, -- file of definition\n" + "\tfile_id INTEGER NOT NULL REFERENCES path, -- file where this identifier is located\n" "\tline INTEGER NOT NULL, -- line where this identifier is located\n" "\tcolumn INTEGER NOT NULL, -- column where this identifier is located\n" - /// @todo make a `detaileddescription' table "\tdetaileddescription TEXT,\n" "\tbriefdescription TEXT,\n" - "\tinbodydescription TEXT\n" - ");" + "\tinbodydescription TEXT,\n" + "\tFOREIGN KEY (rowid) REFERENCES refid (rowid)\n" + ");" + }, + { "member", + "CREATE TABLE IF NOT EXISTS member (\n" + "\t-- Memberdef <-> containing compound relation.\n" + "\t-- Similar to XML listofallmembers.\n" + "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" + "\tscope_rowid INTEGER NOT NULL REFERENCES compounddef,\n" + "\tmemberdef_rowid INTEGER NOT NULL REFERENCES memberdef,\n" + "\tprot INTEGER NOT NULL,\n" + "\tvirt INTEGER NOT NULL,\n" + "\tUNIQUE(scope_rowid, memberdef_rowid)\n" + ");" + }, + { "reimplements", + "CREATE TABLE IF NOT EXISTS reimplements (\n" + "\t-- Inherited member reimplmentation relations.\n" + "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" + "\tmemberdef_rowid INTEGER NOT NULL REFERENCES memberdef, -- reimplementing memberdef id.\n" + "\treimplemented_rowid INTEGER NOT NULL REFERENCES memberdef, -- reimplemented memberdef id.\n" + "\tUNIQUE(memberdef_rowid, reimplemented_rowid) ON CONFLICT IGNORE\n" + ");\n" }, { "compounddef", "CREATE TABLE IF NOT EXISTS compounddef (\n" - "\t-- class/struct definitions.\n" - "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\tname TEXT NOT NULL,\n" - "\tkind TEXT NOT NULL,\n" - "\trefid INTEGER NOT NULL,\n" - "\tprot INTEGER NOT NULL,\n" - "\tid_file INTEGER NOT NULL,\n" - "\tline INTEGER NOT NULL,\n" - "\tcolumn INTEGER NOT NULL\n" - ");" - }, - { "basecompoundref", - "CREATE TABLE IF NOT EXISTS basecompoundref (\n" - "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\tbase TEXT NOT NULL,\n" - "\tderived TEXT NOT NULL,\n" - "\trefid INTEGER NOT NULL,\n" - "\tprot INTEGER NOT NULL,\n" - "\tvirt INTEGER NOT NULL\n" - ");" + "\t-- Class/struct definitions.\n" + "\trowid INTEGER PRIMARY KEY NOT NULL,\n" + "\tname TEXT NOT NULL,\n" + "\ttitle TEXT,\n" + // probably won't be empty '' or unknown, but the source *could* return them... + "\tkind TEXT NOT NULL, -- 'category' 'class' 'constants' 'dir' 'enum' 'example' 'exception' 'file' 'group' 'interface' 'library' 'module' 'namespace' 'package' 'page' 'protocol' 'service' 'singleton' 'struct' 'type' 'union' 'unknown' ''\n" + "\tprot INTEGER,\n" + "\tfile_id INTEGER NOT NULL REFERENCES path,\n" + "\tline INTEGER NOT NULL,\n" + "\tcolumn INTEGER NOT NULL,\n" + "\theader_id INTEGER REFERENCES path,\n" + "\tdetaileddescription TEXT,\n" + "\tbriefdescription TEXT,\n" + "\tFOREIGN KEY (rowid) REFERENCES refid (rowid)\n" + ");" }, - { "derivedcompoundref", - "CREATE TABLE IF NOT EXISTS derivedcompoundref (\n" - "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\tbase TEXT NOT NULL,\n" - "\tderived TEXT NOT NULL,\n" - "\trefid INTEGER NOT NULL,\n" - "\tprot INTEGER NOT NULL,\n" - "\tvirt INTEGER NOT NULL\n" - ");" + { "compoundref", + "CREATE TABLE IF NOT EXISTS compoundref (\n" + "\t-- Inheritance relation.\n" + "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" + "\tbase_rowid INTEGER NOT NULL REFERENCES compounddef,\n" + "\tderived_rowid INTEGER NOT NULL REFERENCES compounddef,\n" + "\tprot INTEGER NOT NULL,\n" + "\tvirt INTEGER NOT NULL,\n" + "\tUNIQUE(base_rowid, derived_rowid)\n" + ");" }, - { "params", - "CREATE TABLE IF NOT EXISTS params (\n" + { "param", + "CREATE TABLE IF NOT EXISTS param (\n" "\t-- All processed parameters.\n" "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" "\tattributes TEXT,\n" @@ -196,24 +280,221 @@ const char * schema_queries[][2] = { "\tarray TEXT,\n" "\tdefval TEXT,\n" "\tbriefdescription TEXT\n" - ");" - "CREATE UNIQUE INDEX idx_params ON params\n" + ");" + "CREATE UNIQUE INDEX idx_param ON param\n" "\t(type, defname);" }, - { "memberdef_params", - "CREATE TABLE IF NOT EXISTS memberdef_params (\n" + { "memberdef_param", + "CREATE TABLE IF NOT EXISTS memberdef_param (\n" "\t-- Junction table for memberdef parameters.\n" "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\tid_memberdef INTEGER NOT NULL,\n" - "\tid_param INTEGER NOT NULL\n" - ");" + "\tmemberdef_id INTEGER NOT NULL REFERENCES memberdef,\n" + "\tparam_id INTEGER NOT NULL REFERENCES param\n" + ");" }, - { "innernamespaces", - "CREATE TABLE IF NOT EXISTS innernamespaces (\n" - "\trowid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n" - "\trefid INTEGER NOT NULL,\n" - "\tname TEXT NOT NULL\n" - ");" +}; + const char * view_schema[][2] = { + /* VIEWS * + We'll set these up AFTER we build the database, so that they can be indexed, + but so we don't have to pay a performance penalty for inserts as we build. + */ + { + /* + Makes all reference/relation tables easier to use. For example: + 1. query xrefs and join this view on either xrefs.dst_rowid=def.rowid or + xrefs.src_rowid=def.rowid + 2. get everything you need to output a list of references to/from an entity + + Also supports simple name search/lookup for both compound and member types. + + NOTES: + - summary for compounds generalizes title and briefdescription because + there's no single field that works as a quick introduction for both + pages and classes + - May be value in eventually extending this to fulltext or levenshtein + distance-driven lookup/search, but I'm avoiding these for now as it + takes some effort to enable them. + */ + "def", + "CREATE VIEW IF NOT EXISTS def (\n" + "\t-- Combined summary of all -def types for easier joins.\n" + "\trowid,\n" + "\trefid,\n" + "\tkind,\n" + "\tname,\n" + "\tsummary" + ")\n" + "as SELECT \n" + "\trefid.rowid,\n" + "\trefid.refid,\n" + "\tmemberdef.kind,\n" + "\tmemberdef.name,\n" + "\tmemberdef.briefdescription \n" + "FROM refid \n" + "JOIN memberdef ON refid.rowid=memberdef.rowid \n" + "UNION ALL \n" + "SELECT \n" + "\trefid.rowid,\n" + "\trefid.refid,\n" + "\tcompounddef.kind,\n" + "\tcompounddef.name,\n" + "\tCASE \n" + "\t\tWHEN briefdescription IS NOT NULL \n" + "\t\tTHEN briefdescription \n" + "\t\tELSE title \n" + "\tEND summary\n" + "FROM refid \n" + "JOIN compounddef ON refid.rowid=compounddef.rowid;" + }, + { + "local_file", + "CREATE VIEW IF NOT EXISTS local_file (\n" + "\t-- File paths found within the project.\n" + "\trowid,\n" + "\tfound,\n" + "\tname\n" + ")\n" + "as SELECT \n" + "\tpath.rowid,\n" + "\tpath.found,\n" + "\tpath.name\n" + "FROM path WHERE path.type=1 AND path.local=1 AND path.found=1;\n" + }, + { + "external_file", + "CREATE VIEW IF NOT EXISTS external_file (\n" + "\t-- File paths outside the project (found or not).\n" + "\trowid,\n" + "\tfound,\n" + "\tname\n" + ")\n" + "as SELECT \n" + "\tpath.rowid,\n" + "\tpath.name\n" + "FROM path WHERE path.type=1 AND path.local=0;\n" + }, + { + "inline_xrefs", + "CREATE VIEW IF NOT EXISTS inline_xrefs (\n" + "\t-- Crossrefs from inline member source.\n" + "\trowid,\n" + "\tsrc_rowid,\n" + "\tdst_rowid\n" + ")\n" + "as SELECT \n" + "\txrefs.rowid,\n" + "\txrefs.src_rowid,\n" + "\txrefs.dst_rowid\n" + "FROM xrefs WHERE xrefs.context='inline';\n" + }, + { + "argument_xrefs", + "CREATE VIEW IF NOT EXISTS argument_xrefs (\n" + "\t-- Crossrefs from member def/decl arguments\n" + "\trowid,\n" + "\tsrc_rowid,\n" + "\tdst_rowid\n" + ")\n" + "as SELECT \n" + "\txrefs.rowid,\n" + "\txrefs.src_rowid,\n" + "\txrefs.dst_rowid\n" + "FROM xrefs WHERE xrefs.context='argument';\n" + }, + { + "initializer_xrefs", + "CREATE VIEW IF NOT EXISTS initializer_xrefs (\n" + "\t-- Crossrefs from member initializers\n" + "\trowid,\n" + "\tsrc_rowid,\n" + "\tdst_rowid\n" + ")\n" + "as SELECT \n" + "\txrefs.rowid,\n" + "\txrefs.src_rowid,\n" + "\txrefs.dst_rowid\n" + "FROM xrefs WHERE xrefs.context='initializer';\n" + }, + { + "inner_outer", + "CREATE VIEW IF NOT EXISTS inner_outer\n" + "\t-- Joins 'contains' relations to simplify inner/outer 'rel' queries.\n" + "as SELECT \n" + "\tinner.*,\n" + "\touter.*\n" + "FROM def as inner\n" + "\tJOIN contains ON inner.rowid=contains.inner_rowid\n" + "\tJOIN def AS outer ON outer.rowid=contains.outer_rowid;\n" + }, + { + "rel", + "CREATE VIEW IF NOT EXISTS rel (\n" + "\t-- Boolean indicator of relations available for a given entity.\n" + "\t-- Join to (compound-|member-)def to find fetch-worthy relations.\n" + "\trowid,\n" + "\treimplemented,\n" + "\treimplements,\n" + "\tinnercompounds,\n" + "\toutercompounds,\n" + "\tinnerpages,\n" + "\touterpages,\n" + "\tinnerdirs,\n" + "\touterdirs,\n" + "\tinnerfiles,\n" + "\touterfiles,\n" + "\tinnerclasses,\n" + "\touterclasses,\n" + "\tinnernamespaces,\n" + "\touternamespaces,\n" + "\tinnergroups,\n" + "\toutergroups,\n" + "\tmembers,\n" + "\tcompounds,\n" + "\tsubclasses,\n" + "\tsuperclasses,\n" + "\tlinks_in,\n" + "\tlinks_out,\n" + "\targument_links_in,\n" + "\targument_links_out,\n" + "\tinitializer_links_in,\n" + "\tinitializer_links_out\n" + ")\n" + "as SELECT \n" + "\tdef.rowid,\n" + "\tEXISTS (SELECT rowid FROM reimplements WHERE reimplemented_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM reimplements WHERE memberdef_rowid=def.rowid),\n" + "\t-- rowid/kind for inner, [rowid:1/kind:1] for outer\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='page'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='page'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='dir'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='dir'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='file'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='file'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind in (\n" + "'category','class','enum','exception','interface','module','protocol',\n" + "'service','singleton','struct','type','union'\n" + ")),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1] in (\n" + "'category','class','enum','exception','interface','module','protocol',\n" + "'service','singleton','struct','type','union'\n" + ")),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='namespace'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='namespace'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE [rowid:1]=def.rowid AND kind='group'),\n" + "\tEXISTS (SELECT * FROM inner_outer WHERE rowid=def.rowid AND [kind:1]='group'),\n" + "\tEXISTS (SELECT rowid FROM member WHERE scope_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM member WHERE memberdef_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM compoundref WHERE base_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM compoundref WHERE derived_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM inline_xrefs WHERE dst_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM inline_xrefs WHERE src_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM argument_xrefs WHERE dst_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM argument_xrefs WHERE src_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM initializer_xrefs WHERE dst_rowid=def.rowid),\n" + "\tEXISTS (SELECT rowid FROM initializer_xrefs WHERE src_rowid=def.rowid)\n" + "FROM def ORDER BY def.rowid;" } }; @@ -224,193 +505,298 @@ struct SqlStmt { sqlite3 *db; }; ////////////////////////////////////////////////////// -SqlStmt incl_insert = { "INSERT INTO includes " - "( local, id_src, id_dst ) " - "VALUES " - "(:local,:id_src,:id_dst )" - ,NULL +/* If you add a new statement below, make sure to add it to + prepareStatements(). If sqlite3 is segfaulting (especially in + sqlite3_clear_bindings()), using an un-prepared statement may + be the cause. */ +SqlStmt meta_insert = { + "INSERT INTO meta " + "( doxygen_version, schema_version, generated_at, generated_on, project_name, project_number, project_brief )" + "VALUES " + "(:doxygen_version,:schema_version,:generated_at,:generated_on,:project_name,:project_number,:project_brief )" + ,NULL +}; +////////////////////////////////////////////////////// +SqlStmt incl_insert = { + "INSERT INTO includes " + "( local, src_id, dst_id ) " + "VALUES " + "(:local,:src_id,:dst_id )" + ,NULL }; -SqlStmt incl_select = { "SELECT COUNT(*) FROM includes WHERE " - "local=:local AND id_src=:id_src AND id_dst=:id_dst" - ,NULL +SqlStmt incl_select = { + "SELECT COUNT(*) FROM includes WHERE " + "local=:local AND src_id=:src_id AND dst_id=:dst_id" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt innerclass_insert={"INSERT INTO innerclass " - "( refid, prot, name )" - "VALUES " - "(:refid,:prot,:name )" - ,NULL +SqlStmt contains_insert={ + "INSERT INTO contains " + "( inner_rowid, outer_rowid )" + "VALUES " + "(:inner_rowid,:outer_rowid )" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt files_select = {"SELECT rowid FROM files WHERE name=:name" +SqlStmt path_select = { + "SELECT rowid FROM path WHERE name=:name" ,NULL }; -SqlStmt files_insert = {"INSERT INTO files " - "( name )" - "VALUES " - "(:name )" - ,NULL +SqlStmt path_insert = { + "INSERT INTO path " + "( type, local, found, name )" + "VALUES " + "(:type,:local,:found,:name )" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt refids_select = {"SELECT rowid FROM refids WHERE " - "refid=:refid" - ,NULL +SqlStmt refid_select = { + "SELECT rowid FROM refid WHERE refid=:refid" + ,NULL }; -SqlStmt refids_insert = {"INSERT INTO refids " - "( refid )" - "VALUES " +SqlStmt refid_insert = { + "INSERT INTO refid " + "( refid )" + "VALUES " "(:refid )" - ,NULL + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt xrefs_insert= {"INSERT INTO xrefs " - "( refid_src, refid_dst, id_file, line, column )" - "VALUES " - "(:refid_src,:refid_dst,:id_file,:line,:column )" - ,NULL +SqlStmt xrefs_insert= { + "INSERT INTO xrefs " + "( src_rowid, dst_rowid, context )" + "VALUES " + "(:src_rowid,:dst_rowid,:context )" + ,NULL +};////////////////////////////////////////////////////// +SqlStmt reimplements_insert= { + "INSERT INTO reimplements " + "( memberdef_rowid, reimplemented_rowid )" + "VALUES " + "(:memberdef_rowid,:reimplemented_rowid )" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt memberdef_insert={"INSERT INTO memberdef " - "(" - "refid," - "name," - "definition," - "type," - "argsstring," - "scope," - "initializer," - "bitfield," - "read," - "write," - "prot," - "static," - "const," - "explicit," - "inline," - "final," - "sealed," - "new," - "optional," - "required," - "volatile," - "virt," - "mutable," - "initonly," - "attribute," - "property," - "readonly," - "bound," - "constrained," - "transient," - "maybevoid," - "maybedefault," - "maybeambiguous," - "readable," - "writable," - "gettable," - "protectedsettable," - "protectedgettable," - "settable," - "privatesettable," - "privategettable," - "accessor," - "addable," - "removable," - "raisable," - "kind," - "bodystart," - "bodyend," - "id_bodyfile," - "id_file," - "line," - "column," - "detaileddescription," - "briefdescription," - "inbodydescription" - ")" - "VALUES " - "(" - ":refid," - ":name," - ":definition," - ":type," - ":argsstring," - ":scope," - ":initializer," - ":bitfield," - ":read," - ":write," - ":prot," - ":static," - ":const," - ":explicit," - ":inline," - ":final," - ":sealed," - ":new," - ":optional," - ":required," - ":volatile," - ":virt," - ":mutable," - ":initonly," - ":attribute," - ":property," - ":readonly," - ":bound," - ":constrained," - ":transient," - ":maybevoid," - ":maybedefault," - ":maybeambiguous," - ":readable," - ":writable," - ":gettable," - ":protectedsettable," - ":protectedgettable," - ":settable," - ":privatesettable," - ":privategettable," - ":accessor," - ":addable," - ":removable," - ":raisable," - ":kind," - ":bodystart," - ":bodyend," - ":id_bodyfile," - ":id_file," - ":line," - ":column," - ":detaileddescription," - ":briefdescription," - ":inbodydescription" - ")" - ,NULL +SqlStmt memberdef_exists={ + "SELECT EXISTS (SELECT * FROM memberdef WHERE rowid = :rowid)" + ,NULL +}; + +SqlStmt memberdef_incomplete={ + "SELECT EXISTS (" + "SELECT * FROM memberdef WHERE " + "rowid = :rowid AND inline != 2 AND inline != :new_inline" + ")" + ,NULL +}; + +SqlStmt memberdef_insert={ + "INSERT INTO memberdef " + "(" + "rowid," + "name," + "definition," + "type," + "argsstring," + "scope," + "initializer," + "bitfield," + "read," + "write," + "prot," + "static," + "const," + "explicit," + "inline," + "final," + "sealed," + "new," + "optional," + "required," + "volatile," + "virt," + "mutable," + "initonly," + "attribute," + "property," + "readonly," + "bound," + "constrained," + "transient," + "maybevoid," + "maybedefault," + "maybeambiguous," + "readable," + "writable," + "gettable," + "protectedsettable," + "protectedgettable," + "settable," + "privatesettable," + "privategettable," + "accessor," + "addable," + "removable," + "raisable," + "kind," + "bodystart," + "bodyend," + "bodyfile_id," + "file_id," + "line," + "column," + "detaileddescription," + "briefdescription," + "inbodydescription" + ")" + "VALUES " + "(" + ":rowid," + ":name," + ":definition," + ":type," + ":argsstring," + ":scope," + ":initializer," + ":bitfield," + ":read," + ":write," + ":prot," + ":static," + ":const," + ":explicit," + ":inline," + ":final," + ":sealed," + ":new," + ":optional," + ":required," + ":volatile," + ":virt," + ":mutable," + ":initonly," + ":attribute," + ":property," + ":readonly," + ":bound," + ":constrained," + ":transient," + ":maybevoid," + ":maybedefault," + ":maybeambiguous," + ":readable," + ":writable," + ":gettable," + ":protectedsettable," + ":protectedgettable," + ":settable," + ":privatesettable," + ":privategettable," + ":accessor," + ":addable," + ":removable," + ":raisable," + ":kind," + ":bodystart," + ":bodyend," + ":bodyfile_id," + ":file_id," + ":line," + ":column," + ":detaileddescription," + ":briefdescription," + ":inbodydescription" + ")" + ,NULL +}; +/* +We have a slightly different need than the XML here. The XML can have two +memberdef nodes with the same refid to document the declaration and the +definition. This doesn't play very nice with a referential model. It isn't a +big issue if only one is documented, but in case both are, we'll fall back on +this kludge to combine them in a single row... +*/ +SqlStmt memberdef_update_decl={ + "UPDATE memberdef SET " + "inline = :inline," + "file_id = :file_id," + "line = :line," + "column = :column," + "detaileddescription = 'Declaration: ' || :detaileddescription || 'Definition: ' || detaileddescription," + "briefdescription = 'Declaration: ' || :briefdescription || 'Definition: ' || briefdescription," + "inbodydescription = 'Declaration: ' || :inbodydescription || 'Definition: ' || inbodydescription " + "WHERE rowid = :rowid" + ,NULL +}; +SqlStmt memberdef_update_def={ + "UPDATE memberdef SET " + "inline = :inline," + "bodystart = :bodystart," + "bodyend = :bodyend," + "bodyfile_id = :bodyfile_id," + "detaileddescription = 'Declaration: ' || detaileddescription || 'Definition: ' || :detaileddescription," + "briefdescription = 'Declaration: ' || briefdescription || 'Definition: ' || :briefdescription," + "inbodydescription = 'Declaration: ' || inbodydescription || 'Definition: ' || :inbodydescription " + "WHERE rowid = :rowid" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt compounddef_insert={"INSERT INTO compounddef " - "( name, kind, prot, refid, id_file, line, column ) " - "VALUES " - "(:name,:kind,:prot,:refid,:id_file,:line,:column )" - ,NULL +SqlStmt member_insert={ + "INSERT INTO member " + "( scope_rowid, memberdef_rowid, prot, virt ) " + "VALUES " + "(:scope_rowid,:memberdef_rowid,:prot,:virt )" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt basecompoundref_insert={"INSERT INTO basecompoundref " - "( base, derived, refid, prot, virt ) " - "VALUES " - "(:base,:derived,:refid,:prot,:virt )" - ,NULL +SqlStmt compounddef_insert={ + "INSERT INTO compounddef " + "(" + "rowid," + "name," + "title," + "kind," + "prot," + "file_id," + "line," + "column," + "header_id," + "briefdescription," + "detaileddescription" + ")" + "VALUES " + "(" + ":rowid," + ":name," + ":title," + ":kind," + ":prot," + ":file_id," + ":line," + ":column," + ":header_id," + ":briefdescription," + ":detaileddescription" + ")" + ,NULL +}; +SqlStmt compounddef_exists={ + "SELECT EXISTS (" + "SELECT * FROM compounddef WHERE rowid = :rowid" + ")" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt derivedcompoundref_insert={"INSERT INTO derivedcompoundref " - "( refid, prot, virt, base, derived ) " - "VALUES " - "(:refid,:prot,:virt,:base,:derived )" - ,NULL +SqlStmt compoundref_insert={ + "INSERT INTO compoundref " + "( base_rowid, derived_rowid, prot, virt ) " + "VALUES " + "(:base_rowid,:derived_rowid,:prot,:virt )" + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt params_select = { "SELECT rowid FROM params WHERE " +SqlStmt param_select = { + "SELECT rowid FROM param WHERE " "(attributes IS NULL OR attributes=:attributes) AND " "(type IS NULL OR type=:type) AND " "(declname IS NULL OR declname=:declname) AND " @@ -418,27 +804,22 @@ SqlStmt params_select = { "SELECT rowid FROM params WHERE " "(array IS NULL OR array=:array) AND " "(defval IS NULL OR defval=:defval) AND " "(briefdescription IS NULL OR briefdescription=:briefdescription)" - ,NULL + ,NULL }; -SqlStmt params_insert = { "INSERT INTO params " - "( attributes, type, declname, defname, array, defval, briefdescription ) " - "VALUES " +SqlStmt param_insert = { + "INSERT INTO param " + "( attributes, type, declname, defname, array, defval, briefdescription ) " + "VALUES " "(:attributes,:type,:declname,:defname,:array,:defval,:briefdescription)" - ,NULL -}; -////////////////////////////////////////////////////// -SqlStmt memberdef_params_insert={ "INSERT INTO memberdef_params " - "( id_memberdef, id_param)" - "VALUES " - "(:id_memberdef,:id_param)" - ,NULL + ,NULL }; ////////////////////////////////////////////////////// -SqlStmt innernamespace_insert={"INSERT INTO innernamespaces " - "( refid, name)" - "VALUES " - "(:refid,:name)", - NULL +SqlStmt memberdef_param_insert={ + "INSERT INTO memberdef_param " + "( memberdef_id, param_id)" + "VALUES " + "(:memberdef_id,:param_id)" + ,NULL }; @@ -491,7 +872,7 @@ static bool bindIntParameter(SqlStmt &s,const char *name,int value) { int idx = sqlite3_bind_parameter_index(s.stmt, name); if (idx==0) { - msg("sqlite3_bind_parameter_index(%s)[%s] failed: %s\n", name, s.query, sqlite3_errmsg(s.db)); + msg("sqlite3_bind_parameter_index(%s)[%s] failed to find column: %s\n", name, s.query, sqlite3_errmsg(s.db)); return false; } int rv = sqlite3_bind_int(s.stmt, idx, value); @@ -508,7 +889,7 @@ static int step(SqlStmt &s,bool getRowId=FALSE, bool select=FALSE) int rc = sqlite3_step(s.stmt); if (rc!=SQLITE_DONE && rc!=SQLITE_ROW) { - msg("sqlite3_step: %s\n", sqlite3_errmsg(s.db)); + DBG_CTX(("sqlite3_step: %s (rc: %d)\n", sqlite3_errmsg(s.db), rc)); sqlite3_reset(s.stmt); sqlite3_clear_bindings(s.stmt); return -1; @@ -520,72 +901,118 @@ static int step(SqlStmt &s,bool getRowId=FALSE, bool select=FALSE) return rowid; } -static int insertFile(const char* name) +static int insertPath(QCString name, bool local=TRUE, bool found=TRUE, int type=1) { int rowid=-1; if (name==0) return rowid; - bindTextParameter(files_select,":name",name); - rowid=step(files_select,TRUE,TRUE); + name = stripFromPath(name); + + bindTextParameter(path_select,":name",name.data(),FALSE); + rowid=step(path_select,TRUE,TRUE); if (rowid==0) { - bindTextParameter(files_insert,":name",name); - rowid=step(files_insert,TRUE); + bindTextParameter(path_insert,":name",name.data(),FALSE); + bindIntParameter(path_insert,":type",type); + bindIntParameter(path_insert,":local",local?1:0); + bindIntParameter(path_insert,":found",found?1:0); + rowid=step(path_insert,TRUE); } return rowid; } -static int insertRefid(const char *refid) +static void recordMetadata() { - int rowid=-1; - if (refid==0) return rowid; + bindTextParameter(meta_insert,":doxygen_version",versionString); + bindTextParameter(meta_insert,":schema_version","0.2.0"); //TODO: this should be a constant somewhere; not sure where + bindTextParameter(meta_insert,":generated_at",dateToString(TRUE), FALSE); + bindTextParameter(meta_insert,":generated_on",dateToString(FALSE), FALSE); + bindTextParameter(meta_insert,":project_name",Config_getString(PROJECT_NAME)); + bindTextParameter(meta_insert,":project_number",Config_getString(PROJECT_NUMBER)); + bindTextParameter(meta_insert,":project_brief",Config_getString(PROJECT_BRIEF)); + step(meta_insert); +} - bindTextParameter(refids_select,":refid",refid); - rowid=step(refids_select,TRUE,TRUE); - if (rowid==0) +struct Refid { + int rowid; + const char *refid; + bool created; +}; + +struct Refid insertRefid(const char *refid) +{ + struct Refid ret; + ret.rowid=-1; + ret.refid=refid; + ret.created = FALSE; + if (refid==0) return ret; + + bindTextParameter(refid_select,":refid",refid); + ret.rowid=step(refid_select,TRUE,TRUE); + if (ret.rowid==0) { - bindTextParameter(refids_insert,":refid",refid); - rowid=step(refids_insert,TRUE); + bindTextParameter(refid_insert,":refid",refid); + ret.rowid=step(refid_insert,TRUE); + ret.created = TRUE; } - return rowid; + + return ret; +} + +static bool memberdefExists(struct Refid refid) +{ + bindIntParameter(memberdef_exists,":rowid",refid.rowid); + int test = step(memberdef_exists,TRUE,TRUE); + return test ? true : false; } +static bool memberdefIncomplete(struct Refid refid, const MemberDef* md) +{ + bindIntParameter(memberdef_incomplete,":rowid",refid.rowid); + bindIntParameter(memberdef_incomplete,":new_inline",md->isInline()); + int test = step(memberdef_incomplete,TRUE,TRUE); + return test ? true : false; +} -static bool insertMemberReference(int refid_src, int refid_dst, - int id_file, int line, int column) +static bool compounddefExists(struct Refid refid) { - if (id_file==-1||refid_src==-1||refid_dst==-1) + bindIntParameter(compounddef_exists,":rowid",refid.rowid); + int test = step(compounddef_exists,TRUE,TRUE); + return test ? true : false; +} + +static bool insertMemberReference(struct Refid src_refid, struct Refid dst_refid, const char *context) +{ + if (src_refid.rowid==-1||dst_refid.rowid==-1) return false; if ( - !bindIntParameter(xrefs_insert,":refid_src",refid_src) || - !bindIntParameter(xrefs_insert,":refid_dst",refid_dst) || - !bindIntParameter(xrefs_insert,":id_file",id_file) || - !bindIntParameter(xrefs_insert,":line",line) || - !bindIntParameter(xrefs_insert,":column",column) + !bindIntParameter(xrefs_insert,":src_rowid",src_refid.rowid) || + !bindIntParameter(xrefs_insert,":dst_rowid",dst_refid.rowid) ) { return false; } + else + { + bindTextParameter(xrefs_insert,":context",context); + } step(xrefs_insert); return true; } -static void insertMemberReference(const MemberDef *src, const MemberDef *dst) +static void insertMemberReference(const MemberDef *src, const MemberDef *dst, const char *context) { - QCString qrefid_dst = dst->getOutputFileBase() + "_1" + dst->anchor(); - QCString qrefid_src = src->getOutputFileBase() + "_1" + src->anchor(); - if (dst->getStartBodyLine()!=-1 && dst->getBodyDef()) - { - int refid_src = insertRefid(qrefid_src.data()); - int refid_dst = insertRefid(qrefid_dst.data()); - int id_file = insertFile("no-file"); // TODO: replace no-file with proper file - insertMemberReference(refid_src,refid_dst,id_file,dst->getStartBodyLine(),-1); - } + QCString qdst_refid = dst->getOutputFileBase() + "_1" + dst->anchor(); + QCString qsrc_refid = src->getOutputFileBase() + "_1" + src->anchor(); + + struct Refid src_refid = insertRefid(qsrc_refid); + struct Refid dst_refid = insertRefid(qdst_refid); + insertMemberReference(src_refid,dst_refid,context); } -static void insertMemberFunctionParams(int id_memberdef, const MemberDef *md, const Definition *def) +static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, const Definition *def) { ArgumentList *declAl = md->declArgumentList(); ArgumentList *defAl = md->argumentList(); @@ -600,8 +1027,8 @@ static void insertMemberFunctionParams(int id_memberdef, const MemberDef *md, co if (!a->attrib.isEmpty()) { - bindTextParameter(params_select,":attributes",a->attrib.data()); - bindTextParameter(params_insert,":attributes",a->attrib.data()); + bindTextParameter(param_select,":attributes",a->attrib); + bindTextParameter(param_insert,":attributes",a->attrib); } if (!a->type.isEmpty()) { @@ -612,57 +1039,56 @@ static void insertMemberFunctionParams(int id_memberdef, const MemberDef *md, co QCString *s; while ((s=li.current())) { - QCString qrefid_src = md->getOutputFileBase() + "_1" + md->anchor(); - int refid_src = insertRefid(qrefid_src.data()); - int refid_dst = insertRefid(s->data()); - int id_file = insertFile(stripFromPath(def->getDefFileName())); - insertMemberReference(refid_src,refid_dst,id_file,md->getDefLine(),-1); + QCString qsrc_refid = md->getOutputFileBase() + "_1" + md->anchor(); + struct Refid src_refid = insertRefid(qsrc_refid); + struct Refid dst_refid = insertRefid(s->data()); + insertMemberReference(src_refid,dst_refid, "argument"); ++li; } - bindTextParameter(params_select,":type",a->type.data()); - bindTextParameter(params_insert,":type",a->type.data()); + bindTextParameter(param_select,":type",a->type); + bindTextParameter(param_insert,":type",a->type); } if (!a->name.isEmpty()) { - bindTextParameter(params_select,":declname",a->name.data()); - bindTextParameter(params_insert,":declname",a->name.data()); + bindTextParameter(param_select,":declname",a->name); + bindTextParameter(param_insert,":declname",a->name); } if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name) { - bindTextParameter(params_select,":defname",defArg->name.data()); - bindTextParameter(params_insert,":defname",defArg->name.data()); + bindTextParameter(param_select,":defname",defArg->name); + bindTextParameter(param_insert,":defname",defArg->name); } if (!a->array.isEmpty()) { - bindTextParameter(params_select,":array",a->array.data()); - bindTextParameter(params_insert,":array",a->array.data()); + bindTextParameter(param_select,":array",a->array); + bindTextParameter(param_insert,":array",a->array); } if (!a->defval.isEmpty()) { StringList l; linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,a->defval); - bindTextParameter(params_select,":defval",a->defval.data()); - bindTextParameter(params_insert,":defval",a->defval.data()); + bindTextParameter(param_select,":defval",a->defval); + bindTextParameter(param_insert,":defval",a->defval); } if (defArg) ++defAli; - int id_param=step(params_select,TRUE,TRUE); - if (id_param==0) { - id_param=step(params_insert,TRUE); + int param_id=step(param_select,TRUE,TRUE); + if (param_id==0) { + param_id=step(param_insert,TRUE); } - if (id_param==-1) { - msg("error INSERT params failed\n"); + if (param_id==-1) { + DBG_CTX(("error INSERT params failed\n")); continue; } - bindIntParameter(memberdef_params_insert,":id_memberdef",id_memberdef); - bindIntParameter(memberdef_params_insert,":id_param",id_param); - step(memberdef_params_insert); + bindIntParameter(memberdef_param_insert,":memberdef_id",memberdef_id); + bindIntParameter(memberdef_param_insert,":param_id",param_id); + step(memberdef_param_insert); } } } -static void insertMemberDefineParams(int id_memberdef,const MemberDef *md, const Definition *def) +static void insertMemberDefineParams(int memberdef_id,const MemberDef *md, const Definition *def) { if (md->argumentList()->count()==0) // special case for "foo()" to // disguish it from "foo". @@ -675,20 +1101,34 @@ static void insertMemberDefineParams(int id_memberdef,const MemberDef *md, const Argument *a; for (ali.toFirst();(a=ali.current());++ali) { - bindTextParameter(params_insert,":defname",a->type.data()); - int id_param=step(params_insert,TRUE); - if (id_param==-1) { - msg("error INSERT param(%s) failed\n", a->type.data()); + bindTextParameter(param_insert,":defname",a->type); + int param_id=step(param_insert,TRUE); + if (param_id==-1) { continue; } - bindIntParameter(memberdef_params_insert,":id_memberdef",id_memberdef); - bindIntParameter(memberdef_params_insert,":id_param",id_param); - step(memberdef_params_insert); + bindIntParameter(memberdef_param_insert,":memberdef_id",memberdef_id); + bindIntParameter(memberdef_param_insert,":param_id",param_id); + step(memberdef_param_insert); } } } +static void associateMember(const MemberDef *md, struct Refid member_refid, struct Refid scope_refid) +{ + // TODO: skip EnumValue only to guard against recording refids and member records + // for enumvalues until we can support documenting them as entities. + if (md->memberType()==MemberType_EnumValue) return; + if (md->name().at(0)!='@') // skip anonymous members + { + bindIntParameter(member_insert, ":scope_rowid", scope_refid.rowid); + bindIntParameter(member_insert, ":memberdef_rowid", member_refid.rowid); + + bindIntParameter(member_insert, ":prot", md->protection()); + bindIntParameter(member_insert, ":virt", md->virtualness()); + step(member_insert); + } +} static void stripQualifiers(QCString &typeStr) { @@ -720,22 +1160,28 @@ static int prepareStatement(sqlite3 *db, SqlStmt &s) static int prepareStatements(sqlite3 *db) { if ( + -1==prepareStatement(db, meta_insert) || + -1==prepareStatement(db, memberdef_exists) || + -1==prepareStatement(db, memberdef_incomplete) || -1==prepareStatement(db, memberdef_insert) || - -1==prepareStatement(db, files_insert) || - -1==prepareStatement(db, files_select) || - -1==prepareStatement(db, refids_insert) || - -1==prepareStatement(db, refids_select) || + -1==prepareStatement(db, memberdef_update_def) || + -1==prepareStatement(db, memberdef_update_decl) || + -1==prepareStatement(db, member_insert) || + -1==prepareStatement(db, path_insert) || + -1==prepareStatement(db, path_select) || + -1==prepareStatement(db, refid_insert) || + -1==prepareStatement(db, refid_select) || -1==prepareStatement(db, incl_insert)|| -1==prepareStatement(db, incl_select)|| - -1==prepareStatement(db, params_insert) || - -1==prepareStatement(db, params_select) || + -1==prepareStatement(db, param_insert) || + -1==prepareStatement(db, param_select) || -1==prepareStatement(db, xrefs_insert) || - -1==prepareStatement(db, innerclass_insert) || + -1==prepareStatement(db, reimplements_insert) || + -1==prepareStatement(db, contains_insert) || + -1==prepareStatement(db, compounddef_exists) || -1==prepareStatement(db, compounddef_insert) || - -1==prepareStatement(db, basecompoundref_insert) || - -1==prepareStatement(db, derivedcompoundref_insert) || - -1==prepareStatement(db, memberdef_params_insert)|| - -1==prepareStatement(db, innernamespace_insert) + -1==prepareStatement(db, compoundref_insert) || + -1==prepareStatement(db, memberdef_param_insert) ) { return -1; @@ -763,15 +1209,35 @@ static void pragmaTuning(sqlite3 *db) sqlite3_exec(db, "PRAGMA temp_store = MEMORY;", NULL, NULL, &sErrMsg); } -static int initializeSchema(sqlite3* db) +static int initializeTables(sqlite3* db) +{ + int rc; + sqlite3_stmt *stmt = 0; + + msg("Initializing DB schema (tables)...\n"); + for (unsigned int k = 0; k < sizeof(table_schema) / sizeof(table_schema[0]); k++) + { + const char *q = table_schema[k][1]; + char *errmsg; + rc = sqlite3_exec(db, q, NULL, NULL, &errmsg); + if (rc != SQLITE_OK) + { + msg("failed to execute query: %s\n\t%s\n", q, errmsg); + return -1; + } + } + return 0; +} + +static int initializeViews(sqlite3* db) { int rc; sqlite3_stmt *stmt = 0; - msg("Initializing DB schema...\n"); - for (unsigned int k = 0; k < sizeof(schema_queries) / sizeof(schema_queries[0]); k++) + msg("Initializing DB schema (views)...\n"); + for (unsigned int k = 0; k < sizeof(view_schema) / sizeof(view_schema[0]); k++) { - const char *q = schema_queries[k][1]; + const char *q = view_schema[k][1]; char *errmsg; rc = sqlite3_exec(db, q, NULL, NULL, &errmsg); if (rc != SQLITE_OK) @@ -784,40 +1250,122 @@ static int initializeSchema(sqlite3* db) } //////////////////////////////////////////// -static void writeInnerClasses(const ClassSDict *cl) +/* TODO: +I collapsed all innerX tables into 'contains', which raises the prospect that +all of these very similar writeInnerX funcs could be refactored into a one, +or a small set of common parts. + +I think the hurdles are: +- picking a first argument that every call location can pass +- which yields a consistent iterator +- accommodates PageDef's slightly different rules for generating the + inner_refid (unless I'm missing a method that would uniformly return + the correct refid for all types). +*/ +static void writeInnerClasses(const ClassSDict *cl, struct Refid outer_refid) { if (!cl) return; ClassSDict::Iterator cli(*cl); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes { - int refid = insertRefid(cd->getOutputFileBase()); - bindIntParameter(innerclass_insert,":refid", refid); - bindIntParameter(innerclass_insert,":prot",cd->protection()); - bindTextParameter(innerclass_insert,":name",cd->name()); - step(innerclass_insert); + struct Refid inner_refid = insertRefid(cd->getOutputFileBase()); + + bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid); + bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid); + step(contains_insert); } } } +static void writeInnerPages(const PageSDict *pl, struct Refid outer_refid) +{ + if (!pl) return; + + PageSDict::Iterator pli(*pl); + const PageDef *pd; + for (pli.toFirst();(pd=pli.current());++pli) + { + struct Refid inner_refid = insertRefid( + pd->getGroupDef() ? pd->getOutputFileBase()+"_"+pd->name() : pd->getOutputFileBase() + ); + + bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid); + bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid); + step(contains_insert); -static void writeInnerNamespaces(const NamespaceSDict *nl) + } +} + +static void writeInnerGroups(const GroupList *gl, struct Refid outer_refid) +{ + if (gl) + { + GroupListIterator gli(*gl); + const GroupDef *sgd; + for (gli.toFirst();(sgd=gli.current());++gli) + { + struct Refid inner_refid = insertRefid(sgd->getOutputFileBase()); + + bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid); + bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid); + step(contains_insert); + } + } +} + +static void writeInnerFiles(const FileList *fl, struct Refid outer_refid) +{ + if (fl) + { + QListIterator fli(*fl); + const FileDef *fd; + for (fli.toFirst();(fd=fli.current());++fli) + { + struct Refid inner_refid = insertRefid(fd->getOutputFileBase()); + + bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid); + bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid); + step(contains_insert); + } + } +} + +static void writeInnerDirs(const DirList *dl, struct Refid outer_refid) +{ + if (dl) + { + QListIterator subdirs(*dl); + const DirDef *subdir; + for (subdirs.toFirst();(subdir=subdirs.current());++subdirs) + { + struct Refid inner_refid = insertRefid(subdir->getOutputFileBase()); + + bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid); + bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid); + step(contains_insert); + } + } +} + +static void writeInnerNamespaces(const NamespaceSDict *nl, struct Refid outer_refid) { if (nl) { NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes + if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes { - int refid = insertRefid(nd->getOutputFileBase()); - bindIntParameter(innernamespace_insert,":refid",refid); - bindTextParameter(innernamespace_insert,":name",nd->name(),FALSE); - step(innernamespace_insert); + struct Refid inner_refid = insertRefid(nd->getOutputFileBase()); + + bindIntParameter(contains_insert,":inner_rowid",inner_refid.rowid); + bindIntParameter(contains_insert,":outer_rowid",outer_refid.rowid); + step(contains_insert); } } } @@ -837,24 +1385,24 @@ static void writeTemplateArgumentList(const ArgumentList * al, if (!a->type.isEmpty()) { #warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->type); - bindTextParameter(params_select,":type",a->type); - bindTextParameter(params_insert,":type",a->type); + bindTextParameter(param_select,":type",a->type); + bindTextParameter(param_insert,":type",a->type); } if (!a->name.isEmpty()) { - bindTextParameter(params_select,":declname",a->name); - bindTextParameter(params_insert,":declname",a->name); - bindTextParameter(params_select,":defname",a->name); - bindTextParameter(params_insert,":defname",a->name); + bindTextParameter(param_select,":declname",a->name); + bindTextParameter(param_insert,":declname",a->name); + bindTextParameter(param_select,":defname",a->name); + bindTextParameter(param_insert,":defname",a->name); } if (!a->defval.isEmpty()) { #warning linkifyText(TextGeneratorXMLImpl(t),scope,fileScope,0,a->defval); - bindTextParameter(params_select,":defval",a->defval); - bindTextParameter(params_insert,":defval",a->defval); + bindTextParameter(param_select,":defval",a->defval); + bindTextParameter(param_insert,":defval",a->defval); } - if (!step(params_select,TRUE,TRUE)) - step(params_insert); + if (!step(param_select,TRUE,TRUE)) + step(param_insert); } } } @@ -871,15 +1419,132 @@ static void writeTemplateList(const ClassDef *cd) { writeTemplateArgumentList(cd->templateArguments(),cd,0); } + +QCString getSQLDocBlock(const Definition *scope, + const Definition *def, + const QCString &doc, + const QCString &fileName, + int lineNr) +{ + QGString s; + if (doc.isEmpty()) return s.data(); + FTextStream t(&s); + DocNode *root = validatingParseDoc( + fileName, + lineNr, + const_cast(scope), + const_cast(reinterpret_cast(def)), + doc, + FALSE, + FALSE + ); + XMLCodeGenerator codeGen(t); + // create a parse tree visitor for XML + XmlDocVisitor *visitor = new XmlDocVisitor(t,codeGen); + root->accept(visitor); + delete visitor; + delete root; + QCString result = convertCharEntitiesToUTF8(s.data()); + return result.data(); +} + +static void getSQLDesc(SqlStmt &s,const char *col,const char *value,const Definition *def) +{ + bindTextParameter( + s, + col, + getSQLDocBlock( + def->getOuterScope(), + def, + value, + def->docFile(), + def->docLine() + ), + FALSE + ); +} //////////////////////////////////////////// +/* (updated Sep 01 2018) +DoxMemberKind and DoxCompoundKind (compound.xsd) gave me some +faulty assumptions about "kind" strings, so I compiled a reference + +The XML schema claims: + DoxMemberKind: (14) + dcop define enum event friend function interface property prototype + service signal slot typedef variable + + DoxCompoundKind: (17) + category class dir example exception file group interface module + namespace page protocol service singleton struct type union + +Member kind comes from MemberDef::memberTypeName() + types.h defines 14 MemberType_*s + _DCOP _Define _Enumeration _EnumValue _Event _Friend _Function _Interface + _Property _Service _Signal _Slot _Typedef _Variable + - xml doesn't include enumvalue here + (but renders enumvalue as) a sub-node of memberdef/templateparamlist + - xml includes 'prototype' that is unlisted here + vestigial? commented out in docsets.cpp and perlmodgen.cpp + MemberDef::memberTypeName() can return 15 strings: + (sorted by MemberType to match above; quoted because whitespace...) + "dcop" "macro definition" "enumeration" "enumvalue" "event" "friend" + "function" "interface" "property" "service" "signal" "slot" "typedef" + "variable" + + Above describes potential values for memberdef.kind + +Compound kind is more complex. *Def::compoundTypeString() + ClassDef kind comes from ::compoundTypeString() + classdef.h defines 9 compound types + Category Class Exception Interface Protocol Service Singleton Struct Union + But ClassDef::compoundTypeString() "could" return 13 strings + - default "unknown" shouldn't actually return + - other 12 can vary by source language; see method for specifics + category class enum exception interface module protocol service + singleton struct type union + + DirDef, FileDef, GroupDef have no method to return a string + tagfile/outputs hard-code kind to 'dir' 'file' or 'group' + + NamespaceDef kind comes from ::compoundTypeString() + NamespaceDef::compoundTypeString() "could" return 6 strings + - default empty ("") string + - other 5 differ by source language + constants library module namespace package + + PageDef also has no method to return a string + - some locations hard-code the kind to 'page' + - others conditionally output 'page' or 'example' + + All together, that's 23 potential strings (21 excl "" and unknown) + "" category class constants dir enum example exception file group + interface library module namespace package page protocol service singleton + struct type union unknown + + Above describes potential values for compounddef.kind + +For reference, there are 35 potential values of def.kind (33 excl "" and unknown): + "" "category" "class" "constants" "dcop" "dir" "enum" "enumeration" + "enumvalue" "event" "example" "exception" "file" "friend" "function" "group" + "interface" "library" "macro definition" "module" "namespace" "package" + "page" "property" "protocol" "service" "signal" "singleton" "slot" "struct" + "type" "typedef" "union" "unknown" "variable" + +This is relevant because the 'def' view generalizes memberdef and compounddef, +and two member+compound kind strings (interface and service) overlap. + +I have no grasp of whether a real user docset would include one or more +member and compound using the interface or service kind. +*/ + ////////////////////////////////////////////////////////////////////////////// -static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) +static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_refid, const Definition *def) { // + declaration/definition arg lists // + reimplements // + reimplementedBy - // + exceptions + // - exceptions // + const/volatile specifiers // - examples // + source definition @@ -893,18 +1558,102 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) // enum values are written as part of the enum if (md->memberType()==MemberType_EnumValue) return; if (md->isHidden()) return; - //if (md->name().at(0)=='@') return; // anonymous member - // group members are only visible in their group - //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return; QCString memType; // memberdef QCString qrefid = md->getOutputFileBase() + "_1" + md->anchor(); - int refid = insertRefid(qrefid.data()); + struct Refid refid = insertRefid(qrefid); + + associateMember(md, refid, scope_refid); + + // compacting duplicate defs + if(!refid.created && memberdefExists(refid) && memberdefIncomplete(refid, md)) + { + /* + For performance, ideal to skip a member we've already added. + Unfortunately, we can have two memberdefs with the same refid documenting + the declaration and definition. memberdefIncomplete() uses the 'inline' + value to figure this out. Once we get to this point, we should *only* be + seeing the *other* type of def/decl, so we'll set inline to a new value (2), + indicating that this entry covers both inline types. + */ + struct SqlStmt memberdef_update; + + // definitions have bodyfile/start/end + if (md->getStartBodyLine()!=-1) + { + memberdef_update = memberdef_update_def; + int bodyfile_id = insertPath(md->getBodyDef()->absFilePath(),!md->getBodyDef()->isReference()); + if (bodyfile_id == -1) + { + sqlite3_clear_bindings(memberdef_update.stmt); + } + else + { + bindIntParameter(memberdef_update,":bodyfile_id",bodyfile_id); + bindIntParameter(memberdef_update,":bodystart",md->getStartBodyLine()); + bindIntParameter(memberdef_update,":bodyend",md->getEndBodyLine()); + } + } + // declarations don't + else + { + memberdef_update = memberdef_update_decl; + if (md->getDefLine() != -1) + { + int file_id = insertPath(md->getDefFileName(),!md->isReference()); + if (file_id!=-1) + { + bindIntParameter(memberdef_update,":file_id",file_id); + bindIntParameter(memberdef_update,":line",md->getDefLine()); + bindIntParameter(memberdef_update,":column",md->getDefColumn()); + } + } + } - bindIntParameter(memberdef_insert,":refid", refid); - bindIntParameter(memberdef_insert,":kind",md->memberType()); + bindIntParameter(memberdef_update, ":rowid", refid.rowid); + // value 2 indicates we've seen "both" inline types. + bindIntParameter(memberdef_update,":inline", 2); + + /* in case both are used, append/prepend descriptions */ + getSQLDesc(memberdef_update,":briefdescription",md->briefDescription(),md); + getSQLDesc(memberdef_update,":detaileddescription",md->documentation(),md); + getSQLDesc(memberdef_update,":inbodydescription",md->inbodyDocumentation(),md); + + step(memberdef_update,TRUE); + + // don't think we need to repeat params; should have from first encounter + + // + source references + // The cross-references in initializers only work when both the src and dst + // are defined. + MemberSDict *mdict = md->getReferencesMembers(); + if (mdict!=0) + { + MemberSDict::IteratorDict mdi(*mdict); + const MemberDef *rmd; + for (mdi.toFirst();(rmd=mdi.current());++mdi) + { + insertMemberReference(md,rmd, "inline"); + } + } + // + source referenced by + mdict = md->getReferencedByMembers(); + if (mdict!=0) + { + MemberSDict::IteratorDict mdi(*mdict); + const MemberDef *rmd; + for (mdi.toFirst();(rmd=mdi.current());++mdi) + { + insertMemberReference(rmd,md, "inline"); + } + } + return; + } + + bindIntParameter(memberdef_insert,":rowid", refid.rowid); + bindTextParameter(memberdef_insert,":kind",md->memberTypeName(),FALSE); bindIntParameter(memberdef_insert,":prot",md->protection()); bindIntParameter(memberdef_insert,":static",md->isStatic()); @@ -973,6 +1722,7 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) bindIntParameter(memberdef_insert,":settable",md->isSettable()); bindIntParameter(memberdef_insert,":privatesettable",md->isPrivateSettable()); bindIntParameter(memberdef_insert,":protectedsettable",md->isProtectedSettable()); + if (md->isAssign() || md->isCopy() || md->isRetain() || md->isStrong() || md->isWeak()) { @@ -995,6 +1745,18 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) bindIntParameter(memberdef_insert,":raisable",md->isRaisable()); } + const MemberDef *rmd = md->reimplements(); + if(rmd) + { + QCString qreimplemented_refid = rmd->getOutputFileBase() + "_1" + rmd->anchor(); + + struct Refid reimplemented_refid = insertRefid(qreimplemented_refid); + + bindIntParameter(reimplements_insert,":memberdef_rowid", refid.rowid); + bindIntParameter(reimplements_insert,":reimplemented_rowid", reimplemented_refid.rowid); + step(reimplements_insert,TRUE); + } + // + declaration/definition arg lists if (md->memberType()!=MemberType_Define && md->memberType()!=MemberType_Enumeration @@ -1008,9 +1770,9 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) stripQualifiers(typeStr); StringList l; linkifyText(TextGeneratorSqlite3Impl(l), def, md->getBodyDef(),md,typeStr); - if (typeStr.data()) + if (typeStr) { - bindTextParameter(memberdef_insert,":type",typeStr.data(),FALSE); + bindTextParameter(memberdef_insert,":type",typeStr,FALSE); } if (md->definition()) @@ -1029,7 +1791,7 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) // Extract references from initializer if (md->hasMultiLineInitializer() || md->hasOneLineInitializer()) { - bindTextParameter(memberdef_insert,":initializer",md->initializer().data()); + bindTextParameter(memberdef_insert,":initializer",md->initializer()); StringList l; linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,md->initializer()); @@ -1044,11 +1806,10 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) s->data(), md->getBodyDef()->getDefFileName().data(), md->getStartBodyLine())); - QCString qrefid_src = md->getOutputFileBase() + "_1" + md->anchor(); - int refid_src = insertRefid(qrefid_src.data()); - int refid_dst = insertRefid(s->data()); - int id_file = insertFile(stripFromPath(md->getBodyDef()->getDefFileName())); - insertMemberReference(refid_src,refid_dst,id_file,md->getStartBodyLine(),-1); + QCString qsrc_refid = md->getOutputFileBase() + "_1" + md->anchor(); + struct Refid src_refid = insertRefid(qsrc_refid); + struct Refid dst_refid = insertRefid(s->data()); + insertMemberReference(src_refid,dst_refid, "initializer"); } ++li; } @@ -1056,34 +1817,35 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) if ( md->getScopeString() ) { - bindTextParameter(memberdef_insert,":scope",md->getScopeString().data(),FALSE); + bindTextParameter(memberdef_insert,":scope",md->getScopeString(),FALSE); } // +Brief, detailed and inbody description - bindTextParameter(memberdef_insert,":briefdescription",md->briefDescription(),FALSE); - bindTextParameter(memberdef_insert,":detaileddescription",md->documentation(),FALSE); - bindTextParameter(memberdef_insert,":inbodydescription",md->inbodyDocumentation(),FALSE); + getSQLDesc(memberdef_insert,":briefdescription",md->briefDescription(),md); + getSQLDesc(memberdef_insert,":detaileddescription",md->documentation(),md); + getSQLDesc(memberdef_insert,":inbodydescription",md->inbodyDocumentation(),md); // File location if (md->getDefLine() != -1) { - int id_file = insertFile(stripFromPath(md->getDefFileName())); - if (id_file!=-1) + int file_id = insertPath(md->getDefFileName(),!md->isReference()); + if (file_id!=-1) { - bindIntParameter(memberdef_insert,":id_file",id_file); + bindIntParameter(memberdef_insert,":file_id",file_id); bindIntParameter(memberdef_insert,":line",md->getDefLine()); bindIntParameter(memberdef_insert,":column",md->getDefColumn()); + // definitions also have bodyfile/start/end if (md->getStartBodyLine()!=-1) { - int id_bodyfile = insertFile(stripFromPath(md->getBodyDef()->absFilePath())); - if (id_bodyfile == -1) + int bodyfile_id = insertPath(md->getBodyDef()->absFilePath(),!md->getBodyDef()->isReference()); + if (bodyfile_id == -1) { sqlite3_clear_bindings(memberdef_insert.stmt); } else { - bindIntParameter(memberdef_insert,":id_bodyfile",id_bodyfile); + bindIntParameter(memberdef_insert,":bodyfile_id",bodyfile_id); bindIntParameter(memberdef_insert,":bodystart",md->getStartBodyLine()); bindIntParameter(memberdef_insert,":bodyend",md->getEndBodyLine()); } @@ -1091,16 +1853,16 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) } } - int id_memberdef=step(memberdef_insert,TRUE); + int memberdef_id=step(memberdef_insert,TRUE); if (isFunc) { - insertMemberFunctionParams(id_memberdef,md,def); + insertMemberFunctionParams(memberdef_id,md,def); } else if (md->memberType()==MemberType_Define && md->argsString()) { - insertMemberDefineParams(id_memberdef,md,def); + insertMemberDefineParams(memberdef_id,md,def); } // + source references @@ -1110,10 +1872,10 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) if (mdict!=0) { MemberSDict::IteratorDict mdi(*mdict); - MemberDef *rmd; + const MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { - insertMemberReference(md,rmd);//,mdi.currentKey()); + insertMemberReference(md,rmd, "inline"); } } // + source referenced by @@ -1121,62 +1883,79 @@ static void generateSqlite3ForMember(const MemberDef *md, const Definition *def) if (mdict!=0) { MemberSDict::IteratorDict mdi(*mdict); - MemberDef *rmd; + const MemberDef *rmd; for (mdi.toFirst();(rmd=mdi.current());++mdi) { - insertMemberReference(rmd,md);//,mdi.currentKey()); + insertMemberReference(rmd,md, "inline"); } } } static void generateSqlite3Section( const Definition *d, const MemberList *ml, + struct Refid scope_refid, const char * /*kind*/, const char * /*header*/=0, const char * /*documentation*/=0) { if (ml==0) return; MemberListIterator mli(*ml); - MemberDef *md; - int count=0; + const MemberDef *md; + for (mli.toFirst();(md=mli.current());++mli) { + // TODO: necessary? just tracking what xmlgen does; xmlgen says: // namespace members are also inserted in the file scope, but // to prevent this duplication in the XML output, we filter those here. if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) { - count++; + generateSqlite3ForMember(md, scope_refid, d); } } - if (count==0) return; // empty list - for (mli.toFirst();(md=mli.current());++mli) +} + +static void associateAllClassMembers(const ClassDef *cd, struct Refid scope_refid) +{ + if (cd->memberNameInfoSDict()) { - // namespace members are also inserted in the file scope, but - // to prevent this duplication in the XML output, we filter those here. - //if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) + MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); + MemberNameInfo *mni; + for (mnii.toFirst();(mni=mnii.current());++mnii) { - generateSqlite3ForMember(md,d); + MemberNameInfoIterator mii(*mni); + MemberInfo *mi; + for (mii.toFirst();(mi=mii.current());++mii) + { + MemberDef *md = mi->memberDef; + QCString qrefid = md->getOutputFileBase() + "_1" + md->anchor(); + associateMember(md, insertRefid(qrefid), scope_refid); + } } } } - +// many kinds: category class enum exception interface +// module protocol service singleton struct type union +// enum is Java only (and is distinct from enum memberdefs) static void generateSqlite3ForClass(const ClassDef *cd) { + // NOTE: Skeptical about XML's version of these + // 'x' marks missing items XML claims to include + + // + brief description + // + detailed description + // + template argument list(s) + // + include file + // + member groups + // x inheritance DOT diagram // + list of direct super classes // + list of direct sub classes - // + include file // + list of inner classes - // - template argument list(s) - // + member groups + // x collaboration DOT diagram // + list of all members - // - brief description - // - detailed description - // - inheritance DOT diagram - // - collaboration DOT diagram - // - user defined member sections - // - standard member sections - // - detailed member documentation + // x user defined member sections + // x standard member sections + // x detailed member documentation // - examples using the class if (cd->isReference()) return; // skip external references. @@ -1184,43 +1963,86 @@ static void generateSqlite3ForClass(const ClassDef *cd) if (cd->name().find('@')!=-1) return; // skip anonymous compounds. if (cd->templateMaster()!=0) return; // skip generated template instances. - msg("Generating Sqlite3 output for class %s\n",cd->name().data()); + struct Refid refid = insertRefid(cd->getOutputFileBase()); + + // can omit a class that already has a refid + if(!refid.created && compounddefExists(refid)){return;} + + bindIntParameter(compounddef_insert,":rowid", refid.rowid); bindTextParameter(compounddef_insert,":name",cd->name()); + bindTextParameter(compounddef_insert,":title",cd->title(), FALSE); bindTextParameter(compounddef_insert,":kind",cd->compoundTypeString(),FALSE); bindIntParameter(compounddef_insert,":prot",cd->protection()); - int refid = insertRefid(cd->getOutputFileBase()); - bindIntParameter(compounddef_insert,":refid", refid); - int id_file = insertFile(stripFromPath(cd->getDefFileName())); - bindIntParameter(compounddef_insert,":id_file",id_file); + int file_id = insertPath(cd->getDefFileName()); + bindIntParameter(compounddef_insert,":file_id",file_id); bindIntParameter(compounddef_insert,":line",cd->getDefLine()); bindIntParameter(compounddef_insert,":column",cd->getDefColumn()); + // + include file + /* + TODO: I wonder if this can actually be cut (just here) + + We were adding this "include" to the "includes" table alongside + other includes (from a FileDef). However, FileDef and ClassDef are using + "includes" nodes in very a different way: + - With FileDef, it means the file includes another. + - With ClassDef, it means you should include this file to use this class. + + Because of this difference, I added a column to compounddef, header_id, and + linked it back to the appropriate file. We could just add a nullable text + column that would hold a string equivalent to what the HTML docs include, + but the logic for generating it is embedded in + ClassDef::writeIncludeFiles(OutputList &ol). + + That said, at least on the handful of test sets I have, header_id == file_id, + suggesting it could be cut and clients might be able to reconstruct it from + other values if there's a solid heuristic for *when a class will + have a header file*. + */ + IncludeInfo *ii=cd->includeInfo(); + if (ii) + { + QCString nm = ii->includeName; + if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName(); + if (!nm.isEmpty()) + { + int header_id=insertPath(ii->fileDef->absFilePath(),!ii->fileDef->isReference()); + DBG_CTX(("-----> ClassDef includeInfo for %s\n", nm.data())); + DBG_CTX((" local : %d\n", ii->local)); + DBG_CTX((" imported : %d\n", ii->imported)); + DBG_CTX((" indirect : %d\n", ii->indirect)); + DBG_CTX(("header: %s\n", ii->fileDef->absFilePath().data())); + DBG_CTX((" file_id : %d\n", file_id)); + DBG_CTX((" header_id: %d\n", header_id)); + + if(header_id!=-1) + { + bindIntParameter(compounddef_insert,":header_id",header_id); + } + } + } + + getSQLDesc(compounddef_insert,":briefdescription",cd->briefDescription(),cd); + getSQLDesc(compounddef_insert,":detaileddescription",cd->documentation(),cd); + step(compounddef_insert); // + list of direct super classes if (cd->baseClasses()) { BaseClassListIterator bcli(*cd->baseClasses()); - BaseClassDef *bcd; + const BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) { - int refid = insertRefid(bcd->classDef->getOutputFileBase()); - bindIntParameter(basecompoundref_insert,":refid", refid); - bindIntParameter(basecompoundref_insert,":prot",bcd->prot); - bindIntParameter(basecompoundref_insert,":virt",bcd->virt); - - if (!bcd->templSpecifiers.isEmpty()) - { - bindTextParameter(basecompoundref_insert,":base",insertTemplateSpecifierInScope(bcd->classDef->name(),bcd->templSpecifiers),FALSE); - } - else - { - bindTextParameter(basecompoundref_insert,":base",bcd->classDef->displayName(),FALSE); - } - bindTextParameter(basecompoundref_insert,":derived",cd->displayName(),FALSE); - step(basecompoundref_insert); + struct Refid base_refid = insertRefid(bcd->classDef->getOutputFileBase()); + struct Refid derived_refid = insertRefid(cd->getOutputFileBase()); + bindIntParameter(compoundref_insert,":base_rowid", base_refid.rowid); + bindIntParameter(compoundref_insert,":derived_rowid", derived_refid.rowid); + bindIntParameter(compoundref_insert,":prot",bcd->prot); + bindIntParameter(compoundref_insert,":virt",bcd->virt); + step(compoundref_insert); } } @@ -1228,54 +2050,23 @@ static void generateSqlite3ForClass(const ClassDef *cd) if (cd->subClasses()) { BaseClassListIterator bcli(*cd->subClasses()); - BaseClassDef *bcd; + const BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) { - bindTextParameter(derivedcompoundref_insert,":base",cd->displayName(),FALSE); - if (!bcd->templSpecifiers.isEmpty()) - { - bindTextParameter(derivedcompoundref_insert,":derived",insertTemplateSpecifierInScope(bcd->classDef->name(),bcd->templSpecifiers),FALSE); - } - else - { - bindTextParameter(derivedcompoundref_insert,":derived",bcd->classDef->displayName(),FALSE); - } - int refid = insertRefid(bcd->classDef->getOutputFileBase()); - bindIntParameter(derivedcompoundref_insert,":refid", refid); - bindIntParameter(derivedcompoundref_insert,":prot",bcd->prot); - bindIntParameter(derivedcompoundref_insert,":virt",bcd->virt); - step(derivedcompoundref_insert); + struct Refid derived_refid = insertRefid(bcd->classDef->getOutputFileBase()); + struct Refid base_refid = insertRefid(cd->getOutputFileBase()); + bindIntParameter(compoundref_insert,":base_rowid", base_refid.rowid); + bindIntParameter(compoundref_insert,":derived_rowid", derived_refid.rowid); + bindIntParameter(compoundref_insert,":prot",bcd->prot); + bindIntParameter(compoundref_insert,":virt",bcd->virt); + step(compoundref_insert); } } - // + include file - IncludeInfo *ii=cd->includeInfo(); - if (ii) - { - QCString nm = ii->includeName; - if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName(); - if (!nm.isEmpty()) - { - int id_dst=insertFile(nm); - if (id_dst!=-1) { - bindIntParameter(incl_select,":local",ii->local); - bindIntParameter(incl_select,":id_src",id_file); - bindIntParameter(incl_select,":id_dst",id_dst); - int count=step(incl_select,TRUE,TRUE); - if (count==0) - { - bindIntParameter(incl_insert,":local",ii->local); - bindIntParameter(incl_insert,":id_src",id_file); - bindIntParameter(incl_insert,":id_dst",id_dst); - step(incl_insert); - } - } - } - } // + list of inner classes - writeInnerClasses(cd->getClassSDict()); + writeInnerClasses(cd->getClassSDict(),refid); - // - template argument list(s) + // + template argument list(s) writeTemplateList(cd); // + member groups @@ -1285,41 +2076,62 @@ static void generateSqlite3ForClass(const ClassDef *cd) MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - generateSqlite3Section(cd,mg->members(),"user-defined",mg->header(), + generateSqlite3Section(cd,mg->members(),refid,"user-defined",mg->header(), mg->documentation()); } } - // + list of all members + // this is just a list of *local* members QListIterator mli(cd->getMemberLists()); MemberList *ml; for (mli.toFirst();(ml=mli.current());++mli) { if ((ml->listType()&MemberListType_detailedLists)==0) { - generateSqlite3Section(cd,ml,"user-defined");//g_xmlSectionMapper.find(ml->listType())); + generateSqlite3Section(cd,ml,refid,"user-defined"); } } + + // + list of all members + associateAllClassMembers(cd, refid); } +// kinds: constants library module namespace package static void generateSqlite3ForNamespace(const NamespaceDef *nd) { // + contained class definitions // + contained namespace definitions // + member groups // + normal members - // - brief desc - // - detailed desc - // - location + // + brief desc + // + detailed desc + // + location (file_id, line, column) // - files containing (parts of) the namespace definition if (nd->isReference() || nd->isHidden()) return; // skip external references + struct Refid refid = insertRefid(nd->getOutputFileBase()); + if(!refid.created && compounddefExists(refid)){return;} + bindIntParameter(compounddef_insert,":rowid", refid.rowid); + + bindTextParameter(compounddef_insert,":name",nd->name()); + bindTextParameter(compounddef_insert,":title",nd->title(), FALSE); + bindTextParameter(compounddef_insert,":kind","namespace",FALSE); + + int file_id = insertPath(nd->getDefFileName()); + bindIntParameter(compounddef_insert,":file_id",file_id); + bindIntParameter(compounddef_insert,":line",nd->getDefLine()); + bindIntParameter(compounddef_insert,":column",nd->getDefColumn()); + + getSQLDesc(compounddef_insert,":briefdescription",nd->briefDescription(),nd); + getSQLDesc(compounddef_insert,":detaileddescription",nd->documentation(),nd); + + step(compounddef_insert); // + contained class definitions - writeInnerClasses(nd->getClassSDict()); + writeInnerClasses(nd->getClassSDict(),refid); // + contained namespace definitions - writeInnerNamespaces(nd->getNamespaceSDict()); + writeInnerNamespaces(nd->getNamespaceSDict(),refid); // + member groups if (nd->getMemberGroupSDict()) @@ -1328,7 +2140,7 @@ static void generateSqlite3ForNamespace(const NamespaceDef *nd) MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - generateSqlite3Section(nd,mg->members(),"user-defined",mg->header(), + generateSqlite3Section(nd,mg->members(),refid,"user-defined",mg->header(), mg->documentation()); } } @@ -1340,29 +2152,48 @@ static void generateSqlite3ForNamespace(const NamespaceDef *nd) { if ((ml->listType()&MemberListType_declarationLists)!=0) { - generateSqlite3Section(nd,ml,"user-defined");//g_xmlSectionMapper.find(ml->listType())); + generateSqlite3Section(nd,ml,refid,"user-defined"); } } } +// kind: file static void generateSqlite3ForFile(const FileDef *fd) { // + includes files // + includedby files - // - include graph - // - included by graph + // x include graph + // x included by graph // + contained class definitions // + contained namespace definitions // + member groups // + normal members - // - brief desc - // - detailed desc - // - source code - // - location + // + brief desc + // + detailed desc + // x source code + // + location (file_id, line, column) // - number of lines if (fd->isReference()) return; // skip external references + struct Refid refid = insertRefid(fd->getOutputFileBase()); + if(!refid.created && compounddefExists(refid)){return;} + bindIntParameter(compounddef_insert,":rowid", refid.rowid); + + bindTextParameter(compounddef_insert,":name",fd->name(),FALSE); + bindTextParameter(compounddef_insert,":title",fd->title(),FALSE); + bindTextParameter(compounddef_insert,":kind","file",FALSE); + + int file_id = insertPath(fd->getDefFileName()); + bindIntParameter(compounddef_insert,":file_id",file_id); + bindIntParameter(compounddef_insert,":line",fd->getDefLine()); + bindIntParameter(compounddef_insert,":column",fd->getDefColumn()); + + getSQLDesc(compounddef_insert,":briefdescription",fd->briefDescription(),fd); + getSQLDesc(compounddef_insert,":detaileddescription",fd->documentation(),fd); + + step(compounddef_insert); + // + includes files IncludeInfo *ii; if (fd->includeFileList()) @@ -1370,15 +2201,48 @@ static void generateSqlite3ForFile(const FileDef *fd) QListIterator ili(*fd->includeFileList()); for (ili.toFirst();(ii=ili.current());++ili) { - int id_src=insertFile(fd->absFilePath().data()); - int id_dst=insertFile(ii->includeName.data()); + int src_id=insertPath(fd->absFilePath(),!fd->isReference()); + int dst_id; + QCString dst_path; + + if(ii->fileDef) // found file + { + if(ii->fileDef->isReference()) + { + // strip tagfile from path + QCString tagfile = ii->fileDef->getReference(); + dst_path = ii->fileDef->absFilePath().copy(); + dst_path.stripPrefix(tagfile+":"); + } + else + { + dst_path = ii->fileDef->absFilePath(); + } + dst_id = insertPath(dst_path,ii->local); + } + else // can't find file + { + dst_id = insertPath(ii->includeName,ii->local,FALSE); + } + + DBG_CTX(("-----> FileDef includeInfo for %s\n", ii->includeName.data())); + DBG_CTX((" local: %d\n", ii->local)); + DBG_CTX((" imported: %d\n", ii->imported)); + DBG_CTX((" indirect: %d\n", ii->indirect)); + if(ii->fileDef) + { + DBG_CTX(("include: %s\n", ii->fileDef->absFilePath().data())); + } + DBG_CTX((" src_id : %d\n", src_id)); + DBG_CTX((" dst_id: %d\n", dst_id)); + bindIntParameter(incl_select,":local",ii->local); - bindIntParameter(incl_select,":id_src",id_src); - bindIntParameter(incl_select,":id_dst",id_dst); + bindIntParameter(incl_select,":src_id",src_id); + bindIntParameter(incl_select,":dst_id",dst_id); if (step(incl_select,TRUE,TRUE)==0) { bindIntParameter(incl_insert,":local",ii->local); - bindIntParameter(incl_insert,":id_src",id_src); - bindIntParameter(incl_insert,":id_dst",id_dst); + bindIntParameter(incl_insert,":src_id",src_id); + bindIntParameter(incl_insert,":dst_id",dst_id); step(incl_insert); } } @@ -1390,15 +2254,37 @@ static void generateSqlite3ForFile(const FileDef *fd) QListIterator ili(*fd->includedByFileList()); for (ili.toFirst();(ii=ili.current());++ili) { - int id_src=insertFile(ii->includeName); - int id_dst=insertFile(fd->absFilePath()); + int dst_id=insertPath(fd->absFilePath(),!fd->isReference()); + int src_id; + QCString src_path; + + if(ii->fileDef) // found file + { + if(ii->fileDef->isReference()) + { + // strip tagfile from path + QCString tagfile = ii->fileDef->getReference(); + src_path = ii->fileDef->absFilePath().copy(); + src_path.stripPrefix(tagfile+":"); + } + else + { + src_path = ii->fileDef->absFilePath(); + } + src_id = insertPath(src_path,ii->local); + } + else // can't find file + { + src_id = insertPath(ii->includeName,ii->local,FALSE); + } + bindIntParameter(incl_select,":local",ii->local); - bindIntParameter(incl_select,":id_src",id_src); - bindIntParameter(incl_select,":id_dst",id_dst); + bindIntParameter(incl_select,":src_id",src_id); + bindIntParameter(incl_select,":dst_id",dst_id); if (step(incl_select,TRUE,TRUE)==0) { bindIntParameter(incl_insert,":local",ii->local); - bindIntParameter(incl_insert,":id_src",id_src); - bindIntParameter(incl_insert,":id_dst",id_dst); + bindIntParameter(incl_insert,":src_id",src_id); + bindIntParameter(incl_insert,":dst_id",dst_id); step(incl_insert); } } @@ -1407,13 +2293,13 @@ static void generateSqlite3ForFile(const FileDef *fd) // + contained class definitions if (fd->getClassSDict()) { - writeInnerClasses(fd->getClassSDict()); + writeInnerClasses(fd->getClassSDict(),refid); } // + contained namespace definitions if (fd->getNamespaceSDict()) { - writeInnerNamespaces(fd->getNamespaceSDict()); + writeInnerNamespaces(fd->getNamespaceSDict(),refid); } // + member groups @@ -1423,7 +2309,7 @@ static void generateSqlite3ForFile(const FileDef *fd) MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - generateSqlite3Section(fd,mg->members(),"user-defined",mg->header(), + generateSqlite3Section(fd,mg->members(),refid,"user-defined",mg->header(), mg->documentation()); } } @@ -1435,24 +2321,201 @@ static void generateSqlite3ForFile(const FileDef *fd) { if ((ml->listType()&MemberListType_declarationLists)!=0) { - generateSqlite3Section(fd,ml,"user-defined");//g_xmlSectionMapper.find(ml->listType())); + generateSqlite3Section(fd,ml,refid,"user-defined"); } } } +// kind: group static void generateSqlite3ForGroup(const GroupDef *gd) { -#warning WorkInProgress + // + members + // + member groups + // + files + // + classes + // + namespaces + // - packages + // + pages + // + child groups + // - examples + // + brief description + // + detailed description + + if (gd->isReference()) return; // skip external references. + + struct Refid refid = insertRefid(gd->getOutputFileBase()); + if(!refid.created && compounddefExists(refid)){return;} + bindIntParameter(compounddef_insert,":rowid", refid.rowid); + + bindTextParameter(compounddef_insert,":name",gd->name()); + bindTextParameter(compounddef_insert,":title",gd->groupTitle(), FALSE); + bindTextParameter(compounddef_insert,":kind","group",FALSE); + + int file_id = insertPath(gd->getDefFileName()); + bindIntParameter(compounddef_insert,":file_id",file_id); + bindIntParameter(compounddef_insert,":line",gd->getDefLine()); + bindIntParameter(compounddef_insert,":column",gd->getDefColumn()); + + getSQLDesc(compounddef_insert,":briefdescription",gd->briefDescription(),gd); + getSQLDesc(compounddef_insert,":detaileddescription",gd->documentation(),gd); + + step(compounddef_insert); + + // + files + writeInnerFiles(gd->getFiles(),refid); + + // + classes + writeInnerClasses(gd->getClasses(),refid); + + // + namespaces + writeInnerNamespaces(gd->getNamespaces(),refid); + + // + pages + writeInnerPages(gd->getPages(),refid); + + // + groups + writeInnerGroups(gd->getSubGroups(),refid); + + // + member groups + if (gd->getMemberGroupSDict()) + { + MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict()); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + generateSqlite3Section(gd,mg->members(),refid,"user-defined",mg->header(), + mg->documentation()); + } + } + + // + members + QListIterator mli(gd->getMemberLists()); + MemberList *ml; + for (mli.toFirst();(ml=mli.current());++mli) + { + if ((ml->listType()&MemberListType_declarationLists)!=0) + { + generateSqlite3Section(gd,ml,refid,"user-defined"); + } + } } +// kind: dir static void generateSqlite3ForDir(const DirDef *dd) { -#warning WorkInProgress + // + dirs + // + files + // + briefdescription + // + detaileddescription + // + location (below uses file_id, line, column; XML just uses file) + if (dd->isReference()) return; // skip external references + + struct Refid refid = insertRefid(dd->getOutputFileBase()); + if(!refid.created && compounddefExists(refid)){return;} + bindIntParameter(compounddef_insert,":rowid", refid.rowid); + + bindTextParameter(compounddef_insert,":name",dd->displayName()); + bindTextParameter(compounddef_insert,":kind","dir",FALSE); + + int file_id = insertPath(dd->getDefFileName(),TRUE,TRUE,2); + bindIntParameter(compounddef_insert,":file_id",file_id); + + /* + line and column are weird here, but: + - dir goes into compounddef with all of the others + - the semantics would be fine if we set them to NULL here + - but defining line and column as NOT NULL is an important promise + for other compounds, so I don't want to loosen it + + For reference, the queries return 1. + 0 or -1 make more sense, but I see that as a change for DirDef. + */ + bindIntParameter(compounddef_insert,":line",dd->getDefLine()); + bindIntParameter(compounddef_insert,":column",dd->getDefColumn()); + + getSQLDesc(compounddef_insert,":briefdescription",dd->briefDescription(),dd); + getSQLDesc(compounddef_insert,":detaileddescription",dd->documentation(),dd); + + step(compounddef_insert); + + // + files + writeInnerDirs(&dd->subDirs(),refid); + + // + files + writeInnerFiles(dd->getFiles(),refid); } +// kinds: page, example static void generateSqlite3ForPage(const PageDef *pd,bool isExample) { -#warning WorkInProgress + // + name + // + title + // + brief description + // + documentation (detailed description) + // + inbody documentation + // + sub pages + if (pd->isReference()) return; // skip external references. + + // TODO: do we more special handling if isExample? + + QCString qrefid = pd->getOutputFileBase(); + if (pd->getGroupDef()) + { + qrefid+=(QCString)"_"+pd->name(); + } + if (qrefid=="index") qrefid="indexpage"; // to prevent overwriting the generated index page. + + struct Refid refid = insertRefid(qrefid); + + // can omit a page that already has a refid + if(!refid.created && compounddefExists(refid)){return;} + + bindIntParameter(compounddef_insert,":rowid",refid.rowid); + // + name + bindTextParameter(compounddef_insert,":name",pd->name()); + + QCString title; + if (pd==Doxygen::mainPage) // main page is special + { + if (!pd->title().isEmpty() && pd->title().lower()!="notitle") + { + title = filterTitle(convertCharEntitiesToUTF8(Doxygen::mainPage->title())); + } + else + { + title = Config_getString(PROJECT_NAME); + } + } + else + { + SectionInfo *si = Doxygen::sectionDict->find(pd->name()); + if (si) + { + title = si->title; + } + + if(!title){title = pd->title();} + } + + // + title + bindTextParameter(compounddef_insert,":title",title,FALSE); + + bindTextParameter(compounddef_insert,":kind", isExample ? "example" : "page"); + + int file_id = insertPath(pd->getDefFileName()); + + bindIntParameter(compounddef_insert,":file_id",file_id); + bindIntParameter(compounddef_insert,":line",pd->getDefLine()); + bindIntParameter(compounddef_insert,":column",pd->getDefColumn()); + + // + brief description + getSQLDesc(compounddef_insert,":briefdescription",pd->briefDescription(),pd); + // + documentation (detailed description) + getSQLDesc(compounddef_insert,":detaileddescription",pd->documentation(),pd); + + step(compounddef_insert); + // + sub pages + writeInnerPages(pd->getSubPages(),refid); } @@ -1463,6 +2526,7 @@ static sqlite3* openDbConnection() QDir sqlite3Dir(outputDirectory); sqlite3 *db; int rc; + struct stat buf; rc = sqlite3_initialize(); if (rc != SQLITE_OK) @@ -1470,7 +2534,21 @@ static sqlite3* openDbConnection() msg("sqlite3_initialize failed\n"); return NULL; } - rc = sqlite3_open_v2(outputDirectory+"/doxygen_sqlite3.db", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); + + + if (stat (outputDirectory+"/doxygen_sqlite3.db", &buf) == 0) + { + msg("doxygen_sqlite3.db already exists! aborting sqlite3 output generation!\n"); + msg("If you wish to re-generate the database, remove or archive the existing copy first.\n"); + return NULL; + } + + rc = sqlite3_open_v2( + outputDirectory+"/doxygen_sqlite3.db", + &db, + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, + 0 + ); if (rc != SQLITE_OK) { sqlite3_close(db); @@ -1497,10 +2575,16 @@ void generateSqlite3() { return; } + +# ifdef SQLITE3_DEBUG + // debug: show all executed statements + sqlite3_trace(db, &sqlLog, NULL); +# endif + beginTransaction(db); pragmaTuning(db); - if (-1==initializeSchema(db)) + if (-1==initializeTables(db)) return; if ( -1 == prepareStatements(db) ) @@ -1509,9 +2593,11 @@ void generateSqlite3() return; } + recordMetadata(); + // + classes ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd; + const ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { msg("Generating Sqlite3 output for class %s\n",cd->name().data()); @@ -1520,7 +2606,7 @@ void generateSqlite3() // + namespaces NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); - NamespaceDef *nd; + const NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { msg("Generating Sqlite3 output for namespace %s\n",nd->name().data()); @@ -1533,7 +2619,7 @@ void generateSqlite3() for (;(fn=fnli.current());++fnli) { FileNameIterator fni(*fn); - FileDef *fd; + const FileDef *fd; for (;(fd=fni.current());++fni) { msg("Generating Sqlite3 output for file %s\n",fd->name().data()); @@ -1543,7 +2629,7 @@ void generateSqlite3() // + groups GroupSDict::Iterator gli(*Doxygen::groupSDict); - GroupDef *gd; + const GroupDef *gd; for (;(gd=gli.current());++gli) { msg("Generating Sqlite3 output for group %s\n",gd->name().data()); @@ -1553,7 +2639,7 @@ void generateSqlite3() // + page { PageSDict::Iterator pdi(*Doxygen::pageSDict); - PageDef *pd=0; + const PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { msg("Generating Sqlite3 output for page %s\n",pd->name().data()); @@ -1563,7 +2649,7 @@ void generateSqlite3() // + dirs { - DirDef *dir; + const DirDef *dir; DirSDict::Iterator sdi(*Doxygen::directories); for (sdi.toFirst();(dir=sdi.current());++sdi) { @@ -1575,7 +2661,7 @@ void generateSqlite3() // + examples { PageSDict::Iterator pdi(*Doxygen::exampleSDict); - PageDef *pd=0; + const PageDef *pd=0; for (pdi.toFirst();(pd=pdi.current());++pdi) { msg("Generating Sqlite3 output for example %s\n",pd->name().data()); @@ -1590,6 +2676,11 @@ void generateSqlite3() generateSqlite3ForPage(Doxygen::mainPage,FALSE); } + // TODO: copied from initializeSchema; not certain if we should say/do more + // if there's a failure here? + if (-1==initializeViews(db)) + return; + endTransaction(db); } -- cgit v0.12 From 03fad37f3bd695d0a30333e8cecc3931c4f870ba Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 3 Sep 2018 18:33:00 +0200 Subject: Correct typing error in test 51 --- testing/051/indexpage.xml | 2 +- testing/051_escape.dox | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/051/indexpage.xml b/testing/051/indexpage.xml index 776f525..50a6ff8 100644 --- a/testing/051/indexpage.xml +++ b/testing/051/indexpage.xml @@ -6,7 +6,7 @@ - Dollar $ At @ Backslash \ Amphasand & Less < Greater > Hash # Percent % Quote " Dot . Double colon :: Pipe | Plus + Minus - + Dollar $ At @ Backslash \ Ampersand & Less < Greater > Hash # Percent % Quote " Dot . Double colon :: Pipe | Plus + Minus - diff --git a/testing/051_escape.dox b/testing/051_escape.dox index 290b298..2165564 100644 --- a/testing/051_escape.dox +++ b/testing/051_escape.dox @@ -5,7 +5,7 @@ Dollar \$ At \@ Backslash \\ -Amphasand \& +Ampersand \& Less \< Greater \> Hash \# -- cgit v0.12 From a705a7a3f3cd0689e0185d92c4f0542c83b9dcb6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 3 Sep 2018 19:40:17 +0200 Subject: Correct typing error in test 5 --- testing/005_attention.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/005_attention.dox b/testing/005_attention.dox index c3c390e..90f67f5 100644 --- a/testing/005_attention.dox +++ b/testing/005_attention.dox @@ -1,4 +1,4 @@ -// objective: test \attention, \not, \remark, \warning, and \par commands +// objective: test \attention, \note, \remark, \warning, and \par commands // check: indexpage.xml /** \mainpage * \attention Attention message. -- cgit v0.12 From 8c838d66fae65187692ec5fc04389d0811860a7f Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 5 Sep 2018 12:52:54 +0200 Subject: Remove double line with documented argument from addContentsItem in ftvhelp.cpp This is a problem of the internal doxygen generated documentation only. --- src/ftvhelp.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index cee39f2..8c46fd5 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -171,11 +171,10 @@ void FTVHelp::decContentsDepth() /*! Add a list item to the contents file. * \param isDir TRUE if the item is a directory, FALSE if it is a text - * \param name The name of the item. + * \param name the name of the item. * \param ref the URL of to the item. * \param file the file containing the definition of the item * \param anchor the anchor within the file. - * \param name the name of the item. * \param separateIndex put the entries in a separate index file * \param addToNavIndex add this entry to the quick navigation index * \param def Definition corresponding to this entry -- cgit v0.12 From 8176639e13357f74d317c631a5bf01a60bb543af Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 7 Sep 2018 11:06:33 +0200 Subject: Extending tests with extra possibilities - docbook for docbook output including small test on validity (i.e. basic xml test) - rtf for rtf output - start_id and end_id creating the possibility to run one range of tests -- subdirs us CREATE_SUBDIRS=YES --- testing/README.txt | 9 +++- testing/runtests.py | 117 ++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 111 insertions(+), 15 deletions(-) diff --git a/testing/README.txt b/testing/README.txt index fd7536d..e66632f 100644 --- a/testing/README.txt +++ b/testing/README.txt @@ -7,7 +7,7 @@ has the same 3 digit number. The directory contains one or more reference files that are compared against the XML output produced by doxygen. If the result is the same, there is no regression and the test passes. If there is a difference the test fails and the difference (in diff -u format) will be shown. -It is also possible to see whether or not the test can be built to an xhtml set +It is also possible to see whether or not the test can be built to a xhtml set of files (and tested against a DTD), it is also possible to create a pdf file for each test to see if the LaTeX / pdf generation is possible. @@ -17,6 +17,8 @@ optional parameters: --doxygen [DOXYGEN] path/name of the doxygen executable --xmllint [XMLLINT] path/name of the xmllint executable --id IDS [IDS ...] id of the test to perform + --start_id START_ID run tests starting with number n + --end_id END_ID run tests ending with number n --all perform all tests --inputdir [INPUTDIR] input directory containing the tests @@ -24,10 +26,13 @@ optional parameters: output directory to write the doxygen output to --noredir disable redirection of doxygen warnings --xml create xml output and check + --rtf create rtf output + --docbook create docbook output and check with xmllint --xhtml create xhtml output and check with xmllint --pdf create LaTeX output and create pdf from it + --subdirs use the configuration parameter CREATE_SUBDIRS=YES --keep keep result directories -In case neither --xml, --pdf or --xhtml is used the default is set to --xml. +In case neither --xml, --pdf, --rtf, --docbook or --xhtml is used the default is set to --xml. The runtest.pl has the following dependencies on 3rd party tools: - python to run the script diff --git a/testing/runtests.py b/testing/runtests.py index 9330d23..be8aae9 100644 --- a/testing/runtests.py +++ b/testing/runtests.py @@ -43,6 +43,28 @@ class Tester: rtnmsg += o return rtnmsg + def cleanup_xmllint_docbook(self,errmsg): + # For future work, first get everything valid XML + msg = self.cleanup_xmllint(errmsg).split('\n') + rtnmsg = "" + cnt = 0 + for o in msg: + if (o): + if (cnt): + cnt -= 1 + pass + elif (o.endswith("does not validate")): + pass + elif (o.find("no DTD found!")!=-1): + pass + elif (o.find("is not an NCName")!=-1): + cnt = 2 + else: + if (rtnmsg): + rtnmsg += '\n' + rtnmsg += o + return rtnmsg + def get_config(self): config = {} with open(self.args.inputdir+'/'+self.test,'r') as f: @@ -53,7 +75,7 @@ class Tester: value = m.group('value') if (key=='config'): value = value.replace('$INPUTDIR',self.args.inputdir) - #print('key=%s value=%s' % (key,value)) + # print('key=%s value=%s' % (key,value)) config.setdefault(key, []).append(value) return config @@ -74,6 +96,16 @@ class Tester: print('XML_OUTPUT=%s/out' % self.test_out, file=f) else: print('GENERATE_XML=NO', file=f) + if (self.args.rtf): + print('GENERATE_RTF=YES', file=f) + print('RTF_OUTPUT=%s/rtf' % self.test_out, file=f) + else: + print('GENERATE_RTF=NO', file=f) + if (self.args.docbook): + print('GENERATE_DOCBOOK=YES', file=f) + print('DOCBOOK_OUTPUT=%s/docbook' % self.test_out, file=f) + else: + print('GENERATE_DOCBOOK=NO', file=f) if (self.args.xhtml): print('GENERATE_HTML=YES', file=f) # HTML_OUTPUT can also be set locally @@ -82,6 +114,8 @@ class Tester: if (self.args.pdf): print('GENERATE_LATEX=YES', file=f) print('LATEX_OUTPUT=%s/latex' % self.test_out, file=f) + if self.args.subdirs: + print('CREATE_SUBDIRS=YES', file=f) if 'check' not in self.config or not self.config['check']: print('Test doesn\'t specify any files to check') @@ -97,7 +131,7 @@ class Tester: redir='' if os.system('%s %s/Doxyfile %s' % (self.args.doxygen,self.test_out,redir))!=0: - print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out)); + print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out)) sys.exit(1) # update the reference data for this test @@ -140,6 +174,8 @@ class Tester: failed_xml=False failed_html=False failed_latex=False + failed_docbook=False + failed_rtf=False msg = () # look for files to check against the reference if self.args.xml: @@ -149,8 +185,14 @@ class Tester: check_file='%s/out/%s' % (self.test_out,check) # check if the file we need to check is actually generated if not os.path.isfile(check_file): - msg += ('Non-existing file %s after \'check:\' statement' % check_file,) - break + # try with sub dirs + check_file = glob.glob('%s/out/*/*/%s' % (self.test_out,check)) + if not check_file: + check_file='%s/out/%s' % (self.test_out,check) + msg += ('Non-existing file %s after \'check:\' statement' % check_file,) + break + else: + check_file = check_file[0] # convert output to canonical form data = os.popen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read() if data: @@ -171,6 +213,34 @@ class Tester: xml_output='%s/out' % self.test_out shutil.rmtree(xml_output,ignore_errors=True) + if (self.args.rtf): + # no tests defined yet + pass + + if (self.args.docbook): + docbook_output='%s/docbook' % self.test_out + if (sys.platform == 'win32'): + redirx=' 2> %s/temp >nul:'%docbook_output + else: + redirx='2>%s/temp >/dev/null'%docbook_output + # For future work, first get everything valid XML + # exe_string = '%s --relaxng db/docbook.rng --nonet --postvalid %s/*xml %s % (self.args.xmllint,docbook_output,redirx) + tests = [] + tests.append(glob.glob('%s/*.xml' % (docbook_output))) + tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output))) + tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/') + exe_string = '%s --nonet --postvalid %s %s' % (self.args.xmllint,tests,redirx) + exe_string += ' %s more "%s/temp"' % (separ,docbook_output) + + failed_docbook=False + xmllint_out = os.popen(exe_string).read() + xmllint_out = self.cleanup_xmllint_docbook(xmllint_out) + if xmllint_out: + msg += (xmllint_out,) + failed_docbook=True + elif not self.args.keep: + shutil.rmtree(docbook_output,ignore_errors=True) + if (self.args.xhtml): html_output='%s/html' % self.test_out if (sys.platform == 'win32'): @@ -206,7 +276,7 @@ class Tester: elif not self.args.keep: shutil.rmtree(latex_output,ignore_errors=True) - if failed_xml or failed_html or failed_latex: + if failed_xml or failed_html or failed_latex or failed_docbook or failed_rtf: testmgr.ok(False,self.test_name,msg) return @@ -268,14 +338,18 @@ def main(): parser = argparse.ArgumentParser(description='run doxygen tests') parser.add_argument('--updateref',help= 'update the reference files. Should be used in combination with -id to ' - 'update the reference file(s) for the given test',action="store_true") + 'update the reference file(s) for the given test',action="store_true") parser.add_argument('--doxygen',nargs='?',default='doxygen',help= 'path/name of the doxygen executable') parser.add_argument('--xmllint',nargs='?',default='xmllint',help= 'path/name of the xmllint executable') parser.add_argument('--id',nargs='+',dest='ids',action='append',type=int,help= - 'run test with number n only (the option may be specified run test with ' - 'number n only (the option may be specified') + 'run test with number n only (the option can be specified to run test with ' + 'number n only (the option can be specified multiple times') + parser.add_argument('--start_id',dest='start_id',type=int,help= + 'run tests starting with number n') + parser.add_argument('--end_id',dest='end_id',type=int,help= + 'run tests ending with number n') parser.add_argument('--all',help= 'can be used in combination with -updateref to update the reference files ' 'for all tests.',action="store_true") @@ -287,17 +361,23 @@ def main(): 'disable redirection of doxygen warnings',action="store_true") parser.add_argument('--xml',help='create xml output and check', action="store_true") + parser.add_argument('--rtf',help= + 'create rtf output',action="store_true") + parser.add_argument('--docbook',help= + 'create docbook output and check with xmllint',action="store_true") parser.add_argument('--xhtml',help= 'create xhtml output and check with xmllint',action="store_true") parser.add_argument('--pdf',help='create LaTeX output and create pdf from it', action="store_true") + parser.add_argument('--subdirs',help='use the configuration parameter CREATE_SUBDIRS=YES', + action="store_true") parser.add_argument('--keep',help='keep result directories', action="store_true") test_flags = os.getenv('TEST_FLAGS', default='').split() args = parser.parse_args(test_flags + sys.argv[1:]) # sanity check - if (not args.xml) and (not args.pdf) and (not args.xhtml): + if (not args.xml) and (not args.pdf) and (not args.xhtml) and (not args.docbook and (not args.rtf)): args.xml=True if (not args.updateref is None) and (args.ids is None) and (args.all is None): parser.error('--updateref requires either --id or --all') @@ -305,15 +385,26 @@ def main(): starting_directory = os.getcwd() os.chdir(args.inputdir) # find the tests to run - if args.ids: # test ids are given by user - tests = [] + tests = [] + if args.start_id: + if args.end_id: + for id in range(args.start_id, args.end_id + 1): + tests.append(glob.glob('%s_*'%id)) + tests.append(glob.glob('0%s_*'%id)) + tests.append(glob.glob('00%s_*'%id)) + else: + parser.error('--start_id requires --end_id') + elif args.end_id: + parser.error('--end_id requires --start_id') + if args.ids: # test ids are given by user for id in list(itertools.chain.from_iterable(args.ids)): tests.append(glob.glob('%s_*'%id)) tests.append(glob.glob('0%s_*'%id)) tests.append(glob.glob('00%s_*'%id)) - tests = list(itertools.chain.from_iterable(tests)) - else: # find all tests + if (not args.ids and not args.start_id): # find all tests tests = glob.glob('[0-9][0-9][0-9]_*') + else: + tests = list(itertools.chain.from_iterable(tests)) os.chdir(starting_directory) # create test manager to run the tests -- cgit v0.12 From 7340b1c0e767b0ee88ce389df653d3d2a77801cd Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 7 Sep 2018 11:29:20 +0200 Subject: Implementation of standard generator for docbook output Till now docbook had its own output generator, but lot of possibilities were missing (see remark about updating below), with this patch the (more than) basic implementation has been made. Added some docbook tests to the current tests and updated documentation where necessary Tried updating current version but too many issues remained that were generically handled in the standard generator, code is in current version behind '#if 0' construct in doxygen.cpp and name with '_v1' and in docbookgen.cp' --- doc/commands.doc | 2 +- src/classdef.cpp | 11 +- src/commentscan.l | 4 + src/definition.cpp | 103 ++- src/docbookgen.cpp | 1900 ++++++++++++++++++++++++++++++++++++++------- src/docbookgen.h | 347 ++++++++- src/docbookvisitor.cpp | 531 +++++++++++-- src/docbookvisitor.h | 4 + src/docparser.h | 2 + src/dot.cpp | 57 +- src/doxygen.cpp | 38 +- src/filedef.cpp | 11 +- src/index.cpp | 31 +- src/marshal.cpp | 6 + src/memberdef.cpp | 12 + src/outputgen.h | 2 +- src/pagedef.cpp | 4 +- src/types.h | 10 +- src/util.cpp | 62 ++ src/util.h | 2 + testing/031/indexpage.xml | 1 + testing/031_image.dox | 1 + testing/043_page.dox | 2 +- 23 files changed, 2706 insertions(+), 437 deletions(-) diff --git a/doc/commands.doc b/doc/commands.doc index a630aac..beda764 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -2034,7 +2034,7 @@ Make sure you have first read \ref intro "the introduction". \addindex \\tableofcontents Creates a table of contents at the top of a page, listing all sections and subsections in the page. The `option` can be `HTML` or `LaTeX` - or `XML`. When a `level` is specified this means the maximum nesting level + or `XML` or `DocBook`. When a `level` is specified this means the maximum nesting level that is shown. The value of `level` should be in the range 1..5, values outside this range are considered to be 5. In case no `level` is specified `level` is set to 5 (show all) diff --git a/src/classdef.cpp b/src/classdef.cpp index 52aa96b..787cd5e 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1110,7 +1110,15 @@ void ClassDef::showUsedFiles(OutputList &ol) ol.writeRuler(); - ol.parseText(generatedFromFiles()); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Docbook); + ol.startParagraph(); + ol.parseText(generatedFromFiles()); + ol.endParagraph(); + ol.popGeneratorState(); + ol.disable(OutputGenerator::Docbook); + ol.parseText(generatedFromFiles()); + ol.enable(OutputGenerator::Docbook); bool first=TRUE; QListIterator li(m_impl->files); @@ -1839,6 +1847,7 @@ void ClassDef::writeMoreLink(OutputList &ol,const QCString &anchor) // LaTeX + RTF ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Docbook); if (!(usePDFLatex && pdfHyperlinks)) { ol.disable(OutputGenerator::Latex); diff --git a/src/commentscan.l b/src/commentscan.l index 159f256..ac83729 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -2949,6 +2949,10 @@ static bool handleToc(const QCString &, const QCStringList &optList) { current->localToc.enableXml(level); } + else if (opt == "docbook") + { + current->localToc.enableDocbook(level); + } else { warn(yyFileName,yyLineNr,"Unknown option specified with \\tableofcontents: `%s'", (*it).stripWhiteSpace().data()); diff --git a/src/definition.cpp b/src/definition.cpp index cbfad94..ba0607b 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -921,6 +921,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE); static bool rtfSourceCode = Config_getBool(RTF_SOURCE_CODE); + static bool docbookSourceCode = Config_getBool(DOCBOOK_PROGRAMLISTING); ol.pushGeneratorState(); //printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef); QCString fn = getSourceFileBase(); @@ -945,11 +946,15 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.disable(OutputGenerator::Latex); } + if (!docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (!rtfSourceCode) { ol.disable(OutputGenerator::RTF); } - // write line link (HTML, LaTeX optionally, RTF optionally) + // write line link (HTML and optionally LaTeX, Docbook, RTF) ol.writeObjectLink(0,fn,anchorStr,lineStr); ol.enableAll(); ol.disable(OutputGenerator::Html); @@ -957,6 +962,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.disable(OutputGenerator::Latex); } + if (docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -975,6 +984,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.disable(OutputGenerator::Latex); } + if (!docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (!rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -987,6 +1000,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.disable(OutputGenerator::Latex); } + if (docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1009,6 +1026,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.disable(OutputGenerator::Latex); } + if (!docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (!rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1021,6 +1042,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.disable(OutputGenerator::Latex); } + if (docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1040,6 +1065,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.enable(OutputGenerator::Latex); } + if (docbookSourceCode) + { + ol.enable(OutputGenerator::Docbook); + } if (rtfSourceCode) { ol.enable(OutputGenerator::RTF); @@ -1052,6 +1081,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *) { ol.disable(OutputGenerator::Latex); } + if (docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1145,6 +1178,7 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, const QCString &text,MemberSDict *members,bool /*funcOnly*/) { static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE); + static bool docbookSourceCode = Config_getBool(DOCBOOK_PROGRAMLISTING); static bool rtfSourceCode = Config_getBool(RTF_SOURCE_CODE); static bool sourceBrowser = Config_getBool(SOURCE_BROWSER); static bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE); @@ -1203,6 +1237,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, { ol.disable(OutputGenerator::Latex); } + if (!docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (!rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1221,6 +1259,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, { ol.disable(OutputGenerator::Latex); } + if (docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1238,6 +1280,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, { ol.disable(OutputGenerator::Latex); } + if (!docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (!rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1255,6 +1301,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, { ol.disable(OutputGenerator::Latex); } + if (docbookSourceCode) + { + ol.disable(OutputGenerator::Docbook); + } if (rtfSourceCode) { ol.disable(OutputGenerator::RTF); @@ -1633,7 +1683,7 @@ void Definition::writeToc(OutputList &ol, const LocalToc &localToc) int level=1,l; char cs[2]; cs[1]='\0'; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE }; + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; for (li.toFirst();(si=li.current());++li) { if (si->type==SectionInfo::Section || @@ -1681,6 +1731,55 @@ void Definition::writeToc(OutputList &ol, const LocalToc &localToc) ol.popGeneratorState(); } + if (localToc.isDocbookEnabled()) + { + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Docbook); + ol.writeString(" \n"); + ol.writeString(" " + theTranslator->trRTFTableOfContents() + "\n"); + SectionDict *sectionDict = getSectionDict(); + SDict::Iterator li(*sectionDict); + SectionInfo *si; + int level=1,l; + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; + int maxLevel = localToc.docbookLevel(); + for (li.toFirst();(si=li.current());++li) + { + if (si->type==SectionInfo::Section || + si->type==SectionInfo::Subsection || + si->type==SectionInfo::Subsubsection || + si->type==SectionInfo::Paragraph) + { + //printf(" level=%d title=%s\n",level,si->title.data()); + int nextLevel = (int)si->type; + if (nextLevel>level) + { + for (l=level;l\n"); + } + } + else if (nextLevelnextLevel;l--) + { + inLi[l]=FALSE; + if (l <= maxLevel) ol.writeString(" \n"); + } + } + if (nextLevel <= maxLevel) + { + QCString titleDoc = convertToDocBook(si->title); + ol.writeString(" " + (si->title.isEmpty()?si->label:titleDoc) + "\n"); + } + inLi[nextLevel]=TRUE; + level = nextLevel; + } + } + ol.writeString(" \n"); + ol.popGeneratorState(); + } + if (localToc.isLatexEnabled()) { ol.pushGeneratorState(); diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index 345629e..3793946 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * -* +* * * Copyright (C) 1997-2015 by Dimitri van Heesch. * @@ -21,11 +21,14 @@ #include #include #include +#include #include "docbookgen.h" #include "doxygen.h" #include "message.h" #include "config.h" #include "classlist.h" +#include "classdef.h" +#include "diagram.h" #include "util.h" #include "defargs.h" #include "outputgen.h" @@ -54,6 +57,17 @@ // debug inside output //#define Docbook_DB(x) QCString __t;__t.sprintf x;m_t << __t +#if 0 +#define DB_GEN_C DB_GEN_C1(t) +#define DB_GEN_C1(x) x << "\n"; +#define DB_GEN_C2(y) DB_GEN_C2a(t,y) +#define DB_GEN_C2a(x,y) x << "\n"; +#else +#define DB_GEN_C +#define DB_GEN_C1(x) +#define DB_GEN_C2(y) +#define DB_GEN_C2a(x,y) +#endif //------------------ class DocbookSectionMapper : public QIntDict @@ -104,7 +118,7 @@ static DocbookSectionMapper g_docbookSectionMapper; inline void writeDocbookString(FTextStream &t,const char *s) { - t << convertToXML(s); + t << convertToDocBook(s); } inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col) @@ -128,27 +142,44 @@ inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col) case '&': t << "&"; col++; break; case '\'': t << "'"; col++; break; case '"': t << """; col++; break; + case '\007': t << "^G"; col++; break; // bell + case '\014': t << "^L"; col++; break; // form feed default: t << c; col++; break; } } } -static void writeDocbookHeaderMainpage(FTextStream &t) +static void writeDocbookHeaderMainpage(FTextStream &t, QCString &pageName) { t << "" << endl;; - t << "" << endl; + t << "" << endl; } static void writeDocbookHeader_ID(FTextStream &t, QCString id) { t << "" << endl;; - t << "
    " << endl; + t << "
    " << endl; } +static void addIndexTerm(FTextStream &t, QCString prim, QCString sec = "") +{ + t << ""; + t << convertToDocBook(prim); + t << ""; + if (!sec.isEmpty()) + { + t << ""; + t << convertToDocBook(sec); + t << ""; + } + t << "" << endl; +} void writeDocbookLink(FTextStream &t,const char * /*extRef*/,const char *compoundId, const char *anchorId,const char * text,const char * /*tooltip*/) { - t << ""; @@ -175,110 +206,127 @@ class TextGeneratorDocbookImpl : public TextGeneratorIntf FTextStream &m_t; }; -class DocbookCodeGenerator : public CodeOutputInterface +DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t) : m_lineNumber(-1), m_col(0), + m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE) { - public: - DocbookCodeGenerator(FTextStream &t) : m_t(t), m_lineNumber(-1), m_col(0), - m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE) {} - virtual ~DocbookCodeGenerator() {} + m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING); + setTextStream(t); +} - void codify(const char *text) - { - Docbook_DB(("(codify \"%s\")\n",text)); - writeDocbookCodeString(m_t,text,m_col); - } - void writeCodeLink(const char *ref,const char *file, - const char *anchor,const char *name, - const char *tooltip) - { - Docbook_DB(("(writeCodeLink)\n")); - writeDocbookLink(m_t,ref,file,anchor,name,tooltip); - m_col+=strlen(name); - } - void writeTooltip(const char *, const DocLinkInfo &, const char *, - const char *, const SourceLinkInfo &, const SourceLinkInfo & - ) - { - Docbook_DB(("(writeToolTip)\n")); - } - void startCodeLine(bool) - { - Docbook_DB(("(startCodeLine)\n")); - if (m_lineNumber!=-1) - { - if (!m_refId.isEmpty()) - { - m_t << ""; - } - m_t << m_lineNumber << " "; - if (!m_refId.isEmpty()) - { - m_t << ""; - } - } - m_insideCodeLine=TRUE; - m_col=0; - } - void endCodeLine() - { - m_t << endl; - Docbook_DB(("(endCodeLine)\n")); - m_lineNumber = -1; - m_refId.resize(0); - m_external.resize(0); - m_insideCodeLine=FALSE; - } - void startFontClass(const char *colorClass) - { - Docbook_DB(("(startFontClass)\n")); - m_t << ""; - m_insideSpecialHL=TRUE; - } - void endFontClass() - { - Docbook_DB(("(endFontClass)\n")); - m_t << ""; // non DocBook - m_insideSpecialHL=FALSE; - } - void writeCodeAnchor(const char *) - { - Docbook_DB(("(writeCodeAnchor)\n")); - } - void writeLineNumber(const char *extRef,const char *compId, - const char *anchorId,int l) - { - Docbook_DB(("(writeLineNumber)\n")); - // we remember the information provided here to use it - // at the start tag. - m_lineNumber = l; - if (compId) - { - m_refId=compId; - if (anchorId) m_refId+=(QCString)"_1"+anchorId; - if (extRef) m_external=extRef; - } - } - void setCurrentDoc(Definition *,const char *,bool) - { - } - void addWord(const char *,bool) +DocbookCodeGenerator::DocbookCodeGenerator() : m_lineNumber(-1), m_col(0), + m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE), m_streamSet(FALSE) +{ + m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING); +} + +DocbookCodeGenerator::~DocbookCodeGenerator() {} + +void DocbookCodeGenerator::codify(const char *text) +{ + Docbook_DB(("(codify \"%s\")\n",text)); + writeDocbookCodeString(m_t,text,m_col); +} +void DocbookCodeGenerator::writeCodeLink(const char *ref,const char *file, + const char *anchor,const char *name, + const char *tooltip) +{ + Docbook_DB(("(writeCodeLink)\n")); + writeDocbookLink(m_t,ref,file,anchor,name,tooltip); + m_col+=strlen(name); +} +void DocbookCodeGenerator::writeCodeLinkLine(const char *ref,const char *file, + const char *anchor,const char *name, + const char *tooltip) +{ + Docbook_DB(("(writeCodeLinkLine)\n")); + m_t << ""; + m_col+=strlen(name); +} +void DocbookCodeGenerator::writeTooltip(const char *, const DocLinkInfo &, const char *, + const char *, const SourceLinkInfo &, const SourceLinkInfo & + ) +{ + Docbook_DB(("(writeToolTip)\n")); +} +void DocbookCodeGenerator::startCodeLine(bool) +{ + Docbook_DB(("(startCodeLine)\n")); + m_insideCodeLine=TRUE; + m_col=0; +} +void DocbookCodeGenerator::endCodeLine() +{ + m_t << endl; + Docbook_DB(("(endCodeLine)\n")); + m_lineNumber = -1; + m_refId.resize(0); + m_external.resize(0); + m_insideCodeLine=FALSE; +} +void DocbookCodeGenerator::startFontClass(const char *colorClass) +{ + Docbook_DB(("(startFontClass)\n")); + m_t << ""; + m_insideSpecialHL=TRUE; +} +void DocbookCodeGenerator::endFontClass() +{ + Docbook_DB(("(endFontClass)\n")); + m_t << ""; // non DocBook + m_insideSpecialHL=FALSE; +} +void DocbookCodeGenerator::writeCodeAnchor(const char *) +{ + Docbook_DB(("(writeCodeAnchor)\n")); +} +void DocbookCodeGenerator::writeLineNumber(const char *ref,const char *fileName, + const char *anchor,int l) +{ + Docbook_DB(("(writeLineNumber)\n")); + m_insideCodeLine = TRUE; + if (m_prettyCode) + { + QCString lineNumber; + lineNumber.sprintf("%05d",l); + + if (fileName && !m_sourceFileName.isEmpty()) { + writeCodeLinkLine(ref,m_sourceFileName,anchor,lineNumber,0); + writeCodeLink(ref,fileName,anchor,lineNumber,0); } - void finish() + else { - if (m_insideCodeLine) endCodeLine(); + codify(lineNumber); } + m_t << " "; + } + else + { + m_t << l << " "; + } - private: - FTextStream &m_t; - QCString m_refId; - QCString m_external; - int m_lineNumber; - int m_col; - bool m_insideCodeLine; - bool m_insideSpecialHL; -}; - +} +void DocbookCodeGenerator::setCurrentDoc(Definition *,const char *,bool) +{ +} +void DocbookCodeGenerator::addWord(const char *,bool) +{ +} +void DocbookCodeGenerator::finish() +{ + if (m_insideCodeLine) endCodeLine(); +} +void DocbookCodeGenerator::startCodeFragment() +{ + m_t << "" << endl; +} +void DocbookCodeGenerator::endCodeFragment() +{ + m_t << "" << endl; +} static void writeTemplateArgumentList(ArgumentList *al, FTextStream &t, @@ -389,10 +437,205 @@ static QCString memberOutputFileBase(MemberDef *md) return md->getOutputFileBase(); } +static void generateTOC(FTextStream &t, PageDef *pd) +{ + if (pd->localToc().isDocbookEnabled()) + { + t << " " << endl; + t << " " << theTranslator->trRTFTableOfContents() << "" << endl; + SectionDict *sectionDict = pd->getSectionDict(); + SDict::Iterator li(*sectionDict); + SectionInfo *si; + int level=1,l; + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; + int maxLevel = pd->localToc().docbookLevel(); + for (li.toFirst();(si=li.current());++li) + { + if (si->type==SectionInfo::Section || + si->type==SectionInfo::Subsection || + si->type==SectionInfo::Subsubsection || + si->type==SectionInfo::Paragraph) + { + //printf(" level=%d title=%s\n",level,si->title.data()); + int nextLevel = (int)si->type; + if (nextLevel>level) + { + for (l=level;l" << endl; + } + } + else if (nextLevelnextLevel;l--) + { + inLi[l]=FALSE; + if (l <= maxLevel) t << " " << endl; + } + } + if (nextLevel <= maxLevel) + { + QCString titleDoc = convertToDocBook(si->title); + t << " " << (si->title.isEmpty()?si->label:titleDoc) << "" << endl; + } + inLi[nextLevel]=TRUE; + level = nextLevel; + } + } + t << " " << endl; + } +} + +static void generateSourceRefList(FTextStream &t,const char *scopeName, const QCString &text,MemberSDict *members, Definition *def) +{ + static bool sourceBrowser = Config_getBool(SOURCE_BROWSER); + static bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE); -static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *def, bool detailed=0) + if (members) + { + members->sort(); + + t << "" << convertToDocBook(text) << ""; + + QCString ldefLine=theTranslator->trWriteList(members->count()); + + QRegExp marker("@[0-9]+"); + int index=0,newIndex,matchLen; + // now replace all markers in inheritLine with links to the classes + while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1) + { + bool ok; + t << convertToDocBook(ldefLine.mid(index,newIndex-index)); + uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok); + MemberDef *md=members->at(entryIndex); + if (ok && md) + { + QCString scope=md->getScopeString(); + QCString name=md->name(); + //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName); + if (!scope.isEmpty() && scope!=scopeName) + { + name.prepend(scope+getLanguageSpecificSeparator(def->getLanguage())); + } + if (!md->isObjCMethod() && + (md->isFunction() || md->isSlot() || + md->isPrototype() || md->isSignal() + ) + ) + { + name+="()"; + } + //Definition *d = md->getOutputFileBase(); + //if (d==Doxygen::globalScope) d=md->getBodyDef(); + if (sourceBrowser && + !(md->isLinkable() && !refLinkSource) && + md->getStartBodyLine()!=-1 && + md->getBodyDef() + ) + { + //printf("md->getBodyDef()=%p global=%p\n",md->getBodyDef(),Doxygen::globalScope); + + const int maxLineNrStr = 10; + char anchorStr[maxLineNrStr]; + qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine()); + //printf("Write object link to %s\n",md->getBodyDef()->getSourceFileBase().data()); + t << convertToDocBook(name); + // or + // ol.writeObjectLink(0,md->getBodyDef()->getSourceFileBase(),anchorStr,name); + } + else if (md->isLinkable() /*&& d && d->isLinkable()*/) + { + t << convertToDocBook(name); + // or + // ol.writeObjectLink(md->getReference(), md->getOutputFileBase(), md->anchor(),name); + } + else + { + t << convertToDocBook(name); + } + } + index=newIndex+matchLen; + } + t << ldefLine.right(ldefLine.length()-index); + t<< "."; + t << ""; + } +} +static void generateInlineCode(FTextStream &t,const char *scopeName, Definition *def) { + static bool inlineSources = Config_getBool(INLINE_SOURCES); + //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(), + // m_startBodyLine,m_endBodyLine,m_bodyDef); + if (inlineSources && def->hasSources()) + { + QCString codeFragment; + int actualStart=def->getStartBodyLine(),actualEnd=def->getEndBodyLine(); + if (readCodeFragment(def->getBodyDef()->absFilePath(), + actualStart,actualEnd,codeFragment) + ) + { + //printf("Adding code fragment '%s' ext='%s'\n", + // codeFragment.data(),m_impl->defFileExt.data()); + ParserInterface *pIntf = Doxygen::parserManager->getParser(def->getDefFileExtension()); + pIntf->resetCodeParserState(); + //printf("Read:\n`%s'\n\n",codeFragment.data()); + MemberDef *thisMd = 0; + if (def->definitionType()==Definition::TypeMember) thisMd = (MemberDef *)def; + + DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t); + docbookGen->startCodeFragment(); + pIntf->parseCode(*docbookGen, // codeOutIntf + scopeName, // scope + codeFragment, // input + def->getLanguage(), // lang + FALSE, // isExample + 0, // exampleName + def->getBodyDef(), // fileDef + actualStart, // startLine + actualEnd, // endLine + TRUE, // inlineFragment + thisMd, // memberDef + TRUE // show line numbers + ); + docbookGen->finish(); + docbookGen->endCodeFragment(); + delete docbookGen; + } + } +} + +static void definedAtLine(int line, QCString fileName, FTextStream &t) +{ + QCString refText = theTranslator->trDefinedAtLineInSourceFile(); + int lineMarkerPos = refText.find("@0"); + int fileMarkerPos = refText.find("@1"); + if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this. + { + if (lineMarkerPosgetNamespaceDef()->name(); } - if (detailed==0) + if (detailed==0) { t << " " << endl; t << " " << endl; t << " " << endl; //enum bool closePara=TRUE; - if (md->memberType()==MemberType_Enumeration) + if (md->memberType()==MemberType_Enumeration) { + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; MemberList *enumFields = md->enumFieldList(); - t << " " << memType << " " << memType << " getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -460,23 +704,23 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de { t << memberOutputFileBase(md); } - t << "_1" << md->anchor() << "\">" << convertToXML(md->name()) << ""; - if (enumFields!=0) + t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; + if (enumFields!=0) { MemberListIterator emli(*enumFields); MemberDef *emd; t << " {" << endl; int cnt=0; - for (emli.toFirst();(emd=emli.current());++emli) + for (emli.toFirst();(emd=emli.current());++emli) { - if (cnt!=0) + if (cnt!=0) { t << "," << endl; } - t << "anchor() << "\">"; + t << "anchor() << "\">"; writeDocbookString(t,emd->name()); t << ""; - if (!emd->initializer().isEmpty()) + if (!emd->initializer().isEmpty()) { writeDocbookString(t,emd->initializer()); } @@ -492,9 +736,9 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << "" << endl; } } - else if (md->memberType()==MemberType_Define) + else if (md->memberType()==MemberType_Define) { - t << " " << "#" << memType << " " << "#" << memType << " getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -503,36 +747,36 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de { t << memberOutputFileBase(md); } - t << "_1" << md->anchor() << "\">" << convertToXML(md->name()) << ""; - if (!md->initializer().isEmpty() && md->initializer().length()<2000) + t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; + if (!md->initializer().isEmpty() && md->initializer().length()<2000) { t << " "; linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->initializer()); } - if (md->briefDescription()) + if (md->briefDescription()) { t << ""; writeDocbookString(t,md->briefDescription()); t << "" << endl; } } - else if (md->memberType()==MemberType_Variable) + else if (md->memberType()==MemberType_Variable) { - if (md->getClassDef()) + if (md->getClassDef()) { - t << " " << convertToXML(md->declaration()); - if (md->briefDescription()) + t << " " << convertToDocBook(md->declaration()); + if (md->briefDescription()) { t << ""; writeDocbookString(t,md->briefDescription()); t << ""; } - } - else + } + else { t << " "; linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -541,7 +785,7 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de { t << memberOutputFileBase(md); } - t << "_1" << md->anchor() << "\">" << convertToXML(md->name()) << ""; + t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; if (md->briefDescription()) { t << ""; @@ -550,13 +794,13 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de } } } - else if (md->memberType()==MemberType_Typedef) + else if (md->memberType()==MemberType_Typedef) { t << " " << memType; t << " "; linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); t << " "; - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -565,7 +809,7 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de { t << memberOutputFileBase(md); } - t << "_1" << md->anchor() << "\">" << convertToXML(md->name()) << ""; + t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; if (md->briefDescription()) { t << ""; @@ -573,11 +817,11 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << "" << endl; } } - else if (md->memberType()==MemberType_Function) + else if (md->memberType()==MemberType_Function) { t << " "; linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -586,7 +830,7 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de { t << memberOutputFileBase(md); } - t << "_1" << md->anchor() << "\">" << convertToXML(md->name()) << ""; + t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; t << " (" << endl; ArgumentList *declAl = md->declArgumentList(); if (declAl && declAl->count()>0) @@ -596,7 +840,7 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de int cnt=0; for (declAli.toFirst();(a=declAli.current());++declAli) { - if (cnt!=0) + if (cnt!=0) { t << ", "; } @@ -634,7 +878,7 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de if (md->memberType()==MemberType_Enumeration) { MemberList *enumFields = md->enumFieldList(); - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -644,20 +888,20 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << memberOutputFileBase(md); } t << "_1" << md->anchor() << "\">" << endl; - t << " " << memType << " " << convertToXML(md->name()) << " " << "" << endl; + t << " " << memType << " " << convertToDocBook(md->name()) << " " << "" << endl; t << " "; writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); t << endl; - if (enumFields!=0) + if (enumFields!=0) { MemberListIterator emli(*enumFields); MemberDef *emd; t << " " << endl; t << " " << theTranslator->trEnumerationValues() << ":" << endl; t << " " << endl; - for (emli.toFirst();(emd=emli.current());++emli) + for (emli.toFirst();(emd=emli.current());++emli) { - t << " anchor() << "\">" << endl; t << " "; writeDocbookString(t,emd->name()); @@ -675,27 +919,30 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << " " << endl; t << " " << endl; t << " "; - t << "Definition at line " << md->getDefLine() << " of file " << stripPath(md->getDefFileName()) << endl; - t << " " << endl; + t << " "; + definedAtLine(md->getDefLine(),stripPath(md->getDefFileName()),t); + t << "" << endl; + + t << " " << endl; t << "{" << endl; - for (emli.toFirst();(emd=emli.current());++emli) + for (emli.toFirst();(emd=emli.current());++emli) { writeDocbookString(t,emd->name()); - if (!emd->initializer().isEmpty()) + if (!emd->initializer().isEmpty()) { writeDocbookString(t,emd->initializer()); } t << ", " << endl; } - t << "}" << convertToXML(md->name()) << ";" << endl; - t << " " << endl; + t << "}" << convertToDocBook(md->name()) << ";" << endl; + t << " " << endl; t << " " << endl; - t << "
    " << endl; } + t << "
    " << endl; } - else if (md->memberType()==MemberType_Typedef) + else if (md->memberType()==MemberType_Typedef) { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -705,7 +952,7 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << memberOutputFileBase(md); } t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToXML(md->definition()) << ""; + t << " " << convertToDocBook(md->definition()) << ""; if(Config_getBool(REPEAT_BRIEF)) { t << " "; @@ -717,9 +964,9 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << endl; t << "
    " << endl; } - else if (md->memberType()==MemberType_Function) + else if (md->memberType()==MemberType_Function) { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -729,23 +976,38 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << memberOutputFileBase(md); } t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToXML(md->definition()) << " " << convertToXML(md->argsString()) << ""; + t << " " << convertToDocBook(md->definition()) << " " << convertToDocBook(md->argsString()) << ""; + addIndexTerm(t,md->name(),def->name()); + addIndexTerm(t,def->name(),md->name()); if(Config_getBool(REPEAT_BRIEF)) { + if (!md->briefDescription().isEmpty()) + { t << " "; writeDocbookString(t,md->briefDescription()); t << "" << endl; + } } t << " "; writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); t << endl; + + if (Config_getBool(REFERENCED_BY_RELATION)) + { + generateSourceRefList(t,md->name(),theTranslator->trReferencedBy(),md->getReferencedByMembers(),md); + } + if (Config_getBool(REFERENCES_RELATION)) + { + generateSourceRefList(t,md->name(),theTranslator->trReferences(),md->getReferencesMembers(),md); + } + generateInlineCode(t,md->name(),md); t << "
    " << endl; } - else if (md->memberType()==MemberType_Define) + else if (md->memberType()==MemberType_Define) { - if (md->documentation()) + if (md->documentation()) { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -755,36 +1017,41 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << memberOutputFileBase(md); } t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToXML(md->definition()) << ""; + t << " " << convertToDocBook(md->definition()) << ""; t << " "; writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); t << endl; - t << " Definition at line " << md->getDefLine() << " of file " << stripPath(md->getDefFileName()) << "" << endl; - t << " The Documentation for this define was generated from the following file: " << endl; - t << " " << stripPath(md->getDefFileName()) << "" << endl; t << "
    " << endl; } } - else if (md->memberType()==MemberType_Variable) + else if (md->memberType()==MemberType_Variable) { - if (md->getClassDef()) + if (md->getClassDef()) { - if (md->documentation()) + if (md->documentation()) { - t << " " << endl; - t << " " << convertToXML(md->definition()) << ""; + t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) + { + t << md->getGroupDef()->getOutputFileBase(); + } + else + { + t << memberOutputFileBase(md); + } + t << "_1" << md->anchor() << "\">" << endl; + t << " " << convertToDocBook(md->definition()) << ""; + addIndexTerm(t,md->name(),def->name()); + addIndexTerm(t,def->name(),md->name()); t << " "; writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); t << endl; - t << " Definition at line " << md->getDefLine() << " of file " << stripPath(md->getDefFileName()) << "" << endl; - t << " The Documentation for this struct was generated from the following file: " << endl; - t << " " << stripPath(md->getDefFileName()) << "" << endl; - t << " " << endl; + t << "
    " << endl; } } - else + else { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) { t << md->getGroupDef()->getOutputFileBase(); @@ -794,7 +1061,9 @@ static void generateDocbookForMember(MemberDef *md,FTextStream &t,Definition *de t << memberOutputFileBase(md); } t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToXML(md->definition()) << ""; + t << " " << convertToDocBook(md->definition()) << ""; + addIndexTerm(t,md->name(),def->name()); + addIndexTerm(t,def->name(),md->name()); if(Config_getBool(REPEAT_BRIEF)) { t << " "; @@ -818,23 +1087,33 @@ static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,c MemberDef *md; int count=0; int doc_count=0; - QCString title, desctitle; + QCString title, desctitle, subtitle; - for (mli.toFirst();(md=mli.current());++mli) + for (mli.toFirst();(md=mli.current());++mli) { // namespace members are also inserted in the file scope, but // to prevent this duplication in the Docbook output, we filter those here. - if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) + if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) { count++; } } - + if (count==0) return; // empty list + subtitle = ""; switch (ml->listType()) { - case MemberListType_decDefineMembers: title=theTranslator->trDefines(); desctitle=theTranslator->trDefineDocumentation(); break; + case MemberListType_pubMethods: d->getLanguage()==SrcLangExt_ObjC ? title = theTranslator->trInstanceMethods() : title = theTranslator->trPublicMembers(); + switch (d->getLanguage()) + { + case SrcLangExt_ObjC: desctitle = theTranslator->trMethodDocumentation(); break; + case SrcLangExt_Fortran: desctitle = theTranslator->trMemberFunctionDocumentationFortran(); break; + default: desctitle = theTranslator->trMemberFunctionDocumentation(); break; + }; + break; + case MemberListType_priMethods: title=theTranslator->trPrivateMembers(); desctitle=""; break; + case MemberListType_decTypedefMembers: title=theTranslator->trTypedefs(); desctitle=theTranslator->trTypedefDocumentation(); break; case MemberListType_decEnumMembers: title=theTranslator->trEnumerations(); desctitle=theTranslator->trEnumerationTypeDocumentation(); break; case MemberListType_decFuncMembers: title=theTranslator->trFunctions(); desctitle=theTranslator->trFunctionDocumentation(); break; @@ -842,10 +1121,13 @@ static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,c case MemberListType_pubAttribs: title=theTranslator->trPublicAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; case MemberListType_priAttribs: title=theTranslator->trPrivateAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; case MemberListType_proAttribs: title=theTranslator->trProtectedAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; - default: title=""; desctitle=""; break; + case MemberListType_decDefineMembers: title=theTranslator->trDefines(); desctitle=theTranslator->trDefineDocumentation(); break; + case MemberListType_related: title=theTranslator->trRelatedFunctions(); desctitle=theTranslator->trRelatedFunctionDocumentation(); + subtitle=theTranslator->trRelatedSubscript(); break; + default: title=""; desctitle=""; } - if (detailed) + if (detailed) { for (mli.toFirst();(md=mli.current());++mli) { @@ -857,40 +1139,45 @@ static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,c break; } - if(doc_count == 0) + if(doc_count == 0) return; + + if (!QCString(header).isEmpty()) { - return; + t << "
    " << endl; + t << " " << convertToDocBook(header) << "" << endl; } - - if (desctitle) + else if (desctitle) { - t << "
    " << endl; - t << " " << desctitle << "" << endl; + t << "
    " << endl; + t << " " << desctitle << "" << endl; } - } else + } + else { t << "
    " << endl; - if (header) + if (!QCString(header).isEmpty()) { - t << " " << convertToXML(header) << "" << endl; - } - else + t << " " << convertToDocBook(header) << "" << endl; + } + else { t << " " << title << "" << endl; } + if (!subtitle.isEmpty()) + t << " " << subtitle << "" << endl; } - if (documentation) + if (documentation) { t << " "; writeDocbookDocBlock(t,d->docFile(),d->docLine(),d,0,documentation); t << "" << endl; } - for (mli.toFirst();(md=mli.current());++mli) + for (mli.toFirst();(md=mli.current());++mli) { // namespace members are also inserted in the file scope, but // to prevent this duplication in the Docbook output, we filter those here. - if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) + if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) { if (detailed && md->documentation().isEmpty() && !Config_getBool(REPEAT_BRIEF)) { @@ -900,14 +1187,18 @@ static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,c generateDocbookForMember(md,t,d,detailed); } } - if (detailed) + if (detailed) { - if (desctitle) + if (!QCString(header).isEmpty()) + { + t << "
    " << endl; + } + else if (desctitle) { - t << "
    " << endl; + t << "
    " << endl; } - } - else + } + else { t << "
    " << endl; } @@ -921,19 +1212,19 @@ static void writeInnerClasses(const ClassSDict *cl,FTextStream &t) ClassDef *cd; QCString title = theTranslator->trClasses(); - if (cli.toFirst()) + if (cli.toFirst()) { t << "
    " << endl; t << " " << title << " " << endl; } for (cli.toFirst();(cd=cli.current());++cli) { - if (!cd->isHidden() && cd->name().find('@')==-1) + if (!cd->isHidden() && cd->name().find('@')==-1) { t << " " << endl; t << " " << endl; t << " " << endl; - t << " " << "struct " << convertToXML(cd->name()) << ""; + t << " " << "struct " << convertToDocBook(cd->name()) << ""; t << "" << endl; if (cd->briefDescription()) { @@ -946,7 +1237,7 @@ static void writeInnerClasses(const ClassSDict *cl,FTextStream &t) t << " " << endl; } } - if (cli.toFirst()) + if (cli.toFirst()) { t << "
    " << endl; } @@ -961,7 +1252,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) NamespaceDef *nd; QCString title = theTranslator->trNamespaces(); - if (nli.toFirst()) + if (nli.toFirst()) { t << " " << endl; t << " " << title << " " << endl; @@ -973,14 +1264,14 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) t << " " << endl; t << " " << endl; t << " " << endl; - t << " " << "struct getOutputFileBase() << "\">" << convertToXML(nd->name()) << ""; + t << " " << "struct getOutputFileBase() << "\">" << convertToDocBook(nd->name()) << ""; t << "" << endl; t << " " << endl; t << " " << endl; t << " " << endl; } } - if (nli.toFirst()) + if (nli.toFirst()) { t << " " << endl; } @@ -995,23 +1286,23 @@ static void writeInnerFiles(const FileList *fl,FTextStream &t) FileDef *fd; QCString title = theTranslator->trFile(TRUE,TRUE); - if (fli.toFirst()) + if (fli.toFirst()) { t << " " << endl; t << " " << title << " " << endl; } - for (fli.toFirst();(fd=fli.current());++fli) + for (fli.toFirst();(fd=fli.current());++fli) { t << " " << endl; t << " " << endl; t << " " << endl; - t << " " << "file getOutputFileBase() << "\">" << convertToXML(fd->name()) << ""; + t << " " << "file getOutputFileBase() << "\">" << convertToDocBook(fd->name()) << ""; t << "" << endl; t << " " << endl; t << " " << endl; t << " " << endl; } - if (fli.toFirst()) + if (fli.toFirst()) { t << " " << endl; } @@ -1040,7 +1331,7 @@ static void writeInnerGroups(const GroupList *gl,FTextStream &t) GroupDef *sgd; //Docbook header tags for inner groups - if (gli.toFirst()) + if (gli.toFirst()) { t << " " << endl; t << " " << theTranslator->trModules() << "" << endl; @@ -1051,11 +1342,11 @@ static void writeInnerGroups(const GroupList *gl,FTextStream &t) for (gli.toFirst();(sgd=gli.current());++gli) { - t << " getOutputFileBase() << "\">" << convertToXML(sgd->groupTitle()) << "" << endl; + t << " getOutputFileBase() << "\">" << convertToDocBook(sgd->groupTitle()) << "" << endl; } //Docbook footer tags for inner groups - if (gli.toFirst()) + if (gli.toFirst()) { t << " " << endl; t << " " << endl; @@ -1071,7 +1362,7 @@ static void writeInnerDirs(const DirList *dl,FTextStream &t) QListIterator subdirs(*dl); DirDef *subdir; QCString title = theTranslator->trDirectories(); - if (subdirs.toFirst()) + if (subdirs.toFirst()) { t << " " << endl; t << " " << title << " " << endl; @@ -1081,13 +1372,13 @@ static void writeInnerDirs(const DirList *dl,FTextStream &t) t << " " << endl; t << " " << endl; t << " " << endl; - t << " " << "dir getOutputFileBase() << "\">" << convertToXML(subdir->displayName()) << ""; + t << " " << "dir getOutputFileBase() << "\">" << convertToDocBook(subdir->displayName()) << ""; t << "" << endl; t << " " << endl; t << " " << endl; t << " " << endl; } - if (subdirs.toFirst()) + if (subdirs.toFirst()) { t << " " << endl; } @@ -1152,8 +1443,15 @@ static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) writeDocbookHeader_ID(t, classOutputFileBase(cd)); t << ""; writeDocbookString(t,cd->name()); + addIndexTerm(t,cd->name()); t << " " << cd->compoundTypeString() << " Reference"; t << "" << endl; + if (cd->briefDescription()) + { + t << " " << endl; + writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription()); + t << " " << endl; + } IncludeInfo *ii=cd->includeInfo(); if (ii) @@ -1166,7 +1464,7 @@ static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) t << " #include "; if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references { - t << "fileDef->getOutputFileBase() << "\">"; + t << "fileDef->getOutputFileBase() << "\">"; } if (ii->local) { @@ -1176,7 +1474,7 @@ static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) { t << "<"; } - t << convertToXML(nm); + t << convertToDocBook(nm); if (ii->local) { t << """; @@ -1196,14 +1494,14 @@ static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) if (Config_getBool(HAVE_DOT) && (Config_getBool(CLASS_DIAGRAMS) || Config_getBool(CLASS_GRAPH))) { - t << "Inheritance diagram for " << convertToXML(cd->name()) << "" << endl; + t << "Inheritance diagram for " << convertToDocBook(cd->name()) << "" << endl; DotClassGraph inheritanceGraph(cd,DotNode::Inheritance); inheritanceGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE); } if (Config_getBool(HAVE_DOT) && Config_getBool(COLLABORATION_GRAPH)) { - t << "Collaboration diagram for " << convertToXML(cd->name()) << "" << endl; + t << "Collaboration diagram for " << convertToDocBook(cd->name()) << "" << endl; DotClassGraph collaborationGraph(cd,DotNode::Collaboration); collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE); } @@ -1222,7 +1520,6 @@ static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) } } - QListIterator mli(cd->getMemberLists()); MemberList *ml; for (mli.toFirst();(ml=mli.current());++mli) @@ -1233,28 +1530,41 @@ static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) } } - if(Config_getBool(REPEAT_BRIEF)) + if ((Config_getBool(REPEAT_BRIEF) && cd->briefDescription()) || cd->documentation()) { - if (cd->briefDescription()) + t << " " << endl; + t << " " << theTranslator->trDetailedDescription() << "" << endl; + + if(Config_getBool(REPEAT_BRIEF)) + { + if (cd->briefDescription()) { - t << " " << endl; + t << " " << endl; // A title as 'Brief Description' may not be necessary. //t << " " << theTranslator->trBriefDescription() << "" << endl; writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription()); - t << " " << endl; + t << " " << endl; } + } + + if (cd->documentation()) + { + writeDocbookDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation()); + } + t << " " << endl; } - if (cd->documentation()) + if (cd->getMemberGroupSDict()) { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - writeDocbookDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation()); - t << " Definition at line " << cd->getDefLine() << " of file " << stripPath(cd->getDefFileName()) << "" << endl; - t << " The Documentation for this struct was generated from the following file: " << endl; - t << " " << stripPath(cd->getDefFileName()) << "" << endl; - t << " " << endl; + MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict()); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + generateDocbookSection(cd,t,mg->members(),"user-defined",1,mg->header(), + mg->documentation()); + } } + for (mli.toFirst();(ml=mli.current());++mli) { if ((ml->listType()&MemberListType_detailedLists)==0) @@ -1295,6 +1605,8 @@ static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) writeListOfAllMembers(cd,t); */ + t << " " << cd->generatedFromFiles() << "" << endl; + t << " " << stripPath(cd->getDefFileName()) << "" << endl; t << "
    " << endl; } @@ -1329,9 +1641,16 @@ static void generateDocbookForNamespace(NamespaceDef *nd,FTextStream &ti) writeDocbookHeader_ID(t, nd->getOutputFileBase()); t << ""; - writeDocbookString(t,nd->name()); + addIndexTerm(t,nd->displayName()); + writeDocbookString(t,nd->title()); t << "" << endl; + if (nd->briefDescription()) + { + t << " " << endl; + //t << " " << theTranslator->trBriefDescription() << "" << endl; + t << " " << endl; + } writeInnerClasses(nd->getClassSDict(),t); writeInnerNamespaces(nd->getNamespaceSDict(),t); @@ -1356,27 +1675,52 @@ static void generateDocbookForNamespace(NamespaceDef *nd,FTextStream &ti) } } - if(Config_getBool(REPEAT_BRIEF)) + if ((Config_getBool(REPEAT_BRIEF) && nd->briefDescription()) || nd->documentation()) { - if (nd->briefDescription()) + t << " " << endl; + t << " " << theTranslator->trDetailedDescription() << "" << endl; + + if(Config_getBool(REPEAT_BRIEF)) + { + if (nd->briefDescription()) { - t << " " << endl; + t << " " << endl; //t << " " << theTranslator->trBriefDescription() << "" << endl; writeDocbookDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription()); - t << " " << endl; + t << " " << endl; } + } + + if (nd->documentation()) + { + writeDocbookDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation()); + } + t << " " << endl; } - if (nd->documentation()) + if (nd->getMemberGroupSDict()) { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - writeDocbookDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation()); - t << " Definition at line " << nd->getDefLine() << " of file " << stripPath(nd->getDefFileName()) << "" << endl; - t << " The Documentation for this struct was generated from the following file: " << endl; - t << " " << stripPath(nd->getDefFileName()) << "" << endl; - t << " " << endl; + MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict()); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + generateDocbookSection(nd,t,mg->members(),"user-defined",1,mg->header(), + mg->documentation()); + } + } + + for (mli.toFirst();(ml=mli.current());++mli) + { + if ((ml->listType()&MemberListType_detailedLists)==0) + { + if (ml->listType() != MemberListType_allMembersList && + ml->listType() != MemberListType_docFuncMembers) + generateDocbookSection(nd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); + } } + // we actually need here "namespace" + // t << " " << theTranslator->trGeneratedFromFiles(ClassDef::Struct, FALSE) << "" << endl; + // t << " " << stripPath(nd->getDefFileName()) << "" << endl; t << "
    " << endl; } @@ -1421,6 +1765,13 @@ static void generateDocbookForFile(FileDef *fd,FTextStream &ti) t << " File Reference"; t << "" << endl; + if (fd->briefDescription()) + { + t << " " << endl; + writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); + t << " " << endl; + } + IncludeInfo *inc; if (fd->includeFileList()) @@ -1437,7 +1788,7 @@ static void generateDocbookForFile(FileDef *fd,FTextStream &ti) { t << "<"; } - t << convertToXML(inc->includeName); + t << convertToDocBook(inc->includeName); if (inc->local) { t << """; @@ -1453,13 +1804,13 @@ static void generateDocbookForFile(FileDef *fd,FTextStream &ti) { if (Config_getBool(INCLUDE_GRAPH)) { - t << "Include dependency diagram for " << convertToXML(fd->name()) << "" << endl; + t << "Include dependency diagram for " << convertToDocBook(fd->name()) << "" << endl; DotInclDepGraph idepGraph(fd, FALSE); idepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); } if (Config_getBool(INCLUDED_BY_GRAPH)) { - t << "Included by dependency diagram for " << convertToXML(fd->name()) << "" << endl; + t << "Included by dependency diagram for " << convertToDocBook(fd->name()) << "" << endl; DotInclDepGraph ibdepGraph(fd, TRUE); ibdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); } @@ -1497,9 +1848,15 @@ static void generateDocbookForFile(FileDef *fd,FTextStream &ti) t << " " << endl; t << " " << theTranslator->trDetailedDescription() << "" << endl; - writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); + if(Config_getBool(REPEAT_BRIEF)) + { + if (fd->briefDescription()) + { + writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); + } + } writeDocbookDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation()); - if (Config_getBool(FULL_PATH_NAMES)) + if (Config_getBool(FULL_PATH_NAMES)) { t << " Definition in file " << fd->getDefFileName() << "" << endl; } @@ -1509,9 +1866,17 @@ static void generateDocbookForFile(FileDef *fd,FTextStream &ti) } t << " " << endl; + for (mli.toFirst();(ml=mli.current());++mli) + { + if ((ml->listType()&MemberListType_declarationLists)!=0) + { + generateDocbookSection(fd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); + } + } + if (Config_getBool(DOCBOOK_PROGRAMLISTING)) { - t << " " << endl; + t << " " << endl;; writeDocbookCodeBlock(t,fd); t << " " << endl; } @@ -1535,7 +1900,7 @@ static void generateDocbookForGroup(GroupDef *gd,FTextStream &ti) if (gd->isReference()) return; // skip external references - if (!gd->isASubGroup()) + if (!gd->isASubGroup()) { QCString fileDocbook=gd->getOutputFileBase()+".xml"; //Add the file Documentation info to index file @@ -1557,31 +1922,21 @@ static void generateDocbookForGroup(GroupDef *gd,FTextStream &ti) //t.setEncoding(FTextStream::UnicodeUTF8); writeDocbookHeader_ID(t, gd->getOutputFileBase()); - t << " " << convertToXML(gd->groupTitle()) << "" << endl; + t << " " << convertToDocBook(gd->groupTitle()) << "" << endl; + if (gd->briefDescription()) + { + t << " " << endl; + writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription()); + t << " " << endl; + } if (Config_getBool(GROUP_GRAPHS) && Config_getBool(HAVE_DOT)) { - t << "Collaboration diagram for " << convertToXML(gd->groupTitle()) << "" << endl; + t << "Collaboration diagram for " << convertToDocBook(gd->groupTitle()) << "" << endl; DotGroupCollaboration collaborationGraph(gd); collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); } - if (gd->briefDescription()) - { - //t << "
    " << endl; - //t << " " << theTranslator->trBriefDescription() << "" << endl; - writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription()); - //t << "
    " << endl; - } - - if (gd->documentation()) - { - t << "
    " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - writeDocbookDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation()); - t << "
    " << endl; - } - writeInnerFiles(gd->getFiles(),t); writeInnerClasses(gd->getClasses(),t); writeInnerNamespaces(gd->getNamespaces(),t); @@ -1608,6 +1963,26 @@ static void generateDocbookForGroup(GroupDef *gd,FTextStream &ti) generateDocbookSection(gd,t,ml,g_docbookSectionMapper.find(ml->listType())); } } + + if(Config_getBool(REPEAT_BRIEF)) + { + if (gd->briefDescription()) + { + //t << "
    " << endl; + //t << " " << theTranslator->trBriefDescription() << "" << endl; + writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription()); + //t << "
    " << endl; + } + } + + if (gd->documentation()) + { + t << " " << endl; + t << " " << theTranslator->trDetailedDescription() << "" << endl; + writeDocbookDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation()); + t << " " << endl; + } + for (mli.toFirst();(ml=mli.current());++mli) { if ((ml->listType()&MemberListType_declarationLists)!=0) @@ -1648,9 +2023,13 @@ static void generateDocbookForDir(DirDef *dd,FTextStream &ti) t << " "; t << theTranslator->trDirReference(dd->displayName()); t << "" << endl; + if (dd->briefDescription()) + { + writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription()); + } if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT)) { - t << "Directory dependency diagram for " << convertToXML(dd->displayName()) << "" << endl; + t << "Directory dependency diagram for " << convertToDocBook(dd->displayName()) << "" << endl; DotDirDeps dirdepGraph(dd); dirdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); } @@ -1660,7 +2039,12 @@ static void generateDocbookForDir(DirDef *dd,FTextStream &ti) t << " " << endl; t << " " << theTranslator->trDetailedDescription() << "" << endl; - writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription()); + if (dd->briefDescription()) + { + t << " " << endl; + writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription()); + t << " " << endl; + } writeDocbookDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation()); t << " Directory location is " << dd->name() << "" << endl; t << " " << endl; @@ -1681,7 +2065,7 @@ static void generateDocbookForPage(PageDef *pd,FTextStream &ti,bool isExample) { pageName+=(QCString)"_"+pd->name(); } - if (pageName=="index") + if (pageName=="index") { pageName="mainpage"; // to prevent overwriting the generated index page. } @@ -1709,9 +2093,9 @@ static void generateDocbookForPage(PageDef *pd,FTextStream &ti,bool isExample) QCString fileDocbook=pageName+".xml"; //Add the file Documentation info to index file ti << " " << endl; - writeDocbookHeaderMainpage(t); - } - else + writeDocbookHeaderMainpage(t,pageName); + } + else { QCString pid; if(isExample) @@ -1728,13 +2112,17 @@ static void generateDocbookForPage(PageDef *pd,FTextStream &ti,bool isExample) SectionInfo *si = Doxygen::sectionDict->find(pd->name()); if (si) { - t << " " << convertToXML(si->title) << "" << endl; - } - else + if ( pageName == "mainpage") + t << " " << convertToDocBook(theTranslator->trMainPage()) << "" << endl; + else + t << " " << convertToDocBook(si->title) << "" << endl; + } + else { - t << " " << convertToXML(pd->name()) << "" << endl; + t << " " << convertToDocBook(pd->name()) << "" << endl; } + generateTOC(t, pd); if (isExample) { writeDocbookDocBlock(t,pd->docFile(),pd->docLine(),pd,0, @@ -1750,14 +2138,13 @@ static void generateDocbookForPage(PageDef *pd,FTextStream &ti,bool isExample) if (!pd->hasParentPage() && !isExample) { t << endl << "
    " << endl; - } - else + } + else { t << endl << "" << endl; } } - -void generateDocbook() +void generateDocbook_v1() { // + classes @@ -1824,7 +2211,7 @@ void generateDocbook() t << "" << endl;; t << "" << endl; t << " " << endl; - t << " " << dbk_projectName << "" << endl; + t << " " << convertToDocBook(dbk_projectName) << "" << endl; t << " " << endl; // NAMESPACE DOCUMENTATION @@ -1832,7 +2219,7 @@ void generateDocbook() NamespaceDef *nd; //Namespace Documentation index header - if (nli.toFirst()) + if (nli.toFirst()) { t << " " << endl; t << " Namespace Documentation" << endl; @@ -1845,7 +2232,7 @@ void generateDocbook() } //Namespace Documentation index footer - if (nli.toFirst()) + if (nli.toFirst()) { t << " " << endl; } @@ -1876,7 +2263,7 @@ void generateDocbook() GroupDef *gd; //Module group Documentation index header - if (gli.toFirst()) + if (gli.toFirst()) { t << " " << endl; t << " " << theTranslator->trModuleDocumentation() << "" << endl; @@ -1889,7 +2276,7 @@ void generateDocbook() } //Module group Documentation index footer - if (gli.toFirst()) + if (gli.toFirst()) { t << " " << endl; } @@ -1901,7 +2288,7 @@ void generateDocbook() ClassDef *cd; //Class Documentation index header - if (cli.toFirst()) + if (cli.toFirst()) { t << " " << endl; t << " " << theTranslator->trClassDocumentation() << "" << endl; @@ -1913,7 +2300,7 @@ void generateDocbook() } //Class Documentation index footer - if (cli.toFirst()) + if (cli.toFirst()) { t << " " << endl; } @@ -1928,7 +2315,7 @@ void generateDocbook() FileName *fn; //File Documentation index header - if (fnli.toFirst()) + if (fnli.toFirst()) { t << " " << endl; t << " " << theTranslator->trFileDocumentation() << "" << endl; @@ -1946,7 +2333,7 @@ void generateDocbook() } //File Documentation index footer - if (fnli.toFirst()) + if (fnli.toFirst()) { t << " " << endl; } @@ -1959,7 +2346,7 @@ void generateDocbook() DirSDict::Iterator sdi(*Doxygen::directories); //Directory Documentation index header - if (sdi.toFirst()) + if (sdi.toFirst()) { t << " " << endl; t << " " << theTranslator->trDirDocumentation() << "" << endl; @@ -1972,7 +2359,7 @@ void generateDocbook() } //Module group Documentation index footer - if (sdi.toFirst()) + if (sdi.toFirst()) { t << " " << endl; } @@ -1985,7 +2372,7 @@ void generateDocbook() PageDef *pd=0; //Example Page Documentation index header - if (pdi.toFirst()) + if (pdi.toFirst()) { t << " " << endl; t << " " << theTranslator->trExampleDocumentation() << "" << endl; @@ -1998,14 +2385,937 @@ void generateDocbook() } //Example Page Documentation index footer - if (pdi.toFirst()) + if (pdi.toFirst()) { t << " " << endl; } } + t << "" << endl; t << "" << endl; } +DocbookGenerator::DocbookGenerator() : OutputGenerator() +{ +DB_GEN_C + dir=Config_getString(DOCBOOK_OUTPUT); + //insideTabbing=FALSE; + //firstDescItem=TRUE; + //disableLinks=FALSE; + //m_indent=0; + //templateMemberItem = FALSE; + m_prettyCode=Config_getBool(DOCBOOK_PROGRAMLISTING); + for (int i = 0 ; i < sizeof(m_inListItem) / sizeof(*m_inListItem) ; i++) m_inListItem[i] = FALSE; + for (int i = 0 ; i < sizeof(m_inSimpleSect) / sizeof(*m_inSimpleSect) ; i++) m_inSimpleSect[i] = FALSE; +} + +DocbookGenerator::~DocbookGenerator() +{ +DB_GEN_C +} + +void DocbookGenerator::init() +{ + QCString dir=Config_getString(DOCBOOK_OUTPUT); + QDir d(dir); + if (!d.exists() && !d.mkdir(dir)) + { + err("Could not create output directory %s\n",dir.data()); + exit(1); + } + createSubDirs(d); +} + +void DocbookGenerator::startFile(const char *name,const char *,const char *) +{ +DB_GEN_C + QCString fileName=name; + QCString pageName; + QCString fileType="section"; + if (fileName == "refman") + { + fileName="index"; + fileType="book"; + } + else if (fileName == "index") + { + fileName="mainpage"; + fileType="chapter"; + } + pageName = fileName; + relPath = relativePathToRoot(fileName); + if (fileName.right(4)!=".xml") fileName+=".xml"; + startPlainFile(fileName); + m_codeGen.setTextStream(t); + m_codeGen.setRelativePath(relPath); + m_codeGen.setSourceFileName(stripPath(fileName)); + + t << "" << endl;; + t << "<" << fileType << " xmlns=\"http://docbook.org/ns/docbook\" version=\"5.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\""; + if (!pageName.isEmpty()) t << " xml:id=\"_" << stripPath(pageName) << "\""; + t << ">" << endl; +} + +void DocbookGenerator::endFile() +{ +DB_GEN_C + if (m_inDetail) t << "" << endl; + m_inDetail = FALSE; + while (m_inLevel != -1) + { + t << "" << endl; + m_inLevel--; + } + if (m_inGroup) t << "" << endl; + m_inGroup = FALSE; + + QCString fileType="section"; + QCString fileName= m_codeGen.sourceFileName(); + if (fileName == "index.xml") + { + fileType="book"; + } + else if (fileName == "mainpage.xml") + { + fileType="chapter"; + } + t << "" << endl; + endPlainFile(); + m_codeGen.setSourceFileName(""); +} + +void DocbookGenerator::startIndexSection(IndexSections is) +{ +DB_GEN_C2("IndexSections " << is) + switch (is) + { + case isTitlePageStart: + { + QCString dbk_projectName = Config_getString(PROJECT_NAME); + t << " " << endl; + t << " " << convertToDocBook(dbk_projectName) << "" << endl; + t << " " << endl; + } + break; + case isTitlePageAuthor: + break; + case isMainPage: + t << "" << endl; + t << " "; + break; + case isModuleIndex: + //Module Index}\n" + break; + case isDirIndex: + //Directory Index}\n" + break; + case isNamespaceIndex: + //Namespace Index}\n" + break; + case isClassHierarchyIndex: + //Hierarchical Index}\n" + break; + case isCompoundIndex: + //t << "{"; //Class Index}\n" + break; + case isFileIndex: + //Annotated File Index}\n" + break; + case isPageIndex: + //Annotated Page Index}\n" + break; + case isModuleDocumentation: + t << "<chapter>\n"; + t << " <title>"; + break; + case isDirDocumentation: + t << "<chapter>\n"; + t << " <title>"; + break; + case isNamespaceDocumentation: + t << "<chapter>\n"; + t << " <title>"; + break; + case isClassDocumentation: + t << "<chapter>\n"; + t << " <title>"; + break; + case isFileDocumentation: + t << "<chapter>\n"; + t << " <title>"; + break; + case isExampleDocumentation: + t << "<chapter>\n"; + t << " <title>"; + break; + case isPageDocumentation: + break; + case isPageDocumentation2: + break; + case isEndIndex: + break; + } +} + +void DocbookGenerator::endIndexSection(IndexSections is) +{ +DB_GEN_C2("IndexSections " << is) + static bool sourceBrowser = Config_getBool(SOURCE_BROWSER); + switch (is) + { + case isTitlePageStart: + break; + case isTitlePageAuthor: + break; + case isMainPage: + t << "" << endl; + t << " " << endl; + t << "" << endl; + break; + case isModuleIndex: + //t << "
    " << endl; + break; + case isDirIndex: + //t << ""; + //t << "" << endl; + break; + case isNamespaceIndex: + //t << ""; + //t << "" << endl; + break; + case isClassHierarchyIndex: + //t << ""; + //t << "" << endl; + break; + case isCompoundIndex: + //t << "" << endl; + break; + case isFileIndex: + //t << ""; + //t << "" << endl; + break; + case isPageIndex: + //t << ""; + //t << "" << endl; + break; + case isModuleDocumentation: + { + t << "" << endl; + GroupSDict::Iterator gli(*Doxygen::groupSDict); + GroupDef *gd; + bool found=FALSE; + for (gli.toFirst();(gd=gli.current()) && !found;++gli) + { + if (!gd->isReference()) + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + found=TRUE; + } + } + for (;(gd=gli.current());++gli) + { + if (!gd->isReference()) + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + } + } + t << "\n"; + break; + case isDirDocumentation: + { + t << "" << endl; + SDict::Iterator dli(*Doxygen::directories); + DirDef *dd; + bool found=FALSE; + for (dli.toFirst();(dd=dli.current()) && !found;++dli) + { + if (dd->isLinkableInProject()) + { + t << "< xi:include href=\"" << dd->getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + found=TRUE; + } + } + for (;(dd=dli.current());++dli) + { + if (dd->isLinkableInProject()) + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + } + } + t << "\n"; + break; + case isNamespaceDocumentation: + { + t << "" << endl; + NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); + NamespaceDef *nd; + bool found=FALSE; + for (nli.toFirst();(nd=nli.current()) && !found;++nli) + { + if (nd->isLinkableInProject()) + { + t << "getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + found=TRUE; + } + } + while ((nd=nli.current())) + { + if (nd->isLinkableInProject()) + { + t << "getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + ++nli; + } + } + t << "\n"; + break; + case isClassDocumentation: + { + t << "" << endl; + ClassSDict::Iterator cli(*Doxygen::classSDict); + ClassDef *cd=0; + bool found=FALSE; + for (cli.toFirst();(cd=cli.current()) && !found;++cli) + { + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInOuterScope() + ) + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + found=TRUE; + } + } + for (;(cd=cli.current());++cli) + { + if (cd->isLinkableInProject() && + cd->templateMaster()==0 && + !cd->isEmbeddedInOuterScope() + ) + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + } + } + t << "\n"; + break; + case isFileDocumentation: + { + t << "" << endl; + bool isFirst=TRUE; + FileNameListIterator fnli(*Doxygen::inputNameList); + FileName *fn; + for (fnli.toFirst();(fn=fnli.current());++fnli) + { + FileNameIterator fni(*fn); + FileDef *fd; + for (;(fd=fni.current());++fni) + { + if (fd->isLinkableInProject()) + { + if (isFirst) + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + if (sourceBrowser && m_prettyCode && fd->generateSourceFile()) + { + t << " getSourceFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + isFirst=FALSE; + } + else + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + if (sourceBrowser && m_prettyCode && fd->generateSourceFile()) + { + t << " getSourceFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + } + } + } + } + } + t << "\n"; + break; + case isExampleDocumentation: + { + t << "" << endl; + PageSDict::Iterator pdi(*Doxygen::exampleSDict); + PageDef *pd=pdi.toFirst(); + if (pd) + { + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + for (++pdi;(pd=pdi.current());++pdi) + { + fprintf(stderr,"==> Done calling from HTML\n"); + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + } + } + t << "\n"; + break; + case isPageDocumentation: + break; + case isPageDocumentation2: + break; + case isEndIndex: + t << "" << endl; + break; + } +} +void DocbookGenerator::writePageLink(const char *name, bool /*first*/) +{ +DB_GEN_C + PageSDict::Iterator pdi(*Doxygen::pageSDict); + PageDef *pd = pdi.toFirst(); + for (pd = pdi.toFirst();(pd=pdi.current());++pdi) + { + if (!pd->getGroupDef() && !pd->isReference() && pd->name() == stripPath(name)) + { + t << "\n"; + if (!pd->title().isEmpty()) + { + t << " " << convertToDocBook(pd->title()) << "" << endl; + } + else + { + t << " " << convertToDocBook(pd->name()) << "" << endl; + } + t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; + t << "\n"; + } + } +} +void DocbookGenerator::writeDoc(DocNode *n,Definition *ctx,MemberDef *) +{ +DB_GEN_C + DocbookDocVisitor *visitor = + new DocbookDocVisitor(t,*this); + n->accept(visitor); + delete visitor; +} + +void DocbookGenerator::startParagraph(const char *) +{ +DB_GEN_C + t << "" << endl; +} + +void DocbookGenerator::endParagraph() +{ +DB_GEN_C + t << "" << endl; +} +void DocbookGenerator::writeString(const char *text) +{ +DB_GEN_C + t << text; +} +void DocbookGenerator::startMemberHeader(const char *name,int) +{ +DB_GEN_C + t << "" << endl; + m_inSimpleSect[m_levelListItem] = TRUE; + t << " "; +} + +void DocbookGenerator::endMemberHeader() +{ +DB_GEN_C + t << " " << endl; +} +void DocbookGenerator::docify(const char *str) +{ +DB_GEN_C + t << convertToDocBook(str); +} +void DocbookGenerator::writeObjectLink(const char *ref, const char *f, + const char *anchor, const char *text) +{ +DB_GEN_C + if (anchor) + if (f) t << ""; + else t << ""; + else + t << ""; + docify(text); + t << ""; +} +void DocbookGenerator::startMemberList() +{ +DB_GEN_C + t << " " << endl; + m_levelListItem++; +} +void DocbookGenerator::endMemberList() +{ +DB_GEN_C + if (m_inListItem[m_levelListItem]) t << "" << endl; + m_inListItem[m_levelListItem] = FALSE; + t << " " << endl; + m_levelListItem = (m_levelListItem> 0 ? m_levelListItem - 1 : 0); + if (m_inSimpleSect[m_levelListItem]) t << "" << endl; + m_inSimpleSect[m_levelListItem] = FALSE; +} +void DocbookGenerator::startMemberItem(const char *,int,const char *) +{ +DB_GEN_C + if (m_inListItem[m_levelListItem]) t << "" << endl; + t << " "; + m_inListItem[m_levelListItem] = TRUE; +} +void DocbookGenerator::endMemberItem() +{ +DB_GEN_C + t << "" << endl; +} +void DocbookGenerator::startBold(void) +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endBold(void) +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::startGroupHeader(int extraIndentLevel) +{ +DB_GEN_C2("m_inLevel " << m_inLevel) +DB_GEN_C2("extraIndentLevel " << extraIndentLevel) + m_firstMember = TRUE; + if (m_inSimpleSect[m_levelListItem]) t << "" << endl; + m_inSimpleSect[m_levelListItem] = FALSE; + if (m_inLevel != -1) m_inGroup = TRUE; + if (m_inLevel == extraIndentLevel) t << "" << endl; + m_inLevel = extraIndentLevel; + t << "
    " << endl; + t << ""; +} +void DocbookGenerator::writeRuler(void) +{ +DB_GEN_C2("m_inLevel " << m_inLevel) +DB_GEN_C2("m_inGroup " << m_inGroup) + if (m_inGroup) t << "</section>" << endl; + m_inGroup = FALSE; +} + +void DocbookGenerator::endGroupHeader(int) +{ +DB_GEN_C + t << "" << endl; +} + +void DocbookGenerator::startParameterList(bool openBracket) +{ +DB_GEN_C + if (openBracket) t << "("; +} +void DocbookGenerator::endParameterList() +{ +DB_GEN_C +} +void DocbookGenerator::writeNonBreakableSpace(int n) +{ +DB_GEN_C + for (int i=0;i"; +} +void DocbookGenerator::endTypewriter() +{ +DB_GEN_C + if (!m_denseText) t << "" << endl; +} +void DocbookGenerator::startTextBlock(bool dense) +{ +DB_GEN_C + if (dense) + { + m_denseText = TRUE; + t << ""; + } +} +void DocbookGenerator::endTextBlock(bool dense) +{ +DB_GEN_C + if (m_denseText) + { + m_denseText = FALSE; + t << ""; + } +} +void DocbookGenerator::startMemberDoc(const char *clname, const char *memname, const char *anchor, const char *title, + int memCount, int memTotal, bool showInline) +{ +DB_GEN_C2("m_inLevel " << m_inLevel) + t << "
    " << endl; + t << " " << convertToDocBook(title); + if (memTotal>1) + { + t << "<computeroutput>[" << memCount << "/" << memTotal << "]</computeroutput>"; + } + t << "" << endl; + if (memname && memname[0]!='@') + { + addIndexTerm(t,memname,clname); + addIndexTerm(t,clname,memname); + } +} +void DocbookGenerator::endMemberDoc(bool) +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::startTitleHead(const char *) +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endTitleHead(const char *fileName,const char *name) +{ +DB_GEN_C + t << "" << endl; + if (name) addIndexTerm(t, name); +} +void DocbookGenerator::startDoxyAnchor(const char *fName,const char *manName, + const char *anchor,const char *name, + const char *args) +{ +DB_GEN_C + if (!m_inListItem[m_levelListItem] && !m_descTable) + { + if (!m_firstMember) t << "
    "; + m_firstMember = FALSE; + } + if (anchor) + { + t << ""; + } +} +void DocbookGenerator::endDoxyAnchor(const char *fileName,const char *anchor) +{ +DB_GEN_C +} +void DocbookGenerator::startMemberDocName(bool) +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endMemberDocName() +{ +DB_GEN_C +} +void DocbookGenerator::startMemberGroupHeader(bool hasHeader) +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endMemberGroupHeader() +{ +DB_GEN_C + t << "" << endl; +} +void DocbookGenerator::startMemberGroup() +{ +DB_GEN_C +} +void DocbookGenerator::endMemberGroup(bool) +{ +DB_GEN_C + t << "" << endl; +} +void DocbookGenerator::startClassDiagram() +{ +DB_GEN_C + t << ""; +} + +void DocbookGenerator::endClassDiagram(const ClassDiagram &d, const char *fileName,const char *) +{ +DB_GEN_C + visitPreStart(t, FALSE, relPath + fileName + ".png", NULL, NULL); + d.writeImage(t,dir,relPath,fileName,FALSE); + visitPostEnd(t, FALSE); + t << "" << endl; +} +void DocbookGenerator::startLabels() +{ +DB_GEN_C +} + +void DocbookGenerator::writeLabel(const char *l,bool isLast) +{ +DB_GEN_C + t << "[" << l << "]"; + if (!isLast) t << ", "; +} + +void DocbookGenerator::endLabels() +{ +DB_GEN_C +} +void DocbookGenerator::startExamples() +{ +DB_GEN_C + t << ""; + docify(theTranslator->trExamples()); + t << ""; +} + +void DocbookGenerator::endExamples() +{ +DB_GEN_C + t << "" << endl; +} +void DocbookGenerator::startSubsubsection(void) +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endSubsubsection(void) +{ +DB_GEN_C + t << "" << endl; +} +void DocbookGenerator::writeChar(char c) +{ +DB_GEN_C + char cs[2]; + cs[0]=c; + cs[1]=0; + docify(cs); +} +void DocbookGenerator::startMemberDocPrefixItem() +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endMemberDocPrefixItem() +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::exceptionEntry(const char* prefix,bool closeBracket) +{ +DB_GEN_C + if (prefix) + t << " " << prefix << "("; + else if (closeBracket) + t << ")"; + t << " "; +} +void DocbookGenerator::startParameterName(bool) +{ +DB_GEN_C + t << " "; +} +void DocbookGenerator::endParameterName(bool last,bool /*emptyList*/,bool closeBracket) +{ +DB_GEN_C + if (last) + { + if (closeBracket) t << ")"; + } +} +void DocbookGenerator::startCodeFragment() +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endCodeFragment() +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::startMemberTemplateParams() +{ +DB_GEN_C +} + +void DocbookGenerator::endMemberTemplateParams(const char *,const char *) +{ +DB_GEN_C + t << ""; + t << ""; +} +void DocbookGenerator::startSection(const char *lab,const char *,SectionInfo::SectionType type) +{ +DB_GEN_C + t << "
    "; + t << ""; +} +void DocbookGenerator::endSection(const char *lab,SectionInfo::SectionType) +{ +DB_GEN_C + t << ""; + t << "
    "; +} +void DocbookGenerator::addIndexItem(const char *prim,const char *sec) +{ +DB_GEN_C + addIndexTerm(t, prim, sec); +} + +void DocbookGenerator::startDescTable(const char *title) +{ +DB_GEN_C + int ncols = 2; + t << "" << endl; + if (title)t << "" << convertToDocBook(title) << "" << endl; + t << " " << endl; + for (int i = 0; i < ncols; i++) + { + t << " \n"; + } + t << "\n"; + m_descTable = TRUE; +} + +void DocbookGenerator::endDescTable() +{ +DB_GEN_C + t << " " << endl; + t << " " << endl; + t << "" << endl; + m_descTable = FALSE; +} + +void DocbookGenerator::startDescTableRow() +{ +DB_GEN_C + t << ""; + t << ""; +} + +void DocbookGenerator::endDescTableRow() +{ +DB_GEN_C + t << ""; +} + +void DocbookGenerator::startDescTableTitle() +{ +DB_GEN_C +} + +void DocbookGenerator::endDescTableTitle() +{ +DB_GEN_C +} + +void DocbookGenerator::startDescTableData() +{ +DB_GEN_C + t << ""; +} + +void DocbookGenerator::endDescTableData() +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::startGroupCollaboration() +{ +DB_GEN_C +} +void DocbookGenerator::endGroupCollaboration(const DotGroupCollaboration &g) +{ +DB_GEN_C + g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); +} +void DocbookGenerator::startDotGraph() +{ +DB_GEN_C +} +void DocbookGenerator::endDotGraph(const DotClassGraph &g) +{ +DB_GEN_C + g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE); +} +void DocbookGenerator::startInclDepGraph() +{ +DB_GEN_C +} +void DocbookGenerator::endInclDepGraph(const DotInclDepGraph &g) +{ +DB_GEN_C + QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), fileName,relPath,FALSE); +} +void DocbookGenerator::startCallGraph() +{ +DB_GEN_C +} +void DocbookGenerator::endCallGraph(const DotCallGraph &g) +{ +DB_GEN_C + QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), fileName,relPath,FALSE); +} +void DocbookGenerator::startDirDepGraph() +{ +DB_GEN_C +} +void DocbookGenerator::endDirDepGraph(const DotDirDeps &g) +{ +DB_GEN_C + QCString fn = g.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT), fileName,relPath,FALSE); +} +void DocbookGenerator::startMemberDocList() +{ +DB_GEN_C +} +void DocbookGenerator::endMemberDocList() +{ +DB_GEN_C + m_inGroup = TRUE; +} +void DocbookGenerator::startConstraintList(const char *header) +{ +DB_GEN_C + t << ""; + docify(header); + t << "" << endl; +} +void DocbookGenerator::startConstraintParam() +{ +DB_GEN_C + t << ""; +} +void DocbookGenerator::endConstraintParam() +{ +DB_GEN_C +} +void DocbookGenerator::startConstraintType() +{ +DB_GEN_C + t << ":"; +} +void DocbookGenerator::endConstraintType() +{ +DB_GEN_C + t << "" << endl; +} +void DocbookGenerator::startConstraintDocs() +{ +DB_GEN_C +} +void DocbookGenerator::endConstraintDocs() +{ +DB_GEN_C +} +void DocbookGenerator::endConstraintList() +{ +DB_GEN_C + t << "" << endl; +} diff --git a/src/docbookgen.h b/src/docbookgen.h index 866d056..3fafff1 100644 --- a/src/docbookgen.h +++ b/src/docbookgen.h @@ -15,6 +15,351 @@ #ifndef DOCBOOKGEN_H #define DOCBOOKGEN_H -void generateDocbook(); +#include "outputgen.h" + +void generateDocbook_v1(); + +class DocbookCodeGenerator : public CodeOutputInterface +{ + public: + DocbookCodeGenerator(FTextStream &t); + DocbookCodeGenerator(); + virtual ~DocbookCodeGenerator(); + void setTextStream(FTextStream &t) + { + m_streamSet = t.device()!=0; + m_t.setDevice(t.device()); + } + void setRelativePath(const QCString &path) { m_relPath = path; } + void setSourceFileName(const QCString &sourceFileName) { m_sourceFileName = sourceFileName; } + QCString sourceFileName() { return m_sourceFileName; } + + void codify(const char *text); + void writeCodeLink(const char *ref,const char *file, + const char *anchor,const char *name, + const char *tooltip); + void writeCodeLinkLine(const char *ref,const char *file, + const char *anchor,const char *name, + const char *tooltip); + void writeTooltip(const char *, const DocLinkInfo &, const char *, + const char *, const SourceLinkInfo &, const SourceLinkInfo & + ); + void startCodeLine(bool); + void endCodeLine(); + void startFontClass(const char *colorClass); + void endFontClass(); + void writeCodeAnchor(const char *); + void writeLineNumber(const char *extRef,const char *compId, + const char *anchorId,int l); + void setCurrentDoc(Definition *,const char *,bool); + void addWord(const char *,bool); + void finish(); + void startCodeFragment(); + void endCodeFragment(); + + private: + FTextStream m_t; + bool m_streamSet; + QCString m_refId; + QCString m_external; + int m_lineNumber; + int m_col; + bool m_insideCodeLine; + bool m_insideSpecialHL; + QCString m_relPath; + QCString m_sourceFileName; + bool m_prettyCode; +}; + + +#if 0 +// define for cases that have been implemented with an empty body +#define DB_GEN_EMPTY t << "\n"; +#else +#define DB_GEN_EMPTY +#endif + +#if 0 +// Generic debug statements +#define DB_GEN_H DB_GEN_H1(t) +#define DB_GEN_H1(x) x << "\n"; +#define DB_GEN_H2(y) DB_GEN_H2a(t,y) +#define DB_GEN_H2a(x,y) x << "\n"; +// define for cases that have NOT yet been implemented / considered +#define DB_GEN_NEW fprintf(stderr,"DBG_GEN_head %d\n",__LINE__); DB_GEN_H +#else +#define DB_GEN_H +#define DB_GEN_H1(x) +#define DB_GEN_H2(y) +#define DB_GEN_H2a(x,y) +#define DB_GEN_NEW +#endif + +class DocbookGenerator : public OutputGenerator +{ + public: + DocbookGenerator(); + ~DocbookGenerator(); + static void init(); + + /////////////////////////////////////////////////////////////// + // generic generator methods + /////////////////////////////////////////////////////////////// + void enable() + { if (genStack->top()) active=*genStack->top(); else active=TRUE; } + void disable() { active=FALSE; } + void enableIf(OutputType o) { if (o==Docbook) enable(); } + void disableIf(OutputType o) { if (o==Docbook) disable(); } + void disableIfNot(OutputType o) { if (o!=Docbook) disable(); } + bool isEnabled(OutputType o) { return (o==Docbook && active); } + OutputGenerator *get(OutputType o) { return (o==Docbook) ? this : 0; } + + // --- CodeOutputInterface + void codify(const char *text) + { m_codeGen.codify(text); } + void writeCodeLink(const char *ref, const char *file, + const char *anchor,const char *name, + const char *tooltip) + { m_codeGen.writeCodeLink(ref,file,anchor,name,tooltip); } + void writeLineNumber(const char *ref,const char *file,const char *anchor,int lineNumber) + { m_codeGen.writeLineNumber(ref,file,anchor,lineNumber); } + void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl, + const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo + ) + { m_codeGen.writeTooltip(id,docInfo,decl,desc,defInfo,declInfo); } + void startCodeLine(bool hasLineNumbers) + { m_codeGen.startCodeLine(hasLineNumbers); } + void endCodeLine() + { m_codeGen.endCodeLine(); } + void startFontClass(const char *s) + { m_codeGen.startFontClass(s); } + void endFontClass() + { m_codeGen.endFontClass(); } + void writeCodeAnchor(const char *anchor) + { m_codeGen.writeCodeAnchor(anchor); } + // --------------------------- + + void writeDoc(DocNode *,Definition *ctx,MemberDef *md); + + /////////////////////////////////////////////////////////////// + // structural output interface + /////////////////////////////////////////////////////////////// + void startFile(const char *name,const char *manName, + const char *title); + void writeSearchInfo(){DB_GEN_EMPTY}; + void writeFooter(const char *navPath){DB_GEN_NEW}; + void endFile(); + void startIndexSection(IndexSections); + void endIndexSection(IndexSections); + void writePageLink(const char *,bool); + void startProjectNumber(){DB_GEN_NEW}; + void endProjectNumber(){DB_GEN_NEW}; + void writeStyleInfo(int part){DB_GEN_EMPTY}; + void startTitleHead(const char *); + void endTitleHead(const char *fileName,const char *name); + void startIndexListItem(){DB_GEN_NEW}; + void endIndexListItem(){DB_GEN_NEW}; + void startIndexList(){DB_GEN_NEW}; + void endIndexList(){DB_GEN_NEW}; + void startIndexKey(){DB_GEN_NEW}; + void endIndexKey(){DB_GEN_NEW}; + void startIndexValue(bool){DB_GEN_NEW}; + void endIndexValue(const char *,bool){DB_GEN_NEW}; + void startItemList() {DB_GEN_EMPTY}; + void endItemList() {DB_GEN_EMPTY}; + + void startIndexItem(const char *ref,const char *file){DB_GEN_NEW}; + void endIndexItem(const char *ref,const char *file){DB_GEN_NEW}; + void startItemListItem() {DB_GEN_EMPTY}; + void endItemListItem() {DB_GEN_EMPTY}; + void docify(const char *text); + void writeChar(char); + void writeString(const char *); + void startParagraph(const char *); + void endParagraph(void); + void writeObjectLink(const char *,const char *,const char *,const char *); + void startHtmlLink(const char *){DB_GEN_NEW}; + void endHtmlLink(void){DB_GEN_NEW}; + void startBold(void); + void endBold(void); + void startTypewriter(void); + void endTypewriter(void); + void startEmphasis(void){DB_GEN_NEW}; + void endEmphasis(void){DB_GEN_NEW}; + void startCodeFragment(void); + void endCodeFragment(void); + void writeRuler(void); + void startDescription(void){DB_GEN_NEW}; + void endDescription(void){DB_GEN_NEW}; + void startDescItem(void){DB_GEN_NEW}; + void startDescForItem(void){DB_GEN_EMPTY}; + void endDescForItem(void){DB_GEN_EMPTY}; + void endDescItem(void){DB_GEN_NEW}; + void startCenter(void){DB_GEN_NEW}; + void endCenter(void){DB_GEN_NEW}; + void startSmall(void){DB_GEN_NEW}; + void endSmall(void){DB_GEN_NEW}; + void startExamples(void); + void endExamples(void); + void startParamList(BaseOutputDocInterface::ParamListTypes,const char *){DB_GEN_NEW}; + void endParamList(void){DB_GEN_NEW}; + void startTitle(void){DB_GEN_NEW}; + void endTitle(void){DB_GEN_NEW}; + void writeAnchor(const char *,const char *){DB_GEN_EMPTY}; + void startSection(const char *,const char *,SectionInfo::SectionType); + void endSection(const char *,SectionInfo::SectionType); + void lineBreak(const char *); + void addIndexItem(const char *,const char *); + void writeNonBreakableSpace(int); + void startDescTable(const char *); + void endDescTable(void); + void startDescTableRow(void); + void endDescTableRow(void); + void startDescTableTitle(void); + void endDescTableTitle(void); + void startDescTableData(void); + void endDescTableData(void); + void startTextLink(const char *,const char *){DB_GEN_NEW}; + void endTextLink(void){DB_GEN_NEW}; + void startPageRef(void){DB_GEN_NEW}; + void endPageRef(const char *,const char *){DB_GEN_NEW}; + void startSubsection(void){DB_GEN_NEW}; + void endSubsection(void){DB_GEN_NEW}; + void startSubsubsection(void); + void endSubsubsection(void); + + + void startGroupHeader(int); + void endGroupHeader(int); + void startMemberSections(){DB_GEN_EMPTY}; + void endMemberSections(){DB_GEN_EMPTY}; + void startHeaderSection(){DB_GEN_EMPTY}; + void endHeaderSection(){DB_GEN_EMPTY}; + void startMemberHeader(const char *anchor, int typ); + void endMemberHeader(); + void startMemberSubtitle(){DB_GEN_EMPTY}; + void endMemberSubtitle(){DB_GEN_EMPTY}; + void startMemberDocList(); + void endMemberDocList(); + void startMemberList(); + void endMemberList(); + void startInlineHeader(){DB_GEN_NEW}; + void endInlineHeader(){DB_GEN_NEW}; + void startAnonTypeScope(int){DB_GEN_EMPTY}; + void endAnonTypeScope(int){DB_GEN_EMPTY}; + void startMemberItem(const char *,int,const char *); + void endMemberItem(); + void startMemberTemplateParams(); + void endMemberTemplateParams(const char *,const char *); + void startMemberGroupHeader(bool); + void endMemberGroupHeader(); + void startMemberGroupDocs(){DB_GEN_EMPTY}; + void endMemberGroupDocs(){DB_GEN_EMPTY}; + void startMemberGroup(); + void endMemberGroup(bool); + void insertMemberAlign(bool){DB_GEN_EMPTY}; + void insertMemberAlignLeft(int,bool){DB_GEN_EMPTY}; + void startMemberDoc(const char *,const char *, + const char *,const char *,int,int,bool); + void endMemberDoc(bool); + void startDoxyAnchor(const char *fName,const char *manName, + const char *anchor,const char *name, + const char *args); + void endDoxyAnchor(const char *fileName,const char *anchor); + void writeLatexSpacing(){DB_GEN_EMPTY} + void writeStartAnnoItem(const char *type,const char *file, + const char *path,const char *name){DB_GEN_NEW}; + void writeEndAnnoItem(const char *name){DB_GEN_NEW}; + void startMemberDescription(const char *anchor,const char *inheritId, bool typ){DB_GEN_EMPTY}; + void endMemberDescription(){DB_GEN_EMPTY}; + void startMemberDeclaration(){DB_GEN_EMPTY}; + void endMemberDeclaration(const char *anchor,const char *inheritId){DB_GEN_EMPTY}; + void writeInheritedSectionTitle(const char *id,const char *ref, + const char *file,const char *anchor, + const char *title,const char *name){DB_GEN_NEW}; + void startIndent(){DB_GEN_EMPTY}; + void endIndent(){DB_GEN_EMPTY}; + void writeSynopsis(){DB_GEN_EMPTY}; + void startClassDiagram(); + void endClassDiagram(const ClassDiagram &,const char *,const char *); + void startDotGraph(); + void endDotGraph(const DotClassGraph &g); + void startInclDepGraph(); + void endInclDepGraph(const DotInclDepGraph &g); + void startGroupCollaboration(); + void endGroupCollaboration(const DotGroupCollaboration &g); + void startCallGraph(); + void endCallGraph(const DotCallGraph &g); + void startDirDepGraph(); + void endDirDepGraph(const DotDirDeps &g); + void writeGraphicalHierarchy(const DotGfxHierarchyTable &g){DB_GEN_NEW}; + void startQuickIndices(){DB_GEN_EMPTY}; + void endQuickIndices(){DB_GEN_EMPTY}; + void writeSplitBar(const char *){DB_GEN_EMPTY}; + void writeNavigationPath(const char *){DB_GEN_NEW}; + void writeLogo(){DB_GEN_NEW}; + void writeQuickLinks(bool compact,HighlightedItem hli,const char *file){DB_GEN_EMPTY}; + void writeSummaryLink(const char *file,const char *anchor,const char *title,bool first){DB_GEN_EMPTY}; + void startContents(){DB_GEN_EMPTY}; + void endContents(){DB_GEN_EMPTY}; + void startPageDoc(const char *pageTitle){DB_GEN_EMPTY} + void endPageDoc() {DB_GEN_EMPTY} + void startTextBlock(bool); + void endTextBlock(bool); + void lastIndexPage(){DB_GEN_EMPTY}; + void startMemberDocPrefixItem(); + void endMemberDocPrefixItem(); + void startMemberDocName(bool); + void endMemberDocName(); + void startParameterType(bool,const char *key){DB_GEN_EMPTY}; + void endParameterType(){DB_GEN_EMPTY}; + void startParameterName(bool); + void endParameterName(bool,bool,bool); + void startParameterList(bool); + void endParameterList(); + void exceptionEntry(const char*,bool); + + void startConstraintList(const char *); + void startConstraintParam(); + void endConstraintParam(); + void startConstraintType(); + void endConstraintType(); + void startConstraintDocs(); + void endConstraintDocs(); + void endConstraintList(); + + void startMemberDocSimple(bool){DB_GEN_NEW}; + void endMemberDocSimple(bool){DB_GEN_NEW}; + void startInlineMemberType(){DB_GEN_NEW}; + void endInlineMemberType(){DB_GEN_NEW}; + void startInlineMemberName(){DB_GEN_NEW}; + void endInlineMemberName(){DB_GEN_NEW}; + void startInlineMemberDoc(){DB_GEN_NEW}; + void endInlineMemberDoc(){DB_GEN_NEW}; + + void startLabels(); + void writeLabel(const char *,bool); + void endLabels(); + + void setCurrentDoc(Definition *,const char *,bool) {DB_GEN_EMPTY} + void addWord(const char *,bool) {DB_GEN_EMPTY} + +private: + DocbookGenerator(const DocbookGenerator &o); + DocbookGenerator &operator=(const DocbookGenerator &o); + + QCString relPath; + DocbookCodeGenerator m_codeGen; + bool m_prettyCode = FALSE; + bool m_denseText = FALSE; + bool m_inGroup = FALSE; + bool m_inDetail = FALSE; + int m_levelListItem = 0; + bool m_inListItem[20]; + bool m_inSimpleSect[20]; + bool m_descTable = FALSE; + int m_inLevel = -1; + bool m_firstMember = FALSE; +}; #endif diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index b83317c..da84931 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -36,17 +36,34 @@ #include "htmlentity.h" #include "plantuml.h" -static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height) +#if 0 +#define DB_VIS_C DB_VIS_C1(m_t) +#define DB_VIS_C1(x) x << "\n"; +#define DB_VIS_C2(y) DB_VIS_C2a(m_t,y) +#define DB_VIS_C2a(x,y) x << "\n"; +#else +#define DB_VIS_C +#define DB_VIS_C1(x) +#define DB_VIS_C2(y) +#define DB_VIS_C2a(x,y) +#endif +void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height) { QCString tmpStr; - t << "
    " << endl; - t << " " << endl; + if (hasCaption) + { + t << "
    " << endl; + } + else + { + t << " " << endl; + } t << " " << endl; t << " " << endl; t << " "; + t << " align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << name << "\">"; t << "" << endl; t << " " << endl; if (hasCaption) { - t << " " << endl; + t << " " << endl; } } -static void visitPostEnd(FTextStream &t, const bool hasCaption) +void visitPostEnd(FTextStream &t, const bool hasCaption) { t << endl; if (hasCaption) { - t << " </caption>" << endl; + t << " " << endl; } t << " " << endl; - t << "
    " << endl; + if (hasCaption) + { + t << "
    " << endl; + } + else + { + t << " " << endl; + } } static void visitCaption(DocbookDocVisitor *parent, QList children) @@ -86,6 +110,13 @@ static void visitCaption(DocbookDocVisitor *parent, QList children) DocbookDocVisitor::DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci) : DocVisitor(DocVisitor_Docbook), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE) { +DB_VIS_C + // m_t << "
    " << endl; +} +DocbookDocVisitor::~DocbookDocVisitor() +{ +DB_VIS_C + // m_t << "
    " << endl; } //-------------------------------------- @@ -94,12 +125,14 @@ DocbookDocVisitor::DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci) void DocbookDocVisitor::visit(DocWord *w) { +DB_VIS_C if (m_hide) return; filter(w->word()); } void DocbookDocVisitor::visit(DocLinkedWord *w) { +DB_VIS_C if (m_hide) return; startLink(w->file(),w->anchor()); filter(w->word()); @@ -108,6 +141,7 @@ void DocbookDocVisitor::visit(DocLinkedWord *w) void DocbookDocVisitor::visit(DocWhiteSpace *w) { +DB_VIS_C if (m_hide) return; if (m_insidePre) { @@ -121,6 +155,7 @@ void DocbookDocVisitor::visit(DocWhiteSpace *w) void DocbookDocVisitor::visit(DocSymbol *s) { +DB_VIS_C if (m_hide) return; const char *res = HtmlEntityMapper::instance()->docbook(s->symbol()); if (res) @@ -135,6 +170,7 @@ void DocbookDocVisitor::visit(DocSymbol *s) void DocbookDocVisitor::visit(DocURL *u) { +DB_VIS_C if (m_hide) return; m_t << "isEmail()) m_t << "mailto:"; @@ -146,12 +182,16 @@ void DocbookDocVisitor::visit(DocURL *u) void DocbookDocVisitor::visit(DocLineBreak *) { +DB_VIS_C if (m_hide) return; - m_t << endl << "\n" << endl; + m_t << endl << "  " << endl; + // gives nicer results but gives problems as it is not allowed in and also problems with dblatex + // m_t << endl << "" << endl; } void DocbookDocVisitor::visit(DocHorRuler *) { +DB_VIS_C if (m_hide) return; m_t << "\n"; m_t << "\n"; @@ -159,6 +199,7 @@ void DocbookDocVisitor::visit(DocHorRuler *) void DocbookDocVisitor::visit(DocStyleChange *s) { +DB_VIS_C if (m_hide) return; switch (s->style()) { @@ -205,6 +246,7 @@ void DocbookDocVisitor::visit(DocStyleChange *s) void DocbookDocVisitor::visit(DocVerbatim *s) { +DB_VIS_C if (m_hide) return; SrcLangExt langExt = getLanguageFromFileName(m_langExt); switch(s->type()) @@ -217,9 +259,9 @@ void DocbookDocVisitor::visit(DocVerbatim *s) m_t << ""; break; case DocVerbatim::Verbatim: - m_t << ""; + m_t << ""; filter(s->text()); - m_t << ""; + m_t << ""; break; case DocVerbatim::HtmlOnly: break; @@ -232,7 +274,6 @@ void DocbookDocVisitor::visit(DocVerbatim *s) case DocVerbatim::XmlOnly: break; case DocVerbatim::DocbookOnly: - break; m_t << s->text(); break; case DocVerbatim::Dot: @@ -304,12 +345,14 @@ void DocbookDocVisitor::visit(DocVerbatim *s) void DocbookDocVisitor::visit(DocAnchor *anc) { +DB_VIS_C if (m_hide) return; - m_t << "file() << "_1" << anc->anchor() << "\"/>"; + m_t << "file()) << "_1" << anc->anchor() << "\"/>"; } void DocbookDocVisitor::visit(DocInclude *inc) { +DB_VIS_C if (m_hide) return; SrcLangExt langExt = getLanguageFromFileName(inc->extension()); switch(inc->type()) @@ -345,9 +388,9 @@ void DocbookDocVisitor::visit(DocInclude *inc) case DocInclude::LatexInclude: break; case DocInclude::VerbInclude: - m_t << ""; + m_t << ""; filter(inc->text()); - m_t << ""; + m_t << ""; break; case DocInclude::Snippet: m_t << ""; @@ -393,6 +436,7 @@ void DocbookDocVisitor::visit(DocInclude *inc) void DocbookDocVisitor::visit(DocIncOperator *op) { +DB_VIS_C if (op->isFirst()) { if (!m_hide) @@ -429,27 +473,37 @@ void DocbookDocVisitor::visit(DocIncOperator *op) void DocbookDocVisitor::visit(DocFormula *f) { +DB_VIS_C if (m_hide) return; - m_t << "" << f->name() << ""; - filter(f->text()); - m_t << ""; + + if (f->isInline()) m_t << "" << endl; + else m_t << " " << endl; + m_t << " " << endl; + m_t << " relPath() << f->name() << ".png\"/>" << endl; + m_t << " " << endl; + if (f->isInline()) m_t << "" << endl; + else m_t << " " << endl; } void DocbookDocVisitor::visit(DocIndexEntry *ie) { +DB_VIS_C if (m_hide) return; - m_t << "" << endl; + m_t << ""; filter(ie->entry()); - m_t << "" << endl; + m_t << "" << endl; } void DocbookDocVisitor::visit(DocSimpleSectSep *) { - m_t << ""; +DB_VIS_C + // m_t << ""; } void DocbookDocVisitor::visit(DocCite *cite) { +DB_VIS_C if (m_hide) return; if (!cite->file().isEmpty()) startLink(cite->file(),cite->anchor()); filter(cite->text()); @@ -462,6 +516,7 @@ void DocbookDocVisitor::visit(DocCite *cite) void DocbookDocVisitor::visitPre(DocAutoList *l) { +DB_VIS_C if (m_hide) return; if (l->isEnumList()) { @@ -475,6 +530,7 @@ void DocbookDocVisitor::visitPre(DocAutoList *l) void DocbookDocVisitor::visitPost(DocAutoList *l) { +DB_VIS_C if (m_hide) return; if (l->isEnumList()) { @@ -488,18 +544,21 @@ void DocbookDocVisitor::visitPost(DocAutoList *l) void DocbookDocVisitor::visitPre(DocAutoListItem *) { +DB_VIS_C if (m_hide) return; m_t << ""; } void DocbookDocVisitor::visitPost(DocAutoListItem *) { +DB_VIS_C if (m_hide) return; m_t << ""; } void DocbookDocVisitor::visitPre(DocPara *) { +DB_VIS_C if (m_hide) return; m_t << endl; m_t << ""; @@ -507,6 +566,7 @@ void DocbookDocVisitor::visitPre(DocPara *) void DocbookDocVisitor::visitPost(DocPara *) { +DB_VIS_C if (m_hide) return; m_t << ""; m_t << endl; @@ -514,16 +574,19 @@ void DocbookDocVisitor::visitPost(DocPara *) void DocbookDocVisitor::visitPre(DocRoot *) { +DB_VIS_C //m_t << "

    New parser:

    \n"; } void DocbookDocVisitor::visitPost(DocRoot *) { +DB_VIS_C //m_t << "

    Old parser:

    \n"; } void DocbookDocVisitor::visitPre(DocSimpleSect *s) { +DB_VIS_C if (m_hide) return; switch(s->type()) { @@ -534,7 +597,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trSeeAlso()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trSeeAlso()) << ": " << endl; } break; case DocSimpleSect::Return: @@ -544,7 +607,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trReturns()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trReturns()) << ": " << endl; } break; case DocSimpleSect::Author: @@ -554,7 +617,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trAuthor(TRUE, TRUE)) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << ": " << endl; } break; case DocSimpleSect::Authors: @@ -564,7 +627,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trAuthor(TRUE, FALSE)) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << ": " << endl; } break; case DocSimpleSect::Version: @@ -574,7 +637,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trVersion()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trVersion()) << ": " << endl; } break; case DocSimpleSect::Since: @@ -584,7 +647,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trSince()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trSince()) << ": " << endl; } break; case DocSimpleSect::Date: @@ -594,27 +657,27 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trDate()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trDate()) << ": " << endl; } break; case DocSimpleSect::Note: if (m_insidePre) { - m_t << "" << theTranslator->trNote() << ": " << endl; + m_t << "" << theTranslator->trNote() << ": " << endl; } else { - m_t << "" << convertToXML(theTranslator->trNote()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trNote()) << ": " << endl; } break; case DocSimpleSect::Warning: if (m_insidePre) { - m_t << "" << theTranslator->trWarning() << ": " << endl; + m_t << "" << theTranslator->trWarning() << ": " << endl; } else { - m_t << "" << convertToXML(theTranslator->trWarning()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trWarning()) << ": " << endl; } break; case DocSimpleSect::Pre: @@ -624,7 +687,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trPrecondition()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trPrecondition()) << ": " << endl; } break; case DocSimpleSect::Post: @@ -634,7 +697,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trPostcondition()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trPostcondition()) << ": " << endl; } break; case DocSimpleSect::Copyright: @@ -644,7 +707,7 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trCopyright()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trCopyright()) << ": " << endl; } break; case DocSimpleSect::Invar: @@ -654,85 +717,121 @@ void DocbookDocVisitor::visitPre(DocSimpleSect *s) } else { - m_t << "" << convertToXML(theTranslator->trInvariant()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trInvariant()) << ": " << endl; } break; case DocSimpleSect::Remark: + // is miising the possibility if (m_insidePre) { m_t << "<formalpara><title>" << theTranslator->trRemarks() << ": " << endl; } else { - m_t << "" << convertToXML(theTranslator->trRemarks()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trRemarks()) << ": " << endl; } break; case DocSimpleSect::Attention: if (m_insidePre) { - m_t << "" << theTranslator->trAttention() << ": " << endl; + m_t << "" << theTranslator->trAttention() << ": " << endl; } else { - m_t << "" << convertToXML(theTranslator->trAttention()) << ": " << endl; + m_t << "" << convertToDocBook(theTranslator->trAttention()) << ": " << endl; } break; case DocSimpleSect::User: - m_t << "" << endl; + if (s->hasTitle()) + m_t << "" << endl; + else + m_t << "" << endl; break; case DocSimpleSect::Rcs: - m_t << "" << endl; + case DocSimpleSect::Unknown: + m_t << "" << endl; break; - case DocSimpleSect::Unknown: m_t << "" << endl; break; } } -void DocbookDocVisitor::visitPost(DocSimpleSect *) +void DocbookDocVisitor::visitPost(DocSimpleSect *s) { +DB_VIS_C if (m_hide) return; - m_t << "" << endl; + switch(s->type()) + { + case DocSimpleSect::Rcs: + case DocSimpleSect::Unknown: + m_t << "" << endl; + break; + case DocSimpleSect::User: + if (s->hasTitle()) + m_t << "" << endl; + else + m_t << "" << endl; + break; + case DocSimpleSect::Note: + m_t << "" << endl; + break; + case DocSimpleSect::Attention: + m_t << "" << endl; + break; + case DocSimpleSect::Warning: + m_t << "" << endl; + break; + default: + m_t << "" << endl; + break; + } } -void DocbookDocVisitor::visitPre(DocTitle *) +void DocbookDocVisitor::visitPre(DocTitle *t) { +DB_VIS_C if (m_hide) return; - m_t << ""; + if (t->hasTitle()) m_t << "<title>"; } -void DocbookDocVisitor::visitPost(DocTitle *) +void DocbookDocVisitor::visitPost(DocTitle *t) { +DB_VIS_C if (m_hide) return; - m_t << ""; + if (t->hasTitle()) m_t << ""; } void DocbookDocVisitor::visitPre(DocSimpleList *) { +DB_VIS_C if (m_hide) return; m_t << "\n"; } void DocbookDocVisitor::visitPost(DocSimpleList *) { +DB_VIS_C if (m_hide) return; m_t << "\n"; } void DocbookDocVisitor::visitPre(DocSimpleListItem *) { +DB_VIS_C if (m_hide) return; m_t << ""; } void DocbookDocVisitor::visitPost(DocSimpleListItem *) { +DB_VIS_C if (m_hide) return; m_t << "\n"; } void DocbookDocVisitor::visitPre(DocSection *s) { +DB_VIS_C if (m_hide) return; - m_t << "
    file(); + m_t << "
    file()); if (!s->anchor().isEmpty()) m_t << "_1" << s->anchor(); m_t << "\">" << endl; m_t << ""; @@ -742,11 +841,13 @@ void DocbookDocVisitor::visitPre(DocSection *s) void DocbookDocVisitor::visitPost(DocSection *) { +DB_VIS_C m_t << "</section>\n"; } void DocbookDocVisitor::visitPre(DocHtmlList *s) { +DB_VIS_C if (m_hide) return; if (s->type()==DocHtmlList::Ordered) m_t << "<orderedlist>\n"; @@ -756,6 +857,7 @@ void DocbookDocVisitor::visitPre(DocHtmlList *s) void DocbookDocVisitor::visitPost(DocHtmlList *s) { +DB_VIS_C if (m_hide) return; if (s->type()==DocHtmlList::Ordered) m_t << "</orderedlist>\n"; @@ -765,143 +867,276 @@ void DocbookDocVisitor::visitPost(DocHtmlList *s) void DocbookDocVisitor::visitPre(DocHtmlListItem *) { +DB_VIS_C if (m_hide) return; m_t << "<listitem>\n"; } void DocbookDocVisitor::visitPost(DocHtmlListItem *) { +DB_VIS_C if (m_hide) return; m_t << "</listitem>\n"; } void DocbookDocVisitor::visitPre(DocHtmlDescList *) { +DB_VIS_C if (m_hide) return; m_t << "<variablelist>\n"; } void DocbookDocVisitor::visitPost(DocHtmlDescList *) { +DB_VIS_C if (m_hide) return; m_t << "</variablelist>\n"; } void DocbookDocVisitor::visitPre(DocHtmlDescTitle *) { +DB_VIS_C if (m_hide) return; m_t << "<varlistentry><term>"; } void DocbookDocVisitor::visitPost(DocHtmlDescTitle *) { +DB_VIS_C if (m_hide) return; m_t << "</term>\n"; } void DocbookDocVisitor::visitPre(DocHtmlDescData *) { +DB_VIS_C if (m_hide) return; m_t << "<listitem>"; } void DocbookDocVisitor::visitPost(DocHtmlDescData *) { +DB_VIS_C if (m_hide) return; m_t << "</listitem></varlistentry>\n"; } +static int colCnt = 0; +static bool bodySet = FALSE; // it is possible to have tables without a header void DocbookDocVisitor::visitPre(DocHtmlTable *t) { +DB_VIS_C + bodySet = FALSE; if (m_hide) return; - m_t << "<table frame=\"all\">" << endl; - m_t << " <title>" << endl; + m_t << "" << endl; m_t << " numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">" << endl; - m_t << " " << endl; + for (int i = 0; i numColumns(); i++) + { + // do something with colwidth based of cell width specification (be aware of possible colspan in the header)? + m_t << " \n"; + } } void DocbookDocVisitor::visitPost(DocHtmlTable *) { +DB_VIS_C if (m_hide) return; m_t << " " << endl; m_t << " " << endl; - m_t << "" << endl; + m_t << "" << endl; } -void DocbookDocVisitor::visitPre(DocHtmlRow *) +void DocbookDocVisitor::visitPre(DocHtmlRow *tr) { +DB_VIS_C + colCnt = 0; if (m_hide) return; - m_t << "\n"; + + if (tr->isHeading()) m_t << "\n"; + else if (!bodySet) + { + bodySet = TRUE; + m_t << "\n"; + } + + m_t << " attribs()); + HtmlAttrib *opt; + for (li.toFirst();(opt=li.current());++li) + { + if (opt->name=="class") + { + // just skip it + } + else if (opt->name=="style") + { + // just skip it + } + else if (opt->name=="height") + { + // just skip it + } + else if (opt->name=="filter") + { + // just skip it + } + else + { + m_t << " " << opt->name << "='" << opt->value << "'"; + } + } + m_t << ">\n"; } -void DocbookDocVisitor::visitPost(DocHtmlRow *) +void DocbookDocVisitor::visitPost(DocHtmlRow *tr) { +DB_VIS_C if (m_hide) return; m_t << "\n"; + if (tr->isHeading()) + { + bodySet = TRUE; + m_t << "\n"; + } } -void DocbookDocVisitor::visitPre(DocHtmlCell *) +void DocbookDocVisitor::visitPre(DocHtmlCell *c) { +DB_VIS_C + colCnt++; if (m_hide) return; - m_t << ""; + m_t << "attribs()); + HtmlAttrib *opt; + for (li.toFirst();(opt=li.current());++li) + { + if (opt->name=="colspan") + { + m_t << " namest='c" << colCnt << "'"; + int cols = opt->value.toInt(); + colCnt += (cols - 1); + m_t << " nameend='c" << colCnt << "'"; + } + else if (opt->name=="rowspan") + { + int extraRows = opt->value.toInt() - 1; + m_t << " morerows='" << extraRows << "'"; + } + else if (opt->name=="class") + { + if (opt->value == "markdownTableBodyRight") + { + m_t << " align='right'"; + } + else if (opt->value == "markdownTableBodyLeftt") + { + m_t << " align='left'"; + } + else if (opt->value == "markdownTableBodyCenter") + { + m_t << " align='center'"; + } + else if (opt->value == "markdownTableHeadRight") + { + m_t << " align='right'"; + } + else if (opt->value == "markdownTableHeadLeftt") + { + m_t << " align='left'"; + } + else if (opt->value == "markdownTableHeadCenter") + { + m_t << " align='center'"; + } + } + else if (opt->name=="style") + { + // just skip it + } + else if (opt->name=="width") + { + // just skip it + } + else if (opt->name=="height") + { + // just skip it + } + else + { + m_t << " " << opt->name << "='" << opt->value << "'"; + } + } + m_t << ">"; } -void DocbookDocVisitor::visitPost(DocHtmlCell *) +void DocbookDocVisitor::visitPost(DocHtmlCell *c) { +DB_VIS_C if (m_hide) return; m_t << ""; } -void DocbookDocVisitor::visitPre(DocHtmlCaption *) +void DocbookDocVisitor::visitPre(DocHtmlCaption *c) { +DB_VIS_C if (m_hide) return; - m_t << ""; + m_t << ""; } void DocbookDocVisitor::visitPost(DocHtmlCaption *) { +DB_VIS_C if (m_hide) return; m_t << "\n"; } void DocbookDocVisitor::visitPre(DocInternal *) { +DB_VIS_C if (m_hide) return; // TODO: to be implemented } void DocbookDocVisitor::visitPost(DocInternal *) { +DB_VIS_C if (m_hide) return; // TODO: to be implemented } void DocbookDocVisitor::visitPre(DocHRef *href) { +DB_VIS_C if (m_hide) return; - m_t << "url() << "\">"; + m_t << "url()) << "\">"; } void DocbookDocVisitor::visitPost(DocHRef *) { +DB_VIS_C if (m_hide) return; m_t << ""; } void DocbookDocVisitor::visitPre(DocHtmlHeader *) { +DB_VIS_C if (m_hide) return; m_t << ""; } void DocbookDocVisitor::visitPost(DocHtmlHeader *) { +DB_VIS_C if (m_hide) return; m_t << "\n"; } void DocbookDocVisitor::visitPre(DocImage *img) { +DB_VIS_C if (img->type()==DocImage::DocBook) { if (m_hide) return; @@ -912,7 +1147,7 @@ void DocbookDocVisitor::visitPre(DocImage *img) { baseName=baseName.right(baseName.length()-i-1); } - visitPreStart(m_t, img -> hasCaption(), baseName, img -> width(), img -> height()); + visitPreStart(m_t, img -> hasCaption(), img->relPath() + baseName, img -> width(), img -> height()); } else { @@ -923,6 +1158,7 @@ void DocbookDocVisitor::visitPre(DocImage *img) void DocbookDocVisitor::visitPost(DocImage *img) { +DB_VIS_C if (img->type()==DocImage::DocBook) { if (m_hide) return; @@ -963,96 +1199,118 @@ void DocbookDocVisitor::visitPost(DocImage *img) void DocbookDocVisitor::visitPre(DocDotFile *df) { +DB_VIS_C if (m_hide) return; startDotFile(df->file(),df->width(),df->height(),df->hasCaption()); } void DocbookDocVisitor::visitPost(DocDotFile *df) { +DB_VIS_C if (m_hide) return; endDotFile(df->hasCaption()); } void DocbookDocVisitor::visitPre(DocMscFile *df) { +DB_VIS_C if (m_hide) return; startMscFile(df->file(),df->width(),df->height(),df->hasCaption()); } void DocbookDocVisitor::visitPost(DocMscFile *df) { +DB_VIS_C if (m_hide) return; endMscFile(df->hasCaption()); } void DocbookDocVisitor::visitPre(DocDiaFile *df) { +DB_VIS_C if (m_hide) return; startDiaFile(df->file(),df->width(),df->height(),df->hasCaption()); } void DocbookDocVisitor::visitPost(DocDiaFile *df) { +DB_VIS_C if (m_hide) return; endDiaFile(df->hasCaption()); } void DocbookDocVisitor::visitPre(DocLink *lnk) { +DB_VIS_C if (m_hide) return; startLink(lnk->file(),lnk->anchor()); } void DocbookDocVisitor::visitPost(DocLink *) { +DB_VIS_C if (m_hide) return; endLink(); } void DocbookDocVisitor::visitPre(DocRef *ref) { +DB_VIS_C if (m_hide) return; - if (!ref->file().isEmpty()) startLink(ref->file(),ref->anchor()); + if (ref->isSubPage()) + { + startLink(0,ref->anchor()); + } + else + { + if (!ref->file().isEmpty()) startLink(ref->file(),ref->anchor()); + } + if (!ref->hasLinkText()) filter(ref->targetTitle()); } void DocbookDocVisitor::visitPost(DocRef *ref) { +DB_VIS_C if (m_hide) return; if (!ref->file().isEmpty()) endLink(); } void DocbookDocVisitor::visitPre(DocSecRefItem *ref) { +DB_VIS_C if (m_hide) return; - m_t << "file() << "_1" << ref->anchor() << "\">"; + //m_t << "file()) << "_1" << ref->anchor() << "\">"; + m_t << ""; } void DocbookDocVisitor::visitPost(DocSecRefItem *) { +DB_VIS_C if (m_hide) return; - m_t << "" << endl; + m_t << "" << endl; } void DocbookDocVisitor::visitPre(DocSecRefList *) { +DB_VIS_C if (m_hide) return; - m_t << "" << endl; + m_t << "" << endl; } void DocbookDocVisitor::visitPost(DocSecRefList *) { +DB_VIS_C if (m_hide) return; - m_t << "" << endl; + m_t << "" << endl; } void DocbookDocVisitor::visitPre(DocParamSect *s) { +DB_VIS_C if (m_hide) return; m_t << endl; m_t << " " << endl; - m_t << " " << endl; - m_t << " <table frame=\"all\">" << endl; - m_t << " <title>"; + m_t << " <title>" << endl; switch(s->type()) { case DocParamSect::Param: m_t << theTranslator->trParameters(); break; @@ -1062,29 +1320,96 @@ void DocbookDocVisitor::visitPre(DocParamSect *s) default: ASSERT(0); } - m_t << " " << endl; - m_t << " " << endl; - m_t << " " << endl; - m_t << " " << endl; + m_t << " " << endl; + m_t << " " << endl; + m_t << " " << endl; + int ncols = 2; + if (s->type() == DocParamSect::Param) + { + bool hasInOutSpecs = s->hasInOutSpecifier(); + bool hasTypeSpecs = s->hasTypeSpecifier(); + if (hasInOutSpecs && hasTypeSpecs) ncols += 2; + else if (hasInOutSpecs || hasTypeSpecs) ncols += 1; + } + m_t << " " << endl; + for (int i = 1; i <= ncols; i++) + { + if (i == ncols) m_t << " " << endl; + else m_t << " " << endl; + } m_t << " " << endl; } void DocbookDocVisitor::visitPost(DocParamSect *) { +DB_VIS_C if (m_hide) return; m_t << " " << endl; m_t << " " << endl; m_t << "
    " << endl; + m_t << "
    " << endl; m_t << "
    " << endl; m_t << " "; } void DocbookDocVisitor::visitPre(DocParamList *pl) { +DB_VIS_C if (m_hide) return; + m_t << " " << endl; + + DocParamSect::Type parentType = DocParamSect::Unknown; + DocParamSect *sect = 0; + if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect) + { + parentType = ((DocParamSect*)pl->parent())->type(); + sect=(DocParamSect*)pl->parent(); + } + + if (sect && sect->hasInOutSpecifier()) + { + m_t << " "; + if (pl->direction()!=DocParamSect::Unspecified) + { + if (pl->direction()==DocParamSect::In) + { + m_t << "in"; + } + else if (pl->direction()==DocParamSect::Out) + { + m_t << "out"; + } + else if (pl->direction()==DocParamSect::InOut) + { + m_t << "in,out"; + } + } + m_t << " "; + } + + if (sect && sect->hasTypeSpecifier()) + { + QListIterator li(pl->paramTypes()); + DocNode *type; + bool first=TRUE; + m_t << " "; + for (li.toFirst();(type=li.current());++li) + { + if (!first) m_t << " | "; else first=FALSE; + if (type->kind()==DocNode::Kind_Word) + { + visit((DocWord*)type); + } + else if (type->kind()==DocNode::Kind_LinkedWord) + { + visit((DocLinkedWord*)type); + } + } + m_t << " "; + } + QListIterator li(pl->parameters()); DocNode *param; - m_t << " " << endl; if (!li.toFirst()) { m_t << " " << endl; @@ -1116,6 +1441,7 @@ void DocbookDocVisitor::visitPre(DocParamList *pl) void DocbookDocVisitor::visitPost(DocParamList *) { +DB_VIS_C if (m_hide) return; m_t << "" << endl; m_t << " " << endl; @@ -1123,10 +1449,11 @@ void DocbookDocVisitor::visitPost(DocParamList *) void DocbookDocVisitor::visitPre(DocXRefItem *x) { +DB_VIS_C if (m_hide) return; if (x->title().isEmpty()) return; - m_t << "file() << "_1" << x->anchor(); + m_t << "file()) << "_1" << x->anchor(); m_t << "\">"; filter(x->title()); m_t << ""; @@ -1135,6 +1462,7 @@ void DocbookDocVisitor::visitPre(DocXRefItem *x) void DocbookDocVisitor::visitPost(DocXRefItem *x) { +DB_VIS_C if (m_hide) return; if (x->title().isEmpty()) return; m_t << ""; @@ -1142,12 +1470,14 @@ void DocbookDocVisitor::visitPost(DocXRefItem *x) void DocbookDocVisitor::visitPre(DocInternalRef *ref) { +DB_VIS_C if (m_hide) return; startLink(ref->file(),ref->anchor()); } void DocbookDocVisitor::visitPost(DocInternalRef *) { +DB_VIS_C if (m_hide) return; endLink(); m_t << " "; @@ -1155,6 +1485,7 @@ void DocbookDocVisitor::visitPost(DocInternalRef *) void DocbookDocVisitor::visitPre(DocCopy *) { +DB_VIS_C if (m_hide) return; // TODO: to be implemented } @@ -1162,6 +1493,7 @@ void DocbookDocVisitor::visitPre(DocCopy *) void DocbookDocVisitor::visitPost(DocCopy *) { +DB_VIS_C if (m_hide) return; // TODO: to be implemented } @@ -1169,72 +1501,89 @@ void DocbookDocVisitor::visitPost(DocCopy *) void DocbookDocVisitor::visitPre(DocText *) { +DB_VIS_C // TODO: to be implemented } void DocbookDocVisitor::visitPost(DocText *) { +DB_VIS_C // TODO: to be implemented } void DocbookDocVisitor::visitPre(DocHtmlBlockQuote *) { +DB_VIS_C if (m_hide) return; m_t << "
    "; } void DocbookDocVisitor::visitPost(DocHtmlBlockQuote *) { +DB_VIS_C if (m_hide) return; m_t << "
    "; } void DocbookDocVisitor::visitPre(DocVhdlFlow *) { +DB_VIS_C // TODO: to be implemented } void DocbookDocVisitor::visitPost(DocVhdlFlow *) { +DB_VIS_C // TODO: to be implemented } void DocbookDocVisitor::visitPre(DocParBlock *) { +DB_VIS_C } void DocbookDocVisitor::visitPost(DocParBlock *) { +DB_VIS_C } void DocbookDocVisitor::filter(const char *str) { - m_t << convertToXML(str); +DB_VIS_C + m_t << convertToDocBook(str); } void DocbookDocVisitor::startLink(const QCString &file,const QCString &anchor) { - m_t << ""; } void DocbookDocVisitor::endLink() { +DB_VIS_C m_t << ""; } void DocbookDocVisitor::pushEnabled() { +DB_VIS_C m_enabled.push(new bool(m_hide)); } void DocbookDocVisitor::popEnabled() { +DB_VIS_C bool *v=m_enabled.pop(); ASSERT(v!=0); m_hide = *v; @@ -1243,6 +1592,7 @@ void DocbookDocVisitor::popEnabled() void DocbookDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s) { +DB_VIS_C QCString shortName = baseName; int i; if ((i=shortName.findRev('/'))!=-1) @@ -1251,13 +1601,14 @@ void DocbookDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s) } QCString outDir = Config_getString(DOCBOOK_OUTPUT); writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_BITMAP); - visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height()); + visitPreStart(m_t, s->hasCaption(), s->relPath() + shortName + ".png", s->width(),s->height()); visitCaption(this, s->children()); visitPostEnd(m_t, s->hasCaption()); } void DocbookDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim *s) { +DB_VIS_C QCString shortName = baseName; int i; if ((i=shortName.findRev('/'))!=-1) @@ -1266,7 +1617,7 @@ void DocbookDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim } QCString outDir = Config_getString(DOCBOOK_OUTPUT); generatePlantUMLOutput(baseName,outDir,PUML_BITMAP); - visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height()); + visitPreStart(m_t, s->hasCaption(), s->relPath() + shortName + ".png", s->width(),s->height()); visitCaption(this, s->children()); visitPostEnd(m_t, s->hasCaption()); } @@ -1277,6 +1628,7 @@ void DocbookDocVisitor::startMscFile(const QCString &fileName, bool hasCaption ) { +DB_VIS_C QCString baseName=fileName; int i; if ((i=baseName.findRev('/'))!=-1) @@ -1296,6 +1648,7 @@ void DocbookDocVisitor::startMscFile(const QCString &fileName, void DocbookDocVisitor::endMscFile(bool hasCaption) { +DB_VIS_C if (m_hide) return; visitPostEnd(m_t, hasCaption); m_t << "
    " << endl; @@ -1303,6 +1656,7 @@ void DocbookDocVisitor::endMscFile(bool hasCaption) void DocbookDocVisitor::writeDiaFile(const QCString &baseName, DocVerbatim *s) { +DB_VIS_C QCString shortName = baseName; int i; if ((i=shortName.findRev('/'))!=-1) @@ -1322,6 +1676,7 @@ void DocbookDocVisitor::startDiaFile(const QCString &fileName, bool hasCaption ) { +DB_VIS_C QCString baseName=fileName; int i; if ((i=baseName.findRev('/'))!=-1) @@ -1341,6 +1696,7 @@ void DocbookDocVisitor::startDiaFile(const QCString &fileName, void DocbookDocVisitor::endDiaFile(bool hasCaption) { +DB_VIS_C if (m_hide) return; visitPostEnd(m_t, hasCaption); m_t << "" << endl; @@ -1348,6 +1704,7 @@ void DocbookDocVisitor::endDiaFile(bool hasCaption) void DocbookDocVisitor::writeDotFile(const QCString &baseName, DocVerbatim *s) { +DB_VIS_C QCString shortName = baseName; int i; if ((i=shortName.findRev('/'))!=-1) @@ -1356,7 +1713,7 @@ void DocbookDocVisitor::writeDotFile(const QCString &baseName, DocVerbatim *s) } QCString outDir = Config_getString(DOCBOOK_OUTPUT); writeDotGraphFromFile(baseName+".dot",outDir,shortName,GOF_BITMAP); - visitPreStart(m_t, s->hasCaption(), baseName + ".dot", s->width(),s->height()); + visitPreStart(m_t, s->hasCaption(), s->relPath() + shortName + "." + getDotImageExtension(), s->width(),s->height()); visitCaption(this, s->children()); visitPostEnd(m_t, s->hasCaption()); } @@ -1367,6 +1724,7 @@ void DocbookDocVisitor::startDotFile(const QCString &fileName, bool hasCaption ) { +DB_VIS_C QCString baseName=fileName; int i; if ((i=baseName.findRev('/'))!=-1) @@ -1387,6 +1745,7 @@ void DocbookDocVisitor::startDotFile(const QCString &fileName, void DocbookDocVisitor::endDotFile(bool hasCaption) { +DB_VIS_C if (m_hide) return; m_t << endl; visitPostEnd(m_t, hasCaption); diff --git a/src/docbookvisitor.h b/src/docbookvisitor.h index 6c7976c..40f8a68 100644 --- a/src/docbookvisitor.h +++ b/src/docbookvisitor.h @@ -26,11 +26,15 @@ class FTextStream; class CodeOutputInterface; class QCString; +void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height); +void visitPostEnd(FTextStream &t, const bool hasCaption); + /*! @brief Concrete visitor implementation for Docbook output. */ class DocbookDocVisitor : public DocVisitor { public: DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci); + ~DocbookDocVisitor(); //-------------------------------------- // visitor functions for leaf nodes //-------------------------------------- diff --git a/src/docparser.h b/src/docparser.h index 6b75426..9776d0b 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -707,6 +707,7 @@ class DocTitle : public CompAccept void parse(); void parseFromString(const QCString &title); Kind kind() const { return Kind_Title; } + bool hasTitle() const { return !m_children.isEmpty(); } private: }; @@ -1092,6 +1093,7 @@ class DocSimpleSect : public CompAccept int parseRcs(); int parseXml(); void appendLinkWord(const QCString &word); + bool hasTitle() const { return m_title->hasTitle(); } private: Type m_type; diff --git a/src/dot.cpp b/src/dot.cpp index 7b29569..5f52210 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1383,6 +1383,11 @@ bool DotManager::run() setDotFontPath(Config_getString(RTF_OUTPUT)); setPath=TRUE; } + else if (Config_getBool(GENERATE_DOCBOOK)) + { + setDotFontPath(Config_getString(DOCBOOK_OUTPUT)); + setPath=TRUE; + } portable_sysTimerStart(); // fill work queue with dot operations DotRunner *dr; @@ -3242,29 +3247,15 @@ QCString DotClassGraph::writeGraph(FTextStream &out, if (graphFormat==GOF_BITMAP && textFormat==EOF_DocBook) { out << "" << endl; - out << "
    " << endl; - out << " "; - switch (m_graphType) - { - case DotNode::Collaboration: - out << "Collaboration graph"; - break; - case DotNode::Inheritance: - out << "Inheritance graph"; - break; - default: - ASSERT(0); - break; - } - out << "" << endl; + out << " " << endl; out << " " << endl; out << " " << endl; out << " "; + out << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << relPath << baseName << "." << imgExt << "\">"; out << "" << endl; out << " " << endl; out << " " << endl; - out << "
    " << endl; + out << " " << endl; out << "
    " << endl; } else if (graphFormat==GOF_BITMAP && generateImageMap) // produce HTML to include the image @@ -3601,17 +3592,15 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out, if (graphFormat==GOF_BITMAP && textFormat==EOF_DocBook) { out << "" << endl; - out << "
    " << endl; - out << " Dependency diagram"; - out << "" << endl; + out << " " << endl; out << " " << endl; out << " " << endl; out << " "; + out << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << relPath << baseName << "." << imgExt << "\">"; out << "" << endl; out << " " << endl; out << " " << endl; - out << "
    " << endl; + out << " " << endl; out << "
    " << endl; } else if (graphFormat==GOF_BITMAP && generateImageMap) @@ -3922,17 +3911,15 @@ QCString DotCallGraph::writeGraph(FTextStream &out, GraphOutputFormat graphForma if (graphFormat==GOF_BITMAP && textFormat==EOF_DocBook) { out << "" << endl; - out << "
    " << endl; - out << " Call diagram"; - out << "" << endl; + out << " " << endl; out << " " << endl; out << " " << endl; out << " "; + out << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << relPath << baseName << "." << imgExt << "\">"; out << "" << endl; out << " " << endl; out << " " << endl; - out << "
    " << endl; + out << " " << endl; out << "
    " << endl; } else if (graphFormat==GOF_BITMAP && generateImageMap) @@ -4087,17 +4074,15 @@ QCString DotDirDeps::writeGraph(FTextStream &out, if (graphFormat==GOF_BITMAP && textFormat==EOF_DocBook) { out << "" << endl; - out << "
    " << endl; - out << " Directory Dependency diagram"; - out << "" << endl; + out << " " << endl; out << " " << endl; out << " " << endl; out << " "; + out << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << relPath << baseName << "." << imgExt << "\">"; out << "" << endl; out << " " << endl; out << " " << endl; - out << "
    " << endl; + out << " " << endl; out << "
    " << endl; } else if (graphFormat==GOF_BITMAP && generateImageMap) @@ -4650,17 +4635,15 @@ QCString DotGroupCollaboration::writeGraph( FTextStream &t, if (graphFormat==GOF_BITMAP && textFormat==EOF_DocBook) { t << "" << endl; - t << "
    " << endl; - t << " Group Collaboration diagram"; - t << "" << endl; + t << " " << endl; t << " " << endl; t << " " << endl; t << " "; + t << " width=\"50%\" align=\"center\" valign=\"middle\" scalefit=\"0\" fileref=\"" << relPath << baseName << "." << imgExt << "\">"; t << "" << endl; t << " " << endl; t << " " << endl; - t << "
    " << endl; + t << " " << endl; t << "
    " << endl; } else if (graphFormat==GOF_BITMAP && writeImageMap) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index bf93a9b..21ae289 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11100,14 +11100,20 @@ void parseInput() // Notice: the order of the function calls below is very important! - if (Config_getBool(GENERATE_HTML)) + if (Config_getBool(GENERATE_HTML) && !Config_getBool(USE_MATHJAX)) { readFormulaRepository(Config_getString(HTML_OUTPUT)); } if (Config_getBool(GENERATE_RTF)) { // in case GENERRATE_HTML is set we just have to compare, both repositories should be identical - readFormulaRepository(Config_getString(RTF_OUTPUT),Config_getBool(GENERATE_HTML)); + readFormulaRepository(Config_getString(RTF_OUTPUT),Config_getBool(GENERATE_HTML) && !Config_getBool(USE_MATHJAX)); + } + if (Config_getBool(GENERATE_DOCBOOK)) + { + // in case GENERRATE_HTML is set we just have to compare, both repositories should be identical + readFormulaRepository(Config_getString(DOCBOOK_OUTPUT), + (Config_getBool(GENERATE_HTML) && !Config_getBool(USE_MATHJAX)) || Config_getBool(GENERATE_RTF)); } /************************************************************************** @@ -11456,6 +11462,7 @@ void generateOutput() bool generateLatex = Config_getBool(GENERATE_LATEX); bool generateMan = Config_getBool(GENERATE_MAN); bool generateRtf = Config_getBool(GENERATE_RTF); + bool generateDocbook = Config_getBool(GENERATE_DOCBOOK); g_outputList = new OutputList(TRUE); @@ -11483,6 +11490,13 @@ void generateOutput() g_outputList->add(new LatexGenerator); LatexGenerator::init(); } +#if 1 + if (generateDocbook) + { + g_outputList->add(new DocbookGenerator); + DocbookGenerator::init(); + } +#endif if (generateMan) { g_outputList->add(new ManGenerator); @@ -11509,6 +11523,7 @@ void generateOutput() if (generateHtml) writeDoxFont(Config_getString(HTML_OUTPUT)); if (generateLatex) writeDoxFont(Config_getString(LATEX_OUTPUT)); + if (generateDocbook) writeDoxFont(Config_getString(DOCBOOK_OUTPUT)); if (generateRtf) writeDoxFont(Config_getString(RTF_OUTPUT)); g_s.begin("Generating style sheet...\n"); @@ -11602,6 +11617,13 @@ void generateOutput() g_s.end(); } + if (Doxygen::formulaList->count()>0 && generateDocbook) + { + g_s.begin("Generating bitmaps for formulas in Docbook...\n"); + Doxygen::formulaList->generateBitmaps(Config_getString(DOCBOOK_OUTPUT)); + g_s.end(); + } + if (Config_getBool(SORT_GROUP_NAMES)) { Doxygen::groupSDict->sort(); @@ -11634,6 +11656,8 @@ void generateOutput() removeDoxFont(Config_getString(RTF_OUTPUT)); if (generateLatex) removeDoxFont(Config_getString(LATEX_OUTPUT)); + if (generateDocbook) + removeDoxFont(Config_getString(DOCBOOK_OUTPUT)); } if (Config_getBool(GENERATE_XML)) @@ -11651,12 +11675,14 @@ void generateOutput() g_s.end(); } - if (Config_getBool(GENERATE_DOCBOOK)) +#if 0 + if (generateDocbook) { g_s.begin("Generating Docbook output...\n"); - generateDocbook(); + generateDocbook_v1(); g_s.end(); } +#endif if (Config_getBool(GENERATE_AUTOGEN_DEF)) { @@ -11728,6 +11754,10 @@ void generateOutput() copyLogo(Config_getString(LATEX_OUTPUT)); copyExtraFiles(Config_getList(LATEX_EXTRA_FILES),"LATEX_EXTRA_FILES",Config_getString(LATEX_OUTPUT)); } + if (generateDocbook) + { + copyLogo(Config_getString(DOCBOOK_OUTPUT)); + } if (generateRtf) { copyLogo(Config_getString(RTF_OUTPUT)); diff --git a/src/filedef.cpp b/src/filedef.cpp index e2df9be..d9eaa4b 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -348,6 +348,10 @@ void FileDef::writeDetailedDescription(OutputList &ol,const QCString &title) { ol.disable(OutputGenerator::Latex); } + if (ol.isEnabled(OutputGenerator::Docbook) && !Config_getBool(DOCBOOK_PROGRAMLISTING)) + { + ol.disable(OutputGenerator::Docbook); + } if (ol.isEnabled(OutputGenerator::RTF) && !Config_getBool(RTF_SOURCE_CODE)) { ol.disable(OutputGenerator::RTF); @@ -937,6 +941,7 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES); static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE); + static bool docbookSourceCode = Config_getBool(DOCBOOK_PROGRAMLISTING); static bool rtfSourceCode = Config_getBool(RTF_SOURCE_CODE); DevNullCodeDocInterface devNullIntf; QCString title = m_docname; @@ -947,6 +952,7 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) QCString pageTitle = theTranslator->trSourceFile(title); ol.disable(OutputGenerator::Man); if (!latexSourceCode) ol.disable(OutputGenerator::Latex); + if (!docbookSourceCode) ol.disable(OutputGenerator::Docbook); if (!rtfSourceCode) ol.disable(OutputGenerator::RTF); bool isDocFile = isDocumentationFile(); @@ -978,13 +984,14 @@ void FileDef::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu) if (isLinkable()) { + ol.pushGeneratorState(); if (latexSourceCode) ol.disable(OutputGenerator::Latex); if (rtfSourceCode) ol.disable(OutputGenerator::RTF); + if (docbookSourceCode) ol.disable(OutputGenerator::Docbook); ol.startTextLink(getOutputFileBase(),0); ol.parseText(theTranslator->trGotoDocumentation()); ol.endTextLink(); - if (latexSourceCode) ol.enable(OutputGenerator::Latex); - if (rtfSourceCode) ol.enable(OutputGenerator::RTF); + ol.popGeneratorState(); } (void)sameTu; diff --git a/src/index.cpp b/src/index.cpp index 8e5f266..503387c 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -94,9 +94,12 @@ static void startIndexHierarchy(OutputList &ol,int level) ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Html); if (level<6) ol.startIndexList(); - ol.enableAll(); + ol.popGeneratorState(); + + ol.pushGeneratorState(); ol.disable(OutputGenerator::Latex); ol.disable(OutputGenerator::RTF); + ol.disable(OutputGenerator::Docbook); ol.startItemList(); ol.popGeneratorState(); } @@ -107,8 +110,11 @@ static void endIndexHierarchy(OutputList &ol,int level) ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Html); if (level<6) ol.endIndexList(); - ol.enableAll(); + ol.popGeneratorState(); + + ol.pushGeneratorState(); ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); ol.disable(OutputGenerator::RTF); ol.endItemList(); ol.popGeneratorState(); @@ -959,6 +965,7 @@ static void writeHierarchicalIndex(OutputList &ol) ol.pushGeneratorState(); //1.{ ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Docbook); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassHierarchy); QCString title = lne ? lne->title() : theTranslator->trClassHierarchy(); @@ -973,15 +980,16 @@ static void writeHierarchicalIndex(OutputList &ol) if (Config_getBool(HAVE_DOT) && Config_getBool(GRAPHICAL_HIERARCHY)) { + ol.pushGeneratorState(); ol.disable(OutputGenerator::Latex); ol.disable(OutputGenerator::RTF); + ol.disable(OutputGenerator::Docbook); ol.startParagraph(); ol.startTextLink("inherits",0); ol.parseText(theTranslator->trGotoGraphicalHierarchy()); ol.endTextLink(); ol.endParagraph(); - ol.enable(OutputGenerator::Latex); - ol.enable(OutputGenerator::RTF); + ol.popGeneratorState(); } ol.parseText(lne ? lne->intro() : theTranslator->trClassHierarchyDescription()); ol.endTextBlock(); @@ -1170,6 +1178,7 @@ static void writeFileIndex(OutputList &ol) ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Docbook); if (documentedFiles==0) ol.disableAllBut(OutputGenerator::Html); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::FileList); @@ -1450,6 +1459,7 @@ static void writeNamespaceIndex(OutputList &ol) if (documentedNamespaces==0) return; ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Docbook); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::NamespaceList); if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces); // fall back QCString title = lne ? lne->title() : theTranslator->trNamespaceList(); @@ -1603,6 +1613,7 @@ static void writeAnnotatedClassList(OutputList &ol) if (cd->isEmbeddedInOuterScope()) { ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); ol.disable(OutputGenerator::RTF); } if (cd->isLinkableInProject() && cd->templateMaster()==0) @@ -2021,6 +2032,7 @@ static void writeAlphabeticalIndex(OutputList &ol) if (annotatedClasses==0) return; ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); + ol.disable(OutputGenerator::Docbook); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassIndex); QCString title = lne ? lne->title() : theTranslator->trCompoundIndex(); bool addToIndex = lne==0 || lne->visible(); @@ -2053,6 +2065,7 @@ static void writeAnnotatedIndex(OutputList &ol) ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Docbook); if (annotatedClassesPrinted==0) { ol.disable(OutputGenerator::Latex); @@ -3022,6 +3035,7 @@ static void writeExampleIndex(OutputList &ol) if (Doxygen::exampleSDict->count()==0) return; ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Docbook); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Examples); QCString title = lne ? lne->title() : theTranslator->trExamples(); bool addToIndex = lne==0 || lne->visible(); @@ -3621,6 +3635,7 @@ static void writeGroupIndex(OutputList &ol) ol.pushGeneratorState(); // 1.{ ol.disable(OutputGenerator::Man); + ol.disable(OutputGenerator::Docbook); LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Modules); QCString title = lne ? lne->title() : theTranslator->trModules(); bool addToIndex = lne==0 || lne->visible(); @@ -3910,6 +3925,7 @@ static void writeIndex(OutputList &ol) // write LaTeX/RTF index //-------------------------------------------------------------------- ol.enable(OutputGenerator::Latex); + ol.enable(OutputGenerator::Docbook); ol.enable(OutputGenerator::RTF); ol.startFile("refman",0,0); @@ -3918,6 +3934,7 @@ static void writeIndex(OutputList &ol) { ol.disable(OutputGenerator::Latex); } + ol.disable(OutputGenerator::Docbook); if (projPrefix.isEmpty()) { @@ -3939,6 +3956,7 @@ static void writeIndex(OutputList &ol) ol.parseText(theTranslator->trGeneratedBy()); ol.endIndexSection(isTitlePageAuthor); ol.enable(OutputGenerator::Latex); + ol.enable(OutputGenerator::Docbook); ol.lastIndexPage(); if (Doxygen::mainPage) @@ -3978,9 +3996,11 @@ static void writeIndex(OutputList &ol) QCString title = pd->title(); if (title.isEmpty()) title=pd->name(); + ol.disable(OutputGenerator::Docbook); ol.startIndexSection(isPageDocumentation); ol.parseText(title); ol.endIndexSection(isPageDocumentation); + ol.enable(OutputGenerator::Docbook); ol.pushGeneratorState(); // write TOC title (RTF only) ol.disableAllBut(OutputGenerator::RTF); @@ -4002,6 +4022,7 @@ static void writeIndex(OutputList &ol) } } + ol.disable(OutputGenerator::Docbook); if (!Config_getBool(LATEX_HIDE_INDICES)) { //if (indexedPages>0) @@ -4049,6 +4070,8 @@ static void writeIndex(OutputList &ol) ol.endIndexSection(isFileIndex); } } + ol.enable(OutputGenerator::Docbook); + if (documentedGroups>0) { ol.startIndexSection(isModuleDocumentation); diff --git a/src/marshal.cpp b/src/marshal.cpp index fa29aed..f0ed2e8 100644 --- a/src/marshal.cpp +++ b/src/marshal.cpp @@ -350,6 +350,7 @@ void marshalLocalToc(StorageIntf *s,const LocalToc <) marshalInt(s,lt.htmlLevel()); marshalInt(s,lt.latexLevel()); marshalInt(s,lt.xmlLevel()); + marshalInt(s,lt.docbookLevel()); } void marshalEntry(StorageIntf *s,Entry *e) @@ -740,6 +741,7 @@ LocalToc unmarshalLocalToc(StorageIntf *s) int htmlLevel = unmarshalInt(s); int latexLevel = unmarshalInt(s); int xmlLevel = unmarshalInt(s); + int docbookLevel = unmarshalInt(s); if ((mask & (1<isObjCMethod()); @@ -172,6 +174,7 @@ static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) ol.enableAll(); ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); { // other formats if (!md->isObjCMethod()) ol.docify("("); // start argument list @@ -270,6 +273,7 @@ static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) // ol.docify(" "); //} ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); ol.disable(OutputGenerator::Html); ol.docify(" "); /* man page */ if (htmlOn) ol.enable(OutputGenerator::Html); @@ -277,12 +281,15 @@ static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) ol.startEmphasis(); ol.enable(OutputGenerator::Man); if (latexOn) ol.enable(OutputGenerator::Latex); + if (docbookOn) ol.enable(OutputGenerator::Docbook); if (a->name.isEmpty()) ol.docify(a->type); else ol.docify(a->name); ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); ol.endEmphasis(); ol.enable(OutputGenerator::Man); if (latexOn) ol.enable(OutputGenerator::Latex); + if (docbookOn) ol.enable(OutputGenerator::Docbook); } if (!a->array.isEmpty()) { @@ -338,10 +345,12 @@ static bool writeDefArgumentList(OutputList &ol,Definition *scope,MemberDef *md) ol.pushGeneratorState(); ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); if (!md->isObjCMethod()) ol.docify(")"); // end argument list ol.enableAll(); if (htmlOn) ol.enable(OutputGenerator::Html); if (latexOn) ol.enable(OutputGenerator::Latex); + if (docbookOn) ol.enable(OutputGenerator::Docbook); if (first) ol.startParameterName(defArgList->count()<2); ol.endParameterName(TRUE,defArgList->count()<2,!md->isObjCMethod()); ol.popGeneratorState(); @@ -1478,6 +1487,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ol.pushGeneratorState(); ol.disable(OutputGenerator::Man); ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); ol.docify("\n"); ol.popGeneratorState(); } @@ -3836,8 +3846,10 @@ void MemberDef::writeEnumDeclaration(OutputList &typeDecl, typeDecl.pushGeneratorState(); typeDecl.disableAllBut(OutputGenerator::Html); typeDecl.enable(OutputGenerator::Latex); + typeDecl.enable(OutputGenerator::Docbook); typeDecl.lineBreak(); typeDecl.disable(OutputGenerator::Latex); + typeDecl.disable(OutputGenerator::Docbook); typeDecl.writeString("  "); typeDecl.popGeneratorState(); } diff --git a/src/outputgen.h b/src/outputgen.h index 9935bd9..a99cff3 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -322,7 +322,7 @@ class BaseOutputDocInterface : public CodeOutputInterface class OutputGenerator : public BaseOutputDocInterface { public: - enum OutputType { Html, Latex, Man, RTF, XML, DEF, Perl }; + enum OutputType { Html, Latex, Man, RTF, XML, DEF, Perl , Docbook}; OutputGenerator(); virtual ~OutputGenerator(); diff --git a/src/pagedef.cpp b/src/pagedef.cpp index d2c3f68..79a78d3 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -187,6 +187,7 @@ void PageDef::writeDocumentation(OutputList &ol) ol.pushGeneratorState(); //2.{ ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Docbook); ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::Man); if (!title().isEmpty() && !name().isEmpty() && si!=0) @@ -207,7 +208,7 @@ void PageDef::writeDocumentation(OutputList &ol) ol.popGeneratorState(); //2.} - if ((m_localToc.isHtmlEnabled() || m_localToc.isLatexEnabled()) && hasSections()) + if ((m_localToc.isHtmlEnabled() || m_localToc.isLatexEnabled() || m_localToc.isDocbookEnabled()) && hasSections()) { writeToc(ol, m_localToc); } @@ -269,6 +270,7 @@ void PageDef::writePageDocumentation(OutputList &ol) ol.pushGeneratorState(); ol.disableAll(); ol.enable(OutputGenerator::Latex); + ol.enable(OutputGenerator::Docbook); ol.enable(OutputGenerator::RTF); PageSDict::Iterator pdi(*m_subPageDict); diff --git a/src/types.h b/src/types.h index e58c8fc..d6f0342 100644 --- a/src/types.h +++ b/src/types.h @@ -227,7 +227,8 @@ class LocalToc Html = 0, // index / also to be used as bit position in mask (1 << Html) Latex = 1, // ... Xml = 2, // ... - numTocTypes = 3 // number of enum values + Docbook = 3, // ... + numTocTypes = 4 // number of enum values }; LocalToc() : m_mask(None) { memset(m_level,0,sizeof(m_level)); } @@ -247,15 +248,22 @@ class LocalToc m_mask|=(1<file.data()); ol.writeObjectLink(0,e->file,e->anchor,e->name); @@ -5932,6 +5934,66 @@ QCString convertToXML(const char *s) return growBuf.get(); } +/*! Converts a string to an DocBook-encoded string */ +QCString convertToDocBook(const char *s) +{ + static GrowBuf growBuf; + growBuf.clear(); + if (s==0) return ""; + const unsigned char *q; + int cnt; + const unsigned char *p=(const unsigned char *)s; + char c; + while ((c=*p++)) + { + switch (c) + { + case '<': growBuf.addStr("<"); break; + case '>': growBuf.addStr(">"); break; + case '&': // possibility to have a special symbol + q = p; + cnt = 2; // we have to count & and ; as well + while ((*q >= 'a' && *q <= 'z') || (*q >= 'A' && *q <= 'Z') || (*q >= '0' && *q <= '9')) + { + cnt++; + q++; + } + if (*q == ';') + { + --p; // we need & as well + DocSymbol::SymType res = HtmlEntityMapper::instance()->name2sym(QCString((char *)p).left(cnt)); + if (res == DocSymbol::Sym_Unknown) + { + p++; + growBuf.addStr("&"); + } + else + { + growBuf.addStr(HtmlEntityMapper::instance()->docbook(res)); + q++; + p = q; + } + } + else + { + growBuf.addStr("&"); + } + break; + case '\'': growBuf.addStr("'"); break; + case '"': growBuf.addStr("""); break; + case '\007': growBuf.addStr("␇"); break; + case 1: case 2: case 3: case 4: case 5: case 6: case 8: + case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: + case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: + case 27: case 28: case 29: case 30: case 31: + break; // skip invalid XML characters (see http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char) + default: growBuf.addChar(c); break; + } + } + growBuf.addChar(0); + return growBuf.get(); +} + /*! Converts a string to a HTML-encoded string */ QCString convertToHtml(const char *s,bool keepEntities) { diff --git a/src/util.h b/src/util.h index a9eee67..2ee8b17 100644 --- a/src/util.h +++ b/src/util.h @@ -284,6 +284,8 @@ QCString convertToLaTeX(const QCString &s,bool insideTabbing=FALSE,bool keepSpac QCString convertToXML(const char *s); +QCString convertToDocBook(const char *s); + QCString convertToJSString(const char *s, bool applyTextDir = true); QCString getOverloadDocs(); diff --git a/testing/031/indexpage.xml b/testing/031/indexpage.xml index 3b3a2e3..2c1dfd7 100644 --- a/testing/031/indexpage.xml +++ b/testing/031/indexpage.xml @@ -8,6 +8,7 @@ Some text. Doxygen logo + More text. diff --git a/testing/031_image.dox b/testing/031_image.dox index f437086..8ba47b7 100644 --- a/testing/031_image.dox +++ b/testing/031_image.dox @@ -5,5 +5,6 @@ * Some text. * \image html sample.png * \image latex sample.png "Doxygen logo" width=5cm + * \image docbook sample.png * More text. */ diff --git a/testing/043_page.dox b/testing/043_page.dox index d554da2..9ac5c0e 100644 --- a/testing/043_page.dox +++ b/testing/043_page.dox @@ -4,7 +4,7 @@ /** \page mypage Page Title * \brief Page brief description. * - * @tableofcontents{xml,html,latex} + * @tableofcontents{xml,html,latex,docbook} * * Text at page level. See \ref mysect for more. * \section mysect Section Title. -- cgit v0.12 From 28fe14198cf1da1f6bef42d4cba4cfbec35c7155 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 7 Sep 2018 14:39:16 +0200 Subject: Don't link to non existing / not accessible namespaces , in CSharp, in the source code In the following the 'test' and 'System' were linked in the source code, this should not be the case. using test; using System; using System.IO; namespace NON { } --- src/code.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/code.l b/src/code.l index 13d538b..5aa333c 100644 --- a/src/code.l +++ b/src/code.l @@ -983,7 +983,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName } } NamespaceDef *nd = getResolvedNamespace(className); - if (nd) + if (nd && nd->isLinkableInProject()) { g_theCallContext.setScope(nd); addToSearchIndex(className); -- cgit v0.12 From dc90259bb67126a6f3e016db2a67499945d6224f Mon Sep 17 00:00:00 2001 From: StefanBruens Date: Sat, 8 Sep 2018 03:45:39 +0200 Subject: Order resources not only on filename but also dirname Although the resource generation sorted files for each subdirectory, total order, i.e. including subdirectories, was not stable. As a result, the generated resources.cpp could be different on each build run. Fixes #6152 --- src/res2cc_cmd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/res2cc_cmd.py b/src/res2cc_cmd.py index 7e0322d..86d999d 100755 --- a/src/res2cc_cmd.py +++ b/src/res2cc_cmd.py @@ -98,10 +98,11 @@ def main(): directory = sys.argv[1] files = [] for dirName, subdirList, fileList in walk(directory): - for fname in sorted(fileList): + for fname in fileList: subdir = dirName[len(directory)+1:] if dirName.startswith(directory) else dirName if subdir: files.append(File.factory(directory,subdir,fname)) + files.sort(key=lambda f: f.subdir + "/" + f.fileName) outputFile = open(sys.argv[2],"w") print("#include \"resourcemgr.h\"\n",file=outputFile) for f in files: -- cgit v0.12 From 44e4967edb03da825c899fea1c4fa226491e13f3 Mon Sep 17 00:00:00 2001 From: Croydon Date: Thu, 30 Aug 2018 09:55:36 +0200 Subject: Init Windows AppVeyor CI --- appveyor.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..636115f --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,36 @@ +image: Visual Studio 2017 + +configuration: + - Release + - Debug + +platform: + - x64 + - Win32 + +environment: + # VS VERSION IN CMAKE STYLE + matrix: + - VSVERSION: "15 2017" + - VSVERSION: "14 2015" + +init: + - cmake --version + +install: + - ps: Invoke-WebRequest https://github.com/lexxmark/winflexbison/releases/download/v2.5.15/win_flex_bison-2.5.15.zip -OutFile flex.zip + - 7z x flex.zip -oC:\deps\flex + - rename C:\deps\flex\win_bison.exe bison.exe + - rename C:\deps\flex\win_flex.exe flex.exe + - set "PATH=%PATH%;C:\deps\flex" + +before_build: + - if "%platform%"=="Win32" ( set "CMAKE_GENERATOR_NAME=Visual Studio %VSVERSION%" ) + - if "%platform%"=="x64" ( set "CMAKE_GENERATOR_NAME=Visual Studio %VSVERSION% Win64") + - mkdir build + - cd build + - cmake .. -G "%CMAKE_GENERATOR_NAME% + +build: + project: "build\\PACKAGE.vcxproj" + parallel: true -- cgit v0.12 From c573dc12a38d8de34f5f63e5e1e52b6f710ffbd8 Mon Sep 17 00:00:00 2001 From: Croydon Date: Sun, 2 Sep 2018 15:32:01 +0200 Subject: AppVeyor: Also execute tests and doc generation --- appveyor.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 636115f..62d084d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,21 +16,35 @@ environment: init: - cmake --version + - perl --version + - msbuild /version install: - ps: Invoke-WebRequest https://github.com/lexxmark/winflexbison/releases/download/v2.5.15/win_flex_bison-2.5.15.zip -OutFile flex.zip - 7z x flex.zip -oC:\deps\flex - rename C:\deps\flex\win_bison.exe bison.exe - rename C:\deps\flex\win_flex.exe flex.exe - - set "PATH=%PATH%;C:\deps\flex" + - ps: Invoke-WebRequest https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs923/gs923w32.exe -OutFile gswin32c.exe + - gswin32c /S /D=C:\deps\ghostscript + - ps: choco install -y miktex + - refreshenv + - pip install conan + - conan install libxml2/2.9.8@bincrafters/stable -g virtualrunenv + - activate_run.bat + - set "PATH=%PATH%;C:\deps\ghostscript\bin;C:\deps\flex" before_build: - if "%platform%"=="Win32" ( set "CMAKE_GENERATOR_NAME=Visual Studio %VSVERSION%" ) - if "%platform%"=="x64" ( set "CMAKE_GENERATOR_NAME=Visual Studio %VSVERSION% Win64") - mkdir build - cd build - - cmake .. -G "%CMAKE_GENERATOR_NAME% + - cmake -G "%CMAKE_GENERATOR_NAME%" .. build: project: "build\\PACKAGE.vcxproj" parallel: true + +test_script: + - msbuild "testing\tests.vcxproj" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + - cmake -G "%CMAKE_GENERATOR_NAME%" -D build_doc=ON .. + - msbuild "doc\docs.vcxproj" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" -- cgit v0.12 From cd9c5bb4ceb6bf9ce48c2861bdf72d5c1ff79752 Mon Sep 17 00:00:00 2001 From: Croydon Date: Mon, 3 Sep 2018 11:06:07 +0200 Subject: Prevent potential race condition --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 62d084d..8090d22 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -42,7 +42,7 @@ before_build: build: project: "build\\PACKAGE.vcxproj" - parallel: true + parallel: false test_script: - msbuild "testing\tests.vcxproj" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" -- cgit v0.12 From 19deeb1181b0ab6fe3a06a5589012c5105272a34 Mon Sep 17 00:00:00 2001 From: Croydon Date: Thu, 6 Sep 2018 08:13:37 +0200 Subject: AppVeyor: Remove outdated renaming and update ghostscript Renaming of win_flex and win_bison is not any longer requires as the CMake find scripts are also looking for these binary names. Updating Ghostscript from 9.23 to 9.24 --- appveyor.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8090d22..ad95ddf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,9 +22,7 @@ init: install: - ps: Invoke-WebRequest https://github.com/lexxmark/winflexbison/releases/download/v2.5.15/win_flex_bison-2.5.15.zip -OutFile flex.zip - 7z x flex.zip -oC:\deps\flex - - rename C:\deps\flex\win_bison.exe bison.exe - - rename C:\deps\flex\win_flex.exe flex.exe - - ps: Invoke-WebRequest https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs923/gs923w32.exe -OutFile gswin32c.exe + - ps: Invoke-WebRequest https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs924/gs924w32.exe -OutFile gswin32c.exe - gswin32c /S /D=C:\deps\ghostscript - ps: choco install -y miktex - refreshenv -- cgit v0.12 From 44278f94827cf772b9f679a6d9f5ea9d3a663b49 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 9 Sep 2018 13:40:38 +0200 Subject: Small correction installation / build procedure - Adding some indices - Adding python requirement for *nix --- doc/install.doc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/install.doc b/doc/install.doc index 497a0c0..519ee47 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -36,6 +36,7 @@ following to build the executable: \addindex make \addindex strip \addindex python +
  • You need \c python (version 2.6 or higher, see https://www.python.org).
  • In order to generate a \c Makefile for your platform, you need cmake version 2.8.12 or later. \addindex cmake @@ -151,6 +152,7 @@ standard installation procedure that is required for these packages. From version 1.8.10 onwards, build files need to be generated by cmake. cmake can be downloaded from https://cmake.org/download/ +\addindex cmake At the moment only the express version of Visual Studio 2013 is tested, but other version might also work. @@ -160,9 +162,12 @@ Alternatively, you can compile doxygen Cygwin or MinGW. +\addindex flex +\addindex bison The next step is to install modern versions of \c bison and \c flex (see https://sourceforge.net/projects/winflexbison/. After installation and adding them to your `path` rename `win_flex.exe` to `flex.exe` and `win_bison.exe` to `bison.exe`) +\addindex python Furthermore you have to install \c python (version 2.6 or higher, see https://www.python.org). These packages are needed during the compilation process. -- cgit v0.12 From b0d911e457e2e8f52ab6796d65e244df5f3881c3 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 9 Sep 2018 20:54:19 +0200 Subject: Update README.md added window's build status (via appveyor) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b30cdf..2ae297b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ The latest binaries and source of Doxygen can be downloaded from: Developers --------- -* Build Status: +* Linux Build Status: +* Windows Build Status: * Coverity Scan Build Status: Coverity Scan Build Status -- cgit v0.12 From cd2cbe4b044257ca984db6f70c7240079f5390f9 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 9 Sep 2018 21:00:04 +0200 Subject: Update README.md corrected URL to appveyer build page --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ae297b..b24a480 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ The latest binaries and source of Doxygen can be downloaded from: Developers --------- * Linux Build Status: -* Windows Build Status: +* Windows Build Status: * Coverity Scan Build Status: Coverity Scan Build Status -- cgit v0.12 From eef433c0531f8f5321f3034bcc5bed02c006f2cf Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 10 Sep 2018 16:44:11 +0200 Subject: Issue 6494: asterisks before args and kwargs are ignored in python Added asterisks in the type field. The type is temporary stored in a variable as the argument field has not yet been defined for its argument. --- src/pyscanner.l | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pyscanner.l b/src/pyscanner.l index 2adf632..7b5a424 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -118,6 +118,7 @@ static bool g_packageCommentAllowed; static bool g_start_init = FALSE; static int g_search_count = 0; +static QCString g_argType = ""; //----------------------------------------------------------------------------- @@ -959,12 +960,16 @@ STARTDOCSYMS "##" ({BB}|",") { } + [\*]+ { + g_argType = yytext; + } {IDENTIFIER} { // Name of parameter lineCount(); Argument *a = new Argument; current->argList->append(a); current->argList->getLast()->name = QCString(yytext).stripWhiteSpace(); - current->argList->getLast()->type = ""; + current->argList->getLast()->type = g_argType; + g_argType = ""; } "=" { // default value // TODO: this rule is too simple, need to be able to -- cgit v0.12 From fd0d0b5902cfd4a748d1834d2ee8442a79d13184 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 10 Sep 2018 18:39:48 +0200 Subject: Update appveyor.yml disabled vs2017 build for now --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ad95ddf..05e726c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -image: Visual Studio 2017 +image: Visual Studio 2015 configuration: - Release @@ -11,7 +11,7 @@ platform: environment: # VS VERSION IN CMAKE STYLE matrix: - - VSVERSION: "15 2017" +# - VSVERSION: "15 2017", disabled until it starts working - VSVERSION: "14 2015" init: -- cgit v0.12 From 510f342b4d6f61f4ea6f0e7cab5531895bc86a20 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 10 Sep 2018 19:04:05 +0200 Subject: Changed state guard instead of adding pattern check+reject --- src/code.l | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/code.l b/src/code.l index 14a53ff..e5e0361 100644 --- a/src/code.l +++ b/src/code.l @@ -2596,14 +2596,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" generatePHPVariableLink(*g_code,yytext); g_name+=yytext+7; } -{SCOPENAME}{B}*"<"[^\n\/\-\.\{\"\>]*">"("::"{ID})*/{B}* { // A *pt; - if (YY_START==Body) - { - // check for special case that starts with: operator{B}*<[=]?{B}*( - static QRegExp re("operator[ \t]*<[=]?[ \t]*("); - QString qq = yytext; - if (qq.find(re) == 0) REJECT; - } +{SCOPENAME}{B}*"<"[^\n\/\-\.\{\"\>\(]*">"("::"{ID})*/{B}* { // A *pt; int i=QCString(yytext).find('<'); QCString kw = QCString(yytext).left(i).stripWhiteSpace(); if (kw.right(5)=="_cast" && YY_START==Body) -- cgit v0.12 From f8c353715a69341f9e4658cd59e750a0adf6bd5d Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 10 Sep 2018 19:59:30 +0200 Subject: Update appveyor.yml Re-enabled vc2017, disabled debug build and building docs & tests until made working reliably --- appveyor.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 05e726c..06a1d76 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,8 @@ -image: Visual Studio 2015 +image: Visual Studio 2017 configuration: - Release - - Debug +# - Debug platform: - x64 @@ -11,7 +11,7 @@ platform: environment: # VS VERSION IN CMAKE STYLE matrix: -# - VSVERSION: "15 2017", disabled until it starts working + - VSVERSION: "15 2017" - VSVERSION: "14 2015" init: @@ -42,7 +42,7 @@ build: project: "build\\PACKAGE.vcxproj" parallel: false -test_script: - - msbuild "testing\tests.vcxproj" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - - cmake -G "%CMAKE_GENERATOR_NAME%" -D build_doc=ON .. - - msbuild "doc\docs.vcxproj" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" +#test_script: +# - msbuild "testing\tests.vcxproj" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" +# - cmake -G "%CMAKE_GENERATOR_NAME%" -D build_doc=ON .. +# - msbuild "doc\docs.vcxproj" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" -- cgit v0.12 From ab80e5dff5e3f3f1e9ce473ea25894ca08d1f739 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 11 Sep 2018 12:31:17 +0200 Subject: Namespace with name docstrings_linebreak As a regression on pull request #674 in respect to the moving of the markdown handling place the `\_linebreak` command is not translated anymore. In fact the `\_linebreak` is not necessary at all only the space is required as the `\namespace` command takes just one word as argument. --- src/pyscanner.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyscanner.l b/src/pyscanner.l index 7b5a424..cd7c256 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1430,7 +1430,7 @@ STARTDOCSYMS "##" actualDoc.prepend("\\verbatim "); actualDoc.append("\\endverbatim "); } - actualDoc.prepend("\\namespace "+g_moduleScope+"\\_linebr "); + actualDoc.prepend("\\namespace "+g_moduleScope+" "); handleCommentBlock(actualDoc, FALSE); } if ((docBlockContext==ClassBody /*&& !g_hideClassDocs*/) || -- cgit v0.12 From 70c2d03e6ca38009ac144b11d7c7cd5ef4f2d3e8 Mon Sep 17 00:00:00 2001 From: "Michael \"Croydon\" Keck" Date: Tue, 11 Sep 2018 16:07:58 +0200 Subject: Update install.doc: Qt 5 is now supported as well --- doc/install.doc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/install.doc b/doc/install.doc index 519ee47..7df0dee 100644 --- a/doc/install.doc +++ b/doc/install.doc @@ -49,7 +49,7 @@ tools should be installed.
  • Qt Software's GUI toolkit Qt \addindex Qt - version 4.3 or higher (but currently, Qt 5.x is not yet supported). + version 4.3 or higher (including Qt 5). This is needed to build the GUI front-end doxywizard.
  • A \LaTeX distribution: for instance TeX Live @@ -179,7 +179,7 @@ cd c:\tools tar zxvf doxygen-x.y.z.src.tar.gz \endverbatim to unpack the sources (you can obtain \c tar from e.g. http://gnuwin32.sourceforge.net/packages.html). -Alternatively you can use an unpack program, like 7-Zip (see http://www.7-zip.org) +Alternatively you can use an unpack program, like 7-Zip (see https://www.7-zip.org/) or use the build in unpack feature of modern Windows systems). Now your environment is setup to generate the required project files for \c doxygen. @@ -191,8 +191,8 @@ cd build cmake -G "Visual Studio 12 2013" .. \endverbatim -Note that compiling Doxywizard currently requires Qt version 4 -(see http://qt-project.org/). +Note that compiling Doxywizard requires Qt 4.3 or newer +(see https://www.qt.io/developers/). Also read the next section for additional tools you may need to install to run doxygen with certain features enabled. @@ -224,7 +224,7 @@ install LaTeX and For \LaTeX a number of distributions exists. Popular ones that should work with doxygen are MikTex -and proTeXt. +and proTeXt. Ghostscript can be downloaded from Sourceforge. -- cgit v0.12 From ef9c151c86073f107ec6556b779cd7b8da3154eb Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 11 Sep 2018 19:35:49 +0200 Subject: Close last code line properly. When ending code fragment, check if last code line is closed, if this is not the case close it. (problem observed with inline code in Python, but might happen on other places as well) --- src/latexgen.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 13a88a9..50d4242 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -2222,11 +2222,9 @@ void LatexGenerator::startCodeFragment() void LatexGenerator::endCodeFragment() { - //if (DoxyCodeOpen) - //{ - // t << "}\n"; - // DoxyCodeOpen = FALSE; - //} + //endCodeLine checks is there is still an open code line, if so closes it. + endCodeLine(); + t << "\\end{DoxyCode}\n"; DoxyCodeOpen = FALSE; } -- cgit v0.12 From 281017b5bc493510a257d3c355d3744f78359e40 Mon Sep 17 00:00:00 2001 From: Croydon Date: Wed, 12 Sep 2018 17:45:24 +0200 Subject: Init macOS CI --- .travis.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 071a7d1..7a370da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: cpp os: - - linux-ppc64le + - linux-ppc64le - linux dist: xenial compiler: @@ -22,6 +22,32 @@ addons: - cmake - cmake-data +jobs: + include: + - os: osx + compiler: clang + +before_script: + - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then + pip install --quiet conan; + export HOMEBREW_NO_AUTO_UPDATE=1; + brew install ghostscript; + + travis_wait brew cask install mactex-no-gui; + curl -O -L http://mirrors.ctan.org/support/epstopdf.zip; + unzip epstopdf.zip; + mkdir -p /Users/travis/Library/TeX/texbin/; + mv epstopdf/epstopdf.pl /Users/travis/Library/TeX/texbin/epstopdf; + chmod a+x /Users/travis/Library/TeX/texbin/epstopdf; + rm -rf epstopdf*; + export PATH=/Users/travis/Library/TeX/texbin:/Library/TeX/texbin:$PATH; + + conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan; + printf "[requires] \nlibxml2/2.9.8@bincrafters/stable \nQt/5.11.1@bincrafters/stable" >> conanfile.txt; + conan install . -g virtualrunenv; + source activate_run.sh; + fi; + script: - mkdir build - cd build -- cgit v0.12 From d198c549fb88769912761d75277680438d88d69b Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 12 Sep 2018 18:32:01 +0200 Subject: Implementation of standard generator for docbook output Removed debug statement --- src/docbookgen.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index 3793946..785dee8 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -2751,7 +2751,6 @@ DB_GEN_C2("IndexSections " << is) } for (++pdi;(pd=pdi.current());++pdi) { - fprintf(stderr,"==> Done calling from HTML\n"); t << " getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; } } -- cgit v0.12 From 0a4b995cdd7735aaf42c423eed2889db5b8617ef Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 12 Sep 2018 18:41:33 +0200 Subject: Fixing problem with possible not initialized variable (endless loop in VS 2017 debug) The not initialized variable `l` caused and endless loop in the VS2017 debug version, variable should not have been used. --- src/definition.cpp | 2 +- src/xmlgen.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/definition.cpp b/src/definition.cpp index cbfad94..66387bc 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -1633,7 +1633,7 @@ void Definition::writeToc(OutputList &ol, const LocalToc &localToc) int level=1,l; char cs[2]; cs[1]='\0'; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE }; + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; for (li.toFirst();(si=li.current());++li) { if (si->type==SectionInfo::Section || diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index e68c454..be866a2 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1845,7 +1845,7 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample) SDict::Iterator li(*sectionDict); SectionInfo *si; int level=1,l; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE }; + bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; int maxLevel = pd->localToc().xmlLevel(); for (li.toFirst();(si=li.current());++li) { @@ -1872,16 +1872,16 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample) if (l <= maxLevel) t << " " << endl; } } - if (l <= maxLevel && inLi[nextLevel]) t << " " << endl; if (nextLevel <= maxLevel) { + if (inLi[nextLevel]) t << " " << endl; QCString titleDoc = convertToXML(si->title); t << " " << endl; t << " " << (si->title.isEmpty()?si->label:titleDoc) << "" << endl; t << " " << convertToXML(pageName) << "_1" << convertToXML(si -> label) << "" << endl; + inLi[nextLevel]=TRUE; + level = nextLevel; } - inLi[nextLevel]=TRUE; - level = nextLevel; } } while (level>1 && level <= maxLevel) -- cgit v0.12 From 404eec5fce27f2c11060a000a22fb4b00e904936 Mon Sep 17 00:00:00 2001 From: Croydon Date: Thu, 13 Sep 2018 02:54:52 +0200 Subject: Readme: Travis displays macOS build status as well --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b24a480..ab3f7fc 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ Doxygen =============== -Doxygen is the de facto standard tool for generating documentation from -annotated C++ sources, but it also supports other popular programming -languages such as C, Objective-C, C#, PHP, Java, Python, IDL -(Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, +Doxygen is the de facto standard tool for generating documentation from +annotated C++ sources, but it also supports other popular programming +languages such as C, Objective-C, C#, PHP, Java, Python, IDL +(Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D. Doxygen can help you in three ways: -1. It can generate an on-line documentation browser (in HTML) and/or an - off-line reference manual (in LaTeX) from a set of documented source files. - There is also support for generating output in RTF (MS-Word), PostScript, - hyperlinked PDF, compressed HTML, DocBook and Unix man pages. - The documentation is extracted directly from the sources, which makes +1. It can generate an on-line documentation browser (in HTML) and/or an + off-line reference manual (in LaTeX) from a set of documented source files. + There is also support for generating output in RTF (MS-Word), PostScript, + hyperlinked PDF, compressed HTML, DocBook and Unix man pages. + The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code. -2. You can configure doxygen to extract the code structure from undocumented - source files. This is very useful to quickly find your way in large - source distributions. Doxygen can also visualize the relations between - the various elements by means of include dependency graphs, inheritance +2. You can configure doxygen to extract the code structure from undocumented + source files. This is very useful to quickly find your way in large + source distributions. Doxygen can also visualize the relations between + the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically. -3. You can also use doxygen for creating normal documentation (as I did for +3. You can also use doxygen for creating normal documentation (as I did for the doxygen user manual and doxygen web-site). Download @@ -29,7 +29,7 @@ The latest binaries and source of Doxygen can be downloaded from: Developers --------- -* Linux Build Status: +* Linux & macOS Build Status: * Windows Build Status: * Coverity Scan Build Status: Coverity Scan Build Status @@ -37,7 +37,7 @@ Developers * Doxygen's Doxygen Documentation: * Install - * Quick install see (./INSTALL) + * Quick install see (./INSTALL) * else http://www.doxygen.org/manual/install.html * Project stats: https://www.openhub.net/p/doxygen @@ -60,7 +60,7 @@ There are three mailing lists: Source Code ---------------------------------- -In May 2013, Doxygen moved from +In May 2013, Doxygen moved from subversion to git hosted at GitHub * https://github.com/doxygen/doxygen -- cgit v0.12 From 99f948c038b763028fcb95ef2a65fdbc1d5f9520 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 13 Sep 2018 18:01:21 +0200 Subject: Fixing coverity messages Note: especially latexdocvisitor (dead code that should not be dead code). --- src/clangparser.cpp | 1 + src/context.cpp | 12 ++++++++---- src/definition.cpp | 1 + src/docparser.h | 2 +- src/htmlgen.cpp | 1 + src/latexdocvisitor.cpp | 2 +- src/layout.cpp | 2 +- src/layout.h | 3 ++- src/perlmodgen.cpp | 2 +- src/pyscanner.l | 1 - src/tagreader.cpp | 4 ++-- src/tclscanner.l | 1 - 12 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/clangparser.cpp b/src/clangparser.cpp index 78b8faa..18dd404 100644 --- a/src/clangparser.cpp +++ b/src/clangparser.cpp @@ -964,6 +964,7 @@ void ClangParser::writeSources(CodeOutputInterface &,FileDef *) ClangParser::ClangParser() { + p = NULL; } ClangParser::~ClangParser() diff --git a/src/context.cpp b/src/context.cpp index c9a6bb3..33e7dcf 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -6978,7 +6978,8 @@ class NamespaceTreeContext::Private SharedPtr m_namespaceTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; @@ -7352,7 +7353,8 @@ class PageTreeContext::Private SharedPtr m_pageTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; @@ -7604,7 +7606,8 @@ class ModuleTreeContext::Private SharedPtr m_moduleTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; @@ -7807,7 +7810,8 @@ class ExampleTreeContext::Private SharedPtr m_exampleTree; struct Cachable { - Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + Cachable() : maxDepth(0), maxDepthComputed(FALSE), + preferredDepth(0), preferredDepthComputed(FALSE) {} int maxDepth; bool maxDepthComputed; int preferredDepth; diff --git a/src/definition.cpp b/src/definition.cpp index cbfad94..9a4bd08 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -304,6 +304,7 @@ Definition::Definition(const Definition &d) : DefinitionIntf(), m_cookie(0) { m_name = d.m_name; m_defLine = d.m_defLine; + m_defColumn = d.m_defColumn; m_impl = new DefinitionImpl; *m_impl = *d.m_impl; m_impl->sectionDict = 0; diff --git a/src/docparser.h b/src/docparser.h index 6b75426..25602cf 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -1370,7 +1370,7 @@ class DocHtmlTable : public CompAccept { public: DocHtmlTable(DocNode *parent,const HtmlAttribList &attribs) - : m_attribs(attribs) { m_caption=0; m_parent = parent; } + : m_attribs(attribs) { m_caption=0; m_numCols=0; m_parent = parent; } ~DocHtmlTable() { delete m_caption; } Kind kind() const { return Kind_HtmlTable; } uint numRows() const { return m_children.count(); } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index ee23fb8..8819078 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -690,6 +690,7 @@ HtmlGenerator::HtmlGenerator() : OutputGenerator() { dir=Config_getString(HTML_OUTPUT); m_emptySection=FALSE; + m_sectionCount=0; } HtmlGenerator::~HtmlGenerator() diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index c35ef11..452a481 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -1177,8 +1177,8 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) m_t << "r|}{"; break; case DocHtmlCell::Center: - break; m_t << "c|}{"; + break; default: m_t << "l|}{"; break; diff --git a/src/layout.cpp b/src/layout.cpp index 1d9a5ed..a3849b5 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -1268,7 +1268,7 @@ class LayoutParser : public QXmlDefaultHandler } private: - LayoutParser() : m_sHandler(163), m_eHandler(17), m_invalidEntry(FALSE) { } + LayoutParser() : m_sHandler(163), m_eHandler(17), m_invalidEntry(FALSE), m_part(0), m_rootNav(NULL) { } ~LayoutParser() { delete m_rootNav; } QDict m_sHandler; diff --git a/src/layout.h b/src/layout.h index 0b9ad9e..1906a3d 100644 --- a/src/layout.h +++ b/src/layout.h @@ -119,6 +119,7 @@ struct LayoutNavEntry { public: enum Kind { + None = -1, MainPage, Pages, Modules, @@ -158,7 +159,7 @@ struct LayoutNavEntry LayoutNavEntry *find(LayoutNavEntry::Kind k,const char *file=0) const; private: - LayoutNavEntry() : m_parent(0) {} + LayoutNavEntry() : m_parent(0), m_kind(None), m_visible(FALSE) {} LayoutNavEntry *m_parent; Kind m_kind; bool m_visible; diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index f805383..5b4b6ea 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -428,7 +428,7 @@ private: }; PerlModDocVisitor::PerlModDocVisitor(PerlModOutput &output) - : DocVisitor(DocVisitor_Other), m_output(output), m_textmode(false) + : DocVisitor(DocVisitor_Other), m_output(output), m_textmode(false), m_textblockstart(FALSE) { m_output.openList("doc"); } diff --git a/src/pyscanner.l b/src/pyscanner.l index 7b5a424..19dc1ad 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1401,7 +1401,6 @@ STARTDOCSYMS "##" BEGIN(Search); } <> { yyterminate(); - newEntry(); } } diff --git a/src/tagreader.cpp b/src/tagreader.cpp index cf64a35..82e4712 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -95,8 +95,8 @@ class TagMemberInfo class TagClassInfo { public: - enum Kind { Class, Struct, Union, Interface, Exception, Protocol, Category, Enum, Service, Singleton }; - TagClassInfo() { bases=0, templateArguments=0; members.setAutoDelete(TRUE); isObjC=FALSE; } + enum Kind { None=-1, Class, Struct, Union, Interface, Exception, Protocol, Category, Enum, Service, Singleton }; + TagClassInfo() { bases=0, templateArguments=0; members.setAutoDelete(TRUE); isObjC=FALSE; kind = None; } ~TagClassInfo() { delete bases; delete templateArguments; } QCString name; QCString filename; diff --git a/src/tclscanner.l b/src/tclscanner.l index 7ca5ade..ca5294b 100644 --- a/src/tclscanner.l +++ b/src/tclscanner.l @@ -1431,7 +1431,6 @@ tcl_inf("(%d) ?%s?\n",what,tcl.string_last.data()); yyless(0); tcl_inf("(.%d) ?%s?\n",what,tcl.string_last.data()); return; - myWhite=0; break; default: tcl_err("wrong state: %d\n",what); -- cgit v0.12 From b7cdfc8d47dc7a7f86605bbbc74aa78501d2bc33 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 13 Sep 2018 18:06:48 +0200 Subject: Fixing coverity messages (Namespace tag) Correcting missing break in namespace when writing a tag file. (Could not find a case; incase the FALL THROUGH case is correct this has to be clearly indicated in the code). --- src/namespacedef.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index d3eb0df..8e6c881 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -326,6 +326,7 @@ void NamespaceDef::writeTagFile(FTextStream &tagFile) } } } + break; case LayoutDocEntry::MemberDecl: { LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; -- cgit v0.12 From 9766554d63dd85ba8857fe18eb7064c84b0231f6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 14 Sep 2018 15:55:30 +0200 Subject: Usage of '{', '}' and ',' in ALIAS Based on the stack overflow question: https://stackoverflow.com/questions/52314045/how-to-use-addtogroup-with-an-aliases-command/52314821#52314821 ALIASES += opengroup{1}="^^* \addtogroup \1_GROUP ^^ * \{ ^^" ALIASES += close="\}" /** \opengroup{LEVEL_1} */ // ...code statements... /** \close */ // opengroup Does not create a group due to the change of `\{` to just `}`, this behavior has been documented now. --- doc/custcmd.doc | 5 +++++ src/config.xml | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/doc/custcmd.doc b/doc/custcmd.doc index acc0224..02805da 100644 --- a/doc/custcmd.doc +++ b/doc/custcmd.doc @@ -44,6 +44,11 @@ Note that you can put `\n`'s in the value part of an alias to insert newlines (in the resulting output). You can put `^^` in the value part of an alias to insert a newline as if a physical newline was in the original file. +Note when you need a literal `{` or `}` or `,` in the value part of an alias you have to +escape them by means of a backslash (`\`), this can lead to conflicts with the +commands \c \\{ and \c \\} for these it is advised to use the version \c @@{ and \c @@} or +use a double escape (\c \\\\{ and \c \\\\}) + Also note that you can redefine existing special commands if you wish. Some commands, such as \ref cmdxrefitem "\\xrefitem" are designed to be used in diff --git a/src/config.xml b/src/config.xml index e12141c..08795dc 100644 --- a/src/config.xml +++ b/src/config.xml @@ -551,6 +551,30 @@ Go to the next section or return to the a physical newline was in the original file. ]]> + + + + + + + + +
  • "; doc += item->text; -- cgit v0.12 From d0f90ba4a1b7a8e2b5a15e7d8a05d0f484e8f3b5 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Oct 2018 09:52:37 +0200 Subject: Fix travis mac build Attempt to fix mac build of travis in respect to: - Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/man' --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7a370da..71fd5bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ jobs: before_script: - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then + mkdir -p /usr/local/man pip install --quiet conan; export HOMEBREW_NO_AUTO_UPDATE=1; brew install ghostscript; -- cgit v0.12 From e78925a2142bb254dfc8ffc993a21f54ee4cf461 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Oct 2018 10:09:02 +0200 Subject: Fix travis mac build Need `;` in `if` statement --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 71fd5bb..626f1f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ jobs: before_script: - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - mkdir -p /usr/local/man + mkdir -p /usr/local/man; pip install --quiet conan; export HOMEBREW_NO_AUTO_UPDATE=1; brew install ghostscript; -- cgit v0.12 From 72f9ffcbda4da4930ceab28043278cff51778c68 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Oct 2018 11:31:12 +0200 Subject: Fix travis mac build Suggestion fro @crodon implemented This is an error in one of the dependencies of Conan, which should be fixed upstream soon. Then we can remove this error again. See conan-io/conan#3728 for more information --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 626f1f3..829e54e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,8 @@ jobs: before_script: - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - mkdir -p /usr/local/man; + sudo mkdir -p /usr/local/man; + sudo chown -R "${USER}:admin" /usr/local/man; pip install --quiet conan; export HOMEBREW_NO_AUTO_UPDATE=1; brew install ghostscript; -- cgit v0.12 From 4fcf0ebe7f8b5040fa6b8cca72de6cfa774d4b15 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Oct 2018 18:25:55 +0200 Subject: Bug 710654 - on a \page does not copy the image to the html output folder Create possibility to copy the image automatically to the HTML directory, in case file cannot be found no warning is given (consistency). --- src/docparser.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index b39b80e..6057f1c 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -266,7 +266,7 @@ static void unescapeCRef(QCString &s) * copies the image to the output directory (which depends on the \a type * parameter). */ -static QCString findAndCopyImage(const char *fileName,DocImage::Type type) +static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool warn = true) { QCString result; bool ambig; @@ -334,7 +334,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) } else { - printf("Source & Destination are the same!\n"); + printf("Source and Destination are the same!\n"); } } else @@ -362,7 +362,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) return baseName; } } - else if (ambig) + else if (ambig && warn) { QCString text; text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName)); @@ -373,7 +373,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) else { result=fileName; - if (result.left(5)!="http:" && result.left(6)!="https:") + if (result.left(5)!="http:" && result.left(6)!="https:" && warn) { warn_doc_error(g_fileName,doctokenizerYYlineno, "image file %s is not found in IMAGE_PATH: " @@ -1750,7 +1750,8 @@ static void handleImg(DocNode *parent,QList &children,const HtmlAttribL // and remove the src attribute bool result = attrList.remove(index); ASSERT(result); - DocImage *img = new DocImage(parent,attrList,opt->value,DocImage::Html,opt->value); + DocImage::Type t = DocImage::Html; + DocImage *img = new DocImage(parent,attrList,findAndCopyImage(opt->value,t,false),t,opt->value); children.append(img); found = TRUE; } -- cgit v0.12 From 7ef3ba54570275a423ce52f65437607446c15b12 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 12 Oct 2018 19:22:07 +0200 Subject: Bug 719541 - Error with inserting images to PDF with Markdown Create possibility to use images in other output formats conform the `\image` command. --- src/markdown.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index c19d6db..5310a29 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -647,6 +647,27 @@ static int processEmphasis(GrowBuf &out,const char *data,int offset,int size) return 0; } +static void writeMarkdownImage(GrowBuf &out, const char *fmt, bool explicitTitle, QCString title, QCString content, QCString link, FileDef *fd) +{ + out.addStr("@image "); + out.addStr(fmt); + out.addStr(" "); + out.addStr(link.mid(fd ? 0 : 5)); + if (!explicitTitle && !content.isEmpty()) + { + out.addStr(" \""); + out.addStr(content); + out.addStr("\""); + } + else if ((content.isEmpty() || explicitTitle) && !title.isEmpty()) + { + out.addStr(" \""); + out.addStr(title); + out.addStr("\""); + } + out.addStr("\n"); +} + static int processLink(GrowBuf &out,const char *data,int,int size) { QCString content; @@ -854,20 +875,10 @@ static int processLink(GrowBuf &out,const char *data,int,int size) (fd=findFileDef(Doxygen::imageNameDict,link,ambig))) // assume doxygen symbol link or local image link { - out.addStr("@image html "); - out.addStr(link.mid(fd ? 0 : 5)); - if (!explicitTitle && !content.isEmpty()) - { - out.addStr(" \""); - out.addStr(content); - out.addStr("\""); - } - else if ((content.isEmpty() || explicitTitle) && !title.isEmpty()) - { - out.addStr(" \""); - out.addStr(title); - out.addStr("\""); - } + writeMarkdownImage(out, "html", explicitTitle, title, content, link, fd); + writeMarkdownImage(out, "latex", explicitTitle, title, content, link, fd); + writeMarkdownImage(out, "rtf", explicitTitle, title, content, link, fd); + writeMarkdownImage(out, "docbook", explicitTitle, title, content, link, fd); } else { -- cgit v0.12 From eec2d3b6a9f80715fb590b0fb67b7fe87ba5fee7 Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Sat, 13 Oct 2018 14:43:48 -0500 Subject: sqlite3: fix missing external_file view schema col --- src/sqlite3gen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index 8e236c1..a7d7f21 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -370,6 +370,7 @@ const char * table_schema[][2] = { ")\n" "as SELECT \n" "\tpath.rowid,\n" + "\tpath.found,\n" "\tpath.name\n" "FROM path WHERE path.type=1 AND path.local=0;\n" }, -- cgit v0.12 From e527ca809cc420ff949f92ca303607008c4caedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Mon, 15 Oct 2018 18:36:49 +0200 Subject: Update docbookgen.cpp --- src/docbookgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index bfec8bf..9398f59 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -1259,7 +1259,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) } for (nli.toFirst();(nd=nli.current());++nli) { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes + if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes { t << " " << endl; t << " " << endl; -- cgit v0.12 From ced0429fa4f85a8a3e2d0f482944e24a5dc8f8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Mon, 15 Oct 2018 18:37:34 +0200 Subject: Update dot.cpp --- src/dot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dot.cpp b/src/dot.cpp index 5f52210..f07a365 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -139,7 +139,7 @@ static const char svgZoomFooter[] = " \n" " \n" " \n" -// link to orginial SVG +// link to original SVG " \n" " \n" " \n" -- cgit v0.12 From a49fc86a1b8e944e4ed9c1f8f66a069586e867fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Mon, 15 Oct 2018 18:38:21 +0200 Subject: Update sqlite3gen.cpp --- src/sqlite3gen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index 6cd9581..0d7843a 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -812,7 +812,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl) NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes + if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes { int refid = insertRefid(nd->getOutputFileBase()); bindIntParameter(innernamespace_insert,":refid",refid); -- cgit v0.12 From 6c1b3353e9b622f9117e95c2ac99d395a32b0049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20M=C3=BCller?= <27155134+arm-in@users.noreply.github.com> Date: Mon, 15 Oct 2018 18:38:58 +0200 Subject: Update xmlgen.cpp --- src/xmlgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index be866a2..06e0418 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1163,7 +1163,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes + if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymous scopes { t << " getOutputFileBase() << "\">" << convertToXML(nd->name()) << "" << endl; -- cgit v0.12 From 93b085e465a42eb26ef8305edfc6d61ba6ce858f Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 16 Oct 2018 11:04:51 +0200 Subject: issue_6547 Call graph missing due to ALIASES The fix as given in pull request #6548 worked but at some places it didn't work as the backslash (`\`) was eaten, replacing the backslash with a `@` solves the issue. --- src/doxygen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 13c60fb..54093eb 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -9889,7 +9889,7 @@ static void escapeAliases() while ((in=value.find("^^",p))!=-1) { newValue+=value.mid(p,in-p); - newValue+="\\_linebr"; + newValue+="@_linebr"; p=in+2; } newValue+=value.mid(p,value.length()-p); -- cgit v0.12 From e4f408eb4aad7fb035847616debe68fe115e2ae4 Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Tue, 16 Oct 2018 19:40:13 -0500 Subject: sqlite3: require sqlite >= 3.9.0 The generated schema is malformed in versions below 3.9.0. --- CMakeLists.txt | 5 ++++- cmake/FindSQLite3.cmake | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e0fb55..45c2f2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,10 @@ find_package(BISON REQUIRED) find_package(Threads) if (sqlite3) - find_package(SQLite3 REQUIRED) + find_package(SQLite3 REQUIRED) + if (SQLITE3_VERSION VERSION_LESS 3.9.0) + message(SEND_ERROR "Doxygen requires at least sqlite3 version 3.9.0 (installed: ${SQLITE3_VERSION})") + endif() endif() find_package(Iconv REQUIRED) diff --git a/cmake/FindSQLite3.cmake b/cmake/FindSQLite3.cmake index 77b8eb4..45cc212 100644 --- a/cmake/FindSQLite3.cmake +++ b/cmake/FindSQLite3.cmake @@ -71,8 +71,16 @@ else (SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS) endif (SQLITE3_INCLUDE_DIRS AND SQLITE3_LIBRARIES) if (SQLITE3_FOUND) + + # Extract version from header file + find_file(SQLITE3_HEADER "sqlite3.h" HINTS ${SQLITE3_INCLUDE_DIRS}) + if(SQLITE3_HEADER) + file(STRINGS "${SQLITE3_HEADER}" _DEF_TMP REGEX "^#define SQLITE_VERSION +\\\"[^\\\"]+\\\"") + string (REGEX REPLACE ".*\\\"(([0-9]+[.]?)+).*" "\\1" SQLITE3_VERSION "${_DEF_TMP}") + endif (SQLITE3_HEADER) + if (NOT Sqlite3_FIND_QUIETLY) - message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES}") + message(STATUS "Found Sqlite3: ${SQLITE3_LIBRARIES} (found version \"${SQLITE3_VERSION}\")") endif (NOT Sqlite3_FIND_QUIETLY) else (SQLITE3_FOUND) if (Sqlite3_FIND_REQUIRED) -- cgit v0.12 From 55063c91fa74921d0c5c7c84d1784ce617f0d53b Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 17 Oct 2018 11:11:53 +0200 Subject: Remove old obsolete docbook generator The docbook generator has been replaced by a new implementation. The old implementation was still present, removed now (disrupts easy updates due to false positive searches in the code). --- src/docbookgen.cpp | 2147 ---------------------------------------------------- src/docbookgen.h | 2 - src/doxygen.cpp | 11 - 3 files changed, 2160 deletions(-) diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index bfec8bf..8c8ed90 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -70,52 +70,6 @@ #endif //------------------ -class DocbookSectionMapper : public QIntDict -{ - public: - DocbookSectionMapper() : QIntDict(47) - { - insert(MemberListType_pubTypes,"public-type"); - insert(MemberListType_pubMethods,"public-func"); - insert(MemberListType_pubAttribs,"public-attrib"); - insert(MemberListType_pubSlots,"public-slot"); - insert(MemberListType_signals,"signal"); - insert(MemberListType_dcopMethods,"dcop-func"); - insert(MemberListType_properties,"property"); - insert(MemberListType_events,"event"); - insert(MemberListType_pubStaticMethods,"public-static-func"); - insert(MemberListType_pubStaticAttribs,"public-static-attrib"); - insert(MemberListType_proTypes,"protected-type"); - insert(MemberListType_proMethods,"protected-func"); - insert(MemberListType_proAttribs,"protected-attrib"); - insert(MemberListType_proSlots,"protected-slot"); - insert(MemberListType_proStaticMethods,"protected-static-func"); - insert(MemberListType_proStaticAttribs,"protected-static-attrib"); - insert(MemberListType_pacTypes,"package-type"); - insert(MemberListType_pacMethods,"package-func"); - insert(MemberListType_pacAttribs,"package-attrib"); - insert(MemberListType_pacStaticMethods,"package-static-func"); - insert(MemberListType_pacStaticAttribs,"package-static-attrib"); - insert(MemberListType_priTypes,"private-type"); - insert(MemberListType_priMethods,"private-func"); - insert(MemberListType_priAttribs,"private-attrib"); - insert(MemberListType_priSlots,"private-slot"); - insert(MemberListType_priStaticMethods,"private-static-func"); - insert(MemberListType_priStaticAttribs,"private-static-attrib"); - insert(MemberListType_friends,"friend"); - insert(MemberListType_related,"related"); - insert(MemberListType_decDefineMembers,"define"); - insert(MemberListType_decProtoMembers,"prototype"); - insert(MemberListType_decTypedefMembers,"typedef"); - insert(MemberListType_decEnumMembers,"enum"); - insert(MemberListType_decFuncMembers,"func"); - insert(MemberListType_decVarMembers,"var"); - } -}; - -static DocbookSectionMapper g_docbookSectionMapper; - - inline void writeDocbookString(FTextStream &t,const char *s) { t << convertToDocBook(s); @@ -149,20 +103,6 @@ inline void writeDocbookCodeString(FTextStream &t,const char *s, int &col) } } -static void writeDocbookHeaderMainpage(FTextStream &t, QCString &pageName) -{ - t << "" << endl;; - t << "" << endl; -} - -static void writeDocbookHeader_ID(FTextStream &t, QCString id) -{ - t << "" << endl;; - t << "
    " << endl; -} - static void addIndexTerm(FTextStream &t, QCString prim, QCString sec = "") { t << ""; @@ -187,25 +127,6 @@ void writeDocbookLink(FTextStream &t,const char * /*extRef*/,const char *compoun t << ""; } -class TextGeneratorDocbookImpl : public TextGeneratorIntf -{ - public: - TextGeneratorDocbookImpl(FTextStream &t): m_t(t) {} - void writeString(const char *s,bool /*keepSpaces*/) const - { - writeDocbookString(m_t,s); - } - void writeBreak(int) const {} - void writeLink(const char *extRef,const char *file, - const char *anchor,const char *text - ) const - { - writeDocbookLink(m_t,extRef,file,anchor,text,0); - } - private: - FTextStream &m_t; -}; - DocbookCodeGenerator::DocbookCodeGenerator(FTextStream &t) : m_lineNumber(-1), m_col(0), m_insideCodeLine(FALSE), m_insideSpecialHL(FALSE) { @@ -328,2074 +249,6 @@ void DocbookCodeGenerator::endCodeFragment() m_t << "" << endl; } -static void writeTemplateArgumentList(ArgumentList *al, - FTextStream &t, - Definition *scope, - FileDef *fileScope, - int indent) -{ - QCString indentStr; - indentStr.fill(' ',indent); - if (al) - { - t << indentStr << "" << endl; - ArgumentListIterator ali(*al); - Argument *a; - for (ali.toFirst();(a=ali.current());++ali) - { - t << indentStr << " " << endl; - if (!a->type.isEmpty()) - { - t << indentStr << " "; - linkifyText(TextGeneratorDocbookImpl(t),scope,fileScope,0,a->type); - t << "" << endl; - } - if (!a->name.isEmpty()) - { - t << indentStr << " " << a->name << "" << endl; - t << indentStr << " " << a->name << "" << endl; - } - if (!a->defval.isEmpty()) - { - t << indentStr << " "; - linkifyText(TextGeneratorDocbookImpl(t),scope,fileScope,0,a->defval); - t << "" << endl; - } - t << indentStr << " " << endl; - } - t << indentStr << "" << endl; - } -} - -static void writeTemplateList(ClassDef *cd,FTextStream &t) -{ - writeTemplateArgumentList(cd->templateArguments(),t,cd,0,4); -} - -static void writeDocbookDocBlock(FTextStream &t, - const QCString &fileName, - int lineNr, - Definition *scope, - MemberDef * md, - const QCString &text) -{ - QCString stext = text.stripWhiteSpace(); - if (stext.isEmpty()) return; - // convert the documentation string into an abstract syntax tree - DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,text,FALSE,FALSE); - // create a code generator - DocbookCodeGenerator *docbookCodeGen = new DocbookCodeGenerator(t); - // create a parse tree visitor for Docbook - DocbookDocVisitor *visitor = new DocbookDocVisitor(t,*docbookCodeGen); - // visit all nodes - root->accept(visitor); - // clean up - delete visitor; - delete docbookCodeGen; - delete root; -} - -void writeDocbookCodeBlock(FTextStream &t,FileDef *fd) -{ - ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension()); - SrcLangExt langExt = getLanguageFromFileName(fd->getDefFileExtension()); - pIntf->resetCodeParserState(); - DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t); - pIntf->parseCode(*docbookGen, // codeOutIntf - 0, // scopeName - fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES)), - langExt, // lang - FALSE, // isExampleBlock - 0, // exampleName - fd, // fileDef - -1, // startLine - -1, // endLine - FALSE, // inlineFragement - 0, // memberDef - TRUE // showLineNumbers - ); - docbookGen->finish(); - delete docbookGen; -} - -static QCString classOutputFileBase(ClassDef *cd) -{ - //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES); - //if (inlineGroupedClasses && cd->partOfGroups()!=0) - return cd->getOutputFileBase(); - //else - // return cd->getOutputFileBase(); -} - -static QCString memberOutputFileBase(MemberDef *md) -{ - //static bool inlineGroupedClasses = Config_getBool(INLINE_GROUPED_CLASSES); - //if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0) - // return md->getClassDef()->getDocbookOutputFileBase(); - //else - // return md->getOutputFileBase(); - return md->getOutputFileBase(); -} - -static void generateTOC(FTextStream &t, PageDef *pd) -{ - if (pd->localToc().isDocbookEnabled()) - { - t << " " << endl; - t << " " << theTranslator->trRTFTableOfContents() << "" << endl; - SectionDict *sectionDict = pd->getSectionDict(); - SDict::Iterator li(*sectionDict); - SectionInfo *si; - int level=1,l; - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; - int maxLevel = pd->localToc().docbookLevel(); - for (li.toFirst();(si=li.current());++li) - { - if (si->type==SectionInfo::Section || - si->type==SectionInfo::Subsection || - si->type==SectionInfo::Subsubsection || - si->type==SectionInfo::Paragraph) - { - //printf(" level=%d title=%s\n",level,si->title.data()); - int nextLevel = (int)si->type; - if (nextLevel>level) - { - for (l=level;l" << endl; - } - } - else if (nextLevelnextLevel;l--) - { - inLi[l]=FALSE; - if (l <= maxLevel) t << " " << endl; - } - } - if (nextLevel <= maxLevel) - { - QCString titleDoc = convertToDocBook(si->title); - t << " " << (si->title.isEmpty()?si->label:titleDoc) << "" << endl; - } - inLi[nextLevel]=TRUE; - level = nextLevel; - } - } - t << " " << endl; - } -} - -static void generateSourceRefList(FTextStream &t,const char *scopeName, const QCString &text,MemberSDict *members, Definition *def) -{ - static bool sourceBrowser = Config_getBool(SOURCE_BROWSER); - static bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE); - - if (members) - { - members->sort(); - - t << "" << convertToDocBook(text) << ""; - - QCString ldefLine=theTranslator->trWriteList(members->count()); - - QRegExp marker("@[0-9]+"); - int index=0,newIndex,matchLen; - // now replace all markers in inheritLine with links to the classes - while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1) - { - bool ok; - t << convertToDocBook(ldefLine.mid(index,newIndex-index)); - uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok); - MemberDef *md=members->at(entryIndex); - if (ok && md) - { - QCString scope=md->getScopeString(); - QCString name=md->name(); - //printf("class=%p scope=%s scopeName=%s\n",md->getClassDef(),scope.data(),scopeName); - if (!scope.isEmpty() && scope!=scopeName) - { - name.prepend(scope+getLanguageSpecificSeparator(def->getLanguage())); - } - if (!md->isObjCMethod() && - (md->isFunction() || md->isSlot() || - md->isPrototype() || md->isSignal() - ) - ) - { - name+="()"; - } - //Definition *d = md->getOutputFileBase(); - //if (d==Doxygen::globalScope) d=md->getBodyDef(); - if (sourceBrowser && - !(md->isLinkable() && !refLinkSource) && - md->getStartBodyLine()!=-1 && - md->getBodyDef() - ) - { - //printf("md->getBodyDef()=%p global=%p\n",md->getBodyDef(),Doxygen::globalScope); - - const int maxLineNrStr = 10; - char anchorStr[maxLineNrStr]; - qsnprintf(anchorStr,maxLineNrStr,"l%05d",md->getStartBodyLine()); - //printf("Write object link to %s\n",md->getBodyDef()->getSourceFileBase().data()); - t << convertToDocBook(name); - // or - // ol.writeObjectLink(0,md->getBodyDef()->getSourceFileBase(),anchorStr,name); - } - else if (md->isLinkable() /*&& d && d->isLinkable()*/) - { - t << convertToDocBook(name); - // or - // ol.writeObjectLink(md->getReference(), md->getOutputFileBase(), md->anchor(),name); - } - else - { - t << convertToDocBook(name); - } - } - index=newIndex+matchLen; - } - t << ldefLine.right(ldefLine.length()-index); - t<< "."; - t << ""; - } -} -static void generateInlineCode(FTextStream &t,const char *scopeName, Definition *def) -{ - static bool inlineSources = Config_getBool(INLINE_SOURCES); - //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(), - // m_startBodyLine,m_endBodyLine,m_bodyDef); - if (inlineSources && def->hasSources()) - { - QCString codeFragment; - int actualStart=def->getStartBodyLine(),actualEnd=def->getEndBodyLine(); - if (readCodeFragment(def->getBodyDef()->absFilePath(), - actualStart,actualEnd,codeFragment) - ) - { - //printf("Adding code fragment '%s' ext='%s'\n", - // codeFragment.data(),m_impl->defFileExt.data()); - ParserInterface *pIntf = Doxygen::parserManager->getParser(def->getDefFileExtension()); - pIntf->resetCodeParserState(); - //printf("Read:\n`%s'\n\n",codeFragment.data()); - MemberDef *thisMd = 0; - if (def->definitionType()==Definition::TypeMember) thisMd = (MemberDef *)def; - - DocbookCodeGenerator *docbookGen = new DocbookCodeGenerator(t); - docbookGen->startCodeFragment(); - pIntf->parseCode(*docbookGen, // codeOutIntf - scopeName, // scope - codeFragment, // input - def->getLanguage(), // lang - FALSE, // isExample - 0, // exampleName - def->getBodyDef(), // fileDef - actualStart, // startLine - actualEnd, // endLine - TRUE, // inlineFragment - thisMd, // memberDef - TRUE // show line numbers - ); - docbookGen->finish(); - docbookGen->endCodeFragment(); - delete docbookGen; - } - } -} - -static void definedAtLine(int line, QCString fileName, FTextStream &t) -{ - QCString refText = theTranslator->trDefinedAtLineInSourceFile(); - int lineMarkerPos = refText.find("@0"); - int fileMarkerPos = refText.find("@1"); - if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this. - { - if (lineMarkerPosmemberType()==MemberType_EnumValue) return; - if (md->isHidden()) return; - //if (md->name().at(0)=='@') return; // anonymous member - - // group members are only visible in their group - //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return; - QCString memType; - switch (md->memberType()) - { - case MemberType_Define: memType="define"; break; - case MemberType_Function: memType="function"; break; - case MemberType_Variable: memType="variable"; break; - case MemberType_Typedef: memType="typedef"; break; - case MemberType_Enumeration: memType="enum"; break; - case MemberType_EnumValue: ASSERT(0); break; - case MemberType_Signal: memType="signal"; break; - case MemberType_Slot: memType="slot"; break; - case MemberType_Friend: memType="friend"; break; - case MemberType_DCOP: memType="dcop"; break; - case MemberType_Property: memType="property"; break; - case MemberType_Event: memType="event"; break; - case MemberType_Interface: memType="interface"; break; - case MemberType_Service: memType="service"; break; - } - QCString scopeName; - if (md->getClassDef()) - { - scopeName=md->getClassDef()->name(); - } - else if (md->getNamespaceDef()) - { - scopeName=md->getNamespaceDef()->name(); - } - if (detailed==0) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - //enum - bool closePara=TRUE; - if (md->memberType()==MemberType_Enumeration) - { - bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE }; - MemberList *enumFields = md->enumFieldList(); - t << " " << memType << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (enumFields!=0) - { - MemberListIterator emli(*enumFields); - MemberDef *emd; - t << " {" << endl; - int cnt=0; - for (emli.toFirst();(emd=emli.current());++emli) - { - if (cnt!=0) - { - t << "," << endl; - } - t << "anchor() << "\">"; - writeDocbookString(t,emd->name()); - t << ""; - if (!emd->initializer().isEmpty()) - { - writeDocbookString(t,emd->initializer()); - } - cnt++; - } - t << endl << "}"; - } - t << "" << endl; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else if (md->memberType()==MemberType_Define) - { - t << " " << "#" << memType << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (!md->initializer().isEmpty() && md->initializer().length()<2000) - { - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->initializer()); - } - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else if (md->memberType()==MemberType_Variable) - { - if (md->getClassDef()) - { - t << " " << convertToDocBook(md->declaration()); - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << ""; - } - } - else - { - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - } - else if (md->memberType()==MemberType_Typedef) - { - t << " " << memType; - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " "; - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else if (md->memberType()==MemberType_Function) - { - t << " "; - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,md->typeString()); - t << " getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << convertToDocBook(md->name()) << ""; - t << " (" << endl; - ArgumentList *declAl = md->declArgumentList(); - if (declAl && declAl->count()>0) - { - ArgumentListIterator declAli(*declAl); - Argument *a; - int cnt=0; - for (declAli.toFirst();(a=declAli.current());++declAli) - { - if (cnt!=0) - { - t << ", "; - } - if (!a->type.isEmpty()) - { - linkifyText(TextGeneratorDocbookImpl(t),def,md->getBodyDef(),md,a->type); - } - t << " "; - if (!a->name.isEmpty()) - { - writeDocbookString(t,a->name); - } - cnt++; - } - } - t << ")"; - if (md->briefDescription()) - { - t << ""; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - else - { - closePara = FALSE; - } - if (closePara) t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - else - { - if (md->memberType()==MemberType_Enumeration) - { - MemberList *enumFields = md->enumFieldList(); - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << memType << " " << convertToDocBook(md->name()) << " " << "" << endl; - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - if (enumFields!=0) - { - MemberListIterator emli(*enumFields); - MemberDef *emd; - t << " " << endl; - t << " " << theTranslator->trEnumerationValues() << ":" << endl; - t << " " << endl; - for (emli.toFirst();(emd=emli.current());++emli) - { - t << " anchor() << "\">" << endl; - t << " "; - writeDocbookString(t,emd->name()); - t << "" << endl; - t << " " << endl; - if(Config_getBool(REPEAT_BRIEF)) - { - t << " "; - writeDocbookString(t,emd->briefDescription()); - t << "" << endl; - } - t << " " << endl; - t << " " << endl; - } - t << " " << endl; - t << " " << endl; - t << " "; - t << " "; - definedAtLine(md->getDefLine(),stripPath(md->getDefFileName()),t); - t << "" << endl; - - t << " " << endl; - t << "{" << endl; - for (emli.toFirst();(emd=emli.current());++emli) - { - writeDocbookString(t,emd->name()); - if (!emd->initializer().isEmpty()) - { - writeDocbookString(t,emd->initializer()); - } - t << ", " << endl; - } - t << "}" << convertToDocBook(md->name()) << ";" << endl; - t << " " << endl; - t << " " << endl; - } - t << "
    " << endl; - } - else if (md->memberType()==MemberType_Typedef) - { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - if(Config_getBool(REPEAT_BRIEF)) - { - t << " "; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
    " << endl; - } - else if (md->memberType()==MemberType_Function) - { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << " " << convertToDocBook(md->argsString()) << ""; - addIndexTerm(t,md->name(),def->name()); - addIndexTerm(t,def->name(),md->name()); - if(Config_getBool(REPEAT_BRIEF)) - { - if (!md->briefDescription().isEmpty()) - { - t << " "; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - } - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - - if (Config_getBool(REFERENCED_BY_RELATION)) - { - generateSourceRefList(t,md->name(),theTranslator->trReferencedBy(),md->getReferencedByMembers(),md); - } - if (Config_getBool(REFERENCES_RELATION)) - { - generateSourceRefList(t,md->name(),theTranslator->trReferences(),md->getReferencesMembers(),md); - } - generateInlineCode(t,md->name(),md); - t << "
    " << endl; - } - else if (md->memberType()==MemberType_Define) - { - if (md->documentation()) - { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
    " << endl; - } - } - else if (md->memberType()==MemberType_Variable) - { - if (md->getClassDef()) - { - if (md->documentation()) - { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - addIndexTerm(t,md->name(),def->name()); - addIndexTerm(t,def->name(),md->name()); - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
    " << endl; - } - } - else - { - t << "
    getGroupDef() && def->definitionType()==Definition::TypeGroup) - { - t << md->getGroupDef()->getOutputFileBase(); - } - else - { - t << memberOutputFileBase(md); - } - t << "_1" << md->anchor() << "\">" << endl; - t << " " << convertToDocBook(md->definition()) << ""; - addIndexTerm(t,md->name(),def->name()); - addIndexTerm(t,def->name(),md->name()); - if(Config_getBool(REPEAT_BRIEF)) - { - t << " "; - writeDocbookString(t,md->briefDescription()); - t << "" << endl; - } - t << " "; - writeDocbookDocBlock(t,md->docFile(),md->docLine(),md->getOuterScope(),md,md->documentation()); - t << endl; - t << "
    " << endl; - } - } - } -} - -static void generateDocbookSection(Definition *d,FTextStream &t,MemberList *ml,const char *, - bool detailed=0, const char *header=0,const char *documentation=0) -{ - if (ml==0) return; - MemberListIterator mli(*ml); - MemberDef *md; - int count=0; - int doc_count=0; - QCString title, desctitle, subtitle; - - for (mli.toFirst();(md=mli.current());++mli) - { - // namespace members are also inserted in the file scope, but - // to prevent this duplication in the Docbook output, we filter those here. - if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) - { - count++; - } - } - - if (count==0) return; // empty list - - subtitle = ""; - switch (ml->listType()) - { - case MemberListType_pubMethods: d->getLanguage()==SrcLangExt_ObjC ? title = theTranslator->trInstanceMethods() : title = theTranslator->trPublicMembers(); - switch (d->getLanguage()) - { - case SrcLangExt_ObjC: desctitle = theTranslator->trMethodDocumentation(); break; - case SrcLangExt_Fortran: desctitle = theTranslator->trMemberFunctionDocumentationFortran(); break; - default: desctitle = theTranslator->trMemberFunctionDocumentation(); break; - }; - break; - case MemberListType_priMethods: title=theTranslator->trPrivateMembers(); desctitle=""; break; - - case MemberListType_decTypedefMembers: title=theTranslator->trTypedefs(); desctitle=theTranslator->trTypedefDocumentation(); break; - case MemberListType_decEnumMembers: title=theTranslator->trEnumerations(); desctitle=theTranslator->trEnumerationTypeDocumentation(); break; - case MemberListType_decFuncMembers: title=theTranslator->trFunctions(); desctitle=theTranslator->trFunctionDocumentation(); break; - case MemberListType_decVarMembers: title=theTranslator->trVariables(); desctitle=theTranslator->trVariableDocumentation(); break; - case MemberListType_pubAttribs: title=theTranslator->trPublicAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; - case MemberListType_priAttribs: title=theTranslator->trPrivateAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; - case MemberListType_proAttribs: title=theTranslator->trProtectedAttribs(); desctitle=theTranslator->trMemberDataDocumentation(); break; - case MemberListType_decDefineMembers: title=theTranslator->trDefines(); desctitle=theTranslator->trDefineDocumentation(); break; - case MemberListType_related: title=theTranslator->trRelatedFunctions(); desctitle=theTranslator->trRelatedFunctionDocumentation(); - subtitle=theTranslator->trRelatedSubscript(); break; - default: title=""; desctitle=""; - } - - if (detailed) - { - for (mli.toFirst();(md=mli.current());++mli) - { - if (md->documentation().isEmpty() && !Config_getBool(REPEAT_BRIEF)) - { - continue; - } - doc_count = 1; - break; - } - - if(doc_count == 0) return; - - if (!QCString(header).isEmpty()) - { - t << "
    " << endl; - t << " " << convertToDocBook(header) << "" << endl; - } - else if (desctitle) - { - t << "
    " << endl; - t << " " << desctitle << "" << endl; - } - } - else - { - t << "
    " << endl; - if (!QCString(header).isEmpty()) - { - t << " " << convertToDocBook(header) << "" << endl; - } - else - { - t << " " << title << "" << endl; - } - if (!subtitle.isEmpty()) - t << " " << subtitle << "" << endl; - } - - if (documentation) - { - t << " "; - writeDocbookDocBlock(t,d->docFile(),d->docLine(),d,0,documentation); - t << "" << endl; - } - for (mli.toFirst();(md=mli.current());++mli) - { - // namespace members are also inserted in the file scope, but - // to prevent this duplication in the Docbook output, we filter those here. - if (d->definitionType()!=Definition::TypeFile || md->getNamespaceDef()==0) - { - if (detailed && md->documentation().isEmpty() && !Config_getBool(REPEAT_BRIEF)) - { - continue; - } - - generateDocbookForMember(md,t,d,detailed); - } - } - if (detailed) - { - if (!QCString(header).isEmpty()) - { - t << "
    " << endl; - } - else if (desctitle) - { - t << "
    " << endl; - } - } - else - { - t << "
    " << endl; - } -} - -static void writeInnerClasses(const ClassSDict *cl,FTextStream &t) -{ - if (cl) - { - ClassSDict::Iterator cli(*cl); - ClassDef *cd; - QCString title = theTranslator->trClasses(); - - if (cli.toFirst()) - { - t << "
    " << endl; - t << " " << title << " " << endl; - } - for (cli.toFirst();(cd=cli.current());++cli) - { - if (!cd->isHidden() && cd->name().find('@')==-1) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "struct " << convertToDocBook(cd->name()) << ""; - t << "" << endl; - if (cd->briefDescription()) - { - t << ""; - writeDocbookString(t,cd->briefDescription()); - t << "" << endl; - } - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - } - if (cli.toFirst()) - { - t << "
    " << endl; - } - } -} - -static void writeInnerNamespaces(const NamespaceSDict *nl,FTextStream &t) -{ - if (nl) - { - NamespaceSDict::Iterator nli(*nl); - NamespaceDef *nd; - QCString title = theTranslator->trNamespaces(); - - if (nli.toFirst()) - { - t << " " << endl; - t << " " << title << " " << endl; - } - for (nli.toFirst();(nd=nli.current());++nli) - { - if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "struct getOutputFileBase() << "\">" << convertToDocBook(nd->name()) << ""; - t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - } - if (nli.toFirst()) - { - t << " " << endl; - } - } -} - -static void writeInnerFiles(const FileList *fl,FTextStream &t) -{ - if (fl) - { - QListIterator fli(*fl); - FileDef *fd; - QCString title = theTranslator->trFile(TRUE,TRUE); - - if (fli.toFirst()) - { - t << " " << endl; - t << " " << title << " " << endl; - } - for (fli.toFirst();(fd=fli.current());++fli) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "file getOutputFileBase() << "\">" << convertToDocBook(fd->name()) << ""; - t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - if (fli.toFirst()) - { - t << " " << endl; - } - } -} - -static void writeInnerPages(const PageSDict *pl,FTextStream &t) -{ - if (pl) - { - PageSDict::Iterator pli(*pl); - PageDef *pd; - - for (pli.toFirst();(pd=pli.current());++pli) - { - t << "getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; - } - } -} - -static void writeInnerGroups(const GroupList *gl,FTextStream &t) -{ - if (gl) - { - GroupListIterator gli(*gl); - GroupDef *sgd; - - //Docbook header tags for inner groups - if (gli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trModules() << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - - for (gli.toFirst();(sgd=gli.current());++gli) - { - t << " getOutputFileBase() << "\">" << convertToDocBook(sgd->groupTitle()) << "" << endl; - } - - //Docbook footer tags for inner groups - if (gli.toFirst()) - { - t << " " << endl; - t << " " << endl; - } - - } -} - -static void writeInnerDirs(const DirList *dl,FTextStream &t) -{ - if (dl) - { - QListIterator subdirs(*dl); - DirDef *subdir; - QCString title = theTranslator->trDirectories(); - if (subdirs.toFirst()) - { - t << " " << endl; - t << " " << title << " " << endl; - } - for (subdirs.toFirst();(subdir=subdirs.current());++subdirs) - { - t << " " << endl; - t << " " << endl; - t << " " << endl; - t << " " << "dir getOutputFileBase() << "\">" << convertToDocBook(subdir->displayName()) << ""; - t << "" << endl; - t << " " << endl; - t << " " << endl; - t << " " << endl; - } - if (subdirs.toFirst()) - { - t << " " << endl; - } - } -} - -static void writeInnerGroupFiles(const GroupList *gl,FTextStream &t) -{ - if (gl) - { - GroupListIterator gli(*gl); - GroupDef *sgd; - - for (gli.toFirst();(sgd=gli.current());++gli) - { - t << "getOutputFileBase() << ".xml\" xmlns:xi=\"http://www.w3.org/2001/XInclude\"/>" << endl; - } - } -} - -static void generateDocbookForClass(ClassDef *cd,FTextStream &ti) -{ - // + brief description - // + detailed description - // + template argument list(s) - // - include file - // + member groups - // + inheritance diagram - // + list of direct super classes - // + list of direct sub classes - // + list of inner classes - // + collaboration diagram - // + list of all members - // + user defined member sections - // + standard member sections - // + detailed member documentation - // - examples using the class - - if (cd->isReference()) return; // skip external references. - if (cd->isHidden()) return; // skip hidden classes. - if (cd->name().find('@')!=-1) return; // skip anonymous compounds. - if (cd->templateMaster()!=0) return; // skip generated template instances. - - msg("Generating Docbook output for class %s\n",cd->name().data()); - - QCString fileDocbook=cd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+ classOutputFileBase(cd)+".xml"; - QCString relPath = relativePathToRoot(fileName); - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - writeDocbookHeader_ID(t, classOutputFileBase(cd)); - t << ""; - writeDocbookString(t,cd->name()); - addIndexTerm(t,cd->name()); - t << " " << cd->compoundTypeString() << " Reference"; - t << "" << endl; - if (cd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription()); - t << " " << endl; - } - - IncludeInfo *ii=cd->includeInfo(); - if (ii) - { - QCString nm = ii->includeName; - if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName(); - if (!nm.isEmpty()) - { - t << "" << endl; - t << " #include "; - if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references - { - t << "fileDef->getOutputFileBase() << "\">"; - } - if (ii->local) - { - t << """; - } - else - { - t << "<"; - } - t << convertToDocBook(nm); - if (ii->local) - { - t << """; - } - else - { - t << ">"; - } - if (ii->fileDef && !ii->fileDef->isReference()) - { - t << ""; - } - t << "" << endl; - t << "" << endl; - } - } - - if (Config_getBool(HAVE_DOT) && (Config_getBool(CLASS_DIAGRAMS) || Config_getBool(CLASS_GRAPH))) - { - t << "Inheritance diagram for " << convertToDocBook(cd->name()) << "" << endl; - DotClassGraph inheritanceGraph(cd,DotNode::Inheritance); - inheritanceGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE); - } - - if (Config_getBool(HAVE_DOT) && Config_getBool(COLLABORATION_GRAPH)) - { - t << "Collaboration diagram for " << convertToDocBook(cd->name()) << "" << endl; - DotClassGraph collaborationGraph(cd,DotNode::Collaboration); - collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,TRUE,FALSE); - } - - writeInnerClasses(cd->getClassSDict(),t); - - writeTemplateList(cd,t); - if (cd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(cd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(cd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_detailedLists)==0) - { - generateDocbookSection(cd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - if ((Config_getBool(REPEAT_BRIEF) && cd->briefDescription()) || cd->documentation()) - { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - - if(Config_getBool(REPEAT_BRIEF)) - { - if (cd->briefDescription()) - { - t << " " << endl; - // A title as 'Brief Description' may not be necessary. - //t << " " << theTranslator->trBriefDescription() << "" << endl; - writeDocbookDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription()); - t << " " << endl; - } - } - - if (cd->documentation()) - { - writeDocbookDocBlock(t,cd->docFile(),cd->docLine(),cd,0,cd->documentation()); - } - t << " " << endl; - } - - if (cd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(cd,t,mg->members(),"user-defined",1,mg->header(), - mg->documentation()); - } - } - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_detailedLists)==0) - { - generateDocbookSection(cd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - - /*// TODO: Handling of Inheritance and Colloboration graph for Docbook to be implemented - DotClassGraph inheritanceGraph(cd,DotNode::Inheritance); - if (!inheritanceGraph.isTrivial()) - { - t << " " << endl; - inheritanceGraph.writeDocbook(t); - t << " " << endl; - } - DotClassGraph collaborationGraph(cd,DotNode::Collaboration); - if (!collaborationGraph.isTrivial()) - { - t << " " << endl; - collaborationGraph.writeDocbook(t); - t << " " << endl; - } - t << " getDefFileName() << "\" line=\"" - << cd->getDefLine() << "\""; - if (cd->getStartBodyLine()!=-1) - { - FileDef *bodyDef = cd->getBodyDef(); - if (bodyDef) - { - t << " bodyfile=\"" << bodyDef->absFilePath() << "\""; - } - t << " bodystart=\"" << cd->getStartBodyLine() << "\" bodyend=\"" - << cd->getEndBodyLine() << "\""; - } - t << "/>" << endl; - writeListOfAllMembers(cd,t); - */ - - t << " " << cd->generatedFromFiles() << "" << endl; - t << " " << stripPath(cd->getDefFileName()) << "" << endl; - t << "
    " << endl; - -} - -static void generateDocbookForNamespace(NamespaceDef *nd,FTextStream &ti) -{ - // + contained class definitions - // + contained namespace definitions - // + member groups - // + normal members - // + brief desc - // + detailed desc - // + location - // - files containing (parts of) the namespace definition - - if (nd->isReference() || nd->isHidden()) return; // skip external references - - QCString fileDocbook=nd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+nd->getOutputFileBase()+".xml"; - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - writeDocbookHeader_ID(t, nd->getOutputFileBase()); - t << ""; - addIndexTerm(t,nd->displayName()); - writeDocbookString(t,nd->title()); - t << "" << endl; - - if (nd->briefDescription()) - { - t << " " << endl; - //t << " " << theTranslator->trBriefDescription() << "" << endl; - t << " " << endl; - } - writeInnerClasses(nd->getClassSDict(),t); - writeInnerNamespaces(nd->getNamespaceSDict(),t); - - if (nd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(nd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(nd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(nd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - if ((Config_getBool(REPEAT_BRIEF) && nd->briefDescription()) || nd->documentation()) - { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - - if(Config_getBool(REPEAT_BRIEF)) - { - if (nd->briefDescription()) - { - t << " " << endl; - //t << " " << theTranslator->trBriefDescription() << "" << endl; - writeDocbookDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription()); - t << " " << endl; - } - } - - if (nd->documentation()) - { - writeDocbookDocBlock(t,nd->docFile(),nd->docLine(),nd,0,nd->documentation()); - } - t << " " << endl; - } - - if (nd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(nd,t,mg->members(),"user-defined",1,mg->header(), - mg->documentation()); - } - } - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_detailedLists)==0) - { - if (ml->listType() != MemberListType_allMembersList && - ml->listType() != MemberListType_docFuncMembers) - generateDocbookSection(nd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - // we actually need here "namespace" - // t << " " << theTranslator->trGeneratedFromFiles(ClassDef::Struct, FALSE) << "" << endl; - // t << " " << stripPath(nd->getDefFileName()) << "" << endl; - t << "" << endl; -} - -static void generateDocbookForFile(FileDef *fd,FTextStream &ti) -{ - // + includes files - // + includedby files - // + include graph - // + included by graph - // + contained class definitions - // + contained namespace definitions - // + member groups - // + normal members - // + brief desc - // + detailed desc - // + source code - // + location - // - number of lines - - if (fd->isReference()) return; // skip external references - - QCString fileDocbook=fd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+fd->getOutputFileBase()+".xml"; - QCString relPath = relativePathToRoot(fileName); - - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - writeDocbookHeader_ID(t, fd->getOutputFileBase()); - - t << " "; - writeDocbookString(t,fd->name()); - t << " File Reference"; - t << "" << endl; - - if (fd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); - t << " " << endl; - } - - IncludeInfo *inc; - - if (fd->includeFileList()) - { - QListIterator ili1(*fd->includeFileList()); - for (ili1.toFirst();(inc=ili1.current());++ili1) - { - t << " #include "; - if (inc->local) - { - t << """; - } - else - { - t << "<"; - } - t << convertToDocBook(inc->includeName); - if (inc->local) - { - t << """; - } - else - { - t << ">"; - } - t << "" << endl; - } - } - if (Config_getBool(HAVE_DOT)) - { - if (Config_getBool(INCLUDE_GRAPH)) - { - t << "Include dependency diagram for " << convertToDocBook(fd->name()) << "" << endl; - DotInclDepGraph idepGraph(fd, FALSE); - idepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - if (Config_getBool(INCLUDED_BY_GRAPH)) - { - t << "Included by dependency diagram for " << convertToDocBook(fd->name()) << "" << endl; - DotInclDepGraph ibdepGraph(fd, TRUE); - ibdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - } - - if (fd->getClassSDict()) - { - writeInnerClasses(fd->getClassSDict(),t); - } - if (fd->getNamespaceSDict()) - { - writeInnerNamespaces(fd->getNamespaceSDict(),t); - } - - if (fd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(fd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(fd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(fd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - if(Config_getBool(REPEAT_BRIEF)) - { - if (fd->briefDescription()) - { - writeDocbookDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription()); - } - } - writeDocbookDocBlock(t,fd->docFile(),fd->docLine(),fd,0,fd->documentation()); - if (Config_getBool(FULL_PATH_NAMES)) - { - t << " Definition in file " << fd->getDefFileName() << "" << endl; - } - else - { - t << " Definition in file " << stripPath(fd->getDefFileName()) << "" << endl; - } - t << " " << endl; - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(fd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - - if (Config_getBool(DOCBOOK_PROGRAMLISTING)) - { - t << " " << endl;; - writeDocbookCodeBlock(t,fd); - t << " " << endl; - } - - t << "" << endl; -} - -static void generateDocbookForGroup(GroupDef *gd,FTextStream &ti) -{ - // + members - // + member groups - // + files - // + classes - // + namespaces - // - packages - // + pages - // + child groups - // - examples - // + brief description - // + detailed description - - if (gd->isReference()) return; // skip external references - - if (!gd->isASubGroup()) - { - QCString fileDocbook=gd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - } - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+gd->getOutputFileBase()+".xml"; - QCString relPath = relativePathToRoot(fileName); - - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - writeDocbookHeader_ID(t, gd->getOutputFileBase()); - - t << " " << convertToDocBook(gd->groupTitle()) << "" << endl; - if (gd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription()); - t << " " << endl; - } - - if (Config_getBool(GROUP_GRAPHS) && Config_getBool(HAVE_DOT)) - { - t << "Collaboration diagram for " << convertToDocBook(gd->groupTitle()) << "" << endl; - DotGroupCollaboration collaborationGraph(gd); - collaborationGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - - writeInnerFiles(gd->getFiles(),t); - writeInnerClasses(gd->getClasses(),t); - writeInnerNamespaces(gd->getNamespaces(),t); - writeInnerPages(gd->getPages(),t); - writeInnerGroups(gd->getSubGroups(),t); - - if (gd->getMemberGroupSDict()) - { - MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict()); - MemberGroup *mg; - for (;(mg=mgli.current());++mgli) - { - generateDocbookSection(gd,t,mg->members(),"user-defined",0,mg->header(), - mg->documentation()); - } - } - - QListIterator mli(gd->getMemberLists()); - MemberList *ml; - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(gd,t,ml,g_docbookSectionMapper.find(ml->listType())); - } - } - - if(Config_getBool(REPEAT_BRIEF)) - { - if (gd->briefDescription()) - { - //t << "
    " << endl; - //t << " " << theTranslator->trBriefDescription() << "" << endl; - writeDocbookDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription()); - //t << "
    " << endl; - } - } - - if (gd->documentation()) - { - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - writeDocbookDocBlock(t,gd->docFile(),gd->docLine(),gd,0,gd->documentation()); - t << " " << endl; - } - - for (mli.toFirst();(ml=mli.current());++mli) - { - if ((ml->listType()&MemberListType_declarationLists)!=0) - { - generateDocbookSection(gd,t,ml,g_docbookSectionMapper.find(ml->listType()),1); - } - } - - writeInnerGroupFiles(gd->getSubGroups(),t); - - t << "" << endl; - -} - -static void generateDocbookForDir(DirDef *dd,FTextStream &ti) -{ - if (dd->isReference()) return; // skip external references - - QCString fileDocbook=dd->getOutputFileBase()+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+dd->getOutputFileBase()+".xml"; - QFile f(fileName); - QCString relPath = relativePathToRoot(fileName); - - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - writeDocbookHeader_ID(t, dd->getOutputFileBase()); - - t << " "; - t << theTranslator->trDirReference(dd->displayName()); - t << "" << endl; - if (dd->briefDescription()) - { - writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription()); - } - if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT)) - { - t << "Directory dependency diagram for " << convertToDocBook(dd->displayName()) << "" << endl; - DotDirDeps dirdepGraph(dd); - dirdepGraph.writeGraph(t,GOF_BITMAP,EOF_DocBook,Config_getString(DOCBOOK_OUTPUT),fileName,relPath,FALSE); - } - - writeInnerDirs(&dd->subDirs(),t); - writeInnerFiles(dd->getFiles(),t); - - t << " " << endl; - t << " " << theTranslator->trDetailedDescription() << "" << endl; - if (dd->briefDescription()) - { - t << " " << endl; - writeDocbookDocBlock(t,dd->briefFile(),dd->briefLine(),dd,0,dd->briefDescription()); - t << " " << endl; - } - writeDocbookDocBlock(t,dd->docFile(),dd->docLine(),dd,0,dd->documentation()); - t << " Directory location is " << dd->name() << "" << endl; - t << " " << endl; - - t << "" << endl; -} - -static void generateDocbookForPage(PageDef *pd,FTextStream &ti,bool isExample) -{ - // + name - // + title - // + documentation - - if (pd->isReference()) return; - - QCString pageName = pd->getOutputFileBase(); - if (pd->getGroupDef()) - { - pageName+=(QCString)"_"+pd->name(); - } - if (pageName=="index") - { - pageName="mainpage"; // to prevent overwriting the generated index page. - } - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - QCString fileName=outputDirectory+"/"+pageName+".xml"; - QFile f(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - if(isExample) - { - QCString fileDocbook=pageName+".xml"; - ti << " " << endl; - } - - if (!pd->hasParentPage() && !isExample) - { - QCString fileDocbook=pageName+".xml"; - //Add the file Documentation info to index file - ti << " " << endl; - writeDocbookHeaderMainpage(t,pageName); - } - else - { - QCString pid; - if(isExample) - { - pid = pageName; - } - else - { - pid = pageName+"_1"+pageName; - } - writeDocbookHeader_ID(t, pid); - } - - SectionInfo *si = Doxygen::sectionDict->find(pd->name()); - if (si) - { - if ( pageName == "mainpage") - t << " " << convertToDocBook(theTranslator->trMainPage()) << "" << endl; - else - t << " " << convertToDocBook(si->title) << "" << endl; - } - else - { - t << " " << convertToDocBook(pd->name()) << "" << endl; - } - - generateTOC(t, pd); - if (isExample) - { - writeDocbookDocBlock(t,pd->docFile(),pd->docLine(),pd,0, - pd->documentation()+"\n\\include "+pd->name()); - } - else - { - writeDocbookDocBlock(t,pd->docFile(),pd->docLine(),pd,0, - pd->documentation()); - } - writeInnerPages(pd->getSubPages(),t); - - if (!pd->hasParentPage() && !isExample) - { - t << endl << "
    " << endl; - } - else - { - t << endl << "" << endl; - } -} -void generateDocbook_v1() -{ - - // + classes - // + namespaces - // + files - // + groups - // + related pages - // - examples - - QCString outputDirectory = Config_getString(DOCBOOK_OUTPUT); - if (outputDirectory.isEmpty()) - { - outputDirectory=QDir::currentDirPath().utf8(); - } - else - { - QDir dir(outputDirectory); - if (!dir.exists()) - { - dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDirectory)) - { - err("tag DOCBOOK_OUTPUT: Output directory `%s' does not " - "exist and cannot be created\n",outputDirectory.data()); - exit(1); - } - else - { - msg("Notice: Output directory `%s' does not exist. " - "I have created it for you.\n", outputDirectory.data()); - } - dir.cd(outputDirectory); - } - outputDirectory=dir.absPath().utf8(); - } - - QDir dir(outputDirectory); - if (!dir.exists()) - { - dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDirectory)) - { - err("Cannot create directory %s\n",outputDirectory.data()); - return; - } - } - QDir docbookDir(outputDirectory); - createSubDirs(docbookDir); - - QCString fileName=outputDirectory+"/index.xml"; - QCString dbk_projectName = Config_getString(PROJECT_NAME); - QFile f(fileName); - - f.setName(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - FTextStream t(&f); - //t.setEncoding(FTextStream::UnicodeUTF8); - - // write index header for Docbook which calls the structure file - t << "" << endl;; - t << "" << endl; - t << " " << endl; - t << " " << convertToDocBook(dbk_projectName) << "" << endl; - t << " " << endl; - - // NAMESPACE DOCUMENTATION - NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict); - NamespaceDef *nd; - - //Namespace Documentation index header - if (nli.toFirst()) - { - t << " " << endl; - t << " Namespace Documentation" << endl; - } - - for (nli.toFirst();(nd=nli.current());++nli) - { - msg("Generating Docbook output for namespace %s\n",nd->name().data()); - generateDocbookForNamespace(nd,t); - } - - //Namespace Documentation index footer - if (nli.toFirst()) - { - t << " " << endl; - } - - /** MAINPAGE DOCUMENTATION **/ - - if (Doxygen::mainPage) - { - msg("Generating Docbook output for the main page\n"); - generateDocbookForPage(Doxygen::mainPage,t,FALSE); - } - - // PAGE DOCUMENTATION - { - PageSDict::Iterator pdi(*Doxygen::pageSDict); - PageDef *pd=0; - - for (pdi.toFirst();(pd=pdi.current());++pdi) - { - msg("Generating Docbook output for page %s\n",pd->name().data()); - generateDocbookForPage(pd,t,FALSE); - } - } - - /** MODULE GROUP DOCUMENTATION **/ - - GroupSDict::Iterator gli(*Doxygen::groupSDict); - GroupDef *gd; - - //Module group Documentation index header - if (gli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trModuleDocumentation() << "" << endl; - } - - for (;(gd=gli.current());++gli) - { - msg("Generating Docbook output for group %s\n",gd->name().data()); - generateDocbookForGroup(gd,t); - } - - //Module group Documentation index footer - if (gli.toFirst()) - { - t << " " << endl; - } - - //CLASS DOCUMENTATION - - { - ClassSDict::Iterator cli(*Doxygen::classSDict); - ClassDef *cd; - - //Class Documentation index header - if (cli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trClassDocumentation() << "" << endl; - } - - for (cli.toFirst();(cd=cli.current());++cli) - { - generateDocbookForClass(cd,t); - } - - //Class Documentation index footer - if (cli.toFirst()) - { - t << " " << endl; - } - } - - // FILE DOCUMENTATION - - static bool showFiles = Config_getBool(SHOW_FILES); - if (showFiles) - { - FileNameListIterator fnli(*Doxygen::inputNameList); - FileName *fn; - - //File Documentation index header - if (fnli.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trFileDocumentation() << "" << endl; - } - - for (;(fn=fnli.current());++fnli) - { - FileNameIterator fni(*fn); - FileDef *fd; - for (;(fd=fni.current());++fni) - { - msg("Generating Docbook output for file %s\n",fd->name().data()); - generateDocbookForFile(fd,t); - } - } - - //File Documentation index footer - if (fnli.toFirst()) - { - t << " " << endl; - } - } - - // DIRECTORY DOCUMENTATION - if (Config_getBool(DIRECTORY_GRAPH) && Config_getBool(HAVE_DOT)) - { - DirDef *dir; - DirSDict::Iterator sdi(*Doxygen::directories); - - //Directory Documentation index header - if (sdi.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trDirDocumentation() << "" << endl; - } - - for (sdi.toFirst();(dir=sdi.current());++sdi) - { - msg("Generate Docbook output for dir %s\n",dir->name().data()); - generateDocbookForDir(dir,t); - } - - //Module group Documentation index footer - if (sdi.toFirst()) - { - t << " " << endl; - } - } - - // EXAMPLE PAGE DOCUMENTATION - - { - PageSDict::Iterator pdi(*Doxygen::exampleSDict); - PageDef *pd=0; - - //Example Page Documentation index header - if (pdi.toFirst()) - { - t << " " << endl; - t << " " << theTranslator->trExampleDocumentation() << "" << endl; - } - - for (pdi.toFirst();(pd=pdi.current());++pdi) - { - msg("Generating Docbook output for example %s\n",pd->name().data()); - generateDocbookForPage(pd,t,TRUE); - } - - //Example Page Documentation index footer - if (pdi.toFirst()) - { - t << " " << endl; - } - } - - t << "" << endl; - t << "" << endl; - -} - DocbookGenerator::DocbookGenerator() : OutputGenerator() { DB_GEN_C diff --git a/src/docbookgen.h b/src/docbookgen.h index 104fbc5..08255a1 100644 --- a/src/docbookgen.h +++ b/src/docbookgen.h @@ -17,8 +17,6 @@ #include "outputgen.h" -void generateDocbook_v1(); - class DocbookCodeGenerator : public CodeOutputInterface { public: diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 13c60fb..7658555 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11532,13 +11532,11 @@ void generateOutput() g_outputList->add(new LatexGenerator); LatexGenerator::init(); } -#if 1 if (generateDocbook) { g_outputList->add(new DocbookGenerator); DocbookGenerator::init(); } -#endif if (generateMan) { g_outputList->add(new ManGenerator); @@ -11717,15 +11715,6 @@ void generateOutput() g_s.end(); } -#if 0 - if (generateDocbook) - { - g_s.begin("Generating Docbook output...\n"); - generateDocbook_v1(); - g_s.end(); - } -#endif - if (Config_getBool(GENERATE_AUTOGEN_DEF)) { g_s.begin("Generating AutoGen DEF output...\n"); -- cgit v0.12 From 8e6a8c7c396748051a8cb3bbe5dbe0def92e82cc Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 17 Oct 2018 12:59:08 +0200 Subject: Remove obsolete definitions from scanner Remove some not used definitions from scanner.l (give false positives when searching for some features). --- src/scanner.l | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/scanner.l b/src/scanner.l index 4846132..7e59279 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -597,15 +597,11 @@ static int yyread(char *buf,int max_size) /* start command character */ CMD ("\\"|"@") -SECTIONCMD {CMD}("image"|"author"|"internal"|"version"|"date"|"deprecated"|"param"|"exception"|"return"[s]?|"retval"|"bug"|"warning"|"par"|"sa"|"see"|"pre"|"post"|"invariant"|"note"|"remark"[s]?|"todo"|"test"|"xrefitem"|"ingroup"|"callgraph"|"callergraph"|"latexonly"|"htmlonly"|"xmlonly"|"docbookonly"|"manonly"|"{"|"verbatim"|"dotfile"|"dot"|"defgroup"|"addtogroup"|"weakgroup"|"class"|"namespace"|"union"|"struct"|"fn"|"var"|"details"|"typedef"|"def"|"overload")|("<"{PRE}">") BN [ \t\n\r] BL [ \t\r]*"\n" B [ \t] -BS ^(({B}*"//")?)(({B}*"*"+)?){B}* ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]* -SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?) SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID}) -PHPSCOPENAME ({ID}"\\")+{ID} TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")? CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID}) PRE [pP][rR][eE] -- cgit v0.12 From 0697535ad38ed122964c4673b102a8e30ad4369f Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 17 Oct 2018 19:10:24 +0200 Subject: Add commands to handle referenced by relation and references relation Analogous to call graph and caller graph this patch provides an implementation for the referenced by relation and references relation. Providing the commands: - referencedbyrelation - hidereferencedbyrelation - referencesrelation - hidereferencesrelation Motivation is that some lists can get extremely large and also there is now more symmetry between the textual and graphical out. --- doc/commands.doc | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++--- src/commentscan.l | 32 +++++++++++++++++++++++ src/context.cpp | 40 ++++++++++++++++++++++++++++ src/definition.cpp | 10 ++----- src/doxygen.cpp | 33 +++++++++++++++++++++++ src/entry.cpp | 6 +++++ src/entry.h | 2 ++ src/marshal.cpp | 4 +++ src/memberdef.cpp | 35 +++++++++++++++++++++++-- src/memberdef.h | 6 +++++ src/util.cpp | 7 ++--- src/vhdldocgen.cpp | 4 +-- 12 files changed, 236 insertions(+), 20 deletions(-) diff --git a/doc/commands.doc b/doc/commands.doc index 840c3b7..53e6837 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -106,6 +106,8 @@ documentation: \refitem cmdheaderfile \\headerfile \refitem cmdhidecallergraph \\hidecallergraph \refitem cmdhidecallgraph \\hidecallgraph +\refitem cmdhidereferencedbyrelation \\hidereferencedbyrelation +\refitem cmdhidereferencesrelation \\hidereferencesrelation \refitem cmdhideinitializer \\hideinitializer \refitem cmdhtmlinclude \\htmlinclude \refitem cmdhtmlonly \\htmlonly @@ -156,7 +158,9 @@ documentation: \refitem cmdpublicsection \\publicsection \refitem cmdpure \\pure \refitem cmdref \\ref -\refitem cmdrefitem \\refitem +\refitem cmdreferencedbyrelation \\refitem +\refitem cmdrefitem \\referencedbyrelation +\refitem cmdreferencesrelation \\referencesrelation \refitem cmdrelated \\related \refitem cmdrelates \\relates \refitem cmdrelatedalso \\relatedalso @@ -306,7 +310,7 @@ Structural indicators When this command is put in a comment block of a function or method and \ref cfg_have_dot "HAVE_DOT" is set to \c YES, then doxygen will generate a caller graph for that function (provided the implementation of the - function or method calls other documented functions). The caller graph will be + function or method is called by other documented functions). The caller graph will be generated regardless of the value of \ref cfg_caller_graph "CALLER_GRAPH". \note The completeness (and correctness) of the caller graph depends on the doxygen code parser which is not perfect. @@ -333,6 +337,74 @@ Structural indicators option \ref cfg_caller_graph "CALLER_GRAPH"

    +\section cmdreferencedbyrelation \\referencedbyrelation + + \addindex \\referencedbyrelation + When this command is put in a comment block of a function, method or variable, + then doxygen will generate an overview for that function, method, variable of + the, documented, funcions and methods that call / use it. + The overview will be generated regardless of the value of + \ref cfg_referenced_by_relation "REFERENCED_BY_RELATION". + \note The completeness (and correctness) of the overview depends on the + doxygen code parser which is not perfect. + + \sa section \ref cmdreferencesrelation "\\referencesrelation", + section \ref cmdhidereferencedbyrelation "\\hidereferencedbyrelation", + section \ref cmdhidereferencesrelation "\\hidereferencesrelation" and + option \ref cfg_referenced_by_relation "REFERENCED_BY_RELATION" + +
    +\section cmdhidereferencedbyrelation \\hidereferencedbyrelation + + \addindex \\hidereferencedbyrelation + When this command is put in a comment block of a function, method or variable + then doxygen will not generate an overview for that function, method or + variable of the functions and methods that call / use it. + The overview will not be generated regardless of the value of + \ref cfg_referenced_by_relation "REFERENCED_BY_RELATION". + \note The completeness (and correctness) of the overview depends on the + doxygen code parser which is not perfect. + + \sa section \ref cmdreferencesrelation "\\referencesrelation", + section \ref cmdreferencedbyrelation "\\referencedbyrelation", + section \ref cmdhidereferencesrelation "\\hidereferencesrelation" and + option \ref cfg_referenced_by_relation "REFERENCED_BY_RELATION" + +
    +\section cmdreferencesrelation \\referencesrelation + + \addindex \\referencesrelation + When this command is put in a comment block of a function or method, + then doxygen will generate an overview for that function or method of the + functions and methods that call it. + The overview will be generated regardless of the value of + \ref cfg_references_relation "REFERENCES_RELATION". + \note The completeness (and correctness) of the overview depends on the + doxygen code parser which is not perfect. + + \sa section \ref cmdreferencedbyrelation "\\referencedbyrelation", + section \ref cmdhidereferencedbyrelation "\\hidereferencedbyrelation", + section \ref cmdhidereferencesrelation "\\hidereferencesrelation" and + option \ref cfg_references_relation "REFERENCES_RELATION" + +
    +\section cmdhidereferencesrelation \\hidereferencesrelation + + \addindex \\hidereferencesrelation + When this command is put in a comment block of a function or method + and then doxygen will not generate an overview for that function or method of + the functions and methods that call it. + The overview will not be generated regardless of the value of + \ref cfg_references_relation "REFERENCES_RELATION". + \note The completeness (and correctness) of the overview depends on the + doxygen code parser which is not perfect. + + \sa section \ref cmdreferencesrelation "\\referencesrelation", + section \ref cmdreferencedbyrelation "\\referencedbyrelation", + section \ref cmdhidereferencedbyrelation "\\hidereferencedbyrelation" and + option \ref cfg_references_relation "REFERENCES_RELATION" + +
    \section cmdcategory \\category [] [] \addindex \\category @@ -3424,4 +3496,3 @@ Go to the
    next section or return to the \endhtmlonly */ - diff --git a/src/commentscan.l b/src/commentscan.l index ac83729..1edfa21 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -107,6 +107,10 @@ static bool handleCallgraph(const QCString &, const QCStringList &); static bool handleHideCallgraph(const QCString &, const QCStringList &); static bool handleCallergraph(const QCString &, const QCStringList &); static bool handleHideCallergraph(const QCString &, const QCStringList &); +static bool handleReferencedByRelation(const QCString &, const QCStringList &); +static bool handleHideReferencedByRelation(const QCString &, const QCStringList &); +static bool handleReferencesRelation(const QCString &, const QCStringList &); +static bool handleHideReferencesRelation(const QCString &, const QCStringList &); static bool handleInternal(const QCString &, const QCStringList &); static bool handleLineBr(const QCString &, const QCStringList &); static bool handleStatic(const QCString &, const QCStringList &); @@ -214,6 +218,10 @@ static DocCmdMap docCmdMap[] = { "hidecallgraph", &handleHideCallgraph, FALSE }, { "callergraph", &handleCallergraph, FALSE }, { "hidecallergraph", &handleHideCallergraph, FALSE }, + { "referencedbyrelation", &handleReferencedByRelation, FALSE }, + { "hidereferencedbyrelation", &handleHideReferencedByRelation, FALSE }, + { "referencesrelation", &handleReferencesRelation, FALSE }, + { "hidereferencesrelation", &handleHideReferencesRelation, FALSE }, { "internal", &handleInternal, TRUE }, { "_linebr", &handleLineBr, FALSE }, { "static", &handleStatic, FALSE }, @@ -2831,6 +2839,30 @@ static bool handleHideCallergraph(const QCString &, const QCStringList &) return FALSE; } +static bool handleReferencedByRelation(const QCString &, const QCStringList &) +{ + current->referencedByRelation = TRUE; // ON + return FALSE; +} + +static bool handleHideReferencedByRelation(const QCString &, const QCStringList &) +{ + current->referencedByRelation = FALSE; // OFF + return FALSE; +} + +static bool handleReferencesRelation(const QCString &, const QCStringList &) +{ + current->referencesRelation = TRUE; // ON + return FALSE; +} + +static bool handleHideReferencesRelation(const QCString &, const QCStringList &) +{ + current->referencesRelation = FALSE; // OFF + return FALSE; +} + static bool handleInternal(const QCString &, const QCStringList &) { if (!Config_getBool(INTERNAL_DOCS)) diff --git a/src/context.cpp b/src/context.cpp index 33e7dcf..12c8c34 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -856,6 +856,14 @@ class TranslateContext::Private { return theTranslator->trCallerGraph(); } + TemplateVariant referencedByRelation() const + { + return theTranslator->trReferencedBy(); + } + TemplateVariant referencesRelation() const + { + return theTranslator->trReferences(); + } TemplateVariant inheritedFrom() const { return theTranslator->trInheritedFrom("@0","@1"); @@ -1112,6 +1120,10 @@ class TranslateContext::Private s_inst.addProperty("callGraph", &Private::callGraph); //%% string callerGraph s_inst.addProperty("callerGraph", &Private::callerGraph); + //%% string referencedByRelation + s_inst.addProperty("referencedByRelation", &Private::referencedByRelation); + //%% string referencesRelation + s_inst.addProperty("referencesRelation", &Private::referencesRelation); //%% markerstring inheritedFrom s_inst.addProperty("inheritedFrom", &Private::inheritedFrom); //%% string addtionalInheritedMembers @@ -3994,6 +4006,10 @@ class MemberContext::Private : public DefinitionContext s_inst.addProperty("callGraph", &Private::callGraph); s_inst.addProperty("hasCallerGraph", &Private::hasCallerGraph); s_inst.addProperty("callerGraph", &Private::callerGraph); + s_inst.addProperty("hasReferencedByRelation", &Private::hasReferencedByRelation); + s_inst.addProperty("referencedByRelation", &Private::referencedByRelation); + s_inst.addProperty("hasReferencesRelation", &Private::hasReferencesRelation); + s_inst.addProperty("referencesRelation", &Private::referencesRelation); s_inst.addProperty("fieldType", &Private::fieldType); s_inst.addProperty("type", &Private::type); s_inst.addProperty("detailsVisibleFor", &Private::detailsVisibleFor); @@ -4918,6 +4934,10 @@ class MemberContext::Private : public DefinitionContext } return TemplateVariant(FALSE); } + TemplateVariant hasReferencedByRelation() const + { + return TemplateVariant(m_memberDef->hasReferencedByRelation()); + } TemplateVariant callGraph() const { if (hasCallGraph().toBool()) @@ -4958,6 +4978,14 @@ class MemberContext::Private : public DefinitionContext return TemplateVariant(""); } } + TemplateVariant referencedByRelation() const + { + if (hasReferencedByRelation().toBool()) + { + err("context.cpp: output format not yet supported"); + } + return TemplateVariant(""); + } DotCallGraph *getCallerGraph() const { Cachable &cache = getCache(); @@ -4978,6 +5006,10 @@ class MemberContext::Private : public DefinitionContext } return TemplateVariant(FALSE); } + TemplateVariant hasReferencesRelation() const + { + return TemplateVariant(m_memberDef->hasReferencesRelation()); + } TemplateVariant callerGraph() const { if (hasCallerGraph().toBool()) @@ -5018,6 +5050,14 @@ class MemberContext::Private : public DefinitionContext return TemplateVariant(""); } } + TemplateVariant referencesRelation() const + { + if (hasReferencesRelation().toBool()) + { + err("context.cpp: output format not yet supported"); + } + return TemplateVariant(""); + } TemplateVariant type() const { return m_memberDef->typeString(); diff --git a/src/definition.cpp b/src/definition.cpp index bd97f6d..33cf7ea 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -1446,18 +1446,12 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName, void Definition::writeSourceReffedBy(OutputList &ol,const char *scopeName) { - if (Config_getBool(REFERENCED_BY_RELATION)) - { - _writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_impl->sourceRefByDict,FALSE); - } + _writeSourceRefList(ol,scopeName,theTranslator->trReferencedBy(),m_impl->sourceRefByDict,FALSE); } void Definition::writeSourceRefs(OutputList &ol,const char *scopeName) { - if (Config_getBool(REFERENCES_RELATION)) - { - _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_impl->sourceRefsDict,TRUE); - } + _writeSourceRefList(ol,scopeName,theTranslator->trReferences(),m_impl->sourceRefsDict,TRUE); } bool Definition::hasDocumentation() const diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 13c60fb..58c7019 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -2187,6 +2187,8 @@ static void findUsingDeclImports(EntryNav *rootNav) newMd->setDefinition(md->definition()); newMd->enableCallGraph(root->callGraph); newMd->enableCallerGraph(root->callerGraph); + newMd->enableReferencedByRelation(root->referencedByRelation); + newMd->enableReferencesRelation(root->referencesRelation); newMd->setBitfields(md->bitfieldString()); newMd->addSectionsToDefinition(root->anchors); newMd->setBodySegment(md->getStartBodyLine(),md->getEndBodyLine()); @@ -2383,6 +2385,8 @@ static MemberDef *addVariableToClass( md->setWriteAccessor(root->write); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setHidden(root->hidden); md->setArtificial(root->artificial); md->setLanguage(root->lang); @@ -2620,6 +2624,8 @@ static MemberDef *addVariableToFile( md->setId(root->id); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setExplicitExternal(root->explicitExternal); //md->setOuterScope(fd); if (!root->explicitExternal) @@ -3133,6 +3139,8 @@ static void addInterfaceOrServiceToServiceOrSingleton( md->setDefinition(def); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); Debug::print(Debug::Functions,0, " Interface Member:\n" @@ -3385,6 +3393,8 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd, md->setDefinition(def); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); Debug::print(Debug::Functions,0, " Func Member:\n" @@ -3652,6 +3662,8 @@ static void buildFunctionList(EntryNav *rootNav) md->enableCallGraph(md->hasCallGraph() || root->callGraph); md->enableCallerGraph(md->hasCallerGraph() || root->callerGraph); + md->enableReferencedByRelation(md->hasReferencedByRelation() || root->referencedByRelation); + md->enableReferencesRelation(md->hasReferencesRelation() || root->referencesRelation); // merge ingroup specifiers if (md->getGroupDef()==0 && root->groups->getFirst()!=0) @@ -3771,6 +3783,8 @@ static void buildFunctionList(EntryNav *rootNav) md->setDefinition(def); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); //if (root->mGrpId!=-1) //{ // md->setMemberGroup(memberGroupDict[root->mGrpId]); @@ -3922,8 +3936,13 @@ static void findFriends() mmd->enableCallGraph(mmd->hasCallGraph() || fmd->hasCallGraph()); mmd->enableCallerGraph(mmd->hasCallerGraph() || fmd->hasCallerGraph()); + mmd->enableReferencedByRelation(mmd->hasReferencedByRelation() || fmd->hasReferencedByRelation()); + mmd->enableReferencesRelation(mmd->hasReferencesRelation() || fmd->hasReferencesRelation()); + fmd->enableCallGraph(mmd->hasCallGraph() || fmd->hasCallGraph()); fmd->enableCallerGraph(mmd->hasCallerGraph() || fmd->hasCallerGraph()); + fmd->enableReferencedByRelation(mmd->hasReferencedByRelation() || fmd->hasReferencedByRelation()); + fmd->enableReferencesRelation(mmd->hasReferencesRelation() || fmd->hasReferencesRelation()); } } } @@ -5323,6 +5342,8 @@ static void addMemberDocs(EntryNav *rootNav, md->setDefinition(fDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); ClassDef *cd=md->getClassDef(); NamespaceDef *nd=md->getNamespaceDef(); QCString fullName; @@ -5415,6 +5436,8 @@ static void addMemberDocs(EntryNav *rootNav, md->enableCallGraph(md->hasCallGraph() || root->callGraph); md->enableCallerGraph(md->hasCallerGraph() || root->callerGraph); + md->enableReferencedByRelation(md->hasReferencedByRelation() || root->referencedByRelation); + md->enableReferencesRelation(md->hasReferencesRelation() || root->referencesRelation); md->mergeMemberSpecifiers(root->spec); md->addSectionsToDefinition(root->anchors); @@ -6447,6 +6470,8 @@ static void findMember(EntryNav *rootNav, md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setBriefDescription(root->brief,root->briefFile,root->briefLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); @@ -6512,6 +6537,8 @@ static void findMember(EntryNav *rootNav, md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); QCString doc=getOverloadDocs(); doc+="

    "; doc+=root->doc; @@ -6716,6 +6743,8 @@ static void findMember(EntryNav *rootNav, md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); md->setDocsForDefinition(!root->proto); @@ -6788,6 +6817,8 @@ localObjCMethod: md->setDefinition(funcDecl); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); md->setDocumentation(root->doc,root->docFile,root->docLine); md->setBriefDescription(root->brief,root->briefFile,root->briefLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); @@ -7130,6 +7161,8 @@ static void findEnums(EntryNav *rootNav) md->setMemberGroupId(root->mGrpId); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); + md->enableReferencedByRelation(root->referencedByRelation); + md->enableReferencesRelation(root->referencesRelation); //printf("%s::setRefItems(%d)\n",md->name().data(),root->sli?root->sli->count():-1); md->setRefItems(root->sli); //printf("found enum %s nd=%p\n",md->name().data(),nd); diff --git a/src/entry.cpp b/src/entry.cpp index a0460da..4332186 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -79,6 +79,8 @@ Entry::Entry(const Entry &e) subGrouping = e.subGrouping; callGraph = e.callGraph; callerGraph = e.callerGraph; + referencedByRelation = e.referencedByRelation; + referencesRelation = e.referencesRelation; virt = e.virt; args = e.args; bitfields = e.bitfields; @@ -219,6 +221,8 @@ void Entry::reset() { static bool entryCallGraph = Config_getBool(CALL_GRAPH); static bool entryCallerGraph = Config_getBool(CALLER_GRAPH); + static bool entryReferencedByRelation = Config_getBool(REFERENCED_BY_RELATION); + static bool entryReferencesRelation = Config_getBool(REFERENCES_RELATION); //printf("Entry::reset()\n"); name.resize(0); type.resize(0); @@ -250,6 +254,8 @@ void Entry::reset() mGrpId = -1; callGraph = entryCallGraph; callerGraph = entryCallerGraph; + referencedByRelation = entryReferencedByRelation; + referencesRelation = entryReferencesRelation; section = EMPTY_SEC; mtype = Method; virt = Normal; diff --git a/src/entry.h b/src/entry.h index 739b128..8187e03 100644 --- a/src/entry.h +++ b/src/entry.h @@ -249,6 +249,8 @@ class Entry bool subGrouping; //!< automatically group class members? bool callGraph; //!< do we need to draw the call graph? bool callerGraph; //!< do we need to draw the caller graph? + bool referencedByRelation;//!< do we need to show the referenced by relation? + bool referencesRelation; //!< do we need to show the references relation? Specifier virt; //!< virtualness of the entry QCString args; //!< member argument string QCString bitfields; //!< member's bit fields diff --git a/src/marshal.cpp b/src/marshal.cpp index f0ed2e8..25a9a89 100644 --- a/src/marshal.cpp +++ b/src/marshal.cpp @@ -370,6 +370,8 @@ void marshalEntry(StorageIntf *s,Entry *e) marshalBool(s,e->subGrouping); marshalBool(s,e->callGraph); marshalBool(s,e->callerGraph); + marshalBool(s,e->referencedByRelation); + marshalBool(s,e->referencesRelation); marshalInt(s,(int)e->virt); marshalQCString(s,e->args); marshalQCString(s,e->bitfields); @@ -780,6 +782,8 @@ Entry * unmarshalEntry(StorageIntf *s) e->subGrouping = unmarshalBool(s); e->callGraph = unmarshalBool(s); e->callerGraph = unmarshalBool(s); + e->referencedByRelation = unmarshalBool(s); + e->referencesRelation = unmarshalBool(s); e->virt = (Specifier)unmarshalInt(s); e->args = unmarshalQCString(s); e->bitfields = unmarshalQCString(s); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 5d74270..eb90cd1 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -584,6 +584,8 @@ class MemberDefImpl bool annUsed; bool hasCallGraph; bool hasCallerGraph; + bool hasReferencedByRelation; + bool hasReferencesRelation; bool explExt; // member was explicitly declared external bool tspec; // member is a template specialization bool groupHasDocs; // true if the entry that caused the grouping was documented @@ -647,6 +649,8 @@ void MemberDefImpl::init(Definition *def, defTmpArgLists=0; hasCallGraph = FALSE; hasCallerGraph = FALSE; + hasReferencedByRelation = FALSE; + hasReferencesRelation = FALSE; initLines=0; type=t; if (mt==MemberType_Typedef) type.stripPrefix("typedef "); @@ -2984,9 +2988,9 @@ void MemberDef::writeDocumentation(MemberList *ml, _writeExamples(ol); _writeTypeConstraints(ol); writeSourceDef(ol,cname); - writeSourceRefs(ol,cname); - writeSourceReffedBy(ol,cname); writeInlineCode(ol,cname); + if (hasReferencesRelation()) writeSourceRefs(ol,cname); + if (hasReferencedByRelation()) writeSourceReffedBy(ol,cname); _writeCallGraph(ol); _writeCallerGraph(ol); @@ -3960,6 +3964,18 @@ void MemberDef::enableCallerGraph(bool e) if (e) Doxygen::parseSourcesNeeded = TRUE; } +void MemberDef::enableReferencedByRelation(bool e) +{ + m_impl->hasReferencedByRelation=e; + if (e) Doxygen::parseSourcesNeeded = TRUE; +} + +void MemberDef::enableReferencesRelation(bool e) +{ + m_impl->hasReferencesRelation=e; + if (e) Doxygen::parseSourcesNeeded = TRUE; +} + #if 0 bool MemberDef::protectionVisible() const { @@ -4592,6 +4608,16 @@ bool MemberDef::hasCallerGraph() const return m_impl->hasCallerGraph; } +bool MemberDef::hasReferencedByRelation() const +{ + return m_impl->hasReferencedByRelation; +} + +bool MemberDef::hasReferencesRelation() const +{ + return m_impl->hasReferencesRelation; +} + MemberDef *MemberDef::templateMaster() const { return m_impl->templateMaster; @@ -5104,6 +5130,11 @@ void combineDeclarationAndDefinition(MemberDef *mdec,MemberDef *mdef) mdef->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph()); mdec->enableCallGraph(mdec->hasCallGraph() || mdef->hasCallGraph()); mdec->enableCallerGraph(mdec->hasCallerGraph() || mdef->hasCallerGraph()); + + mdef->enableReferencedByRelation(mdec->hasReferencedByRelation() || mdef->hasReferencedByRelation()); + mdef->enableCallerGraph(mdec->hasReferencesRelation() || mdef->hasReferencesRelation()); + mdec->enableReferencedByRelation(mdec->hasReferencedByRelation() || mdef->hasReferencedByRelation()); + mdec->enableCallerGraph(mdec->hasReferencesRelation() || mdef->hasReferencesRelation()); } } } diff --git a/src/memberdef.h b/src/memberdef.h index bf7ea9a..e9524c6 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -237,6 +237,9 @@ class MemberDef : public Definition bool hasCallGraph() const; bool hasCallerGraph() const; bool visibleMemberGroup(bool hideNoHeader); + // refrenced related members + bool hasReferencesRelation() const; + bool hasReferencedByRelation() const; MemberDef *templateMaster() const; QCString getScopeString() const; @@ -349,6 +352,9 @@ class MemberDef : public Definition void enableCallGraph(bool e); void enableCallerGraph(bool e); + void enableReferencedByRelation(bool e); + void enableReferencesRelation(bool e); + void setTemplateMaster(MemberDef *mt); void addListReference(Definition *d); void setDocsForDefinition(bool b); diff --git a/src/util.cpp b/src/util.cpp index 7371026..afb9905 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -8505,12 +8505,9 @@ bool fileVisibleInIndex(FileDef *fd,bool &genSourceFile) void addDocCrossReference(MemberDef *src,MemberDef *dst) { - static bool referencedByRelation = Config_getBool(REFERENCED_BY_RELATION); - static bool referencesRelation = Config_getBool(REFERENCES_RELATION); - //printf("--> addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data()); if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types - if ((referencedByRelation || dst->hasCallerGraph()) && + if ((dst->hasReferencedByRelation() || dst->hasCallerGraph()) && src->showInCallGraph() ) { @@ -8526,7 +8523,7 @@ void addDocCrossReference(MemberDef *src,MemberDef *dst) mdDecl->addSourceReferencedBy(src); } } - if ((referencesRelation || src->hasCallGraph()) && + if ((src->hasReferencesRelation() || src->hasCallGraph()) && src->showInCallGraph() ) { diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 287565b..9ac0cfd 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -2466,8 +2466,8 @@ void VhdlDocGen::writeSource(MemberDef *mdef,OutputList& ol,QCString & cname) if (cname.isEmpty()) return; mdef->writeSourceDef(ol,cname); - mdef->writeSourceRefs(ol,cname); - mdef->writeSourceReffedBy(ol,cname); + if (mdef->hasReferencesRelation()) mdef->writeSourceRefs(ol,cname); + if (mdef->hasReferencedByRelation()) mdef->writeSourceReffedBy(ol,cname); } -- cgit v0.12 From 7c76f37c452ad49f1b19a661525ceebafc036a6e Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 18 Oct 2018 14:51:33 +0200 Subject: Enable comma as separator in configuration lists Loosely based on problems when users use a comma as separator in a list (as this is slightly suggested in the documentation). (https://stackoverflow.com/questions/43093051/doxygen-is-generating-empty-documentation) --- src/configimpl.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/configimpl.l b/src/configimpl.l index 3fb1360..0779e70 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -868,7 +868,7 @@ static void readIncludeFile(const char *incName) } BEGIN(Start); } -[ \t]+ { +[ \t,]+ { if (!elemStr.isEmpty()) { //printf("elemStr2=`%s'\n",elemStr.data()); @@ -922,7 +922,7 @@ static void readIncludeFile(const char *incName) bs.data(),yyLineNr,yyFileName.data()); } } -[^ \#\"\t\r\n]+ { +[^ \#\"\t\r\n,]+ { elemStr+=configStringRecode(yytext,encoding,"UTF-8"); } \n { yyLineNr++; BEGIN(Start); } -- cgit v0.12 From 69092a59ad04016f2423776425140c3190db6a01 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 18 Oct 2018 15:08:31 +0200 Subject: Remove obsolete line from README.md The README.md contained a reference to the file INSTALL but this file only contains a reference to the manual plus address. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index ab3f7fc..3e1c608 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,7 @@ Developers * Doxygen's Doxygen Documentation: -* Install - * Quick install see (./INSTALL) - * else http://www.doxygen.org/manual/install.html +* Install: Please read the installation section of the manual (http://www.doxygen.org/manual/install.html) * Project stats: https://www.openhub.net/p/doxygen -- cgit v0.12 From 5f9be083471dad47a9b3ad59d85bf04d3a855001 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 20 Oct 2018 12:21:16 +0200 Subject: Bug 749049 - Doxygen not creating call graphs for C# methods if namespace contains the classname Problem is the '.' in the namespace name. For Csharp: namespace N1.n2 { is equivalent to namespace N1 { namespace N2 { This splitting has to be considered in the scanner so the different namespaces are mentioned. In the code.l the '.' was not handled. --- src/code.l | 6 +++++- src/scanner.l | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/code.l b/src/code.l index bb9744b..a55ab1a 100644 --- a/src/code.l +++ b/src/code.l @@ -2172,8 +2172,12 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" g_code->codify(yytext); endFontClass(); } +{ID}("."{ID})* | {ID}("::"{ID})* { - g_curClassName=yytext; + if(g_insideCS) + g_curClassName=substitute(yytext,".","::"); + else + g_curClassName=yytext; addType(); if (g_curClassName=="alignas") { diff --git a/src/scanner.l b/src/scanner.l index 4846132..08bcee1 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -3840,6 +3840,28 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) else { current->endBodyLine = yyLineNr; + if (current->section == Entry::NAMESPACE_SEC && current->type == "namespace") + { + int split_point; + while ((split_point = current->name.find("::")) != -1) + { + Entry *new_current = new Entry(*current); + current->program = ""; + new_current->doc = ""; + new_current->docLine = 0; + new_current->docFile = ""; + new_current->brief = ""; + new_current->briefLine = 0; + new_current->briefFile = ""; + new_current->name = current->name.mid(split_point + 2); + current->name = current->name.left(split_point); + if (!current_root->name.isEmpty()) current->name.prepend(current_root->name+"::"); + + current_root->addSubEntry(current); + current_root = current; + current = new_current; + } + } QCString &cn = current->name; QCString rn = current_root->name.copy(); //printf("cn=`%s' rn=`%s' isTypedef=%d\n",cn.data(),rn.data(),isTypedef); -- cgit v0.12 From 58cf0414b9bfc5d7216e75e00beb115d91e36245 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 21 Oct 2018 11:50:42 +0200 Subject: Handling Fortran functions in call graphs When functions are used they have to be declared and were seen as local variables even when the 'external' keyword had been applied. Functions are now not seen anymore as local variables as soon as the 'external' keyword has been applied. --- src/fortrancode.l | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/fortrancode.l b/src/fortrancode.l index 3014dc3..0e610fd 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -107,8 +107,9 @@ class Scope public: QCStringList useNames; //!< contains names of used modules QDict localVars; //!< contains names of local variables + QDict externalVars; //!< contains names of external entities - Scope() : localVars(7, FALSE /*caseSensitive*/) {} + Scope() : localVars(7, FALSE /*caseSensitive*/), externalVars(7, FALSE /*caseSensitive*/) {} }; /*===================================================================*/ @@ -122,6 +123,7 @@ static QCString currentClass=0; //!< name of the current enclosing static UseSDict *useMembers= new UseSDict; //!< info about used modules static UseEntry *useEntry = 0; //!< current use statement info static QList scopeStack; +static bool g_isExternal = false; // static QCStringList *currentUseNames= new QCStringList; //! contains names of used modules of current program unit static QCString str=""; //!> contents of fortran string @@ -434,7 +436,7 @@ static bool getFortranDefs(const QCString &memberName, const QCString &moduleNam Scope *scope; for (it.toLast();(scope=it.current());--it) { - if (scope->localVars.find(memberName)) + if (scope->localVars.find(memberName) && (!scope->externalVars.find(memberName))) return FALSE; } @@ -648,7 +650,10 @@ static void addUse(const QCString &moduleName) static void addLocalVar(const QCString &varName) { if (!scopeStack.isEmpty()) + { scopeStack.getLast()->localVars.insert(varName, (void*)1); + if (g_isExternal) scopeStack.getLast()->externalVars.insert(varName, (void*)1); + } } //---------------------------------------------------------------------------- @@ -969,11 +974,18 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") endFontClass(); } {ATTR_SPEC} { + if (QCString(yytext) == "external") + { + yy_push_state(YY_START); + BEGIN(Declaration); + g_isExternal = true; + } startFontClass("keywordtype"); g_code->codify(yytext); endFontClass(); } ({TYPE_SPEC}|{ATTR_SPEC})/[,:( ] { //| variable declaration + if (QCString(yytext) == "external") g_isExternal = true; startFontClass("keywordtype"); g_code->codify(yytext); endFontClass(); @@ -1046,6 +1058,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?") g_contLineNr++; if (!(g_hasContLine && g_hasContLine[g_contLineNr - 1])) { + g_isExternal = false; yy_pop_state(); } YY_FTN_RESET -- cgit v0.12 From 3e6447119d64b492ed55c3baad17b04dd57f4821 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 22 Oct 2018 12:03:05 +0200 Subject: Wrong separator in index for a.o. Python, C# In e.g. the LaTeX output the separator for Pyton, C# is given as '::', this should be '.' . With this fix the problems in the index are gone. --- src/memberdef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 5d74270..1cedc7f 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2560,7 +2560,7 @@ void MemberDef::writeDocumentation(MemberList *ml, QCString scopeName = scName; QCString memAnchor = anchor(); - QCString ciname = container->name(); + QCString ciname = container->displayName(); Definition *scopedContainer = container; // see bug 753608 if (container->definitionType()==TypeGroup) { -- cgit v0.12 From f56ce241a09dff819c194be4585aae99f35d85f1 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 22 Oct 2018 15:03:48 +0200 Subject: issue_6566: INHERIT_DOCS not working for python methods in Python are always "virtual" (but there is no way to signal it). --- src/doxygen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 13c60fb..7eb7968 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -7697,7 +7697,7 @@ static void computeMemberRelations() // bmcd->name().data(),bmd->name().data(),bmd // ); if (md!=bmd && bmcd && mcd && bmcd!=mcd && - (bmd->virtualness()!=Normal || + (bmd->virtualness()!=Normal || bmd->getLanguage()==SrcLangExt_Python || bmcd->compoundType()==ClassDef::Interface || bmcd->compoundType()==ClassDef::Protocol ) && -- cgit v0.12 From 3a97099d5e6afd298486f219694a7fb5eff67fea Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Wed, 27 Dec 2017 11:12:07 -0800 Subject: Added *.ice files as a recognized file type. Added a Slice-optimized output mode. --- src/classdef.cpp | 325 +++++++++++++-- src/classdef.h | 6 + src/code.l | 4 +- src/config.xml | 1091 ++++++++++++++++++++++++------------------------ src/context.cpp | 125 ++++-- src/defgen.cpp | 34 +- src/dirdef.cpp | 6 + src/docbookgen.cpp | 47 ++- src/docsets.cpp | 5 + src/dot.cpp | 15 +- src/dot.h | 14 +- src/doxygen.cpp | 151 +++++-- src/entry.cpp | 1 + src/entry.h | 66 +-- src/filedef.cpp | 138 ++++-- src/filedef.h | 6 +- src/ftvhelp.cpp | 69 ++- src/groupdef.cpp | 6 + src/htmlgen.cpp | 18 +- src/index.cpp | 972 ++++++++++++++++++++++++++++++++++++++---- src/index.h | 19 +- src/layout.cpp | 196 ++++++++- src/layout.h | 16 +- src/layout_default.xml | 32 ++ src/marshal.cpp | 2 + src/memberdef.cpp | 83 +++- src/memberdef.h | 5 +- src/membergroup.cpp | 10 + src/membergroup.h | 2 + src/memberlist.cpp | 64 ++- src/memberlist.h | 26 +- src/namespacedef.cpp | 152 ++++++- src/namespacedef.h | 18 +- src/pre.l | 2 +- src/scanner.l | 203 +++++++-- src/searchindex.cpp | 115 +++-- src/searchindex.h | 37 +- src/translator.h | 32 +- src/translator_am.h | 135 ++++++ src/translator_ar.h | 135 ++++++ src/translator_br.h | 135 ++++++ src/translator_ca.h | 135 ++++++ src/translator_cn.h | 135 ++++++ src/translator_cz.h | 135 ++++++ src/translator_de.h | 136 +++++- src/translator_dk.h | 134 ++++++ src/translator_en.h | 136 ++++++ src/translator_eo.h | 135 ++++++ src/translator_es.h | 135 ++++++ src/translator_fa.h | 135 ++++++ src/translator_fi.h | 135 ++++++ src/translator_fr.h | 135 ++++++ src/translator_gr.h | 135 ++++++ src/translator_hr.h | 135 ++++++ src/translator_hu.h | 133 +++++- src/translator_id.h | 135 ++++++ src/translator_it.h | 135 ++++++ src/translator_jp.h | 135 ++++++ src/translator_kr.h | 135 ++++++ src/translator_lt.h | 133 ++++++ src/translator_lv.h | 135 ++++++ src/translator_mk.h | 135 ++++++ src/translator_nl.h | 132 ++++++ src/translator_no.h | 135 ++++++ src/translator_pl.h | 135 ++++++ src/translator_pt.h | 135 ++++++ src/translator_ro.h | 135 ++++++ src/translator_ru.h | 135 ++++++ src/translator_sc.h | 135 ++++++ src/translator_si.h | 135 ++++++ src/translator_sk.h | 135 ++++++ src/translator_sr.h | 135 ++++++ src/translator_sv.h | 133 ++++++ src/translator_tr.h | 135 ++++++ src/translator_tw.h | 135 ++++++ src/translator_ua.h | 135 ++++++ src/translator_vi.h | 135 ++++++ src/translator_za.h | 135 ++++++ src/types.h | 10 +- src/util.cpp | 66 ++- src/util.h | 25 +- src/vhdldocgen.cpp | 3 +- src/xmlgen.cpp | 32 +- 83 files changed, 8594 insertions(+), 1047 deletions(-) diff --git a/src/classdef.cpp b/src/classdef.cpp index 787cd5e..abe7a52 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include "classdef.h" #include "classlist.h" @@ -201,6 +202,8 @@ class ClassDefImpl bool isAnonymous; uint64 spec; + + QCString metaData; }; void ClassDefImpl::init(const char *defFileName, const char *name, @@ -1372,27 +1375,53 @@ void ClassDef::writeIncludeFiles(OutputList &ol) { if (m_impl->incInfo /*&& Config_getBool(SHOW_INCLUDE_FILES)*/) { - QCString nm=m_impl->incInfo->includeName.isEmpty() ? - (m_impl->incInfo->fileDef ? - m_impl->incInfo->fileDef->docName().data() : "" - ) : - m_impl->incInfo->includeName.data(); - if (!nm.isEmpty()) + SrcLangExt lang = getLanguage(); + if (lang==SrcLangExt_Slice) { + QCString nm; + QStrList paths = Config_getList(STRIP_FROM_PATH); + if (!paths.isEmpty() && m_impl->incInfo->fileDef) + { + QCString abs = m_impl->incInfo->fileDef->absFilePath(); + const char *s = paths.first(); + QCString potential; + unsigned int length = 0; + while (s) + { + QFileInfo info(s); + if (info.exists()) + { + QString prefix = info.absFilePath(); + if (prefix.at(prefix.length() - 1) != '/') + { + prefix += '/'; + } + + if (prefix.length() > length && + qstricmp(abs.left(prefix.length()).data(), prefix.data()) == 0) // case insensitive compare + { + length = prefix.length(); + potential = abs.right(abs.length() - prefix.length()); + } + s = paths.next(); + } + } + + if (length > 0) + { + nm = potential; + } + } + + if (nm.isEmpty()) + { + nm = m_impl->incInfo->includeName.data(); + } + ol.startParagraph(); + ol.docify("Defined in "); ol.startTypewriter(); - ol.docify(includeStatement()); - SrcLangExt lang = getLanguage(); - bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java; - if (m_impl->incInfo->local || isIDLorJava) - ol.docify("\""); - else - ol.docify("<"); - ol.pushGeneratorState(); - ol.disable(OutputGenerator::Html); - ol.docify(nm); - ol.disableAllBut(OutputGenerator::Html); - ol.enable(OutputGenerator::Html); + ol.docify("<"); if (m_impl->incInfo->fileDef) { ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm); @@ -1401,13 +1430,143 @@ void ClassDef::writeIncludeFiles(OutputList &ol) { ol.docify(nm); } - ol.popGeneratorState(); - if (m_impl->incInfo->local || isIDLorJava) - ol.docify("\""); + ol.docify(">"); + ol.endTypewriter(); + ol.endParagraph(); + } + else + { + QCString nm=m_impl->incInfo->includeName.isEmpty() ? + (m_impl->incInfo->fileDef ? + m_impl->incInfo->fileDef->docName().data() : "" + ) : + m_impl->incInfo->includeName.data(); + if (!nm.isEmpty()) + { + ol.startParagraph(); + ol.startTypewriter(); + ol.docify(includeStatement()); + bool isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java; + if (m_impl->incInfo->local || isIDLorJava) + ol.docify("\""); + else + ol.docify("<"); + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + ol.docify(nm); + ol.disableAllBut(OutputGenerator::Html); + ol.enable(OutputGenerator::Html); + if (m_impl->incInfo->fileDef) + { + ol.writeObjectLink(0,m_impl->incInfo->fileDef->includeName(),0,nm); + } + else + { + ol.docify(nm); + } + ol.popGeneratorState(); + if (m_impl->incInfo->local || isIDLorJava) + ol.docify("\""); + else + ol.docify(">"); + if (isIDLorJava) + ol.docify(";"); + ol.endTypewriter(); + ol.endParagraph(); + } + } + + // Write a summary of the Slice definition including metadata. + if (lang == SrcLangExt_Slice) + { + ol.startParagraph(); + ol.startTypewriter(); + if (!m_impl->metaData.isEmpty()) + { + ol.docify(m_impl->metaData); + ol.lineBreak(); + } + if (m_impl->spec & Entry::Local) + { + ol.docify("local "); + } + if (m_impl->spec & Entry::Interface) + { + ol.docify("interface "); + } + else if (m_impl->spec & Entry::Struct) + { + ol.docify("struct "); + } + else if (m_impl->spec & Entry::Exception) + { + ol.docify("exception "); + } else - ol.docify(">"); - if (isIDLorJava) - ol.docify(";"); + { + ol.docify("class "); + } + ol.docify(stripScope(name())); + if (m_impl->inherits) + { + if (m_impl->spec & (Entry::Interface|Entry::Exception)) + { + ol.docify(" extends "); + BaseClassListIterator it(*m_impl->inherits); + BaseClassDef *ibcd; + for (;(ibcd=it.current());++it) + { + ClassDef *icd = ibcd->classDef; + ol.docify(icd->name()); + if (!it.atLast()) + { + ol.docify(", "); + } + } + } + else + { + // Must be a class. + bool implements = false; + BaseClassListIterator it(*m_impl->inherits); + BaseClassDef *ibcd; + for (;(ibcd=it.current());++it) + { + ClassDef *icd = ibcd->classDef; + if (icd->m_impl->spec & Entry::Interface) + { + implements = true; + } + else + { + ol.docify(" extends "); + ol.docify(icd->name()); + } + } + if (implements) + { + ol.docify(" implements "); + bool first = true; + for (ibcd=it.toFirst();(ibcd=it.current());++it) + { + ClassDef *icd = ibcd->classDef; + if (icd->m_impl->spec & Entry::Interface) + { + if (!first) + { + ol.docify(", "); + } + else + { + first = false; + } + ol.docify(icd->name()); + } + } + } + } + } + ol.docify(" { ... }"); ol.endTypewriter(); ol.endParagraph(); } @@ -1914,6 +2073,10 @@ void ClassDef::writeDeclarationLink(OutputList &ol,bool &found,const char *heade if (lang!=SrcLangExt_VHDL) // for VHDL we swap the name and the type { + if (isSliceLocal()) + { + ol.writeString("local "); + } ol.writeString(ctype); ol.writeString(" "); ol.insertMemberAlign(); @@ -2079,8 +2242,14 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page case LayoutDocEntry::NamespaceNestedNamespaces: case LayoutDocEntry::NamespaceNestedConstantGroups: case LayoutDocEntry::NamespaceClasses: + case LayoutDocEntry::NamespaceInterfaces: + case LayoutDocEntry::NamespaceStructs: + case LayoutDocEntry::NamespaceExceptions: case LayoutDocEntry::NamespaceInlineClasses: case LayoutDocEntry::FileClasses: + case LayoutDocEntry::FileInterfaces: + case LayoutDocEntry::FileStructs: + case LayoutDocEntry::FileExceptions: case LayoutDocEntry::FileNamespaces: case LayoutDocEntry::FileConstantGroups: case LayoutDocEntry::FileIncludes: @@ -2119,6 +2288,12 @@ QCString ClassDef::title() const m_impl->compType, m_impl->tempArgs != 0); } + else if (lang==SrcLangExt_Slice) + { + pageTitle = theTranslator->trCompoundReferenceSlice(displayName(), + m_impl->compType, + isSliceLocal()); + } else if (lang==SrcLangExt_VHDL) { pageTitle = theTranslator->trCustomReference(VhdlDocGen::getClassTitle(this)); @@ -2157,9 +2332,35 @@ void ClassDef::writeDocumentation(OutputList &ol) static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); //static bool fortranOpt = Config_getBool(OPTIMIZE_FOR_FORTRAN); //static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); + static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); QCString pageTitle = title(); - startFile(ol,getOutputFileBase(),name(),pageTitle,HLI_ClassVisible,!generateTreeView); + HighlightedItem hli; + if (sliceOpt) + { + if (isInterface()) + { + hli = HLI_InterfaceVisible; + } + else if (isStruct()) + { + hli = HLI_StructVisible; + } + else if (isException()) + { + hli = HLI_ExceptionVisible; + } + else + { + hli = HLI_ClassVisible; + } + } + else + { + hli = HLI_ClassVisible; + } + + startFile(ol,getOutputFileBase(),name(),pageTitle,hli,!generateTreeView); if (!generateTreeView) { if (getOuterScope()!=Doxygen::globalScope) @@ -2286,15 +2487,40 @@ void ClassDef::writeMemberList(OutputList &ol) { static bool cOpt = Config_getBool(OPTIMIZE_OUTPUT_FOR_C); //static bool vhdlOpt = Config_getBool(OPTIMIZE_OUTPUT_VHDL); + static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); static bool generateTreeView = Config_getBool(GENERATE_TREEVIEW); if (m_impl->allMemberNameInfoSDict==0 || cOpt) return; // only for HTML ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); + HighlightedItem hli; + if (sliceOpt) + { + if (isInterface()) + { + hli = HLI_InterfaceVisible; + } + else if (isStruct()) + { + hli = HLI_StructVisible; + } + else if (isException()) + { + hli = HLI_ExceptionVisible; + } + else + { + hli = HLI_ClassVisible; + } + } + else + { + hli = HLI_ClassVisible; + } + QCString memListFile = getMemberListFileName(); - startFile(ol,memListFile,memListFile,theTranslator->trMemberList(), - HLI_ClassVisible,!generateTreeView,getOutputFileBase()); + startFile(ol,memListFile,memListFile,theTranslator->trMemberList(),hli,!generateTreeView,getOutputFileBase()); if (!generateTreeView) { if (getOuterScope()!=Doxygen::globalScope) @@ -3549,19 +3775,21 @@ QCString ClassDef::compoundTypeString() const } else { + QCString type; switch (m_impl->compType) { - case Class: return isJavaEnum() ? "enum" : "class"; - case Struct: return "struct"; - case Union: return "union"; - case Interface: return getLanguage()==SrcLangExt_ObjC ? "class" : "interface"; - case Protocol: return "protocol"; - case Category: return "category"; - case Exception: return "exception"; - case Service: return "service"; - case Singleton: return "singleton"; + case Class: type += isJavaEnum() ? "enum" : "class"; break; + case Struct: type += "struct"; break; + case Union: type += "union"; break; + case Interface: type += getLanguage()==SrcLangExt_ObjC ? "class" : "interface"; break; + case Protocol: type += "protocol"; break; + case Category: type += "category"; break; + case Exception: type += "exception"; break; + case Service: type += "service"; break; + case Singleton: type += "singleton"; break; default: return "unknown"; } + return type; } } @@ -4746,12 +4974,37 @@ bool ClassDef::subGrouping() const return m_impl->subGrouping; } +bool ClassDef::isInterface() const +{ + return m_impl->compType == Interface; +} + +bool ClassDef::isStruct() const +{ + return m_impl->compType == Struct; +} + +bool ClassDef::isException() const +{ + return m_impl->compType == Exception; +} + +bool ClassDef::isSliceLocal() const +{ + return m_impl->spec&Entry::Local; +} + void ClassDef::setName(const char *name) { m_impl->isAnonymous = QCString(name).find('@')!=-1; Definition::setName(name); } +void ClassDef::setMetaData(const char *md) +{ + m_impl->metaData = md; +} + bool ClassDef::isAnonymous() const { return m_impl->isAnonymous; diff --git a/src/classdef.h b/src/classdef.h index 12fcd93..caa2750 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -336,6 +336,10 @@ class ClassDef : public Definition QCString getMemberListFileName() const; bool subGrouping() const; + bool isInterface() const; + bool isStruct() const; + bool isException() const; + bool isSliceLocal() const; //----------------------------------------------------------------------------------- // --- setters ---- @@ -376,6 +380,8 @@ class ClassDef : public Definition void setTagLessReference(ClassDef *cd); void setName(const char *name); + void setMetaData(const char *md); + //----------------------------------------------------------------------------------- // --- actions ---- //----------------------------------------------------------------------------------- diff --git a/src/code.l b/src/code.l index a55ab1a..3fd2f6a 100644 --- a/src/code.l +++ b/src/code.l @@ -1834,7 +1834,7 @@ KEYWORD_OBJC ("@public"|"@private"|"@protected"|"@class"|"@implementation"|"@int KEYWORD ("asm"|"__assume"|"auto"|"class"|"const"|"delete"|"enum"|"explicit"|"extern"|"false"|"friend"|"gcnew"|"gcroot"|"set"|"get"|"inline"|"internal"|"mutable"|"namespace"|"new"|"null"|"nullptr"|"override"|"operator"|"pin_ptr"|"private"|"protected"|"public"|"raise"|"register"|"remove"|"self"|"sizeof"|"static"|"struct"|"__super"|"function"|"template"|"generic"|"this"|"true"|"typedef"|"typeid"|"typename"|"union"|"using"|"virtual"|"volatile"|"abstract"|"final"|"import"|"synchronized"|"transient"|"alignas"|"alignof"|{KEYWORD_OBJC}) FLOWKW ("break"|"catch"|"continue"|"default"|"do"|"else"|"finally"|"return"|"switch"|"throw"|"throws"|"@catch"|"@finally") FLOWCONDITION ("case"|"for"|"foreach"|"for each"|"goto"|"if"|"try"|"while"|"@try") -TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr") +TYPEKW ("bool"|"byte"|"char"|"double"|"float"|"int"|"long"|"object"|"short"|"signed"|"unsigned"|"void"|"wchar_t"|"size_t"|"boolean"|"id"|"SEL"|"string"|"nullptr"|"LocalObject"|"Object"|"Value") CASTKW ("const_cast"|"dynamic_cast"|"reinterpret_cast"|"static_cast") CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'")) ARITHOP "+"|"-"|"/"|"*"|"%"|"--"|"++" @@ -2241,7 +2241,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\" unput(*yytext); BEGIN( Body ); } -("extends"|"implements") { // Java +("extends"|"implements") { // Java, Slice startFontClass("keyword"); codifyLines(yytext); endFontClass(); diff --git a/src/config.xml b/src/config.xml index 08795dc..74c50c2 100644 --- a/src/config.xml +++ b/src/config.xml @@ -4,13 +4,13 @@ =) and one or more values. If the same tag is assigned more than once, the last assignment overwrites any earlier assignment. For tags that take a list as their argument, -the += operator can be used instead of = to append -new values to the list. Values are sequences of non-blanks. If the value should +the += operator can be used instead of = to append +new values to the list. Values are sequences of non-blanks. If the value should contain one or more blanks it must be surrounded by quotes ("..."). Multiple lines can be concatenated by inserting a backslash (\c \\) -as the last character of a line. Environment variables can be expanded +as the last character of a line. Environment variables can be expanded using the pattern \$(ENV_VARIABLE_NAME). You can also include part of a configuration file from another configuration file using a \@INCLUDE tag as follows: \verbatim @INCLUDE = config_file_name -\endverbatim -The include file is searched in the current working directory. You can +\endverbatim +The include file is searched in the current working directory. You can also specify a list of directories that should be searched before looking -in the current working directory. Do this by putting a \@INCLUDE_PATH tag +in the current working directory. Do this by putting a \@INCLUDE_PATH tag with these paths before the \@INCLUDE tag, e.g.: \verbatim @INCLUDE_PATH = my_config_dir \endverbatim The configuration options can be divided into several categories. -Below is an alphabetical index of the tags that are recognized +Below is an alphabetical index of the tags that are recognized followed by the descriptions of the tags grouped by category. ]]> @@ -91,14 +91,14 @@ Values that contain spaces should be placed between quotes (\" \"). /usr/bin, a more realistic configuration file would be: \verbatim PROJECT_NAME = Example @@ -109,7 +109,7 @@ PERL_PATH = /usr/local/bin/perl SEARCHENGINE = NO \endverbatim -To generate the documentation for the +To generate the documentation for the QdbtTabular package I have used the following configuration file: \verbatim @@ -160,7 +160,7 @@ INPUT = $(QTDIR)/doc \ $(QTDIR)/src/dialogs \ $(QTDIR)/src/tools FILE_PATTERNS = *.cpp *.h q*.doc -INCLUDE_PATH = $(QTDIR)/include +INCLUDE_PATH = $(QTDIR)/include RECURSIVE = YES \endverbatim @@ -212,7 +212,7 @@ Go to the next section or return to the + @@ -670,9 +680,9 @@ Go to the next section or return to the @@ -713,8 +723,8 @@ Go to the next section or return to the For Microsoft's IDL there are \c propget and \c propput attributes to indicate getter and setter methods for a property. Setting this option to \c YES will make doxygen to replace the get and set methods by a property in the - documentation. This will only work if the methods are indeed getting or - setting a simple type. If this is not the case, or you want to show the + documentation. This will only work if the methods are indeed getting or + setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to \c NO. ]]> @@ -745,16 +755,16 @@ Go to the next section or return to the the same type (for instance a group of public functions) to be put as a subgroup of that type (e.g. under the Public Functions section). Set it to \c NO to prevent subgrouping. Alternatively, this can be done per class using - the \ref cmdnosubgrouping "\\nosubgrouping" command. + the \ref cmdnosubgrouping "\\nosubgrouping" command. ]]>

    \$date
    will be replaced with the current date.
    \$year
    will be replaces with the current year.
    \$doxygenversion
    will be replaced with the version of doxygen -
    \$projectname
    will be replaced with the name of +
    \$projectname
    will be replaced with the name of the project (see \ref cfg_project_name "PROJECT_NAME")
    \$projectnumber
    will be replaced with the project number (see \ref cfg_project_number "PROJECT_NUMBER") @@ -1794,25 +1805,25 @@ doxygen -w html new_header.html new_footer.html new_stylesheet.css YourConfigFil description (see \ref cfg_project_brief "PROJECT_BRIEF")
    \$projectlogo
    will be replaced with the project logo (see \ref cfg_project_logo "PROJECT_LOGO") -
    \$treeview
    will be replaced with links to - the javascript and style sheets needed for the navigation tree - (or an empty string when \ref cfg_generate_treeview "GENERATE_TREEVIEW" +
    \$treeview
    will be replaced with links to + the javascript and style sheets needed for the navigation tree + (or an empty string when \ref cfg_generate_treeview "GENERATE_TREEVIEW" is disabled). -
    \$search
    will be replaced with a links to - the javascript and style sheets needed for the search engine - (or an empty string when \ref cfg_searchengine "SEARCHENGINE" +
    \$search
    will be replaced with a links to + the javascript and style sheets needed for the search engine + (or an empty string when \ref cfg_searchengine "SEARCHENGINE" is disabled). -
    \$mathjax
    will be replaced with a links to - the javascript and style sheets needed for the MathJax feature +
    \$mathjax
    will be replaced with a links to + the javascript and style sheets needed for the MathJax feature (or an empty string when \ref cfg_use_mathjax "USE_MATHJAX" is disabled).
    \$relpath^
    - If \ref cfg_create_subdirs "CREATE_SUBDIRS" is enabled, the command \$relpath^ can be + If \ref cfg_create_subdirs "CREATE_SUBDIRS" is enabled, the command \$relpath^ can be used to produce a relative path to the root of the HTML output directory, e.g. use \$relpath^doxygen.css, to refer to the standard style sheet. - To cope with differences in the layout of the header and footer that depend on - configuration settings, the header can also contain special blocks that + To cope with differences in the layout of the header and footer that depend on + configuration settings, the header can also contain special blocks that will be copied to the output or skipped depending on the configuration. Such blocks have the following form: \verbatim @@ -1841,9 +1852,9 @@ doxygen -w html new_header.html new_footer.html new_stylesheet.css YourConfigFil when the \ref cfg_project_logo "PROJECT_LOGO" option is not empty.
    TITLEAREA
    Content within this block is copied to the output when a title is visible at the top of each page. This is the case - if either \ref cfg_project_name "PROJECT_NAME", - \ref cfg_project_brief "PROJECT_BRIEF", \ref cfg_project_logo "PROJECT_LOGO" - is filled in or if both \ref cfg_disable_index "DISABLE_INDEX" and + if either \ref cfg_project_name "PROJECT_NAME", + \ref cfg_project_brief "PROJECT_BRIEF", \ref cfg_project_logo "PROJECT_LOGO" + is filled in or if both \ref cfg_disable_index "DISABLE_INDEX" and \ref cfg_searchengine "SEARCHENGINE" are enabled. ]]> @@ -1858,12 +1869,12 @@ doxygen -w html new_header.html new_footer.html new_stylesheet.css YourConfigFil