diff options
Diffstat (limited to 'src/htmldocvisitor.cpp')
-rw-r--r-- | src/htmldocvisitor.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 8ee8c62..601b665 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -28,6 +28,7 @@ #include "htmlgen.h" #include "parserintf.h" #include "msc.h" +#include "dia.h" #include "util.h" #include "vhdldocgen.h" #include "filedef.h" @@ -1546,6 +1547,26 @@ void HtmlDocVisitor::visitPost(DocMscFile *df) m_t << "</div>" << endl; } +void HtmlDocVisitor::visitPre(DocDiaFile *df) +{ + if (m_hide) return; + m_t << "<div class=\"diagraph\">" << endl; + writeDiaFile(df->file(),df->relPath(),df->context()); + if (df->hasCaption()) + { + m_t << "<div class=\"caption\">" << endl; + } +} +void HtmlDocVisitor::visitPost(DocDiaFile *df) +{ + if (m_hide) return; + if (df->hasCaption()) + { + m_t << "</div>" << endl; + } + m_t << "</div>" << endl; +} + void HtmlDocVisitor::visitPre(DocLink *lnk) { if (m_hide) return; @@ -2011,6 +2032,27 @@ void HtmlDocVisitor::writeMscFile(const QCString &fileName, writeMscImageMapFromFile(m_t,fileName,outDir,relPath,baseName,context); } +void HtmlDocVisitor::writeDiaFile(const QCString &fileName, + const QCString &, + const QCString &) +{ + QCString baseName=fileName; + int i; + if ((i=baseName.findRev('/'))!=-1) // strip path + { + baseName=baseName.right(baseName.length()-i-1); + } + if ((i=baseName.find('.'))!=-1) // strip extension + { + baseName=baseName.left(i); + } + baseName.prepend("dia_"); + QCString outDir = Config_getString("HTML_OUTPUT"); + writeDiaGraphFromFile(fileName,outDir,baseName,DIA_BITMAP); + + m_t << "<img src=\"" << outDir << '/' << baseName << ".png" << "\" />" << endl; +} + /** Used for items found inside a paragraph, which due to XHTML restrictions * have to be outside of the paragraph. This method will forcefully end * the current paragraph and forceStartParagraph() will restart it. |