summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-12-24 09:08:33 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-12-24 09:08:33 (GMT)
commit1e8704925f5f41d53079e8c486b1072a1cd2bab5 (patch)
tree2b76ee16440e7b7380bd4278f241824b441289f0 /src
parent31527356a50262ede3564156550260526d8470e2 (diff)
parentb834da5a44887e477d0bdd36f84ac5cf7c94577d (diff)
downloadDoxygen-1e8704925f5f41d53079e8c486b1072a1cd2bab5.zip
Doxygen-1e8704925f5f41d53079e8c486b1072a1cd2bab5.tar.gz
Doxygen-1e8704925f5f41d53079e8c486b1072a1cd2bab5.tar.bz2
Merge branch 'master' of github.com:doxygen/doxygen
Diffstat (limited to 'src')
-rw-r--r--src/htmldocvisitor.cpp8
-rw-r--r--src/msc.cpp44
-rw-r--r--src/msc.h6
3 files changed, 44 insertions, 14 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 815a16d..6ccbda4 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -2031,8 +2031,12 @@ void HtmlDocVisitor::writeMscFile(const QCString &fileName,
}
baseName.prepend("msc_");
QCString outDir = Config_getString("HTML_OUTPUT");
- writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP);
- writeMscImageMapFromFile(m_t,fileName,outDir,relPath,baseName,context);
+ QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
+ MscOutputFormat mscFormat = MSC_BITMAP;
+ if ("svg" == imgExt)
+ mscFormat = MSC_SVG;
+ writeMscGraphFromFile(fileName,outDir,baseName,mscFormat);
+ writeMscImageMapFromFile(m_t,fileName,outDir,relPath,baseName,context,mscFormat);
}
void HtmlDocVisitor::writeDiaFile(const QCString &fileName,
diff --git a/src/msc.cpp b/src/msc.cpp
index 069bcdd..3592e76 100644
--- a/src/msc.cpp
+++ b/src/msc.cpp
@@ -103,15 +103,22 @@ void writeMscGraphFromFile(const char *inFile,const char *outDir,
QCString mscExe = Config_getString("MSCGEN_PATH")+"mscgen"+portable_commandExtension();
QCString mscArgs;
QCString extension;
- if (format==MSC_BITMAP)
+ switch (format)
{
- mscArgs+="-T png";
- extension=".png";
- }
- else if (format==MSC_EPS)
- {
- mscArgs+="-T eps";
- extension=".eps";
+ case MSC_BITMAP:
+ mscArgs+="-T png";
+ extension=".png";
+ break;
+ case MSC_EPS:
+ mscArgs+="-T eps";
+ extension=".eps";
+ break;
+ case MSC_SVG:
+ mscArgs+="-T svg";
+ extension=".svg";
+ break;
+ default:
+ goto error; // I am not very fond of goto statements, but when in Rome...
}
mscArgs+=" -i \"";
mscArgs+=inFile;
@@ -188,11 +195,28 @@ void writeMscImageMapFromFile(FTextStream &t,const QCString &inFile,
const QCString &outDir,
const QCString &relPath,
const QCString &baseName,
- const QCString &context)
+ const QCString &context,
+ MscOutputFormat format
+ )
{
QCString mapName = baseName+".map";
QCString mapFile = inFile+".map";
- t << "<img src=\"" << relPath << baseName << ".png\" alt=\""
+ t << "<img src=\"" << relPath << baseName << ".";
+ switch (format)
+ {
+ case MSC_BITMAP:
+ t << "png";
+ break;
+ case MSC_EPS:
+ t << "eps";
+ break;
+ case MSC_SVG:
+ t << "svg";
+ break;
+ default:
+ t << "unknown";
+ }
+ t << "\" alt=\""
<< baseName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>" << endl;
QCString imap = getMscImageMapFromFile(inFile,outDir,relPath,context);
t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>" << endl;
diff --git a/src/msc.h b/src/msc.h
index 711e3de..961f544 100644
--- a/src/msc.h
+++ b/src/msc.h
@@ -21,7 +21,7 @@
class QCString;
class FTextStream;
-enum MscOutputFormat { MSC_BITMAP , MSC_EPS };
+enum MscOutputFormat { MSC_BITMAP , MSC_EPS, MSC_SVG };
void writeMscGraphFromFile(const char *inFile,const char *outDir,
const char *outFile,MscOutputFormat format);
@@ -31,7 +31,9 @@ QCString getMscImageMapFromFile(const QCString& inFile, const QCString& outDir,
void writeMscImageMapFromFile(FTextStream &t,const QCString &inFile,
const QCString &outDir, const QCString &relPath,
- const QCString &baseName, const QCString &context);
+ const QCString &baseName, const QCString &context,
+ MscOutputFormat format
+ );
#endif