diff options
Diffstat (limited to 'src/dot.cpp')
-rw-r--r-- | src/dot.cpp | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/src/dot.cpp b/src/dot.cpp index 66ec988..e72bf45 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -537,11 +537,12 @@ static bool readSVGSize(const QCString &fileName,int *width,int *height) if (numBytes>0) { buf[numBytes]='\0'; - if (strncmp(buf,"<!--zoomable-->",15)==0) + if (strncmp(buf,"<!--zoomable ",13)==0) { - //printf("Found zoomable for %s!\n",fileName.data()); *width=-1; *height=-1; + sscanf(buf,"<!--zoomable %d",height); + //printf("Found zoomable for %s!\n",fileName.data()); found=TRUE; } else if (sscanf(buf,"<svg width=\"%dpt\" height=\"%dpt\"",width,height)==2) @@ -569,18 +570,23 @@ static void writeSVGNotSupported(FTextStream &out) static bool writeSVGFigureLink(FTextStream &out,const QCString &relPath, const QCString &baseName,const QCString &absImgName) { - int width=600,height=450; + int width=600,height=600; if (!readSVGSize(absImgName,&width,&height)) { return FALSE; } - if (width==-1 && height==-1) + if (width==-1) { + if (height<=60) + height=60; + else + height+=40; // add some extra space for zooming + if (height>600) height=600; // clip to maximum height of 600 pixels out << "<div class=\"zoom\">"; //out << "<object type=\"image/svg+xml\" data=\"" //out << "<embed type=\"image/svg+xml\" src=\"" out << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" - << relPath << baseName << ".svg\" width=\"100%\" height=\"600\">"; + << relPath << baseName << ".svg\" width=\"100%\" height=\"" << height << "\">"; } else { @@ -595,7 +601,7 @@ static bool writeSVGFigureLink(FTextStream &out,const QCString &relPath, //out << "</object>"; //out << "</embed>"; out << "</iframe>"; - if (width==-1 && height==-1) + if (width==-1) { out << "</div>"; } @@ -959,7 +965,7 @@ bool DotFilePatcher::run() if (foundSize) { // insert special replacement header for interactive SVGs - t << "<!--zoomable-->\n"; + t << "<!--zoomable " << height << " -->\n"; t << svgZoomHeader; t << "var viewWidth = " << width << ";\n"; t << "var viewHeight = " << height << ";\n"; @@ -1492,7 +1498,6 @@ static QCString convertLabel(const QCString &l) return result; } -#if 0 static QCString escapeTooltip(const QCString &tooltip) { QCString result; @@ -1503,13 +1508,12 @@ static QCString escapeTooltip(const QCString &tooltip) { switch(c) { - case '\\': result+="\\\\"; break; - default: result+=c; break; + case '"': result+="\\\""; break; + default: result+=c; break; } } return result; } -#endif static void writeBoxMemberList(FTextStream &t, char prot,MemberList *ml,ClassDef *scope, @@ -1653,7 +1657,7 @@ void DotNode::writeBox(FTextStream &t, } if (!m_tooltip.isEmpty()) { - t << ",tooltip=\"" << /*escapeTooltip(m_tooltip)*/ m_tooltip << "\""; + t << ",tooltip=\"" << escapeTooltip(m_tooltip) << "\""; } } t << "];" << endl; @@ -2010,6 +2014,9 @@ void DotGfxHierarchyTable::writeGraph(FTextStream &out, { //printf("DotGfxHierarchyTable::writeGraph(%s)\n",name); //printf("m_rootNodes=%p count=%d\n",m_rootNodes,m_rootNodes->count()); + + static bool vhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); + if (m_rootSubgraphs->count()==0) return; QDir d(path); @@ -2028,6 +2035,18 @@ void DotGfxHierarchyTable::writeGraph(FTextStream &out, for (dnli.toFirst();(n=dnli.current());++dnli) { QCString baseName; + + if (vhdl) + { + QCString l=n->m_url; + l=VhdlDocGen::convertFileNameToClassName(l); + ClassDef *cd=Doxygen::classSDict->find(l); + if (cd==0) continue; + // only entities are shown + if ((VhdlDocGen::VhdlClasses)cd->protection()!=VhdlDocGen::ENTITYCLASS) + continue; + } + QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); baseName.sprintf("inherit_graph_%d",count++); //baseName = convertNameToFile(baseName); |