diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/code.l | 27 | ||||
-rw-r--r-- | src/config.l | 20 | ||||
-rw-r--r-- | src/definition.cpp | 4 | ||||
-rw-r--r-- | src/docparser.cpp | 119 | ||||
-rw-r--r-- | src/docparser.h | 25 | ||||
-rw-r--r-- | src/doctokenizer.l | 10 | ||||
-rw-r--r-- | src/docvisitor.h | 7 | ||||
-rw-r--r-- | src/htmldocvisitor.cpp | 45 | ||||
-rw-r--r-- | src/htmldocvisitor.h | 4 | ||||
-rw-r--r-- | src/latexdocvisitor.cpp | 32 | ||||
-rw-r--r-- | src/latexdocvisitor.h | 4 | ||||
-rw-r--r-- | src/mandocvisitor.cpp | 46 | ||||
-rw-r--r-- | src/mandocvisitor.h | 4 | ||||
-rw-r--r-- | src/memberdef.cpp | 13 | ||||
-rw-r--r-- | src/perlmodgen.cpp | 966 | ||||
-rw-r--r-- | src/printdocvisitor.h | 27 | ||||
-rw-r--r-- | src/rtfdocvisitor.cpp | 49 | ||||
-rw-r--r-- | src/rtfdocvisitor.h | 4 | ||||
-rw-r--r-- | src/rtfgen.cpp | 15 | ||||
-rw-r--r-- | src/util.cpp | 8 | ||||
-rw-r--r-- | src/xmldocvisitor.cpp | 28 | ||||
-rw-r--r-- | src/xmldocvisitor.h | 4 |
22 files changed, 901 insertions, 560 deletions
@@ -521,7 +521,7 @@ static MemberDef *setCallContextForVar(const QCString &name) { QCString scope = name.left(scopeEnd); QCString locName = name.right(name.length()-scopeEnd-2); - //printf("name=%s scope=%s\n",locName.data(),scope.data()); + //printf("explicit scope: name=%s scope=%s\n",locName.data(),scope.data()); ClassDef *mcd = getClass(scope); // TODO: check namespace as well if (mcd && !locName.isEmpty()) { @@ -539,20 +539,21 @@ static MemberDef *setCallContextForVar(const QCString &name) ClassDef *mcd = g_theVarContext.findVariable(name); if (mcd) // local variable { - //printf("local var `%s'\n",name.data()); + //printf("local var `%s' mcd=%s\n",name.data(),mcd->name().data()); g_theCallContext.setClass(mcd); - return 0; } - - // look for a class member - mcd = getClass(g_classScope); - if (mcd) + else { - MemberDef *md=mcd->getMemberByName(name); - if (md) + // look for a class member + mcd = getClass(g_classScope); + if (mcd) { - g_theCallContext.setClass(stripClassName(md->typeString())); - return md; + MemberDef *md=mcd->getMemberByName(name); + if (md) + { + g_theCallContext.setClass(stripClassName(md->typeString())); + return md; + } } } @@ -613,6 +614,7 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst) static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int *clNameLen=0) { int i=0; + //printf("generateClassOrGlobalLink(clName=%s)\n",clName); if (*clName=='~') // correct for matching negated values i.s.o. destructors. { g_code->codify("~"); @@ -634,6 +636,7 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int } if (cd && cd->isLinkable()) // is it a linkable class { + //printf("is linkable class %s\n",clName); if (g_exampleBlock) { QCString anchor; @@ -654,10 +657,12 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int if (cd==0) // not a class, see if it is a global enum/variable/typedef. { MemberDef *md = setCallContextForVar(clName); + //printf("is a global md=%p\n",md); if (md) { Definition *d = md->getOuterScope()==Doxygen::globalScope ? md->getBodyDef() : md->getOuterScope(); + //printf("definition %s\n",d?d->name().data():"<none>"); if (md->getGroupDef()) d = md->getGroupDef(); if (d && d->isLinkable() && md->isLinkable()) { diff --git a/src/config.l b/src/config.l index ab77a02..a2ace80 100644 --- a/src/config.l +++ b/src/config.l @@ -2206,10 +2206,28 @@ void Config::create() "PERLMOD_LATEX", "If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n" "the necessary Makefile rules, Perl scripts and LaTeX code to be able \n" - "to generate PDF and DVI output from the Perl module output.\n", + "to generate PDF and DVI output from the Perl module output. \n", FALSE ); cb->addDependency("GENERATE_PERLMOD"); + cb = addBool( + "PERLMOD_PRETTY", + "If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n" + "nicely formatted so it can be parsed by a human reader. This is useful \n" + "if you want to understand what is going on. On the other hand, if this \n" + "tag is set to NO the size of the Perl module output will be much smaller \n" + "and Perl will parse it just the same. \n", + TRUE + ); + cb->addDependency("GENERATE_PERLMOD"); + cs = addString( + "PERLMOD_MAKEVAR_PREFIX", + "The names of the make variables in the generated doxyrules.make file \n" + "are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n" + "This is useful so different doxyrules.make files included by the same \n" + "Makefile don't overwrite each other's variables." + ); + cs->addDependency("GENERATE_PERLMOD"); //----------------------------------------------------------------------------------------------- addInfo( "Preprocessor","Configuration options related to the preprocessor "); diff --git a/src/definition.cpp b/src/definition.cpp index 6fa80dd..f3b556a 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -259,9 +259,9 @@ void Definition::writeSourceDef(OutputList &ol,const char *) //printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef); if (Config_getBool("SOURCE_BROWSER") && m_startBodyLine!=-1 && m_bodyDef) { - //ol.disable(OutputGenerator::RTF); + ol.disable(OutputGenerator::RTF); ol.newParagraph(); - //ol.enableAll(); + ol.enableAll(); QCString refText = theTranslator->trDefinedAtLineInSourceFile(); int lineMarkerPos = refText.find("@0"); diff --git a/src/docparser.cpp b/src/docparser.cpp index a5f07f5..4b15a2b 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -327,7 +327,7 @@ static bool insidePRE(DocNode *n) { while (n) { - if (n->kind()==DocNode::Kind_HtmlPre) return TRUE; + if (n->isPreformatted()) return TRUE; n=n->parent(); } return FALSE; @@ -539,15 +539,17 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children, return tok==TK_NEWPARA ? TK_NEWPARA : RetVal_OK; } -static void handleStyleEnter(DocNode *parent,QList<DocNode> &children,DocStyleChange::Style s) +static void handleStyleEnter(DocNode *parent,QList<DocNode> &children, + DocStyleChange::Style s,const HtmlAttribList *attribs) { DBG(("HandleStyleEnter\n")); - DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,TRUE); + DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,TRUE,attribs); children.append(sc); g_styleStack.push(sc); } -static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,DocStyleChange::Style s,const char *tagName) +static void handleStyleLeave(DocNode *parent,QList<DocNode> &children, + DocStyleChange::Style s,const char *tagName) { DBG(("HandleStyleLeave\n")); if (g_styleStack.isEmpty() || // no style change @@ -576,13 +578,14 @@ static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children) const char *cmd=""; switch (sc->style()) { - case DocStyleChange::Bold: cmd = "b"; break; - case DocStyleChange::Italic: cmd = "em"; break; - case DocStyleChange::Code: cmd = "code"; break; - case DocStyleChange::Center: cmd = "center"; break; - case DocStyleChange::Small: cmd = "small"; break; - case DocStyleChange::Subscript: cmd = "subscript"; break; - case DocStyleChange::Superscript: cmd = "superscript"; break; + case DocStyleChange::Bold: cmd = "b"; break; + case DocStyleChange::Italic: cmd = "em"; break; + case DocStyleChange::Code: cmd = "code"; break; + case DocStyleChange::Center: cmd = "center"; break; + case DocStyleChange::Small: cmd = "small"; break; + case DocStyleChange::Subscript: cmd = "subscript"; break; + case DocStyleChange::Superscript: cmd = "superscript"; break; + case DocStyleChange::Preformatted: cmd = "preformatted"; break; } warn(g_fileName,doctokenizerYYlineno,"Error: end of paragraph without end of style " "command </%s>",cmd); @@ -597,12 +600,14 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children) { Definition *compound=0; MemberDef *member=0; + QString name = g_token->name; + if (name.at(0)=='#') name=name.right(name.length()-1); if (resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member)) { if (member) // member link { children.append(new - DocLinkedWord(parent,g_token->name, + DocLinkedWord(parent,name, compound->getReference(), compound->getOutputFileBase(), member->anchor() @@ -612,7 +617,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children) else // compound link { children.append(new - DocLinkedWord(parent,g_token->name, + DocLinkedWord(parent,name, compound->getReference(), compound->getOutputFileBase(), "" @@ -791,17 +796,29 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children case HTML_BOLD: if (!g_token->endTag) { - handleStyleEnter(parent,children,DocStyleChange::Bold); + handleStyleEnter(parent,children,DocStyleChange::Bold,&g_token->attribs); } else { handleStyleLeave(parent,children,DocStyleChange::Bold,tokenName); } break; + case HTML_PRE: + if (!g_token->endTag) + { + handleStyleEnter(parent,children,DocStyleChange::Preformatted,&g_token->attribs); + parent->setInsidePreformatted(TRUE); + } + else + { + handleStyleLeave(parent,children,DocStyleChange::Preformatted,tokenName); + parent->setInsidePreformatted(FALSE); + } + break; case HTML_CODE: if (!g_token->endTag) { - handleStyleEnter(parent,children,DocStyleChange::Code); + handleStyleEnter(parent,children,DocStyleChange::Code,&g_token->attribs); } else { @@ -811,7 +828,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children case HTML_EMPHASIS: if (!g_token->endTag) { - handleStyleEnter(parent,children,DocStyleChange::Italic); + handleStyleEnter(parent,children,DocStyleChange::Italic,&g_token->attribs); } else { @@ -821,7 +838,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children case HTML_SUB: if (!g_token->endTag) { - handleStyleEnter(parent,children,DocStyleChange::Subscript); + handleStyleEnter(parent,children,DocStyleChange::Subscript,&g_token->attribs); } else { @@ -831,7 +848,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children case HTML_SUP: if (!g_token->endTag) { - handleStyleEnter(parent,children,DocStyleChange::Superscript); + handleStyleEnter(parent,children,DocStyleChange::Superscript,&g_token->attribs); } else { @@ -841,7 +858,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children case HTML_CENTER: if (!g_token->endTag) { - handleStyleEnter(parent,children,DocStyleChange::Center); + handleStyleEnter(parent,children,DocStyleChange::Center,&g_token->attribs); } else { @@ -851,7 +868,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children case HTML_SMALL: if (!g_token->endTag) { - handleStyleEnter(parent,children,DocStyleChange::Small); + handleStyleEnter(parent,children,DocStyleChange::Small,&g_token->attribs); } else { @@ -1614,7 +1631,7 @@ QString DocLink::parse(bool isJavaLink) } goto endlink; default: - warn(g_fileName,doctokenizerYYlineno,"Error: Illegal command %s as part of a \\ref", + warn(g_fileName,doctokenizerYYlineno,"Error: Illegal command %s as part of a \\link", g_token->name.data()); break; } @@ -1628,7 +1645,6 @@ QString DocLink::parse(bool isJavaLink) if (isJavaLink) // special case to detect closing } { QString w = g_token->name; - uint l=w.length(); int p; if (w=="}") { @@ -1636,6 +1652,7 @@ QString DocLink::parse(bool isJavaLink) } else if ((p=w.find('}'))!=-1) { + uint l=w.length(); m_children.append(new DocWord(this,w.left(p))); if ((uint)p<l-1) // something left after the } (for instance a .) { @@ -2494,6 +2511,7 @@ enddesclist: //--------------------------------------------------------------------------- +#if 0 int DocHtmlPre::parse() { int rv; @@ -2515,6 +2533,7 @@ int DocHtmlPre::parse() ASSERT(n==this); return rv==RetVal_EndPre ? RetVal_OK : rv; } +#endif //--------------------------------------------------------------------------- @@ -3524,33 +3543,37 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag retval=RetVal_ListItem; } break; - case HTML_PRE: - { - DocHtmlPre *pre = new DocHtmlPre(this,tagHtmlAttribs); - m_children.append(pre); - retval=pre->parse(); - } - break; + //case HTML_PRE: + // { + // DocHtmlPre *pre = new DocHtmlPre(this,tagHtmlAttribs); + // m_children.append(pre); + // retval=pre->parse(); + // } + // break; case HTML_BOLD: - handleStyleEnter(this,m_children,DocStyleChange::Bold); + handleStyleEnter(this,m_children,DocStyleChange::Bold,&g_token->attribs); break; case HTML_CODE: - handleStyleEnter(this,m_children,DocStyleChange::Code); + handleStyleEnter(this,m_children,DocStyleChange::Code,&g_token->attribs); break; case HTML_EMPHASIS: - handleStyleEnter(this,m_children,DocStyleChange::Italic); + handleStyleEnter(this,m_children,DocStyleChange::Italic,&g_token->attribs); break; case HTML_SUB: - handleStyleEnter(this,m_children,DocStyleChange::Subscript); + handleStyleEnter(this,m_children,DocStyleChange::Subscript,&g_token->attribs); break; case HTML_SUP: - handleStyleEnter(this,m_children,DocStyleChange::Superscript); + handleStyleEnter(this,m_children,DocStyleChange::Superscript,&g_token->attribs); break; case HTML_CENTER: - handleStyleEnter(this,m_children,DocStyleChange::Center); + handleStyleEnter(this,m_children,DocStyleChange::Center,&g_token->attribs); break; case HTML_SMALL: - handleStyleEnter(this,m_children,DocStyleChange::Small); + handleStyleEnter(this,m_children,DocStyleChange::Small,&g_token->attribs); + break; + case HTML_PRE: + handleStyleEnter(this,m_children,DocStyleChange::Preformatted,&g_token->attribs); + setInsidePreformatted(TRUE); break; case HTML_P: retval=TK_NEWPARA; @@ -3737,16 +3760,16 @@ int DocPara::handleHtmlEndTag(const QString &tagName) // ignore </li> tags } break; - case HTML_PRE: - if (!insidePRE(this)) - { - warn(g_fileName,doctokenizerYYlineno,"Error: found </pre> tag without matching <pre>"); - } - else - { - retval=RetVal_EndPre; - } - break; + //case HTML_PRE: + // if (!insidePRE(this)) + // { + // warn(g_fileName,doctokenizerYYlineno,"Error: found </pre> tag without matching <pre>"); + // } + // else + // { + // retval=RetVal_EndPre; + // } + // break; case HTML_BOLD: handleStyleLeave(this,m_children,DocStyleChange::Bold,"b"); break; @@ -3768,6 +3791,10 @@ int DocPara::handleHtmlEndTag(const QString &tagName) case HTML_SMALL: handleStyleLeave(this,m_children,DocStyleChange::Small,"small"); break; + case HTML_PRE: + handleStyleLeave(this,m_children,DocStyleChange::Preformatted,"preformatted"); + setInsidePreformatted(FALSE); + break; case HTML_P: // ignore </p> tag break; diff --git a/src/docparser.h b/src/docparser.h index 1c78ada4..346623e 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -80,7 +80,7 @@ class DocNode Kind_XRefItem = 15, Kind_HtmlList = 16, Kind_HtmlListItem = 17, - Kind_HtmlPre = 18, + //Kind_HtmlPre = 18, Kind_HtmlDescList = 19, Kind_HtmlDescData = 20, Kind_HtmlDescTitle = 21, @@ -112,7 +112,9 @@ class DocNode Kind_Copy = 47, Kind_Text = 48 }; - /*! Destructor. */ + /*! Creates a new node */ + DocNode() : m_insidePre(FALSE) {} + /*! Destroys a node. */ virtual ~DocNode() {} /*! Returns the kind of node. Provides runtime type information */ virtual Kind kind() const = 0; @@ -122,6 +124,12 @@ class DocNode * @param v Abstract visitor. */ virtual void accept(DocVisitor *v) = 0; + /*! Returns TRUE iff this node is inside a preformatted section */ + bool isPreformatted() const { return m_insidePre; } + /*! Sets whether or not this item is inside a preformatted section */ + void setInsidePreformatted(bool p) { m_insidePre = p; } + private: + bool m_insidePre; }; /*! @brief Default accept implementation for compound nodes in the abstract @@ -254,22 +262,26 @@ class DocStyleChange : public DocNode { public: enum Style { Bold, Italic, Code, Center, Small, - Subscript, Superscript + Subscript, Superscript, Preformatted }; - DocStyleChange(DocNode *parent,uint position,Style s,bool enable) : - m_parent(parent), m_position(position), m_style(s), m_enable(enable) {} + DocStyleChange(DocNode *parent,uint position,Style s,bool enable, + const HtmlAttribList *attribs=0) : + m_parent(parent), m_position(position), m_style(s), m_enable(enable) + { if (attribs) m_attribs=*attribs; } Kind kind() const { return Kind_StyleChange; } Style style() const { return m_style; } bool enable() const { return m_enable; } uint position() const { return m_position; } DocNode *parent() const { return m_parent; } void accept(DocVisitor *v) { v->visit(this); } + const HtmlAttribList &attribs() const { return m_attribs; } private: DocNode *m_parent; uint m_position; Style m_style; bool m_enable; + HtmlAttribList m_attribs; }; /*! @brief Node representing a special symbol */ @@ -1024,7 +1036,7 @@ class DocHtmlDescData : public CompAccept<DocHtmlDescData>, public DocNode HtmlAttribList m_attribs; }; - +#if 0 /*! @brief Node representing a preformatted HTML section */ class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode { @@ -1041,6 +1053,7 @@ class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode DocNode * m_parent; HtmlAttribList m_attribs; }; +#endif /*! @brief Node representing a HTML table cell */ class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 4f34a00..f92a6f3 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -219,7 +219,7 @@ URLMASK (([a-z_A-Z][^\>\"\n]*{URLCHAR})|({URLCHAR}+))([({]{URLCHAR}*[)}])? FILESCHAR [a-z_A-Z0-9\\:\\\/\-\+] FILEECHAR [a-z_A-Z0-9\-\+] FILEMASK {FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)* -LINKMASK [^ \t\n\r\\@<&$]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"))? +LINKMASK [^ \t\n\r\\@<&${}]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"))? SPCMD1 {CMD}[a-z_A-Z0-9]+ SPCMD2 {CMD}[\\@<>&$#%~] SPCMD3 {CMD}form#[0-9]+ @@ -234,12 +234,12 @@ OPDEL {BLANK}+"delete"({BLANK}*"[]")? OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()" OPCAST {BLANK}+[^(\r\n.,]+ OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG}) -LNKWORD1 {SCOPEMASK} +LNKWORD1 ("::"|"#")?{SCOPEMASK} CVSPEC {BLANK}*("const"|"volatile") LNKWORD2 {SCOPEPRE}*"operator"{OPMASK} -WORD1 [^ \t\n\r\\@<>&$#,.]+ +WORD1 [^ \t\n\r\\@<>{}&$#,.]+|"{"|"}" WORD2 "."|"," -WORD1NQ [^ \t\n\r\\@<>&$#,."]+ +WORD1NQ [^ \t\n\r\\@<>{}&$#,."]+ WORD2NQ "."|"," HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">" HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p" @@ -618,7 +618,7 @@ HTMLKEYW {HTMLKEYL}|{HTMLKEYU} <*>\n { warn(g_fileName,yylineno,"Error: Unexpected new line character"); } -<*>[\\@<>&$#%~] { /* unescaped special character */ +<*>[\\@<>&$#%~] { /* unescaped special character */ //warn(g_fileName,yylineno,"Warning: Unexpected character `%s', assuming command \\%s was meant.",yytext,yytext); g_token->name = yytext; return TK_COMMAND; diff --git a/src/docvisitor.h b/src/docvisitor.h index e9cc03a..eb94e08 100644 --- a/src/docvisitor.h +++ b/src/docvisitor.h @@ -38,7 +38,7 @@ class DocVerbatim; class DocXRefItem; class DocHtmlList; class DocHtmlListItem; -class DocHtmlPre; +//class DocHtmlPre; class DocHtmlDescList; class DocHtmlDescTitle; class DocHtmlDescData; @@ -75,6 +75,7 @@ class DocText; class DocVisitor { public: + virtual ~DocVisitor() {} /*! @name Visitor functions for leaf nodes * @{ */ @@ -119,8 +120,8 @@ class DocVisitor virtual void visitPost(DocHtmlListItem *) = 0; virtual void visitPre(DocHtmlListItem *) = 0; virtual void visitPost(DocHtmlList *) = 0; - virtual void visitPre(DocHtmlPre *) = 0; - virtual void visitPost(DocHtmlPre *) = 0; + //virtual void visitPre(DocHtmlPre *) = 0; + //virtual void visitPost(DocHtmlPre *) = 0; virtual void visitPre(DocHtmlDescList *) = 0; virtual void visitPost(DocHtmlDescList *) = 0; virtual void visitPre(DocHtmlDescTitle *) = 0; diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index b9ef2d6..982dc39 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -133,26 +133,37 @@ void HtmlDocVisitor::visit(DocStyleChange *s) switch (s->style()) { case DocStyleChange::Bold: - if (s->enable()) m_t << "<b>"; else m_t << "</b>"; + if (s->enable()) m_t << "<b" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</b>"; break; case DocStyleChange::Italic: - if (s->enable()) m_t << "<em>"; else m_t << "</em>"; + if (s->enable()) m_t << "<em" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</em>"; break; case DocStyleChange::Code: - if (s->enable()) m_t << "<code>"; else m_t << "</code>"; + if (s->enable()) m_t << "<code" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</code>"; break; case DocStyleChange::Subscript: - if (s->enable()) m_t << "<sub>"; else m_t << "</sub>"; + if (s->enable()) m_t << "<sub" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sub>"; break; case DocStyleChange::Superscript: - if (s->enable()) m_t << "<sup>"; else m_t << "</sup>"; + if (s->enable()) m_t << "<sup" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sup>"; break; case DocStyleChange::Center: - if (s->enable()) m_t << "<center>"; else m_t << "</center>"; + if (s->enable()) m_t << "<center" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</center>"; break; case DocStyleChange::Small: - if (s->enable()) m_t << "<small>"; else m_t << "</small>"; + if (s->enable()) m_t << "<small" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</small>"; break; + case DocStyleChange::Preformatted: + if (s->enable()) + { + m_t << "<pre" << htmlAttribsToString(s->attribs()) << ">\n"; + m_insidePre=TRUE; + } + else + { + m_insidePre=FALSE; + m_t << "</pre>\n"; + } } } @@ -434,17 +445,17 @@ void HtmlDocVisitor::visitPost(DocHtmlListItem *) m_t << "</li>\n"; } -void HtmlDocVisitor::visitPre(DocHtmlPre *p) -{ - m_t << "<pre" << htmlAttribsToString(p->attribs()) << ">\n"; - m_insidePre=TRUE; -} +//void HtmlDocVisitor::visitPre(DocHtmlPre *p) +//{ +// m_t << "<pre" << htmlAttribsToString(p->attribs()) << ">\n"; +// m_insidePre=TRUE; +//} -void HtmlDocVisitor::visitPost(DocHtmlPre *) -{ - m_insidePre=FALSE; - m_t << "</pre>\n"; -} +//void HtmlDocVisitor::visitPost(DocHtmlPre *) +//{ +// m_insidePre=FALSE; +// m_t << "</pre>\n"; +//} void HtmlDocVisitor::visitPre(DocHtmlDescList *dl) { diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h index 0c49685..c2202a7 100644 --- a/src/htmldocvisitor.h +++ b/src/htmldocvisitor.h @@ -76,8 +76,8 @@ class HtmlDocVisitor : public DocVisitor void visitPost(DocHtmlList *) ; void visitPre(DocHtmlListItem *); void visitPost(DocHtmlListItem *); - void visitPre(DocHtmlPre *); - void visitPost(DocHtmlPre *); + //void visitPre(DocHtmlPre *); + //void visitPost(DocHtmlPre *); void visitPre(DocHtmlDescList *); void visitPost(DocHtmlDescList *); void visitPre(DocHtmlDescTitle *); diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index ce71479..e226168 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -203,6 +203,18 @@ void LatexDocVisitor::visit(DocStyleChange *s) case DocStyleChange::Small: if (s->enable()) m_t << "\\footnotesize "; else m_t << "\\normalsize "; break; + case DocStyleChange::Preformatted: + if (s->enable()) + { + m_t << "\\small\\begin{alltt}"; + m_insidePre=TRUE; + } + else + { + m_insidePre=FALSE; + m_t << "\\end{alltt}\\normalsize " << endl; + } + break; } } @@ -499,17 +511,17 @@ void LatexDocVisitor::visitPost(DocHtmlListItem *) { } -void LatexDocVisitor::visitPre(DocHtmlPre *) -{ - m_t << "\\small\\begin{alltt}"; - m_insidePre=TRUE; -} +//void LatexDocVisitor::visitPre(DocHtmlPre *) +//{ +// m_t << "\\small\\begin{alltt}"; +// m_insidePre=TRUE; +//} -void LatexDocVisitor::visitPost(DocHtmlPre *) -{ - m_insidePre=FALSE; - m_t << "\\end{alltt}\\normalsize " << endl; -} +//void LatexDocVisitor::visitPost(DocHtmlPre *) +//{ +// m_insidePre=FALSE; +// m_t << "\\end{alltt}\\normalsize " << endl; +//} void LatexDocVisitor::visitPre(DocHtmlDescList *) { diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index fbd2e3b..2d52dd7 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -76,8 +76,8 @@ class LatexDocVisitor : public DocVisitor void visitPost(DocHtmlList *s); void visitPre(DocHtmlListItem *); void visitPost(DocHtmlListItem *); - void visitPre(DocHtmlPre *); - void visitPost(DocHtmlPre *); + //void visitPre(DocHtmlPre *); + //void visitPost(DocHtmlPre *); void visitPre(DocHtmlDescList *); void visitPost(DocHtmlDescList *); void visitPre(DocHtmlDescTitle *); diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index edc7ede..c5b1230 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -151,6 +151,22 @@ void ManDocVisitor::visit(DocStyleChange *s) case DocStyleChange::Small: /* not supported */ break; + case DocStyleChange::Preformatted: + if (s->enable()) + { + if (!m_firstCol) m_t << endl; + m_t << ".PP" << endl; + m_t << ".nf" << endl; + m_insidePre=TRUE; + } + else + { + m_insidePre=FALSE; + if (!m_firstCol) m_t << endl; + m_t << ".PP" << endl; + m_firstCol=TRUE; + } + break; } } @@ -468,21 +484,21 @@ void ManDocVisitor::visitPost(DocHtmlListItem *) m_firstCol=TRUE; } -void ManDocVisitor::visitPre(DocHtmlPre *) -{ - if (!m_firstCol) m_t << endl; - m_t << ".PP" << endl; - m_t << ".nf" << endl; - m_insidePre=TRUE; -} - -void ManDocVisitor::visitPost(DocHtmlPre *) -{ - m_insidePre=FALSE; - if (!m_firstCol) m_t << endl; - m_t << ".PP" << endl; - m_firstCol=TRUE; -} +//void ManDocVisitor::visitPre(DocHtmlPre *) +//{ +// if (!m_firstCol) m_t << endl; +// m_t << ".PP" << endl; +// m_t << ".nf" << endl; +// m_insidePre=TRUE; +//} +// +//void ManDocVisitor::visitPost(DocHtmlPre *) +//{ +// m_insidePre=FALSE; +// if (!m_firstCol) m_t << endl; +// m_t << ".PP" << endl; +// m_firstCol=TRUE; +//} void ManDocVisitor::visitPre(DocHtmlDescList *) { diff --git a/src/mandocvisitor.h b/src/mandocvisitor.h index 2b61abf..cb3f5cc 100644 --- a/src/mandocvisitor.h +++ b/src/mandocvisitor.h @@ -76,8 +76,8 @@ class ManDocVisitor : public DocVisitor void visitPost(DocHtmlList *s); void visitPre(DocHtmlListItem *); void visitPost(DocHtmlListItem *); - void visitPre(DocHtmlPre *); - void visitPost(DocHtmlPre *); + //void visitPre(DocHtmlPre *); + //void visitPost(DocHtmlPre *); void visitPre(DocHtmlDescList *); void visitPost(DocHtmlDescList *); void visitPre(DocHtmlDescTitle *); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 7e2e454..cc8e0f2 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -1271,6 +1271,15 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.newParagraph(); ol.popGeneratorState(); } + else if(!brief.isEmpty() && (Config_getBool("REPEAT_BRIEF") || + !Config_getBool("BRIEF_MEMBER_DESC"))) + { + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::RTF); + ol.newParagraph(); + ol.popGeneratorState(); + } + //printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n", // defArgList, @@ -1375,7 +1384,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, // write class that contains a member that is reimplemented by this one if (bcd->isLinkable()) { + ol.disable(OutputGenerator::RTF); ol.newParagraph(); + ol.enableAll(); QCString reimplFromLine; if (bmd->virtualness()!=Pure && bcd->compoundType()!=ClassDef::Interface) @@ -1449,7 +1460,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, { mli.toFirst(); // write the list of classes that overwrite this member + ol.disable(OutputGenerator::RTF); ol.newParagraph(); + ol.enableAll(); QCString reimplInLine; if (virt==Pure || (classDef && classDef->compoundType()==ClassDef::Interface)) diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 596aa0b..66c57f9 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -102,14 +102,31 @@ class PerlModOutput { public: - PerlModOutput() : m_stream(0), m_indentation(0) { m_spaces[0] = 0; } + bool m_pretty; + + inline PerlModOutput(bool pretty) + : m_pretty(pretty), m_stream(0), m_indentation(false), m_blockstart(true) + { + m_spaces[0] = 0; + } + virtual ~PerlModOutput() { } inline void setPerlModOutputStream(PerlModOutputStream *os) { m_stream = os; } inline PerlModOutput &openSave() { iopenSave(); return *this; } inline PerlModOutput &closeSave(QString &s) { icloseSave(s); return *this; } - + + inline PerlModOutput &continueBlock() + { + if (m_blockstart) + m_blockstart = false; + else + m_stream->add(','); + indent(); + return *this; + } + inline PerlModOutput &add(char c) { m_stream->add(c); return *this; } inline PerlModOutput &add(const char *s) { m_stream->add(s); return *this; } inline PerlModOutput &add(QCString &s) { m_stream->add(s); return *this; } @@ -118,12 +135,24 @@ public: inline PerlModOutput &add(unsigned int n) { m_stream->add(n); return *this; } PerlModOutput &addQuoted(const char *s) { iaddQuoted(s); return *this; } - inline PerlModOutput &indent() { m_stream->add(m_spaces); return *this; } + + inline PerlModOutput &indent() + { + if (m_pretty) { + m_stream->add('\n'); + m_stream->add(m_spaces); + } + return *this; + } inline PerlModOutput &open(char c, const char *s = 0) { iopen(c, s); return *this; } inline PerlModOutput &close(char c = 0) { iclose(c); return *this; } inline PerlModOutput &addField(const char *s) { iaddField(s); return *this; } + inline PerlModOutput &addFieldQuotedChar(const char *field, char content) + { + iaddFieldQuotedChar(field, content); return *this; + } inline PerlModOutput &addFieldQuotedString(const char *field, const char *content) { iaddFieldQuotedString(field, content); return *this; @@ -146,6 +175,7 @@ protected: void decIndent(); void iaddQuoted(const char *); + void iaddFieldQuotedChar(const char *, char); void iaddFieldQuotedString(const char *, const char *); void iaddField(const char *); @@ -156,6 +186,7 @@ private: PerlModOutputStream *m_stream; int m_indentation; + bool m_blockstart; QStack<PerlModOutputStream> m_saved; char m_spaces[PERLOUTPUT_MAX_INDENTATION * 2 + 2]; @@ -203,9 +234,19 @@ void PerlModOutput::iaddQuoted(const char *s) inline void PerlModOutput::iaddField(const char *s) { - indent(); + continueBlock(); m_stream->add(s); - m_stream->add(" => "); + m_stream->add(m_pretty ? " => " : "=>"); +} + +void PerlModOutput::iaddFieldQuotedChar(const char *field, char content) +{ + iaddField(field); + m_stream->add('\''); + if (content == '\'') + m_stream->add('\\'); + m_stream->add(content); + m_stream->add('\''); } void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content) @@ -215,7 +256,7 @@ void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content iaddField(field); m_stream->add('\''); iaddQuoted(content); - m_stream->add("',\n"); + m_stream->add('\''); } void PerlModOutput::iopen(char c, const char *s) @@ -223,10 +264,10 @@ void PerlModOutput::iopen(char c, const char *s) if (s != 0) iaddField(s); else - indent(); + continueBlock(); m_stream->add(c); - m_stream->add('\n'); incIndent(); + m_blockstart = true; } void PerlModOutput::iclose(char c) @@ -235,7 +276,7 @@ void PerlModOutput::iclose(char c) indent(); if (c != 0) m_stream->add(c); - m_stream->add(",\n"); + m_blockstart = false; } /*! @brief Concrete visitor implementation for PerlMod output. */ @@ -243,7 +284,7 @@ class PerlModDocVisitor : public DocVisitor { public: PerlModDocVisitor(PerlModOutput &); - virtual ~PerlModDocVisitor() {} + virtual ~PerlModDocVisitor() { } void finish(); @@ -292,8 +333,8 @@ public: void visitPost(DocHtmlList *) ; void visitPre(DocHtmlListItem *); void visitPost(DocHtmlListItem *); - void visitPre(DocHtmlPre *); - void visitPost(DocHtmlPre *); + //void visitPre(DocHtmlPre *); + //void visitPost(DocHtmlPre *); void visitPre(DocHtmlDescList *); void visitPost(DocHtmlDescList *); void visitPre(DocHtmlDescTitle *); @@ -358,6 +399,8 @@ private: void singleItem(const char *); void openSubBlock(const char * = 0); void closeSubBlock(); + void openOther(); + void closeOther(); //-------------------------------------- // state variables @@ -365,6 +408,7 @@ private: PerlModOutput &m_output; bool m_textmode; + bool m_textblockstart; QString m_other; }; @@ -397,6 +441,7 @@ void PerlModDocVisitor::openItem(const char *name) void PerlModDocVisitor::closeItem() { + leaveText(); m_output.closeHash(); } @@ -413,9 +458,10 @@ void PerlModDocVisitor::leaveText() { if (!m_textmode) return; - m_output.add("\'\n"); - closeItem(); m_textmode = false; + m_output + .add('\'') + .closeHash(); } void PerlModDocVisitor::singleItem(const char *name) @@ -427,6 +473,7 @@ void PerlModDocVisitor::singleItem(const char *name) void PerlModDocVisitor::openSubBlock(const char *s) { m_output.openList(s); + m_textblockstart = true; } void PerlModDocVisitor::closeSubBlock() @@ -435,6 +482,20 @@ void PerlModDocVisitor::closeSubBlock() m_output.closeList(); } +void PerlModDocVisitor::openOther() +{ + leaveText(); + m_output.openSave(); +} + +void PerlModDocVisitor::closeOther() +{ + QString other; + leaveText(); + m_output.closeSave(other); + m_other += other; +} + void PerlModDocVisitor::visit(DocWord *w) { enterText(); @@ -459,6 +520,8 @@ void PerlModDocVisitor::visit(DocSymbol *sy) { char c = 0; const char *s = 0; + const char *accent = 0; + const char *symbol = 0; switch(sy->symbol()) { case DocSymbol::At: c = '@'; break; @@ -469,27 +532,41 @@ void PerlModDocVisitor::visit(DocSymbol *sy) case DocSymbol::Hash: c = '#'; break; case DocSymbol::Percent: c = '%'; break; case DocSymbol::Quot: c = '"'; break; - case DocSymbol::Szlig: c = 'ß'; break; case DocSymbol::Nbsp: c = ' '; break; - case DocSymbol::Uml: c = sy->letter(); break; - case DocSymbol::Acute: c = sy->letter(); break; - case DocSymbol::Grave: c = sy->letter(); break; - case DocSymbol::Circ: c = sy->letter(); break; - case DocSymbol::Tilde: c = sy->letter(); break; - case DocSymbol::Cedil: c = sy->letter(); break; - case DocSymbol::Ring: c = sy->letter(); break; + case DocSymbol::Uml: accent = "umlaut"; break; + case DocSymbol::Acute: accent = "acute"; break; + case DocSymbol::Grave: accent = "grave"; break; + case DocSymbol::Circ: accent = "circ"; break; + case DocSymbol::Tilde: accent = "tilde"; break; + case DocSymbol::Cedil: accent = "cedilla"; break; + case DocSymbol::Ring: accent = "ring"; break; case DocSymbol::BSlash: s = "\\\\"; break; - case DocSymbol::Copy: s = "(c)"; break; + case DocSymbol::Copy: symbol = "copyright"; break; + case DocSymbol::Szlig: symbol = "szlig"; break; case DocSymbol::Apos: s = "\\\'"; break; case DocSymbol::Unknown: err("Error: unknown symbol found\n"); break; } - enterText(); - if (c != 0) + if (c != 0) { + enterText(); m_output.add(c); - else + } else if (s != 0) { + enterText(); m_output.add(s); + } else if (symbol != 0) { + leaveText(); + openItem("symbol"); + m_output.addFieldQuotedString("symbol", symbol); + closeItem(); + } else if (accent != 0) { + leaveText(); + openItem("accent"); + m_output + .addFieldQuotedString("accent", accent) + .addFieldQuotedChar("letter", sy->letter()); + closeItem(); + } } void PerlModDocVisitor::visit(DocURL *u) @@ -501,18 +578,26 @@ void PerlModDocVisitor::visit(DocURL *u) void PerlModDocVisitor::visit(DocLineBreak *) { singleItem("linebreak"); } void PerlModDocVisitor::visit(DocHorRuler *) { singleItem("hruler"); } + void PerlModDocVisitor::visit(DocStyleChange *s) { + const char *style = 0; switch (s->style()) { - case DocStyleChange::Bold: break; // bold - case DocStyleChange::Italic: break; // italic - case DocStyleChange::Code: break; // code - case DocStyleChange::Subscript: break; // subscript - case DocStyleChange::Superscript: break; // superscript - case DocStyleChange::Center: break; // center - case DocStyleChange::Small: break; // small + case DocStyleChange::Bold: style = "bold"; break; + case DocStyleChange::Italic: style = "italic"; break; + case DocStyleChange::Code: style = "code"; break; + case DocStyleChange::Subscript: style = "subscript"; break; + case DocStyleChange::Superscript: style = "superscript"; break; + case DocStyleChange::Center: style = "center"; break; + case DocStyleChange::Small: style = "small"; break; + case DocStyleChange::Preformatted: style = "preformatted"; break; + } + openItem("style"); + m_output.addFieldQuotedString("style", style) + .addFieldBoolean("enable", s->enable()); + closeItem(); } void PerlModDocVisitor::visit(DocVerbatim *s) @@ -616,22 +701,45 @@ void PerlModDocVisitor::visit(DocIndexEntry *) void PerlModDocVisitor::visitPre(DocAutoList *l) { - openItem(l->isEnumList() ? "ordered_list" : "itemized_list"); + openItem("list"); + m_output.addFieldQuotedString("style", l->isEnumList() ? "ordered" : "itemized"); openSubBlock("content"); } -void PerlModDocVisitor::visitPost(DocAutoList *) { closeSubBlock(); closeItem(); } -void PerlModDocVisitor::visitPre(DocAutoListItem *) { openSubBlock(); } -void PerlModDocVisitor::visitPost(DocAutoListItem *) { closeSubBlock(); } +void PerlModDocVisitor::visitPost(DocAutoList *) +{ + closeSubBlock(); + closeItem(); +} + +void PerlModDocVisitor::visitPre(DocAutoListItem *) +{ + openSubBlock(); +} + +void PerlModDocVisitor::visitPost(DocAutoListItem *) +{ + closeSubBlock(); +} + void PerlModDocVisitor::visitPre(DocPara *) { + if (m_textblockstart) + m_textblockstart = false; + else + singleItem("parbreak"); + /* openItem("para"); openSubBlock("content"); + */ } + void PerlModDocVisitor::visitPost(DocPara *) { + /* closeSubBlock(); closeItem(); + */ } void PerlModDocVisitor::visitPre(DocRoot *) @@ -644,7 +752,6 @@ void PerlModDocVisitor::visitPost(DocRoot *) void PerlModDocVisitor::visitPre(DocSimpleSect *s) { - leaveText(); const char *type = 0; switch (s->type()) { @@ -667,15 +774,14 @@ void PerlModDocVisitor::visitPre(DocSimpleSect *s) err("Error: unknown simple section found\n"); break; } - m_output.openSave().openList(type); + openOther(); + openSubBlock(type); } void PerlModDocVisitor::visitPost(DocSimpleSect *) { - QString content; - leaveText(); - m_output.closeList().closeSave(content); - m_other += content; + closeSubBlock(); + closeOther(); } void PerlModDocVisitor::visitPre(DocTitle *) @@ -692,44 +798,63 @@ void PerlModDocVisitor::visitPost(DocTitle *) void PerlModDocVisitor::visitPre(DocSimpleList *) { - openItem("itemized_list"); + openItem("list"); + m_output.addFieldQuotedString("style", "itemized"); openSubBlock("content"); } -void PerlModDocVisitor::visitPost(DocSimpleList *) { closeSubBlock(); } + +void PerlModDocVisitor::visitPost(DocSimpleList *) +{ + closeSubBlock(); + closeItem(); +} + void PerlModDocVisitor::visitPre(DocSimpleListItem *) { openSubBlock(); } void PerlModDocVisitor::visitPost(DocSimpleListItem *) { closeSubBlock(); } void PerlModDocVisitor::visitPre(DocSection *s) { - QString sect = "sect" + (s->level() + 1); + QString sect = QString("sect%1").arg(s->level()); openItem(sect); openSubBlock("content"); } -void PerlModDocVisitor::visitPost(DocSection *) { closeSubBlock(); } -void PerlModDocVisitor::visitPre(DocHtmlList *l) +void PerlModDocVisitor::visitPost(DocSection *) { - openItem((l->type() == DocHtmlList::Ordered) ? "ordered_list" : "itemized_list"); - openSubBlock("content"); + closeSubBlock(); + closeItem(); } -void PerlModDocVisitor::visitPost(DocHtmlList *) { closeSubBlock(); } -void PerlModDocVisitor::visitPre(DocHtmlListItem *) { openSubBlock(); } -void PerlModDocVisitor::visitPost(DocHtmlListItem *) { closeSubBlock(); } -void PerlModDocVisitor::visitPre(DocHtmlPre *) +void PerlModDocVisitor::visitPre(DocHtmlList *l) { - openItem("preformatted"); + openItem("list"); + m_output.addFieldQuotedString("style", (l->type() == DocHtmlList::Ordered) ? "ordered" : "itemized"); openSubBlock("content"); - //m_insidePre=TRUE; } -void PerlModDocVisitor::visitPost(DocHtmlPre *) +void PerlModDocVisitor::visitPost(DocHtmlList *) { - //m_insidePre=FALSE; closeSubBlock(); closeItem(); } +void PerlModDocVisitor::visitPre(DocHtmlListItem *) { openSubBlock(); } +void PerlModDocVisitor::visitPost(DocHtmlListItem *) { closeSubBlock(); } + +//void PerlModDocVisitor::visitPre(DocHtmlPre *) +//{ +// openItem("preformatted"); +// openSubBlock("content"); +// //m_insidePre=TRUE; +//} + +//void PerlModDocVisitor::visitPost(DocHtmlPre *) +//{ +// //m_insidePre=FALSE; +// closeSubBlock(); +// closeItem(); +//} + void PerlModDocVisitor::visitPre(DocHtmlDescList *) { #if 0 @@ -943,10 +1068,12 @@ void PerlModDocVisitor::visitPre(DocRef *ref) openItem("ref"); if (!ref->hasLinkText()) m_output.addFieldQuotedString("text", ref->targetTitle()); + openSubBlock("content"); } void PerlModDocVisitor::visitPost(DocRef *) { + closeSubBlock(); closeItem(); } @@ -1002,15 +1129,14 @@ void PerlModDocVisitor::visitPre(DocParamSect *s) err("Error: unknown parameter section found\n"); break; } - m_output.openSave().openList(type); + openOther(); + openSubBlock(type); } void PerlModDocVisitor::visitPost(DocParamSect *) { - leaveText(); - QString content; - m_output.closeList().closeSave(content); - m_other += content; + closeSubBlock(); + closeOther(); } void PerlModDocVisitor::visitPre(DocParamList *pl) @@ -1048,10 +1174,14 @@ void PerlModDocVisitor::visitPre(DocXRefItem *) m_output.add("</xreftitle>"); m_output.add("<xrefdescription>"); #endif + openItem("xrefitem"); + openSubBlock("content"); } void PerlModDocVisitor::visitPost(DocXRefItem *) { + closeSubBlock(); + closeItem(); #if 0 m_output.add("</xrefdescription>"); m_output.add("</xrefsect>"); @@ -1062,10 +1192,12 @@ void PerlModDocVisitor::visitPre(DocInternalRef *ref) { openItem("ref"); addLink(0,ref->file(),ref->anchor()); + openSubBlock("content"); } void PerlModDocVisitor::visitPost(DocInternalRef *) { + closeSubBlock(); closeItem(); } @@ -1133,7 +1265,7 @@ static void addPerlModDocBlock(PerlModOutput &output, { QCString stext = text.stripWhiteSpace(); if (stext.isEmpty()) - output.addField(name).add("{},\n"); + output.addField(name).add("{}"); else { DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,stext,FALSE); output.openHash(name); @@ -1181,38 +1313,40 @@ class PerlModGenerator { public: - PerlModOutput output; + PerlModOutput m_output; - QString pathDoxyModelPM; + QString pathDoxyStructurePM; QString pathDoxyDocsTex; QString pathDoxyFormatTex; QString pathDoxyLatexTex; QString pathDoxyLatexDVI; QString pathDoxyLatexPDF; - QString pathDoxyTemplateTex; + QString pathDoxyStructureTex; QString pathDoxyDocsPM; QString pathDoxyLatexPL; - QString pathDoxyLatexTemplatePL; + QString pathDoxyLatexStructurePL; QString pathDoxyRules; QString pathMakefile; - void generatePerlModForMember(MemberDef *md,Definition *); - void generatePerlModSection(Definition *d, - MemberList *ml,const char *name,const char *header=0); - void addListOfAllMembers(ClassDef *cd, PerlModOutput &output); - void generatePerlModForClass(ClassDef *cd, PerlModOutput &output); - void generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output); - void generatePerlModForFile(FileDef *fd, PerlModOutput &output); - void generatePerlModForGroup(GroupDef *gd, PerlModOutput &output); - void generatePerlModForPage(PageInfo *pi, PerlModOutput &output); + inline PerlModGenerator(bool pretty) : m_output(pretty) { } + + void generatePerlModForMember(MemberDef *md, Definition *); + void generatePerlModSection(Definition *d, MemberList *ml, + const char *name, const char *header=0); + void addListOfAllMembers(ClassDef *cd); + void generatePerlModForClass(ClassDef *cd); + void generatePerlModForNamespace(NamespaceDef *nd); + void generatePerlModForFile(FileDef *fd); + void generatePerlModForGroup(GroupDef *gd); + void generatePerlModForPage(PageInfo *pi); bool createOutputFile(QFile &f, const char *s); bool createOutputDir(QDir &perlModDir); bool generateDoxyLatexTex(); bool generateDoxyFormatTex(); - bool generateDoxyModelPM(); + bool generateDoxyStructurePM(); bool generateDoxyLatexPL(); - bool generateDoxyLatexTemplatePL(); + bool generateDoxyLatexStructurePL(); bool generateDoxyRules(); bool generateMakefile(); bool generatePerlModOutput(); @@ -1222,7 +1356,6 @@ public: void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) { - // + declaration/definition arg lists // + reimplements // + reimplementedBy @@ -1261,26 +1394,26 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) else if (md->getNamespaceDef()) scopeName=md->getNamespaceDef()->name(); - output.openHash() + m_output.openHash() .addFieldQuotedString("kind", memType) .addFieldQuotedString("name", md->name()) .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) .addFieldQuotedString("protection", getProtectionName(md->protection())) .addFieldBoolean("static", md->isStatic()); - addPerlModDocBlock(output,"brief",md->getDefFileName(),md->getDefLine(),scopeName,md,md->briefDescription()); - addPerlModDocBlock(output,"detailed",md->getDefFileName(),md->getDefLine(),scopeName,md,md->documentation()); + addPerlModDocBlock(m_output,"brief",md->getDefFileName(),md->getDefLine(),scopeName,md,md->briefDescription()); + addPerlModDocBlock(m_output,"detailed",md->getDefFileName(),md->getDefLine(),scopeName,md,md->documentation()); if (md->memberType()!=MemberDef::Define && md->memberType()!=MemberDef::Enumeration) - output.addFieldQuotedString("type", md->typeString()); + m_output.addFieldQuotedString("type", md->typeString()); if (isFunc) //function { ArgumentList *al = md->argumentList(); - output.addFieldBoolean("const", al && al->constSpecifier) + m_output.addFieldBoolean("const", al && al->constSpecifier) .addFieldBoolean("volatile", al && al->volatileSpecifier); - output.openList("parameters"); + m_output.openList("parameters"); ArgumentList *declAl = md->declArgumentList(); ArgumentList *defAl = md->argumentList(); if (declAl && declAl->count()>0) @@ -1291,80 +1424,80 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) for (declAli.toFirst();(a=declAli.current());++declAli) { Argument *defArg = defAli.current(); - output.openHash(); + m_output.openHash(); if (!a->name.isEmpty()) - output.addFieldQuotedString("declaration_name", a->name); + m_output.addFieldQuotedString("declaration_name", a->name); if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name) - output.addFieldQuotedString("definition_name", defArg->name); + m_output.addFieldQuotedString("definition_name", defArg->name); if (!a->type.isEmpty()) - output.addFieldQuotedString("type", a->type); + m_output.addFieldQuotedString("type", a->type); if (!a->array.isEmpty()) - output.addFieldQuotedString("array", a->array); + m_output.addFieldQuotedString("array", a->array); if (!a->defval.isEmpty()) - output.addFieldQuotedString("default_value", a->defval); + m_output.addFieldQuotedString("default_value", a->defval); if (!a->attrib.isEmpty()) - output.addFieldQuotedString("attributes", a->attrib); + m_output.addFieldQuotedString("attributes", a->attrib); - output.closeHash(); + m_output.closeHash(); if (defArg) ++defAli; } } - output.closeList(); + m_output.closeList(); } else if (md->memberType()==MemberDef::Define && md->argsString()!=0) // define { - output.openList("parameters"); + m_output.openList("parameters"); ArgumentListIterator ali(*md->argumentList()); Argument *a; for (ali.toFirst();(a=ali.current());++ali) { - output.openHash() + m_output.openHash() .addFieldQuotedString("name", a->type) .closeHash(); } - output.closeList(); + m_output.closeList(); } if (!md->initializer().isEmpty()) - output.addFieldQuotedString("initializer", md->initializer()); + m_output.addFieldQuotedString("initializer", md->initializer()); if (md->excpString()) - output.addFieldQuotedString("exceptions", md->excpString()); + m_output.addFieldQuotedString("exceptions", md->excpString()); if (md->memberType()==MemberDef::Enumeration) // enum { if (md->enumFieldList()) { - output.openList("values"); + m_output.openList("values"); MemberListIterator emli(*md->enumFieldList()); MemberDef *emd; for (emli.toFirst();(emd=emli.current());++emli) { - output.openHash() + m_output.openHash() .addFieldQuotedString("name", emd->name()); if (!emd->initializer().isEmpty()) - output.addFieldQuotedString("initializer", emd->initializer()); + m_output.addFieldQuotedString("initializer", emd->initializer()); - addPerlModDocBlock(output,"brief",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->briefDescription()); + addPerlModDocBlock(m_output,"brief",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->briefDescription()); - addPerlModDocBlock(output,"detailed",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->documentation()); + addPerlModDocBlock(m_output,"detailed",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->documentation()); - output.closeHash(); + m_output.closeHash(); } - output.closeList(); + m_output.closeList(); } } MemberDef *rmd = md->reimplements(); if (rmd) - output.openHash("reimplements") + m_output.openHash("reimplements") .addFieldQuotedString("name", rmd->name()) .closeHash(); @@ -1372,15 +1505,15 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) if (rbml) { MemberListIterator mli(*rbml); - output.openList("reimplemented_by"); + m_output.openList("reimplemented_by"); for (mli.toFirst();(rmd=mli.current());++mli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", rmd->name()) .closeHash(); - output.closeList(); + m_output.closeList(); } - output.closeHash(); + m_output.closeHash(); } void PerlModGenerator::generatePerlModSection(Definition *d, @@ -1388,25 +1521,25 @@ void PerlModGenerator::generatePerlModSection(Definition *d, { if (ml->count()==0) return; // empty list - output.openHash(name); + m_output.openHash(name); if (header) - output.addFieldQuotedString("header", header); + m_output.addFieldQuotedString("header", header); - output.openList("members"); + m_output.openList("members"); MemberListIterator mli(*ml); MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { generatePerlModForMember(md,d); } - output.closeList() + m_output.closeList() .closeHash(); } -void PerlModGenerator::addListOfAllMembers(ClassDef *cd, PerlModOutput &output) +void PerlModGenerator::addListOfAllMembers(ClassDef *cd) { - output.openList("all_members"); + m_output.openList("all_members"); MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); MemberNameInfo *mni; for (mnii.toFirst();(mni=mnii.current());++mnii) @@ -1420,22 +1553,22 @@ void PerlModGenerator::addListOfAllMembers(ClassDef *cd, PerlModOutput &output) Definition *d=md->getGroupDef(); if (d==0) d = cd; - output.openHash() + m_output.openHash() .addFieldQuotedString("name", md->name()) .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) .addFieldQuotedString("protection", getProtectionName(mi->prot)); if (!mi->ambiguityResolutionScope.isEmpty()) - output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); + m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); - output.addFieldQuotedString("scope", cd->name()) + m_output.addFieldQuotedString("scope", cd->name()) .closeHash(); } } - output.closeList(); + m_output.closeList(); } -void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForClass(ClassDef *cd) { // + brief description // + detailed description @@ -1457,48 +1590,48 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp if (cd->name().find('@')!=-1) return; // skip anonymous compounds. if (cd->templateMaster()!=0) return; // skip generated template instances. - output.openHash() + m_output.openHash() .addFieldQuotedString("name", cd->name()); if (cd->baseClasses()->count()>0) { - output.openList("base"); + m_output.openList("base"); BaseClassListIterator bcli(*cd->baseClasses()); BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", bcd->classDef->displayName()) .addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt)) .addFieldQuotedString("protection", getProtectionName(bcd->prot)) .closeHash(); - output.closeList(); + m_output.closeList(); } if (cd->subClasses()->count()>0) { - output.openList("derived"); + m_output.openList("derived"); BaseClassListIterator bcli(*cd->baseClasses()); BaseClassDef *bcd; for (bcli.toFirst();(bcd=bcli.current());++bcli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", bcd->classDef->displayName()) .addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt)) .addFieldQuotedString("protection", getProtectionName(bcd->prot)) .closeHash(); - output.closeList(); + m_output.closeList(); } ClassSDict *cl = cd->getInnerClasses(); if (cl) { - output.openList("inner"); + m_output.openList("inner"); ClassSDict::Iterator cli(*cl); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", cd->name()) .closeHash(); - output.closeList(); + m_output.closeList(); } IncludeInfo *ii=cd->includeInfo(); @@ -1508,19 +1641,19 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName(); if (!nm.isEmpty()) { - output.openHash("includes"); + m_output.openHash("includes"); #if 0 if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references t << " id=\"" << ii->fileDef->getOutputFileBase() << "\""; #endif - output.addFieldBoolean("local", ii->local) + m_output.addFieldBoolean("local", ii->local) .addFieldQuotedString("name", nm) .closeHash(); } } - addTemplateList(cd,output); - addListOfAllMembers(cd,output); + addTemplateList(cd,m_output); + addListOfAllMembers(cd); MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) @@ -1550,8 +1683,8 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp generatePerlModSection(cd,&cd->friends,"friend_methods"); generatePerlModSection(cd,&cd->related,"related_methods"); - addPerlModDocBlock(output,"brief",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->briefDescription()); - addPerlModDocBlock(output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->documentation()); + addPerlModDocBlock(m_output,"brief",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->briefDescription()); + addPerlModDocBlock(m_output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->documentation()); #if 0 DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance); @@ -1579,10 +1712,10 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp t << "/>" << endl; #endif - output.closeHash(); + m_output.closeHash(); } -void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd) { // + contained class definitions // + contained namespace definitions @@ -1595,33 +1728,33 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutp if (nd->isReference()) return; // skip external references - output.openHash() + m_output.openHash() .addFieldQuotedString("name", nd->name()); ClassSDict *cl = nd->classSDict; if (cl) { - output.openList("classes"); + m_output.openList("classes"); ClassSDict::Iterator cli(*cl); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", cd->name()) .closeHash(); - output.closeList(); + m_output.closeList(); } NamespaceSDict *nl = nd->namespaceSDict; if (nl) { - output.openList("namespaces"); + m_output.openList("namespaces"); NamespaceSDict::Iterator nli(*nl); NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", nd->name()) .closeHash(); - output.closeList(); + m_output.closeList(); } MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict); @@ -1636,13 +1769,13 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutp generatePerlModSection(nd,&nd->decFuncMembers,"functions"); generatePerlModSection(nd,&nd->decVarMembers,"variables"); - addPerlModDocBlock(output,"brief",nd->getDefFileName(),nd->getDefLine(),0,0,nd->briefDescription()); - addPerlModDocBlock(output,"detailed",nd->getDefFileName(),nd->getDefLine(),0,0,nd->documentation()); + addPerlModDocBlock(m_output,"brief",nd->getDefFileName(),nd->getDefLine(),0,0,nd->briefDescription()); + addPerlModDocBlock(m_output,"detailed",nd->getDefFileName(),nd->getDefLine(),0,0,nd->documentation()); - output.closeHash(); + m_output.closeHash(); } -void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForFile(FileDef *fd) { // + includes files // + includedby files @@ -1660,37 +1793,37 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output if (fd->isReference()) return; - output.openHash() + m_output.openHash() .addFieldQuotedString("name", fd->name()); QListIterator<IncludeInfo> ili1(*fd->includeFileList()); IncludeInfo *inc; - output.openList("includes"); + m_output.openList("includes"); for (ili1.toFirst();(inc=ili1.current());++ili1) { - output.openHash() + m_output.openHash() .addFieldQuotedString("name", inc->includeName); if (inc->fileDef && !inc->fileDef->isReference()) { - output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); } - output.closeHash(); + m_output.closeHash(); } - output.closeList(); + m_output.closeList(); QListIterator<IncludeInfo> ili2(*fd->includedByFileList()); - output.openList("included_by"); + m_output.openList("included_by"); for (ili2.toFirst();(inc=ili2.current());++ili2) { - output.openHash() - .addFieldQuotedString("name => ", inc->includeName); + m_output.openHash() + .addFieldQuotedString("name", inc->includeName); if (inc->fileDef && !inc->fileDef->isReference()) { - output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); + m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); } - output.closeHash(); + m_output.closeHash(); } - output.closeList(); + m_output.closeList(); generatePerlModSection(fd,&fd->decDefineMembers,"defines"); generatePerlModSection(fd,&fd->decProtoMembers,"prototypes"); @@ -1699,13 +1832,13 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output generatePerlModSection(fd,&fd->decFuncMembers,"functions"); generatePerlModSection(fd,&fd->decVarMembers,"variables"); - addPerlModDocBlock(output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription()); - addPerlModDocBlock(output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation()); + addPerlModDocBlock(m_output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription()); + addPerlModDocBlock(m_output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation()); - output.closeHash(); + m_output.closeHash(); } -void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &output) +void PerlModGenerator::generatePerlModForGroup(GroupDef *gd) { // + members // + member groups @@ -1721,73 +1854,73 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &outp if (gd->isReference()) return; // skip external references - output.openHash() + m_output.openHash() .addFieldQuotedString("name", gd->name()) .addFieldQuotedString("title", gd->groupTitle()); FileList *fl = gd->getFiles(); if (fl) { - output.openList("files"); + m_output.openList("files"); QListIterator<FileDef> fli(*fl); FileDef *fd = fl->first(); for (fli.toFirst();(fd=fli.current());++fli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", fd->name()) .closeHash(); - output.closeList(); + m_output.closeList(); } ClassSDict *cl = gd->getClasses(); if (cl) { - output.openList("classes"); + m_output.openList("classes"); ClassSDict::Iterator cli(*cl); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", cd->name()) .closeHash(); - output.closeList(); + m_output.closeList(); } NamespaceList *nl = gd->getNamespaces(); if (nl) { - output.openList("namespaces"); + m_output.openList("namespaces"); NamespaceListIterator nli(*nl); NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) - output.openHash() + m_output.openHash() .addFieldQuotedString("name", nd->name()) .closeHash(); - output.closeList(); + m_output.closeList(); } PageSDict *pl = gd->getPages(); if (pl) { - output.openList("pages"); + m_output.openList("pages"); PageSDict::Iterator pli(*pl); PageInfo *pi; for (pli.toFirst();(pi=pli.current());++pli) - output.openHash() + m_output.openHash() .addFieldQuotedString("title", pi->title) .closeHash(); - output.closeList(); + m_output.closeList(); } GroupList *gl = gd->getSubGroups(); if (gl) { - output.openList("groups"); + m_output.openList("groups"); GroupListIterator gli(*gl); GroupDef *sgd; for (gli.toFirst();(sgd=gli.current());++gli) - output.openHash() + m_output.openHash() .addFieldQuotedString("title", gd->groupTitle()) .closeHash(); - output.closeList(); + m_output.closeList(); } MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict); @@ -1802,13 +1935,13 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &outp generatePerlModSection(gd,&gd->decFuncMembers,"functions"); generatePerlModSection(gd,&gd->decVarMembers,"variables"); - addPerlModDocBlock(output,"brief",gd->getDefFileName(),gd->getDefLine(),0,0,gd->briefDescription()); - addPerlModDocBlock(output,"detailed",gd->getDefFileName(),gd->getDefLine(),0,0,gd->documentation()); + addPerlModDocBlock(m_output,"brief",gd->getDefFileName(),gd->getDefLine(),0,0,gd->briefDescription()); + addPerlModDocBlock(m_output,"detailed",gd->getDefFileName(),gd->getDefLine(),0,0,gd->documentation()); - output.closeHash(); + m_output.closeHash(); } -void PerlModGenerator::generatePerlModForPage(PageInfo *pi, PerlModOutput &output) +void PerlModGenerator::generatePerlModForPage(PageInfo *pi) { // + name // + title @@ -1816,14 +1949,15 @@ void PerlModGenerator::generatePerlModForPage(PageInfo *pi, PerlModOutput &outpu if (pi->isReference()) return; - output.openHash() + m_output.openHash() .addFieldQuotedString("name", pi->name); SectionInfo *si = Doxygen::sectionDict.find(pi->name); if (si) - output.addFieldQuotedString("title", si->title); + m_output.addFieldQuotedString("title", si->title); - addPerlModDocBlock(output,"detailed",pi->defFileName,pi->defLine,0,0,pi->doc); + addPerlModDocBlock(m_output,"detailed",pi->defFileName,pi->defLine,0,0,pi->doc); + m_output.closeHash(); } bool PerlModGenerator::generatePerlModOutput() @@ -1834,24 +1968,24 @@ bool PerlModGenerator::generatePerlModOutput() QTextStream outputTextStream(&outputFile); PerlModOutputStream outputStream(&outputTextStream); - output.setPerlModOutputStream(&outputStream); - output.add("$doxydocs =\n").openHash(); + m_output.setPerlModOutputStream(&outputStream); + m_output.add("$doxydocs=").openHash(); - output.openList("classes"); + m_output.openList("classes"); ClassSDict::Iterator cli(Doxygen::classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) - generatePerlModForClass(cd,output); - output.closeList(); + generatePerlModForClass(cd); + m_output.closeList(); - output.openList("namespaces"); + m_output.openList("namespaces"); NamespaceSDict::Iterator nli(Doxygen::namespaceSDict); NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) - generatePerlModForNamespace(nd,output); - output.closeList(); + generatePerlModForNamespace(nd); + m_output.closeList(); - output.openList("files"); + m_output.openList("files"); FileNameListIterator fnli(Doxygen::inputNameList); FileName *fn; for (;(fn=fnli.current());++fnli) @@ -1859,27 +1993,27 @@ bool PerlModGenerator::generatePerlModOutput() FileNameIterator fni(*fn); FileDef *fd; for (;(fd=fni.current());++fni) - generatePerlModForFile(fd,output); + generatePerlModForFile(fd); } - output.closeList(); + m_output.closeList(); - output.openList("groups"); + m_output.openList("groups"); GroupSDict::Iterator gli(Doxygen::groupSDict); GroupDef *gd; for (;(gd=gli.current());++gli) - generatePerlModForGroup(gd,output); - output.closeList(); + generatePerlModForGroup(gd); + m_output.closeList(); - output.openList("pages"); + m_output.openList("pages"); PageSDict::Iterator pdi(*Doxygen::pageSDict); PageInfo *pi=0; for (pdi.toFirst();(pi=pdi.current());++pdi) - generatePerlModForPage(pi,output); + generatePerlModForPage(pi); if (Doxygen::mainPage) - generatePerlModForPage(Doxygen::mainPage,output); - output.closeList(); + generatePerlModForPage(Doxygen::mainPage); + m_output.closeList(); - output.closeHash().add(";\n1;\n"); + m_output.closeHash().add(";\n1;\n"); return true; } @@ -1943,10 +2077,10 @@ bool PerlModGenerator::createOutputDir(QDir &perlModDir) return true; } -bool PerlModGenerator::generateDoxyModelPM() +bool PerlModGenerator::generateDoxyStructurePM() { QFile doxyModelPM; - if (!createOutputFile(doxyModelPM, pathDoxyModelPM)) + if (!createOutputFile(doxyModelPM, pathDoxyStructurePM)) return false; QTextStream doxyModelPMStream(&doxyModelPM); @@ -2006,7 +2140,7 @@ bool PerlModGenerator::generateDoxyModelPM() "\t];\n" "}\n" "\n" - "$doxymodel =\n" + "$doxystructure =\n" " [ \"hash\", \"Root\",\n" " {\n" "\tfiles =>\n" @@ -2026,6 +2160,20 @@ bool PerlModGenerator::generateDoxyModelPM() "\t },\n" "\t ],\n" "\t ],\n" + "\tpages =>\n" + "\t [ \"list\", \"Pages\",\n" + "\t [ \"hash\", \"Page\",\n" + "\t {\n" + "\t\tname => [ \"string\", \"PageName\" ],\n" + "\t\tdetailed =>\n" + "\t\t [ \"hash\", \"PageDetailed\",\n" + "\t\t {\n" + "\t\t doc => [ \"doc\", \"PageDetailedDoc\" ],\n" + "\t\t },\n" + "\t\t ],\n" + "\t },\n" + "\t ],\n" + "\t ],\n" "\tclasses =>\n" "\t [ \"list\", \"Classes\",\n" "\t [ \"hash\", \"Class\",\n" @@ -2064,67 +2212,90 @@ bool PerlModGenerator::generateDoxyRules() return false; bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); + QString prefix = Config_getString("PERLMOD_MAKEVAR_PREFIX"); QTextStream doxyRulesStream(&doxyRules); doxyRulesStream << - "DOXYEXECPATH = " << pathDoxyExec << "\n" - "DOXYFILE = " << pathDoxyfile << "\n" - "DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" - "DOXYMODEL_PM = " << pathDoxyModelPM << "\n" - "DOXYRULES = " << pathDoxyRules << "\n"; + prefix << "DOXY_EXEC_PATH = " << pathDoxyExec << "\n" << + prefix << "DOXYFILE = " << pathDoxyfile << "\n" << + prefix << "DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" << + prefix << "DOXYSTRUCTURE_PM = " << pathDoxyStructurePM << "\n" << + prefix << "DOXYRULES = " << pathDoxyRules << "\n"; if (perlmodLatex) doxyRulesStream << - "DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" - "DOXYLATEXTEMPLATE_PL = " << pathDoxyLatexTemplatePL << "\n" - "DOXYTEMPLATE_TEX = " << pathDoxyTemplateTex << "\n" - "DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" - "DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" - "DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" - "DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" - "DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n"; + prefix << "DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" << + prefix << "DOXYLATEXSTRUCTURE_PL = " << pathDoxyLatexStructurePL << "\n" << + prefix << "DOXYSTRUCTURE_TEX = " << pathDoxyStructureTex << "\n" << + prefix << "DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" << + prefix << "DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" << + prefix << "DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" << + prefix << "DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" << + prefix << "DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n"; doxyRulesStream << "\n" ".PHONY: clean-perlmod\n" - "clean-perlmod:\n" - "\trm -f $(DOXYMODEL_PM) $(DOXYDOCS_PM)"; + "clean-perlmod::\n" + "\trm -f $(" << prefix << "DOXYSTRUCTURE_PM) \\\n" + "\t$(" << prefix << "DOXYDOCS_PM)"; if (perlmodLatex) doxyRulesStream << " \\\n" - "\t$(DOXYLATEX_PL) $(DOXYLATEXTEMPLATE_PL) \\\n" - "\t$(DOXYDOCS_TEX) $(DOXYTEMPLATE_TEX) \\\n" - "\t$(DOXYFORMAT_TEX) $(DOXYLATEX_TEX) \\\n" - "\t$(DOXYLATEX_PDF) $(DOXYLATEX_DVI) \\\n" - "\t$(addprefix $(DOXYLATEX_TEX:tex=),out aux log)"; + "\t$(" << prefix << "DOXYLATEX_PL) \\\n" + "\t$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n" + "\t$(" << prefix << "DOXYDOCS_TEX) \\\n" + "\t$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n" + "\t$(" << prefix << "DOXYFORMAT_TEX) \\\n" + "\t$(" << prefix << "DOXYLATEX_TEX) \\\n" + "\t$(" << prefix << "DOXYLATEX_PDF) \\\n" + "\t$(" << prefix << "DOXYLATEX_DVI) \\\n" + "\t$(addprefix $(" << prefix << "DOXYLATEX_TEX:tex=),out aux log)"; doxyRulesStream << "\n\n"; doxyRulesStream << - "$(DOXYRULES) $(DOXYMAKEFILE) $(DOXYMODEL_PM) $(DOXYDOCS_PM)"; + "$(" << prefix << "DOXYRULES) \\\n" + "$(" << prefix << "DOXYMAKEFILE) \\\n" + "$(" << prefix << "DOXYSTRUCTURE_PM) \\\n" + "$(" << prefix << "DOXYDOCS_PM)"; if (perlmodLatex) { doxyRulesStream << " \\\n" - "$(DOXYLATEX_PL) $(DOXYLATEXTEMPLATE_PL) \\\n" - "$(DOXYFORMAT_TEX) $(DOXYLATEX_TEX)"; + "$(" << prefix << "DOXYLATEX_PL) \\\n" + "$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n" + "$(" << prefix << "DOXYFORMAT_TEX) \\\n" + "$(" << prefix << "DOXYLATEX_TEX)"; } doxyRulesStream << - ": $(DOXYFILE)\n" - "\tcd $(DOXYEXECPATH) ; doxygen \"$<\"\n"; + ": \\\n" + "\t$(" << prefix << "DOXYFILE)\n" + "\tcd $(" << prefix << "DOXY_EXEC_PATH) ; doxygen \"$<\"\n"; if (perlmodLatex) { doxyRulesStream << "\n" - "$(DOXYDOCS_TEX): $(DOXYLATEX_PL) $(DOXYDOCS_PM)\n" + "$(" << prefix << "DOXYDOCS_TEX): \\\n" + "$(" << prefix << "DOXYLATEX_PL) \\\n" + "$(" << prefix << "DOXYDOCS_PM)\n" "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" "\n" - "$(DOXYTEMPLATE_TEX): $(DOXYLATEXTEMPLATE_PL) $(DOXYMODEL_PM)\n" + "$(" << prefix << "DOXYSTRUCTURE_TEX): \\\n" + "$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n" + "$(" << prefix << "DOXYSTRUCTURE_PM)\n" "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" "\n" - "$(DOXYLATEX_PDF) $(DOXYLATEX_DVI): $(DOXYLATEX_TEX) $(DOXYFORMAT_TEX) $(DOXYTEMPLATE_TEX) $(DOXYDOCS_TEX)\n" + "$(" << prefix << "DOXYLATEX_PDF) \\\n" + "$(" << prefix << "DOXYLATEX_DVI): \\\n" + "$(" << prefix << "DOXYLATEX_TEX) \\\n" + "$(" << prefix << "DOXYFORMAT_TEX) \\\n" + "$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n" + "$(" << prefix << "DOXYDOCS_TEX)\n" "\n" - "$(DOXYLATEX_PDF): $(DOXYLATEX_TEX)\n" + "$(" << prefix << "DOXYLATEX_PDF): \\\n" + "$(" << prefix << "DOXYLATEX_TEX)\n" "\tpdflatex -interaction=nonstopmode \"$<\"\n" "\n" - "$(DOXYLATEX_DVI): $(DOXYLATEX_TEX)\n" + "$(" << prefix << "DOXYLATEX_DVI): \\\n" + "$(" << prefix << "DOXYLATEX_TEX)\n" "\tlatex -interaction=nonstopmode \"$<\"\n"; } @@ -2138,6 +2309,7 @@ bool PerlModGenerator::generateMakefile() return false; bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); + QString prefix = Config_getString("PERLMOD_MAKEVAR_PREFIX"); QTextStream makefileStream(&makefile); makefileStream << @@ -2150,47 +2322,43 @@ bool PerlModGenerator::generateMakefile() if (perlmodLatex) { makefileStream << - "pdf: $(DOXYLATEX_PDF)\n" - "dvi: $(DOXYLATEX_DVI)\n"; + "pdf: $(" << prefix << "DOXYLATEX_PDF)\n" + "dvi: $(" << prefix << "DOXYLATEX_DVI)\n"; } return true; } -bool PerlModGenerator::generateDoxyLatexTemplatePL() +bool PerlModGenerator::generateDoxyLatexStructurePL() { - QFile doxyLatexTemplatePL; - if (!createOutputFile(doxyLatexTemplatePL, pathDoxyLatexTemplatePL)) + QFile doxyLatexStructurePL; + if (!createOutputFile(doxyLatexStructurePL, pathDoxyLatexStructurePL)) return false; - QTextStream doxyLatexTemplatePLStream(&doxyLatexTemplatePL); - doxyLatexTemplatePLStream << - "use DoxyModel;\n" + QTextStream doxyLatexStructurePLStream(&doxyLatexStructurePL); + doxyLatexStructurePLStream << + "use DoxyStructure;\n" "\n" - "sub template($) {\n" - "\tmy $model = $_[0];\n" - "\tmy ($type, $name) = @$model[0, 1];\n" - "\tif ($type eq \"string\") {\n" - "\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" - "\t} elsif ($type eq \"doc\") {\n" - "\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" - "\t} elsif ($type eq \"hash\") {\n" - "\t\tmy ($key, $value);\n" - "\t\twhile (($key, $submodel) = each %{$$model[2]}) {\n" - "\t\t\tmy $subname = $$submodel[1];\n" - "\t\t\tprint \"\\\\def\\\\\" . $subname . \"Empty{}%\\n\";\n" - "\t\t\tprint \"\\\\def\\\\field\" . $subname . \"Empty{\\\\\" . $subname . \"Empty}%\\n\";\n" - "\t\t\ttemplate($submodel);\n" + "sub process($) {\n" + "\tmy $node = $_[0];\n" + "\tmy ($type, $name) = @$node[0, 1];\n" + "\tmy $command;\n" + "\tif ($type eq \"string\") { $command = \"String\" }\n" + "\telsif ($type eq \"doc\") { $command = \"Doc\" }\n" + "\telsif ($type eq \"hash\") {\n" + "\t\t$command = \"Hash\";\n" + "\t\tfor my $subnode (values %{$$node[2]}) {\n" + "\t\t\tprocess($subnode);\n" "\t\t}\n" - "\t\tprint \"\\\\def\\\\\" . $name . \"{}%\\n\";\n" - "\t} elsif ($type eq \"list\") {\n" - "\t\ttemplate($$model[2]);\n" - "\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" - "\t\tprint \"\\\\def\\\\\" . $name . \"Sep{}%\\n\";\n" "\t}\n" + "\telsif ($type eq \"list\") {\n" + "\t\t$command = \"List\";\n" + "\t\tprocess($$node[2]);\n" + "\t}\n" + "\tprint \"\\\\\" . $command . \"Node{\" . $name . \"}%\\n\";\n" "}\n" "\n" - "template($doxymodel);\n"; + "process($doxystructure);\n"; return true; } @@ -2203,16 +2371,17 @@ bool PerlModGenerator::generateDoxyLatexPL() QTextStream doxyLatexPLStream(&doxyLatexPL); doxyLatexPLStream << - "use DoxyModel;\n" + "use DoxyStructure;\n" "use DoxyDocs;\n" "\n" "sub latex_quote($) {\n" "\tmy $text = $_[0];\n" "\t$text =~ s/\\\\/\\\\textbackslash /g;\n" + "\t$text =~ s/\\|/\\\\textbar /g;\n" + "\t$text =~ s/</\\\\textless /g;\n" + "\t$text =~ s/>/\\\\textgreater /g;\n" "\t$text =~ s/~/\\\\textasciitilde /g;\n" - "\t$text =~ s/</\\\\textasciiless /g;\n" - "\t$text =~ s/>/\\\\textasciigreater /g;\n" - "\t$text =~ s/\\\\^/\\\\textasciicircum /g;\n" + "\t$text =~ s/\\^/\\\\textasciicircum /g;\n" "\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n" "\tprint $text;\n" "}\n" @@ -2223,17 +2392,43 @@ bool PerlModGenerator::generateDoxyLatexPL() "\t\tmy $type = $$item{type};\n" "\t\tif ($type eq \"text\") {\n" "\t\t\tlatex_quote($$item{content});\n" - "\t\t} elsif ($type eq \"para\") {\n" - "\t\t\tgenerate_doc($$item{content});\n" - "#\t\t\tprint \"\\\\par\\n\";\n" - "\t\t} elsif ($type eq \"bold\") {\n" - "\t\t\tprint \"\\\\textbf{\";\n" - "\t\t\tgenerate_doc($$item{content});\n" - "\t\t\tprint \"}\";\n" - "\t\t} elsif ($type eq \"emphasis\") {\n" - "\t\t\tprint \"\\\\textit{\";\n" - "\t\t\tgenerate_doc($$item{content});\n" - "\t\t\tprint \"}\";\n" + "\t\t} elsif ($type eq \"parbreak\") {\n" + "\t\t\tprint \"\\n\\n\";\n" + "\t\t} elsif ($type eq \"style\") {\n" + "\t\t\tmy $style = $$item{style};\n" + "\t\t\tif ($$item{enable} eq \"yes\") {\n" + "\t\t\t\tif ($style eq \"bold\") { print '\\bfseries'; }\n" + "\t\t\t\tif ($style eq \"italic\") { print '\\itshape'; }\n" + "\t\t\t\tif ($style eq \"code\") { print '\\ttfamily'; }\n" + "\t\t\t} else {\n" + "\t\t\t\tif ($style eq \"bold\") { print '\\mdseries'; }\n" + "\t\t\t\tif ($style eq \"italic\") { print '\\upshape'; }\n" + "\t\t\t\tif ($style eq \"code\") { print '\\rmfamily'; }\n" + "\t\t\t}\n" + "\t\t\tprint '{}';\n" + "\t\t} elsif ($type eq \"symbol\") {\n" + "\t\t\tmy $symbol = $$item{symbol};\n" + "\t\t\tif ($symbol eq \"copyright\") { print '\\copyright'; }\n" + "\t\t\telsif ($symbol eq \"szlig\") { print '\\ss'; }\n" + "\t\t\tprint '{}';\n" + "\t\t} elsif ($type eq \"accent\") {\n" + "\t\t\tmy ($accent) = $$item{accent};\n" + "\t\t\tif ($accent eq \"umlaut\") { print '\\\"'; }\n" + "\t\t\telsif ($accent eq \"acute\") { print '\\\\\\''; }\n" + "\t\t\telsif ($accent eq \"grave\") { print '\\`'; }\n" + "\t\t\telsif ($accent eq \"circ\") { print '\\^'; }\n" + "\t\t\telsif ($accent eq \"tilde\") { print '\\~'; }\n" + "\t\t\telsif ($accent eq \"cedilla\") { print '\\c'; }\n" + "\t\t\telsif ($accent eq \"ring\") { print '\\r'; }\n" + "\t\t\tprint \"{\" . $$item{letter} . \"}\"; \n" + "\t\t} elsif ($type eq \"list\") {\n" + "\t\t\tmy $env = ($$item{style} eq \"ordered\") ? \"enumerate\" : \"itemize\";\n" + "\t\t\tprint \"\\n\\\\begin{\" . $env .\"}\";\n" + "\t\t \tfor my $subitem (@{$$item{content}}) {\n" + "\t\t\t\tprint \"\\n\\\\item \";\n" + "\t\t\t\tgenerate_doc($subitem);\n" + "\t\t \t}\n" + "\t\t\tprint \"\\n\\\\end{\" . $env .\"}\";\n" "\t\t} elsif ($type eq \"url\") {\n" "\t\t\tlatex_quote($$item{content});\n" "\t\t}\n" @@ -2241,8 +2436,8 @@ bool PerlModGenerator::generateDoxyLatexPL() "}\n" "\n" "sub generate($$) {\n" - "\tmy ($item, $model) = @_;\n" - "\tmy ($type, $name) = @$model[0, 1];\n" + "\tmy ($item, $node) = @_;\n" + "\tmy ($type, $name) = @$node[0, 1];\n" "\tif ($type eq \"string\") {\n" "\t\tprint \"\\\\\" . $name . \"{\";\n" "\t\tlatex_quote($item);\n" @@ -2253,17 +2448,17 @@ bool PerlModGenerator::generateDoxyLatexPL() "\t\t\tgenerate_doc($item);\n" "\t\t\tprint \"}%\\n\";\n" "\t\t} else {\n" - "\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" + "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" "\t\t}\n" "\t} elsif ($type eq \"hash\") {\n" "\t\tmy ($key, $value);\n" - "\t\twhile (($key, $submodel) = each %{$$model[2]}) {\n" - "\t\t\tmy $subname = $$submodel[1];\n" - "\t\t\tprint \"\\\\def\\\\field\" . $subname . \"{\";\n" + "\t\twhile (($key, $subnode) = each %{$$node[2]}) {\n" + "\t\t\tmy $subname = $$subnode[1];\n" + "\t\t\tprint \"\\\\Defcs{field\" . $subname . \"}{\";\n" "\t\t\tif ($$item{$key}) {\n" - "\t\t\t\tgenerate($$item{$key}, $submodel);\n" + "\t\t\t\tgenerate($$item{$key}, $subnode);\n" "\t\t\t} else {\n" - "\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n" + "#\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n" "\t\t\t}\n" "\t\t\tprint \"}%\\n\";\n" "\t\t}\n" @@ -2276,17 +2471,17 @@ bool PerlModGenerator::generateDoxyLatexPL() "\t\t\t\tif ($index) {\n" "\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n" "\t\t\t\t}\n" - "\t\t\t\tgenerate($subitem, $$model[2]);\n" + "\t\t\t\tgenerate($subitem, $$node[2]);\n" "\t\t\t\t$index++;\n" "\t\t\t}\n" "\t\t\tprint \"}%\\n\";\n" "\t\t} else {\n" - "\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" + "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" "\t\t}\n" "\t}\n" "}\n" "\n" - "generate($doxydocs, $doxymodel);\n"; + "generate($doxydocs, $doxystructure);\n"; return true; } @@ -2299,51 +2494,56 @@ bool PerlModGenerator::generateDoxyFormatTex() QTextStream doxyFormatTexStream(&doxyFormatTex); doxyFormatTexStream << - "\\input{" << pathDoxyTemplateTex << "}\n" + "\\def\\Defcs#1{\\long\\expandafter\\def\\csname#1\\endcsname}\n" + "\\Defcs{Empty}{}\n" + "\\def\\IfEmpty#1{\\expandafter\\ifx\\csname#1\\endcsname\\Empty}\n" + "\n" + "\\def\\StringNode#1{\\Defcs{#1}##1{##1}}\n" + "\\def\\DocNode#1{\\Defcs{#1}##1{##1}}\n" + "\\def\\ListNode#1{\\Defcs{#1}##1{##1}\\Defcs{#1Sep}{}}\n" + "\\def\\HashNode#1{\\Defcs{#1}{}}\n" + "\n" + "\\input{" << pathDoxyStructureTex << "}\n" "\n" "\\newbox\\BoxA\n" "\\dimendef\\DimenA=151\\relax\n" "\\dimendef\\DimenB=152\\relax\n" "\\countdef\\ZoneDepth=151\\relax\n" "\n" - "\\def\\Ifxcscs#1#2{%\n" - "\\expandafter\\let\\expandafter\\Ifxcscsa\\csname#1\\endcsname%\n" - "\\expandafter\\let\\expandafter\\Ifxcscsb\\csname#2\\endcsname%\n" - "\\ifx\\Ifxcscsa\\Ifxcscsb}%\n" + "\\def\\Cs#1{\\csname#1\\endcsname}\n" + "\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}\n" + "\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}\n" + "\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}\n" "\n" - "\\def\\Cs#1{\\csname#1\\endcsname}%\n" - "\\def\\Defcs#1{\\expandafter\\def\\csname#1\\endcsname}%\n" - "\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}%\n" - "\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}%\n" - "\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}%\n" - "\n" - "\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax%\n" - "\\raggedright#1\\vskip 0.5mm\\relax} }}%\n" + "\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax\n" + "\\raggedright#1\\vskip 0.5mm\\relax} }}\n" "\n" "\\def\\Zone#1#2#3{%\n" - "\\Defcs{#1}{\n" - "\\advance\\ZoneDepth1\\relax%\n" - "\\Letcs{Mode\\number\\ZoneDepth}0%\n" - "\\Letcs{Present\\number\\ZoneDepth}0%\n" - "#2%\n" + "\\Defcs{Test#1}{#2}%\n" + "\\Defcs{Emit#1}{#3}%\n" + "\\Defcs{#1}{%\n" + "\\advance\\ZoneDepth1\\relax\n" + "\\Letcs{Mode\\number\\ZoneDepth}0\\relax\n" + "\\Letcs{Present\\number\\ZoneDepth}0\\relax\n" + "\\Cs{Test#1}\n" "\\expandafter\\if\\Cs{Present\\number\\ZoneDepth}1%\n" - "\\advance\\ZoneDepth-1\\relax%\n" - "\\Letcs{Present\\number\\ZoneDepth}1%\n" + "\\advance\\ZoneDepth-1\\relax\n" + "\\Letcs{Present\\number\\ZoneDepth}1\\relax\n" "\\expandafter\\if\\Cs{Mode\\number\\ZoneDepth}1%\n" - "\\advance\\ZoneDepth1\\relax%\n" - "\\Letcs{Mode\\number\\ZoneDepth}1%\n" - "#3%\n" - "\\advance\\ZoneDepth-1\\relax\\fi%\n" - "\\advance\\ZoneDepth1\\relax\\fi%\n" - "\\advance\\ZoneDepth-1\\relax}}%\n" + "\\advance\\ZoneDepth1\\relax\n" + "\\Letcs{Mode\\number\\ZoneDepth}1\\relax\n" + "\\Cs{Emit#1}\n" + "\\advance\\ZoneDepth-1\\relax\\fi\n" + "\\advance\\ZoneDepth1\\relax\\fi\n" + "\\advance\\ZoneDepth-1\\relax}}\n" "\n" "\\def\\Member#1#2{%\n" - "\\Defcs{Test#1}{\\Cs{field#1Detailed}%\n" - "\\Ifxcscs{field#1DetailedDoc}{field#1DetailedDocEmpty}\\else\\Letcs{Present#1}1\\fi}\n" - "\\Defcs{#1}{\\Letcs{Present#1}0%\n" - "\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1%\n" - "\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}%\n" - "%\n" + "\\Defcs{Test#1}{\\Cs{field#1Detailed}\n" + "\\IfEmpty{field#1DetailedDoc}\\else\\Letcs{Present#1}1\\fi}\n" + "\\Defcs{#1}{\\Letcs{Present#1}0\\relax\n" + "\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1\\relax\n" + "\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}\n" + "\n" "\\def\\TypedefMemberList#1#2{%\n" "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n" "\\Defcs{#1Name}##1{\\textbf{##1}}%\n" @@ -2369,40 +2569,48 @@ bool PerlModGenerator::generateDoxyFormatTex() "\\Defcs{#1PDBlocksSep}{\\vskip 2mm\\relax}%\n" "%\n" "\\Defcs{#1PDBlocks}##1{%\n" - "\\Heading{Parameters:}\\vskip 1.5mm\\relax%\n" - "\\DimenA0pt\\relax%\n" + "\\Heading{Parameters:}\\vskip 1.5mm\\relax\n" + "\\DimenA0pt\\relax\n" "\\Defcs{#1PDBlock}{\\setbox\\BoxA\\hbox{\\Cs{field#1PDParams}}%\n" "\\ifdim\\DimenA<\\wd\\BoxA\\DimenA\\wd\\BoxA\\fi}%\n" "##1%\n" "\\advance\\DimenA3mm\\relax\n" - "\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax%\n" - "\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax%\n" - "\\Cs{field#1PDParams}}\\hfill%\n" + "\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax\n" + "\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax\n" + "\\Cs{field#1PDParams}}\\hfill\n" "\\vtop{\\hsize\\DimenB\\relax\\Cs{field#1PDDoc}}}}%\n" - "##1}%\n" - "%\n" - "\\Defcs{#1ParamName}##1{\\textit{##1}}%\n" - "\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}%\n" - "\\Defcs{#1ParamsSep}{, }%\n" - "%\n" - "\\Defcs{#1Name}##1{\\textbf{##1}}%\n" - "\\Defcs{#1See}##1{\\See{##1}}%\n" - "\\Defcs{#1Return}##1{\\Heading{Returns: }##1}%\n" + "##1}\n" + "\n" + "\\Defcs{#1ParamName}##1{\\textit{##1}}\n" + "\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}\n" + "\\Defcs{#1ParamsSep}{, }\n" + "\n" + "\\Defcs{#1Name}##1{\\textbf{##1}}\n" + "\\Defcs{#1See}##1{\\See{##1}}\n" + "\\Defcs{#1Return}##1{\\Heading{Returns: }##1}\n" "\\Defcs{field#1Title}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}(\\Cs{field#1Params})}}%\n" "%\n" "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" - "\\Member{#1}{\n" - "\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}%\n" + "\\Member{#1}{%\n" + "\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}\n" "\\Cs{field#1Return}\\Cs{field#1PDBlocks}\\Cs{field#1See}\\vskip 5mm\\relax}}\n" "\n" - "\\TypedefMemberList{FileTypedef}{Typedefs}%\n" - "\\VariableMemberList{FileVariable}{Variables}%\n" - "\\FunctionMemberList{FileFunction}{Functions}%\n" + "\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}\n" + "\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}\n" + "\n" + "\\def\\FileSubzones{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}\n" "\n" - "\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}%\n" + "\\def\\ClassSubzones{%\n" + "\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods\n" + "\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods\n" + "\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}\n" "\n" - "\\def\\TestFile{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}%\n" - "\\Zone{File}{\\TestFile}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\TestFile}%\n" + "\\Member{Page}{\\subsection{\\fieldPageName}\\fieldPageDetailedDoc}\n" + "\n" + "\\TypedefMemberList{FileTypedef}{Typedefs}\n" + "\\VariableMemberList{FileVariable}{Variables}\n" + "\\FunctionMemberList{FileFunction}{Functions}\n" + "\\Zone{File}{\\FileSubzones}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\FileSubzones}\n" "\n" "\\TypedefMemberList{ClassPublicTypedef}{Public Typedefs}\n" "\\TypedefMemberList{ClassProtectedTypedef}{Protected Typedefs}\n" @@ -2413,36 +2621,29 @@ bool PerlModGenerator::generateDoxyFormatTex() "\\FunctionMemberList{ClassPublicMethod}{Public Methods}\n" "\\FunctionMemberList{ClassProtectedMethod}{Protected Methods}\n" "\\FunctionMemberList{ClassPrivateMethod}{Private Methods}\n" + "\\Zone{Class}{\\ClassSubzones}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\ClassSubzones}\n" "\n" - "\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}%\n" - "\n" - "\\def\\TestClass{%\n" - "\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods%\n" - "\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods%\n" - "\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}%\n" - "\n" - "\\Zone{Class}{\\TestClass}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\TestClass}%\n" - "\n" - "\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}%\n" - "\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}%\n" + "\\Zone{AllPages}{\\fieldPages}{\\section{Pages}\\fieldPages}\n" + "\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}\n" + "\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}\n" "\n" - "\\newlength{\\oldparskip}%\n" - "\\newlength{\\oldparindent}%\n" - "\\newlength{\\oldfboxrule}%\n" + "\\newlength{\\oldparskip}\n" + "\\newlength{\\oldparindent}\n" + "\\newlength{\\oldfboxrule}\n" "\n" - "\\ZoneDepth0%\n" - "\\Letcs{Mode0}1%\n" + "\\ZoneDepth0\\relax\n" + "\\Letcs{Mode0}1\\relax\n" "\n" "\\def\\EmitDoxyDocs{%\n" - "\\setlength{\\oldparskip}{\\parskip}%\n" - "\\setlength{\\oldparindent}{\\parindent}%\n" - "\\setlength{\\oldfboxrule}{\\fboxrule}%\n" - "\\setlength{\\parskip}{0cm}%\n" - "\\setlength{\\parindent}{0cm}%\n" - "\\setlength{\\fboxrule}{1pt}%\n" - "\\AllFiles\\AllClasses%\n" - "\\setlength{\\parskip}{\\oldparskip}%\n" - "\\setlength{\\parindent}{\\oldparindent}%\n" + "\\setlength{\\oldparskip}{\\parskip}\n" + "\\setlength{\\oldparindent}{\\parindent}\n" + "\\setlength{\\oldfboxrule}{\\fboxrule}\n" + "\\setlength{\\parskip}{0cm}\n" + "\\setlength{\\parindent}{0cm}\n" + "\\setlength{\\fboxrule}{1pt}\n" + "\\AllPages\\AllFiles\\AllClasses\n" + "\\setlength{\\parskip}{\\oldparskip}\n" + "\\setlength{\\parindent}{\\oldparindent}\n" "\\setlength{\\fboxrule}{\\oldfboxrule}}\n"; return true; @@ -2467,6 +2668,7 @@ bool PerlModGenerator::generateDoxyLatexTex() "\n" "\\begin{document}\n" "\\input{" << pathDoxyDocsTex << "}\n" + "\\sloppy\n" "\\EmitDoxyDocs\n" "\\end{document}\n"; @@ -2490,29 +2692,29 @@ void PerlModGenerator::generate() bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); pathDoxyDocsPM = perlModDir.absPath() + "/DoxyDocs.pm"; - pathDoxyModelPM = perlModDir.absPath() + "/DoxyModel.pm"; + pathDoxyStructurePM = perlModDir.absPath() + "/DoxyStructure.pm"; pathMakefile = perlModDir.absPath() + "/Makefile"; pathDoxyRules = perlModDir.absPath() + "/doxyrules.make"; if (perlmodLatex) { - pathDoxyTemplateTex = perlModDir.absPath() + "/doxytemplate.tex"; + pathDoxyStructureTex = perlModDir.absPath() + "/doxystructure.tex"; pathDoxyFormatTex = perlModDir.absPath() + "/doxyformat.tex"; pathDoxyLatexTex = perlModDir.absPath() + "/doxylatex.tex"; pathDoxyLatexDVI = perlModDir.absPath() + "/doxylatex.dvi"; pathDoxyLatexPDF = perlModDir.absPath() + "/doxylatex.pdf"; pathDoxyDocsTex = perlModDir.absPath() + "/doxydocs.tex"; pathDoxyLatexPL = perlModDir.absPath() + "/doxylatex.pl"; - pathDoxyLatexTemplatePL = perlModDir.absPath() + "/doxylatex-template.pl"; + pathDoxyLatexStructurePL = perlModDir.absPath() + "/doxylatex-structure.pl"; } if (!(generatePerlModOutput() - && generateDoxyModelPM() + && generateDoxyStructurePM() && generateMakefile() && generateDoxyRules())) return; if (perlmodLatex) { - if (!(generateDoxyLatexTemplatePL() + if (!(generateDoxyLatexStructurePL() && generateDoxyLatexPL() && generateDoxyLatexTex() && generateDoxyFormatTex())) @@ -2522,7 +2724,7 @@ void PerlModGenerator::generate() void generatePerlMod() { - PerlModGenerator pmg; + PerlModGenerator pmg(Config_getBool("PERLMOD_PRETTY")); pmg.generate(); } diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index 7d7c102..de53e8a 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -121,6 +121,9 @@ class PrintDocVisitor : public DocVisitor case DocStyleChange::Small: if (s->enable()) printf("<small>"); else printf("</small>"); break; + case DocStyleChange::Preformatted: + if (s->enable()) printf("<pre>"); else printf("</pre>"); + break; } } void visit(DocVerbatim *s) @@ -330,18 +333,18 @@ class PrintDocVisitor : public DocVisitor indent_post(); printf("</li>\n"); } - void visitPre(DocHtmlPre *) - { - indent_pre(); - printf("<pre>\n"); - m_insidePre=TRUE; - } - void visitPost(DocHtmlPre *) - { - m_insidePre=FALSE; - indent_post(); - printf("</pre>\n"); - } + //void visitPre(DocHtmlPre *) + //{ + // indent_pre(); + // printf("<pre>\n"); + // m_insidePre=TRUE; + //} + //void visitPost(DocHtmlPre *) + //{ + // m_insidePre=FALSE; + // indent_post(); + // printf("</pre>\n"); + //} void visitPre(DocHtmlDescList *) { indent_pre(); diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index bf2731a..a11e857 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -28,7 +28,7 @@ #include "message.h" RTFDocVisitor::RTFDocVisitor(QTextStream &t,BaseCodeDocInterface &ci) - : m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_indentLevel(0) + : m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_indentLevel(1) { } @@ -48,7 +48,7 @@ void RTFDocVisitor::incIndentLevel() void RTFDocVisitor::decIndentLevel() { - if (m_indentLevel>0) m_indentLevel--; + if (m_indentLevel>1) m_indentLevel--; } //-------------------------------------- @@ -259,6 +259,21 @@ void RTFDocVisitor::visit(DocStyleChange *s) case DocStyleChange::Small: if (s->enable()) m_t << "{\\sub "; else m_t << "} "; break; + case DocStyleChange::Preformatted: + if (s->enable()) + { + m_t << "{" << endl; + m_t << "\\par" << endl; + m_t << rtf_Style_Reset << getStyle("CodeExample"); + m_insidePre=TRUE; + } + else + { + m_insidePre=FALSE; + m_t << "\\par" << endl; + m_t << "}" << endl; + } + break; } } @@ -585,20 +600,20 @@ void RTFDocVisitor::visitPost(DocHtmlListItem *) { } -void RTFDocVisitor::visitPre(DocHtmlPre *) -{ - m_t << "{" << endl; - m_t << "\\par" << endl; - m_t << rtf_Style_Reset << getStyle("CodeExample"); - m_insidePre=TRUE; -} +//void RTFDocVisitor::visitPre(DocHtmlPre *) +//{ +// m_t << "{" << endl; +// m_t << "\\par" << endl; +// m_t << rtf_Style_Reset << getStyle("CodeExample"); +// m_insidePre=TRUE; +//} -void RTFDocVisitor::visitPost(DocHtmlPre *) -{ - m_insidePre=FALSE; - m_t << "\\par" << endl; - m_t << "}" << endl; -} +//void RTFDocVisitor::visitPost(DocHtmlPre *) +//{ +// m_insidePre=FALSE; +// m_t << "\\par" << endl; +// m_t << "}" << endl; +//} void RTFDocVisitor::visitPre(DocHtmlDescList *) { @@ -875,8 +890,8 @@ void RTFDocVisitor::visitPost(DocLanguage *) void RTFDocVisitor::visitPre(DocParamSect *s) { m_t << "{"; // start param list - m_t << "{\\b "; // start bold m_t << "\\par" << endl; + m_t << "{\\b "; // start bold switch(s->type()) { case DocParamSect::Param: @@ -896,7 +911,7 @@ void RTFDocVisitor::visitPre(DocParamSect *s) void RTFDocVisitor::visitPost(DocParamSect *) { - m_t << "\\par" << endl; + //m_t << "\\par" << endl; decIndentLevel(); m_t << "}" << endl; } diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h index 119eff9..40487d1 100644 --- a/src/rtfdocvisitor.h +++ b/src/rtfdocvisitor.h @@ -76,8 +76,8 @@ class RTFDocVisitor : public DocVisitor void visitPost(DocHtmlList *s); void visitPre(DocHtmlListItem *); void visitPost(DocHtmlListItem *); - void visitPre(DocHtmlPre *); - void visitPost(DocHtmlPre *); + //void visitPre(DocHtmlPre *); + //void visitPost(DocHtmlPre *); void visitPre(DocHtmlDescList *); void visitPost(DocHtmlDescList *); void visitPre(DocHtmlDescTitle *); diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 19fc945..7965c9c 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -1439,14 +1439,14 @@ void RTFGenerator::startDescription() { DBG_RTF(t << "{\\comment (startDescription)}" << endl) t << "{" << endl; - t << rtf_Style_Reset << rtf_CList_DepthStyle(); + t << rtf_Style_Reset << rtf_DList_DepthStyle(); } void RTFGenerator::endDescription() { DBG_RTF(t << "{\\comment (endDescription)}" << endl) - t << "}"; newParagraph(); + t << "}"; } void RTFGenerator::startDescItem() @@ -1758,6 +1758,7 @@ void RTFGenerator::writeRTFReference(const char *label) void RTFGenerator::startCodeFragment() { + DBG_RTF(t << "{\\comment (startCodeFragment) }" << endl) t << "{" << endl; newParagraph(); t << rtf_Style_Reset << rtf_Code_DepthStyle(); @@ -1974,8 +1975,11 @@ void RTFGenerator::endTextBlock() void RTFGenerator::newParagraph() { + if (!m_omitParagraph) + { DBG_RTF(t << "{\\comment (newParagraph)}" << endl) - if (!m_omitParagraph) t << "\\par" << endl; + t << "\\par" << endl; + } m_omitParagraph = FALSE; } @@ -2177,6 +2181,7 @@ static bool PreProcessFile(QDir &d,QCString &infName, QTextStream &t, bool bIncl void RTFGenerator::startDotGraph() { + DBG_RTF(t << "{\\comment (startDotGraph)}" << endl) } void RTFGenerator::endDotGraph(DotClassGraph &g) @@ -2193,10 +2198,13 @@ void RTFGenerator::endDotGraph(DotClassGraph &g) t << fileName << "." << Config_getEnum("DOT_IMAGE_FORMAT"); t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; + newParagraph(); + DBG_RTF(t << "{\\comment (endDotGraph)}" << endl) } void RTFGenerator::startInclDepGraph() { + DBG_RTF(t << "{\\comment (startInclDepGraph)}" << endl) } void RTFGenerator::endInclDepGraph(DotInclDepGraph &g) @@ -2212,6 +2220,7 @@ void RTFGenerator::endInclDepGraph(DotInclDepGraph &g) t << fileName << "." << Config_getEnum("DOT_IMAGE_FORMAT"); t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << "}" << endl; + DBG_RTF(t << "{\\comment (endInclDepGraph)}" << endl) } /** Tests the integrity of the result by counting brackets. diff --git a/src/util.cpp b/src/util.cpp index 2141530..56f61c3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3827,18 +3827,14 @@ void filterLatexString(QTextStream &t,const char *str, case '>': t << "$>$"; break; case '|': t << "$|$"; break; case '~': t << "$\\sim$"; break; - case '[': if (Config_getBool("PDF_HYPERLINKS")) + case '[': if (Config_getBool("PDF_HYPERLINKS") || insideItem) t << "\\mbox{[}"; - else if (insideItem) - t << "\\["; else t << "["; break; case ']': if (pc=='[') t << "$\\,$"; - if (Config_getBool("PDF_HYPERLINKS")) + if (Config_getBool("PDF_HYPERLINKS") || insideItem) t << "\\mbox{]}"; - else if (insideItem) - t << "\\]"; else t << "]"; break; diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index ca021c6..be8ca04 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -138,6 +138,18 @@ void XmlDocVisitor::visit(DocStyleChange *s) case DocStyleChange::Small: if (s->enable()) m_t << "<small>"; else m_t << "</small> "; break; + case DocStyleChange::Preformatted: + if (s->enable()) + { + m_t << "<preformatted>"; + m_insidePre=TRUE; + } + else + { + m_t << "</preformatted> "; + m_insidePre=FALSE; + } + break; } } @@ -412,18 +424,6 @@ void XmlDocVisitor::visitPost(DocHtmlListItem *) m_t << "</listitem>\n"; } -void XmlDocVisitor::visitPre(DocHtmlPre *) -{ - m_t << "<preformatted>\n"; - m_insidePre=TRUE; -} - -void XmlDocVisitor::visitPost(DocHtmlPre *) -{ - m_insidePre=FALSE; - m_t << "</preformatted>\n"; -} - void XmlDocVisitor::visitPre(DocHtmlDescList *) { m_t << "<variablelist>\n"; @@ -517,12 +517,12 @@ void XmlDocVisitor::visitPost(DocHRef *) void XmlDocVisitor::visitPre(DocHtmlHeader *header) { - m_t << "<sect" << header->level() << ">"; + m_t << "<heading" << header->level() << ">"; } void XmlDocVisitor::visitPost(DocHtmlHeader *header) { - m_t << "</sect" << header->level() << ">\n"; + m_t << "</heading" << header->level() << ">\n"; } void XmlDocVisitor::visitPre(DocImage *img) diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h index 045f868..95f5afe 100644 --- a/src/xmldocvisitor.h +++ b/src/xmldocvisitor.h @@ -76,8 +76,8 @@ class XmlDocVisitor : public DocVisitor void visitPost(DocHtmlList *) ; void visitPre(DocHtmlListItem *); void visitPost(DocHtmlListItem *); - void visitPre(DocHtmlPre *); - void visitPost(DocHtmlPre *); + //void visitPre(DocHtmlPre *); + //void visitPost(DocHtmlPre *); void visitPre(DocHtmlDescList *); void visitPost(DocHtmlDescList *); void visitPre(DocHtmlDescTitle *); |