diff options
-rw-r--r-- | src/htmldocvisitor.cpp | 8 | ||||
-rw-r--r-- | src/msc.cpp | 44 | ||||
-rw-r--r-- | src/msc.h | 6 |
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; @@ -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 |