summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2007-04-04 19:15:20 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2007-04-04 19:15:20 (GMT)
commitbd691d38fe61aed85189a6675668a67deefd8002 (patch)
tree7f7bcc4353ffd2147b592358b06865a518c14d7b /src
parent97a3911e2682bfebeebbb8999c9e3844c414c3e0 (diff)
downloadDoxygen-bd691d38fe61aed85189a6675668a67deefd8002.zip
Doxygen-bd691d38fe61aed85189a6675668a67deefd8002.tar.gz
Doxygen-bd691d38fe61aed85189a6675668a67deefd8002.tar.bz2
Release-1.5.2
Diffstat (limited to 'src')
-rw-r--r--src/commentcnv.l20
-rw-r--r--src/config.l22
-rw-r--r--src/docparser.cpp2
-rw-r--r--src/dot.cpp15
-rw-r--r--src/ftvhelp.cpp6
-rw-r--r--src/htmldocvisitor.cpp2
-rw-r--r--src/latexgen.cpp32
-rw-r--r--src/latexgen.h6
-rw-r--r--src/scanner.l22
-rw-r--r--src/translator_jp.h4
-rw-r--r--src/xmlgen.cpp6
11 files changed, 109 insertions, 28 deletions
diff --git a/src/commentcnv.l b/src/commentcnv.l
index 238e56b..9462110 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -263,12 +263,11 @@ void replaceComment(int offset);
%}
-CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
-
%option noyywrap
%x Scan
%x SkipString
+%x SkipChar
%x SComment
%x CComment
%x Verbatim
@@ -285,8 +284,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
copyToOutput(yytext,yyleng);
BEGIN(SkipString);
}
-<Scan>{CHARLIT} {
+<Scan>' {
copyToOutput(yytext,yyleng);
+ BEGIN(SkipChar);
}
<Scan>\n { /* new line */
copyToOutput(yytext,yyleng);
@@ -398,6 +398,20 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^' \\\n]{1,4}"'"))
<SkipString>\n { /* new line inside string (illegal for some compilers) */
copyToOutput(yytext,yyleng);
}
+<SkipChar>\\. { /* escaped character */
+ copyToOutput(yytext,yyleng);
+ }
+<SkipChar>' { /* end of character literal */
+ copyToOutput(yytext,yyleng);
+ BEGIN(Scan);
+ }
+<SkipChar>. { /* any other string character */
+ copyToOutput(yytext,yyleng);
+ }
+<SkipChar>\n { /* new line character */
+ copyToOutput(yytext,yyleng);
+ }
+
<CComment>[^\\@*\n]* { /* anything that is not a '*' or command */
copyToOutput(yytext,yyleng);
}
diff --git a/src/config.l b/src/config.l
index b1ea378..26fb9b9 100644
--- a/src/config.l
+++ b/src/config.l
@@ -384,7 +384,7 @@ static void checkEncoding()
static FILE *tryPath(const char *path,const char *fileName)
{
- QCString absName=(QCString)path+"/"+fileName;
+ QCString absName=(path ? (QCString)path+"/"+fileName : (QCString)fileName);
QFileInfo fi(absName);
if (fi.exists() && fi.isFile())
{
@@ -398,8 +398,27 @@ static FILE *tryPath(const char *path,const char *fileName)
static void substEnvVarsInStrList(QStrList &sl);
static void substEnvVarsInString(QCString &s);
+static bool isAbsolute(const char * fileName)
+{
+# ifdef _WIN32
+ if (isalpha (fileName [0]) && fileName[1] == ':')
+ fileName += 2;
+# endif
+ char const fst = fileName [0];
+ if (fst == '/') {
+ return true;
+ }
+# ifdef _WIN32
+ if (fst == '\\')
+ return true;
+# endif
+ return false;
+}
+
static FILE *findFile(const char *fileName)
{
+ if(isAbsolute(fileName))
+ return tryPath(NULL, fileName);
substEnvVarsInStrList(includePathList);
char *s=includePathList.first();
while (s) // try each of the include paths
@@ -431,7 +450,6 @@ static void readIncludeFile(const char *incName)
FILE *f;
- //printf("Searching for `%s'\n",incFileName.data());
if ((f=findFile(inc))) // see if the include file can be found
{
// For debugging
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 2dc29a5..e1bfac5 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1316,7 +1316,7 @@ DocSymbol::SymType DocSymbol::decodeSymbol(const QString &symName,char *letter)
int l=symName.length();
DBG(("decodeSymbol(%s) l=%d\n",symName.data(),l));
if (symName=="&copy;") return DocSymbol::Copy;
- else if (symName=="&tm;") return DocSymbol::Tm;
+ else if (symName=="&trade;") return DocSymbol::Tm;
else if (symName=="&reg;") return DocSymbol::Reg;
else if (symName=="&lt;") return DocSymbol::Less;
else if (symName=="&gt;") return DocSymbol::Greater;
diff --git a/src/dot.cpp b/src/dot.cpp
index dae373c..651b6c9 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -2116,7 +2116,8 @@ QCString DotClassGraph::writeGraph(QTextStream &out,
return baseName;
}
int maxWidth = 420; /* approx. page width in points */
- out << "\\begin{figure}[H]\n"
+ out << "\\nopagebreak\n"
+ "\\begin{figure}[H]\n"
"\\begin{center}\n"
"\\leavevmode\n"
"\\includegraphics[width=" << QMIN(width/2,maxWidth)
@@ -2410,7 +2411,8 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out,
}
int maxWidth = 420; /* approx. page width in points */
- out << "\\begin{figure}[H]\n"
+ out << "\\nopagebreak\n"
+ "\\begin{figure}[H]\n"
"\\begin{center}\n"
"\\leavevmode\n"
"\\includegraphics[width=" << QMIN(width/2,maxWidth)
@@ -2689,7 +2691,8 @@ QCString DotCallGraph::writeGraph(QTextStream &out, GraphOutputFormat format,
}
int maxWidth = 420; /* approx. page width in points */
- out << "\\begin{figure}[H]\n"
+ out << "\\nopagebreak\n"
+ "\\begin{figure}[H]\n"
"\\begin{center}\n"
"\\leavevmode\n"
"\\includegraphics[width=" << QMIN(width/2,maxWidth)
@@ -2825,7 +2828,8 @@ QCString DotDirDeps::writeGraph(QTextStream &out,
}
int maxWidth = 420; /* approx. page width in points */
- out << "\\begin{figure}[H]\n"
+ out << "\\nopagebreak\n"
+ "\\begin{figure}[H]\n"
"\\begin{center}\n"
"\\leavevmode\n"
"\\includegraphics[width=" << QMIN(width/2,maxWidth)
@@ -3317,7 +3321,8 @@ QCString DotGroupCollaboration::writeGraph( QTextStream &t, GraphOutputFormat fo
return baseName;
}
int maxWidth = 420; /* approx. page width in points */
- t << "\\begin{figure}[H]\n"
+ t << "\\nopagebreak\n"
+ "\\begin{figure}[H]\n"
"\\begin{center}\n"
"\\leavevmode\n"
"\\includegraphics[width=" << QMIN(width/2,maxWidth)
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index 5be662d..81ea4e0 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -596,8 +596,7 @@ void FTVHelp::generateTreeView()
#endif
t << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
t << "<html><head>";
- t << "<meta http-equiv=\"Content-Type\" content=\"text/html;charset="
- << theTranslator->idLanguageCharset() << "\">\n";
+ t << "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n";
t << "<title>";
if (Config_getString("PROJECT_NAME").isEmpty())
{
@@ -635,8 +634,7 @@ void FTVHelp::generateTreeView()
#endif
t << "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
t << " <head>\n";
- t << " <meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset="
- << theTranslator->idLanguageCharset() << "\" />\n";
+ t << " <meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\" />\n";
t << " <meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n";
t << " <meta http-equiv=\"Content-Language\" content=\"en\" />\n";
t << " <link rel=\"stylesheet\" href=\"";
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index e7910b5..2b8d88d 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -102,7 +102,7 @@ void HtmlDocVisitor::visit(DocSymbol *s)
case DocSymbol::Hash: m_t << "#"; break;
case DocSymbol::Percent: m_t << "%"; break;
case DocSymbol::Copy: m_t << "&copy;"; break;
- case DocSymbol::Tm: m_t << "&tm;"; break;
+ case DocSymbol::Tm: m_t << "&trade;"; break;
case DocSymbol::Reg: m_t << "&reg;"; break;
case DocSymbol::Apos: m_t << "'"; break;
case DocSymbol::Quot: m_t << "\""; break;
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index d93b503..a64ad22 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -102,7 +102,9 @@ LatexGenerator::LatexGenerator() : OutputGenerator()
//printf("LatexGenerator::LatexGenerator() insideTabbing=FALSE\n");
insideTabbing=FALSE;
firstDescItem=TRUE;
+ disableLinks=FALSE;
m_indent=0;
+ templateMemberItem = FALSE;
}
LatexGenerator::~LatexGenerator()
@@ -974,7 +976,7 @@ void LatexGenerator::endIndexValue(const char *name,bool hasBrief)
void LatexGenerator::startTextLink(const char *f,const char *anchor)
{
- if (Config_getBool("PDF_HYPERLINKS"))
+ if (!disableLinks && Config_getBool("PDF_HYPERLINKS"))
{
t << "\\hyperlink{";
if (f) t << stripPath(f);
@@ -995,7 +997,7 @@ void LatexGenerator::endTextLink()
void LatexGenerator::writeObjectLink(const char *ref, const char *f,
const char *anchor, const char *text)
{
- if (!ref && Config_getBool("PDF_HYPERLINKS"))
+ if (!disableLinks && !ref && Config_getBool("PDF_HYPERLINKS"))
{
t << "\\hyperlink{";
if (f) t << stripPath(f);
@@ -1088,10 +1090,12 @@ void LatexGenerator::startGroupHeader()
{
t << "\\subsection{";
}
+ disableLinks=TRUE;
}
void LatexGenerator::endGroupHeader()
{
+ disableLinks=FALSE;
t << "}" << endl;
}
@@ -1105,10 +1109,12 @@ void LatexGenerator::startMemberHeader()
{
t << "\\subsection*{";
}
+ disableLinks=TRUE;
}
void LatexGenerator::endMemberHeader()
{
+ disableLinks=FALSE;
t << "}" << endl;
}
@@ -1149,10 +1155,12 @@ void LatexGenerator::startMemberDoc(const char *clname,
// t << "]";
//}
t << "{\\setlength{\\rightskip}{0pt plus 5cm}";
+ disableLinks=TRUE;
}
void LatexGenerator::endMemberDoc(bool)
{
+ disableLinks=FALSE;
t << "}";
if (Config_getBool("COMPACT_LATEX")) t << "\\hfill";
}
@@ -1351,12 +1359,29 @@ void LatexGenerator::endAnonTypeScope(int indent)
}
}
-void LatexGenerator::startMemberItem(int)
+void LatexGenerator::startMemberTemplateParams()
+{
+ if (templateMemberItem)
+ {
+ t << "{\\footnotesize ";
+ }
+}
+
+void LatexGenerator::endMemberTemplateParams()
+{
+ if (templateMemberItem)
+ {
+ t << "}\\\\";
+ }
+}
+
+void LatexGenerator::startMemberItem(int annoType)
{
//printf("LatexGenerator::startMemberItem(%d)\n",annType);
if (!insideTabbing)
{
t << "\\item " << endl;
+ templateMemberItem = (annoType == 3);
}
}
@@ -1366,6 +1391,7 @@ void LatexGenerator::endMemberItem()
{
t << "\\\\";
}
+ templateMemberItem = FALSE;
t << endl;
}
diff --git a/src/latexgen.h b/src/latexgen.h
index e4e4378..214256f 100644
--- a/src/latexgen.h
+++ b/src/latexgen.h
@@ -103,8 +103,8 @@ class LatexGenerator : public OutputGenerator
void endAnonTypeScope(int);
void startMemberItem(int);
void endMemberItem();
- void startMemberTemplateParams() {}
- void endMemberTemplateParams() {}
+ void startMemberTemplateParams();
+ void endMemberTemplateParams();
void startMemberGroupHeader(bool);
void endMemberGroupHeader();
@@ -222,8 +222,10 @@ class LatexGenerator : public OutputGenerator
int col;
bool insideTabbing;
bool firstDescItem;
+ bool disableLinks;
QCString relPath;
int m_indent;
+ bool templateMemberItem;
};
#endif
diff --git a/src/scanner.l b/src/scanner.l
index e4180dc..d3ad412 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -552,6 +552,7 @@ ATTR ({B}+[^>\n]*)?
A [aA]
BR [bB][rR]
PRE [pP][rR][eE]
+CODE [cC][oO][dD][eE]
TABLE [tT][aA][bB][lL][eE]
P [pP]
UL [uU][lL]
@@ -4709,6 +4710,18 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
docBlockName=&yytext[1];
BEGIN(DocCopyBlock);
}
+<DocBlock>{B}*"<code>" {
+ if (insideCS)
+ {
+ docBlock+=yytext;
+ docBlockName="<code>";
+ BEGIN(DocCopyBlock);
+ }
+ else
+ {
+ REJECT;
+ }
+ }
<DocBlock>[^@*\/\\\n]+ { // any character that isn't special
docBlock+=yytext;
}
@@ -4729,6 +4742,13 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
BEGIN(DocBlock);
}
}
+<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
+ docBlock+=yytext;
+ if (docBlockName=="<code>")
+ {
+ BEGIN(DocBlock);
+ }
+ }
<DocCopyBlock>[\\@]("f$"|"f]"|"f}") {
docBlock+=yytext;
BEGIN(DocBlock);
@@ -4746,7 +4766,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
REJECT;
}
}
-<DocCopyBlock>[^@/*\]\$\\\n]+ { // any character that is not special
+<DocCopyBlock>[^\<@/*\]\$\\\n]+ { // any character that is not special
docBlock+=yytext;
}
<DocCopyBlock>"/*"|"*/"|"//" {
diff --git a/src/translator_jp.h b/src/translator_jp.h
index ff226d8..c9a5d29 100644
--- a/src/translator_jp.h
+++ b/src/translator_jp.h
@@ -1573,14 +1573,14 @@ class TranslatorJapanese : public Translator
virtual QCString trCallerGraph()
{
// return "Here is the caller graph for this function:";
- return "呼出しグラフ:";
+ return decode("呼出しグラフ:");
}
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for enumeration values
*/
virtual QCString trEnumerationValueDocumentation()
- { return "列挙型"; }
+ { return decode("列挙型"); }
};
#endif
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index e0ef129..1cc8375 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -142,8 +142,7 @@ inline void writeXMLCodeString(QTextStream &t,const char *s, int &col)
static void writeXMLHeader(QTextStream &t)
{
- t << "<?xml version='1.0' encoding='" << theTranslator->idLanguageCharset()
- << "' standalone='no'?>" << endl;;
+ t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"compound.xsd\" ";
t << "version=\"" << versionString << "\">" << endl;
@@ -1877,8 +1876,7 @@ void generateXML()
t.setEncoding(QTextStream::Latin1);
// write index header
- t << "<?xml version='1.0' encoding='" << theTranslator->idLanguageCharset()
- << "' standalone='no'?>" << endl;;
+ t << "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" << endl;;
t << "<doxygenindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" ";
t << "version=\"" << versionString << "\">" << endl;