Index: src/rtfdocvisitor.cpp
===================================================================
--- src/rtfdocvisitor.cpp (révision 741)
+++ src/rtfdocvisitor.cpp (copie de travail)
@@ -22,6 +22,7 @@
#include "doxygen.h"
#include "outputgen.h"
#include "dot.h"
+#include "msc.h"
#include "util.h"
#include "rtfstyle.h"
#include "message.h"
@@ -1080,7 +1081,22 @@
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocDotFile)}\n");
popEnabled();
}
+void RTFDocVisitor::visitPre(DocMscFile *df)
+{
+ DBG_RTF("{\\comment RTFDocVisitor::visitPre(MscDotFile)}\n");
+ writeMscFile(df->file());
+ // hide caption since it is not supported at the moment
+ pushEnabled();
+ m_hide=TRUE;
+}
+
+void RTFDocVisitor::visitPost(DocMscFile *)
+{
+ DBG_RTF("{\\comment RTFDocVisitor::visitPost(MscDotFile)}\n");
+ popEnabled();
+}
+
void RTFDocVisitor::visitPre(DocLink *lnk)
{
if (m_hide) return;
Index: src/docvisitor.h
===================================================================
--- src/docvisitor.h (révision 741)
+++ src/docvisitor.h (copie de travail)
@@ -65,6 +65,7 @@
class DocHtmlHeader;
class DocImage;
class DocDotFile;
+class DocMscFile;
class DocLink;
class DocRef;
class DocFormula;
@@ -158,7 +159,9 @@
virtual void visitPost(DocImage *) = 0;
virtual void visitPre(DocDotFile *) = 0;
virtual void visitPost(DocDotFile *) = 0;
- virtual void visitPre(DocLink *) = 0;
+ virtual void visitPre(DocMscFile *) = 0;
+ virtual void visitPost(DocMscFile *) = 0;
+virtual void visitPre(DocLink *) = 0;
virtual void visitPost(DocLink *) = 0;
virtual void visitPre(DocRef *) = 0;
virtual void visitPost(DocRef *) = 0;
Index: src/portable.cpp
===================================================================
--- src/portable.cpp (révision 741)
+++ src/portable.cpp (copie de travail)
@@ -43,9 +43,9 @@
}
fullCmd += " ";
fullCmd += args;
-#ifndef NODEBUG
+//#ifndef NODEBUG
Debug::print(Debug::ExtCmd,0,"Executing external command `%s`\n",fullCmd.data());
-#endif
+//#endif
#if !defined(_WIN32) || defined(__CYGWIN__)
commandHasConsole=commandHasConsole;
Index: src/cmdmapper.cpp
===================================================================
--- src/cmdmapper.cpp (révision 741)
+++ src/cmdmapper.cpp (copie de travail)
@@ -37,7 +37,7 @@
{ "dontinclude", CMD_DONTINCLUDE },
{ "dotfile", CMD_DOTFILE },
{ "e", CMD_EMPHASIS },
- { "em", CMD_EMPHASIS },
+ { "em", CMD_EMPHASIS} ,
{ "endcode", CMD_ENDCODE },
{ "endhtmlonly", CMD_ENDHTMLONLY },
{ "endlatexonly", CMD_ENDLATEXONLY },
@@ -112,7 +112,8 @@
{ "endmanonly", CMD_ENDMANONLY },
{ "includelineno", CMD_INCWITHLINES },
{ "inheritdoc", CMD_INHERITDOC },
- { 0, 0 }
+ { "mscfile", CMD_MSCFILE },
+ { 0, 0 },
};
//----------------------------------------------------------------------------
Index: src/mandocvisitor.cpp
===================================================================
--- src/mandocvisitor.cpp (révision 741)
+++ src/mandocvisitor.cpp (copie de travail)
@@ -718,7 +718,15 @@
void ManDocVisitor::visitPost(DocDotFile *)
{
}
+void ManDocVisitor::visitPre(DocMscFile *)
+{
+}
+void ManDocVisitor::visitPost(DocMscFile *)
+{
+}
+
+
void ManDocVisitor::visitPre(DocLink *)
{
if (m_hide) return;
Index: src/rtfdocvisitor.h
===================================================================
--- src/rtfdocvisitor.h (révision 741)
+++ src/rtfdocvisitor.h (copie de travail)
@@ -104,7 +104,9 @@
void visitPost(DocImage *);
void visitPre(DocDotFile *);
void visitPost(DocDotFile *);
- void visitPre(DocLink *lnk);
+ void visitPre(DocMscFile *);
+ void visitPost(DocMscFile *);
+ void visitPre(DocLink *);
void visitPost(DocLink *);
void visitPre(DocRef *ref);
void visitPost(DocRef *);
Index: src/printdocvisitor.h
===================================================================
--- src/printdocvisitor.h (révision 741)
+++ src/printdocvisitor.h (copie de travail)
@@ -503,6 +503,16 @@
indent_post();
printf("\n");
}
+ void visitPre(DocMscFile *df)
+ {
+ indent_pre();
+ printf("\n",df->name().data());
+ }
+ void visitPost(DocMscFile *)
+ {
+ indent_post();
+ printf("\n");
+ }
void visitPre(DocLink *lnk)
{
indent_pre();
Index: src/xmldocvisitor.h
===================================================================
--- src/xmldocvisitor.h (révision 741)
+++ src/xmldocvisitor.h (copie de travail)
@@ -96,7 +96,8 @@
void visitPre(DocHtmlCaption *);
void visitPost(DocHtmlCaption *);
void visitPre(DocInternal *);
- void visitPost(DocInternal *);
+
+void visitPost(DocInternal *);
void visitPre(DocHRef *);
void visitPost(DocHRef *);
void visitPre(DocHtmlHeader *);
@@ -105,6 +106,9 @@
void visitPost(DocImage *);
void visitPre(DocDotFile *);
void visitPost(DocDotFile *);
+
+ void visitPre(DocMscFile *);
+ void visitPost(DocMscFile *);
void visitPre(DocLink *);
void visitPost(DocLink *);
void visitPre(DocRef *);
Index: src/configoptions.cpp
===================================================================
--- src/configoptions.cpp (révision 741)
+++ src/configoptions.cpp (copie de travail)
@@ -2186,6 +2186,14 @@
cl->addDependency("HAVE_DOT");
cl->setWidgetType(ConfigList::Dir);
//----
+ cl = cfg->addList(
+ "MSCFILE_DIRS",
+ "The MSCFILE_DIRS tag can be used to specify one or more directories that\n"
+ "contain msc files that are included in the documentation (see the\n"
+ "\\mscfile command)."
+ );
+ cl->setWidgetType(ConfigList::Dir);
+ //----
ci = cfg->addInt(
"DOT_GRAPH_MAX_NODES",
"The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of\n"
Index: src/docparser.cpp
===================================================================
--- src/docparser.cpp (révision 741)
+++ src/docparser.cpp (copie de travail)
@@ -2526,7 +2526,88 @@
ASSERT(n==this);
}
+DocMscFile::DocMscFile(DocNode *parent,const QCString &name,const QCString &context) :
+ m_name(name), m_relPath(g_relPath), m_context(context)
+{
+ m_parent = parent;
+}
+void DocMscFile::parse()
+{
+ g_nodeStack.push(this);
+ DBG(("DocMscFile::parse() start\n"));
+
+ doctokenizerYYsetStateTitle();
+ int tok;
+ while ((tok=doctokenizerYYlex()))
+ {
+ if (!defaultHandleToken(this,tok,m_children))
+ {
+ switch (tok)
+ {
+ case TK_COMMAND:
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: Illegal command %s as part of a \\mscfile",
+ qPrint(g_token->name));
+ break;
+ case TK_SYMBOL:
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: Unsupported symbol %s found",
+ qPrint(g_token->name));
+ break;
+ default:
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: Unexpected token %s",
+ tokToString(tok));
+ break;
+ }
+ }
+ }
+ tok=doctokenizerYYlex();
+ while (tok==TK_WORD) // there are values following the title
+ {
+ if (g_token->name=="width")
+ {
+ m_width=g_token->chars;
+ }
+ else if (g_token->name=="height")
+ {
+ m_height=g_token->chars;
+ }
+ else
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: Unknown option %s after image title",
+ qPrint(g_token->name));
+ }
+ tok=doctokenizerYYlex();
+ }
+ ASSERT(tok==0);
+ doctokenizerYYsetStatePara();
+ handlePendingStyleCommands(this,m_children);
+
+ bool ambig;
+ FileDef *fd = findFileDef(Doxygen::mscFileNameDict,m_name,ambig);
+ if (fd)
+ {
+ m_file = fd->absFilePath();
+ }
+ else if (ambig)
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: included msc file name %s is ambiguous.\n"
+ "Possible candidates:\n%s",qPrint(m_name),
+ qPrint(showFileDefMatches(Doxygen::exampleNameDict,m_name))
+ );
+ }
+ else
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: included dot file %s is not found "
+ "in any of the paths specified via MSCFILE_DIRS!",qPrint(m_name));
+ }
+
+ DBG(("DocMscFile::parse() end\n"));
+ DocNode *n=g_nodeStack.pop();
+ ASSERT(n==this);
+}
+
+
+
//---------------------------------------------------------------------------
DocImage::DocImage(DocNode *parent,const HtmlAttribList &attribs,const QCString &name,Type t) :
@@ -4391,6 +4472,29 @@
m_children.append(df);
df->parse();
}
+void DocPara::handleMscFile(const QCString &cmdName)
+{
+ int tok=doctokenizerYYlex();
+ if (tok!=TK_WHITESPACE)
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: expected whitespace after %s command",
+ qPrint(cmdName));
+ return;
+ }
+ doctokenizerYYsetStateFile();
+ tok=doctokenizerYYlex();
+ doctokenizerYYsetStatePara();
+ if (tok!=TK_WORD)
+ {
+ warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: unexpected token %s as the argument of %s",
+ tokToString(tok),qPrint(cmdName));
+ return;
+ }
+ QCString name = g_token->name;
+ DocMscFile *df = new DocMscFile(this,name,g_context);
+ m_children.append(df);
+ df->parse();
+}
void DocPara::handleLink(const QCString &cmdName,bool isJavaLink)
{
@@ -4903,6 +5007,9 @@
case CMD_DOTFILE:
handleDotFile(cmdName);
break;
+ case CMD_MSCFILE:
+ handleMscFile(cmdName);
+ break;
case CMD_LINK:
handleLink(cmdName,FALSE);
break;
Index: src/mandocvisitor.h
===================================================================
--- src/mandocvisitor.h (révision 741)
+++ src/mandocvisitor.h (copie de travail)
@@ -104,6 +104,8 @@
void visitPost(DocImage *);
void visitPre(DocDotFile *);
void visitPost(DocDotFile *);
+ void visitPre(DocMscFile *);
+ void visitPost(DocMscFile *);
void visitPre(DocLink *lnk);
void visitPost(DocLink *);
void visitPre(DocRef *ref);
Index: src/htmldocvisitor.cpp
===================================================================
--- src/htmldocvisitor.cpp (révision 741)
+++ src/htmldocvisitor.cpp (copie de travail)
@@ -1224,6 +1224,26 @@
m_t << "" << endl;
}
+void HtmlDocVisitor::visitPre(DocMscFile *df)
+{
+ if (m_hide) return;
+ writeMscFile(df->file(),df->relPath(),df->context());
+ m_t << "
" << endl;
+ if (df->hasCaption())
+ {
+ m_t << "
";
+ }
+}
+void HtmlDocVisitor::visitPost(DocMscFile *df)
+{
+ if (m_hide) return;
+ if (df->hasCaption())
+ {
+ m_t << "
" << endl;
+ }
+ m_t << "
" << endl;
+}
+
void HtmlDocVisitor::visitPre(DocLink *lnk)
{
if (m_hide) return;
Index: src/docparser.h
===================================================================
--- src/docparser.h (révision 741)
+++ src/docparser.h (copie de travail)
@@ -131,7 +131,8 @@
Kind_ParamList = 44,
Kind_InternalRef = 45,
Kind_Copy = 46,
- Kind_Text = 47
+ Kind_Text = 47,
+ Kind_MscFile = 48,
};
/*! Creates a new node */
DocNode() : m_parent(0), m_insidePre(FALSE) {}
@@ -608,6 +609,31 @@
QCString m_context;
};
+/*! @brief Node representing a msc file */
+class DocMscFile : public CompAccept, public DocNode
+{
+ public:
+ DocMscFile(DocNode *parent,const QCString &name,const QCString &context);
+ void parse();
+ Kind kind() const { return Kind_MscFile; }
+ QCString name() const { return m_name; }
+ QCString file() const { return m_file; }
+ QCString relPath() const { return m_relPath; }
+ bool hasCaption() const { return !m_children.isEmpty(); }
+ QCString width() const { return m_width; }
+ QCString height() const { return m_height; }
+ QCString context() const { return m_context; }
+ void accept(DocVisitor *v) { CompAccept::accept(this,v); }
+ private:
+ QCString m_name;
+ QCString m_file;
+ QCString m_relPath;
+ QCString m_width;
+ QCString m_height;
+ QCString m_context;
+};
+
+
/*! @brief Node representing a link to some item */
class DocLink : public CompAccept, public DocNode
{
@@ -944,6 +970,7 @@
void handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type t);
void handleImage(const QCString &cmdName);
void handleDotFile(const QCString &cmdName);
+ void handleMscFile(const QCString &cmdName);
void handleInclude(const QCString &cmdName,DocInclude::Type t);
void handleLink(const QCString &cmdName,bool isJavaLink);
void handleRef(const QCString &cmdName);
Index: src/cmdmapper.h
===================================================================
--- src/cmdmapper.h (révision 741)
+++ src/cmdmapper.h (copie de travail)
@@ -113,7 +113,8 @@
CMD_TPARAM = 79 | SIMPLESECT_BIT,
CMD_COPYBRIEF = 80,
CMD_COPYDETAILS = 81,
- CMD_QUOTE = 82
+ CMD_QUOTE = 82,
+ CMD_MSCFILE = 83,
};
enum HtmlTagType
@@ -189,7 +190,7 @@
return !name.isEmpty() && (result=m_map.find(name)) ? *result: 0;
}
- Mapper(const CommandMap *cm,bool caseSensitive) : m_map(89), m_cs(caseSensitive)
+ Mapper(const CommandMap *cm,bool caseSensitive) : m_map(90), m_cs(caseSensitive)
{
m_map.setAutoDelete(TRUE);
const CommandMap *p = cm;
Index: src/htmldocvisitor.h
===================================================================
--- src/htmldocvisitor.h (révision 741)
+++ src/htmldocvisitor.h (copie de travail)
@@ -103,6 +103,8 @@
void visitPost(DocImage *);
void visitPre(DocDotFile *);
void visitPost(DocDotFile *);
+ void visitPre(DocMscFile *);
+ void visitPost(DocMscFile *);
void visitPre(DocLink *);
void visitPost(DocLink *);
void visitPre(DocRef *);
Index: src/doxygen.h
===================================================================
--- src/doxygen.h (révision 741)
+++ src/doxygen.h (copie de travail)
@@ -92,6 +92,7 @@
static FileNameList *inputNameList;
static FileNameDict *imageNameDict;
static FileNameDict *dotFileNameDict;
+ static FileNameDict *mscFileNameDict;
static QStrList tagfileList;
static MemberNameSDict *memberNameSDict;
static MemberNameSDict *functionNameSDict;
Index: src/config.xml
===================================================================
--- src/config.xml (révision 741)
+++ src/config.xml (copie de travail)
@@ -1431,6 +1431,14 @@
\dotfile command).
' depends='HAVE_DOT'>
+
+
+