Doxygen
Loading...
Searching...
No Matches
msc.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  MscOutputFormat { BITMAP , EPS , SVG }
 

Functions

void writeMscGraphFromFile (const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
 
QCString getMscImageMapFromFile (const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
 
void writeMscImageMapFromFile (TextStream &t, const QCString &inFile, const QCString &outDir, const QCString &relPath, const QCString &baseName, const QCString &context, MscOutputFormat format, const QCString &srcFile, int srcLine)
 

Enumeration Type Documentation

◆ MscOutputFormat

enum class MscOutputFormat
strong
Enumerator
BITMAP 
EPS 
SVG 

Definition at line 22 of file msc.h.

22{ BITMAP, EPS, SVG };

Function Documentation

◆ getMscImageMapFromFile()

QCString getMscImageMapFromFile ( const QCString & inFile,
const QCString & outDir,
const QCString & relPath,
const QCString & context,
const QCString & srcFile,
int srcLine )

◆ writeMscGraphFromFile()

void writeMscGraphFromFile ( const QCString & inFile,
const QCString & outDir,
const QCString & outFile,
MscOutputFormat format,
const QCString & srcFile,
int srcLine )

Definition at line 156 of file msc.cpp.

160{
161 QCString absOutFile = outDir;
162 absOutFile+=Portable::pathSeparator();
163 absOutFile+=outFile;
164
165 mscgen_format_t msc_format = mscgen_format_png;
166 QCString imgName = absOutFile;
167 switch (format)
168 {
170 msc_format = mscgen_format_png;
171 imgName+=".png";
172 break;
174 msc_format = mscgen_format_eps;
175 imgName+=".eps";
176 break;
178 msc_format = mscgen_format_svg;
179 imgName+=".svg";
180 break;
181 default:
182 return;
183 }
184 if (!do_mscgen_generate(inFile,imgName,msc_format,srcFile,srcLine))
185 {
186 return;
187 }
188
189 if ( (format==MscOutputFormat::EPS) && (Config_getBool(USE_PDFLATEX)) )
190 {
192 epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
193 qPrint(absOutFile),qPrint(absOutFile));
194 if (Portable::system("epstopdf",epstopdfArgs)!=0)
195 {
196 err_full(srcFile,srcLine,"Problems running epstopdf when processing '{}.eps'. Check your TeX installation!", absOutFile);
197 }
198 else
199 {
200 Dir().remove((absOutFile + ".eps").data());
201 }
202 }
203
204 int i=std::max(imgName.findRev('/'),imgName.findRev('\\'));
205 if (i!=-1) // strip path
206 {
207 imgName=imgName.right(imgName.length()-i-1);
208 }
209 Doxygen::indexList->addImageFile(imgName);
210
211}
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
static IndexList * indexList
Definition doxygen.h:134
This is an alternative implementation of QCString.
Definition qcstring.h:101
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:153
QCString right(size_t len) const
Definition qcstring.h:219
@ ExplicitSize
Definition qcstring.h:133
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91
#define Config_getBool(name)
Definition config.h:33
static const int maxCmdLine
Definition dia.cpp:24
#define err_full(file, line, fmt,...)
Definition message.h:132
static bool do_mscgen_generate(const QCString &inFile, const QCString &outFile, mscgen_format_t msc_format, const QCString &srcFile, int srcLine)
Definition msc.cpp:111
QCString pathSeparator()
Definition portable.cpp:391
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Definition portable.cpp:106
const char * qPrint(const char *s)
Definition qcstring.h:672

References BITMAP, Config_getBool, do_mscgen_generate(), EPS, err_full, QCString::ExplicitSize, QCString::findRev(), Doxygen::indexList, QCString::length(), maxCmdLine, Portable::pathSeparator(), qPrint(), Dir::remove(), QCString::right(), QCString::sprintf(), SVG, and Portable::system().

Referenced by DocbookDocVisitor::startMscFile(), LatexDocVisitor::startMscFile(), DocbookDocVisitor::writeMscFile(), HtmlDocVisitor::writeMscFile(), LatexDocVisitor::writeMscFile(), and RTFDocVisitor::writeMscFile().

◆ writeMscImageMapFromFile()

void writeMscImageMapFromFile ( TextStream & t,
const QCString & inFile,
const QCString & outDir,
const QCString & relPath,
const QCString & baseName,
const QCString & context,
MscOutputFormat format,
const QCString & srcFile,
int srcLine )

Definition at line 232 of file msc.cpp.

241{
242 QCString mapName = baseName+".map";
243 t << "<img src=\"" << relPath << baseName << ".";
244 switch (format)
245 {
247 t << "png";
248 break;
250 t << "eps";
251 break;
253 t << "svg";
254 break;
255 default:
256 t << "unknown";
257 }
258 QCString imap = getMscImageMapFromFile(inFile,outDir,relPath,context,format==MscOutputFormat::SVG,srcFile,srcLine);
259 if (!imap.isEmpty())
260 {
261 t << "\" alt=\""
262 << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>\n";
263 t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>\n";
264 }
265 else
266 {
267 t << "\" alt=\"" << baseName << "\" border=\"0\"/>\n";
268 }
269}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
static QCString getMscImageMapFromFile(const QCString &inFile, const QCString &, const QCString &relPath, const QCString &context, bool writeSVGMap, const QCString &srcFile, int srcLine)
Definition msc.cpp:213

References BITMAP, EPS, getMscImageMapFromFile(), QCString::isEmpty(), and SVG.

Referenced by HtmlDocVisitor::writeMscFile().