summaryrefslogtreecommitdiffstats
path: root/Source/cmSetDirectoryPropertiesCommand.cxx
blob: b956313a0ea6138c92e0ff78b45f4701df83cfda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*============================================================================
  CMake - Cross Platform Makefile Generator
  Copyright 2000-2009 Kitware, Inc., Insight Software Consortium

  Distributed under the OSI-approved BSD License (the "License");
  see accompanying file Copyright.txt for details.

  This software is distributed WITHOUT ANY WARRANTY; without even the
  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License for more information.
============================================================================*/
#include "cmSetDirectoryPropertiesCommand.h"

#include "cmake.h"

// cmSetDirectoryPropertiesCommand
bool cmSetDirectoryPropertiesCommand
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
{
  if(args.size() < 1 )
    {
    this->SetError("called with incorrect number of arguments");
    return false;
    }
  
  std::string errors;
  bool ret = 
    cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile, 
                                                args.begin() + 1, 
                                                args.end(), errors);
  if (!ret)
    {
    this->SetError(errors.c_str());
    }
  return ret;
}

bool cmSetDirectoryPropertiesCommand
::RunCommand(cmMakefile *mf,
             std::vector<std::string>::const_iterator ait,
             std::vector<std::string>::const_iterator aitend,
             std::string &errors)
{
  for (; ait != aitend; ait += 2 )
    {
    if ( ait +1 == aitend)
      {
      errors = "Wrong number of arguments";
      return false;
      }
    const std::string& prop = *ait;
    const std::string& value = *(ait+1);
    if ( prop == "VARIABLES" )
      {
      errors = 
        "Variables and cache variables should be set using SET command";
      return false;
      }
    else if ( prop == "MACROS" )
      {
      errors = 
        "Commands and macros cannot be set using SET_CMAKE_PROPERTIES";
      return false;
      }
    mf->SetProperty(prop.c_str(), value.c_str());
    }
  
  return true;
}

