25#include "mscgen_api.h"
37 err(
"failed to open map file %s for inclusion in the docs!\n"
38 "If you installed Graphviz/dot after a previous failing run, \n"
39 "try deleting the output directory and rerun doxygen.\n",
qPrint(mapName));
42 const int maxLineLen=1024;
45 int x1=0, y1=0, x2=0, y2=0;
47 while (getline(f,line))
51 if (
qstrncmp(line.c_str(),
"rect",4)==0)
54 sscanf(line.c_str(),
"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);
59 sscanf(line.c_str(),
"rect %s %s %d,%d %d,%d",ref,url,&x1,&y1,&x2,&y2);
63 if (y2<y1) {
int temp=y2; y2=y1; y1=temp; }
64 if (x2<x1) {
int temp=x2; x2=x1; x1=temp; }
73 auto dfAst {
createRef( *parser.get(), url, context, srcFile, srcLine) };
74 auto dfAstImpl =
dynamic_cast<const DocNodeAST*
>(dfAst.get());
75 const DocRef *df = std::get_if<DocRef>(&dfAstImpl->root);
101 t <<
"\" shape=\"rect\" coords=\""
102 << x1 <<
"," << y1 <<
"," << x2 <<
"," << y2 <<
"\""
112 const QCString &srcFile,
int srcLine)
115 if (!mscgen_tool.isEmpty())
120 case mscgen_format_png:
123 case mscgen_format_eps:
126 case mscgen_format_svg:
129 case mscgen_format_pngmap:
130 case mscgen_format_svgmap:
134 int exitcode =
Portable::system(mscgen_tool,
"-T"+type+
" -o "+outFile+
" "+inFile);
137 err_full(srcFile,srcLine,
"Problems running external tool %s given via MSCGEN_TOOL (exit status: %d)."
138 " Look for typos in your msc file and check error messages above.",
139 qPrint(mscgen_tool),exitcode);
145 int code = mscgen_generate(inFile.
data(),outFile.
data(),msc_format);
148 err_full(srcFile,srcLine,
"Problems generating msc output (error=%s). Look for typos in you msc file '%s'",
149 mscgen_error2str(code),
qPrint(inFile));
165 mscgen_format_t msc_format = mscgen_format_png;
170 msc_format = mscgen_format_png;
174 msc_format = mscgen_format_eps;
178 msc_format = mscgen_format_svg;
192 epstopdfArgs.
sprintf(
"\"%s.eps\" --outfile=\"%s.pdf\"",
196 err_full(srcFile,srcLine,
"Problems running epstopdf when processing '%s.eps'. Check your TeX installation!",
201 Dir().
remove((absOutFile +
".eps").data());
216 bool writeSVGMap,
const QCString &srcFile,
int srcLine)
221 writeSVGMap ? mscgen_format_svgmap : mscgen_format_pngmap,
244 t <<
"<img src=\"" << relPath << baseName <<
".";
263 << baseName <<
"\" border=\"0\" usemap=\"#" << mapName <<
"\"/>\n";
264 t <<
"<map name=\"" << mapName <<
"\" id=\"" << mapName <<
"\">" << imap <<
"</map>\n";
268 t <<
"\" alt=\"" << baseName <<
"\" border=\"0\"/>\n";
Class representing a directory in the file system.
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Class representing the abstract syntax tree of a documentation block.
Node representing a reference to some item.
static IndexList * indexList
This is an alternative implementation of QCString.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
bool isEmpty() const
Returns TRUE iff the string is empty.
const std::string & str() const
QCString right(size_t len) const
QCString & sprintf(const char *format,...)
int findRev(char c, int index=-1, bool cs=TRUE) const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Text streaming class that buffers data.
std::string str() const
Return the contents of the buffer as a std::string object.
#define Config_getBool(name)
#define Config_getString(name)
static const int maxCmdLine
IDocParserPtr createDocParser()
factory function to create a parser
IDocNodeASTPtr createRef(IDocParser &parserIntf, const QCString &target, const QCString &context, const QCString &srcFile, int srcLine)
#define err_full(file, line, fmt,...)
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)
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
static QCString getMscImageMapFromFile(const QCString &inFile, const QCString &, const QCString &relPath, const QCString &context, bool writeSVGMap, const QCString &srcFile, int srcLine)
static bool convertMapFile(TextStream &t, const QCString &mapName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
static bool do_mscgen_generate(const QCString &inFile, const QCString &outFile, mscgen_format_t msc_format, const QCString &srcFile, int srcLine)
std::ifstream openInputStream(const QCString &name, bool binary=false, bool openAtEnd=false)
int system(const QCString &command, const QCString &args, bool commandHasConsole=true)
Portable versions of functions that are platform dependent.
int qstrncmp(const char *str1, const char *str2, size_t len)
const char * qPrint(const char *s)
int qstrcmp(const char *str1, const char *str2)
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
void addHtmlExtensionIfMissing(QCString &fName)
A bunch of utility functions.