From 4fc5b2b154331fbf35800935889f1d0372334f0a Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 6 Oct 2013 21:28:00 +0200 Subject: Bug 707713 - Add support for dia diagrams --- doc/commands.doc | 19 ++++++++ doc/config.doc | 17 ++++++++ src/cmdmapper.cpp | 1 + src/cmdmapper.h | 3 +- src/compound.xsd | 7 ++- src/config.l | 25 ++++++++++- src/config.xml | 19 ++++++++ src/dia.cpp | 88 +++++++++++++++++++++++++++++++++++++ src/dia.h | 30 +++++++++++++ src/docbookvisitor.cpp | 87 +++++++++++++++++++++++++++++++++++++ src/docbookvisitor.h | 6 +++ src/docparser.cpp | 113 ++++++++++++++++++++++++++++++++++++++++++++++++ src/docparser.h | 28 +++++++++++- src/docvisitor.h | 3 ++ src/doxygen.cpp | 20 ++++++++- src/doxygen.css | 5 +++ src/doxygen.h | 1 + src/htmldocvisitor.cpp | 42 ++++++++++++++++++ src/htmldocvisitor.h | 3 ++ src/latexdocvisitor.cpp | 104 ++++++++++++++++++++++++++++++++++++++++++++ src/latexdocvisitor.h | 7 +++ src/libdoxygen.pro.in | 2 + src/mandocvisitor.cpp | 7 +++ src/mandocvisitor.h | 2 + src/msc.cpp | 8 ++-- src/perlmodgen.cpp | 16 +++++++ src/printdocvisitor.h | 10 +++++ src/rtfdocvisitor.cpp | 37 ++++++++++++++++ src/rtfdocvisitor.h | 3 ++ src/textdocvisitor.h | 2 + src/xmldocvisitor.cpp | 13 ++++++ src/xmldocvisitor.h | 2 + 32 files changed, 720 insertions(+), 10 deletions(-) create mode 100644 src/dia.cpp create mode 100644 src/dia.h diff --git a/doc/commands.doc b/doc/commands.doc index 912e9ec..b53c9d7 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -65,6 +65,7 @@ documentation: \refitem cmddefgroup \\defgroup \refitem cmddeprecated \\deprecated \refitem cmddetails \\details +\refitem cmddiafile \\diafile \refitem cmddir \\dir \refitem cmddocbookonly \\docbookonly \refitem cmddontinclude \\dontinclude @@ -2518,6 +2519,24 @@ class Receiver \sa section \ref cmdmsc "\\msc".
+\section cmddiafile \\diafile ["caption"] + + \addindex \\diafile + Inserts an image made in dia from \ into the documentation. + + The first argument specifies the file name of the image. + doxygen will look for files in the paths (or files) that you specified + after the \ref cfg_diafile_dirs "DIAFILE_DIRS" tag. + If the dia file is found it will be used as an input file dia. + The resulting image will be put into the correct output directory. + If the dia file name contains spaces you'll have to put quotes ("...") around it. + + The second argument is optional and can be used to specify the caption + that is displayed below the image. This argument has to be specified + between quotes even if it does not contain any spaces. The quotes are + stripped before the caption is displayed. + +
\section cmde \\e \addindex \\e diff --git a/doc/config.doc b/doc/config.doc index ec19732..1637275 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -88,6 +88,8 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_compact_rtf COMPACT_RTF \refitem cfg_cpp_cli_support CPP_CLI_SUPPORT \refitem cfg_create_subdirs CREATE_SUBDIRS +\refitem cfg_dia_path DIA_PATH +\refitem cfg_diafile_dirs DIAFILE_DIRS \refitem cfg_directory_graph DIRECTORY_GRAPH \refitem cfg_disable_index DISABLE_INDEX \refitem cfg_distribute_group_doc DISTRIBUTE_GROUP_DOC @@ -3306,6 +3308,14 @@ The default value is: YES. specify the directory where the \c mscgen tool resides. If left empty the tool is assumed to be found in the default search path. + \anchor cfg_dia_path +
\c DIA_PATH
+ \addindex DIA_PATH + You can include diagrams drawn in dia using the \ref cmddiafile "\\diafile" command. + Doxygen will run dia to produce the appropriate image and insert it in the documentation. + The DIA_PATH tag allows you to specify the directory where the \c dia + binary resides. If left empty the tool is assumed to be found in the default search path. + \anchor cfg_hide_undoc_relations
\c HIDE_UNDOC_RELATIONS
\addindex HIDE_UNDOC_RELATIONS @@ -3592,6 +3602,13 @@ This tag requires that the tag \ref cfg_have_dot "HAVE_DOT" is set to \c YES. contain msc files that are included in the documentation (see the \ref cmdmscfile "\\mscfile" command). + \anchor cfg_diafile_dirs +
\c DIAFILE_DIRS
+ \addindex DIAFILE_DIRS + The \c DIAFILE_DIRS tag can be used to specify one or more directories that + contain dia files that are included in the documentation (see the + \ref cmddiafile "\\diafile" command). + \anchor cfg_dot_graph_max_nodes
\c DOT_GRAPH_MAX_NODES
\addindex DOT_GRAPH_MAX_NODES diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index f4fc7e4..c728be3 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -134,6 +134,7 @@ CommandMap cmdMap[] = { "endinternal", CMD_ENDINTERNAL }, { "parblock", CMD_PARBLOCK }, { "endparblock", CMD_ENDPARBLOCK }, + { "diafile", CMD_DIAFILE }, { 0, 0 }, }; diff --git a/src/cmdmapper.h b/src/cmdmapper.h index f6d5ee6..0017c02 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -123,7 +123,8 @@ enum CommandType CMD_ENDDBONLY = 93, CMD_ENDINTERNAL = 94, CMD_PARBLOCK = 95, - CMD_ENDPARBLOCK = 96 + CMD_ENDPARBLOCK = 96, + CMD_DIAFILE = 97 }; enum HtmlTagType diff --git a/src/compound.xsd b/src/compound.xsd index 6a747b6..c1eb0ab 100644 --- a/src/compound.xsd +++ b/src/compound.xsd @@ -386,6 +386,7 @@ + @@ -501,7 +502,9 @@ - + + + @@ -628,7 +631,7 @@ - + diff --git a/src/config.l b/src/config.l index 19f0267..cc0a2f8 100644 --- a/src/config.l +++ b/src/config.l @@ -1311,7 +1311,30 @@ void Config::check() mscgenPath=""; } - + // check dia path + QCString &diaPath = Config_getString("DIA_PATH"); + if (!diaPath.isEmpty()) + { + QFileInfo dp(diaPath+"/dia"+portable_commandExtension()); + if (!dp.exists() || !dp.isFile()) + { + config_err("Warning: dia could not be found at %s\n",diaPath.data()); + diaPath=""; + } + else + { + diaPath=dp.dirPath(TRUE).utf8()+"/"; +#if defined(_WIN32) // convert slashes + uint i=0,l=diaPath.length(); + for (i=0;i + +