summaryrefslogtreecommitdiffstats
path: root/src/definition.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2018-09-15 17:32:30 (GMT)
committerGitHub <noreply@github.com>2018-09-15 17:32:30 (GMT)
commitb604de30d948b02d6f931d9411ed626a4d2b43d7 (patch)
tree7d609b39c6b8f8289f6542b82782ef80e111767d /src/definition.cpp
parent6c1c88f41aa68e6999bfa4b72e37c5a8034588a5 (diff)
parentd198c549fb88769912761d75277680438d88d69b (diff)
downloadDoxygen-b604de30d948b02d6f931d9411ed626a4d2b43d7.zip
Doxygen-b604de30d948b02d6f931d9411ed626a4d2b43d7.tar.gz
Doxygen-b604de30d948b02d6f931d9411ed626a4d2b43d7.tar.bz2
Merge pull request #6487 from albert-github/feature/bug_docbook
Implementation of standard generator for docbook output
Diffstat (limited to 'src/definition.cpp')
-rw-r--r--src/definition.cpp101
1 files changed, 100 insertions, 1 deletions
diff --git a/src/definition.cpp b/src/definition.cpp
index c9f4ac3..ec8c0cc 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -922,6 +922,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE);
static bool rtfSourceCode = Config_getBool(RTF_SOURCE_CODE);
+ static bool docbookSourceCode = Config_getBool(DOCBOOK_PROGRAMLISTING);
ol.pushGeneratorState();
//printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef);
QCString fn = getSourceFileBase();
@@ -946,11 +947,15 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.disable(OutputGenerator::Latex);
}
+ if (!docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (!rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
}
- // write line link (HTML, LaTeX optionally, RTF optionally)
+ // write line link (HTML and optionally LaTeX, Docbook, RTF)
ol.writeObjectLink(0,fn,anchorStr,lineStr);
ol.enableAll();
ol.disable(OutputGenerator::Html);
@@ -958,6 +963,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.disable(OutputGenerator::Latex);
}
+ if (docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -976,6 +985,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.disable(OutputGenerator::Latex);
}
+ if (!docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (!rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -988,6 +1001,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.disable(OutputGenerator::Latex);
}
+ if (docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1010,6 +1027,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.disable(OutputGenerator::Latex);
}
+ if (!docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (!rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1022,6 +1043,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.disable(OutputGenerator::Latex);
}
+ if (docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1041,6 +1066,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.enable(OutputGenerator::Latex);
}
+ if (docbookSourceCode)
+ {
+ ol.enable(OutputGenerator::Docbook);
+ }
if (rtfSourceCode)
{
ol.enable(OutputGenerator::RTF);
@@ -1053,6 +1082,10 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.disable(OutputGenerator::Latex);
}
+ if (docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1146,6 +1179,7 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName,
const QCString &text,MemberSDict *members,bool /*funcOnly*/)
{
static bool latexSourceCode = Config_getBool(LATEX_SOURCE_CODE);
+ static bool docbookSourceCode = Config_getBool(DOCBOOK_PROGRAMLISTING);
static bool rtfSourceCode = Config_getBool(RTF_SOURCE_CODE);
static bool sourceBrowser = Config_getBool(SOURCE_BROWSER);
static bool refLinkSource = Config_getBool(REFERENCES_LINK_SOURCE);
@@ -1204,6 +1238,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName,
{
ol.disable(OutputGenerator::Latex);
}
+ if (!docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (!rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1222,6 +1260,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName,
{
ol.disable(OutputGenerator::Latex);
}
+ if (docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1239,6 +1281,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName,
{
ol.disable(OutputGenerator::Latex);
}
+ if (!docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (!rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1256,6 +1302,10 @@ void Definition::_writeSourceRefList(OutputList &ol,const char *scopeName,
{
ol.disable(OutputGenerator::Latex);
}
+ if (docbookSourceCode)
+ {
+ ol.disable(OutputGenerator::Docbook);
+ }
if (rtfSourceCode)
{
ol.disable(OutputGenerator::RTF);
@@ -1682,6 +1732,55 @@ void Definition::writeToc(OutputList &ol, const LocalToc &localToc)
ol.popGeneratorState();
}
+ if (localToc.isDocbookEnabled())
+ {
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Docbook);
+ ol.writeString(" <toc>\n");
+ ol.writeString(" <title>" + theTranslator->trRTFTableOfContents() + "</title>\n");
+ SectionDict *sectionDict = getSectionDict();
+ SDict<SectionInfo>::Iterator li(*sectionDict);
+ SectionInfo *si;
+ int level=1,l;
+ bool inLi[5]={ FALSE, FALSE, FALSE, FALSE, FALSE };
+ int maxLevel = localToc.docbookLevel();
+ for (li.toFirst();(si=li.current());++li)
+ {
+ if (si->type==SectionInfo::Section ||
+ si->type==SectionInfo::Subsection ||
+ si->type==SectionInfo::Subsubsection ||
+ si->type==SectionInfo::Paragraph)
+ {
+ //printf(" level=%d title=%s\n",level,si->title.data());
+ int nextLevel = (int)si->type;
+ if (nextLevel>level)
+ {
+ for (l=level;l<nextLevel;l++)
+ {
+ if (l < maxLevel) ol.writeString(" <tocdiv>\n");
+ }
+ }
+ else if (nextLevel<level)
+ {
+ for (l=level;l>nextLevel;l--)
+ {
+ inLi[l]=FALSE;
+ if (l <= maxLevel) ol.writeString(" </tocdiv>\n");
+ }
+ }
+ if (nextLevel <= maxLevel)
+ {
+ QCString titleDoc = convertToDocBook(si->title);
+ ol.writeString(" <tocentry>" + (si->title.isEmpty()?si->label:titleDoc) + "</tocentry>\n");
+ }
+ inLi[nextLevel]=TRUE;
+ level = nextLevel;
+ }
+ }
+ ol.writeString(" </toc>\n");
+ ol.popGeneratorState();
+ }
+
if (localToc.isLatexEnabled())
{
ol.pushGeneratorState();