Skip to content

Commit

Permalink
various fixes and restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Dec 22, 2014
1 parent 67e8d62 commit 223e7de
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 309 deletions.
25 changes: 11 additions & 14 deletions doc/commands.doc
Expand Up @@ -2572,7 +2572,7 @@ class Receiver
step before running doxygen, you can also add the name of the image file after \c \\startuml
and inside curly brackets, i.e.
\verbatim
@startuml{myimage.png}
@startuml{myimage.png} "Image Caption" width=5cm
Alice -> Bob : Hello
@enduml
\endverbatim
Expand Down Expand Up @@ -2897,15 +2897,16 @@ class Receiver
specific, so if you want to insert an image for more than one
format you'll have to repeat this command for each format.

The first argument specifies the output format. Currently, the
following values are supported: \c html, \c latex, \c docbook and \c rtf.
The first argument specifies the output format in which the image should
be embedded. Currently, the following values are supported:
\c html, \c latex, \c docbook and \c rtf.

The second argument specifies the file name of the image.
doxygen will look for files in the paths (or files) that you specified
after the \ref cfg_image_path "IMAGE_PATH" tag.
If the image is found it will be copied to the correct output directory.
If the image name contains spaces you'll have to put quotes ("...") around it.
You can also specify an absolute URL instead of a file name, but then
If the image name contains spaces you'll have to put quotes ("...") around
the name. You can also specify an absolute URL instead of a file name, but then
doxygen does not copy the image nor check its existence.

The third argument is optional and can be used to specify the caption
Expand All @@ -2914,16 +2915,12 @@ class Receiver
spaces. The quotes are stripped before the caption is displayed.

The fourth argument is also optional and can be used to specify the
width or height of the image. This can be useful for \LaTeX output
(i.e. format=<code>latex</code>).
width or height of the image. This can be useful for \LaTeX or docbook output
(i.e. format=<code>latex</code> or format=<code>docbook</code>).
\anchor image_sizeindicator \par Size indication
The \c sizeindication can
specify the width or height to be used )or a combination). Possible
values are (width, analogous for height):
`width` or `max with` or `min width`. The size should be a valid
size specifier in \LaTeX (for example `10cm` or
`6in` or a symbolic width like `\\textwidth`). (The `max width` etc.
are based on the \LaTeX package `adjustbox`)
The \c sizeindication can specify the width or height to be used (or a combination).
The size specifier in \LaTeX (for example `10cm` or
`4in` or a symbolic width like `\\textwidth`).

Here is example of a comment block:

Expand Down
27 changes: 6 additions & 21 deletions src/docbookvisitor.cpp
Expand Up @@ -46,30 +46,15 @@ static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name,
t << " <imagedata";
if (!width.isEmpty())
{
tmpStr = width;
tmpStr = tmpStr.replace(QRegExp("min *width"),"minwidth");
tmpStr = tmpStr.replace(QRegExp("max *width"),"maxwidth");
tmpStr = tmpStr.replace(QRegExp("="),"=\"");
tmpStr = tmpStr.replace(QRegExp(","),"\" ") + "\"";
tmpStr = tmpStr.replace(QRegExp("\"\""),"\"");
tmpStr = tmpStr.replace(QRegExp("\\"),"\\\\");
t << " " << tmpStr;
t << " width=\"" << convertToXML(width) << "\"";
}
else
{
t << " width=\"50%\"";
}
if (!height.isEmpty())
{
tmpStr = height;
tmpStr = tmpStr.replace(QRegExp("min *height"),"mindepth");
tmpStr = tmpStr.replace(QRegExp("max *height"),"maxdepth");
tmpStr = tmpStr.replace(QRegExp("height="),"depth=");
tmpStr = tmpStr.replace(QRegExp("="),"=\"");
tmpStr = tmpStr.replace(QRegExp(","),"\" ") + "\"";
tmpStr = tmpStr.replace(QRegExp("\"\""),"\"");
tmpStr = tmpStr.replace(QRegExp("\\"),"\\\\");
t << " " << tmpStr;
t << " depth=\"" << convertToXML(tmpStr) << "\"";
}
t << " align=\"center\" valign=\"middle\" scalefit=\"1\" fileref=\"" << name << "\">";
t << "</imagedata>" << endl;
Expand Down Expand Up @@ -1238,7 +1223,7 @@ void DocbookDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s)
QCString outDir = Config_getString("DOCBOOK_OUTPUT");
writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_BITMAP);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
visitCaption(this, s->m_children);
visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption());
}

Expand All @@ -1253,7 +1238,7 @@ void DocbookDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim
QCString outDir = Config_getString("DOCBOOK_OUTPUT");
generatePlantUMLOutput(baseName,outDir,PUML_BITMAP);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
visitCaption(this, s->m_children);
visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption());
}

Expand Down Expand Up @@ -1298,7 +1283,7 @@ void DocbookDocVisitor::writeDiaFile(const QCString &baseName, DocVerbatim *s)
QCString outDir = Config_getString("DOCBOOK_OUTPUT");
writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_BITMAP);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
visitCaption(this, s->m_children);
visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption());
}

Expand Down Expand Up @@ -1344,7 +1329,7 @@ void DocbookDocVisitor::writeDotFile(const QCString &baseName, DocVerbatim *s)
QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
writeDotGraphFromFile(baseName+".dot",outDir,shortName,GOF_BITMAP);
visitPreStart(m_t, s->hasCaption(), baseName + ".dot", s->width(),s->height());
visitCaption(this, s->m_children);
visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption());
}

Expand Down

0 comments on commit 223e7de

Please sign in to comment.