diff options
39 files changed, 647 insertions, 203 deletions
diff --git a/doc/commands.doc b/doc/commands.doc index dbc7504..d9d38e8 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -115,6 +115,7 @@ documentation: \refitem cmdimage \\image \refitem cmdimplements \\implements \refitem cmdinclude \\include +\refitem cmdincludedoc \\includedoc \refitem cmdincludelineno \\includelineno \refitem cmdingroup \\ingroup \refitem cmdinternal \\internal @@ -177,6 +178,7 @@ documentation: \refitem cmdskip \\skip \refitem cmdskipline \\skipline \refitem cmdsnippet \\snippet +\refitem cmdsnippetdoc \\snippetdoc \refitem cmdstartuml \\startuml \refitem cmdstruct \\struct \refitem cmdsubpage \\subpage @@ -2171,8 +2173,8 @@ Commands for displaying examples \note Doxygen's special commands do not work inside blocks of code. It is allowed to nest C-style comments inside a code block though. - \sa sections \ref cmdexample "\\example", \ref cmddontinclude "\\dontinclude", and - \ref cmdverbatim "\\verbatim". + \sa sections \ref cmdexample "\\example", \ref cmddontinclude "\\dontinclude", + \ref cmdverbatim "\\verbatim" and \ref cmdincludedoc "\\includedoc". <hr> \section cmdincludelineno \\includelineno <file-name> @@ -2184,6 +2186,22 @@ Commands for displaying examples \sa section \ref cmdinclude "\\include". <hr> +\section cmdincludedoc \\includedoc <file-name> + + \addindex \\includedoc + This command works the same way as \ref cmdinclude "\\include", but it will include + the content of the file as if it were at the place where this command is called. + The result is that the content is parsed by doxygen and placed in the documentation. + + \note Some commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with + this command due to the moment of parsing. + + \note The included documentation should not have comment signs in it as the will appear + in the documentation as well. + + \sa section \ref cmdinclude "\\include". + +<hr> \section cmdline \\line ( pattern ) \addindex \\line @@ -2285,6 +2303,23 @@ Commands for displaying examples see section \ref cmddontinclude "\\dontinclude" for an alternative way to include fragments of a source file that does not require markers. + \sa section \ref cmdsnippetdoc "\\snippetdoc". +<hr> +\section cmdsnippetdoc \\snippetdoc <file-name> ( block_id ) + + \addindex \\snippetdoc + This command works the same way as \ref cmdsnippet "\\snippet", but it will include + the content of the file between the `block-id`s as if it were at the place where this command is called. + The result is that the content is parsed by doxygen and placed in the documentation. + + \note Some commands like \ref cmdcond "\\cond" and \ref cmdif "\\if" don't work with + this command due to the moment of parsing. + + \note The included documentation should not have comment signs in it as the will appear + in the documentation as well. + + \sa section \ref cmdsnippet "\\snippet" and \ref cmdincludedoc "\\includedoc". + <hr> \section cmduntil \\until ( pattern ) @@ -3177,8 +3212,9 @@ class Receiver \c \\verbatim command or the parser will get confused! \sa sections \ref cmdcode "\\code", - \ref cmdendverbatim "\\endverbatim", and - \ref cmdverbinclude "\\verbinclude". + \ref cmdendverbatim "\\endverbatim", + \ref cmdverbinclude "\\verbinclude", and + \ref cmdverbincludedooc "\\verbincludedooc". <hr> \section cmdxmlonly \\xmlonly diff --git a/doc/starting.doc b/doc/starting.doc index f82e90d..bfb8e8f 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -126,6 +126,9 @@ Extension | Language .f |Fortran .for |Fortran .f90 |Fortran +.f95 |Fortran +.f03 |Fortran +.f08 |Fortran .vhd |VHDL .vhdl |VHDL .tcl |TCL diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index 6784b3e..5ed25cc 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -88,6 +88,7 @@ CommandMap cmdMap[] = { "secreflist", CMD_SECREFLIST }, { "section", CMD_SECTION }, { "snippet", CMD_SNIPPET }, + { "snippetdoc", CMD_SNIPPETDOC }, { "subpage", CMD_SUBPAGE }, { "subsection", CMD_SUBSECTION }, { "subsubsection", CMD_SUBSUBSECTION }, @@ -130,6 +131,7 @@ CommandMap cmdMap[] = { "manonly", CMD_MANONLY }, { "endmanonly", CMD_ENDMANONLY }, { "includelineno", CMD_INCWITHLINES }, + { "includedoc", CMD_INCLUDEDOC }, { "inheritdoc", CMD_INHERITDOC }, { "mscfile", CMD_MSCFILE }, { "rtfonly", CMD_RTFONLY }, diff --git a/src/cmdmapper.h b/src/cmdmapper.h index 92c906a..8800c38 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -133,7 +133,9 @@ enum CommandType CMD_SETSCOPE = 103, CMD_PUNT = 104, CMD_PLUS = 105, - CMD_MINUS = 106 + CMD_MINUS = 106, + CMD_INCLUDEDOC = 107, + CMD_SNIPPETDOC = 108 }; enum HtmlTagType diff --git a/src/config.xml b/src/config.xml index abed704..4c13e9c 100644 --- a/src/config.xml +++ b/src/config.xml @@ -1337,6 +1337,9 @@ FILE_VERSION_INFO = "cleartool desc -fmt \%Vn" <value name='*.py'/> <value name='*.pyw'/> <value name='*.f90'/> + <value name='*.f95'/> + <value name='*.f03'/> + <value name='*.f08'/> <value name='*.f'/> <value name='*.for'/> <value name='*.tcl'/> diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index ec320e9..535d294 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -359,6 +359,11 @@ void DocbookDocVisitor::visit(DocInclude *inc) ); m_t << "</computeroutput></literallayout>"; break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } } diff --git a/src/docparser.cpp b/src/docparser.cpp index 5dfa7b3..cdf549a 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -123,6 +123,7 @@ struct DocParserContext QStack<DocStyleChange> initialStyleStack; QList<Definition> copyStack; QCString fileName; + int lineNo; QCString relPath; bool hasParamCommand; @@ -144,7 +145,6 @@ struct DocParserContext static QStack<DocParserContext> g_parserStack; //--------------------------------------------------------------------------- - static void docParserPushContext(bool saveParamInfo=TRUE) { //QCString indent; @@ -163,6 +163,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE) ctx->initialStyleStack = g_initialStyleStack; ctx->copyStack = g_copyStack; ctx->fileName = g_fileName; + ctx->lineNo = doctokenizerYYlineno; ctx->relPath = g_relPath; if (saveParamInfo) @@ -201,6 +202,7 @@ static void docParserPopContext(bool keepParamInfo=FALSE) g_initialStyleStack = ctx->initialStyleStack; g_copyStack = ctx->copyStack; g_fileName = ctx->fileName; + doctokenizerYYlineno = ctx->lineNo; g_relPath = ctx->relPath; if (!keepParamInfo) @@ -1264,9 +1266,6 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN if (tok==TK_WORD && (g_token->name=="width=" || g_token->name=="height=")) { // special case: no title, but we do have a size indicator - doctokenizerYYsetStateTitleAttrValue(); - // strip = - g_token->name = g_token->name.left(g_token->name.length()-1); break; } if (!defaultHandleToken(parent,tok,children)) @@ -1293,21 +1292,32 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN { tok=doctokenizerYYlex(); } - while (tok==TK_WORD) // there are values following the title + while (tok==TK_WHITESPACE || tok==TK_WORD) // there are values following the title { - if (g_token->name=="width") - { - width = g_token->chars; - } - else if (g_token->name=="height") + if(tok == TK_WORD) { - height = g_token->chars; - } - else - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Unknown option '%s' after \\%s command, expected 'width' or 'height'", - qPrint(g_token->name), Mappers::cmdMapper->find(cmd).data()); + if (g_token->name=="width=" || g_token->name=="height=") + { + doctokenizerYYsetStateTitleAttrValue(); + g_token->name = g_token->name.left(g_token->name.length()-1); + } + + if (g_token->name=="width") + { + width = g_token->chars; + } + else if (g_token->name=="height") + { + height = g_token->chars; + } + else + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Unknown option '%s' after \\%s command, expected 'width' or 'height'", + qPrint(g_token->name), Mappers::cmdMapper->find(cmd).data()); + break; + } } + tok=doctokenizerYYlex(); } doctokenizerYYsetStatePara(); @@ -1931,6 +1941,11 @@ void DocInclude::parse() m_blockId.data(),m_file.data(),count); } break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } } @@ -5132,7 +5147,6 @@ endref: doctokenizerYYsetStatePara(); } - void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t) { DBG(("handleInclude(%s)\n",qPrint(cmdName))); @@ -5160,7 +5174,7 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t) } QCString fileName = g_token->name; QCString blockId; - if (t==DocInclude::Snippet) + if (t==DocInclude::Snippet || t==DocInclude::SnippetDoc) { if (fileName == "this") fileName=g_fileName; doctokenizerYYsetStateSnippet(); @@ -5174,9 +5188,31 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t) } blockId = "["+g_token->name+"]"; } - DocInclude *inc = new DocInclude(this,fileName,g_context,t,g_isExample,g_exampleName,blockId); - m_children.append(inc); - inc->parse(); + + // This is the only place to handle the \includedoc and \snippetdoc commands, + // as the content is included here as if it is really here. + if (t==DocInclude::IncludeDoc || t==DocInclude::SnippetDoc) + { + QCString inc_text; + int inc_line = 1; + readTextFileByName(fileName,inc_text); + if (t==DocInclude::SnippetDoc) + { + inc_line = lineBlock(inc_text, blockId); + inc_text = extractBlock(inc_text, blockId); + } + docParserPushContext(); + g_fileName = fileName; + doctokenizerYYlineno=inc_line; + internalValidatingParseDoc(this,m_children,inc_text); + docParserPopContext(); + } + else + { + DocInclude *inc = new DocInclude(this,fileName,g_context,t,g_isExample,g_exampleName,blockId); + m_children.append(inc); + inc->parse(); + } } void DocPara::handleSection(const QCString &cmdName) @@ -5411,15 +5447,15 @@ int DocPara::handleCommand(const QCString &cmdName) break; case CMD_LI: { - DocSimpleList *sl=new DocSimpleList(this); - m_children.append(sl); + DocSimpleList *sl=new DocSimpleList(this); + m_children.append(sl); retval = sl->parse(); } break; case CMD_SECTION: { handleSection(cmdName); - retval = RetVal_Section; + retval = RetVal_Section; } break; case CMD_SUBSECTION: @@ -5665,6 +5701,12 @@ int DocPara::handleCommand(const QCString &cmdName) case CMD_SNIPPET: handleInclude(cmdName,DocInclude::Snippet); break; + case CMD_INCLUDEDOC: + handleInclude(cmdName,DocInclude::IncludeDoc); + break; + case CMD_SNIPPETDOC: + handleInclude(cmdName,DocInclude::SnippetDoc); + break; case CMD_SKIP: handleIncludeOperator(cmdName,DocIncOperator::Skip); break; @@ -6152,8 +6194,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta case XML_INHERITDOC: handleInheritDoc(); break; - - default: + default: // we should not get here! ASSERT(0); break; diff --git a/src/docparser.h b/src/docparser.h index e2751d8..1fe5e95 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -483,7 +483,7 @@ class DocVerbatim : public DocNode class DocInclude : public DocNode { public: - enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude, IncWithLines, Snippet }; + enum Type { Include, DontInclude, VerbInclude, HtmlInclude, LatexInclude, IncWithLines, Snippet , IncludeDoc, SnippetDoc}; DocInclude(DocNode *parent,const QCString &file, const QCString context, Type t, bool isExample,const QCString exampleFile, diff --git a/src/fileparser.cpp b/src/fileparser.cpp index b54b243..6883622 100644 --- a/src/fileparser.cpp +++ b/src/fileparser.cpp @@ -22,7 +22,7 @@ void FileParser::parseCode(CodeOutputInterface &codeOutIntf, SrcLangExt, // lang bool, // isExampleBlock const char *, // exampleName - FileDef *, // fileDef + FileDef * fileDef, int startLine, int endLine, bool, // inlineFragment @@ -40,8 +40,8 @@ void FileParser::parseCode(CodeOutputInterface &codeOutIntf, int j=i; while (j<length && input[j]!='\n') j++; QCString lineStr = input.mid(i,j-i); - codeOutIntf.startCodeLine(showLineNumbers); - if (showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr); + codeOutIntf.startCodeLine(fileDef != 0 && showLineNumbers); + if (fileDef != 0 && showLineNumbers) codeOutIntf.writeLineNumber(0,0,0,lineNr); if (!lineStr.isEmpty()) codeOutIntf.codify(lineStr); codeOutIntf.endCodeLine(); lineNr++; diff --git a/src/fortrancode.l b/src/fortrancode.l index f14867c..a2a5d1a 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -925,7 +925,12 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I startScope(); generateLink(*g_code,yytext); } -<Subprog>"(".* { // ignore rest of line +<Subprog>"result"/{BS}"("[^)]*")" { + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + } +<Subprog>"("[^)]*")" { // ignore rest of line codifyLines(yytext); } <Subprog,Subprogend>"\n" { codifyLines(yytext); @@ -1123,6 +1128,16 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I codifyLines(yytext); endFontClass(); } +<*>"assignment"/{BS}"("{BS}"="{BS}")" { + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + } +<*>"operator"/{BS}"("[^)]*")" { + startFontClass("keyword"); + codifyLines(yytext); + endFontClass(); + } /*------ preprocessor --------------------------------------------*/ <Start>"#".*\n { diff --git a/src/fortranscanner.l b/src/fortranscanner.l index ad4a63f..0b59eb7 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -322,6 +322,12 @@ SCOPENAME ({ID}{BS}"::"{BS})* /*-----------------------------------------------------------------------------------*/ +<Prepass>^{BS}[&]*{BS}!.*\n { /* skip lines with just comment. Note code was in free format or has been converted to it */ + lineCountPrepass ++; + } +<Prepass>^{BS}\n { /* skip empty lines */ + lineCountPrepass ++; + } <*>^.*\n { // prepass: look for line continuations functionLine = FALSE; @@ -1422,6 +1428,7 @@ static const char* prepassFixedForm(const char* contents) bool inSingle=FALSE; bool inDouble=FALSE; bool inBackslash=FALSE; + bool fullCommentLine=TRUE; int newContentsSize = strlen(contents)+3; // \000, \n (when necessary) and one spare character (to avoid reallocation) char* newContents = (char*)malloc(newContentsSize); @@ -1435,8 +1442,17 @@ static const char* prepassFixedForm(const char* contents) char c = contents[i]; switch(c) { case '\n': - prevLineLength=column; - prevLineAmpOrExclIndex=getAmpOrExclAtTheEnd(&contents[i-prevLineLength+1], prevLineLength,prevQuote); + if (!fullCommentLine) + { + prevLineLength=column; + prevLineAmpOrExclIndex=getAmpOrExclAtTheEnd(&contents[i-prevLineLength+1], prevLineLength,prevQuote); + if (prevLineAmpOrExclIndex == -1) prevLineAmpOrExclIndex = column - 1; + } + else + { + prevLineLength+=column; + } + fullCommentLine=TRUE; column=0; emptyLabel=TRUE; commented=FALSE; @@ -1463,7 +1479,8 @@ static const char* prepassFixedForm(const char* contents) case '\\': if ((column <= fixedCommentAfter) && (column!=6) && !commented) { - // we have some special cases in respect to strings and exscaped string characters + // we have some special cases in respect to strings and escaped string characters + fullCommentLine=FALSE; newContents[j]=c; if (c == '\\') { @@ -1512,6 +1529,7 @@ static const char* prepassFixedForm(const char* contents) } else { + if (!commented) fullCommentLine=FALSE; newContents[j]=c; } break; @@ -1519,6 +1537,7 @@ static const char* prepassFixedForm(const char* contents) // fallthrough default: if(column==6 && emptyLabel) { // continuation + if (!commented) fullCommentLine=FALSE; if (c != '0') { // 0 not allowed as continuation character, see f95 standard paragraph 3.3.2.3 newContents[j]=' '; @@ -1532,6 +1551,7 @@ static const char* prepassFixedForm(const char* contents) } else { newContents[j]=c; // , just handle like space } + prevLineLength=0; } else if ((column > fixedCommentAfter) && !commented) { // first non commented non blank character after position fixedCommentAfter if (c != '!') { @@ -1542,6 +1562,7 @@ static const char* prepassFixedForm(const char* contents) newContents[j]=c; commented = TRUE; } else { + if (!commented) fullCommentLine=FALSE; newContents[j]=c; emptyLabel=FALSE; } @@ -2491,7 +2512,11 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt, Fortra //printf("---strlen=%d\n", strlen(fileBuf)); //clock_t start=clock(); + //printf("Input fixed form string:\n%s\n", fileBuf); + //printf("===========================\n"); inputString = prepassFixedForm(fileBuf); + //printf("Resulting free form string:\n%s\n", inputString); + //printf("===========================\n"); //clock_t end=clock(); //printf("CPU time used=%f\n", ((double) (end-start))/CLOCKS_PER_SEC); diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index b589f71..1b1bc98 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -585,6 +585,11 @@ void HtmlDocVisitor::visit(DocInclude *inc) forceStartParagraph(inc); } break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } } diff --git a/src/htmlentity.cpp b/src/htmlentity.cpp index ff3c574..668c224 100644 --- a/src/htmlentity.cpp +++ b/src/htmlentity.cpp @@ -199,7 +199,7 @@ static struct htmlEntityInfo { SYM(oline), "\xe2\x80\xbe", "‾", "<oline/>", "‾", "{$\\overline{\\,}$}", NULL, "\\u8254?", { NULL, DocSymbol::Perl_unknown }}, { SYM(frasl), "\xe2\x81\x84", "⁄", "<frasl/>", "⁄", "/", NULL, "\\u8260?", { NULL, DocSymbol::Perl_unknown }}, { SYM(weierp), "\xe2\x84\x98", "℘", "<weierp/>", "℘", "{$\\wp$}", NULL, "\\u8472?", { NULL, DocSymbol::Perl_unknown }}, - { SYM(image), "\xe2\x84\x91", "ℑ", "<image/>", "ℑ", "{$\\Im$}", NULL, "\\u8465?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(image), "\xe2\x84\x91", "ℑ", "<imaginary/>", "ℑ", "{$\\Im$}", NULL, "\\u8465?", { NULL, DocSymbol::Perl_unknown }}, { SYM(real), "\xe2\x84\x9c", "ℜ", "<real/>", "ℜ", "{$\\Re$}", NULL, "\\u8476?", { NULL, DocSymbol::Perl_unknown }}, { SYM(trade), "\xe2\x84\xa2", "™", "<trademark/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, { SYM(alefsym), "\xe2\x85\xb5", "ℵ", "<alefsym/>", "ℵ", "{$\\aleph$}", NULL, "\\u8501?", { NULL, DocSymbol::Perl_unknown }}, @@ -297,7 +297,7 @@ static struct htmlEntityInfo { SYM(euro), "\xe2\x82\xac", "€", "<euro/>", "€", "\\texteuro{}", NULL, "\\'80", { NULL, DocSymbol::Perl_unknown }}, // doxygen extension to the HTML4 table of HTML entities - { SYM(tm), "\xe2\x84\xa2", "™", "<trademark/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, + { SYM(tm), "\xe2\x84\xa2", "™", "<tm/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, { SYM(apos), "'", "'", "'", "'", "\\textquotesingle{}", "'", "'", { "\\\'", DocSymbol::Perl_string }}, // doxygen commands represented as HTML entities diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 53926cf..24af9fc 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1863,6 +1863,46 @@ void HtmlGenerator::writeNonBreakableSpace(int n) } } +void HtmlGenerator::startDescTable(const char *title) +{ + t << "<table class=\"fieldtable\">" << endl + << "<tr><th colspan=\"2\">" << title << "</th></tr>"; +} +void HtmlGenerator::endDescTable() +{ + t << "</table>" << endl; +} + +void HtmlGenerator::startDescTableRow() +{ + t << "<tr>"; +} + +void HtmlGenerator::endDescTableRow() +{ + t << "</tr>" << endl; +} + +void HtmlGenerator::startDescTableTitle() +{ + t << "<td class=\"fieldname\">"; +} + +void HtmlGenerator::endDescTableTitle() +{ + t << " </td>"; +} + +void HtmlGenerator::startDescTableData() +{ + t << "<td class=\"fielddoc\">"; +} + +void HtmlGenerator::endDescTableData() +{ + t << "</td>"; +} + void HtmlGenerator::startSimpleSect(SectionTypes, const char *filename,const char *anchor, const char *title) @@ -2488,14 +2528,16 @@ void HtmlGenerator::endInlineHeader() t << "</h3></td></tr>" << endl; } -void HtmlGenerator::startMemberDocSimple() +void HtmlGenerator::startMemberDocSimple(bool isEnum) { DBG_HTML(t << "<!-- startMemberDocSimple -->" << endl;) t << "<table class=\"fieldtable\">" << endl; - t << "<tr><th colspan=\"3\">" << theTranslator->trCompoundMembers() << "</th></tr>" << endl; + t << "<tr><th colspan=\"" << (isEnum?"2":"3") << "\">"; + t << (isEnum? theTranslator->trEnumerationValues() : + theTranslator->trCompoundMembers()) << "</th></tr>" << endl; } -void HtmlGenerator::endMemberDocSimple() +void HtmlGenerator::endMemberDocSimple(bool) { DBG_HTML(t << "<!-- endMemberDocSimple -->" << endl;) t << "</table>" << endl; diff --git a/src/htmlgen.h b/src/htmlgen.h index cafb666..30f54f4 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -272,25 +272,16 @@ class HtmlGenerator : public OutputGenerator void startContents(); void endContents(); void writeNonBreakableSpace(int); - - void startDescTable(const char *title) - //{ t << "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">" << endl; } - { t << "<table class=\"fieldtable\">" << endl - << "<tr><th colspan=\"2\">" << title << "</th></tr>"; - } - void endDescTable() - { t << "</table>" << endl; } - void startDescTableTitle() - //{ t << "<tr><td valign=\"top\"><em>"; } - { t << "<tr><td class=\"fieldname\">"; } - void endDescTableTitle() - { t << " </td>"; } - void startDescTableData() - //{ t << "<td>" << endl; } - { t << "<td class=\"fielddoc\">" << endl; } - void endDescTableData() - { t << "</td></tr>" << endl; } - + + void startDescTable(const char *title); + void endDescTable(); + void startDescTableRow(); + void endDescTableRow(); + void startDescTableTitle(); + void endDescTableTitle(); + void startDescTableData(); + void endDescTableData(); + void startDotGraph(); void endDotGraph(const DotClassGraph &g); void startInclDepGraph(); @@ -330,8 +321,8 @@ class HtmlGenerator : public OutputGenerator void endConstraintDocs(); void endConstraintList(); - void startMemberDocSimple(); - void endMemberDocSimple(); + void startMemberDocSimple(bool); + void endMemberDocSimple(bool); void startInlineMemberType(); void endInlineMemberType(); void startInlineMemberName(); diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 4a98c77..13491e9 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -431,7 +431,14 @@ void LatexDocVisitor::visit(DocInclude *inc) inc->text(), langExt, inc->isExample(), - inc->exampleFile(), &fd); + inc->exampleFile(), + &fd, // fileDef, + -1, // start line + -1, // end line + FALSE, // inline fragment + 0, // memberDef + TRUE // show line numbers + ); m_t << "\\end{DoxyCodeInclude}" << endl; } break; @@ -440,7 +447,14 @@ void LatexDocVisitor::visit(DocInclude *inc) Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text(),langExt,inc->isExample(), - inc->exampleFile()); + inc->exampleFile(), + 0, // fileDef + -1, // startLine + -1, // endLine + TRUE, // inlineFragment + 0, // memberDef + FALSE + ); m_t << "\\end{DoxyCodeInclude}\n"; break; case DocInclude::DontInclude: @@ -469,6 +483,11 @@ void LatexDocVisitor::visit(DocInclude *inc) m_t << "\\end{DoxyCodeInclude}" << endl; } break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } } diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 4877599..ca60b50 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -1292,7 +1292,7 @@ void LatexGenerator::endIndexItem(const char *ref,const char *fn) //{ // t << "\\item\\contentsline{section}{"; // docify(text); -// t << "}{\\pageref{" << text << "}}" << endl; +// t << "}{\\pageref{" << stripPath(text) << "}}" << endl; //} @@ -1336,7 +1336,7 @@ void LatexGenerator::writeStartAnnoItem(const char *,const char *, void LatexGenerator::writeEndAnnoItem(const char *name) { - t << "}{\\pageref{" << name << "}}{}" << endl; + t << "}{\\pageref{" << stripPath(name) << "}}{}" << endl; } void LatexGenerator::startIndexKey() @@ -1357,7 +1357,7 @@ void LatexGenerator::startIndexValue(bool hasBrief) void LatexGenerator::endIndexValue(const char *name,bool /*hasBrief*/) { //if (hasBrief) t << ")"; - t << "}{\\pageref{" << name << "}}{}" << endl; + t << "}{\\pageref{" << stripPath(name) << "}}{}" << endl; } //void LatexGenerator::writeClassLink(const char *,const char *, @@ -1579,7 +1579,7 @@ void LatexGenerator::startMemberDoc(const char *clname, t << "\\hspace{0.1cm}{\\footnotesize\\ttfamily [" << memCount << "/" << memTotal << "]}"; } t << "}"; - t << "\n{\\ttfamily "; + t << "\n{\\footnotesize\\ttfamily "; //disableLinks=TRUE; } @@ -1826,6 +1826,65 @@ void LatexGenerator::writeNonBreakableSpace(int) } } +// ---------------------------------------------- +// nesting of functions below: +// startDescTable() +// - startDescTableRow() +// - startDescTableTitle() +// - endDescTabelTitle() +// - startDescTableData() +// - endDescTableData() +// - endDescTableRow() +// - startDescTableRow() +// - ... +// - endDescTableRow() +// endDescTable() + +void LatexGenerator::startDescTable(const char *title) +{ + t << "\\begin{DoxyEnumFields}{" << title << "}" << endl; +} + +void LatexGenerator::endDescTable() +{ + t << "\\end{DoxyEnumFields}" << endl; +} + +void LatexGenerator::startDescTableRow() +{ + // this is needed to prevent the \hypertarget, \label, and \index commands from messing up + // the row height (based on http://tex.stackexchange.com/a/186102) + t << "\\raisebox{\\heightof{T}}[0pt][0pt]{"; +} + +void LatexGenerator::endDescTableRow() +{ +} + +void LatexGenerator::startDescTableTitle() +{ + t << "}"; +} + +void LatexGenerator::endDescTableTitle() +{ +} + +void LatexGenerator::startDescTableData() +{ + t << "&"; +} + +void LatexGenerator::endDescTableData() +{ + t << "\\\\\n\\hline\n" << endl; +} + +void LatexGenerator::lastIndexPage() +{ +} + + void LatexGenerator::startMemberList() { if (!insideTabbing) @@ -2124,20 +2183,35 @@ void LatexGenerator::lineBreak(const char *) } else { - t << "\\\\*\n"; + t << "\\newline\n"; } } -void LatexGenerator::startMemberDocSimple() +void LatexGenerator::startMemberDocSimple(bool isEnum) { - t << "\\begin{DoxyFields}{"; - docify(theTranslator->trCompoundMembers()); + if (isEnum) + { + t << "\\begin{DoxyEnumFields}{"; + docify(theTranslator->trEnumerationValues()); + } + else + { + t << "\\begin{DoxyFields}{"; + docify(theTranslator->trCompoundMembers()); + } t << "}" << endl; } -void LatexGenerator::endMemberDocSimple() +void LatexGenerator::endMemberDocSimple(bool isEnum) { - t << "\\end{DoxyFields}" << endl; + if (isEnum) + { + t << "\\end{DoxyEnumFields}" << endl; + } + else + { + t << "\\end{DoxyFields}" << endl; + } } void LatexGenerator::startInlineMemberType() diff --git a/src/latexgen.h b/src/latexgen.h index f2e4978..7b21ea4 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -259,23 +259,16 @@ class LatexGenerator : public OutputGenerator void startContents() {} void endContents() {} void writeNonBreakableSpace(int); - - void startDescTable(const char *title) - { startSimpleSect(EnumValues,0,0,title); - startDescForItem(); - t << "\\begin{description}" << endl; } - void endDescTable() - { t << "\\end{description}" << endl; - endDescForItem(); - endSimpleSect(); - } - void startDescTableTitle() - { t << "\\item[{\\em " << endl; } - void endDescTableTitle() - { t << "}]"; } - void startDescTableData() {} - void endDescTableData() {} - void lastIndexPage() {} + + void startDescTable(const char *title); + void endDescTable(); + void startDescTableRow(); + void endDescTableRow(); + void startDescTableTitle(); + void endDescTableTitle(); + void startDescTableData(); + void endDescTableData(); + void lastIndexPage(); void startDotGraph(); void endDotGraph(const DotClassGraph &); @@ -313,8 +306,8 @@ class LatexGenerator : public OutputGenerator void endConstraintDocs(); void endConstraintList(); - void startMemberDocSimple(); - void endMemberDocSimple(); + void startMemberDocSimple(bool); + void endMemberDocSimple(bool); void startInlineMemberType(); void endInlineMemberType(); void startInlineMemberName(); diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 8acffc7..771cd80 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -237,7 +237,14 @@ void ManDocVisitor::visit(DocInclude *inc) inc->text(), langExt, inc->isExample(), - inc->exampleFile(), &fd); + inc->exampleFile(), + &fd, // fileDef, + -1, // start line + -1, // end line + FALSE, // inline fragment + 0, // memberDef + TRUE + ); if (!m_firstCol) m_t << endl; m_t << ".fi" << endl; m_t << ".PP" << endl; @@ -253,7 +260,14 @@ void ManDocVisitor::visit(DocInclude *inc) inc->text(), langExt, inc->isExample(), - inc->exampleFile()); + inc->exampleFile(), + 0, // fileDef + -1, // startLine + -1, // endLine + TRUE, // inlineFragment + 0, // memberDef + FALSE + ); if (!m_firstCol) m_t << endl; m_t << ".fi" << endl; m_t << ".PP" << endl; @@ -292,6 +306,11 @@ void ManDocVisitor::visit(DocInclude *inc) m_t << ".PP" << endl; m_firstCol=TRUE; break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } } diff --git a/src/mangen.cpp b/src/mangen.cpp index 34ce0c1..963f66c 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -762,19 +762,26 @@ void ManGenerator::endInlineHeader() firstCol = FALSE; } -void ManGenerator::startMemberDocSimple() +void ManGenerator::startMemberDocSimple(bool isEnum) { if (!firstCol) { t << endl << ".PP" << endl; } t << "\\fB"; - docify(theTranslator->trCompoundMembers()); + if (isEnum) + { + docify(theTranslator->trEnumerationValues()); + } + else + { + docify(theTranslator->trCompoundMembers()); + } t << ":\\fP" << endl; t << ".RS 4" << endl; } -void ManGenerator::endMemberDocSimple() +void ManGenerator::endMemberDocSimple(bool) { if (!firstCol) t << endl; t << ".RE" << endl; diff --git a/src/mangen.h b/src/mangen.h index 021f475..daaae0c 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -199,6 +199,8 @@ class ManGenerator : public OutputGenerator void startDescTable(const char *t) { startSimpleSect(EnumValues,0,0,t); startDescForItem(); } void endDescTable() { endDescForItem(); endSimpleSect(); } + void startDescTableRow() {} + void endDescTableRow() {} void startDescTableTitle() { startItemListItem(); startBold(); startEmphasis(); endItemListItem(); } void endDescTableTitle() { endEmphasis(); endBold(); } void startDescTableData() { t << endl; firstCol=TRUE; } @@ -244,8 +246,8 @@ class ManGenerator : public OutputGenerator void endConstraintDocs(); void endConstraintList(); - void startMemberDocSimple(); - void endMemberDocSimple(); + void startMemberDocSimple(bool); + void endMemberDocSimple(bool); void startInlineMemberType(); void endInlineMemberType(); void startInlineMemberName(); diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 1c78ab9..952be64 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2342,6 +2342,7 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container, ol.startDescTable(theTranslator->trEnumerationValues()); } + ol.startDescTableRow(); ol.addIndexItem(fmd->name(),ciname); ol.addIndexItem(ciname,fmd->name()); @@ -2391,6 +2392,7 @@ void MemberDef::_writeEnumValues(OutputList &ol,Definition *container, fmd,fmd->documentation()+"\n",TRUE,FALSE); } ol.endDescTableData(); + ol.endDescTableRow(); } } } @@ -3118,43 +3120,47 @@ void MemberDef::writeMemberDocSimple(OutputList &ol, Definition *container) ClassDef *cd = m_impl->accessorClass; //printf("===> %s::anonymous: %s\n",name().data(),cd?cd->name().data():"<none>"); - ol.startInlineMemberType(); - ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); + if (container && container->definitionType()==Definition::TypeClass && + !((ClassDef*)container)->isJavaEnum()) + { + ol.startInlineMemberType(); + ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs); - QCString ts = fieldType(); + QCString ts = fieldType(); - if (cd) // cd points to an anonymous struct pointed to by this member - // so we add a link to it from the type column. - { - int i=0; - const char *prefixes[] = { "struct ","union ","class ", 0 }; - const char **p = prefixes; - while (*p) + if (cd) // cd points to an anonymous struct pointed to by this member + // so we add a link to it from the type column. { - int l=qstrlen(*p); - if (ts.left(l)==*p) + int i=0; + const char *prefixes[] = { "struct ","union ","class ", 0 }; + const char **p = prefixes; + while (*p) { - ol.writeString(*p); - i=l; + int l=qstrlen(*p); + if (ts.left(l)==*p) + { + ol.writeString(*p); + i=l; + } + p++; } - p++; + ol.writeObjectLink(cd->getReference(), + cd->getOutputFileBase(), + cd->anchor(),ts.mid(i)); } - ol.writeObjectLink(cd->getReference(), - cd->getOutputFileBase(), - cd->anchor(),ts.mid(i)); - } - else // use standard auto linking - { - linkifyText(TextGeneratorOLImpl(ol), // out - scope, // scope - getBodyDef(), // fileScope - this, // self - ts, // text - TRUE // autoBreak - ); + else // use standard auto linking + { + linkifyText(TextGeneratorOLImpl(ol), // out + scope, // scope + getBodyDef(), // fileScope + this, // self + ts, // text + TRUE // autoBreak + ); + } + ol.endDoxyAnchor(cfname,memAnchor); + ol.endInlineMemberType(); } - ol.endDoxyAnchor(cfname,memAnchor); - ol.endInlineMemberType(); ol.startInlineMemberName(); ol.docify(doxyName); diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 7cd65bf..5349030 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -748,14 +748,19 @@ void MemberList::writeSimpleDocumentation(OutputList &ol, //printf("MemberList count=%d\n",numDocMembers()); if (numDocMembers()==0) return; - ol.startMemberDocSimple(); + ClassDef *cd = 0; + if (container && container->definitionType()==Definition::TypeClass) + { + cd = (ClassDef*)container; + } + ol.startMemberDocSimple(cd && cd->isJavaEnum()); MemberListIterator mli(*this); MemberDef *md; for ( ; (md=mli.current()) ; ++mli) { md->writeMemberDocSimple(ol,container); } - ol.endMemberDocSimple(); + ol.endMemberDocSimple(cd && cd->isJavaEnum()); } // separate member pages diff --git a/src/outputgen.h b/src/outputgen.h index 24d1acc..830fd49 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -299,6 +299,8 @@ class BaseOutputDocInterface : public CodeOutputInterface virtual void writeNonBreakableSpace(int) = 0; virtual void startDescTable(const char *title) = 0; virtual void endDescTable() = 0; + virtual void startDescTableRow() = 0; + virtual void endDescTableRow() = 0; virtual void startDescTableTitle() = 0; virtual void endDescTableTitle() = 0; virtual void startDescTableData() = 0; @@ -468,8 +470,8 @@ class OutputGenerator : public BaseOutputDocInterface virtual void endConstraintDocs() = 0; virtual void endConstraintList() = 0; - virtual void startMemberDocSimple() = 0; - virtual void endMemberDocSimple() = 0; + virtual void startMemberDocSimple(bool) = 0; + virtual void endMemberDocSimple(bool) = 0; virtual void startInlineMemberType() = 0; virtual void endInlineMemberType() = 0; virtual void startInlineMemberName() = 0; diff --git a/src/outputlist.h b/src/outputlist.h index cb67250..78a2ea0 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -372,6 +372,10 @@ class OutputList : public OutputDocInterface { forall(&OutputGenerator::startDescTable,title); } void endDescTable() { forall(&OutputGenerator::endDescTable); } + void startDescTableRow() + { forall(&OutputGenerator::startDescTableRow); } + void endDescTableRow() + { forall(&OutputGenerator::endDescTableRow); } void startDescTableTitle() { forall(&OutputGenerator::startDescTableTitle); } void endDescTableTitle() @@ -448,10 +452,10 @@ class OutputList : public OutputDocInterface void endConstraintList() { forall(&OutputGenerator::endConstraintList); } - void startMemberDocSimple() - { forall(&OutputGenerator::startMemberDocSimple); } - void endMemberDocSimple() - { forall(&OutputGenerator::endMemberDocSimple); } + void startMemberDocSimple(bool b) + { forall(&OutputGenerator::startMemberDocSimple,b); } + void endMemberDocSimple(bool b) + { forall(&OutputGenerator::endMemberDocSimple,b); } void startInlineMemberType() { forall(&OutputGenerator::startInlineMemberType); } void endInlineMemberType() diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 09e1968..0cd9911 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -716,6 +716,11 @@ void PerlModDocVisitor::visit(DocInclude *inc) case DocInclude::LatexInclude: type = "latexonly"; break; case DocInclude::VerbInclude: type = "preformatted"; break; case DocInclude::Snippet: return; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } openItem(type); m_output.addFieldQuotedString("content", inc->text()); @@ -1737,6 +1737,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) %x SkipString %x CopyLine %x CopyString +%x CopyStringFtn %x Include %x IncludeID %x EndImport @@ -1850,6 +1851,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) outputChar(*yytext); BEGIN( CopyString ); } +<CopyLine>\' { + if (getLanguageFromFileName(g_yyFileName)!=SrcLangExt_Fortran) REJECT; + outputChar(*yytext); + BEGIN( CopyStringFtn ); + } <CopyString>[^\"\\\r\n]+ { outputArray(yytext,(int)yyleng); } @@ -1860,6 +1866,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) outputChar(*yytext); BEGIN( CopyLine ); } +<CopyStringFtn>[^\'\\\r\n]+ { + outputArray(yytext,(int)yyleng); + } +<CopyStringFtn>\\. { + outputArray(yytext,(int)yyleng); + } +<CopyStringFtn>\' { + outputChar(*yytext); + BEGIN( CopyLine ); + } <CopyLine>{ID}/{BN}{0,80}"(" { g_expectGuard = FALSE; Define *def=0; diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index b86670a..499fac2 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -22,6 +22,7 @@ #include <qglobal.h> #include "docvisitor.h" #include "htmlentity.h" +#include "message.h" /*! Concrete visitor implementation for pretty printing */ class PrintDocVisitor : public DocVisitor @@ -170,6 +171,11 @@ class PrintDocVisitor : public DocVisitor case DocInclude::LatexInclude: printf("latexinclude"); break; case DocInclude::VerbInclude: printf("verbinclude"); break; case DocInclude::Snippet: printf("snippet"); break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } printf("\"/>"); } diff --git a/src/pycode.l b/src/pycode.l index ef6c780..3935107 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -1142,6 +1142,10 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBUT codify(yytext); } + "\n" { + codifyLines(yytext); + } + ":" { codify(yytext); diff --git a/src/pyscanner.l b/src/pyscanner.l index 35d305d..3bebe0e 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -1205,51 +1205,49 @@ STARTDOCSYMS "##" current->initializer += " "; } {B} { // spaces + current->initializer += yytext; } {INTNUMBER} { // integer value - current->type = "int"; + if (current-> type.isEmpty()) current->type = "int"; current->initializer += yytext; - BEGIN(VariableEnd); } {FLOATNUMBER} { // floating point value - current->type = "float"; + if (current->type.isEmpty()) current->type = "float"; current->initializer += yytext; - BEGIN(VariableEnd); } {BOOL} { // boolean value - current->type = "bool"; + if (current->type.isEmpty()) current->type = "bool"; current->initializer += yytext; - BEGIN(VariableEnd); } {STRINGPREFIX}?"'" { // string - current->type = "string"; + if (current->type.isEmpty()) current->type = "string"; current->initializer += yytext; g_copyString=¤t->initializer; - g_stringContext=VariableEnd; + g_stringContext=VariableDec; BEGIN( SingleQuoteString ); } {STRINGPREFIX}?"\"" { // string - current->type = "string"; + if (current->type.isEmpty()) current->type = "string"; current->initializer += yytext; g_copyString=¤t->initializer; - g_stringContext=VariableEnd; + g_stringContext=VariableDec; BEGIN( DoubleQuoteString ); } {TRIDOUBLEQUOTE} { // start of a comment block - current->type = "string"; + if (current->type.isEmpty()) current->type = "string"; current->initializer += yytext; g_doubleQuote=TRUE; g_copyString=¤t->initializer; - g_stringContext=VariableEnd; + g_stringContext=VariableDec; BEGIN(TripleString); } {TRISINGLEQUOTE} { // start of a comment block - current->type = "string"; + if (current->type.isEmpty()) current->type = "string"; current->initializer += yytext; g_doubleQuote=FALSE; g_copyString=¤t->initializer; - g_stringContext=VariableEnd; + g_stringContext=VariableDec; BEGIN(TripleString); } "(" { // tuple, only when direct after = @@ -1283,6 +1281,20 @@ STARTDOCSYMS "##" BEGIN( VariableEnd ); } {IDENTIFIER} { + // do something based on the type of the IDENTIFIER + if (current->type.isEmpty()) + { + QListIterator<Entry> eli(*(current_root->children())); + Entry *child; + for (eli.toFirst();(child=eli.current());++eli) + { + if (child->name == QCString(yytext)) + { + current->type = child->type; + break; + } + } + } g_start_init = FALSE; current->initializer+=yytext; } diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 7386c6e..76da457 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -386,7 +386,14 @@ void RTFDocVisitor::visit(DocInclude *inc) inc->text(), langExt, inc->isExample(), - inc->exampleFile(), &fd); + inc->exampleFile(), + &fd, // fileDef, + -1, // start line + -1, // end line + FALSE, // inline fragment + 0, // memberDef + TRUE // show line numbers + ); m_t << "\\par"; m_t << "}" << endl; } @@ -398,7 +405,14 @@ void RTFDocVisitor::visit(DocInclude *inc) Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text(),langExt,inc->isExample(), - inc->exampleFile()); + inc->exampleFile(), + 0, // fileDef + -1, // startLine + -1, // endLine + TRUE, // inlineFragment + 0, // memberDef + FALSE // show line numbers + ); m_t << "\\par"; m_t << "}" << endl; break; @@ -430,6 +444,11 @@ void RTFDocVisitor::visit(DocInclude *inc) ); m_t << "}"; break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } m_lastIsPara=TRUE; } diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index a3f157f..053d450 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -1986,50 +1986,67 @@ void RTFGenerator::endMemberList() void RTFGenerator::startDescTable(const char *title) { DBG_RTF(t << "{\\comment (startDescTable) }" << endl) - startSimpleSect(EnumValues,0,0,title); - startDescForItem(); - //t << "{" << endl; - //incrementIndentLevel(); - //t << rtf_Style_Reset << rtf_CList_DepthStyle(); + t << "{\\par" << endl; + t << "{" << rtf_Style["Heading5"]->reference << endl; + docify(title); + t << ":\\par}" << endl; + t << rtf_Style_Reset << rtf_DList_DepthStyle(); + t << "\\trowd \\trgaph108\\trleft426\\tblind426" + "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 " + "\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 " + "\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 " + "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 " + "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 " + "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl; + int i,columnPos[2] = { 25, 100 }; + for (i=0;i<2;i++) + { + t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 " + "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 " + "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 " + "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 " + "\\cltxlrtb " + "\\cellx" << (rtf_pageWidth*columnPos[i]/100) << endl; + } + t << "\\pard \\widctlpar\\intbl\\adjustright" << endl; } void RTFGenerator::endDescTable() { - //decrementIndentLevel(); DBG_RTF(t << "{\\comment (endDescTable)}" << endl) - endDescForItem(); - endSimpleSect(); - //t << "}" << endl; - //t << rtf_Style_Reset << styleStack.top(); + t << "}" << endl; +} + +void RTFGenerator::startDescTableRow() +{ +} + +void RTFGenerator::endDescTableRow() +{ } void RTFGenerator::startDescTableTitle() { - //t << rtf_BList_DepthStyle() << endl; DBG_RTF(t << "{\\comment (startDescTableTitle) }" << endl) - startBold(); - startEmphasis(); + t << "{\\qr "; } void RTFGenerator::endDescTableTitle() { DBG_RTF(t << "{\\comment (endDescTableTitle) }" << endl) - endEmphasis(); - endBold(); - t << " "; + t << "\\cell }"; } void RTFGenerator::startDescTableData() { DBG_RTF(t << "{\\comment (startDescTableData) }" << endl) - m_omitParagraph = FALSE; + t << "{"; } void RTFGenerator::endDescTableData() { DBG_RTF(t << "{\\comment (endDescTableData) }" << endl) - newParagraph(); - m_omitParagraph = TRUE; + t << "\\cell }{\\row }" << endl; } // a style for list formatted as a "bulleted list" @@ -2906,12 +2923,20 @@ void RTFGenerator::endInlineHeader() t << "}" << endl; } -void RTFGenerator::startMemberDocSimple() +void RTFGenerator::startMemberDocSimple(bool isEnum) { DBG_RTF(t << "{\\comment (startMemberDocSimple)}" << endl) t << "{\\par" << endl; t << "{" << rtf_Style["Heading5"]->reference << endl; - t << theTranslator->trCompoundMembers() << ":\\par}" << endl; + if (isEnum) + { + t << theTranslator->trEnumerationValues(); + } + else + { + t << theTranslator->trCompoundMembers(); + } + t << ":\\par}" << endl; t << rtf_Style_Reset << rtf_DList_DepthStyle(); t << "\\trowd \\trgaph108\\trleft426\\tblind426" "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 " @@ -2920,8 +2945,14 @@ void RTFGenerator::startMemberDocSimple() "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 " "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 " "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< endl; - int i,columnPos[3] = { 25, 50, 100 }; - for (i=0;i<3;i++) + int i,n=3,columnPos[3] = { 25, 50, 100 }; + if (isEnum) + { + columnPos[0]=30; + columnPos[1]=100; + n=2; + } + for (i=0;i<n;i++) { t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 " "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 " @@ -2933,7 +2964,7 @@ void RTFGenerator::startMemberDocSimple() t << "\\pard \\widctlpar\\intbl\\adjustright" << endl; } -void RTFGenerator::endMemberDocSimple() +void RTFGenerator::endMemberDocSimple(bool) { DBG_RTF(t << "{\\comment (endMemberDocSimple)}" << endl) t << "}" << endl; diff --git a/src/rtfgen.h b/src/rtfgen.h index abf9549..27dd490 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -193,6 +193,8 @@ class RTFGenerator : public OutputGenerator void startDescTable(const char *title); void endDescTable(); + void startDescTableRow(); + void endDescTableRow(); void startDescTableTitle(); void endDescTableTitle(); void startDescTableData(); @@ -242,8 +244,8 @@ class RTFGenerator : public OutputGenerator void endConstraintDocs(); void endConstraintList(); - void startMemberDocSimple(); - void endMemberDocSimple(); + void startMemberDocSimple(bool); + void endMemberDocSimple(bool); void startInlineMemberType(); void endInlineMemberType(); void startInlineMemberName(); diff --git a/src/util.cpp b/src/util.cpp index 1f49fb3..efd3d3c 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -7132,6 +7132,9 @@ void initDefaultExtensionMapping() updateLanguageMapping(".f", "fortran"); updateLanguageMapping(".for", "fortran"); updateLanguageMapping(".f90", "fortran"); + updateLanguageMapping(".f95", "fortran"); + updateLanguageMapping(".f03", "fortran"); + updateLanguageMapping(".f08", "fortran"); updateLanguageMapping(".vhd", "vhdl"); updateLanguageMapping(".vhdl", "vhdl"); updateLanguageMapping(".tcl", "tcl"); @@ -8082,6 +8085,7 @@ bool copyFile(const QCString &src,const QCString &dest) /** Returns the section of text, in between a pair of markers. * Full lines are returned, excluding the lines on which the markers appear. + * \sa routine lineBlock */ QCString extractBlock(const QCString text,const QCString marker) { @@ -8125,6 +8129,29 @@ QCString extractBlock(const QCString text,const QCString marker) return l2>l1 ? text.mid(l1,l2-l1) : QCString(); } +/** Returns the line number of the line following the line with the marker. + * \sa routine extractBlock + */ +int lineBlock(const QCString text,const QCString marker) +{ + int result = 1; + int p=0,i; + bool found=FALSE; + + // find the character positions of the first marker + int m1 = text.find(marker); + if (m1==-1) return result; + + // find start line positions for the markers + while (!found && (i=text.find('\n',p))!=-1) + { + found = (p<=m1 && m1<i); // found the line with the start marker + p=i+1; + result++; + } + return result; +} + /** Returns a string representation of \a lang. */ QCString langToString(SrcLangExt lang) { @@ -445,6 +445,7 @@ QCString replaceColorMarkers(const char *str); bool copyFile(const QCString &src,const QCString &dest); QCString extractBlock(const QCString text,const QCString marker); +int lineBlock(const QCString text,const QCString marker); QCString correctURL(const QCString &url,const QCString &relPath); diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 380a39b..b0d6551 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -272,7 +272,14 @@ void XmlDocVisitor::visit(DocInclude *inc) inc->text(), langExt, inc->isExample(), - inc->exampleFile(), &fd); + inc->exampleFile(), + &fd, // fileDef, + -1, // start line + -1, // end line + FALSE, // inline fragment + 0, // memberDef + TRUE // show line numbers + ); m_t << "</programlisting>"; } break; @@ -283,7 +290,14 @@ void XmlDocVisitor::visit(DocInclude *inc) inc->text(), langExt, inc->isExample(), - inc->exampleFile()); + inc->exampleFile(), + 0, // fileDef + -1, // startLine + -1, // endLine + TRUE, // inlineFragment + 0, // memberDef + FALSE // show line numbers + ); m_t << "</programlisting>"; break; case DocInclude::DontInclude: @@ -315,6 +329,11 @@ void XmlDocVisitor::visit(DocInclude *inc) ); m_t << "</programlisting>"; break; + case DocInclude::SnippetDoc: + case DocInclude::IncludeDoc: + err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s" + "Please create a bug report\n",__FILE__); + break; } } diff --git a/templates/html/navtree.css b/templates/html/navtree.css index d6b54b5..7d1cb67 100644 --- a/templates/html/navtree.css +++ b/templates/html/navtree.css @@ -96,7 +96,7 @@ .ui-resizable-e { background-image:url("splitbar.png"); background-size:100%; - background-repeat:no-repeat + background-repeat:no-repeat; background-attachment: scroll; cursor:ew-resize; height:100%; diff --git a/templates/html/resize.js b/templates/html/resize.js index 2066667..6d78f5b 100644 --- a/templates/html/resize.js +++ b/templates/html/resize.js @@ -92,11 +92,10 @@ function initResizable() $(sidenav).resizable({ minWidth: 0 }); $(window).resize(function() { resizeHeight(); }); var device = navigator.userAgent.toLowerCase(); - var ios_or_android = device.match(/(iphone|ipod|ipad|android)/); - if (ios_or_android) { /* wider split bar for touch only devices */ + var touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ $(sidenav).css({ paddingRight:'20px' }); $('.ui-resizable-e').css({ width:'20px' }); - console.log('ui='+$('.ui-resizable-e').width()); $('#nav-sync').css({ right:'34px' }); barWidth=20; } @@ -108,20 +107,6 @@ function initResizable() var _preventDefault = function(evt) { evt.preventDefault(); }; $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); $(".ui-resizable-handle").dblclick(collapseExpand); - $(document).bind('touchmove',function(e){ - if (ios_or_android) { - try { - var target = e.target; - while (target) { - if ($(target).css('-webkit-overflow-scrolling')=='touch') return; - target = target.parentNode; - } - e.preventDefault(); - } catch(err) { - e.preventDefault(); - } - } - }); $(window).load(resizeHeight); } diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty index 67860e0..2510b41 100644 --- a/templates/latex/doxygen.sty +++ b/templates/latex/doxygen.sty @@ -305,6 +305,22 @@ \vspace{6pt}% } +% Used for fields simple class style enums +\newenvironment{DoxyEnumFields}[1]{% + \tabulinesep=1mm% + \par% + \begin{longtabu} spread 0pt [l]{|X[-1,r]|X[-1,l]|}% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endfirsthead% + \multicolumn{2}{l}{\hspace{-6pt}\bfseries\fontseries{bc}\selectfont\color{darkgray} #1}\\[1ex]% + \hline% + \endhead% +}{% + \end{longtabu}% + \vspace{6pt}% +} + % Used for parameters within a detailed function description \newenvironment{DoxyParamCaption}{% \renewcommand{\item}[2][]{\\ \hspace*{2.0cm} ##1 {\em ##2}}% |