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 '%s.eps'. Check your TeX installation!",
197 qPrint(absOutFile));
198 }
199 else
200 {
201 Dir().remove((absOutFile + ".eps").data());
202 }
203 }
204
205 int i=std::max(imgName.findRev('/'),imgName.findRev('\\'));
206 if (i!=-1) // strip path
207 {
208 imgName=imgName.right(imgName.length()-i-1);
209 }
210 Doxygen::indexList->addImageFile(imgName);
211
212}
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:89
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:661

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 233 of file msc.cpp.

242{
243 QCString mapName = baseName+".map";
244 t << "<img src=\"" << relPath << baseName << ".";
245 switch (format)
246 {
248 t << "png";
249 break;
251 t << "eps";
252 break;
254 t << "svg";
255 break;
256 default:
257 t << "unknown";
258 }
259 QCString imap = getMscImageMapFromFile(inFile,outDir,relPath,context,format==MscOutputFormat::SVG,srcFile,srcLine);
260 if (!imap.isEmpty())
261 {
262 t << "\" alt=\""
263 << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\"/>\n";
264 t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>\n";
265 }
266 else
267 {
268 t << "\" alt=\"" << baseName << "\" border=\"0\"/>\n";
269 }
270}
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:214

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

Referenced by HtmlDocVisitor::writeMscFile().