44 static char hex[] =
"0123456789abcdef";
46 const char *str = word.data();
52 if ((c >=
'a' && c <=
'z') ||
53 (c >=
'A' && c <=
'Z') ||
54 (c >=
'0' && c <=
'9') ||
66 enc[1] = hex[(c & 0xf0) >> 4];
67 enc[2] = hex[c & 0xf];
134 for (li.toFirst();(att=li.current());++li)
136 if (!att->
value.isEmpty())
152 m_hide(FALSE), m_ctx(ctx)
206 m_t <<
"<a href=\"#\" onclick=\"location.href='mai'+'lto:'";
209 for (i=0;i<url.length();)
211 m_t <<
"+'" << url.mid(i,size) <<
"'";
213 if (size==3) size=2;
else size=3;
215 m_t <<
"; return false;\">";
223 QCString url = u->
url();
226 for (i=0;i<url.length();)
229 if (i<url.length()-size)
m_t <<
"<span style=\"display: none;\">.nosp@m.</span>";
231 if (size==5) size=4;
else size=5;
331 t <<
"<div class=\"caption\">" <<
endl;
340 t <<
"</div>" <<
endl;
347 QListIterator<DocNode> cli(children);
349 for (cli.toFirst();(n=cli.current());++cli) n->
accept(parent);
387 m_t <<
"<pre class=\"fragment\">";
407 static int dotindex = 1;
408 QCString fileName(4096);
411 fileName.sprintf(
"%s%d%s",
416 QFile file(fileName);
417 if (!file.open(IO_WriteOnly))
419 err(
"Could not open file %s for writing\n",fileName.data());
423 file.writeBlock( s->
text(), s->
text().length() );
426 m_t <<
"<div align=\"center\">" <<
endl;
431 m_t <<
"</div>" <<
endl;
442 static int mscindex = 1;
443 QCString baseName(4096);
445 baseName.sprintf(
"%s%d",
449 QFile file(baseName+
".msc");
450 if (!file.open(IO_WriteOnly))
452 err(
"Could not open file %s.msc for writing\n",baseName.data());
456 QCString text =
"msc {";
460 file.writeBlock( text, text.length() );
463 m_t <<
"<div align=\"center\">" <<
endl;
468 m_t <<
"</div>" <<
endl;
481 m_t <<
"<div align=\"center\">" <<
endl;
486 m_t <<
"</div>" <<
endl;
496 m_t <<
"<a class=\"anchor\" id=\"" << anc->
anchor() <<
"\"></a>";
530 QFileInfo cfi( inc->
file() );
531 FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
560 m_t <<
"<pre class=\"fragment\">";
590 err(
"Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
591 "Please create a bug report\n",__FILE__);
650 m_t <<
"<p class=\"formulaDsp\">" <<
endl;
655 QCString text = f->
text();
656 bool closeInline = FALSE;
657 if (!bDisplay && !text.isEmpty() && text.at(0)==
'$' &&
658 text.at(text.length()-1)==
'$')
661 text = text.mid(1,text.length()-2);
672 m_t <<
"<img class=\"formula"
673 << (bDisplay ?
"Dsp" :
"Inl");
679 m_t <<
" src=\"" << f->
relPath() << f->
name() <<
".png\"/>";
696 m_t <<
"<a name=\"" << anchor <<
"\"></a>";
714 if (!cite->
file().isEmpty())
723 if (!cite->
file().isEmpty())
795 return parent->children().getFirst()==node;
801 return parent->children().getLast()==node;
806 QList<DocNode> nodes = parent->
children();
807 int i = nodes.findRef(par);
808 if (i==-1)
return FALSE;
809 int count = parent->
children().count();
817 else if (count>1 && i==count-1)
824 else if (count>2 && i>0 && i<count-1)
969 bool needsTag = FALSE;
1000 if (p && nodeIndex<p->children().count())
1002 while (nodeIndex<p->children().count() &&
1007 if (nodeIndex<p->children().count())
1021 static const char *contexts[7] =
1023 " class=\"startli\"",
1024 " class=\"startdd\"",
1027 " class=\"starttd\"",
1034 if (isFirst && isLast) needsTag=FALSE;
1038 if (needsTag)
m_t <<
"<p" << contexts[t] <<
">";
1043 bool needsTag = FALSE;
1073 int nodeIndex = p->
children().count()-1;
1094 if (isFirst && isLast) needsTag=FALSE;
1098 if (needsTag)
m_t <<
"</p>\n";
1114 m_t <<
"<dl class=\"section " << s->
typeString() <<
"\"><dt>";
1162 m_t <<
"</dd></dl>\n";
1211 m_t <<
"<a class=\"anchor\" id=\"" << s->
anchor();
1214 m_t <<
"</h" << s->
level() <<
">\n";
1310 m_t <<
"<a class=\"anchor\" id=\"" << t->
caption()->
anchor() <<
"\"></a>\n";
1314 if (attrs.isEmpty())
1316 m_t <<
"<table class=\"doxtable\">\n";
1327 m_t <<
"</table>\n";
1371 m_t <<
"</caption>\n";
1390 if (href->
url().left(7)==
"mailto:")
1419 m_t <<
"</h" << header->
level() <<
">\n";
1429 QString baseName=img->
name();
1431 if ((i=baseName.findRev(
'/'))!=-1 || (i=baseName.findRev(
'\\'))!=-1)
1433 baseName=baseName.right(baseName.length()-i-1);
1435 m_t <<
"<div class=\"image\">" <<
endl;
1436 QCString url = img->
url();
1437 QCString sizeAttribs;
1438 if (!img->
width().isEmpty())
1440 sizeAttribs+=
" width=\""+img->
width()+
"\"";
1442 if (!img->
height().isEmpty())
1444 sizeAttribs+=
" height=\""+img->
height()+
"\"";
1448 if (img->
name().right(4)==
".svg")
1450 m_t <<
"<object type=\"image/svg+xml\" data=\"" << img->
relPath() << img->
name()
1452 <<
"</object>" << endl;
1456 m_t <<
"<img src=\"" << img->
relPath() << img->
name() <<
"\" alt=\""
1463 if (url.right(4)==
".svg")
1477 m_t <<
"<div class=\"caption\">" <<
endl;
1508 m_t <<
"<div class=\"dotgraph\">" <<
endl;
1512 m_t <<
"<div class=\"caption\">" <<
endl;
1529 m_t <<
"<div class=\"mscgraph\">" <<
endl;
1533 m_t <<
"<div class=\"caption\">" <<
endl;
1549 m_t <<
"<div class=\"diagraph\">" <<
endl;
1553 m_t <<
"<div class=\"caption\">" <<
endl;
1581 if (!ref->
file().isEmpty())
1600 QString refName=ref->
file();
1606 m_t <<
"<li><a href=\"" << refName <<
"#" << ref->
anchor() <<
"\">";
1613 m_t <<
"</a></li>\n";
1620 m_t <<
"<div class=\"multicol\">" <<
endl;
1669 className=
"exception";
1673 className=
"tparams";
1678 m_t <<
"<dl class=\"" << className <<
"\"><dt>";
1681 m_t <<
" <table class=\"" << className <<
"\">" <<
endl;
1705 m_t <<
"<td class=\"paramdir\">";
1727 m_t <<
"<td class=\"paramtype\">";
1731 for (li.toFirst();(type=li.current());++li)
1733 if (!first)
m_t <<
" | ";
else first=FALSE;
1745 m_t <<
"<td class=\"paramname\">";
1751 for (li.toFirst();(param=li.current());++li)
1753 if (!first)
m_t <<
",";
else first=FALSE;
1776 if (x->
title().isEmpty())
return;
1779 bool anonymousEnum = x->
file()==
"@";
1782 m_t <<
"<dl class=\"" << x->
key() <<
"\"><dt><b><a class=\"el\" href=\""
1784 <<
"#" << x->
anchor() <<
"\">";
1788 m_t <<
"<dl class=\"" << x->
key() <<
"\"><dt><b>";
1792 if (!anonymousEnum) m_t <<
"</a>";
1793 m_t <<
"</b></dt><dd>";
1799 if (x->
title().isEmpty())
return;
1838 if (attrs.isEmpty())
1840 m_t <<
"<blockquote class=\"doxtable\">\n";
1851 m_t <<
"</blockquote>" <<
endl;
1863 m_t <<
"flowchart: " ;
1864 m_t <<
"<a href=\"";
1865 m_t << fname.data();
1908 case '<':
m_t <<
"<";
break;
1909 case '>':
m_t <<
">";
break;
1910 case '&':
m_t <<
"&";
break;
1928 case '&':
m_t <<
"&";
break;
1929 case '"':
m_t <<
""";
break;
1930 case '<':
m_t <<
"<";
break;
1931 case '>':
m_t <<
">";
break;
1938 const QCString &relPath,
const QCString &anchor,
1939 const QCString &tooltip)
1944 m_t <<
"<a class=\"elRef\" ";
1949 m_t <<
"<a class=\"el\" ";
1954 if (!anchor.isEmpty())
m_t <<
"#" << anchor;
1956 if (!tooltip.isEmpty())
m_t <<
" title=\"" <<
convertToHtml(tooltip) <<
"\"";
1979 const QCString &context)
1981 QCString baseName=fn;
1983 if ((i=baseName.findRev(
'/'))!=-1)
1985 baseName=baseName.right(baseName.length()-i-1);
1987 if ((i=baseName.find(
'.'))!=-1)
1989 baseName=baseName.left(i);
1991 baseName.prepend(
"dot_");
1998 const QCString &relPath,
1999 const QCString &context)
2001 QCString baseName=fileName;
2003 if ((i=baseName.findRev(
'/'))!=-1)
2005 baseName=baseName.right(baseName.length()-i-1);
2007 if ((i=baseName.find(
'.'))!=-1)
2009 baseName=baseName.left(i);
2011 baseName.prepend(
"msc_");
2015 if (
"svg" == imgExt)
2022 const QCString &relPath,
2025 QCString baseName=fileName;
2027 if ((i=baseName.findRev(
'/'))!=-1)
2029 baseName=baseName.right(baseName.length()-i-1);
2031 if ((i=baseName.find(
'.'))!=-1)
2033 baseName=baseName.left(i);
2035 baseName.prepend(
"dia_");
2039 m_t <<
"<img src=\"" << relPath << baseName <<
".png" <<
"\" />" <<
endl;
2043 const QCString &relPath,
2046 QCString baseName=fileName;
2048 if ((i=baseName.findRev(
'/'))!=-1)
2050 baseName=baseName.right(baseName.length()-i-1);
2052 if ((i=baseName.findRev(
'.'))!=-1)
2054 baseName=baseName.left(i);
2064 m_t <<
"<object type=\"image/svg+xml\" data=\"" << relPath << baseName <<
".svg\"></object>" <<
endl;
2069 m_t <<
"<img src=\"" << relPath << baseName <<
".png" <<
"\" />" <<
endl;
2082 bool styleOutsideParagraph=FALSE;
2083 while (nodeIndex>=0 && !styleOutsideParagraph)
2091 styleMask|=(int)sc->
style();
2097 if (sc->
enable() && (styleMask&(int)sc->
style())==0 &&
2101 styleOutsideParagraph=TRUE;
2106 return styleOutsideParagraph;
2119 int nodeIndex = para->
children().findRef(n);
2121 if (nodeIndex<0)
return;
2122 while (nodeIndex>=0 &&
2140 if (isFirst && isLast)
return;
2141 if (styleOutsideParagraph)
return;
2157 int nodeIndex = para->
children().findRef(n);
2158 int numNodes = para->
children().count();
2160 if (styleOutsideParagraph)
return;
2162 if (nodeIndex==numNodes)
return;
2163 while (nodeIndex<numNodes &&
2169 if (nodeIndex<numNodes)
2183 if (isFirst && isLast)
return;