/td> -rw-r--r--src/htmldocvisitor.h1
-rw-r--r--src/latexdocvisitor.cpp134
-rw-r--r--src/latexdocvisitor.h3
-rw-r--r--src/latexgen.cpp4
-rw-r--r--src/mandocvisitor.cpp1
-rw-r--r--src/perlmodgen.cpp1
-rw-r--r--src/printdocvisitor.h2
-rw-r--r--src/rtfdocvisitor.cpp57
-rw-r--r--src/rtfdocvisitor.h1
-rw-r--r--src/scanner.l70
-rw-r--r--src/translator_fr.h56
-rw-r--r--src/xmldocvisitor.cpp5
30 files changed, 434 insertions, 117 deletions
diff --git a/INSTALL b/INSTALL
index 3aca7d0..2f9f718 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
-DOXYGEN Version 1.3.3-20030909
+DOXYGEN Version 1.3.3-20030915
Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions.
--------
-Dimitri van Heesch (09 September 2003)
+Dimitri van Heesch (15 September 2003)
diff --git a/README b/README
index d03d9f7..63f9315 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-DOXYGEN Version 1.3.3_20030909
+DOXYGEN Version 1.3.3_20030915
Please read INSTALL for compilation instructions.
@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy,
-Dimitri van Heesch (dimitri@stack.nl) (09 September 2003)
+Dimitri van Heesch (dimitri@stack.nl) (15 September 2003)
diff --git a/VERSION b/VERSION
index 3314165..594903d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.3-20030909
+1.3.3-20030915
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 7af4228..f44f52e 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -48,3 +48,4 @@ PERL_PATH = /usr/local/bin/perl
SEARCHENGINE = NO
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
+STRIP_CODE_COMMENTS = NO
diff --git a/doc/commands.doc b/doc/commands.doc
index 1a6d8e5..bd9b543 100644
--- a/doc/commands.doc
+++ b/doc/commands.doc
@@ -56,12 +56,14 @@ documentation:
\refitem cmddefgroup \\defgroup
\refitem cmddeprecated \\deprecated
\refitem cmddontinclude \\dontinclude
+\refitem cmddot \\dot
\refitem cmddotfile \\dotfile
\refitem cmde \\e
\refitem cmdelse \\else
\refitem cmdelseif \\elseif
\refitem cmdem \\em
\refitem cmdendcode \\endcode
+\refitem cmdenddot \\enddot
\refitem cmdendhtmlonly \\endhtmlonly
\refitem cmdendif \\endif
\refitem cmdendlatexonly \\endlatexonly
@@ -1509,6 +1511,40 @@ ALIASES = "english=\if english" \
relation will be broken and flagged as an error.
<hr>
+\section cmddot \dot
+
+ \addindex \\dot
+ Starts a text fragment which should contain a valid description of a
+ dot graph. The text fragment ends with \ref cmdenddot "\\enddot".
+ Doxygen will pass the text on to dot and include the resulting
+ image (and image map) into the output.
+ The nodes of a graph can be made clickable by using the URL attribute.
+ By using the command \\ref inside the URL value you can conveniently
+ link to an item inside doxygen. Here is an example:
+\code
+/*! class B */
+class B {};
+
+/*! class C */
+class C {};
+
+/*! \mainpage
+ *
+ * Class relations expressed via an inline dot graph:
+ * \dot
+ * digraph example {
+ * node [shape=record, fontname=Helvetica, fontsize=10];
+ * b [ label="class B" URL="\ref B"];
+ * c [ label="class C" URL="\ref C"];
+ * b -> c [ arrowhead="open", style="dashed" ];
+ * }
+ * \enddot
+ * Note that the classes in the above graph are clickable
+ * (in the HTML output).
+ */
+\endcode
+
+<hr>
\section cmddotfile \dotfile <file> ["caption"]
\addindex \\dotfile
@@ -1569,6 +1605,12 @@ ALIASES = "english=\if english" \
\sa section \ref cmdcode "\\code"
<hr>
+\section cmdenddot \enddot
+
+ \addindex \\enddot
+ Ends a blocks that was started with \ref cmddot "\\dot".
+
+<hr>
\section cmdendhtmlonly \endhtmlonly
\addindex \\endhtmlonly
diff --git a/doc/language.doc b/doc/language.doc
index dd926ac..a6d8fad 100644
--- a/doc/language.doc
+++ b/doc/language.doc
@@ -25,7 +25,7 @@ Doxygen has built-in support for multiple languages. This means
that the text fragments that doxygen generates can be produced in
languages other than English (the default) at configuration time.
-Currently (version 1.3.3-20030904), 29 languages
+Currently (version 1.3.3), 29 languages
are supported (sorted alphabetically):
Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian,
Czech, Danish, Dutch, English, Finnish,
@@ -115,7 +115,7 @@ when the translator was updated.
<TD>French</TD>
<TD>Xavier Outhier</TD>
<TD>xouthier@NOSPAM.yahoo.fr</TD>
- <TD>1.3.3</TD>
+ <TD>up-to-date</TD>
</TR>
<TR BGCOLOR="#ffffff">
<TD>German</TD>
@@ -215,8 +215,8 @@ when the translator was updated.
</TR>
<TR BGCOLOR="#ffffff">
<TD>Swedish</TD>
- <TD>XeT Erixon</TD>
- <TD>xet@NOSPAM.hem.passagen.se</TD>
+ <TD>Mikael Hallin</TD>
+ <TD>mikaelhallin@NOSPAM.yahoo.se</TD>
<TD>1.3.3</TD>
</TR>
<TR BGCOLOR="#ffffff">
@@ -258,7 +258,7 @@ when the translator was updated.
\hline
Finnish & Olli Korhonen & {\tt Olli.Korhonen@ccc.fi} & obsolete \\
\hline
- French & Xavier Outhier & {\tt xouthier@yahoo.fr} & 1.3.3 \\
+ French & Xavier Outhier & {\tt xouthier@yahoo.fr} & up-to-date \\
\hline
German & Jens Seidel & {\tt jensseidel@users.sf.net} & 1.3.1 \\
\hline
@@ -295,7 +295,7 @@ when the translator was updated.
\hline
Spanish & Francisco Oltra Thennet & {\tt foltra@puc.cl} & 1.3.3 \\
\hline
- Swedish & XeT Erixon & {\tt xet@hem.passagen.se} & 1.3.3 \\
+ Swedish & Mikael Hallin & {\tt mikaelhallin@yahoo.se} & 1.3.3 \\
\hline
Ukrainian & Olexij Tkatchenko & {\tt olexij.tkatchenko@gmx.de} & 1.2.11 \\
\hline
diff --git a/doc/maintainers.txt b/doc/maintainers.txt
index 7171bd3..e865c44 100644
--- a/doc/maintainers.txt
+++ b/doc/maintainers.txt
@@ -85,7 +85,8 @@ Spanish
Francisco Oltra Thennet: foltra@puc.cl
Swedish
-XeT Erixon: xet@hem.passagen.se
+Mikael Hallin: mikaelhallin@yahoo.se
Ukrainian
Olexij Tkatchenko: olexij.tkatchenko@gmx.de
+
diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec
index f9792a9..428d3f4 100644
--- a/packages/rpm/doxygen.spec
+++ b/packages/rpm/doxygen.spec
@@ -1,6 +1,6 @@
Summary: A documentation system for C/C++.
Name: doxygen
-Version: 1.3.3_20030909
+Version: 1.3.3_20030915
Release: 1
Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp
index f06c6f1..578af8c 100644
--- a/src/cmdmapper.cpp
+++ b/src/cmdmapper.cpp
@@ -101,6 +101,8 @@ CommandMap cmdMap[] =
{ "%", CMD_PERCENT },
{ "~", CMD_LANGSWITCH },
{ "_internalref", CMD_INTERNALREF },
+ { "dot", CMD_DOT },
+ { "enddot", CMD_ENDDOT },
{ 0, 0 }
};
diff --git a/src/cmdmapper.h b/src/cmdmapper.h
index 7623348..44e77ae 100644
--- a/src/cmdmapper.h
+++ b/src/cmdmapper.h
@@ -101,7 +101,9 @@ enum CommandType
CMD_VERSION = 67 | SIMPLESECT_BIT,
CMD_WARNING = 68 | SIMPLESECT_BIT,
CMD_XREFITEM = 69 | SIMPLESECT_BIT,
- CMD_XMLONLY = 70
+ CMD_XMLONLY = 70,
+ CMD_DOT = 71,
+ CMD_ENDDOT = 72
};
enum HtmlTagType
diff --git a/src/compound.xsd b/src/compound.xsd
index 4937ff0..925f29e 100644
--- a/src/compound.xsd
+++ b/src/compound.xsd
@@ -313,6 +313,7 @@
<xsd:element name="small" type="docMarkupType" />
<xsd:element name="htmlonly" type="xsd:string" />
<xsd:element name="latexonly" type="xsd:string" />
+ <xsd:element name="dot" type="xsd:string" />
<xsd:element name="anchor" type="docAnchorType" />
<xsd:element name="formula" type="docFormulaType" />
<xsd:element name="ref" type="docRefTextType" />
diff --git a/src/compound_xsd.h b/src/compound_xsd.h
index 6ec95e1..f434aad 100644
--- a/src/compound_xsd.h
+++ b/src/compound_xsd.h
@@ -313,6 +313,7 @@
" <xsd:element name=\"small\" type=\"docMarkupType\" />\n"
" <xsd:element name=\"htmlonly\" type=\"xsd:string\" />\n"
" <xsd:element name=\"latexonly\" type=\"xsd:string\" />\n"
+" <xsd:element name=\"dot\" type=\"xsd:string\" />\n"
" <xsd:element name=\"anchor\" type=\"docAnchorType\" />\n"
" <xsd:element name=\"formula\" type=\"docFormulaType\" />\n"
" <xsd:element name=\"ref\" type=\"docRefTextType\" />\n"
diff --git a/src/docparser.cpp b/src/docparser.cpp
index a66f659..048448d 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -3686,12 +3686,22 @@ int DocPara::handleCommand(const QString &cmdName)
doctokenizerYYsetStatePara();
}
break;
+ case CMD_DOT:
+ {
+ doctokenizerYYsetStateDot();
+ retval = doctokenizerYYlex();
+ m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Dot,g_isExample,g_exampleName));
+ if (retval==0) warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: dot section ended without end marker");
+ doctokenizerYYsetStatePara();
+ }
+ break;
case CMD_ENDCODE:
case CMD_ENDHTMLONLY:
case CMD_ENDLATEXONLY:
case CMD_ENDXMLONLY:
case CMD_ENDLINK:
case CMD_ENDVERBATIM:
+ case CMD_ENDDOT:
warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected command %s",g_token->name.data());
break;
case CMD_PARAM:
@@ -4585,6 +4595,7 @@ int DocSection::parse()
void DocText::parse()
{
+ DBG(("DocText::parse() start\n"));
g_nodeStack.push(this);
doctokenizerYYsetStateText();
@@ -4658,6 +4669,7 @@ void DocText::parse()
DocNode *n = g_nodeStack.pop();
ASSERT(n==this);
+ DBG(("DocText::parse() end\n"));
}
@@ -4665,6 +4677,7 @@ void DocText::parse()
void DocRoot::parse()
{
+ DBG(("DocRoot::parse() start\n"));
g_nodeStack.push(this);
doctokenizerYYsetStatePara();
int retval=0;
@@ -4717,7 +4730,7 @@ void DocRoot::parse()
}
else
{
- warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid anchor id `%s'",g_token->sectionId.data());
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Invalid anchor id `%s'; ignoring section",g_token->sectionId.data());
retval = 0;
}
}
@@ -4734,6 +4747,7 @@ void DocRoot::parse()
DocNode *n = g_nodeStack.pop();
ASSERT(n==this);
+ DBG(("DocRoot::parse() end\n"));
}
//--------------------------------------------------------------------------
diff --git a/src/docparser.h b/src/docparser.h
index 6b79220..dc2b890 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -349,7 +349,7 @@ class DocWhiteSpace : public DocNode
class DocVerbatim : public DocNode
{
public:
- enum Type { Code, HtmlOnly, LatexOnly, XmlOnly, Verbatim };
+ enum Type { Code, HtmlOnly, LatexOnly, XmlOnly, Verbatim, Dot };
DocVerbatim(DocNode *parent,const QString &context,
const QString &text, Type t,bool isExample,
const QString &exampleFile) :
@@ -373,6 +373,7 @@ class DocVerbatim : public DocNode
QString m_exampleFile;
};
+
/*! @brief Node representing an included text block from file */
class DocInclude : public DocNode
{
@@ -595,7 +596,6 @@ class DocDotFile : public CompAccept<DocDotFile>, public DocNode
QString height() const { return m_height; }
DocNode *parent() const { return m_parent; }
void accept(DocVisitor *v) { CompAccept<DocDotFile>::accept(this,v); }
-
private:
DocNode *m_parent;
QString m_name;
diff --git a/src/doctokenizer.h b/src/doctokenizer.h
index 6c62815..ce2532d 100644
--- a/src/doctokenizer.h
+++ b/src/doctokenizer.h
@@ -123,6 +123,7 @@ void doctokenizerYYsetStateHtmlOnly();
void doctokenizerYYsetStateLatexOnly();
void doctokenizerYYsetStateXmlOnly();
void doctokenizerYYsetStateVerbatim();
+void doctokenizerYYsetStateDot();
void doctokenizerYYsetStateParam();
void doctokenizerYYsetStateXRefItem();
void doctokenizerYYsetStateFile();
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 1e4b2d1..81e2afa 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -327,6 +327,7 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]*
%x St_LatexOnly
%x St_XmlOnly
%x St_Verbatim
+%x St_Dot
%x St_Param
%x St_XRefItem
%x St_XRefItem2
@@ -525,6 +526,14 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]*
<St_Verbatim>. { /* Verbatim text */
g_token->verb+=yytext;
}
+<St_Dot>{CMD}"enddot" {
+ return RetVal_OK;
+ }
+<St_Dot>[^\\@\n]+ |
+<St_Dot>\n |
+<St_Dot>. { /* dot text */
+ g_token->verb+=yytext;
+ }
<St_Title>"\"" { // quoted title
BEGIN(St_TitleQ);
}
@@ -746,6 +755,10 @@ LABELID [a-z_A-Z][a-z_A-Z0-9\-]*
g_endMarker="endverbatim";
BEGIN(St_SecSkip);
}
+<St_Sections>{CMD}"dot" {
+ g_endMarker="enddot";
+ BEGIN(St_SecSkip);
+ }
<St_Sections>{CMD}"htmlonly" {
g_endMarker="endhtmlonly";
BEGIN(St_SecSkip);
@@ -885,6 +898,12 @@ void doctokenizerYYsetStateVerbatim()
BEGIN(St_Verbatim);
}
+void doctokenizerYYsetStateDot()
+{
+ g_token->verb="";
+ BEGIN(St_Dot);
+}
+
void doctokenizerYYsetStateParam()
{
BEGIN(St_Param);
diff --git a/src/dot.cpp b/src/dot.cpp
index a9585bf..d2f852a 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -26,6 +26,7 @@
#include "language.h"
#include "scanner.h"
#include "defargs.h"
+#include "docparser.h"
#include <qdir.h>
#include <qfile.h>
@@ -96,6 +97,8 @@ static bool convertMapFile(QTextStream &t,const char *mapName,
const int maxLineLen=1024;
char buf[maxLineLen];
char url[maxLineLen];
+ char ref[maxLineLen];
+ bool isRef = FALSE;
int x1,y1,x2,y2;
while (!f.atEnd())
{
@@ -106,6 +109,13 @@ static bool convertMapFile(QTextStream &t,const char *mapName,
{
// obtain the url and the coordinates in the order used by graphviz-1.5
sscanf(buf,"rect %s %d,%d %d,%d",url,&x1,&y1,&x2,&y2);
+
+ if ( strcmp(url,"\\ref") == 0 )
+ {
+ isRef = TRUE;
+ sscanf(buf,"rect %s %s %d,%d %d,%d",ref,url,&x1,&y1,&x2,&y2);
+ }
+
// later versions of graphviz corrected the y coordinate order
// the rule is that y2>=y1, so test and switch if needed
if (y2<y1)
@@ -124,9 +134,27 @@ static bool convertMapFile(QTextStream &t,const char *mapName,
}
if (urlOnly)
{
- t << "<area href=\"" << url << "\" shape=\"rect\" coords=\""
- << x1 << "," << y1 << "," << x2 << "," << y2 << "\""
- << " alt=\"\">" << endl;
+ t << "<area href=\"";
+
+ if ( isRef )
+ {
+ // handle doxygen \ref tag URL reference
+ QCString *dest;
+ DocRef *df = new DocRef( (DocNode*) 0, url );
+ if (!df->ref().isEmpty())
+ {
+ if ((dest=Doxygen::tagDestinationDict[df->ref()])) t << *dest << "/";
+ }
+ if (!df->file().isEmpty()) t << df->file() << Doxygen::htmlFileExtension;
+ if (!df->anchor().isEmpty()) t << "#" << df->anchor();
+ }
+ else
+ {
+ t << url;
+ }
+ t << "\" shape=\"rect\" coords=\""
+ << x1 << "," << y1 << "," << x2 << "," << y2 << "\""
+ << " alt=\"\">" << endl;
}
else // name and external reference are separated by a $
{
@@ -2220,7 +2248,7 @@ QString getDotImageMapFromFile(const QString& inFile, const QString& outDir)
QTextOStream tmpout(&result);
convertMapFile(tmpout, outFile, TRUE);
QDir().remove(outFile);
- //printf("result=%s\n",result.data());
+// printf("result=%s\n",result.data());
QDir::setCurrent(oldDir);
return result;
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 23c7a6d..9db76aa 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -16,6 +16,7 @@
*
*/
+#include <qdir.h>
#include "htmldocvisitor.h"
#include "docparser.h"
#include "language.h"
@@ -180,6 +181,7 @@ void HtmlDocVisitor::visit(DocStyleChange *s)
}
}
+
void HtmlDocVisitor::visit(DocVerbatim *s)
{
if (m_hide) return;
@@ -202,6 +204,31 @@ void HtmlDocVisitor::visit(DocVerbatim *s)
case DocVerbatim::XmlOnly:
/* nothing */
break;
+
+ case DocVerbatim::Dot:
+ {
+ static int dotindex = 1;
+ QCString fileName(4096);
+
+ fileName.sprintf("%s%d",
+ (Config_getString("HTML_OUTPUT")+"/inline_dotgraph_").data(),
+ dotindex++
+ );
+ QFile file(fileName);
+ if (!file.open(IO_WriteOnly))
+ {
+ err("Could not open file %s for writing\n",fileName.data());
+ }
+ file.writeBlock( s->text(), s->text().length() );
+ file.close();
+
+ m_t << "<div align=\"center\">" << endl;
+ writeDotFile(fileName);
+ m_t << "</div>" << endl;
+
+ file.remove();
+ }
+ break;
}
}
@@ -701,22 +728,8 @@ void HtmlDocVisitor::visitPost(DocImage *img)
void HtmlDocVisitor::visitPre(DocDotFile *df)
{
if (m_hide) return;
- QString baseName=df->file();
- int i;
- if ((i=baseName.findRev('/'))!=-1)
- {
- baseName=baseName.right(baseName.length()-i-1);
- }
- QString outDir = Config_getString("HTML_OUTPUT");
- writeDotGraphFromFile(df->file(),outDir,baseName,BITMAP);
+ writeDotFile(df->file());
m_t << "<div align=\"center\">" << endl;
- QString mapName = baseName+".map";
- QString mapFile = df->file()+".map";
- m_t << "<img src=\"" << baseName << "."
- << Config_getEnum("DOT_IMAGE_FORMAT") << "\" alt=\""
- << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl;
- QString imap = getDotImageMapFromFile(df->file(),outDir);
- m_t << "<map name=\"" << mapName << "\">" << imap << "</map>" << endl;
if (df->hasCaption())
{
m_t << "<p><strong>";
@@ -1000,3 +1013,22 @@ void HtmlDocVisitor::popEnabled()
delete v;
}
+void HtmlDocVisitor::writeDotFile(const QString &fileName)
+{
+ QString baseName=fileName;
+ int i;
+ if ((i=baseName.findRev('/'))!=-1)
+ {
+ baseName=baseName.right(baseName.length()-i-1);
+ }
+ QString outDir = Config_getString("HTML_OUTPUT");
+ writeDotGraphFromFile(fileName,outDir,baseName,BITMAP);
+ QString mapName = baseName+".map";
+ QString mapFile = fileName+".map";
+ m_t << "<img src=\"" << baseName << "."
+ << Config_getEnum("DOT_IMAGE_FORMAT") << "\" alt=\""
+ << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl;
+ QString imap = getDotImageMapFromFile(fileName,outDir);
+ m_t << "<map name=\"" << mapName << "\">" << imap << "</map>" << endl;
+}
+
diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h
index 0ba7d34..b0fd4ef 100644
--- a/src/htmldocvisitor.h
+++ b/src/htmldocvisitor.h
@@ -137,6 +137,7 @@ class HtmlDocVisitor : public DocVisitor
void startLink(const QString &ref,const QString &file,
const QString &anchor);
void endLink();
+ void writeDotFile(const QString &fileName);
void pushEnabled();
void popEnabled();
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 459fddb..1a6c889 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -263,6 +263,31 @@ void LatexDocVisitor::visit(DocVerbatim *s)
case DocVerbatim::LatexOnly:
m_t << s->text();
break;
+ case DocVerbatim::Dot:
+ {
+ static int dotindex = 1;
+ QCString fileName(4096);
+
+ fileName.sprintf("%s%d",
+ (Config_getString("LATEX_OUTPUT")+"/inline_dotgraph_").data(),
+ dotindex++
+ );
+ QFile file(fileName);
+ if (!file.open(IO_WriteOnly))
+ {
+ err("Could not open file %s for writing\n",fileName.data());
+ }
+ file.writeBlock( s->text(), s->text().length() );
+ file.close();
+
+ m_t << "\\begin{center}\n";
+ startDotFile(fileName,"","",FALSE);
+ endDotFile(FALSE);
+ m_t << "\\end{center}\n";
+
+ file.remove();
+ }
+ break;
}
}
@@ -742,58 +767,13 @@ void LatexDocVisitor::visitPost(DocImage *img)
void LatexDocVisitor::visitPre(DocDotFile *df)
{
if (m_hide) return;
- QString baseName=df->file();
- int i;
- if ((i=baseName.findRev('/'))!=-1)
- {
- baseName=baseName.right(baseName.length()-i-1);
- }
- if (baseName.right(4)==".eps" || baseName.right(4)==".pdf")
- {
- baseName=baseName.left(baseName.length()-4);
- }
- if (baseName.right(4)==".dot")
- {
- baseName=baseName.left(baseName.length()-4);
- }
- QString outDir = Config_getString("LATEX_OUTPUT");
- QString name = df->file();
- writeDotGraphFromFile(name,outDir,baseName,EPS);
- if (df->hasCaption())
- {
- m_t << "\\begin{figure}[H]" << endl;
- m_t << "\\begin{center}" << endl;
- }
- else
- {
- m_t << "\\mbox{";
- }
- m_t << "\\includegraphics";
- if (!df->width().isEmpty())
- {
- m_t << "[width=" << df->width() << "]";
- }
- else if (!df->height().isEmpty())
- {
- m_t << "[height=" << df->height() << "]";
- }
- m_t << "{" << baseName << "}";
-
- if (df->hasCaption())
- {
- m_t << "\\caption{";
- }
+ startDotFile(df->file(),df->width(),df->height(),df->hasCaption());
}
void LatexDocVisitor::visitPost(DocDotFile *df)
{
if (m_hide) return;
- m_t << "}" << endl; // end mbox or caption
- if (df->hasCaption())
- {
- m_t << "\\end{center}" << endl;
- m_t << "\\end{figure}" << endl;
- }
+ endDotFile(df->hasCaption());
}
void LatexDocVisitor::visitPre(DocLink *lnk)
@@ -1016,3 +996,63 @@ void LatexDocVisitor::popEnabled()
delete v;
}
+void LatexDocVisitor::startDotFile(const QString &fileName,
+ const QString &width,
+ const QString &height,
+ bool hasCaption
+ )
+{
+ QString baseName=fileName;
+ int i;
+ if ((i=baseName.findRev('/'))!=-1)
+ {
+ baseName=baseName.right(baseName.length()-i-1);
+ }
+ if (baseName.right(4)==".eps" || baseName.right(4)==".pdf")
+ {
+ baseName=baseName.left(baseName.length()-4);
+ }
+ if (baseName.right(4)==".dot")
+ {
+ baseName=baseName.left(baseName.length()-4);
+ }
+ QString outDir = Config_getString("LATEX_OUTPUT");
+ QString name = fileName;
+ writeDotGraphFromFile(name,outDir,baseName,EPS);
+ if (hasCaption)
+ {
+ m_t << "\\begin{figure}[H]" << endl;
+ m_t << "\\begin{center}" << endl;
+ }
+ else
+ {
+ m_t << "\\mbox{";
+ }
+ m_t << "\\includegraphics";
+ if (!width.isEmpty())
+ {
+ m_t << "[width=" << width << "]";
+ }
+ else if (!height.isEmpty())
+ {
+ m_t << "[height=" << height << "]";
+ }
+ m_t << "{" << baseName << "}";
+
+ if (hasCaption)
+ {
+ m_t << "\\caption{";
+ }
+}
+
+void LatexDocVisitor::endDotFile(bool hasCaption)
+{
+ if (m_hide) return;
+ m_t << "}" << endl; // end mbox or caption
+ if (hasCaption)
+ {
+ m_t << "\\end{center}" << endl;
+ m_t << "\\end{figure}" << endl;
+ }
+}
+
diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h
index 0b168d5..7b2d4ff 100644
--- a/src/latexdocvisitor.h
+++ b/src/latexdocvisitor.h
@@ -138,6 +138,9 @@ class LatexDocVisitor : public DocVisitor
void endLink(const QString &ref,const QString &file,
const QString &anchor);
QString escapeMakeIndexChars(const char *s);
+ void startDotFile(const QString &fileName,const QString &width,
+ const QString &height, bool hasCaption);
+ void endDotFile(bool hasCaption);
void pushEnabled();
void popEnabled();
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index cffcb5b..e330e1e 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -328,8 +328,8 @@ static void writeDefaultStyleSheetPart1(QTextStream &t)
t << "\\RequirePackage{calc}\n";
t << "\\RequirePackage{array}\n";
t << "\\pagestyle{fancyplain}\n";
- t << "\\addtolength{\\headwidth}{\\marginparsep}\n";
- t << "\\addtolength{\\headwidth}{\\marginparwidth}\n";
+ //t << "\\addtolength{\\headwidth}{\\marginparsep}\n";
+ //t << "\\addtolength{\\headwidth}{\\marginparwidth}\n";
t << "\\newcommand{\\clearemptydoublepage}{\\newpage{\\pagestyle{empty}";
t << "\\cleardoublepage}}\n";
if (!Config_getBool("COMPACT_LATEX"))
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index 341a50d..f7f8c84 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -201,6 +201,7 @@ void ManDocVisitor::visit(DocVerbatim *s)
case DocVerbatim::HtmlOnly:
case DocVerbatim::XmlOnly:
case DocVerbatim::LatexOnly:
+ case DocVerbatim::Dot:
/* nothing */
break;
}
diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp
index bd676ad..5184e66 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -621,6 +621,7 @@ void PerlModDocVisitor::visit(DocVerbatim *s)
case DocVerbatim::HtmlOnly: type = "htmlonly"; break;
case DocVerbatim::LatexOnly: type = "latexonly"; break;
case DocVerbatim::XmlOnly: type = "xmlonly"; break;
+ case DocVerbatim::Dot: type = "dot"; break;
}
openItem(type);
m_output.addFieldQuotedString("content", s->text());
diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h
index 1241659..4cf0b53 100644
--- a/src/printdocvisitor.h
+++ b/src/printdocvisitor.h
@@ -143,6 +143,7 @@ class PrintDocVisitor : public DocVisitor
case DocVerbatim::HtmlOnly: printf("<htmlonly>"); break;
case DocVerbatim::LatexOnly: printf("<latexonly>"); break;
case DocVerbatim::XmlOnly: printf("<xmlonly>"); break;
+ case DocVerbatim::Dot: printf("<dot>"); break;
}
printf("%s",s->text().data());
switch(s->type())
@@ -152,6 +153,7 @@ class PrintDocVisitor : public DocVisitor
case DocVerbatim::HtmlOnly: printf("</htmlonly>"); break;
case DocVerbatim::LatexOnly: printf("</latexonly>"); break;
case DocVerbatim::XmlOnly: printf("</xmlonly>"); break;
+ case DocVerbatim::Dot: printf("</dot>"); break;
}
}
void visit(DocAnchor *a)
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp