Commit 4fbc3452 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-1.2.18-20021106

parent afc47efd
DOXYGEN Version 1.2.18-20021030 DOXYGEN Version 1.2.18-20021106
Please read the installation section of the manual for instructions. Please read the installation section of the manual for instructions.
-------- --------
Dimitri van Heesch (30 October 2002) Dimitri van Heesch (06 November 2002)
DOXYGEN Version 1.2.18_20021030 DOXYGEN Version 1.2.18_20021106
Please read INSTALL for compilation instructions. Please read INSTALL for compilation instructions.
...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. ...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy, Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (30 October 2002) Dimitri van Heesch (dimitri@stack.nl) (06 November 2002)
1.2.18-20021030 1.2.18-20021106
...@@ -159,10 +159,13 @@ class IDoc ...@@ -159,10 +159,13 @@ class IDoc
Row, // 27 -> IDocRow Row, // 27 -> IDocRow
Entry, // 28 -> IDocEntry Entry, // 28 -> IDocEntry
Section, // 29 -> IDocSection Section, // 29 -> IDocSection
Preformatted, // 30 -> IDocPreformatted Verbatim, // 30 -> IDocVerbatim
Verbatim, // 31 -> IDocVerbatim Copy, // 31 -> IDocCopy
Symbol, // 32 -> IDocSymbol TocList, // 32 -> IDocTocList
Root // 33 -> IDocRoot TocItem, // 33 -> IDocTocItem
Anchor, // 34 -> IDocAnchor
Symbol, // 35 -> IDocSymbol
Root // 36 -> IDocRoot
}; };
virtual Kind kind() const = 0; virtual Kind kind() const = 0;
}; };
...@@ -172,14 +175,16 @@ class IDocMarkup : public IDoc ...@@ -172,14 +175,16 @@ class IDocMarkup : public IDoc
public: public:
enum Markup enum Markup
{ {
Normal = 0x00, Normal = 0x000,
Bold = 0x01, Bold = 0x001,
Emphasis = 0x02, Emphasis = 0x002,
ComputerOutput = 0x04, ComputerOutput = 0x004,
Subscript = 0x08, Subscript = 0x008,
Superscript = 0x10, Superscript = 0x010,
SmallFont = 0x20, SmallFont = 0x020,
Center = 0x40 Center = 0x040,
Preformatted = 0x080,
Heading = 0x100
}; };
}; };
...@@ -194,6 +199,7 @@ class IDocText : public IDocMarkup ...@@ -194,6 +199,7 @@ class IDocText : public IDocMarkup
public: public:
virtual const IString * text() const = 0; virtual const IString * text() const = 0;
virtual int markup() const = 0; virtual int markup() const = 0;
virtual int headingLevel() const = 0;
}; };
class IDocMarkupModifier : public IDoc class IDocMarkupModifier : public IDoc
...@@ -201,6 +207,7 @@ class IDocMarkupModifier : public IDoc ...@@ -201,6 +207,7 @@ class IDocMarkupModifier : public IDoc
public: public:
virtual bool enabled() const = 0; virtual bool enabled() const = 0;
virtual int markup() const = 0; virtual int markup() const = 0;
virtual int headingLevel() const = 0;
}; };
class IDocItemizedList : public IDoc class IDocItemizedList : public IDoc
...@@ -278,7 +285,7 @@ class IDocVariableList : public IDoc ...@@ -278,7 +285,7 @@ class IDocVariableList : public IDoc
class IDocVariableListEntry : public IDoc class IDocVariableListEntry : public IDoc
{ {
public: public:
virtual const IString * term() const = 0; virtual ILinkedTextIterator * term() const = 0;
virtual IDocPara *description() const = 0; virtual IDocPara *description() const = 0;
}; };
...@@ -393,7 +400,20 @@ class IDocSection : public IDoc ...@@ -393,7 +400,20 @@ class IDocSection : public IDoc
virtual IDocIterator *title() const = 0; virtual IDocIterator *title() const = 0;
}; };
class IDocPreformatted : public IDoc class IDocTocList : public IDoc
{
public:
virtual IDocIterator *elements() const = 0;
};
class IDocTocItem : public IDoc
{
public:
virtual const IString *id() const = 0;
virtual const IString *title() const = 0;
};
class IDocCopy : public IDoc
{ {
public: public:
virtual IDocIterator *contents() const = 0; virtual IDocIterator *contents() const = 0;
...@@ -402,7 +422,15 @@ class IDocPreformatted : public IDoc ...@@ -402,7 +422,15 @@ class IDocPreformatted : public IDoc
class IDocVerbatim : public IDoc class IDocVerbatim : public IDoc
{ {
public: public:
enum Types { Invalid = 0, HtmlOnly, LatexOnly, Verbatim };
virtual const IString *text() const = 0; virtual const IString *text() const = 0;
virtual Types type() const = 0;
};
class IDocAnchor : public IDoc
{
public:
virtual const IString *id() const = 0;
}; };
class IDocSymbol : public IDoc class IDocSymbol : public IDoc
......
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
#include "debug.h" #include "debug.h"
#include "graphhandler.h" #include "graphhandler.h"
#include "sectionhandler.h" #include "sectionhandler.h"
#include "paramhandler.h"
#include "loamhandler.h" #include "loamhandler.h"
#include "memberhandler.h"
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
...@@ -13,9 +13,12 @@ ...@@ -13,9 +13,12 @@
* *
*/ */
#include <qmap.h>
#include "dochandler.h" #include "dochandler.h"
#include "debug.h" #include "debug.h"
#include <qmap.h> #include "linkedtexthandler.h"
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -95,7 +98,8 @@ void dochandler_exit() ...@@ -95,7 +98,8 @@ void dochandler_exit()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString) MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString)
: m_children(children), m_curString(curString), m_curMarkup(IDocMarkup::Normal) : m_children(children), m_curString(curString),
m_curMarkup(IDocMarkup::Normal), m_headingLevel(0)
{ {
addStartHandler("bold",this,&MarkupHandler::startBold); addStartHandler("bold",this,&MarkupHandler::startBold);
addEndHandler("bold",this,&MarkupHandler::endBold); addEndHandler("bold",this,&MarkupHandler::endBold);
...@@ -117,6 +121,27 @@ MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString) ...@@ -117,6 +121,27 @@ MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString)
addStartHandler("superscript",this,&MarkupHandler::startSuperscript); addStartHandler("superscript",this,&MarkupHandler::startSuperscript);
addEndHandler("superscript",this,&MarkupHandler::endSuperscript); addEndHandler("superscript",this,&MarkupHandler::endSuperscript);
addStartHandler("preformatted",this,&MarkupHandler::startPreformatted);
addEndHandler("preformatted",this,&MarkupHandler::endPreformatted);
addStartHandler("heading1",this,&MarkupHandler::startHeading1);
addEndHandler("heading1",this,&MarkupHandler::endHeading1);
addStartHandler("heading2",this,&MarkupHandler::startHeading2);
addEndHandler("heading2",this,&MarkupHandler::endHeading2);
addStartHandler("heading3",this,&MarkupHandler::startHeading3);
addEndHandler("heading3",this,&MarkupHandler::endHeading3);
addStartHandler("heading4",this,&MarkupHandler::startHeading4);
addEndHandler("heading4",this,&MarkupHandler::endHeading4);
addStartHandler("heading5",this,&MarkupHandler::startHeading5);
addEndHandler("heading5",this,&MarkupHandler::endHeading5);
addStartHandler("heading6",this,&MarkupHandler::startHeading6);
addEndHandler("heading6",this,&MarkupHandler::endHeading6);
} }
MarkupHandler::~MarkupHandler() MarkupHandler::~MarkupHandler()
...@@ -127,7 +152,7 @@ void MarkupHandler::addTextNode() ...@@ -127,7 +152,7 @@ void MarkupHandler::addTextNode()
{ {
if (!m_curString.isEmpty()) if (!m_curString.isEmpty())
{ {
m_children.append(new TextNode(m_curString,m_curMarkup)); m_children.append(new TextNode(m_curString,m_curMarkup,m_headingLevel));
debug(2,"addTextNode() text=%s markup=%x\n",m_curString.data(),m_curMarkup); debug(2,"addTextNode() text=%s markup=%x\n",m_curString.data(),m_curMarkup);
m_curString=""; m_curString="";
} }
...@@ -231,6 +256,117 @@ void MarkupHandler::endSuperscript() ...@@ -231,6 +256,117 @@ void MarkupHandler::endSuperscript()
m_curMarkup &= ~IDocMarkup::Superscript; m_curMarkup &= ~IDocMarkup::Superscript;
} }
void MarkupHandler::startPreformatted(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,TRUE));
m_curMarkup |= IDocMarkup::Preformatted;
}
void MarkupHandler::endPreformatted()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,FALSE));
m_curMarkup &= ~IDocMarkup::Preformatted;
}
void MarkupHandler::startHeading1(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,1));
m_curMarkup |= IDocMarkup::Heading;
m_headingLevel=1;
}
void MarkupHandler::endHeading1()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,1));
m_curMarkup &= ~IDocMarkup::Heading;
m_headingLevel=0;
}
void MarkupHandler::startHeading2(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,2));
m_curMarkup |= IDocMarkup::Heading;
m_headingLevel=2;
}
void MarkupHandler::endHeading2()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,2));
m_curMarkup &= ~IDocMarkup::Heading;
m_headingLevel=0;
}
void MarkupHandler::startHeading3(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,3));
m_curMarkup |= IDocMarkup::Heading;
m_headingLevel=3;
}
void MarkupHandler::endHeading3()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,3));
m_curMarkup &= ~IDocMarkup::Heading;
m_headingLevel=0;
}
void MarkupHandler::startHeading4(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,4));
m_curMarkup |= IDocMarkup::Heading;
m_headingLevel=4;
}
void MarkupHandler::endHeading4()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,4));
m_curMarkup &= ~IDocMarkup::Heading;
m_headingLevel=0;
}
void MarkupHandler::startHeading5(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,5));
m_curMarkup |= IDocMarkup::Heading;
m_headingLevel=5;
}
void MarkupHandler::endHeading5()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,5));
m_curMarkup &= ~IDocMarkup::Heading;
m_headingLevel=0;
}
void MarkupHandler::startHeading6(const QXmlAttributes & /*attrib*/)
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,6));
m_curMarkup |= IDocMarkup::Heading;
m_headingLevel=6;
}
void MarkupHandler::endHeading6()
{
addTextNode();
m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,6));
m_curMarkup &= ~IDocMarkup::Heading;
m_headingLevel=0;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// ListItemHandler // ListItemHandler
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -347,6 +483,69 @@ IDocIterator *ItemizedListHandler::elements() const ...@@ -347,6 +483,69 @@ IDocIterator *ItemizedListHandler::elements() const
return new ItemizedListIterator(*this); return new ItemizedListIterator(*this);
} }
//----------------------------------------------------------------------
// TocListHandler
//----------------------------------------------------------------------
TocListHandler::TocListHandler(IBaseHandler *parent) : m_parent(parent)
{
m_children.setAutoDelete(TRUE);
addEndHandler("toclist",this,&TocListHandler::endTocList);
addStartHandler("tocitem",this,&TocListHandler::startTocItem);
}
TocListHandler::~TocListHandler()
{
}
void TocListHandler::startTocList(const QXmlAttributes& /*attrib*/)
{
m_parent->setDelegate(this);
}
void TocListHandler::endTocList()
{
m_parent->setDelegate(0);
}
void TocListHandler::startTocItem(const QXmlAttributes& attrib)
{
TocItemHandler *tiHandler = new TocItemHandler(this);
tiHandler->startTocItem(attrib);
m_children.append(tiHandler);
}
IDocIterator *TocListHandler::elements() const
{
return new TocListIterator(*this);
}
//----------------------------------------------------------------------
// TocItemHandler
//----------------------------------------------------------------------
TocItemHandler::TocItemHandler(IBaseHandler *parent) : m_parent(parent)
{
addEndHandler("tocitem",this,&TocItemHandler::endTocItem);
}
TocItemHandler::~TocItemHandler()
{
}
void TocItemHandler::startTocItem(const QXmlAttributes& attrib)
{
m_parent->setDelegate(this);
m_id = attrib.value("id");
m_curString="";
}
void TocItemHandler::endTocItem()
{
m_title = m_curString;
m_parent->setDelegate(0);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// ParameterHandler // ParameterHandler
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -663,9 +862,15 @@ void TitleHandler::addTextNode() ...@@ -663,9 +862,15 @@ void TitleHandler::addTextNode()
{ {
if (!m_curString.isEmpty()) if (!m_curString.isEmpty())
{ {
m_children.append(new TextNode(m_curString,m_markupHandler->markup())); m_children.append(
debug(2,"addTextNode() text=\"%s\" markup=%x\n", new TextNode(
m_curString.data(),m_markupHandler->markup()); m_curString,
m_markupHandler->markup(),
m_markupHandler->headingLevel()
)
);
debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
m_curString=""; m_curString="";
} }
} }
...@@ -731,7 +936,7 @@ void SimpleSectHandler::startParagraph(const QXmlAttributes& attrib) ...@@ -731,7 +936,7 @@ void SimpleSectHandler::startParagraph(const QXmlAttributes& attrib)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
VariableListEntryHandler::VariableListEntryHandler(IBaseHandler *parent) VariableListEntryHandler::VariableListEntryHandler(IBaseHandler *parent)
: m_parent(parent), m_description(0) : m_parent(parent), m_description(0), m_linkedTextHandler(0)
{ {
addStartHandler("term",this,&VariableListEntryHandler::startTerm); addStartHandler("term",this,&VariableListEntryHandler::startTerm);
addEndHandler("term",this,&VariableListEntryHandler::endTerm); addEndHandler("term",this,&VariableListEntryHandler::endTerm);
...@@ -772,12 +977,13 @@ void VariableListEntryHandler::endListItem() ...@@ -772,12 +977,13 @@ void VariableListEntryHandler::endListItem()
void VariableListEntryHandler::startTerm(const QXmlAttributes& /*attrib*/) void VariableListEntryHandler::startTerm(const QXmlAttributes& /*attrib*/)
{ {
m_curString=""; m_curString="";
m_linkedTextHandler = new LinkedTextHandler(this,m_term);
m_linkedTextHandler->start("term");
} }
void VariableListEntryHandler::endTerm() void VariableListEntryHandler::endTerm()
{ {
m_term = m_curString; delete m_linkedTextHandler;
debug(2,"term=%s\n",m_term.data());
} }
void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib) void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib)
...@@ -787,6 +993,10 @@ void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib) ...@@ -787,6 +993,10 @@ void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib)
m_description->startParagraph(attrib); m_description->startParagraph(attrib);
} }
ILinkedTextIterator *VariableListEntryHandler::term() const
{
return new LinkedTextIterator(m_term);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -881,7 +1091,7 @@ void HighlightHandler::addTextNode() ...@@ -881,7 +1091,7 @@ void HighlightHandler::addTextNode()
{ {
if (!m_curString.isEmpty()) if (!m_curString.isEmpty())
{ {
m_children.append(new TextNode(m_curString,IDocMarkup::Normal)); m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
debug(2,"addTextNode() text=\"%s\"\n", debug(2,"addTextNode() text=\"%s\"\n",
m_curString.data()); m_curString.data());
m_curString=""; m_curString="";
...@@ -958,7 +1168,7 @@ void CodeLineHandler::addTextNode() ...@@ -958,7 +1168,7 @@ void CodeLineHandler::addTextNode()
{ {
if (!m_curString.isEmpty()) if (!m_curString.isEmpty())
{ {
m_children.append(new TextNode(m_curString,IDocMarkup::Normal)); m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
debug(2,"addTextNode() text=\"%s\"\n", debug(2,"addTextNode() text=\"%s\"\n",
m_curString.data()); m_curString.data());
m_curString=""; m_curString="";
...@@ -1062,6 +1272,32 @@ void FormulaHandler::endFormula() ...@@ -1062,6 +1272,32 @@ void FormulaHandler::endFormula()
m_parent->setDelegate(0); m_parent->setDelegate(0);
} }
//----------------------------------------------------------------------
// AnchorHandler
//----------------------------------------------------------------------
AnchorHandler::AnchorHandler(IBaseHandler *parent)
: m_parent(parent)
{
addEndHandler("anchor",this,&AnchorHandler::endAnchor);
}
AnchorHandler::~AnchorHandler()
{
}
void AnchorHandler::startAnchor(const QXmlAttributes& attrib)
{
m_id = attrib.value("id");
m_parent->setDelegate(this);
}
void AnchorHandler::endAnchor()
{
debug(2,"anchor id=`%s'\n",m_id.data());
m_parent->setDelegate(0);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// ImageHandler // ImageHandler
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -1298,33 +1534,45 @@ IDocIterator *TableHandler::rows() const ...@@ -1298,33 +1534,45 @@ IDocIterator *TableHandler::rows() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// PreformattedHandler // CopyHandler
//---------------------------------------------------------------------- //----------------------------------------------------------------------
PreformattedHandler::PreformattedHandler(IBaseHandler *parent) CopyHandler::CopyHandler(IBaseHandler *parent)
: m_parent(parent) : m_parent(parent)
{ {
m_children.setAutoDelete(TRUE); m_children.setAutoDelete(TRUE);
addEndHandler("preformatted",this,&PreformattedHandler::endPreformatted);
addEndHandler("copydoc",this,&CopyHandler::endCopy);
addStartHandler("para",this,&CopyHandler::startParagraph);
} }
PreformattedHandler::~PreformattedHandler() CopyHandler::~CopyHandler()
{ {
} }
void PreformattedHandler::startPreformatted(const QXmlAttributes&) void CopyHandler::startCopy(const QXmlAttributes& /*attrib*/)
{ {
m_parent->setDelegate(this); m_parent->setDelegate(this);
debug(2,"start copy handler\n");
} }
void PreformattedHandler::endPreformatted() void CopyHandler::endCopy()
{ {
debug(2,"end copy handler\n");
m_parent->setDelegate(0); m_parent->setDelegate(0);
} }
IDocIterator *PreformattedHandler::contents() const void CopyHandler::startParagraph(const QXmlAttributes& attrib)
{ {
return new PreformattedIterator(*this); ParagraphHandler *parHandler = new ParagraphHandler(this);
parHandler->startParagraph(attrib);
m_children.append(parHandler);
}
IDocIterator *CopyHandler::contents() const
{
return new CopyIterator(*this);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -1332,17 +1580,20 @@ IDocIterator *PreformattedHandler::contents() const ...@@ -1332,17 +1580,20 @@ IDocIterator *PreformattedHandler::contents() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
VerbatimHandler::VerbatimHandler(IBaseHandler *parent) VerbatimHandler::VerbatimHandler(IBaseHandler *parent)
: m_parent(parent) : m_parent(parent), m_type(IDocVerbatim::Invalid)
{ {
addEndHandler("verbatim",this,&VerbatimHandler::endVerbatim); addEndHandler("verbatim",this,&VerbatimHandler::endVerbatim);
addEndHandler("latexonly",this,&VerbatimHandler::endVerbatim);
addEndHandler("htmlonly",this,&VerbatimHandler::endVerbatim);
} }
VerbatimHandler::~VerbatimHandler() VerbatimHandler::~VerbatimHandler()
{ {
} }
void VerbatimHandler::startVerbatim(const QXmlAttributes&) void VerbatimHandler::startVerbatim(const QXmlAttributes&,Types type)
{ {
m_type = type;
m_parent->setDelegate(this); m_parent->setDelegate(this);
m_curString=""; m_curString="";
} }
...@@ -1353,6 +1604,7 @@ void VerbatimHandler::endVerbatim() ...@@ -1353,6 +1604,7 @@ void VerbatimHandler::endVerbatim()
m_parent->setDelegate(0); m_parent->setDelegate(0);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// SymbolHandler // SymbolHandler
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -1418,8 +1670,9 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent) ...@@ -1418,8 +1670,9 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
addStartHandler("dotfile",this,&ParagraphHandler::startDotFile); addStartHandler("dotfile",this,&ParagraphHandler::startDotFile);
addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry); addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry);
addStartHandler("table",this,&ParagraphHandler::startTable); addStartHandler("table",this,&ParagraphHandler::startTable);
addStartHandler("preformatted",this,&ParagraphHandler::startPreformatted);
addStartHandler("verbatim",this,&ParagraphHandler::startVerbatim); addStartHandler("verbatim",this,&ParagraphHandler::startVerbatim);
addStartHandler("latexonly",this,&ParagraphHandler::startHtmlOnly);
addStartHandler("htmlonly",this,&ParagraphHandler::startLatexOnly);
addStartHandler("umlaut",this,&ParagraphHandler::startUmlaut); addStartHandler("umlaut",this,&ParagraphHandler::startUmlaut);
addStartHandler("acute",this,&ParagraphHandler::startAcute); addStartHandler("acute",this,&ParagraphHandler::startAcute);
addStartHandler("grave",this,&ParagraphHandler::startGrave); addStartHandler("grave",this,&ParagraphHandler::startGrave);
...@@ -1430,6 +1683,9 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent) ...@@ -1430,6 +1683,9 @@ ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
addStartHandler("ring",this,&ParagraphHandler::startRing); addStartHandler("ring",this,&ParagraphHandler::startRing);
addStartHandler("nbsp",this,&ParagraphHandler::startNbsp); addStartHandler("nbsp",this,&ParagraphHandler::startNbsp);
addStartHandler("copy",this,&ParagraphHandler::startCopy); addStartHandler("copy",this,&ParagraphHandler::startCopy);
addStartHandler("anchor",this,&ParagraphHandler::startAnchor);
addStartHandler("copydoc",this,&ParagraphHandler::startCopyDoc);
addStartHandler("toclist",this,&ParagraphHandler::startTocList);
} }
ParagraphHandler::~ParagraphHandler() ParagraphHandler::~ParagraphHandler()
...@@ -1586,19 +1842,27 @@ void ParagraphHandler::startTable(const QXmlAttributes& attrib) ...@@ -1586,19 +1842,27 @@ void ParagraphHandler::startTable(const QXmlAttributes& attrib)
m_children.append(th); m_children.append(th);
} }
void ParagraphHandler::startPreformatted(const QXmlAttributes& attrib) void ParagraphHandler::startVerbatim(const QXmlAttributes& attrib)
{ {
addTextNode(); addTextNode();
PreformattedHandler *ph = new PreformattedHandler(this); VerbatimHandler *vh = new VerbatimHandler(this);
ph->startPreformatted(attrib); vh->startVerbatim(attrib,IDocVerbatim::Verbatim);
m_children.append(ph); m_children.append(vh);
} }
void ParagraphHandler::startVerbatim(const QXmlAttributes& attrib) void ParagraphHandler::startHtmlOnly(const QXmlAttributes& attrib)
{
addTextNode();
VerbatimHandler *vh = new VerbatimHandler(this);
vh->startVerbatim(attrib,IDocVerbatim::HtmlOnly);
m_children.append(vh);
}
void ParagraphHandler::startLatexOnly(const QXmlAttributes& attrib)
{ {
addTextNode(); addTextNode();
VerbatimHandler *vh = new VerbatimHandler(this); VerbatimHandler *vh = new VerbatimHandler(this);
vh->startVerbatim(attrib); vh->startVerbatim(attrib,IDocVerbatim::LatexOnly);
m_children.append(vh); m_children.append(vh);
} }
...@@ -1682,13 +1946,43 @@ void ParagraphHandler::startCopy(const QXmlAttributes& attrib) ...@@ -1682,13 +1946,43 @@ void ParagraphHandler::startCopy(const QXmlAttributes& attrib)
m_children.append(sh); m_children.append(sh);
} }
void ParagraphHandler::startAnchor(const QXmlAttributes& attrib)
{
addTextNode();
AnchorHandler *ah = new AnchorHandler(this);
ah->startAnchor(attrib);
m_children.append(ah);
}
void ParagraphHandler::startCopyDoc(const QXmlAttributes& attrib)
{
addTextNode();
CopyHandler *ch = new CopyHandler(this);
ch->startCopy(attrib);
m_children.append(ch);
}
void ParagraphHandler::startTocList(const QXmlAttributes& attrib)
{
addTextNode();
TocListHandler *th = new TocListHandler(this);
th->startTocList(attrib);
m_children.append(th);
}
void ParagraphHandler::addTextNode() void ParagraphHandler::addTextNode()
{ {
if (!m_curString.isEmpty()) if (!m_curString.isEmpty())
{ {
m_children.append(new TextNode(m_curString,m_markupHandler->markup())); m_children.append(
debug(2,"addTextNode() text=\"%s\" markup=%x\n", new TextNode(
m_curString.data(),m_markupHandler->markup()); m_curString,
m_markupHandler->markup(),
m_markupHandler->headingLevel()
)
);
debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
m_curString=""; m_curString="";
} }
} }
...@@ -1738,9 +2032,14 @@ void DocSectionHandler::addTextNode() ...@@ -1738,9 +2032,14 @@ void DocSectionHandler::addTextNode()
{ {
if (!m_curString.isEmpty()) if (!m_curString.isEmpty())
{ {
m_children.append(new TextNode(m_curString,m_markupHandler->markup())); m_children.append(
debug(2,"addTextNode() text=\"%s\" markup=%x\n", new TextNode(m_curString,
m_curString.data(),m_markupHandler->markup()); m_markupHandler->markup(),
m_markupHandler->headingLevel()
)
);
debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
m_curString=""; m_curString="";
} }
} }
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include "baseiterator.h" #include "baseiterator.h"
class ParagraphHandler; class ParagraphHandler;
class LinkedTextImpl;
class LinkedTextHandler;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -64,8 +66,11 @@ DEFINE_CLS_IMPL(DocTable); ...@@ -64,8 +66,11 @@ DEFINE_CLS_IMPL(DocTable);
DEFINE_CLS_IMPL(DocRow); DEFINE_CLS_IMPL(DocRow);
DEFINE_CLS_IMPL(DocEntry); DEFINE_CLS_IMPL(DocEntry);
DEFINE_CLS_IMPL(DocSection); DEFINE_CLS_IMPL(DocSection);
DEFINE_CLS_IMPL(DocPreformatted);
DEFINE_CLS_IMPL(DocVerbatim); DEFINE_CLS_IMPL(DocVerbatim);
DEFINE_CLS_IMPL(DocCopy);
DEFINE_CLS_IMPL(DocTocList);
DEFINE_CLS_IMPL(DocTocItem);
DEFINE_CLS_IMPL(DocAnchor);
DEFINE_CLS_IMPL(DocSymbol); DEFINE_CLS_IMPL(DocSymbol);
DEFINE_CLS_IMPL(DocRoot); DEFINE_CLS_IMPL(DocRoot);
...@@ -78,18 +83,20 @@ DEFINE_CLS_IMPL(DocRoot); ...@@ -78,18 +83,20 @@ DEFINE_CLS_IMPL(DocRoot);
class TextNode : public DocTextImpl class TextNode : public DocTextImpl
{ {
public: public:
TextNode(const QString &t,int markup) TextNode(const QString &t,int markup,int level)
: m_text(t), m_markup(markup) {} : m_text(t), m_markup(markup), m_headingLevel(level) {}
virtual ~TextNode() {} virtual ~TextNode() {}
// IDocText // IDocText
virtual Kind kind() const { return DocImpl::Text; } virtual Kind kind() const { return DocImpl::Text; }
virtual const IString *text() const { return &m_text; } virtual const IString *text() const { return &m_text; }
virtual int markup() const { return m_markup; } virtual int markup() const { return m_markup; }
virtual int headingLevel() const { return m_headingLevel; }
private: private:
StringImpl m_text; StringImpl m_text;
int m_markup; int m_markup;
int m_headingLevel;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -100,18 +107,20 @@ class TextNode : public DocTextImpl ...@@ -100,18 +107,20 @@ class TextNode : public DocTextImpl
class MarkupModifierNode : public DocMarkupModifierImpl class MarkupModifierNode : public DocMarkupModifierImpl
{ {
public: public:
MarkupModifierNode(int markup,bool enabled) MarkupModifierNode(int markup,bool enabled,int level=0)
: m_markup(markup), m_enabled(enabled) {} : m_markup(markup), m_enabled(enabled), m_headingLevel(level) {}
virtual ~MarkupModifierNode() {} virtual ~MarkupModifierNode() {}
// IDocMarkupModifier // IDocMarkupModifier
virtual Kind kind() const { return DocImpl::MarkupModifier; } virtual Kind kind() const { return DocImpl::MarkupModifier; }
virtual bool enabled() const { return m_enabled; } virtual bool enabled() const { return m_enabled; }
virtual int markup() const { return m_markup; } virtual int markup() const { return m_markup; }
virtual int headingLevel() const { return m_headingLevel; }
private: private:
int m_markup; int m_markup;
bool m_enabled; bool m_enabled;
int m_headingLevel;
}; };
...@@ -126,6 +135,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler> ...@@ -126,6 +135,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
MarkupHandler(QList<DocImpl> &children,QString &curString); MarkupHandler(QList<DocImpl> &children,QString &curString);
virtual ~MarkupHandler(); virtual ~MarkupHandler();
int markup() const { return m_curMarkup; } int markup() const { return m_curMarkup; }
int headingLevel() const { return m_headingLevel; }
virtual void startBold(const QXmlAttributes &attrib); virtual void startBold(const QXmlAttributes &attrib);
virtual void endBold(); virtual void endBold();
...@@ -141,6 +151,20 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler> ...@@ -141,6 +151,20 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
virtual void endSubscript(); virtual void endSubscript();
virtual void startSuperscript(const QXmlAttributes &attrib); virtual void startSuperscript(const QXmlAttributes &attrib);
virtual void endSuperscript(); virtual void endSuperscript();
virtual void startPreformatted(const QXmlAttributes &attrib);
virtual void endPreformatted();
virtual void startHeading1(const QXmlAttributes &attrib);
virtual void endHeading1();
virtual void startHeading2(const QXmlAttributes &attrib);
virtual void endHeading2();
virtual void startHeading3(const QXmlAttributes &attrib);
virtual void endHeading3();
virtual void startHeading4(const QXmlAttributes &attrib);
virtual void endHeading4();
virtual void startHeading5(const QXmlAttributes &attrib);
virtual void endHeading5();
virtual void startHeading6(const QXmlAttributes &attrib);
virtual void endHeading6();
private: private:
...@@ -149,6 +173,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler> ...@@ -149,6 +173,7 @@ class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
QList<DocImpl> &m_children; QList<DocImpl> &m_children;
QString &m_curString; QString &m_curString;
int m_curMarkup; int m_curMarkup;
int m_headingLevel;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -190,8 +215,9 @@ class ParagraphHandler : public DocParaImpl, ...@@ -190,8 +215,9 @@ class ParagraphHandler : public DocParaImpl,
virtual void startDotFile(const QXmlAttributes& attrib); virtual void startDotFile(const QXmlAttributes& attrib);
virtual void startIndexEntry(const QXmlAttributes& attrib); virtual void startIndexEntry(const QXmlAttributes& attrib);
virtual void startTable(const QXmlAttributes& attrib); virtual void startTable(const QXmlAttributes& attrib);
virtual void startPreformatted(const QXmlAttributes& attrib);
virtual void startVerbatim(const QXmlAttributes& attrib); virtual void startVerbatim(const QXmlAttributes& attrib);
virtual void startHtmlOnly(const QXmlAttributes& attrib);
virtual void startLatexOnly(const QXmlAttributes& attrib);
virtual void startUmlaut(const QXmlAttributes& attrib); virtual void startUmlaut(const QXmlAttributes& attrib);
virtual void startAcute(const QXmlAttributes& attrib); virtual void startAcute(const QXmlAttributes& attrib);
virtual void startGrave(const QXmlAttributes& attrib); virtual void startGrave(const QXmlAttributes& attrib);
...@@ -202,6 +228,9 @@ class ParagraphHandler : public DocParaImpl, ...@@ -202,6 +228,9 @@ class ParagraphHandler : public DocParaImpl,
virtual void startRing(const QXmlAttributes& attrib); virtual void startRing(const QXmlAttributes& attrib);
virtual void startNbsp(const QXmlAttributes& attrib); virtual void startNbsp(const QXmlAttributes& attrib);
virtual void startCopy(const QXmlAttributes& attrib); virtual void startCopy(const QXmlAttributes& attrib);
virtual void startAnchor(const QXmlAttributes& attrib);
virtual void startCopyDoc(const QXmlAttributes& attrib);
virtual void startTocList(const QXmlAttributes& attrib);
ParagraphHandler(IBaseHandler *parent); ParagraphHandler(IBaseHandler *parent);
virtual ~ParagraphHandler(); virtual ~ParagraphHandler();
...@@ -287,6 +316,61 @@ class OrderedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,Doc ...@@ -287,6 +316,61 @@ class OrderedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,Doc
BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
//-----------------------------------------------------------------------------
/*! \brief Node representing table of contents list.
*
*/
class TocListHandler : public DocTocListImpl, public BaseHandler<TocListHandler>
{
friend class TocListIterator;
public:
TocListHandler(IBaseHandler *parent);
virtual ~TocListHandler();
virtual void startTocList(const QXmlAttributes& attrib);
virtual void endTocList();
virtual void startTocItem(const QXmlAttributes& attrib);
// IDocTocList
virtual Kind kind() const { return DocImpl::TocList; }
virtual IDocIterator *elements() const;
private:
IBaseHandler *m_parent;
QList<DocImpl> m_children;
};
class TocListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{
public:
TocListIterator(const TocListHandler &handler) :
BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
};
//-----------------------------------------------------------------------------
/*! \brief Node representing a table of contents item.
*
*/
class TocItemHandler : public DocTocItemImpl, public BaseHandler<TocItemHandler>
{
friend class TocItemIterator;
public:
TocItemHandler(IBaseHandler *parent);
virtual ~TocItemHandler();
virtual void startTocItem(const QXmlAttributes& attrib);
virtual void endTocItem();
// IDocItem
virtual Kind kind() const { return DocImpl::TocItem; }
virtual const IString *id() const { return &m_id; }
virtual const IString *title() const { return &m_title; }
private:
IBaseHandler *m_parent;
StringImpl m_id;
StringImpl m_title;
};
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -619,13 +703,14 @@ class VariableListEntryHandler : public DocVariableListEntryImpl, ...@@ -619,13 +703,14 @@ class VariableListEntryHandler : public DocVariableListEntryImpl,
// IDocVariableListEntry // IDocVariableListEntry
virtual Kind kind() const { return DocImpl::VariableListEntry; } virtual Kind kind() const { return DocImpl::VariableListEntry; }
virtual const IString *term() const { return &m_term; } virtual ILinkedTextIterator *term() const;
virtual IDocPara *description() const { return m_description; } virtual IDocPara *description() const { return m_description; }
private: private:
IBaseHandler *m_parent; IBaseHandler* m_parent;
StringImpl m_term; QList<LinkedTextImpl> m_term;
ParagraphHandler *m_description; ParagraphHandler* m_description;
LinkedTextHandler* m_linkedTextHandler;
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -832,6 +917,29 @@ class ImageHandler : public DocImageImpl, public BaseHandler<ImageHandler> ...@@ -832,6 +917,29 @@ class ImageHandler : public DocImageImpl, public BaseHandler<ImageHandler>
StringImpl m_caption; StringImpl m_caption;
}; };
//-----------------------------------------------------------------------------
/*! \brief Node representing an anchor.
*
*/
// children: -
class AnchorHandler : public DocAnchorImpl, public BaseHandler<AnchorHandler>
{
public:
AnchorHandler(IBaseHandler *parent);
virtual ~AnchorHandler();
void startAnchor(const QXmlAttributes& attrib);
void endAnchor();
// IDocAnchor
virtual Kind kind() const { return DocImpl::Anchor; }
virtual const IString *id() const { return &m_id; }
private:
IBaseHandler *m_parent;
StringImpl m_id;
};
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/*! \brief Node representing a dot file. /*! \brief Node representing a dot file.
...@@ -990,32 +1098,32 @@ class TableIterator : public BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImp ...@@ -990,32 +1098,32 @@ class TableIterator : public BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImp
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/*! \brief Node representing an preformatted section /*! \brief Node representing a copied piece of documentation.
*
*/ */
class PreformattedHandler : public DocPreformattedImpl, class CopyHandler : public DocCopyImpl, public BaseHandler<CopyHandler>
public BaseHandler<PreformattedHandler>
{ {
friend class PreformattedIterator; friend class CopyIterator;
public: public:
PreformattedHandler(IBaseHandler *parent); CopyHandler(IBaseHandler *parent);
virtual ~PreformattedHandler(); virtual ~CopyHandler();
void startPreformatted(const QXmlAttributes& attrib); virtual void startCopy(const QXmlAttributes& attrib);
void endPreformatted(); virtual void endCopy();
virtual void startParagraph(const QXmlAttributes& attrib);
// IDocPreformatted // IDocCopy
virtual Kind kind() const { return DocImpl::Copy; }
virtual IDocIterator *contents() const; virtual IDocIterator *contents() const;
virtual Kind kind() const { return DocImpl::Preformatted; }
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
QList<DocImpl> m_children; QList<DocImpl> m_children;
}; };
class PreformattedIterator : class CopyIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
{ {
public: public:
PreformattedIterator(const PreformattedHandler &handler) : CopyIterator(const CopyHandler &handler) :
BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {} BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
}; };
...@@ -1026,20 +1134,21 @@ class PreformattedIterator : ...@@ -1026,20 +1134,21 @@ class PreformattedIterator :
class VerbatimHandler : public DocVerbatimImpl, class VerbatimHandler : public DocVerbatimImpl,
public BaseHandler<VerbatimHandler> public BaseHandler<VerbatimHandler>
{ {
friend class VerbatimIterator;
public: public:
VerbatimHandler(IBaseHandler *parent); VerbatimHandler(IBaseHandler *parent);
virtual ~VerbatimHandler(); virtual ~VerbatimHandler();
void startVerbatim(const QXmlAttributes& attrib); void startVerbatim(const QXmlAttributes& attrib,Types type);
void endVerbatim(); void endVerbatim();
// IDocVerbatim // IDocVerbatim
virtual Kind kind() const { return DocImpl::Verbatim; } virtual Kind kind() const { return DocImpl::Verbatim; }
virtual const IString *text() const { return &m_text; } virtual const IString *text() const { return &m_text; }
virtual Types type() const { return m_type; }
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
StringImpl m_text; StringImpl m_text;
Types m_type;
}; };
......
...@@ -159,10 +159,13 @@ class IDoc ...@@ -159,10 +159,13 @@ class IDoc
Row, // 27 -> IDocRow Row, // 27 -> IDocRow
Entry, // 28 -> IDocEntry Entry, // 28 -> IDocEntry
Section, // 29 -> IDocSection Section, // 29 -> IDocSection
Preformatted, // 30 -> IDocPreformatted Verbatim, // 30 -> IDocVerbatim
Verbatim, // 31 -> IDocVerbatim Copy, // 31 -> IDocCopy
Symbol, // 32 -> IDocSymbol TocList, // 32 -> IDocTocList
Root // 33 -> IDocRoot TocItem, // 33 -> IDocTocItem
Anchor, // 34 -> IDocAnchor
Symbol, // 35 -> IDocSymbol
Root // 36 -> IDocRoot
}; };
virtual Kind kind() const = 0; virtual Kind kind() const = 0;
}; };
...@@ -172,14 +175,16 @@ class IDocMarkup : public IDoc ...@@ -172,14 +175,16 @@ class IDocMarkup : public IDoc
public: public:
enum Markup enum Markup
{ {
Normal = 0x00, Normal = 0x000,
Bold = 0x01, Bold = 0x001,
Emphasis = 0x02, Emphasis = 0x002,
ComputerOutput = 0x04, ComputerOutput = 0x004,
Subscript = 0x08, Subscript = 0x008,
Superscript = 0x10, Superscript = 0x010,
SmallFont = 0x20, SmallFont = 0x020,
Center = 0x40 Center = 0x040,
Preformatted = 0x080,
Heading = 0x100
}; };
}; };
...@@ -194,6 +199,7 @@ class IDocText : public IDocMarkup ...@@ -194,6 +199,7 @@ class IDocText : public IDocMarkup
public: public:
virtual const IString * text() const = 0; virtual const IString * text() const = 0;
virtual int markup() const = 0; virtual int markup() const = 0;
virtual int headingLevel() const = 0;
}; };
class IDocMarkupModifier : public IDoc class IDocMarkupModifier : public IDoc
...@@ -201,6 +207,7 @@ class IDocMarkupModifier : public IDoc ...@@ -201,6 +207,7 @@ class IDocMarkupModifier : public IDoc
public: public:
virtual bool enabled() const = 0; virtual bool enabled() const = 0;
virtual int markup() const = 0; virtual int markup() const = 0;
virtual int headingLevel() const = 0;
}; };
class IDocItemizedList : public IDoc class IDocItemizedList : public IDoc
...@@ -278,7 +285,7 @@ class IDocVariableList : public IDoc ...@@ -278,7 +285,7 @@ class IDocVariableList : public IDoc
class IDocVariableListEntry : public IDoc class IDocVariableListEntry : public IDoc
{ {
public: public:
virtual const IString * term() const = 0; virtual ILinkedTextIterator * term() const = 0;
virtual IDocPara *description() const = 0; virtual IDocPara *description() const = 0;
}; };
...@@ -393,7 +400,20 @@ class IDocSection : public IDoc ...@@ -393,7 +400,20 @@ class IDocSection : public IDoc
virtual IDocIterator *title() const = 0; virtual IDocIterator *title() const = 0;
}; };
class IDocPreformatted : public IDoc class IDocTocList : public IDoc
{
public:
virtual IDocIterator *elements() const = 0;
};
class IDocTocItem : public IDoc
{
public:
virtual const IString *id() const = 0;
virtual const IString *title() const = 0;
};
class IDocCopy : public IDoc
{ {
public: public:
virtual IDocIterator *contents() const = 0; virtual IDocIterator *contents() const = 0;
...@@ -402,7 +422,15 @@ class IDocPreformatted : public IDoc ...@@ -402,7 +422,15 @@ class IDocPreformatted : public IDoc
class IDocVerbatim : public IDoc class IDocVerbatim : public IDoc
{ {
public: public:
enum Types { Invalid = 0, HtmlOnly, LatexOnly, Verbatim };
virtual const IString *text() const = 0; virtual const IString *text() const = 0;
virtual Types type() const = 0;
};
class IDocAnchor : public IDoc
{
public:
virtual const IString *id() const = 0;
}; };
class IDocSymbol : public IDoc class IDocSymbol : public IDoc
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "compoundhandler.h" #include "compoundhandler.h"
#include "sectionhandler.h" #include "sectionhandler.h"
#include "graphhandler.h" #include "graphhandler.h"
#include "dochandler.h"
#include "memberhandler.h"
#include "debug.h" #include "debug.h"
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
#define _MAINHANDLER_H #define _MAINHANDLER_H
#include <qlist.h> #include <qlist.h>
#include "basehandler.h"
#include "compoundhandler.h"
#include <doxmlintf.h> #include <doxmlintf.h>
#include "memberhandler.h" #include "basehandler.h"
class CompoundHandler;
struct CompoundEntry; struct CompoundEntry;
struct IndexEntry struct IndexEntry
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "dochandler.h" #include "dochandler.h"
#include "mainhandler.h" #include "mainhandler.h"
#include "linkedtexthandler.h" #include "linkedtexthandler.h"
#include "paramhandler.h"
#include "compoundhandler.h"
#include "debug.h" #include "debug.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
...@@ -451,4 +453,60 @@ IMemberIterator *MemberHandler::enumValues() const ...@@ -451,4 +453,60 @@ IMemberIterator *MemberHandler::enumValues() const
return new MemberIterator(m_enumValues); return new MemberIterator(m_enumValues);
} }
ILinkedTextIterator *MemberHandler::type() const
{
return new LinkedTextIterator(m_type);
}
const IString *MemberHandler::typeString() const
{
MemberHandler *that = (MemberHandler *)this;
that->m_typeString = LinkedTextHandler::toString(m_type);
return &m_typeString;
}
IParamIterator *MemberHandler::parameters() const
{
return new ParamIterator(m_params);
}
IParamIterator *MemberHandler::templateParameters() const
{
return m_hasTemplateParamList ? new ParamIterator(m_templateParams) : 0;
}
IMemberReferenceIterator *MemberHandler::references() const
{
return new MemberReferenceIterator(m_references);
}
IMemberReferenceIterator *MemberHandler::referencedBy() const
{
return new MemberReferenceIterator(m_referencedBy);
}
ILinkedTextIterator *MemberHandler::initializer() const
{
return new LinkedTextIterator(m_initializer);
}
ILinkedTextIterator *MemberHandler::exceptions() const
{
return new LinkedTextIterator(m_exception);
}
IMemberReferenceIterator *MemberHandler::reimplementedBy() const
{
return new MemberReferenceIterator(m_reimplementedBy);
}
IDocRoot *MemberHandler::briefDescription() const
{
return m_brief;
}
IDocRoot *MemberHandler::detailedDescription() const
{
return m_detailed;
}
...@@ -23,14 +23,15 @@ ...@@ -23,14 +23,15 @@
#include "basehandler.h" #include "basehandler.h"
#include "baseiterator.h" #include "baseiterator.h"
#include "paramhandler.h" #include "stringimpl.h"
#include "linkedtexthandler.h"
#include "dochandler.h"
class MainHandler; class MainHandler;
class CompoundHandler; class CompoundHandler;
class SectionHandler; class SectionHandler;
class ParamHandler; class ParamHandler;
class LinkedTextImpl;
class LinkedTextHandler;
class DocHandler;
struct MemberReference : public IMemberReference struct MemberReference : public IMemberReference
{ {
...@@ -159,25 +160,14 @@ class MemberHandler : public IDefine, ...@@ -159,25 +160,14 @@ class MemberHandler : public IDefine,
{ return m_isConst; } { return m_isConst; }
virtual bool isVolatile() const virtual bool isVolatile() const
{ return m_isVolatile; } { return m_isVolatile; }
virtual ILinkedTextIterator *type() const virtual ILinkedTextIterator *type() const;
{ return new LinkedTextIterator(m_type); } virtual const IString *typeString() const;
virtual const IString *typeString() const virtual IParamIterator *parameters() const;
{ MemberHandler *that = (MemberHandler *)this; virtual IParamIterator *templateParameters() const;
that->m_typeString = LinkedTextHandler::toString(m_type); virtual IMemberReferenceIterator *references() const;
return &m_typeString; virtual IMemberReferenceIterator *referencedBy() const;
} virtual ILinkedTextIterator *initializer() const;
virtual IParamIterator *parameters() const virtual ILinkedTextIterator *exceptions() const;
{ return new ParamIterator(m_params); }
virtual IParamIterator *templateParameters() const
{ return m_hasTemplateParamList ? new ParamIterator(m_templateParams) : 0; }
virtual IMemberReferenceIterator *references() const
{ return new MemberReferenceIterator(m_references); }
virtual IMemberReferenceIterator *referencedBy() const
{ return new MemberReferenceIterator(m_referencedBy); }
virtual ILinkedTextIterator *initializer() const
{ return new LinkedTextIterator(m_initializer); }
virtual ILinkedTextIterator *exceptions() const
{ return new LinkedTextIterator(m_exception); }
virtual int bodyStart() const virtual int bodyStart() const
{ return m_bodyStart; } { return m_bodyStart; }
virtual int bodyEnd() const virtual int bodyEnd() const
...@@ -188,12 +178,9 @@ class MemberHandler : public IDefine, ...@@ -188,12 +178,9 @@ class MemberHandler : public IDefine,
{ return m_defLine; } { return m_defLine; }
virtual IMemberReference *reimplements() const virtual IMemberReference *reimplements() const
{ return m_reimplements; } { return m_reimplements; }
virtual IMemberReferenceIterator *reimplementedBy() const virtual IMemberReferenceIterator *reimplementedBy() const;
{ return new MemberReferenceIterator(m_reimplementedBy); } virtual IDocRoot *briefDescription() const;
virtual IDocRoot *briefDescription() const virtual IDocRoot *detailedDescription() const;
{ return m_brief; }
virtual IDocRoot *detailedDescription() const
{ return m_detailed; }
// IEnum // IEnum
virtual IMemberIterator *enumValues() const; virtual IMemberIterator *enumValues() const;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "paramhandler.h" #include "paramhandler.h"
#include "memberhandler.h" #include "memberhandler.h"
#include "linkedtexthandler.h"
#include "debug.h" #include "debug.h"
TemplateParamListHandler::TemplateParamListHandler(IBaseHandler *parent) : m_parent(parent) TemplateParamListHandler::TemplateParamListHandler(IBaseHandler *parent) : m_parent(parent)
...@@ -127,5 +128,14 @@ void ParamHandler::startDefVal(const QXmlAttributes& /*attrib*/) ...@@ -127,5 +128,14 @@ void ParamHandler::startDefVal(const QXmlAttributes& /*attrib*/)
debug(2,"member defVal\n"); debug(2,"member defVal\n");
} }
ILinkedTextIterator *ParamHandler::type() const
{
return new LinkedTextIterator(m_type);
}
ILinkedTextIterator *ParamHandler::defaultValue() const
{
return new LinkedTextIterator(m_defVal);
}
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
#include "stringimpl.h" #include "stringimpl.h"
#include "basehandler.h" #include "basehandler.h"
#include "baseiterator.h" #include "baseiterator.h"
#include "linkedtexthandler.h"
class LinkedTextImpl;
class LinkedTextHandler;
class ParamHandler : public IParam, public BaseHandler<ParamHandler> class ParamHandler : public IParam, public BaseHandler<ParamHandler>
...@@ -43,14 +45,12 @@ class ParamHandler : public IParam, public BaseHandler<ParamHandler> ...@@ -43,14 +45,12 @@ class ParamHandler : public IParam, public BaseHandler<ParamHandler>
virtual ~ParamHandler(); virtual ~ParamHandler();
// IParam // IParam
virtual ILinkedTextIterator *type() const virtual ILinkedTextIterator *type() const;
{ return new LinkedTextIterator(m_type); }
virtual const IString * declarationName() const { return &m_declName; } virtual const IString * declarationName() const { return &m_declName; }
virtual const IString * definitionName() const { return &m_defName; } virtual const IString * definitionName() const { return &m_defName; }
virtual const IString * attrib() const { return &m_attrib; } virtual const IString * attrib() const { return &m_attrib; }
virtual const IString * arraySpecifier() const { return &m_array; } virtual const IString * arraySpecifier() const { return &m_array; }
virtual ILinkedTextIterator *defaultValue() const virtual ILinkedTextIterator *defaultValue() const;
{ return new LinkedTextIterator(m_defVal); }
private: private:
IBaseHandler *m_parent; IBaseHandler *m_parent;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "mainhandler.h" #include "mainhandler.h"
#include "compoundhandler.h" #include "compoundhandler.h"
#include "sectionhandler.h" #include "sectionhandler.h"
#include "memberhandler.h"
#include "debug.h" #include "debug.h"
class SectionTypeMap class SectionTypeMap
...@@ -126,4 +127,8 @@ void SectionHandler::initialize(CompoundHandler *ch) ...@@ -126,4 +127,8 @@ void SectionHandler::initialize(CompoundHandler *ch)
} }
} }
IMemberIterator *SectionHandler::members() const
{
return new MemberIterator(m_members);
}
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <doxmlintf.h> #include <doxmlintf.h>
#include "basehandler.h" #include "basehandler.h"
#include "memberhandler.h"
class MainHandler; class MainHandler;
...@@ -50,8 +49,7 @@ class SectionHandler : public ISection, public BaseHandler<SectionHandler> ...@@ -50,8 +49,7 @@ class SectionHandler : public ISection, public BaseHandler<SectionHandler>
{ return &m_kindString; } { return &m_kindString; }
virtual SectionKind kind() const virtual SectionKind kind() const
{ return m_kind; } { return m_kind; }
virtual IMemberIterator *members() const virtual IMemberIterator *members() const;
{ return new MemberIterator(m_members); }
virtual bool isStatic() const virtual bool isStatic() const
{ {
return m_kind==PubStatFuncs || m_kind==PubStatAttribs || return m_kind==PubStatFuncs || m_kind==PubStatAttribs ||
......
...@@ -73,14 +73,16 @@ void DumpDoc(IDoc *doc,int level) ...@@ -73,14 +73,16 @@ void DumpDoc(IDoc *doc,int level)
{ {
IDocText *txt = dynamic_cast<IDocText*>(doc); IDocText *txt = dynamic_cast<IDocText*>(doc);
ASSERT(txt!=0); ASSERT(txt!=0);
InPrint(("<text value=`%s' markup=%d/>\n",txt->text()->latin1(),txt->markup())); InPrint(("<text value=`%s' markup=%d headingLevel=%d/>\n",
txt->text()->latin1(),txt->markup(),txt->headingLevel()));
} }
break; break;
case IDoc::MarkupModifier: case IDoc::MarkupModifier:
{ {
IDocMarkupModifier *md = dynamic_cast<IDocMarkupModifier*>(doc); IDocMarkupModifier *md = dynamic_cast<IDocMarkupModifier*>(doc);
ASSERT(md!=0); ASSERT(md!=0);
InPrint(("<markup modifier enabled=%d markup=%d/>\n",md->enabled(),md->markup())); InPrint(("<markup modifier enabled=%d markup=%d headingLevel=%d/>\n",
md->enabled(),md->markup(),md->headingLevel()));
} }
break; break;
case IDoc::ItemizedList: case IDoc::ItemizedList:
...@@ -203,7 +205,10 @@ void DumpDoc(IDoc *doc,int level) ...@@ -203,7 +205,10 @@ void DumpDoc(IDoc *doc,int level)
{ {
IDocVariableListEntry *vle = dynamic_cast<IDocVariableListEntry*>(doc); IDocVariableListEntry *vle = dynamic_cast<IDocVariableListEntry*>(doc);
ASSERT(vle!=0); ASSERT(vle!=0);
InPrint(("<variablelistentry term=%s>\n",vle->term()->latin1())); ILinkedTextIterator *lti = vle->term();
QString term = linkedTextToString(lti);
lti->release();
InPrint(("<variablelistentry term=%s>\n",term.latin1()));
DumpDoc(vle->description(),level+1); DumpDoc(vle->description(),level+1);
InPrint(("<variablelistentry/>\n")); InPrint(("<variablelistentry/>\n"));
} }
...@@ -255,7 +260,7 @@ void DumpDoc(IDoc *doc,int level) ...@@ -255,7 +260,7 @@ void DumpDoc(IDoc *doc,int level)
DumpDoc(cl,level+1); DumpDoc(cl,level+1);
} }
cli->release(); cli->release();
InPrint(("<programlisting/>\n")); InPrint(("</programlisting>\n"));
} }
break; break;
case IDoc::CodeLine: case IDoc::CodeLine:
...@@ -270,7 +275,7 @@ void DumpDoc(IDoc *doc,int level) ...@@ -270,7 +275,7 @@ void DumpDoc(IDoc *doc,int level)
DumpDoc(ce,level+1); DumpDoc(ce,level+1);
} }
cei->release(); cei->release();
InPrint(("<codeline/>\n")); InPrint(("</codeline>\n"));
} }
break; break;
case IDoc::Highlight: case IDoc::Highlight:
...@@ -373,31 +378,70 @@ void DumpDoc(IDoc *doc,int level) ...@@ -373,31 +378,70 @@ void DumpDoc(IDoc *doc,int level)
{ {
DumpDoc(pdoc,level+1); DumpDoc(pdoc,level+1);
} }
InPrint(("<section/>\n")); InPrint(("</section>\n"));
} }
break; break;
case IDoc::Preformatted: case IDoc::Copy:
{ {
InPrint(("<preformatted>\n")); IDocCopy *cpy = dynamic_cast<IDocCopy*>(doc);
IDocPreformatted *pf = dynamic_cast<IDocPreformatted*>(doc); ASSERT(cpy!=0);
ASSERT(pf!=0); InPrint(("<copydoc>\n"));
IDocIterator *di = pf->contents(); IDocIterator *di = cpy->contents();
IDoc *pdoc; IDoc *pdoc;
for (di->toFirst();(pdoc=di->current());di->toNext()) for (di->toFirst();(pdoc=di->current());di->toNext())
{ {
DumpDoc(pdoc,level+1); DumpDoc(pdoc,level+1);
} }
di->release(); di->release();
InPrint(("<preformatted/>\n")); InPrint(("<copydoc/>\n"));
}
break;
case IDoc::TocItem:
{
IDocTocItem *ti = dynamic_cast<IDocTocItem*>(doc);
ASSERT(ti!=0);
InPrint(("<tocitem id=\"%s\" title=\"%s\"/>\n",
ti->id()->latin1(),ti->title()->latin1()));
}
break;
case IDoc::TocList:
{
IDocTocList *tl = dynamic_cast<IDocTocList*>(doc);
ASSERT(tl!=0);
InPrint(("<toclist>\n"));
IDocIterator *di = tl->elements();
IDoc *pdoc;
for (di->toFirst();(pdoc=di->current());di->toNext())
{
DumpDoc(pdoc,level+1);
}
di->release();
InPrint(("<toclist/>\n"));
} }
break; break;
case IDoc::Verbatim: case IDoc::Verbatim:
{ {
InPrint(("<verbatim>\n"));
IDocVerbatim *vt = dynamic_cast<IDocVerbatim*>(doc); IDocVerbatim *vt = dynamic_cast<IDocVerbatim*>(doc);
ASSERT(vt!=0); ASSERT(vt!=0);
const char *s=0;
switch (vt->type())
{
case IDocVerbatim::Verbatim: s="verbatim"; break;
case IDocVerbatim::HtmlOnly: s="htmlonly"; break;
case IDocVerbatim::LatexOnly: s="latexonly"; break;
default:
printf("Invalid verbatim type!\n");
}
InPrint(("<verbatim %s>\n",s));
InPrint(("%s",vt->text()->latin1())); InPrint(("%s",vt->text()->latin1()));
InPrint(("<verbatim/>\n")); InPrint(("</verbatim>\n"));
}
break;
case IDoc::Anchor:
{
IDocAnchor *anc = dynamic_cast<IDocAnchor*>(doc);
ASSERT(anc!=0);
InPrint(("<anchor id='%s'/>\n",anc->id()->latin1()));
} }
break; break;
case IDoc::Symbol: case IDoc::Symbol:
...@@ -420,7 +464,7 @@ void DumpDoc(IDoc *doc,int level) ...@@ -420,7 +464,7 @@ void DumpDoc(IDoc *doc,int level)
DumpDoc(pdoc,level+1); DumpDoc(pdoc,level+1);
} }
di->release(); di->release();
InPrint(("<root/>\n")); InPrint(("</root>\n"));
} }
break; break;
......
...@@ -319,7 +319,7 @@ doxygen. Unrecognized commands are treated as normal text. ...@@ -319,7 +319,7 @@ doxygen. Unrecognized commands are treated as normal text.
If your comment block \e is in front of the function If your comment block \e is in front of the function
declaration or definition this command can (and to avoid redundancy declaration or definition this command can (and to avoid redundancy
should) be ommitted. should) be omitted.
A full function declaration including arguments should be specified after the A full function declaration including arguments should be specified after the
\\fn command on a \e single line, since the argument ends at the end \\fn command on a \e single line, since the argument ends at the end
...@@ -745,7 +745,7 @@ See section \ref memgroup for an example. ...@@ -745,7 +745,7 @@ See section \ref memgroup for an example.
\par Example: \par Example:
\verbatim \verbatim
/*! Uncoditionally shown documentation. /*! Unconditionally shown documentation.
* \if Cond1 * \if Cond1
* Only included if Cond1 is set. * Only included if Cond1 is set.
* \endif * \endif
......
Summary: A documentation system for C/C++. Summary: A documentation system for C/C++.
Name: doxygen Name: doxygen
Version: 1.2.18_20021030 Version: 1.2.18_20021106
Release: 1 Release: 1
Epoch: 1 Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
......
...@@ -521,7 +521,7 @@ static MemberDef *setCallContextForVar(const QCString &name) ...@@ -521,7 +521,7 @@ static MemberDef *setCallContextForVar(const QCString &name)
{ {
QCString scope = name.left(scopeEnd); QCString scope = name.left(scopeEnd);
QCString locName = name.right(name.length()-scopeEnd-2); QCString locName = name.right(name.length()-scopeEnd-2);
//printf("name=%s scope=%s\n",locName.data(),scope.data()); //printf("explicit scope: name=%s scope=%s\n",locName.data(),scope.data());
ClassDef *mcd = getClass(scope); // TODO: check namespace as well ClassDef *mcd = getClass(scope); // TODO: check namespace as well
if (mcd && !locName.isEmpty()) if (mcd && !locName.isEmpty())
{ {
...@@ -539,11 +539,11 @@ static MemberDef *setCallContextForVar(const QCString &name) ...@@ -539,11 +539,11 @@ static MemberDef *setCallContextForVar(const QCString &name)
ClassDef *mcd = g_theVarContext.findVariable(name); ClassDef *mcd = g_theVarContext.findVariable(name);
if (mcd) // local variable if (mcd) // local variable
{ {
//printf("local var `%s'\n",name.data()); //printf("local var `%s' mcd=%s\n",name.data(),mcd->name().data());
g_theCallContext.setClass(mcd); g_theCallContext.setClass(mcd);
return 0;
} }
else
{
// look for a class member // look for a class member
mcd = getClass(g_classScope); mcd = getClass(g_classScope);
if (mcd) if (mcd)
...@@ -555,6 +555,7 @@ static MemberDef *setCallContextForVar(const QCString &name) ...@@ -555,6 +555,7 @@ static MemberDef *setCallContextForVar(const QCString &name)
return md; return md;
} }
} }
}
// look for a global member // look for a global member
if ((mn=Doxygen::functionNameSDict[name])) if ((mn=Doxygen::functionNameSDict[name]))
...@@ -613,6 +614,7 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst) ...@@ -613,6 +614,7 @@ static void addDocCrossReference(MemberDef *src,MemberDef *dst)
static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int *clNameLen=0) static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int *clNameLen=0)
{ {
int i=0; int i=0;
//printf("generateClassOrGlobalLink(clName=%s)\n",clName);
if (*clName=='~') // correct for matching negated values i.s.o. destructors. if (*clName=='~') // correct for matching negated values i.s.o. destructors.
{ {
g_code->codify("~"); g_code->codify("~");
...@@ -634,6 +636,7 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int ...@@ -634,6 +636,7 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int
} }
if (cd && cd->isLinkable()) // is it a linkable class if (cd && cd->isLinkable()) // is it a linkable class
{ {
//printf("is linkable class %s\n",clName);
if (g_exampleBlock) if (g_exampleBlock)
{ {
QCString anchor; QCString anchor;
...@@ -654,10 +657,12 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int ...@@ -654,10 +657,12 @@ static void generateClassOrGlobalLink(BaseCodeDocInterface &ol,char *clName,int
if (cd==0) // not a class, see if it is a global enum/variable/typedef. if (cd==0) // not a class, see if it is a global enum/variable/typedef.
{ {
MemberDef *md = setCallContextForVar(clName); MemberDef *md = setCallContextForVar(clName);
//printf("is a global md=%p\n",md);
if (md) if (md)
{ {
Definition *d = md->getOuterScope()==Doxygen::globalScope ? Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getBodyDef() : md->getOuterScope(); md->getBodyDef() : md->getOuterScope();
//printf("definition %s\n",d?d->name().data():"<none>");
if (md->getGroupDef()) d = md->getGroupDef(); if (md->getGroupDef()) d = md->getGroupDef();
if (d && d->isLinkable() && md->isLinkable()) if (d && d->isLinkable() && md->isLinkable())
{ {
......
...@@ -2206,10 +2206,28 @@ void Config::create() ...@@ -2206,10 +2206,28 @@ void Config::create()
"PERLMOD_LATEX", "PERLMOD_LATEX",
"If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n" "If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n"
"the necessary Makefile rules, Perl scripts and LaTeX code to be able \n" "the necessary Makefile rules, Perl scripts and LaTeX code to be able \n"
"to generate PDF and DVI output from the Perl module output.\n", "to generate PDF and DVI output from the Perl module output. \n",
FALSE FALSE
); );
cb->addDependency("GENERATE_PERLMOD"); cb->addDependency("GENERATE_PERLMOD");
cb = addBool(
"PERLMOD_PRETTY",
"If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n"
"nicely formatted so it can be parsed by a human reader. This is useful \n"
"if you want to understand what is going on. On the other hand, if this \n"
"tag is set to NO the size of the Perl module output will be much smaller \n"
"and Perl will parse it just the same. \n",
TRUE
);
cb->addDependency("GENERATE_PERLMOD");
cs = addString(
"PERLMOD_MAKEVAR_PREFIX",
"The names of the make variables in the generated doxyrules.make file \n"
"are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n"
"This is useful so different doxyrules.make files included by the same \n"
"Makefile don't overwrite each other's variables."
);
cs->addDependency("GENERATE_PERLMOD");
//----------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------
addInfo( "Preprocessor","Configuration options related to the preprocessor "); addInfo( "Preprocessor","Configuration options related to the preprocessor ");
......
...@@ -259,9 +259,9 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ...@@ -259,9 +259,9 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
//printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef); //printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef);
if (Config_getBool("SOURCE_BROWSER") && m_startBodyLine!=-1 && m_bodyDef) if (Config_getBool("SOURCE_BROWSER") && m_startBodyLine!=-1 && m_bodyDef)
{ {
//ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::RTF);
ol.newParagraph(); ol.newParagraph();
//ol.enableAll(); ol.enableAll();
QCString refText = theTranslator->trDefinedAtLineInSourceFile(); QCString refText = theTranslator->trDefinedAtLineInSourceFile();
int lineMarkerPos = refText.find("@0"); int lineMarkerPos = refText.find("@0");
......
...@@ -327,7 +327,7 @@ static bool insidePRE(DocNode *n) ...@@ -327,7 +327,7 @@ static bool insidePRE(DocNode *n)
{ {
while (n) while (n)
{ {
if (n->kind()==DocNode::Kind_HtmlPre) return TRUE; if (n->isPreformatted()) return TRUE;
n=n->parent(); n=n->parent();
} }
return FALSE; return FALSE;
...@@ -539,15 +539,17 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children, ...@@ -539,15 +539,17 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
return tok==TK_NEWPARA ? TK_NEWPARA : RetVal_OK; return tok==TK_NEWPARA ? TK_NEWPARA : RetVal_OK;
} }
static void handleStyleEnter(DocNode *parent,QList<DocNode> &children,DocStyleChange::Style s) static void handleStyleEnter(DocNode *parent,QList<DocNode> &children,
DocStyleChange::Style s,const HtmlAttribList *attribs)
{ {
DBG(("HandleStyleEnter\n")); DBG(("HandleStyleEnter\n"));
DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,TRUE); DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,TRUE,attribs);
children.append(sc); children.append(sc);
g_styleStack.push(sc); g_styleStack.push(sc);
} }
static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,DocStyleChange::Style s,const char *tagName) static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
DocStyleChange::Style s,const char *tagName)
{ {
DBG(("HandleStyleLeave\n")); DBG(("HandleStyleLeave\n"));
if (g_styleStack.isEmpty() || // no style change if (g_styleStack.isEmpty() || // no style change
...@@ -583,6 +585,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children) ...@@ -583,6 +585,7 @@ static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children)
case DocStyleChange::Small: cmd = "small"; break; case DocStyleChange::Small: cmd = "small"; break;
case DocStyleChange::Subscript: cmd = "subscript"; break; case DocStyleChange::Subscript: cmd = "subscript"; break;
case DocStyleChange::Superscript: cmd = "superscript"; break; case DocStyleChange::Superscript: cmd = "superscript"; break;
case DocStyleChange::Preformatted: cmd = "preformatted"; break;
} }
warn(g_fileName,doctokenizerYYlineno,"Error: end of paragraph without end of style " warn(g_fileName,doctokenizerYYlineno,"Error: end of paragraph without end of style "
"command </%s>",cmd); "command </%s>",cmd);
...@@ -597,12 +600,14 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children) ...@@ -597,12 +600,14 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children)
{ {
Definition *compound=0; Definition *compound=0;
MemberDef *member=0; MemberDef *member=0;
QString name = g_token->name;
if (name.at(0)=='#') name=name.right(name.length()-1);
if (resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member)) if (resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member))
{ {
if (member) // member link if (member) // member link
{ {
children.append(new children.append(new
DocLinkedWord(parent,g_token->name, DocLinkedWord(parent,name,
compound->getReference(), compound->getReference(),
compound->getOutputFileBase(), compound->getOutputFileBase(),
member->anchor() member->anchor()
...@@ -612,7 +617,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children) ...@@ -612,7 +617,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children)
else // compound link else // compound link
{ {
children.append(new children.append(new
DocLinkedWord(parent,g_token->name, DocLinkedWord(parent,name,
compound->getReference(), compound->getReference(),
compound->getOutputFileBase(), compound->getOutputFileBase(),
"" ""
...@@ -791,17 +796,29 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children ...@@ -791,17 +796,29 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
case HTML_BOLD: case HTML_BOLD:
if (!g_token->endTag) if (!g_token->endTag)
{ {
handleStyleEnter(parent,children,DocStyleChange::Bold); handleStyleEnter(parent,children,DocStyleChange::Bold,&g_token->attribs);
} }
else else
{ {
handleStyleLeave(parent,children,DocStyleChange::Bold,tokenName); handleStyleLeave(parent,children,DocStyleChange::Bold,tokenName);
} }
break; break;
case HTML_PRE:
if (!g_token->endTag)
{
handleStyleEnter(parent,children,DocStyleChange::Preformatted,&g_token->attribs);
parent->setInsidePreformatted(TRUE);
}
else
{
handleStyleLeave(parent,children,DocStyleChange::Preformatted,tokenName);
parent->setInsidePreformatted(FALSE);
}
break;
case HTML_CODE: case HTML_CODE:
if (!g_token->endTag) if (!g_token->endTag)
{ {
handleStyleEnter(parent,children,DocStyleChange::Code); handleStyleEnter(parent,children,DocStyleChange::Code,&g_token->attribs);
} }
else else
{ {
...@@ -811,7 +828,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children ...@@ -811,7 +828,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
case HTML_EMPHASIS: case HTML_EMPHASIS:
if (!g_token->endTag) if (!g_token->endTag)
{ {
handleStyleEnter(parent,children,DocStyleChange::Italic); handleStyleEnter(parent,children,DocStyleChange::Italic,&g_token->attribs);
} }
else else
{ {
...@@ -821,7 +838,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children ...@@ -821,7 +838,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
case HTML_SUB: case HTML_SUB:
if (!g_token->endTag) if (!g_token->endTag)
{ {
handleStyleEnter(parent,children,DocStyleChange::Subscript); handleStyleEnter(parent,children,DocStyleChange::Subscript,&g_token->attribs);
} }
else else
{ {
...@@ -831,7 +848,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children ...@@ -831,7 +848,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
case HTML_SUP: case HTML_SUP:
if (!g_token->endTag) if (!g_token->endTag)
{ {
handleStyleEnter(parent,children,DocStyleChange::Superscript); handleStyleEnter(parent,children,DocStyleChange::Superscript,&g_token->attribs);
} }
else else
{ {
...@@ -841,7 +858,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children ...@@ -841,7 +858,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
case HTML_CENTER: case HTML_CENTER:
if (!g_token->endTag) if (!g_token->endTag)
{ {
handleStyleEnter(parent,children,DocStyleChange::Center); handleStyleEnter(parent,children,DocStyleChange::Center,&g_token->attribs);
} }
else else
{ {
...@@ -851,7 +868,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children ...@@ -851,7 +868,7 @@ static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children
case HTML_SMALL: case HTML_SMALL:
if (!g_token->endTag) if (!g_token->endTag)
{ {
handleStyleEnter(parent,children,DocStyleChange::Small); handleStyleEnter(parent,children,DocStyleChange::Small,&g_token->attribs);
} }
else else
{ {
...@@ -1614,7 +1631,7 @@ QString DocLink::parse(bool isJavaLink) ...@@ -1614,7 +1631,7 @@ QString DocLink::parse(bool isJavaLink)
} }
goto endlink; goto endlink;
default: default:
warn(g_fileName,doctokenizerYYlineno,"Error: Illegal command %s as part of a \\ref", warn(g_fileName,doctokenizerYYlineno,"Error: Illegal command %s as part of a \\link",
g_token->name.data()); g_token->name.data());
break; break;
} }
...@@ -1628,7 +1645,6 @@ QString DocLink::parse(bool isJavaLink) ...@@ -1628,7 +1645,6 @@ QString DocLink::parse(bool isJavaLink)
if (isJavaLink) // special case to detect closing } if (isJavaLink) // special case to detect closing }
{ {
QString w = g_token->name; QString w = g_token->name;
uint l=w.length();
int p; int p;
if (w=="}") if (w=="}")
{ {
...@@ -1636,6 +1652,7 @@ QString DocLink::parse(bool isJavaLink) ...@@ -1636,6 +1652,7 @@ QString DocLink::parse(bool isJavaLink)
} }
else if ((p=w.find('}'))!=-1) else if ((p=w.find('}'))!=-1)
{ {
uint l=w.length();
m_children.append(new DocWord(this,w.left(p))); m_children.append(new DocWord(this,w.left(p)));
if ((uint)p<l-1) // something left after the } (for instance a .) if ((uint)p<l-1) // something left after the } (for instance a .)
{ {
...@@ -2494,6 +2511,7 @@ enddesclist: ...@@ -2494,6 +2511,7 @@ enddesclist:
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
#if 0
int DocHtmlPre::parse() int DocHtmlPre::parse()
{ {
int rv; int rv;
...@@ -2515,6 +2533,7 @@ int DocHtmlPre::parse() ...@@ -2515,6 +2533,7 @@ int DocHtmlPre::parse()
ASSERT(n==this); ASSERT(n==this);
return rv==RetVal_EndPre ? RetVal_OK : rv; return rv==RetVal_EndPre ? RetVal_OK : rv;
} }
#endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -3524,33 +3543,37 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag ...@@ -3524,33 +3543,37 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag
retval=RetVal_ListItem; retval=RetVal_ListItem;
} }
break; break;
case HTML_PRE: //case HTML_PRE:
{ // {
DocHtmlPre *pre = new DocHtmlPre(this,tagHtmlAttribs); // DocHtmlPre *pre = new DocHtmlPre(this,tagHtmlAttribs);
m_children.append(pre); // m_children.append(pre);
retval=pre->parse(); // retval=pre->parse();
} // }
break; // break;
case HTML_BOLD: case HTML_BOLD:
handleStyleEnter(this,m_children,DocStyleChange::Bold); handleStyleEnter(this,m_children,DocStyleChange::Bold,&g_token->attribs);
break; break;
case HTML_CODE: case HTML_CODE:
handleStyleEnter(this,m_children,DocStyleChange::Code); handleStyleEnter(this,m_children,DocStyleChange::Code,&g_token->attribs);
break; break;
case HTML_EMPHASIS: case HTML_EMPHASIS:
handleStyleEnter(this,m_children,DocStyleChange::Italic); handleStyleEnter(this,m_children,DocStyleChange::Italic,&g_token->attribs);
break; break;
case HTML_SUB: case HTML_SUB:
handleStyleEnter(this,m_children,DocStyleChange::Subscript); handleStyleEnter(this,m_children,DocStyleChange::Subscript,&g_token->attribs);
break; break;
case HTML_SUP: case HTML_SUP:
handleStyleEnter(this,m_children,DocStyleChange::Superscript); handleStyleEnter(this,m_children,DocStyleChange::Superscript,&g_token->attribs);
break; break;
case HTML_CENTER: case HTML_CENTER:
handleStyleEnter(this,m_children,DocStyleChange::Center); handleStyleEnter(this,m_children,DocStyleChange::Center,&g_token->attribs);
break; break;
case HTML_SMALL: case HTML_SMALL:
handleStyleEnter(this,m_children,DocStyleChange::Small); handleStyleEnter(this,m_children,DocStyleChange::Small,&g_token->attribs);
break;
case HTML_PRE:
handleStyleEnter(this,m_children,DocStyleChange::Preformatted,&g_token->attribs);
setInsidePreformatted(TRUE);
break; break;
case HTML_P: case HTML_P:
retval=TK_NEWPARA; retval=TK_NEWPARA;
...@@ -3737,16 +3760,16 @@ int DocPara::handleHtmlEndTag(const QString &tagName) ...@@ -3737,16 +3760,16 @@ int DocPara::handleHtmlEndTag(const QString &tagName)
// ignore </li> tags // ignore </li> tags
} }
break; break;
case HTML_PRE: //case HTML_PRE:
if (!insidePRE(this)) // if (!insidePRE(this))
{ // {
warn(g_fileName,doctokenizerYYlineno,"Error: found </pre> tag without matching <pre>"); // warn(g_fileName,doctokenizerYYlineno,"Error: found </pre> tag without matching <pre>");
} // }
else // else
{ // {
retval=RetVal_EndPre; // retval=RetVal_EndPre;
} // }
break; // break;
case HTML_BOLD: case HTML_BOLD:
handleStyleLeave(this,m_children,DocStyleChange::Bold,"b"); handleStyleLeave(this,m_children,DocStyleChange::Bold,"b");
break; break;
...@@ -3768,6 +3791,10 @@ int DocPara::handleHtmlEndTag(const QString &tagName) ...@@ -3768,6 +3791,10 @@ int DocPara::handleHtmlEndTag(const QString &tagName)
case HTML_SMALL: case HTML_SMALL:
handleStyleLeave(this,m_children,DocStyleChange::Small,"small"); handleStyleLeave(this,m_children,DocStyleChange::Small,"small");
break; break;
case HTML_PRE:
handleStyleLeave(this,m_children,DocStyleChange::Preformatted,"preformatted");
setInsidePreformatted(FALSE);
break;
case HTML_P: case HTML_P:
// ignore </p> tag // ignore </p> tag
break; break;
......
...@@ -80,7 +80,7 @@ class DocNode ...@@ -80,7 +80,7 @@ class DocNode
Kind_XRefItem = 15, Kind_XRefItem = 15,
Kind_HtmlList = 16, Kind_HtmlList = 16,
Kind_HtmlListItem = 17, Kind_HtmlListItem = 17,
Kind_HtmlPre = 18, //Kind_HtmlPre = 18,
Kind_HtmlDescList = 19, Kind_HtmlDescList = 19,
Kind_HtmlDescData = 20, Kind_HtmlDescData = 20,
Kind_HtmlDescTitle = 21, Kind_HtmlDescTitle = 21,
...@@ -112,7 +112,9 @@ class DocNode ...@@ -112,7 +112,9 @@ class DocNode
Kind_Copy = 47, Kind_Copy = 47,
Kind_Text = 48 Kind_Text = 48
}; };
/*! Destructor. */ /*! Creates a new node */
DocNode() : m_insidePre(FALSE) {}
/*! Destroys a node. */
virtual ~DocNode() {} virtual ~DocNode() {}
/*! Returns the kind of node. Provides runtime type information */ /*! Returns the kind of node. Provides runtime type information */
virtual Kind kind() const = 0; virtual Kind kind() const = 0;
...@@ -122,6 +124,12 @@ class DocNode ...@@ -122,6 +124,12 @@ class DocNode
* @param v Abstract visitor. * @param v Abstract visitor.
*/ */
virtual void accept(DocVisitor *v) = 0; virtual void accept(DocVisitor *v) = 0;
/*! Returns TRUE iff this node is inside a preformatted section */
bool isPreformatted() const { return m_insidePre; }
/*! Sets whether or not this item is inside a preformatted section */
void setInsidePreformatted(bool p) { m_insidePre = p; }
private:
bool m_insidePre;
}; };
/*! @brief Default accept implementation for compound nodes in the abstract /*! @brief Default accept implementation for compound nodes in the abstract
...@@ -254,22 +262,26 @@ class DocStyleChange : public DocNode ...@@ -254,22 +262,26 @@ class DocStyleChange : public DocNode
{ {
public: public:
enum Style { Bold, Italic, Code, Center, Small, enum Style { Bold, Italic, Code, Center, Small,
Subscript, Superscript Subscript, Superscript, Preformatted
}; };
DocStyleChange(DocNode *parent,uint position,Style s,bool enable) : DocStyleChange(DocNode *parent,uint position,Style s,bool enable,
m_parent(parent), m_position(position), m_style(s), m_enable(enable) {} const HtmlAttribList *attribs=0) :
m_parent(parent), m_position(position), m_style(s), m_enable(enable)
{ if (attribs) m_attribs=*attribs; }
Kind kind() const { return Kind_StyleChange; } Kind kind() const { return Kind_StyleChange; }
Style style() const { return m_style; } Style style() const { return m_style; }
bool enable() const { return m_enable; } bool enable() const { return m_enable; }
uint position() const { return m_position; } uint position() const { return m_position; }
DocNode *parent() const { return m_parent; } DocNode *parent() const { return m_parent; }
void accept(DocVisitor *v) { v->visit(this); } void accept(DocVisitor *v) { v->visit(this); }
const HtmlAttribList &attribs() const { return m_attribs; }
private: private:
DocNode *m_parent; DocNode *m_parent;
uint m_position; uint m_position;
Style m_style; Style m_style;
bool m_enable; bool m_enable;
HtmlAttribList m_attribs;
}; };
/*! @brief Node representing a special symbol */ /*! @brief Node representing a special symbol */
...@@ -1024,7 +1036,7 @@ class DocHtmlDescData : public CompAccept<DocHtmlDescData>, public DocNode ...@@ -1024,7 +1036,7 @@ class DocHtmlDescData : public CompAccept<DocHtmlDescData>, public DocNode
HtmlAttribList m_attribs; HtmlAttribList m_attribs;
}; };
#if 0
/*! @brief Node representing a preformatted HTML section */ /*! @brief Node representing a preformatted HTML section */
class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode
{ {
...@@ -1041,6 +1053,7 @@ class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode ...@@ -1041,6 +1053,7 @@ class DocHtmlPre : public CompAccept<DocHtmlPre>, public DocNode
DocNode * m_parent; DocNode * m_parent;
HtmlAttribList m_attribs; HtmlAttribList m_attribs;
}; };
#endif
/*! @brief Node representing a HTML table cell */ /*! @brief Node representing a HTML table cell */
class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode class DocHtmlCell : public CompAccept<DocHtmlCell>, public DocNode
......
...@@ -219,7 +219,7 @@ URLMASK (([a-z_A-Z][^\>\"\n]*{URLCHAR})|({URLCHAR}+))([({]{URLCHAR}*[)}])? ...@@ -219,7 +219,7 @@ URLMASK (([a-z_A-Z][^\>\"\n]*{URLCHAR})|({URLCHAR}+))([({]{URLCHAR}*[)}])?
FILESCHAR [a-z_A-Z0-9\\:\\\/\-\+] FILESCHAR [a-z_A-Z0-9\\:\\\/\-\+]
FILEECHAR [a-z_A-Z0-9\-\+] FILEECHAR [a-z_A-Z0-9\-\+]
FILEMASK {FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)* FILEMASK {FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*
LINKMASK [^ \t\n\r\\@<&$]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"))? LINKMASK [^ \t\n\r\\@<&${}]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"))?
SPCMD1 {CMD}[a-z_A-Z0-9]+ SPCMD1 {CMD}[a-z_A-Z0-9]+
SPCMD2 {CMD}[\\@<>&$#%~] SPCMD2 {CMD}[\\@<>&$#%~]
SPCMD3 {CMD}form#[0-9]+ SPCMD3 {CMD}form#[0-9]+
...@@ -234,12 +234,12 @@ OPDEL {BLANK}+"delete"({BLANK}*"[]")? ...@@ -234,12 +234,12 @@ OPDEL {BLANK}+"delete"({BLANK}*"[]")?
OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()" OPNORM {OPNEW}|{OPDEL}|"+"|"-"|"*"|"/"|"%"|"^"|"&"|"|"|"~"|"!"|"="|"<"|">"|"+="|"-="|"*="|"/="|"%="|"^="|"&="|"|="|"<<"|">>"|"<<="|">>="|"=="|"!="|"<="|">="|"&&"|"||"|"++"|"--"|","|"->*"|"->"|"[]"|"()"
OPCAST {BLANK}+[^(\r\n.,]+ OPCAST {BLANK}+[^(\r\n.,]+
OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG}) OPMASK ({BLANK}*{OPNORM}({FUNCARG}?))|({OPCAST}{FUNCARG})
LNKWORD1 {SCOPEMASK} LNKWORD1 ("::"|"#")?{SCOPEMASK}
CVSPEC {BLANK}*("const"|"volatile") CVSPEC {BLANK}*("const"|"volatile")
LNKWORD2 {SCOPEPRE}*"operator"{OPMASK} LNKWORD2 {SCOPEPRE}*"operator"{OPMASK}
WORD1 [^ \t\n\r\\@<>&$#,.]+ WORD1 [^ \t\n\r\\@<>{}&$#,.]+|"{"|"}"
WORD2 "."|"," WORD2 "."|","
WORD1NQ [^ \t\n\r\\@<>&$#,."]+ WORD1NQ [^ \t\n\r\\@<>{}&$#,."]+
WORD2NQ "."|"," WORD2NQ "."|","
HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">" HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*">"
HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p" HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"
......
...@@ -38,7 +38,7 @@ class DocVerbatim; ...@@ -38,7 +38,7 @@ class DocVerbatim;
class DocXRefItem; class DocXRefItem;
class DocHtmlList; class DocHtmlList;
class DocHtmlListItem; class DocHtmlListItem;
class DocHtmlPre; //class DocHtmlPre;
class DocHtmlDescList; class DocHtmlDescList;
class DocHtmlDescTitle; class DocHtmlDescTitle;
class DocHtmlDescData; class DocHtmlDescData;
...@@ -75,6 +75,7 @@ class DocText; ...@@ -75,6 +75,7 @@ class DocText;
class DocVisitor class DocVisitor
{ {
public: public:
virtual ~DocVisitor() {}
/*! @name Visitor functions for leaf nodes /*! @name Visitor functions for leaf nodes
* @{ * @{
*/ */
...@@ -119,8 +120,8 @@ class DocVisitor ...@@ -119,8 +120,8 @@ class DocVisitor
virtual void visitPost(DocHtmlListItem *) = 0; virtual void visitPost(DocHtmlListItem *) = 0;
virtual void visitPre(DocHtmlListItem *) = 0; virtual void visitPre(DocHtmlListItem *) = 0;
virtual void visitPost(DocHtmlList *) = 0; virtual void visitPost(DocHtmlList *) = 0;
virtual void visitPre(DocHtmlPre *) = 0; //virtual void visitPre(DocHtmlPre *) = 0;
virtual void visitPost(DocHtmlPre *) = 0; //virtual void visitPost(DocHtmlPre *) = 0;
virtual void visitPre(DocHtmlDescList *) = 0; virtual void visitPre(DocHtmlDescList *) = 0;
virtual void visitPost(DocHtmlDescList *) = 0; virtual void visitPost(DocHtmlDescList *) = 0;
virtual void visitPre(DocHtmlDescTitle *) = 0; virtual void visitPre(DocHtmlDescTitle *) = 0;
......
...@@ -133,26 +133,37 @@ void HtmlDocVisitor::visit(DocStyleChange *s) ...@@ -133,26 +133,37 @@ void HtmlDocVisitor::visit(DocStyleChange *s)
switch (s->style()) switch (s->style())
{ {
case DocStyleChange::Bold: case DocStyleChange::Bold:
if (s->enable()) m_t << "<b>"; else m_t << "</b>"; if (s->enable()) m_t << "<b" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</b>";
break; break;
case DocStyleChange::Italic: case DocStyleChange::Italic:
if (s->enable()) m_t << "<em>"; else m_t << "</em>"; if (s->enable()) m_t << "<em" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</em>";
break; break;
case DocStyleChange::Code: case DocStyleChange::Code:
if (s->enable()) m_t << "<code>"; else m_t << "</code>"; if (s->enable()) m_t << "<code" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</code>";
break; break;
case DocStyleChange::Subscript: case DocStyleChange::Subscript:
if (s->enable()) m_t << "<sub>"; else m_t << "</sub>"; if (s->enable()) m_t << "<sub" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sub>";
break; break;
case DocStyleChange::Superscript: case DocStyleChange::Superscript:
if (s->enable()) m_t << "<sup>"; else m_t << "</sup>"; if (s->enable()) m_t << "<sup" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sup>";
break; break;
case DocStyleChange::Center: case DocStyleChange::Center:
if (s->enable()) m_t << "<center>"; else m_t << "</center>"; if (s->enable()) m_t << "<center" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</center>";
break; break;
case DocStyleChange::Small: case DocStyleChange::Small:
if (s->enable()) m_t << "<small>"; else m_t << "</small>"; if (s->enable()) m_t << "<small" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</small>";
break; break;
case DocStyleChange::Preformatted:
if (s->enable())
{
m_t << "<pre" << htmlAttribsToString(s->attribs()) << ">\n";
m_insidePre=TRUE;
}
else
{
m_insidePre=FALSE;
m_t << "</pre>\n";
}
} }
} }
...@@ -434,17 +445,17 @@ void HtmlDocVisitor::visitPost(DocHtmlListItem *) ...@@ -434,17 +445,17 @@ void HtmlDocVisitor::visitPost(DocHtmlListItem *)
m_t << "</li>\n"; m_t << "</li>\n";
} }
void HtmlDocVisitor::visitPre(DocHtmlPre *p) //void HtmlDocVisitor::visitPre(DocHtmlPre *p)
{ //{
m_t << "<pre" << htmlAttribsToString(p->attribs()) << ">\n"; // m_t << "<pre" << htmlAttribsToString(p->attribs()) << ">\n";
m_insidePre=TRUE; // m_insidePre=TRUE;
} //}
void HtmlDocVisitor::visitPost(DocHtmlPre *) //void HtmlDocVisitor::visitPost(DocHtmlPre *)
{ //{
m_insidePre=FALSE; // m_insidePre=FALSE;
m_t << "</pre>\n"; // m_t << "</pre>\n";
} //}
void HtmlDocVisitor::visitPre(DocHtmlDescList *dl) void HtmlDocVisitor::visitPre(DocHtmlDescList *dl)
{ {
......
...@@ -76,8 +76,8 @@ class HtmlDocVisitor : public DocVisitor ...@@ -76,8 +76,8 @@ class HtmlDocVisitor : public DocVisitor
void visitPost(DocHtmlList *) ; void visitPost(DocHtmlList *) ;
void visitPre(DocHtmlListItem *); void visitPre(DocHtmlListItem *);
void visitPost(DocHtmlListItem *); void visitPost(DocHtmlListItem *);
void visitPre(DocHtmlPre *); //void visitPre(DocHtmlPre *);
void visitPost(DocHtmlPre *); //void visitPost(DocHtmlPre *);
void visitPre(DocHtmlDescList *); void visitPre(DocHtmlDescList *);
void visitPost(DocHtmlDescList *); void visitPost(DocHtmlDescList *);
void visitPre(DocHtmlDescTitle *); void visitPre(DocHtmlDescTitle *);
......
...@@ -203,6 +203,18 @@ void LatexDocVisitor::visit(DocStyleChange *s) ...@@ -203,6 +203,18 @@ void LatexDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Small: case DocStyleChange::Small:
if (s->enable()) m_t << "\\footnotesize "; else m_t << "\\normalsize "; if (s->enable()) m_t << "\\footnotesize "; else m_t << "\\normalsize ";
break; break;
case DocStyleChange::Preformatted:
if (s->enable())
{
m_t << "\\small\\begin{alltt}";
m_insidePre=TRUE;
}
else
{
m_insidePre=FALSE;
m_t << "\\end{alltt}\\normalsize " << endl;
}
break;
} }
} }
...@@ -499,17 +511,17 @@ void LatexDocVisitor::visitPost(DocHtmlListItem *) ...@@ -499,17 +511,17 @@ void LatexDocVisitor::visitPost(DocHtmlListItem *)
{ {
} }
void LatexDocVisitor::visitPre(DocHtmlPre *) //void LatexDocVisitor::visitPre(DocHtmlPre *)
{ //{
m_t << "\\small\\begin{alltt}"; // m_t << "\\small\\begin{alltt}";
m_insidePre=TRUE; // m_insidePre=TRUE;
} //}
void LatexDocVisitor::visitPost(DocHtmlPre *) //void LatexDocVisitor::visitPost(DocHtmlPre *)
{ //{
m_insidePre=FALSE; // m_insidePre=FALSE;
m_t << "\\end{alltt}\\normalsize " << endl; // m_t << "\\end{alltt}\\normalsize " << endl;
} //}
void LatexDocVisitor::visitPre(DocHtmlDescList *) void LatexDocVisitor::visitPre(DocHtmlDescList *)
{ {
......
...@@ -76,8 +76,8 @@ class LatexDocVisitor : public DocVisitor ...@@ -76,8 +76,8 @@ class LatexDocVisitor : public DocVisitor
void visitPost(DocHtmlList *s); void visitPost(DocHtmlList *s);
void visitPre(DocHtmlListItem *); void visitPre(DocHtmlListItem *);
void visitPost(DocHtmlListItem *); void visitPost(DocHtmlListItem *);
void visitPre(DocHtmlPre *); //void visitPre(DocHtmlPre *);
void visitPost(DocHtmlPre *); //void visitPost(DocHtmlPre *);
void visitPre(DocHtmlDescList *); void visitPre(DocHtmlDescList *);
void visitPost(DocHtmlDescList *); void visitPost(DocHtmlDescList *);
void visitPre(DocHtmlDescTitle *); void visitPre(DocHtmlDescTitle *);
......
...@@ -151,6 +151,22 @@ void ManDocVisitor::visit(DocStyleChange *s) ...@@ -151,6 +151,22 @@ void ManDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Small: case DocStyleChange::Small:
/* not supported */ /* not supported */
break; break;
case DocStyleChange::Preformatted:
if (s->enable())
{
if (!m_firstCol) m_t << endl;
m_t << ".PP" << endl;
m_t << ".nf" << endl;
m_insidePre=TRUE;
}
else
{
m_insidePre=FALSE;
if (!m_firstCol) m_t << endl;
m_t << ".PP" << endl;
m_firstCol=TRUE;
}
break;
} }
} }
...@@ -468,21 +484,21 @@ void ManDocVisitor::visitPost(DocHtmlListItem *) ...@@ -468,21 +484,21 @@ void ManDocVisitor::visitPost(DocHtmlListItem *)
m_firstCol=TRUE; m_firstCol=TRUE;
} }
void ManDocVisitor::visitPre(DocHtmlPre *) //void ManDocVisitor::visitPre(DocHtmlPre *)
{ //{
if (!m_firstCol) m_t << endl; // if (!m_firstCol) m_t << endl;
m_t << ".PP" << endl; // m_t << ".PP" << endl;
m_t << ".nf" << endl; // m_t << ".nf" << endl;
m_insidePre=TRUE; // m_insidePre=TRUE;
} //}
//
void ManDocVisitor::visitPost(DocHtmlPre *) //void ManDocVisitor::visitPost(DocHtmlPre *)
{ //{
m_insidePre=FALSE; // m_insidePre=FALSE;
if (!m_firstCol) m_t << endl; // if (!m_firstCol) m_t << endl;
m_t << ".PP" << endl; // m_t << ".PP" << endl;
m_firstCol=TRUE; // m_firstCol=TRUE;
} //}
void ManDocVisitor::visitPre(DocHtmlDescList *) void ManDocVisitor::visitPre(DocHtmlDescList *)
{ {
......
...@@ -76,8 +76,8 @@ class ManDocVisitor : public DocVisitor ...@@ -76,8 +76,8 @@ class ManDocVisitor : public DocVisitor
void visitPost(DocHtmlList *s); void visitPost(DocHtmlList *s);
void visitPre(DocHtmlListItem *); void visitPre(DocHtmlListItem *);
void visitPost(DocHtmlListItem *); void visitPost(DocHtmlListItem *);
void visitPre(DocHtmlPre *); //void visitPre(DocHtmlPre *);
void visitPost(DocHtmlPre *); //void visitPost(DocHtmlPre *);
void visitPre(DocHtmlDescList *); void visitPre(DocHtmlDescList *);
void visitPost(DocHtmlDescList *); void visitPost(DocHtmlDescList *);
void visitPre(DocHtmlDescTitle *); void visitPre(DocHtmlDescTitle *);
......
...@@ -1271,6 +1271,15 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1271,6 +1271,15 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.newParagraph(); ol.newParagraph();
ol.popGeneratorState(); ol.popGeneratorState();
} }
else if(!brief.isEmpty() && (Config_getBool("REPEAT_BRIEF") ||
!Config_getBool("BRIEF_MEMBER_DESC")))
{
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::RTF);
ol.newParagraph();
ol.popGeneratorState();
}
//printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n", //printf("***** defArgList=%p name=%s docs=%s hasDocs=%d\n",
// defArgList, // defArgList,
...@@ -1375,7 +1384,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1375,7 +1384,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
// write class that contains a member that is reimplemented by this one // write class that contains a member that is reimplemented by this one
if (bcd->isLinkable()) if (bcd->isLinkable())
{ {
ol.disable(OutputGenerator::RTF);
ol.newParagraph(); ol.newParagraph();
ol.enableAll();
QCString reimplFromLine; QCString reimplFromLine;
if (bmd->virtualness()!=Pure && bcd->compoundType()!=ClassDef::Interface) if (bmd->virtualness()!=Pure && bcd->compoundType()!=ClassDef::Interface)
...@@ -1449,7 +1460,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1449,7 +1460,9 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
{ {
mli.toFirst(); mli.toFirst();
// write the list of classes that overwrite this member // write the list of classes that overwrite this member
ol.disable(OutputGenerator::RTF);
ol.newParagraph(); ol.newParagraph();
ol.enableAll();
QCString reimplInLine; QCString reimplInLine;
if (virt==Pure || (classDef && classDef->compoundType()==ClassDef::Interface)) if (virt==Pure || (classDef && classDef->compoundType()==ClassDef::Interface))
......
...@@ -102,7 +102,14 @@ class PerlModOutput ...@@ -102,7 +102,14 @@ class PerlModOutput
{ {
public: public:
PerlModOutput() : m_stream(0), m_indentation(0) { m_spaces[0] = 0; } bool m_pretty;
inline PerlModOutput(bool pretty)
: m_pretty(pretty), m_stream(0), m_indentation(false), m_blockstart(true)
{
m_spaces[0] = 0;
}
virtual ~PerlModOutput() { } virtual ~PerlModOutput() { }
inline void setPerlModOutputStream(PerlModOutputStream *os) { m_stream = os; } inline void setPerlModOutputStream(PerlModOutputStream *os) { m_stream = os; }
...@@ -110,6 +117,16 @@ public: ...@@ -110,6 +117,16 @@ public:
inline PerlModOutput &openSave() { iopenSave(); return *this; } inline PerlModOutput &openSave() { iopenSave(); return *this; }
inline PerlModOutput &closeSave(QString &s) { icloseSave(s); return *this; } inline PerlModOutput &closeSave(QString &s) { icloseSave(s); return *this; }
inline PerlModOutput &continueBlock()
{
if (m_blockstart)
m_blockstart = false;
else
m_stream->add(',');
indent();
return *this;
}
inline PerlModOutput &add(char c) { m_stream->add(c); return *this; } inline PerlModOutput &add(char c) { m_stream->add(c); return *this; }
inline PerlModOutput &add(const char *s) { m_stream->add(s); return *this; } inline PerlModOutput &add(const char *s) { m_stream->add(s); return *this; }
inline PerlModOutput &add(QCString &s) { m_stream->add(s); return *this; } inline PerlModOutput &add(QCString &s) { m_stream->add(s); return *this; }
...@@ -118,12 +135,24 @@ public: ...@@ -118,12 +135,24 @@ public:
inline PerlModOutput &add(unsigned int n) { m_stream->add(n); return *this; } inline PerlModOutput &add(unsigned int n) { m_stream->add(n); return *this; }
PerlModOutput &addQuoted(const char *s) { iaddQuoted(s); return *this; } PerlModOutput &addQuoted(const char *s) { iaddQuoted(s); return *this; }
inline PerlModOutput &indent() { m_stream->add(m_spaces); return *this; }
inline PerlModOutput &indent()
{
if (m_pretty) {
m_stream->add('\n');
m_stream->add(m_spaces);
}
return *this;
}
inline PerlModOutput &open(char c, const char *s = 0) { iopen(c, s); return *this; } inline PerlModOutput &open(char c, const char *s = 0) { iopen(c, s); return *this; }
inline PerlModOutput &close(char c = 0) { iclose(c); return *this; } inline PerlModOutput &close(char c = 0) { iclose(c); return *this; }
inline PerlModOutput &addField(const char *s) { iaddField(s); return *this; } inline PerlModOutput &addField(const char *s) { iaddField(s); return *this; }
inline PerlModOutput &addFieldQuotedChar(const char *field, char content)
{
iaddFieldQuotedChar(field, content); return *this;
}
inline PerlModOutput &addFieldQuotedString(const char *field, const char *content) inline PerlModOutput &addFieldQuotedString(const char *field, const char *content)
{ {
iaddFieldQuotedString(field, content); return *this; iaddFieldQuotedString(field, content); return *this;
...@@ -146,6 +175,7 @@ protected: ...@@ -146,6 +175,7 @@ protected:
void decIndent(); void decIndent();
void iaddQuoted(const char *); void iaddQuoted(const char *);
void iaddFieldQuotedChar(const char *, char);
void iaddFieldQuotedString(const char *, const char *); void iaddFieldQuotedString(const char *, const char *);
void iaddField(const char *); void iaddField(const char *);
...@@ -156,6 +186,7 @@ private: ...@@ -156,6 +186,7 @@ private:
PerlModOutputStream *m_stream; PerlModOutputStream *m_stream;
int m_indentation; int m_indentation;
bool m_blockstart;
QStack<PerlModOutputStream> m_saved; QStack<PerlModOutputStream> m_saved;
char m_spaces[PERLOUTPUT_MAX_INDENTATION * 2 + 2]; char m_spaces[PERLOUTPUT_MAX_INDENTATION * 2 + 2];
...@@ -203,9 +234,19 @@ void PerlModOutput::iaddQuoted(const char *s) ...@@ -203,9 +234,19 @@ void PerlModOutput::iaddQuoted(const char *s)
inline void PerlModOutput::iaddField(const char *s) inline void PerlModOutput::iaddField(const char *s)
{ {
indent(); continueBlock();
m_stream->add(s); m_stream->add(s);
m_stream->add(" => "); m_stream->add(m_pretty ? " => " : "=>");
}
void PerlModOutput::iaddFieldQuotedChar(const char *field, char content)
{
iaddField(field);
m_stream->add('\'');
if (content == '\'')
m_stream->add('\\');
m_stream->add(content);
m_stream->add('\'');
} }
void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content) void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content)
...@@ -215,7 +256,7 @@ void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content ...@@ -215,7 +256,7 @@ void PerlModOutput::iaddFieldQuotedString(const char *field, const char *content
iaddField(field); iaddField(field);
m_stream->add('\''); m_stream->add('\'');
iaddQuoted(content); iaddQuoted(content);
m_stream->add("',\n"); m_stream->add('\'');
} }
void PerlModOutput::iopen(char c, const char *s) void PerlModOutput::iopen(char c, const char *s)
...@@ -223,10 +264,10 @@ void PerlModOutput::iopen(char c, const char *s) ...@@ -223,10 +264,10 @@ void PerlModOutput::iopen(char c, const char *s)
if (s != 0) if (s != 0)
iaddField(s); iaddField(s);
else else
indent(); continueBlock();
m_stream->add(c); m_stream->add(c);
m_stream->add('\n');
incIndent(); incIndent();
m_blockstart = true;
} }
void PerlModOutput::iclose(char c) void PerlModOutput::iclose(char c)
...@@ -235,7 +276,7 @@ void PerlModOutput::iclose(char c) ...@@ -235,7 +276,7 @@ void PerlModOutput::iclose(char c)
indent(); indent();
if (c != 0) if (c != 0)
m_stream->add(c); m_stream->add(c);
m_stream->add(",\n"); m_blockstart = false;
} }
/*! @brief Concrete visitor implementation for PerlMod output. */ /*! @brief Concrete visitor implementation for PerlMod output. */
...@@ -243,7 +284,7 @@ class PerlModDocVisitor : public DocVisitor ...@@ -243,7 +284,7 @@ class PerlModDocVisitor : public DocVisitor
{ {
public: public:
PerlModDocVisitor(PerlModOutput &); PerlModDocVisitor(PerlModOutput &);
virtual ~PerlModDocVisitor() {} virtual ~PerlModDocVisitor() { }
void finish(); void finish();
...@@ -292,8 +333,8 @@ public: ...@@ -292,8 +333,8 @@ public:
void visitPost(DocHtmlList *) ; void visitPost(DocHtmlList *) ;
void visitPre(DocHtmlListItem *); void visitPre(DocHtmlListItem *);
void visitPost(DocHtmlListItem *); void visitPost(DocHtmlListItem *);
void visitPre(DocHtmlPre *); //void visitPre(DocHtmlPre *);
void visitPost(DocHtmlPre *); //void visitPost(DocHtmlPre *);
void visitPre(DocHtmlDescList *); void visitPre(DocHtmlDescList *);
void visitPost(DocHtmlDescList *); void visitPost(DocHtmlDescList *);
void visitPre(DocHtmlDescTitle *); void visitPre(DocHtmlDescTitle *);
...@@ -358,6 +399,8 @@ private: ...@@ -358,6 +399,8 @@ private:
void singleItem(const char *); void singleItem(const char *);
void openSubBlock(const char * = 0); void openSubBlock(const char * = 0);
void closeSubBlock(); void closeSubBlock();
void openOther();
void closeOther();
//-------------------------------------- //--------------------------------------
// state variables // state variables
...@@ -365,6 +408,7 @@ private: ...@@ -365,6 +408,7 @@ private:
PerlModOutput &m_output; PerlModOutput &m_output;
bool m_textmode; bool m_textmode;
bool m_textblockstart;
QString m_other; QString m_other;
}; };
...@@ -397,6 +441,7 @@ void PerlModDocVisitor::openItem(const char *name) ...@@ -397,6 +441,7 @@ void PerlModDocVisitor::openItem(const char *name)
void PerlModDocVisitor::closeItem() void PerlModDocVisitor::closeItem()
{ {
leaveText();
m_output.closeHash(); m_output.closeHash();
} }
...@@ -413,9 +458,10 @@ void PerlModDocVisitor::leaveText() ...@@ -413,9 +458,10 @@ void PerlModDocVisitor::leaveText()
{ {
if (!m_textmode) if (!m_textmode)
return; return;
m_output.add("\'\n");
closeItem();
m_textmode = false; m_textmode = false;
m_output
.add('\'')
.closeHash();
} }
void PerlModDocVisitor::singleItem(const char *name) void PerlModDocVisitor::singleItem(const char *name)
...@@ -427,6 +473,7 @@ void PerlModDocVisitor::singleItem(const char *name) ...@@ -427,6 +473,7 @@ void PerlModDocVisitor::singleItem(const char *name)
void PerlModDocVisitor::openSubBlock(const char *s) void PerlModDocVisitor::openSubBlock(const char *s)
{ {
m_output.openList(s); m_output.openList(s);
m_textblockstart = true;
} }
void PerlModDocVisitor::closeSubBlock() void PerlModDocVisitor::closeSubBlock()
...@@ -435,6 +482,20 @@ void PerlModDocVisitor::closeSubBlock() ...@@ -435,6 +482,20 @@ void PerlModDocVisitor::closeSubBlock()
m_output.closeList(); m_output.closeList();
} }
void PerlModDocVisitor::openOther()
{
leaveText();
m_output.openSave();
}
void PerlModDocVisitor::closeOther()
{
QString other;
leaveText();
m_output.closeSave(other);
m_other += other;
}
void PerlModDocVisitor::visit(DocWord *w) void PerlModDocVisitor::visit(DocWord *w)
{ {
enterText(); enterText();
...@@ -459,6 +520,8 @@ void PerlModDocVisitor::visit(DocSymbol *sy) ...@@ -459,6 +520,8 @@ void PerlModDocVisitor::visit(DocSymbol *sy)
{ {
char c = 0; char c = 0;
const char *s = 0; const char *s = 0;
const char *accent = 0;
const char *symbol = 0;
switch(sy->symbol()) switch(sy->symbol())
{ {
case DocSymbol::At: c = '@'; break; case DocSymbol::At: c = '@'; break;
...@@ -469,27 +532,41 @@ void PerlModDocVisitor::visit(DocSymbol *sy) ...@@ -469,27 +532,41 @@ void PerlModDocVisitor::visit(DocSymbol *sy)
case DocSymbol::Hash: c = '#'; break; case DocSymbol::Hash: c = '#'; break;
case DocSymbol::Percent: c = '%'; break; case DocSymbol::Percent: c = '%'; break;
case DocSymbol::Quot: c = '"'; break; case DocSymbol::Quot: c = '"'; break;
case DocSymbol::Szlig: c = ''; break;
case DocSymbol::Nbsp: c = ''; break; case DocSymbol::Nbsp: c = ''; break;
case DocSymbol::Uml: c = sy->letter(); break; case DocSymbol::Uml: accent = "umlaut"; break;
case DocSymbol::Acute: c = sy->letter(); break; case DocSymbol::Acute: accent = "acute"; break;
case DocSymbol::Grave: c = sy->letter(); break; case DocSymbol::Grave: accent = "grave"; break;
case DocSymbol::Circ: c = sy->letter(); break; case DocSymbol::Circ: accent = "circ"; break;
case DocSymbol::Tilde: c = sy->letter(); break; case DocSymbol::Tilde: accent = "tilde"; break;
case DocSymbol::Cedil: c = sy->letter(); break; case DocSymbol::Cedil: accent = "cedilla"; break;
case DocSymbol::Ring: c = sy->letter(); break; case DocSymbol::Ring: accent = "ring"; break;
case DocSymbol::BSlash: s = "\\\\"; break; case DocSymbol::BSlash: s = "\\\\"; break;
case DocSymbol::Copy: s = "(c)"; break; case DocSymbol::Copy: symbol = "copyright"; break;
case DocSymbol::Szlig: symbol = "szlig"; break;
case DocSymbol::Apos: s = "\\\'"; break; case DocSymbol::Apos: s = "\\\'"; break;
case DocSymbol::Unknown: case DocSymbol::Unknown:
err("Error: unknown symbol found\n"); err("Error: unknown symbol found\n");
break; break;
} }
if (c != 0) {
enterText(); enterText();
if (c != 0)
m_output.add(c); m_output.add(c);
else } else if (s != 0) {
enterText();
m_output.add(s); m_output.add(s);
} else if (symbol != 0) {
leaveText();
openItem("symbol");
m_output.addFieldQuotedString("symbol", symbol);
closeItem();
} else if (accent != 0) {
leaveText();
openItem("accent");
m_output
.addFieldQuotedString("accent", accent)
.addFieldQuotedChar("letter", sy->letter());
closeItem();
}
} }
void PerlModDocVisitor::visit(DocURL *u) void PerlModDocVisitor::visit(DocURL *u)
...@@ -501,18 +578,26 @@ void PerlModDocVisitor::visit(DocURL *u) ...@@ -501,18 +578,26 @@ void PerlModDocVisitor::visit(DocURL *u)
void PerlModDocVisitor::visit(DocLineBreak *) { singleItem("linebreak"); } void PerlModDocVisitor::visit(DocLineBreak *) { singleItem("linebreak"); }
void PerlModDocVisitor::visit(DocHorRuler *) { singleItem("hruler"); } void PerlModDocVisitor::visit(DocHorRuler *) { singleItem("hruler"); }
void PerlModDocVisitor::visit(DocStyleChange *s) void PerlModDocVisitor::visit(DocStyleChange *s)
{ {
const char *style = 0;
switch (s->style()) switch (s->style())
{ {
case DocStyleChange::Bold: break; // bold case DocStyleChange::Bold: style = "bold"; break;
case DocStyleChange::Italic: break; // italic case DocStyleChange::Italic: style = "italic"; break;
case DocStyleChange::Code: break; // code case DocStyleChange::Code: style = "code"; break;
case DocStyleChange::Subscript: break; // subscript case DocStyleChange::Subscript: style = "subscript"; break;
case DocStyleChange::Superscript: break; // superscript case DocStyleChange::Superscript: style = "superscript"; break;
case DocStyleChange::Center: break; // center case DocStyleChange::Center: style = "center"; break;
case DocStyleChange::Small: break; // small case DocStyleChange::Small: style = "small"; break;
} case DocStyleChange::Preformatted: style = "preformatted"; break;
}
openItem("style");
m_output.addFieldQuotedString("style", style)
.addFieldBoolean("enable", s->enable());
closeItem();
} }
void PerlModDocVisitor::visit(DocVerbatim *s) void PerlModDocVisitor::visit(DocVerbatim *s)
...@@ -616,22 +701,45 @@ void PerlModDocVisitor::visit(DocIndexEntry *) ...@@ -616,22 +701,45 @@ void PerlModDocVisitor::visit(DocIndexEntry *)
void PerlModDocVisitor::visitPre(DocAutoList *l) void PerlModDocVisitor::visitPre(DocAutoList *l)
{ {
openItem(l->isEnumList() ? "ordered_list" : "itemized_list"); openItem("list");
m_output.addFieldQuotedString("style", l->isEnumList() ? "ordered" : "itemized");
openSubBlock("content"); openSubBlock("content");
} }
void PerlModDocVisitor::visitPost(DocAutoList *) { closeSubBlock(); closeItem(); }
void PerlModDocVisitor::visitPre(DocAutoListItem *) { openSubBlock(); } void PerlModDocVisitor::visitPost(DocAutoList *)
void PerlModDocVisitor::visitPost(DocAutoListItem *) { closeSubBlock(); } {
closeSubBlock();
closeItem();
}
void PerlModDocVisitor::visitPre(DocAutoListItem *)
{
openSubBlock();
}
void PerlModDocVisitor::visitPost(DocAutoListItem *)
{
closeSubBlock();
}
void PerlModDocVisitor::visitPre(DocPara *) void PerlModDocVisitor::visitPre(DocPara *)
{ {
if (m_textblockstart)
m_textblockstart = false;
else
singleItem("parbreak");
/*
openItem("para"); openItem("para");
openSubBlock("content"); openSubBlock("content");
*/
} }
void PerlModDocVisitor::visitPost(DocPara *) void PerlModDocVisitor::visitPost(DocPara *)
{ {
/*
closeSubBlock(); closeSubBlock();
closeItem(); closeItem();
*/
} }
void PerlModDocVisitor::visitPre(DocRoot *) void PerlModDocVisitor::visitPre(DocRoot *)
...@@ -644,7 +752,6 @@ void PerlModDocVisitor::visitPost(DocRoot *) ...@@ -644,7 +752,6 @@ void PerlModDocVisitor::visitPost(DocRoot *)
void PerlModDocVisitor::visitPre(DocSimpleSect *s) void PerlModDocVisitor::visitPre(DocSimpleSect *s)
{ {
leaveText();
const char *type = 0; const char *type = 0;
switch (s->type()) switch (s->type())
{ {
...@@ -667,15 +774,14 @@ void PerlModDocVisitor::visitPre(DocSimpleSect *s) ...@@ -667,15 +774,14 @@ void PerlModDocVisitor::visitPre(DocSimpleSect *s)
err("Error: unknown simple section found\n"); err("Error: unknown simple section found\n");
break; break;
} }
m_output.openSave().openList(type); openOther();
openSubBlock(type);
} }
void PerlModDocVisitor::visitPost(DocSimpleSect *) void PerlModDocVisitor::visitPost(DocSimpleSect *)
{ {
QString content; closeSubBlock();
leaveText(); closeOther();
m_output.closeList().closeSave(content);
m_other += content;
} }
void PerlModDocVisitor::visitPre(DocTitle *) void PerlModDocVisitor::visitPre(DocTitle *)
...@@ -692,44 +798,63 @@ void PerlModDocVisitor::visitPost(DocTitle *) ...@@ -692,44 +798,63 @@ void PerlModDocVisitor::visitPost(DocTitle *)
void PerlModDocVisitor::visitPre(DocSimpleList *) void PerlModDocVisitor::visitPre(DocSimpleList *)
{ {
openItem("itemized_list"); openItem("list");
m_output.addFieldQuotedString("style", "itemized");
openSubBlock("content"); openSubBlock("content");
} }
void PerlModDocVisitor::visitPost(DocSimpleList *) { closeSubBlock(); }
void PerlModDocVisitor::visitPost(DocSimpleList *)
{
closeSubBlock();
closeItem();
}
void PerlModDocVisitor::visitPre(DocSimpleListItem *) { openSubBlock(); } void PerlModDocVisitor::visitPre(DocSimpleListItem *) { openSubBlock(); }
void PerlModDocVisitor::visitPost(DocSimpleListItem *) { closeSubBlock(); } void PerlModDocVisitor::visitPost(DocSimpleListItem *) { closeSubBlock(); }
void PerlModDocVisitor::visitPre(DocSection *s) void PerlModDocVisitor::visitPre(DocSection *s)
{ {
QString sect = "sect" + (s->level() + 1); QString sect = QString("sect%1").arg(s->level());
openItem(sect); openItem(sect);
openSubBlock("content"); openSubBlock("content");
} }
void PerlModDocVisitor::visitPost(DocSection *) { closeSubBlock(); }
void PerlModDocVisitor::visitPre(DocHtmlList *l) void PerlModDocVisitor::visitPost(DocSection *)
{ {
openItem((l->type() == DocHtmlList::Ordered) ? "ordered_list" : "itemized_list"); closeSubBlock();
openSubBlock("content"); closeItem();
} }
void PerlModDocVisitor::visitPost(DocHtmlList *) { closeSubBlock(); }
void PerlModDocVisitor::visitPre(DocHtmlListItem *) { openSubBlock(); }
void PerlModDocVisitor::visitPost(DocHtmlListItem *) { closeSubBlock(); }
void PerlModDocVisitor::visitPre(DocHtmlPre *) void PerlModDocVisitor::visitPre(DocHtmlList *l)
{ {
openItem("preformatted"); openItem("list");
m_output.addFieldQuotedString("style", (l->type() == DocHtmlList::Ordered) ? "ordered" : "itemized");
openSubBlock("content"); openSubBlock("content");
//m_insidePre=TRUE;
} }
void PerlModDocVisitor::visitPost(DocHtmlPre *) void PerlModDocVisitor::visitPost(DocHtmlList *)
{ {
//m_insidePre=FALSE;
closeSubBlock(); closeSubBlock();
closeItem(); closeItem();
} }
void PerlModDocVisitor::visitPre(DocHtmlListItem *) { openSubBlock(); }
void PerlModDocVisitor::visitPost(DocHtmlListItem *) { closeSubBlock(); }
//void PerlModDocVisitor::visitPre(DocHtmlPre *)
//{
// openItem("preformatted");
// openSubBlock("content");
// //m_insidePre=TRUE;
//}
//void PerlModDocVisitor::visitPost(DocHtmlPre *)
//{
// //m_insidePre=FALSE;
// closeSubBlock();
// closeItem();
//}
void PerlModDocVisitor::visitPre(DocHtmlDescList *) void PerlModDocVisitor::visitPre(DocHtmlDescList *)
{ {
#if 0 #if 0
...@@ -943,10 +1068,12 @@ void PerlModDocVisitor::visitPre(DocRef *ref) ...@@ -943,10 +1068,12 @@ void PerlModDocVisitor::visitPre(DocRef *ref)
openItem("ref"); openItem("ref");
if (!ref->hasLinkText()) if (!ref->hasLinkText())
m_output.addFieldQuotedString("text", ref->targetTitle()); m_output.addFieldQuotedString("text", ref->targetTitle());
openSubBlock("content");
} }
void PerlModDocVisitor::visitPost(DocRef *) void PerlModDocVisitor::visitPost(DocRef *)
{ {
closeSubBlock();
closeItem(); closeItem();
} }
...@@ -1002,15 +1129,14 @@ void PerlModDocVisitor::visitPre(DocParamSect *s) ...@@ -1002,15 +1129,14 @@ void PerlModDocVisitor::visitPre(DocParamSect *s)
err("Error: unknown parameter section found\n"); err("Error: unknown parameter section found\n");
break; break;
} }
m_output.openSave().openList(type); openOther();
openSubBlock(type);
} }
void PerlModDocVisitor::visitPost(DocParamSect *) void PerlModDocVisitor::visitPost(DocParamSect *)
{ {
leaveText(); closeSubBlock();
QString content; closeOther();
m_output.closeList().closeSave(content);
m_other += content;
} }
void PerlModDocVisitor::visitPre(DocParamList *pl) void PerlModDocVisitor::visitPre(DocParamList *pl)
...@@ -1048,10 +1174,14 @@ void PerlModDocVisitor::visitPre(DocXRefItem *) ...@@ -1048,10 +1174,14 @@ void PerlModDocVisitor::visitPre(DocXRefItem *)
m_output.add("</xreftitle>"); m_output.add("</xreftitle>");
m_output.add("<xrefdescription>"); m_output.add("<xrefdescription>");
#endif #endif
openItem("xrefitem");
openSubBlock("content");
} }
void PerlModDocVisitor::visitPost(DocXRefItem *) void PerlModDocVisitor::visitPost(DocXRefItem *)
{ {
closeSubBlock();
closeItem();
#if 0 #if 0
m_output.add("</xrefdescription>"); m_output.add("</xrefdescription>");
m_output.add("</xrefsect>"); m_output.add("</xrefsect>");
...@@ -1062,10 +1192,12 @@ void PerlModDocVisitor::visitPre(DocInternalRef *ref) ...@@ -1062,10 +1192,12 @@ void PerlModDocVisitor::visitPre(DocInternalRef *ref)
{ {
openItem("ref"); openItem("ref");
addLink(0,ref->file(),ref->anchor()); addLink(0,ref->file(),ref->anchor());
openSubBlock("content");
} }
void PerlModDocVisitor::visitPost(DocInternalRef *) void PerlModDocVisitor::visitPost(DocInternalRef *)
{ {
closeSubBlock();
closeItem(); closeItem();
} }
...@@ -1133,7 +1265,7 @@ static void addPerlModDocBlock(PerlModOutput &output, ...@@ -1133,7 +1265,7 @@ static void addPerlModDocBlock(PerlModOutput &output,
{ {
QCString stext = text.stripWhiteSpace(); QCString stext = text.stripWhiteSpace();
if (stext.isEmpty()) if (stext.isEmpty())
output.addField(name).add("{},\n"); output.addField(name).add("{}");
else { else {
DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,stext,FALSE); DocNode *root = validatingParseDoc(fileName,lineNr,scope,md,stext,FALSE);
output.openHash(name); output.openHash(name);
...@@ -1181,38 +1313,40 @@ class PerlModGenerator ...@@ -1181,38 +1313,40 @@ class PerlModGenerator
{ {
public: public:
PerlModOutput output; PerlModOutput m_output;
QString pathDoxyModelPM; QString pathDoxyStructurePM;
QString pathDoxyDocsTex; QString pathDoxyDocsTex;
QString pathDoxyFormatTex; QString pathDoxyFormatTex;
QString pathDoxyLatexTex; QString pathDoxyLatexTex;
QString pathDoxyLatexDVI; QString pathDoxyLatexDVI;
QString pathDoxyLatexPDF; QString pathDoxyLatexPDF;
QString pathDoxyTemplateTex; QString pathDoxyStructureTex;
QString pathDoxyDocsPM; QString pathDoxyDocsPM;
QString pathDoxyLatexPL; QString pathDoxyLatexPL;
QString pathDoxyLatexTemplatePL; QString pathDoxyLatexStructurePL;
QString pathDoxyRules; QString pathDoxyRules;
QString pathMakefile; QString pathMakefile;
void generatePerlModForMember(MemberDef *md,Definition *); inline PerlModGenerator(bool pretty) : m_output(pretty) { }
void generatePerlModSection(Definition *d,
MemberList *ml,const char *name,const char *header=0); void generatePerlModForMember(MemberDef *md, Definition *);
void addListOfAllMembers(ClassDef *cd, PerlModOutput &output); void generatePerlModSection(Definition *d, MemberList *ml,
void generatePerlModForClass(ClassDef *cd, PerlModOutput &output); const char *name, const char *header=0);
void generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output); void addListOfAllMembers(ClassDef *cd);
void generatePerlModForFile(FileDef *fd, PerlModOutput &output); void generatePerlModForClass(ClassDef *cd);
void generatePerlModForGroup(GroupDef *gd, PerlModOutput &output); void generatePerlModForNamespace(NamespaceDef *nd);
void generatePerlModForPage(PageInfo *pi, PerlModOutput &output); void generatePerlModForFile(FileDef *fd);
void generatePerlModForGroup(GroupDef *gd);
void generatePerlModForPage(PageInfo *pi);
bool createOutputFile(QFile &f, const char *s); bool createOutputFile(QFile &f, const char *s);
bool createOutputDir(QDir &perlModDir); bool createOutputDir(QDir &perlModDir);
bool generateDoxyLatexTex(); bool generateDoxyLatexTex();
bool generateDoxyFormatTex(); bool generateDoxyFormatTex();
bool generateDoxyModelPM(); bool generateDoxyStructurePM();
bool generateDoxyLatexPL(); bool generateDoxyLatexPL();
bool generateDoxyLatexTemplatePL(); bool generateDoxyLatexStructurePL();
bool generateDoxyRules(); bool generateDoxyRules();
bool generateMakefile(); bool generateMakefile();
bool generatePerlModOutput(); bool generatePerlModOutput();
...@@ -1222,7 +1356,6 @@ public: ...@@ -1222,7 +1356,6 @@ public:
void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *)
{ {
// + declaration/definition arg lists // + declaration/definition arg lists
// + reimplements // + reimplements
// + reimplementedBy // + reimplementedBy
...@@ -1261,26 +1394,26 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) ...@@ -1261,26 +1394,26 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *)
else if (md->getNamespaceDef()) else if (md->getNamespaceDef())
scopeName=md->getNamespaceDef()->name(); scopeName=md->getNamespaceDef()->name();
output.openHash() m_output.openHash()
.addFieldQuotedString("kind", memType) .addFieldQuotedString("kind", memType)
.addFieldQuotedString("name", md->name()) .addFieldQuotedString("name", md->name())
.addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness()))
.addFieldQuotedString("protection", getProtectionName(md->protection())) .addFieldQuotedString("protection", getProtectionName(md->protection()))
.addFieldBoolean("static", md->isStatic()); .addFieldBoolean("static", md->isStatic());
addPerlModDocBlock(output,"brief",md->getDefFileName(),md->getDefLine(),scopeName,md,md->briefDescription()); addPerlModDocBlock(m_output,"brief",md->getDefFileName(),md->getDefLine(),scopeName,md,md->briefDescription());
addPerlModDocBlock(output,"detailed",md->getDefFileName(),md->getDefLine(),scopeName,md,md->documentation()); addPerlModDocBlock(m_output,"detailed",md->getDefFileName(),md->getDefLine(),scopeName,md,md->documentation());
if (md->memberType()!=MemberDef::Define && if (md->memberType()!=MemberDef::Define &&
md->memberType()!=MemberDef::Enumeration) md->memberType()!=MemberDef::Enumeration)
output.addFieldQuotedString("type", md->typeString()); m_output.addFieldQuotedString("type", md->typeString());
if (isFunc) //function if (isFunc) //function
{ {
ArgumentList *al = md->argumentList(); ArgumentList *al = md->argumentList();
output.addFieldBoolean("const", al && al->constSpecifier) m_output.addFieldBoolean("const", al && al->constSpecifier)
.addFieldBoolean("volatile", al && al->volatileSpecifier); .addFieldBoolean("volatile", al && al->volatileSpecifier);
output.openList("parameters"); m_output.openList("parameters");
ArgumentList *declAl = md->declArgumentList(); ArgumentList *declAl = md->declArgumentList();
ArgumentList *defAl = md->argumentList(); ArgumentList *defAl = md->argumentList();
if (declAl && declAl->count()>0) if (declAl && declAl->count()>0)
...@@ -1291,80 +1424,80 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) ...@@ -1291,80 +1424,80 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *)
for (declAli.toFirst();(a=declAli.current());++declAli) for (declAli.toFirst();(a=declAli.current());++declAli)
{ {
Argument *defArg = defAli.current(); Argument *defArg = defAli.current();
output.openHash(); m_output.openHash();
if (!a->name.isEmpty()) if (!a->name.isEmpty())
output.addFieldQuotedString("declaration_name", a->name); m_output.addFieldQuotedString("declaration_name", a->name);
if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name) if (defArg && !defArg->name.isEmpty() && defArg->name!=a->name)
output.addFieldQuotedString("definition_name", defArg->name); m_output.addFieldQuotedString("definition_name", defArg->name);
if (!a->type.isEmpty()) if (!a->type.isEmpty())
output.addFieldQuotedString("type", a->type); m_output.addFieldQuotedString("type", a->type);
if (!a->array.isEmpty()) if (!a->array.isEmpty())
output.addFieldQuotedString("array", a->array); m_output.addFieldQuotedString("array", a->array);
if (!a->defval.isEmpty()) if (!a->defval.isEmpty())
output.addFieldQuotedString("default_value", a->defval); m_output.addFieldQuotedString("default_value", a->defval);
if (!a->attrib.isEmpty()) if (!a->attrib.isEmpty())
output.addFieldQuotedString("attributes", a->attrib); m_output.addFieldQuotedString("attributes", a->attrib);
output.closeHash(); m_output.closeHash();
if (defArg) ++defAli; if (defArg) ++defAli;
} }
} }
output.closeList(); m_output.closeList();
} }
else if (md->memberType()==MemberDef::Define && else if (md->memberType()==MemberDef::Define &&
md->argsString()!=0) // define md->argsString()!=0) // define
{ {
output.openList("parameters"); m_output.openList("parameters");
ArgumentListIterator ali(*md->argumentList()); ArgumentListIterator ali(*md->argumentList());
Argument *a; Argument *a;
for (ali.toFirst();(a=ali.current());++ali) for (ali.toFirst();(a=ali.current());++ali)
{ {
output.openHash() m_output.openHash()
.addFieldQuotedString("name", a->type) .addFieldQuotedString("name", a->type)
.closeHash(); .closeHash();
} }
output.closeList(); m_output.closeList();
} }
if (!md->initializer().isEmpty()) if (!md->initializer().isEmpty())
output.addFieldQuotedString("initializer", md->initializer()); m_output.addFieldQuotedString("initializer", md->initializer());
if (md->excpString()) if (md->excpString())
output.addFieldQuotedString("exceptions", md->excpString()); m_output.addFieldQuotedString("exceptions", md->excpString());
if (md->memberType()==MemberDef::Enumeration) // enum if (md->memberType()==MemberDef::Enumeration) // enum
{ {
if (md->enumFieldList()) if (md->enumFieldList())
{ {
output.openList("values"); m_output.openList("values");
MemberListIterator emli(*md->enumFieldList()); MemberListIterator emli(*md->enumFieldList());
MemberDef *emd; MemberDef *emd;
for (emli.toFirst();(emd=emli.current());++emli) for (emli.toFirst();(emd=emli.current());++emli)
{ {
output.openHash() m_output.openHash()
.addFieldQuotedString("name", emd->name()); .addFieldQuotedString("name", emd->name());
if (!emd->initializer().isEmpty()) if (!emd->initializer().isEmpty())
output.addFieldQuotedString("initializer", emd->initializer()); m_output.addFieldQuotedString("initializer", emd->initializer());
addPerlModDocBlock(output,"brief",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->briefDescription()); addPerlModDocBlock(m_output,"brief",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->briefDescription());
addPerlModDocBlock(output,"detailed",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->documentation()); addPerlModDocBlock(m_output,"detailed",emd->getDefFileName(),emd->getDefLine(),scopeName,emd,emd->documentation());
output.closeHash(); m_output.closeHash();
} }
output.closeList(); m_output.closeList();
} }
} }
MemberDef *rmd = md->reimplements(); MemberDef *rmd = md->reimplements();
if (rmd) if (rmd)
output.openHash("reimplements") m_output.openHash("reimplements")
.addFieldQuotedString("name", rmd->name()) .addFieldQuotedString("name", rmd->name())
.closeHash(); .closeHash();
...@@ -1372,15 +1505,15 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *) ...@@ -1372,15 +1505,15 @@ void PerlModGenerator::generatePerlModForMember(MemberDef *md,Definition *)
if (rbml) if (rbml)
{ {
MemberListIterator mli(*rbml); MemberListIterator mli(*rbml);
output.openList("reimplemented_by"); m_output.openList("reimplemented_by");
for (mli.toFirst();(rmd=mli.current());++mli) for (mli.toFirst();(rmd=mli.current());++mli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", rmd->name()) .addFieldQuotedString("name", rmd->name())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
output.closeHash(); m_output.closeHash();
} }
void PerlModGenerator::generatePerlModSection(Definition *d, void PerlModGenerator::generatePerlModSection(Definition *d,
...@@ -1388,25 +1521,25 @@ void PerlModGenerator::generatePerlModSection(Definition *d, ...@@ -1388,25 +1521,25 @@ void PerlModGenerator::generatePerlModSection(Definition *d,
{ {
if (ml->count()==0) return; // empty list if (ml->count()==0) return; // empty list
output.openHash(name); m_output.openHash(name);
if (header) if (header)
output.addFieldQuotedString("header", header); m_output.addFieldQuotedString("header", header);
output.openList("members"); m_output.openList("members");
MemberListIterator mli(*ml); MemberListIterator mli(*ml);
MemberDef *md; MemberDef *md;
for (mli.toFirst();(md=mli.current());++mli) for (mli.toFirst();(md=mli.current());++mli)
{ {
generatePerlModForMember(md,d); generatePerlModForMember(md,d);
} }
output.closeList() m_output.closeList()
.closeHash(); .closeHash();
} }
void PerlModGenerator::addListOfAllMembers(ClassDef *cd, PerlModOutput &output) void PerlModGenerator::addListOfAllMembers(ClassDef *cd)
{ {
output.openList("all_members"); m_output.openList("all_members");
MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict()); MemberNameInfoSDict::Iterator mnii(*cd->memberNameInfoSDict());
MemberNameInfo *mni; MemberNameInfo *mni;
for (mnii.toFirst();(mni=mnii.current());++mnii) for (mnii.toFirst();(mni=mnii.current());++mnii)
...@@ -1420,22 +1553,22 @@ void PerlModGenerator::addListOfAllMembers(ClassDef *cd, PerlModOutput &output) ...@@ -1420,22 +1553,22 @@ void PerlModGenerator::addListOfAllMembers(ClassDef *cd, PerlModOutput &output)
Definition *d=md->getGroupDef(); Definition *d=md->getGroupDef();
if (d==0) d = cd; if (d==0) d = cd;
output.openHash() m_output.openHash()
.addFieldQuotedString("name", md->name()) .addFieldQuotedString("name", md->name())
.addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness()))
.addFieldQuotedString("protection", getProtectionName(mi->prot)); .addFieldQuotedString("protection", getProtectionName(mi->prot));
if (!mi->ambiguityResolutionScope.isEmpty()) if (!mi->ambiguityResolutionScope.isEmpty())
output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope); m_output.addFieldQuotedString("ambiguity_scope", mi->ambiguityResolutionScope);
output.addFieldQuotedString("scope", cd->name()) m_output.addFieldQuotedString("scope", cd->name())
.closeHash(); .closeHash();
} }
} }
output.closeList(); m_output.closeList();
} }
void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &output) void PerlModGenerator::generatePerlModForClass(ClassDef *cd)
{ {
// + brief description // + brief description
// + detailed description // + detailed description
...@@ -1457,48 +1590,48 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp ...@@ -1457,48 +1590,48 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp
if (cd->name().find('@')!=-1) return; // skip anonymous compounds. if (cd->name().find('@')!=-1) return; // skip anonymous compounds.
if (cd->templateMaster()!=0) return; // skip generated template instances. if (cd->templateMaster()!=0) return; // skip generated template instances.
output.openHash() m_output.openHash()
.addFieldQuotedString("name", cd->name()); .addFieldQuotedString("name", cd->name());
if (cd->baseClasses()->count()>0) if (cd->baseClasses()->count()>0)
{ {
output.openList("base"); m_output.openList("base");
BaseClassListIterator bcli(*cd->baseClasses()); BaseClassListIterator bcli(*cd->baseClasses());
BaseClassDef *bcd; BaseClassDef *bcd;
for (bcli.toFirst();(bcd=bcli.current());++bcli) for (bcli.toFirst();(bcd=bcli.current());++bcli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", bcd->classDef->displayName()) .addFieldQuotedString("name", bcd->classDef->displayName())
.addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt)) .addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt))
.addFieldQuotedString("protection", getProtectionName(bcd->prot)) .addFieldQuotedString("protection", getProtectionName(bcd->prot))
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
if (cd->subClasses()->count()>0) if (cd->subClasses()->count()>0)
{ {
output.openList("derived"); m_output.openList("derived");
BaseClassListIterator bcli(*cd->baseClasses()); BaseClassListIterator bcli(*cd->baseClasses());
BaseClassDef *bcd; BaseClassDef *bcd;
for (bcli.toFirst();(bcd=bcli.current());++bcli) for (bcli.toFirst();(bcd=bcli.current());++bcli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", bcd->classDef->displayName()) .addFieldQuotedString("name", bcd->classDef->displayName())
.addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt)) .addFieldQuotedString("virtualness", getVirtualnessName(bcd->virt))
.addFieldQuotedString("protection", getProtectionName(bcd->prot)) .addFieldQuotedString("protection", getProtectionName(bcd->prot))
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
ClassSDict *cl = cd->getInnerClasses(); ClassSDict *cl = cd->getInnerClasses();
if (cl) if (cl)
{ {
output.openList("inner"); m_output.openList("inner");
ClassSDict::Iterator cli(*cl); ClassSDict::Iterator cli(*cl);
ClassDef *cd; ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli) for (cli.toFirst();(cd=cli.current());++cli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", cd->name()) .addFieldQuotedString("name", cd->name())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
IncludeInfo *ii=cd->includeInfo(); IncludeInfo *ii=cd->includeInfo();
...@@ -1508,19 +1641,19 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp ...@@ -1508,19 +1641,19 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp
if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName(); if (nm.isEmpty() && ii->fileDef) nm = ii->fileDef->docName();
if (!nm.isEmpty()) if (!nm.isEmpty())
{ {
output.openHash("includes"); m_output.openHash("includes");
#if 0 #if 0
if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
t << " id=\"" << ii->fileDef->getOutputFileBase() << "\""; t << " id=\"" << ii->fileDef->getOutputFileBase() << "\"";
#endif #endif
output.addFieldBoolean("local", ii->local) m_output.addFieldBoolean("local", ii->local)
.addFieldQuotedString("name", nm) .addFieldQuotedString("name", nm)
.closeHash(); .closeHash();
} }
} }
addTemplateList(cd,output); addTemplateList(cd,m_output);
addListOfAllMembers(cd,output); addListOfAllMembers(cd);
MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict); MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict);
MemberGroup *mg; MemberGroup *mg;
for (;(mg=mgli.current());++mgli) for (;(mg=mgli.current());++mgli)
...@@ -1550,8 +1683,8 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp ...@@ -1550,8 +1683,8 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp
generatePerlModSection(cd,&cd->friends,"friend_methods"); generatePerlModSection(cd,&cd->friends,"friend_methods");
generatePerlModSection(cd,&cd->related,"related_methods"); generatePerlModSection(cd,&cd->related,"related_methods");
addPerlModDocBlock(output,"brief",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->briefDescription()); addPerlModDocBlock(m_output,"brief",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->briefDescription());
addPerlModDocBlock(output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->documentation()); addPerlModDocBlock(m_output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd->name(),0,cd->documentation());
#if 0 #if 0
DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance); DotClassGraph inheritanceGraph(cd,DotClassGraph::Inheritance);
...@@ -1579,10 +1712,10 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp ...@@ -1579,10 +1712,10 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd, PerlModOutput &outp
t << "/>" << endl; t << "/>" << endl;
#endif #endif
output.closeHash(); m_output.closeHash();
} }
void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutput &output) void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd)
{ {
// + contained class definitions // + contained class definitions
// + contained namespace definitions // + contained namespace definitions
...@@ -1595,33 +1728,33 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutp ...@@ -1595,33 +1728,33 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutp
if (nd->isReference()) return; // skip external references if (nd->isReference()) return; // skip external references
output.openHash() m_output.openHash()
.addFieldQuotedString("name", nd->name()); .addFieldQuotedString("name", nd->name());
ClassSDict *cl = nd->classSDict; ClassSDict *cl = nd->classSDict;
if (cl) if (cl)
{ {
output.openList("classes"); m_output.openList("classes");
ClassSDict::Iterator cli(*cl); ClassSDict::Iterator cli(*cl);
ClassDef *cd; ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli) for (cli.toFirst();(cd=cli.current());++cli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", cd->name()) .addFieldQuotedString("name", cd->name())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
NamespaceSDict *nl = nd->namespaceSDict; NamespaceSDict *nl = nd->namespaceSDict;
if (nl) if (nl)
{ {
output.openList("namespaces"); m_output.openList("namespaces");
NamespaceSDict::Iterator nli(*nl); NamespaceSDict::Iterator nli(*nl);
NamespaceDef *nd; NamespaceDef *nd;
for (nli.toFirst();(nd=nli.current());++nli) for (nli.toFirst();(nd=nli.current());++nli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", nd->name()) .addFieldQuotedString("name", nd->name())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict); MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict);
...@@ -1636,13 +1769,13 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutp ...@@ -1636,13 +1769,13 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd, PerlModOutp
generatePerlModSection(nd,&nd->decFuncMembers,"functions"); generatePerlModSection(nd,&nd->decFuncMembers,"functions");
generatePerlModSection(nd,&nd->decVarMembers,"variables"); generatePerlModSection(nd,&nd->decVarMembers,"variables");
addPerlModDocBlock(output,"brief",nd->getDefFileName(),nd->getDefLine(),0,0,nd->briefDescription()); addPerlModDocBlock(m_output,"brief",nd->getDefFileName(),nd->getDefLine(),0,0,nd->briefDescription());
addPerlModDocBlock(output,"detailed",nd->getDefFileName(),nd->getDefLine(),0,0,nd->documentation()); addPerlModDocBlock(m_output,"detailed",nd->getDefFileName(),nd->getDefLine(),0,0,nd->documentation());
output.closeHash(); m_output.closeHash();
} }
void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output) void PerlModGenerator::generatePerlModForFile(FileDef *fd)
{ {
// + includes files // + includes files
// + includedby files // + includedby files
...@@ -1660,37 +1793,37 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output ...@@ -1660,37 +1793,37 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output
if (fd->isReference()) return; if (fd->isReference()) return;
output.openHash() m_output.openHash()
.addFieldQuotedString("name", fd->name()); .addFieldQuotedString("name", fd->name());
QListIterator<IncludeInfo> ili1(*fd->includeFileList()); QListIterator<IncludeInfo> ili1(*fd->includeFileList());
IncludeInfo *inc; IncludeInfo *inc;
output.openList("includes"); m_output.openList("includes");
for (ili1.toFirst();(inc=ili1.current());++ili1) for (ili1.toFirst();(inc=ili1.current());++ili1)
{ {
output.openHash() m_output.openHash()
.addFieldQuotedString("name", inc->includeName); .addFieldQuotedString("name", inc->includeName);
if (inc->fileDef && !inc->fileDef->isReference()) if (inc->fileDef && !inc->fileDef->isReference())
{ {
output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase());
} }
output.closeHash(); m_output.closeHash();
} }
output.closeList(); m_output.closeList();
QListIterator<IncludeInfo> ili2(*fd->includedByFileList()); QListIterator<IncludeInfo> ili2(*fd->includedByFileList());
output.openList("included_by"); m_output.openList("included_by");
for (ili2.toFirst();(inc=ili2.current());++ili2) for (ili2.toFirst();(inc=ili2.current());++ili2)
{ {
output.openHash() m_output.openHash()
.addFieldQuotedString("name => ", inc->includeName); .addFieldQuotedString("name", inc->includeName);
if (inc->fileDef && !inc->fileDef->isReference()) if (inc->fileDef && !inc->fileDef->isReference())
{ {
output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase()); m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase());
} }
output.closeHash(); m_output.closeHash();
} }
output.closeList(); m_output.closeList();
generatePerlModSection(fd,&fd->decDefineMembers,"defines"); generatePerlModSection(fd,&fd->decDefineMembers,"defines");
generatePerlModSection(fd,&fd->decProtoMembers,"prototypes"); generatePerlModSection(fd,&fd->decProtoMembers,"prototypes");
...@@ -1699,13 +1832,13 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output ...@@ -1699,13 +1832,13 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd, PerlModOutput &output
generatePerlModSection(fd,&fd->decFuncMembers,"functions"); generatePerlModSection(fd,&fd->decFuncMembers,"functions");
generatePerlModSection(fd,&fd->decVarMembers,"variables"); generatePerlModSection(fd,&fd->decVarMembers,"variables");
addPerlModDocBlock(output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription()); addPerlModDocBlock(m_output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription());
addPerlModDocBlock(output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation()); addPerlModDocBlock(m_output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation());
output.closeHash(); m_output.closeHash();
} }
void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &output) void PerlModGenerator::generatePerlModForGroup(GroupDef *gd)
{ {
// + members // + members
// + member groups // + member groups
...@@ -1721,73 +1854,73 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &outp ...@@ -1721,73 +1854,73 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &outp
if (gd->isReference()) return; // skip external references if (gd->isReference()) return; // skip external references
output.openHash() m_output.openHash()
.addFieldQuotedString("name", gd->name()) .addFieldQuotedString("name", gd->name())
.addFieldQuotedString("title", gd->groupTitle()); .addFieldQuotedString("title", gd->groupTitle());
FileList *fl = gd->getFiles(); FileList *fl = gd->getFiles();
if (fl) if (fl)
{ {
output.openList("files"); m_output.openList("files");
QListIterator<FileDef> fli(*fl); QListIterator<FileDef> fli(*fl);
FileDef *fd = fl->first(); FileDef *fd = fl->first();
for (fli.toFirst();(fd=fli.current());++fli) for (fli.toFirst();(fd=fli.current());++fli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", fd->name()) .addFieldQuotedString("name", fd->name())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
ClassSDict *cl = gd->getClasses(); ClassSDict *cl = gd->getClasses();
if (cl) if (cl)
{ {
output.openList("classes"); m_output.openList("classes");
ClassSDict::Iterator cli(*cl); ClassSDict::Iterator cli(*cl);
ClassDef *cd; ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli) for (cli.toFirst();(cd=cli.current());++cli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", cd->name()) .addFieldQuotedString("name", cd->name())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
NamespaceList *nl = gd->getNamespaces(); NamespaceList *nl = gd->getNamespaces();
if (nl) if (nl)
{ {
output.openList("namespaces"); m_output.openList("namespaces");
NamespaceListIterator nli(*nl); NamespaceListIterator nli(*nl);
NamespaceDef *nd; NamespaceDef *nd;
for (nli.toFirst();(nd=nli.current());++nli) for (nli.toFirst();(nd=nli.current());++nli)
output.openHash() m_output.openHash()
.addFieldQuotedString("name", nd->name()) .addFieldQuotedString("name", nd->name())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
PageSDict *pl = gd->getPages(); PageSDict *pl = gd->getPages();
if (pl) if (pl)
{ {
output.openList("pages"); m_output.openList("pages");
PageSDict::Iterator pli(*pl); PageSDict::Iterator pli(*pl);
PageInfo *pi; PageInfo *pi;
for (pli.toFirst();(pi=pli.current());++pli) for (pli.toFirst();(pi=pli.current());++pli)
output.openHash() m_output.openHash()
.addFieldQuotedString("title", pi->title) .addFieldQuotedString("title", pi->title)
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
GroupList *gl = gd->getSubGroups(); GroupList *gl = gd->getSubGroups();
if (gl) if (gl)
{ {
output.openList("groups"); m_output.openList("groups");
GroupListIterator gli(*gl); GroupListIterator gli(*gl);
GroupDef *sgd; GroupDef *sgd;
for (gli.toFirst();(sgd=gli.current());++gli) for (gli.toFirst();(sgd=gli.current());++gli)
output.openHash() m_output.openHash()
.addFieldQuotedString("title", gd->groupTitle()) .addFieldQuotedString("title", gd->groupTitle())
.closeHash(); .closeHash();
output.closeList(); m_output.closeList();
} }
MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict); MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict);
...@@ -1802,13 +1935,13 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &outp ...@@ -1802,13 +1935,13 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd, PerlModOutput &outp
generatePerlModSection(gd,&gd->decFuncMembers,"functions"); generatePerlModSection(gd,&gd->decFuncMembers,"functions");
generatePerlModSection(gd,&gd->decVarMembers,"variables"); generatePerlModSection(gd,&gd->decVarMembers,"variables");
addPerlModDocBlock(output,"brief",gd->getDefFileName(),gd->getDefLine(),0,0,gd->briefDescription()); addPerlModDocBlock(m_output,"brief",gd->getDefFileName(),gd->getDefLine(),0,0,gd->briefDescription());
addPerlModDocBlock(output,"detailed",gd->getDefFileName(),gd->getDefLine(),0,0,gd->documentation()); addPerlModDocBlock(m_output,"detailed",gd->getDefFileName(),gd->getDefLine(),0,0,gd->documentation());
output.closeHash(); m_output.closeHash();
} }
void PerlModGenerator::generatePerlModForPage(PageInfo *pi, PerlModOutput &output) void PerlModGenerator::generatePerlModForPage(PageInfo *pi)
{ {
// + name // + name
// + title // + title
...@@ -1816,14 +1949,15 @@ void PerlModGenerator::generatePerlModForPage(PageInfo *pi, PerlModOutput &outpu ...@@ -1816,14 +1949,15 @@ void PerlModGenerator::generatePerlModForPage(PageInfo *pi, PerlModOutput &outpu
if (pi->isReference()) return; if (pi->isReference()) return;
output.openHash() m_output.openHash()
.addFieldQuotedString("name", pi->name); .addFieldQuotedString("name", pi->name);
SectionInfo *si = Doxygen::sectionDict.find(pi->name); SectionInfo *si = Doxygen::sectionDict.find(pi->name);
if (si) if (si)
output.addFieldQuotedString("title", si->title); m_output.addFieldQuotedString("title", si->title);
addPerlModDocBlock(output,"detailed",pi->defFileName,pi->defLine,0,0,pi->doc); addPerlModDocBlock(m_output,"detailed",pi->defFileName,pi->defLine,0,0,pi->doc);
m_output.closeHash();
} }
bool PerlModGenerator::generatePerlModOutput() bool PerlModGenerator::generatePerlModOutput()
...@@ -1834,24 +1968,24 @@ bool PerlModGenerator::generatePerlModOutput() ...@@ -1834,24 +1968,24 @@ bool PerlModGenerator::generatePerlModOutput()
QTextStream outputTextStream(&outputFile); QTextStream outputTextStream(&outputFile);
PerlModOutputStream outputStream(&outputTextStream); PerlModOutputStream outputStream(&outputTextStream);
output.setPerlModOutputStream(&outputStream); m_output.setPerlModOutputStream(&outputStream);
output.add("$doxydocs =\n").openHash(); m_output.add("$doxydocs=").openHash();
output.openList("classes"); m_output.openList("classes");
ClassSDict::Iterator cli(Doxygen::classSDict); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd; ClassDef *cd;
for (cli.toFirst();(cd=cli.current());++cli) for (cli.toFirst();(cd=cli.current());++cli)
generatePerlModForClass(cd,output); generatePerlModForClass(cd);
output.closeList(); m_output.closeList();
output.openList("namespaces"); m_output.openList("namespaces");
NamespaceSDict::Iterator nli(Doxygen::namespaceSDict); NamespaceSDict::Iterator nli(Doxygen::namespaceSDict);
NamespaceDef *nd; NamespaceDef *nd;
for (nli.toFirst();(nd=nli.current());++nli) for (nli.toFirst();(nd=nli.current());++nli)
generatePerlModForNamespace(nd,output); generatePerlModForNamespace(nd);
output.closeList(); m_output.closeList();
output.openList("files"); m_output.openList("files");
FileNameListIterator fnli(Doxygen::inputNameList); FileNameListIterator fnli(Doxygen::inputNameList);
FileName *fn; FileName *fn;
for (;(fn=fnli.current());++fnli) for (;(fn=fnli.current());++fnli)
...@@ -1859,27 +1993,27 @@ bool PerlModGenerator::generatePerlModOutput() ...@@ -1859,27 +1993,27 @@ bool PerlModGenerator::generatePerlModOutput()
FileNameIterator fni(*fn); FileNameIterator fni(*fn);
FileDef *fd; FileDef *fd;
for (;(fd=fni.current());++fni) for (;(fd=fni.current());++fni)
generatePerlModForFile(fd,output); generatePerlModForFile(fd);
} }
output.closeList(); m_output.closeList();
output.openList("groups"); m_output.openList("groups");
GroupSDict::Iterator gli(Doxygen::groupSDict); GroupSDict::Iterator gli(Doxygen::groupSDict);
GroupDef *gd; GroupDef *gd;
for (;(gd=gli.current());++gli) for (;(gd=gli.current());++gli)
generatePerlModForGroup(gd,output); generatePerlModForGroup(gd);
output.closeList(); m_output.closeList();
output.openList("pages"); m_output.openList("pages");
PageSDict::Iterator pdi(*Doxygen::pageSDict); PageSDict::Iterator pdi(*Doxygen::pageSDict);
PageInfo *pi=0; PageInfo *pi=0;
for (pdi.toFirst();(pi=pdi.current());++pdi) for (pdi.toFirst();(pi=pdi.current());++pdi)
generatePerlModForPage(pi,output); generatePerlModForPage(pi);
if (Doxygen::mainPage) if (Doxygen::mainPage)
generatePerlModForPage(Doxygen::mainPage,output); generatePerlModForPage(Doxygen::mainPage);
output.closeList(); m_output.closeList();
output.closeHash().add(";\n1;\n"); m_output.closeHash().add(";\n1;\n");
return true; return true;
} }
...@@ -1943,10 +2077,10 @@ bool PerlModGenerator::createOutputDir(QDir &perlModDir) ...@@ -1943,10 +2077,10 @@ bool PerlModGenerator::createOutputDir(QDir &perlModDir)
return true; return true;
} }
bool PerlModGenerator::generateDoxyModelPM() bool PerlModGenerator::generateDoxyStructurePM()
{ {
QFile doxyModelPM; QFile doxyModelPM;
if (!createOutputFile(doxyModelPM, pathDoxyModelPM)) if (!createOutputFile(doxyModelPM, pathDoxyStructurePM))
return false; return false;
QTextStream doxyModelPMStream(&doxyModelPM); QTextStream doxyModelPMStream(&doxyModelPM);
...@@ -2006,7 +2140,7 @@ bool PerlModGenerator::generateDoxyModelPM() ...@@ -2006,7 +2140,7 @@ bool PerlModGenerator::generateDoxyModelPM()
"\t];\n" "\t];\n"
"}\n" "}\n"
"\n" "\n"
"$doxymodel =\n" "$doxystructure =\n"
" [ \"hash\", \"Root\",\n" " [ \"hash\", \"Root\",\n"
" {\n" " {\n"
"\tfiles =>\n" "\tfiles =>\n"
...@@ -2026,6 +2160,20 @@ bool PerlModGenerator::generateDoxyModelPM() ...@@ -2026,6 +2160,20 @@ bool PerlModGenerator::generateDoxyModelPM()
"\t },\n" "\t },\n"
"\t ],\n" "\t ],\n"
"\t ],\n" "\t ],\n"
"\tpages =>\n"
"\t [ \"list\", \"Pages\",\n"
"\t [ \"hash\", \"Page\",\n"
"\t {\n"
"\t\tname => [ \"string\", \"PageName\" ],\n"
"\t\tdetailed =>\n"
"\t\t [ \"hash\", \"PageDetailed\",\n"
"\t\t {\n"
"\t\t doc => [ \"doc\", \"PageDetailedDoc\" ],\n"
"\t\t },\n"
"\t\t ],\n"
"\t },\n"
"\t ],\n"
"\t ],\n"
"\tclasses =>\n" "\tclasses =>\n"
"\t [ \"list\", \"Classes\",\n" "\t [ \"list\", \"Classes\",\n"
"\t [ \"hash\", \"Class\",\n" "\t [ \"hash\", \"Class\",\n"
...@@ -2064,67 +2212,90 @@ bool PerlModGenerator::generateDoxyRules() ...@@ -2064,67 +2212,90 @@ bool PerlModGenerator::generateDoxyRules()
return false; return false;
bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); bool perlmodLatex = Config_getBool("PERLMOD_LATEX");
QString prefix = Config_getString("PERLMOD_MAKEVAR_PREFIX");
QTextStream doxyRulesStream(&doxyRules); QTextStream doxyRulesStream(&doxyRules);
doxyRulesStream << doxyRulesStream <<
"DOXYEXECPATH = " << pathDoxyExec << "\n" prefix << "DOXY_EXEC_PATH = " << pathDoxyExec << "\n" <<
"DOXYFILE = " << pathDoxyfile << "\n" prefix << "DOXYFILE = " << pathDoxyfile << "\n" <<
"DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" prefix << "DOXYDOCS_PM = " << pathDoxyDocsPM << "\n" <<
"DOXYMODEL_PM = " << pathDoxyModelPM << "\n" prefix << "DOXYSTRUCTURE_PM = " << pathDoxyStructurePM << "\n" <<
"DOXYRULES = " << pathDoxyRules << "\n"; prefix << "DOXYRULES = " << pathDoxyRules << "\n";
if (perlmodLatex) if (perlmodLatex)
doxyRulesStream << doxyRulesStream <<
"DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" prefix << "DOXYLATEX_PL = " << pathDoxyLatexPL << "\n" <<
"DOXYLATEXTEMPLATE_PL = " << pathDoxyLatexTemplatePL << "\n" prefix << "DOXYLATEXSTRUCTURE_PL = " << pathDoxyLatexStructurePL << "\n" <<
"DOXYTEMPLATE_TEX = " << pathDoxyTemplateTex << "\n" prefix << "DOXYSTRUCTURE_TEX = " << pathDoxyStructureTex << "\n" <<
"DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" prefix << "DOXYDOCS_TEX = " << pathDoxyDocsTex << "\n" <<
"DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" prefix << "DOXYFORMAT_TEX = " << pathDoxyFormatTex << "\n" <<
"DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" prefix << "DOXYLATEX_TEX = " << pathDoxyLatexTex << "\n" <<
"DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" prefix << "DOXYLATEX_DVI = " << pathDoxyLatexDVI << "\n" <<
"DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n"; prefix << "DOXYLATEX_PDF = " << pathDoxyLatexPDF << "\n";
doxyRulesStream << doxyRulesStream <<
"\n" "\n"
".PHONY: clean-perlmod\n" ".PHONY: clean-perlmod\n"
"clean-perlmod:\n" "clean-perlmod::\n"
"\trm -f $(DOXYMODEL_PM) $(DOXYDOCS_PM)"; "\trm -f $(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
"\t$(" << prefix << "DOXYDOCS_PM)";
if (perlmodLatex) if (perlmodLatex)
doxyRulesStream << doxyRulesStream <<
" \\\n" " \\\n"
"\t$(DOXYLATEX_PL) $(DOXYLATEXTEMPLATE_PL) \\\n" "\t$(" << prefix << "DOXYLATEX_PL) \\\n"
"\t$(DOXYDOCS_TEX) $(DOXYTEMPLATE_TEX) \\\n" "\t$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
"\t$(DOXYFORMAT_TEX) $(DOXYLATEX_TEX) \\\n" "\t$(" << prefix << "DOXYDOCS_TEX) \\\n"
"\t$(DOXYLATEX_PDF) $(DOXYLATEX_DVI) \\\n" "\t$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
"\t$(addprefix $(DOXYLATEX_TEX:tex=),out aux log)"; "\t$(" << prefix << "DOXYFORMAT_TEX) \\\n"
"\t$(" << prefix << "DOXYLATEX_TEX) \\\n"
"\t$(" << prefix << "DOXYLATEX_PDF) \\\n"
"\t$(" << prefix << "DOXYLATEX_DVI) \\\n"
"\t$(addprefix $(" << prefix << "DOXYLATEX_TEX:tex=),out aux log)";
doxyRulesStream << "\n\n"; doxyRulesStream << "\n\n";
doxyRulesStream << doxyRulesStream <<
"$(DOXYRULES) $(DOXYMAKEFILE) $(DOXYMODEL_PM) $(DOXYDOCS_PM)"; "$(" << prefix << "DOXYRULES) \\\n"
"$(" << prefix << "DOXYMAKEFILE) \\\n"
"$(" << prefix << "DOXYSTRUCTURE_PM) \\\n"
"$(" << prefix << "DOXYDOCS_PM)";
if (perlmodLatex) { if (perlmodLatex) {
doxyRulesStream << doxyRulesStream <<
" \\\n" " \\\n"
"$(DOXYLATEX_PL) $(DOXYLATEXTEMPLATE_PL) \\\n" "$(" << prefix << "DOXYLATEX_PL) \\\n"
"$(DOXYFORMAT_TEX) $(DOXYLATEX_TEX)"; "$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
"$(" << prefix << "DOXYFORMAT_TEX) \\\n"
"$(" << prefix << "DOXYLATEX_TEX)";
} }
doxyRulesStream << doxyRulesStream <<
": $(DOXYFILE)\n" ": \\\n"
"\tcd $(DOXYEXECPATH) ; doxygen \"$<\"\n"; "\t$(" << prefix << "DOXYFILE)\n"
"\tcd $(" << prefix << "DOXY_EXEC_PATH) ; doxygen \"$<\"\n";
if (perlmodLatex) { if (perlmodLatex) {
doxyRulesStream << doxyRulesStream <<
"\n" "\n"
"$(DOXYDOCS_TEX): $(DOXYLATEX_PL) $(DOXYDOCS_PM)\n" "$(" << prefix << "DOXYDOCS_TEX): \\\n"
"$(" << prefix << "DOXYLATEX_PL) \\\n"
"$(" << prefix << "DOXYDOCS_PM)\n"
"\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
"\n" "\n"
"$(DOXYTEMPLATE_TEX): $(DOXYLATEXTEMPLATE_PL) $(DOXYMODEL_PM)\n" "$(" << prefix << "DOXYSTRUCTURE_TEX): \\\n"
"$(" << prefix << "DOXYLATEXSTRUCTURE_PL) \\\n"
"$(" << prefix << "DOXYSTRUCTURE_PM)\n"
"\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n" "\tperl -I\"$(<D)\" \"$<\" >\"$@\"\n"
"\n" "\n"
"$(DOXYLATEX_PDF) $(DOXYLATEX_DVI): $(DOXYLATEX_TEX) $(DOXYFORMAT_TEX) $(DOXYTEMPLATE_TEX) $(DOXYDOCS_TEX)\n" "$(" << prefix << "DOXYLATEX_PDF) \\\n"
"$(" << prefix << "DOXYLATEX_DVI): \\\n"
"$(" << prefix << "DOXYLATEX_TEX) \\\n"
"$(" << prefix << "DOXYFORMAT_TEX) \\\n"
"$(" << prefix << "DOXYSTRUCTURE_TEX) \\\n"
"$(" << prefix << "DOXYDOCS_TEX)\n"
"\n" "\n"
"$(DOXYLATEX_PDF): $(DOXYLATEX_TEX)\n" "$(" << prefix << "DOXYLATEX_PDF): \\\n"
"$(" << prefix << "DOXYLATEX_TEX)\n"
"\tpdflatex -interaction=nonstopmode \"$<\"\n" "\tpdflatex -interaction=nonstopmode \"$<\"\n"
"\n" "\n"
"$(DOXYLATEX_DVI): $(DOXYLATEX_TEX)\n" "$(" << prefix << "DOXYLATEX_DVI): \\\n"
"$(" << prefix << "DOXYLATEX_TEX)\n"
"\tlatex -interaction=nonstopmode \"$<\"\n"; "\tlatex -interaction=nonstopmode \"$<\"\n";
} }
...@@ -2138,6 +2309,7 @@ bool PerlModGenerator::generateMakefile() ...@@ -2138,6 +2309,7 @@ bool PerlModGenerator::generateMakefile()
return false; return false;
bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); bool perlmodLatex = Config_getBool("PERLMOD_LATEX");
QString prefix = Config_getString("PERLMOD_MAKEVAR_PREFIX");
QTextStream makefileStream(&makefile); QTextStream makefileStream(&makefile);
makefileStream << makefileStream <<
...@@ -2150,47 +2322,43 @@ bool PerlModGenerator::generateMakefile() ...@@ -2150,47 +2322,43 @@ bool PerlModGenerator::generateMakefile()
if (perlmodLatex) { if (perlmodLatex) {
makefileStream << makefileStream <<
"pdf: $(DOXYLATEX_PDF)\n" "pdf: $(" << prefix << "DOXYLATEX_PDF)\n"
"dvi: $(DOXYLATEX_DVI)\n"; "dvi: $(" << prefix << "DOXYLATEX_DVI)\n";
} }
return true; return true;
} }
bool PerlModGenerator::generateDoxyLatexTemplatePL() bool PerlModGenerator::generateDoxyLatexStructurePL()
{ {
QFile doxyLatexTemplatePL; QFile doxyLatexStructurePL;
if (!createOutputFile(doxyLatexTemplatePL, pathDoxyLatexTemplatePL)) if (!createOutputFile(doxyLatexStructurePL, pathDoxyLatexStructurePL))
return false; return false;
QTextStream doxyLatexTemplatePLStream(&doxyLatexTemplatePL); QTextStream doxyLatexStructurePLStream(&doxyLatexStructurePL);
doxyLatexTemplatePLStream << doxyLatexStructurePLStream <<
"use DoxyModel;\n" "use DoxyStructure;\n"
"\n" "\n"
"sub template($) {\n" "sub process($) {\n"
"\tmy $model = $_[0];\n" "\tmy $node = $_[0];\n"
"\tmy ($type, $name) = @$model[0, 1];\n" "\tmy ($type, $name) = @$node[0, 1];\n"
"\tif ($type eq \"string\") {\n" "\tmy $command;\n"
"\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" "\tif ($type eq \"string\") { $command = \"String\" }\n"
"\t} elsif ($type eq \"doc\") {\n" "\telsif ($type eq \"doc\") { $command = \"Doc\" }\n"
"\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n" "\telsif ($type eq \"hash\") {\n"
"\t} elsif ($type eq \"hash\") {\n" "\t\t$command = \"Hash\";\n"
"\t\tmy ($key, $value);\n" "\t\tfor my $subnode (values %{$$node[2]}) {\n"
"\t\twhile (($key, $submodel) = each %{$$model[2]}) {\n" "\t\t\tprocess($subnode);\n"
"\t\t\tmy $subname = $$submodel[1];\n"
"\t\t\tprint \"\\\\def\\\\\" . $subname . \"Empty{}%\\n\";\n"
"\t\t\tprint \"\\\\def\\\\field\" . $subname . \"Empty{\\\\\" . $subname . \"Empty}%\\n\";\n"
"\t\t\ttemplate($submodel);\n"
"\t\t}\n" "\t\t}\n"
"\t\tprint \"\\\\def\\\\\" . $name . \"{}%\\n\";\n"
"\t} elsif ($type eq \"list\") {\n"
"\t\ttemplate($$model[2]);\n"
"\t\tprint \"\\\\def\\\\\" . $name . \"#1{#1}%\\n\";\n"
"\t\tprint \"\\\\def\\\\\" . $name . \"Sep{}%\\n\";\n"
"\t}\n" "\t}\n"
"\telsif ($type eq \"list\") {\n"
"\t\t$command = \"List\";\n"
"\t\tprocess($$node[2]);\n"
"\t}\n"
"\tprint \"\\\\\" . $command . \"Node{\" . $name . \"}%\\n\";\n"
"}\n" "}\n"
"\n" "\n"
"template($doxymodel);\n"; "process($doxystructure);\n";
return true; return true;
} }
...@@ -2203,16 +2371,17 @@ bool PerlModGenerator::generateDoxyLatexPL() ...@@ -2203,16 +2371,17 @@ bool PerlModGenerator::generateDoxyLatexPL()
QTextStream doxyLatexPLStream(&doxyLatexPL); QTextStream doxyLatexPLStream(&doxyLatexPL);
doxyLatexPLStream << doxyLatexPLStream <<
"use DoxyModel;\n" "use DoxyStructure;\n"
"use DoxyDocs;\n" "use DoxyDocs;\n"
"\n" "\n"
"sub latex_quote($) {\n" "sub latex_quote($) {\n"
"\tmy $text = $_[0];\n" "\tmy $text = $_[0];\n"
"\t$text =~ s/\\\\/\\\\textbackslash /g;\n" "\t$text =~ s/\\\\/\\\\textbackslash /g;\n"
"\t$text =~ s/\\|/\\\\textbar /g;\n"
"\t$text =~ s/</\\\\textless /g;\n"
"\t$text =~ s/>/\\\\textgreater /g;\n"
"\t$text =~ s/~/\\\\textasciitilde /g;\n" "\t$text =~ s/~/\\\\textasciitilde /g;\n"
"\t$text =~ s/</\\\\textasciiless /g;\n" "\t$text =~ s/\\^/\\\\textasciicircum /g;\n"
"\t$text =~ s/>/\\\\textasciigreater /g;\n"
"\t$text =~ s/\\\\^/\\\\textasciicircum /g;\n"
"\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n" "\t$text =~ s/[\\$&%#_{}]/\\\\$&/g;\n"
"\tprint $text;\n" "\tprint $text;\n"
"}\n" "}\n"
...@@ -2223,17 +2392,43 @@ bool PerlModGenerator::generateDoxyLatexPL() ...@@ -2223,17 +2392,43 @@ bool PerlModGenerator::generateDoxyLatexPL()
"\t\tmy $type = $$item{type};\n" "\t\tmy $type = $$item{type};\n"
"\t\tif ($type eq \"text\") {\n" "\t\tif ($type eq \"text\") {\n"
"\t\t\tlatex_quote($$item{content});\n" "\t\t\tlatex_quote($$item{content});\n"
"\t\t} elsif ($type eq \"para\") {\n" "\t\t} elsif ($type eq \"parbreak\") {\n"
"\t\t\tgenerate_doc($$item{content});\n" "\t\t\tprint \"\\n\\n\";\n"
"#\t\t\tprint \"\\\\par\\n\";\n" "\t\t} elsif ($type eq \"style\") {\n"
"\t\t} elsif ($type eq \"bold\") {\n" "\t\t\tmy $style = $$item{style};\n"
"\t\t\tprint \"\\\\textbf{\";\n" "\t\t\tif ($$item{enable} eq \"yes\") {\n"
"\t\t\tgenerate_doc($$item{content});\n" "\t\t\t\tif ($style eq \"bold\") { print '\\bfseries'; }\n"
"\t\t\tprint \"}\";\n" "\t\t\t\tif ($style eq \"italic\") { print '\\itshape'; }\n"
"\t\t} elsif ($type eq \"emphasis\") {\n" "\t\t\t\tif ($style eq \"code\") { print '\\ttfamily'; }\n"
"\t\t\tprint \"\\\\textit{\";\n" "\t\t\t} else {\n"
"\t\t\tgenerate_doc($$item{content});\n" "\t\t\t\tif ($style eq \"bold\") { print '\\mdseries'; }\n"
"\t\t\tprint \"}\";\n" "\t\t\t\tif ($style eq \"italic\") { print '\\upshape'; }\n"
"\t\t\t\tif ($style eq \"code\") { print '\\rmfamily'; }\n"
"\t\t\t}\n"
"\t\t\tprint '{}';\n"
"\t\t} elsif ($type eq \"symbol\") {\n"
"\t\t\tmy $symbol = $$item{symbol};\n"
"\t\t\tif ($symbol eq \"copyright\") { print '\\copyright'; }\n"
"\t\t\telsif ($symbol eq \"szlig\") { print '\\ss'; }\n"
"\t\t\tprint '{}';\n"
"\t\t} elsif ($type eq \"accent\") {\n"
"\t\t\tmy ($accent) = $$item{accent};\n"
"\t\t\tif ($accent eq \"umlaut\") { print '\\\"'; }\n"
"\t\t\telsif ($accent eq \"acute\") { print '\\\\\\''; }\n"
"\t\t\telsif ($accent eq \"grave\") { print '\\`'; }\n"
"\t\t\telsif ($accent eq \"circ\") { print '\\^'; }\n"
"\t\t\telsif ($accent eq \"tilde\") { print '\\~'; }\n"
"\t\t\telsif ($accent eq \"cedilla\") { print '\\c'; }\n"
"\t\t\telsif ($accent eq \"ring\") { print '\\r'; }\n"
"\t\t\tprint \"{\" . $$item{letter} . \"}\"; \n"
"\t\t} elsif ($type eq \"list\") {\n"
"\t\t\tmy $env = ($$item{style} eq \"ordered\") ? \"enumerate\" : \"itemize\";\n"
"\t\t\tprint \"\\n\\\\begin{\" . $env .\"}\";\n"
"\t\t \tfor my $subitem (@{$$item{content}}) {\n"
"\t\t\t\tprint \"\\n\\\\item \";\n"
"\t\t\t\tgenerate_doc($subitem);\n"
"\t\t \t}\n"
"\t\t\tprint \"\\n\\\\end{\" . $env .\"}\";\n"
"\t\t} elsif ($type eq \"url\") {\n" "\t\t} elsif ($type eq \"url\") {\n"
"\t\t\tlatex_quote($$item{content});\n" "\t\t\tlatex_quote($$item{content});\n"
"\t\t}\n" "\t\t}\n"
...@@ -2241,8 +2436,8 @@ bool PerlModGenerator::generateDoxyLatexPL() ...@@ -2241,8 +2436,8 @@ bool PerlModGenerator::generateDoxyLatexPL()
"}\n" "}\n"
"\n" "\n"
"sub generate($$) {\n" "sub generate($$) {\n"
"\tmy ($item, $model) = @_;\n" "\tmy ($item, $node) = @_;\n"
"\tmy ($type, $name) = @$model[0, 1];\n" "\tmy ($type, $name) = @$node[0, 1];\n"
"\tif ($type eq \"string\") {\n" "\tif ($type eq \"string\") {\n"
"\t\tprint \"\\\\\" . $name . \"{\";\n" "\t\tprint \"\\\\\" . $name . \"{\";\n"
"\t\tlatex_quote($item);\n" "\t\tlatex_quote($item);\n"
...@@ -2253,17 +2448,17 @@ bool PerlModGenerator::generateDoxyLatexPL() ...@@ -2253,17 +2448,17 @@ bool PerlModGenerator::generateDoxyLatexPL()
"\t\t\tgenerate_doc($item);\n" "\t\t\tgenerate_doc($item);\n"
"\t\t\tprint \"}%\\n\";\n" "\t\t\tprint \"}%\\n\";\n"
"\t\t} else {\n" "\t\t} else {\n"
"\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
"\t\t}\n" "\t\t}\n"
"\t} elsif ($type eq \"hash\") {\n" "\t} elsif ($type eq \"hash\") {\n"
"\t\tmy ($key, $value);\n" "\t\tmy ($key, $value);\n"
"\t\twhile (($key, $submodel) = each %{$$model[2]}) {\n" "\t\twhile (($key, $subnode) = each %{$$node[2]}) {\n"
"\t\t\tmy $subname = $$submodel[1];\n" "\t\t\tmy $subname = $$subnode[1];\n"
"\t\t\tprint \"\\\\def\\\\field\" . $subname . \"{\";\n" "\t\t\tprint \"\\\\Defcs{field\" . $subname . \"}{\";\n"
"\t\t\tif ($$item{$key}) {\n" "\t\t\tif ($$item{$key}) {\n"
"\t\t\t\tgenerate($$item{$key}, $submodel);\n" "\t\t\t\tgenerate($$item{$key}, $subnode);\n"
"\t\t\t} else {\n" "\t\t\t} else {\n"
"\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n" "#\t\t\t\t\tprint \"\\\\\" . $subname . \"Empty%\\n\";\n"
"\t\t\t}\n" "\t\t\t}\n"
"\t\t\tprint \"}%\\n\";\n" "\t\t\tprint \"}%\\n\";\n"
"\t\t}\n" "\t\t}\n"
...@@ -2276,17 +2471,17 @@ bool PerlModGenerator::generateDoxyLatexPL() ...@@ -2276,17 +2471,17 @@ bool PerlModGenerator::generateDoxyLatexPL()
"\t\t\t\tif ($index) {\n" "\t\t\t\tif ($index) {\n"
"\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n" "\t\t\t\t\tprint \"\\\\\" . $name . \"Sep%\\n\";\n"
"\t\t\t\t}\n" "\t\t\t\t}\n"
"\t\t\t\tgenerate($subitem, $$model[2]);\n" "\t\t\t\tgenerate($subitem, $$node[2]);\n"
"\t\t\t\t$index++;\n" "\t\t\t\t$index++;\n"
"\t\t\t}\n" "\t\t\t}\n"
"\t\t\tprint \"}%\\n\";\n" "\t\t\tprint \"}%\\n\";\n"
"\t\t} else {\n" "\t\t} else {\n"
"\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n" "#\t\t\tprint \"\\\\\" . $name . \"Empty%\\n\";\n"
"\t\t}\n" "\t\t}\n"
"\t}\n" "\t}\n"
"}\n" "}\n"
"\n" "\n"
"generate($doxydocs, $doxymodel);\n"; "generate($doxydocs, $doxystructure);\n";
return true; return true;
} }
...@@ -2299,51 +2494,56 @@ bool PerlModGenerator::generateDoxyFormatTex() ...@@ -2299,51 +2494,56 @@ bool PerlModGenerator::generateDoxyFormatTex()
QTextStream doxyFormatTexStream(&doxyFormatTex); QTextStream doxyFormatTexStream(&doxyFormatTex);
doxyFormatTexStream << doxyFormatTexStream <<
"\\input{" << pathDoxyTemplateTex << "}\n" "\\def\\Defcs#1{\\long\\expandafter\\def\\csname#1\\endcsname}\n"
"\\Defcs{Empty}{}\n"
"\\def\\IfEmpty#1{\\expandafter\\ifx\\csname#1\\endcsname\\Empty}\n"
"\n"
"\\def\\StringNode#1{\\Defcs{#1}##1{##1}}\n"
"\\def\\DocNode#1{\\Defcs{#1}##1{##1}}\n"
"\\def\\ListNode#1{\\Defcs{#1}##1{##1}\\Defcs{#1Sep}{}}\n"
"\\def\\HashNode#1{\\Defcs{#1}{}}\n"
"\n"
"\\input{" << pathDoxyStructureTex << "}\n"
"\n" "\n"
"\\newbox\\BoxA\n" "\\newbox\\BoxA\n"
"\\dimendef\\DimenA=151\\relax\n" "\\dimendef\\DimenA=151\\relax\n"
"\\dimendef\\DimenB=152\\relax\n" "\\dimendef\\DimenB=152\\relax\n"
"\\countdef\\ZoneDepth=151\\relax\n" "\\countdef\\ZoneDepth=151\\relax\n"
"\n" "\n"
"\\def\\Ifxcscs#1#2{%\n" "\\def\\Cs#1{\\csname#1\\endcsname}\n"
"\\expandafter\\let\\expandafter\\Ifxcscsa\\csname#1\\endcsname%\n" "\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}\n"
"\\expandafter\\let\\expandafter\\Ifxcscsb\\csname#2\\endcsname%\n" "\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}\n"
"\\ifx\\Ifxcscsa\\Ifxcscsb}%\n" "\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}\n"
"\n"
"\\def\\Cs#1{\\csname#1\\endcsname}%\n"
"\\def\\Defcs#1{\\expandafter\\def\\csname#1\\endcsname}%\n"
"\\def\\Letcs#1{\\expandafter\\let\\csname#1\\endcsname}%\n"
"\\def\\Heading#1{\\vskip 4mm\\relax\\textbf{#1}}%\n"
"\\def\\See#1{\\begin{flushleft}\\Heading{See also: }#1\\end{flushleft}}%\n"
"\n" "\n"
"\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax%\n" "\\def\\Frame#1{\\vskip 3mm\\relax\\fbox{ \\vbox{\\hsize0.95\\hsize\\vskip 1mm\\relax\n"
"\\raggedright#1\\vskip 0.5mm\\relax} }}%\n" "\\raggedright#1\\vskip 0.5mm\\relax} }}\n"
"\n" "\n"
"\\def\\Zone#1#2#3{%\n" "\\def\\Zone#1#2#3{%\n"
"\\Defcs{#1}{\n" "\\Defcs{Test#1}{#2}%\n"
"\\advance\\ZoneDepth1\\relax%\n" "\\Defcs{Emit#1}{#3}%\n"
"\\Letcs{Mode\\number\\ZoneDepth}0%\n" "\\Defcs{#1}{%\n"
"\\Letcs{Present\\number\\ZoneDepth}0%\n" "\\advance\\ZoneDepth1\\relax\n"
"#2%\n" "\\Letcs{Mode\\number\\ZoneDepth}0\\relax\n"
"\\Letcs{Present\\number\\ZoneDepth}0\\relax\n"
"\\Cs{Test#1}\n"
"\\expandafter\\if\\Cs{Present\\number\\ZoneDepth}1%\n" "\\expandafter\\if\\Cs{Present\\number\\ZoneDepth}1%\n"
"\\advance\\ZoneDepth-1\\relax%\n" "\\advance\\ZoneDepth-1\\relax\n"
"\\Letcs{Present\\number\\ZoneDepth}1%\n" "\\Letcs{Present\\number\\ZoneDepth}1\\relax\n"
"\\expandafter\\if\\Cs{Mode\\number\\ZoneDepth}1%\n" "\\expandafter\\if\\Cs{Mode\\number\\ZoneDepth}1%\n"
"\\advance\\ZoneDepth1\\relax%\n" "\\advance\\ZoneDepth1\\relax\n"
"\\Letcs{Mode\\number\\ZoneDepth}1%\n" "\\Letcs{Mode\\number\\ZoneDepth}1\\relax\n"
"#3%\n" "\\Cs{Emit#1}\n"
"\\advance\\ZoneDepth-1\\relax\\fi%\n" "\\advance\\ZoneDepth-1\\relax\\fi\n"
"\\advance\\ZoneDepth1\\relax\\fi%\n" "\\advance\\ZoneDepth1\\relax\\fi\n"
"\\advance\\ZoneDepth-1\\relax}}%\n" "\\advance\\ZoneDepth-1\\relax}}\n"
"\n" "\n"
"\\def\\Member#1#2{%\n" "\\def\\Member#1#2{%\n"
"\\Defcs{Test#1}{\\Cs{field#1Detailed}%\n" "\\Defcs{Test#1}{\\Cs{field#1Detailed}\n"
"\\Ifxcscs{field#1DetailedDoc}{field#1DetailedDocEmpty}\\else\\Letcs{Present#1}1\\fi}\n" "\\IfEmpty{field#1DetailedDoc}\\else\\Letcs{Present#1}1\\fi}\n"
"\\Defcs{#1}{\\Letcs{Present#1}0%\n" "\\Defcs{#1}{\\Letcs{Present#1}0\\relax\n"
"\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1%\n" "\\Cs{Test#1}\\if1\\Cs{Present#1}\\Letcs{Present\\number\\ZoneDepth}1\\relax\n"
"\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}%\n" "\\if1\\Cs{Mode\\number\\ZoneDepth}#2\\fi\\fi}}\n"
"%\n" "\n"
"\\def\\TypedefMemberList#1#2{%\n" "\\def\\TypedefMemberList#1#2{%\n"
"\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n" "\\Defcs{#1DetailedDoc}##1{\\vskip 5.5mm\\relax##1}%\n"
"\\Defcs{#1Name}##1{\\textbf{##1}}%\n" "\\Defcs{#1Name}##1{\\textbf{##1}}%\n"
...@@ -2369,40 +2569,48 @@ bool PerlModGenerator::generateDoxyFormatTex() ...@@ -2369,40 +2569,48 @@ bool PerlModGenerator::generateDoxyFormatTex()
"\\Defcs{#1PDBlocksSep}{\\vskip 2mm\\relax}%\n" "\\Defcs{#1PDBlocksSep}{\\vskip 2mm\\relax}%\n"
"%\n" "%\n"
"\\Defcs{#1PDBlocks}##1{%\n" "\\Defcs{#1PDBlocks}##1{%\n"
"\\Heading{Parameters:}\\vskip 1.5mm\\relax%\n" "\\Heading{Parameters:}\\vskip 1.5mm\\relax\n"
"\\DimenA0pt\\relax%\n" "\\DimenA0pt\\relax\n"
"\\Defcs{#1PDBlock}{\\setbox\\BoxA\\hbox{\\Cs{field#1PDParams}}%\n" "\\Defcs{#1PDBlock}{\\setbox\\BoxA\\hbox{\\Cs{field#1PDParams}}%\n"
"\\ifdim\\DimenA<\\wd\\BoxA\\DimenA\\wd\\BoxA\\fi}%\n" "\\ifdim\\DimenA<\\wd\\BoxA\\DimenA\\wd\\BoxA\\fi}%\n"
"##1%\n" "##1%\n"
"\\advance\\DimenA3mm\\relax\n" "\\advance\\DimenA3mm\\relax\n"
"\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax%\n" "\\DimenB\\hsize\\advance\\DimenB-\\DimenA\\relax\n"
"\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax%\n" "\\Defcs{#1PDBlock}{\\hbox to\\hsize{\\vtop{\\hsize\\DimenA\\relax\n"
"\\Cs{field#1PDParams}}\\hfill%\n" "\\Cs{field#1PDParams}}\\hfill\n"
"\\vtop{\\hsize\\DimenB\\relax\\Cs{field#1PDDoc}}}}%\n" "\\vtop{\\hsize\\DimenB\\relax\\Cs{field#1PDDoc}}}}%\n"
"##1}%\n" "##1}\n"
"%\n" "\n"
"\\Defcs{#1ParamName}##1{\\textit{##1}}%\n" "\\Defcs{#1ParamName}##1{\\textit{##1}}\n"
"\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}%\n" "\\Defcs{#1Param}{\\Cs{field#1ParamType}{} \\Cs{field#1ParamName}}\n"
"\\Defcs{#1ParamsSep}{, }%\n" "\\Defcs{#1ParamsSep}{, }\n"
"%\n" "\n"
"\\Defcs{#1Name}##1{\\textbf{##1}}%\n" "\\Defcs{#1Name}##1{\\textbf{##1}}\n"
"\\Defcs{#1See}##1{\\See{##1}}%\n" "\\Defcs{#1See}##1{\\See{##1}}\n"
"\\Defcs{#1Return}##1{\\Heading{Returns: }##1}%\n" "\\Defcs{#1Return}##1{\\Heading{Returns: }##1}\n"
"\\Defcs{field#1Title}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}(\\Cs{field#1Params})}}%\n" "\\Defcs{field#1Title}{\\Frame{\\Cs{field#1Type}{} \\Cs{field#1Name}(\\Cs{field#1Params})}}%\n"
"%\n" "%\n"
"\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n" "\\Zone{#1s}{\\Cs{field#1List}}{\\subsubsection{#2}\\Cs{field#1List}}%\n"
"\\Member{#1}{\n" "\\Member{#1}{%\n"
"\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}%\n" "\\Cs{field#1Title}\\vskip 6mm\\relax\\Cs{field#1DetailedDoc}\n"
"\\Cs{field#1Return}\\Cs{field#1PDBlocks}\\Cs{field#1See}\\vskip 5mm\\relax}}\n" "\\Cs{field#1Return}\\Cs{field#1PDBlocks}\\Cs{field#1See}\\vskip 5mm\\relax}}\n"
"\n" "\n"
"\\TypedefMemberList{FileTypedef}{Typedefs}%\n" "\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}\n"
"\\VariableMemberList{FileVariable}{Variables}%\n" "\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}\n"
"\\FunctionMemberList{FileFunction}{Functions}%\n" "\n"
"\\def\\FileSubzones{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}\n"
"\n"
"\\def\\ClassSubzones{%\n"
"\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods\n"
"\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods\n"
"\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}\n"
"\n" "\n"
"\\def\\FileDetailed{\\fieldFileDetailedDoc\\par}%\n" "\\Member{Page}{\\subsection{\\fieldPageName}\\fieldPageDetailedDoc}\n"
"\n" "\n"
"\\def\\TestFile{\\fieldFileTypedefs\\fieldFileVariables\\fieldFileFunctions}%\n" "\\TypedefMemberList{FileTypedef}{Typedefs}\n"
"\\Zone{File}{\\TestFile}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\TestFile}%\n" "\\VariableMemberList{FileVariable}{Variables}\n"
"\\FunctionMemberList{FileFunction}{Functions}\n"
"\\Zone{File}{\\FileSubzones}{\\subsection{\\fieldFileName}\\fieldFileDetailed\\FileSubzones}\n"
"\n" "\n"
"\\TypedefMemberList{ClassPublicTypedef}{Public Typedefs}\n" "\\TypedefMemberList{ClassPublicTypedef}{Public Typedefs}\n"
"\\TypedefMemberList{ClassProtectedTypedef}{Protected Typedefs}\n" "\\TypedefMemberList{ClassProtectedTypedef}{Protected Typedefs}\n"
...@@ -2413,36 +2621,29 @@ bool PerlModGenerator::generateDoxyFormatTex() ...@@ -2413,36 +2621,29 @@ bool PerlModGenerator::generateDoxyFormatTex()
"\\FunctionMemberList{ClassPublicMethod}{Public Methods}\n" "\\FunctionMemberList{ClassPublicMethod}{Public Methods}\n"
"\\FunctionMemberList{ClassProtectedMethod}{Protected Methods}\n" "\\FunctionMemberList{ClassProtectedMethod}{Protected Methods}\n"
"\\FunctionMemberList{ClassPrivateMethod}{Private Methods}\n" "\\FunctionMemberList{ClassPrivateMethod}{Private Methods}\n"
"\\Zone{Class}{\\ClassSubzones}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\ClassSubzones}\n"
"\n" "\n"
"\\def\\ClassDetailed{\\fieldClassDetailedDoc\\par}%\n" "\\Zone{AllPages}{\\fieldPages}{\\section{Pages}\\fieldPages}\n"
"\n" "\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}\n"
"\\def\\TestClass{%\n" "\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}\n"
"\\fieldClassPublicTypedefs\\fieldClassPublicMembers\\fieldClassPublicMethods%\n"
"\\fieldClassProtectedTypedefs\\fieldClassProtectedMembers\\fieldClassProtectedMethods%\n"
"\\fieldClassPrivateTypedefs\\fieldClassPrivateMembers\\fieldClassPrivateMethods}%\n"
"\n"
"\\Zone{Class}{\\TestClass}{\\subsection{\\fieldClassName}\\fieldClassDetailed\\TestClass}%\n"
"\n"
"\\Zone{AllFiles}{\\fieldFiles}{\\section{Files}\\fieldFiles}%\n"
"\\Zone{AllClasses}{\\fieldClasses}{\\section{Classes}\\fieldClasses}%\n"
"\n" "\n"
"\\newlength{\\oldparskip}%\n" "\\newlength{\\oldparskip}\n"
"\\newlength{\\oldparindent}%\n" "\\newlength{\\oldparindent}\n"
"\\newlength{\\oldfboxrule}%\n" "\\newlength{\\oldfboxrule}\n"
"\n" "\n"
"\\ZoneDepth0%\n" "\\ZoneDepth0\\relax\n"
"\\Letcs{Mode0}1%\n" "\\Letcs{Mode0}1\\relax\n"
"\n" "\n"
"\\def\\EmitDoxyDocs{%\n" "\\def\\EmitDoxyDocs{%\n"
"\\setlength{\\oldparskip}{\\parskip}%\n" "\\setlength{\\oldparskip}{\\parskip}\n"
"\\setlength{\\oldparindent}{\\parindent}%\n" "\\setlength{\\oldparindent}{\\parindent}\n"
"\\setlength{\\oldfboxrule}{\\fboxrule}%\n" "\\setlength{\\oldfboxrule}{\\fboxrule}\n"
"\\setlength{\\parskip}{0cm}%\n" "\\setlength{\\parskip}{0cm}\n"
"\\setlength{\\parindent}{0cm}%\n" "\\setlength{\\parindent}{0cm}\n"
"\\setlength{\\fboxrule}{1pt}%\n" "\\setlength{\\fboxrule}{1pt}\n"
"\\AllFiles\\AllClasses%\n" "\\AllPages\\AllFiles\\AllClasses\n"
"\\setlength{\\parskip}{\\oldparskip}%\n" "\\setlength{\\parskip}{\\oldparskip}\n"
"\\setlength{\\parindent}{\\oldparindent}%\n" "\\setlength{\\parindent}{\\oldparindent}\n"
"\\setlength{\\fboxrule}{\\oldfboxrule}}\n"; "\\setlength{\\fboxrule}{\\oldfboxrule}}\n";
return true; return true;
...@@ -2467,6 +2668,7 @@ bool PerlModGenerator::generateDoxyLatexTex() ...@@ -2467,6 +2668,7 @@ bool PerlModGenerator::generateDoxyLatexTex()
"\n" "\n"
"\\begin{document}\n" "\\begin{document}\n"
"\\input{" << pathDoxyDocsTex << "}\n" "\\input{" << pathDoxyDocsTex << "}\n"
"\\sloppy\n"
"\\EmitDoxyDocs\n" "\\EmitDoxyDocs\n"
"\\end{document}\n"; "\\end{document}\n";
...@@ -2490,29 +2692,29 @@ void PerlModGenerator::generate() ...@@ -2490,29 +2692,29 @@ void PerlModGenerator::generate()
bool perlmodLatex = Config_getBool("PERLMOD_LATEX"); bool perlmodLatex = Config_getBool("PERLMOD_LATEX");
pathDoxyDocsPM = perlModDir.absPath() + "/DoxyDocs.pm"; pathDoxyDocsPM = perlModDir.absPath() + "/DoxyDocs.pm";
pathDoxyModelPM = perlModDir.absPath() + "/DoxyModel.pm"; pathDoxyStructurePM = perlModDir.absPath() + "/DoxyStructure.pm";
pathMakefile = perlModDir.absPath() + "/Makefile"; pathMakefile = perlModDir.absPath() + "/Makefile";
pathDoxyRules = perlModDir.absPath() + "/doxyrules.make"; pathDoxyRules = perlModDir.absPath() + "/doxyrules.make";
if (perlmodLatex) { if (perlmodLatex) {
pathDoxyTemplateTex = perlModDir.absPath() + "/doxytemplate.tex"; pathDoxyStructureTex = perlModDir.absPath() + "/doxystructure.tex";
pathDoxyFormatTex = perlModDir.absPath() + "/doxyformat.tex"; pathDoxyFormatTex = perlModDir.absPath() + "/doxyformat.tex";
pathDoxyLatexTex = perlModDir.absPath() + "/doxylatex.tex"; pathDoxyLatexTex = perlModDir.absPath() + "/doxylatex.tex";
pathDoxyLatexDVI = perlModDir.absPath() + "/doxylatex.dvi"; pathDoxyLatexDVI = perlModDir.absPath() + "/doxylatex.dvi";
pathDoxyLatexPDF = perlModDir.absPath() + "/doxylatex.pdf"; pathDoxyLatexPDF = perlModDir.absPath() + "/doxylatex.pdf";
pathDoxyDocsTex = perlModDir.absPath() + "/doxydocs.tex"; pathDoxyDocsTex = perlModDir.absPath() + "/doxydocs.tex";
pathDoxyLatexPL = perlModDir.absPath() + "/doxylatex.pl"; pathDoxyLatexPL = perlModDir.absPath() + "/doxylatex.pl";
pathDoxyLatexTemplatePL = perlModDir.absPath() + "/doxylatex-template.pl"; pathDoxyLatexStructurePL = perlModDir.absPath() + "/doxylatex-structure.pl";
} }
if (!(generatePerlModOutput() if (!(generatePerlModOutput()
&& generateDoxyModelPM() && generateDoxyStructurePM()
&& generateMakefile() && generateMakefile()
&& generateDoxyRules())) && generateDoxyRules()))
return; return;
if (perlmodLatex) { if (perlmodLatex) {
if (!(generateDoxyLatexTemplatePL() if (!(generateDoxyLatexStructurePL()
&& generateDoxyLatexPL() && generateDoxyLatexPL()
&& generateDoxyLatexTex() && generateDoxyLatexTex()
&& generateDoxyFormatTex())) && generateDoxyFormatTex()))
...@@ -2522,7 +2724,7 @@ void PerlModGenerator::generate() ...@@ -2522,7 +2724,7 @@ void PerlModGenerator::generate()
void generatePerlMod() void generatePerlMod()
{ {
PerlModGenerator pmg; PerlModGenerator pmg(Config_getBool("PERLMOD_PRETTY"));
pmg.generate(); pmg.generate();
} }
......
...@@ -121,6 +121,9 @@ class PrintDocVisitor : public DocVisitor ...@@ -121,6 +121,9 @@ class PrintDocVisitor : public DocVisitor
case DocStyleChange::Small: case DocStyleChange::Small:
if (s->enable()) printf("<small>"); else printf("</small>"); if (s->enable()) printf("<small>"); else printf("</small>");
break; break;
case DocStyleChange::Preformatted:
if (s->enable()) printf("<pre>"); else printf("</pre>");
break;
} }
} }
void visit(DocVerbatim *s) void visit(DocVerbatim *s)
...@@ -330,18 +333,18 @@ class PrintDocVisitor : public DocVisitor ...@@ -330,18 +333,18 @@ class PrintDocVisitor : public DocVisitor
indent_post(); indent_post();
printf("</li>\n"); printf("</li>\n");
} }
void visitPre(DocHtmlPre *) //void visitPre(DocHtmlPre *)
{ //{
indent_pre(); // indent_pre();
printf("<pre>\n"); // printf("<pre>\n");
m_insidePre=TRUE; // m_insidePre=TRUE;
} //}
void visitPost(DocHtmlPre *) //void visitPost(DocHtmlPre *)
{ //{
m_insidePre=FALSE; // m_insidePre=FALSE;
indent_post(); // indent_post();
printf("</pre>\n"); // printf("</pre>\n");
} //}
void visitPre(DocHtmlDescList *) void visitPre(DocHtmlDescList *)
{ {
indent_pre(); indent_pre();
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "message.h" #include "message.h"
RTFDocVisitor::RTFDocVisitor(QTextStream &t,BaseCodeDocInterface &ci) RTFDocVisitor::RTFDocVisitor(QTextStream &t,BaseCodeDocInterface &ci)
: m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_indentLevel(0) : m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE), m_indentLevel(1)
{ {
} }
...@@ -48,7 +48,7 @@ void RTFDocVisitor::incIndentLevel() ...@@ -48,7 +48,7 @@ void RTFDocVisitor::incIndentLevel()
void RTFDocVisitor::decIndentLevel() void RTFDocVisitor::decIndentLevel()
{ {
if (m_indentLevel>0) m_indentLevel--; if (m_indentLevel>1) m_indentLevel--;
} }
//-------------------------------------- //--------------------------------------
...@@ -259,6 +259,21 @@ void RTFDocVisitor::visit(DocStyleChange *s) ...@@ -259,6 +259,21 @@ void RTFDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Small: case DocStyleChange::Small:
if (s->enable()) m_t << "{\\sub "; else m_t << "} "; if (s->enable()) m_t << "{\\sub "; else m_t << "} ";
break; break;
case DocStyleChange::Preformatted:
if (s->enable())
{
m_t << "{" << endl;
m_t << "\\par" << endl;
m_t << rtf_Style_Reset << getStyle("CodeExample");
m_insidePre=TRUE;
}
else
{
m_insidePre=FALSE;
m_t << "\\par" << endl;
m_t << "}" << endl;
}
break;
} }
} }
...@@ -585,20 +600,20 @@ void RTFDocVisitor::visitPost(DocHtmlListItem *) ...@@ -585,20 +600,20 @@ void RTFDocVisitor::visitPost(DocHtmlListItem *)
{ {
} }
void RTFDocVisitor::visitPre(DocHtmlPre *) //void RTFDocVisitor::visitPre(DocHtmlPre *)
{ //{
m_t << "{" << endl; // m_t << "{" << endl;
m_t << "\\par" << endl; // m_t << "\\par" << endl;
m_t << rtf_Style_Reset << getStyle("CodeExample"); // m_t << rtf_Style_Reset << getStyle("CodeExample");
m_insidePre=TRUE; // m_insidePre=TRUE;
} //}
void RTFDocVisitor::visitPost(DocHtmlPre *) //void RTFDocVisitor::visitPost(DocHtmlPre *)
{ //{
m_insidePre=FALSE; // m_insidePre=FALSE;
m_t << "\\par" << endl; // m_t << "\\par" << endl;
m_t << "}" << endl; // m_t << "}" << endl;
} //}
void RTFDocVisitor::visitPre(DocHtmlDescList *) void RTFDocVisitor::visitPre(DocHtmlDescList *)
{ {
...@@ -875,8 +890,8 @@ void RTFDocVisitor::visitPost(DocLanguage *) ...@@ -875,8 +890,8 @@ void RTFDocVisitor::visitPost(DocLanguage *)
void RTFDocVisitor::visitPre(DocParamSect *s) void RTFDocVisitor::visitPre(DocParamSect *s)
{ {
m_t << "{"; // start param list m_t << "{"; // start param list
m_t << "{\\b "; // start bold
m_t << "\\par" << endl; m_t << "\\par" << endl;
m_t << "{\\b "; // start bold
switch(s->type()) switch(s->type())
{ {
case DocParamSect::Param: case DocParamSect::Param:
...@@ -896,7 +911,7 @@ void RTFDocVisitor::visitPre(DocParamSect *s) ...@@ -896,7 +911,7 @@ void RTFDocVisitor::visitPre(DocParamSect *s)
void RTFDocVisitor::visitPost(DocParamSect *) void RTFDocVisitor::visitPost(DocParamSect *)
{ {
m_t << "\\par" << endl; //m_t << "\\par" << endl;
decIndentLevel(); decIndentLevel();
m_t << "}" << endl; m_t << "}" << endl;
} }
......
...@@ -76,8 +76,8 @@ class RTFDocVisitor : public DocVisitor ...@@ -76,8 +76,8 @@ class RTFDocVisitor : public DocVisitor
void visitPost(DocHtmlList *s); void visitPost(DocHtmlList *s);
void visitPre(DocHtmlListItem *); void visitPre(DocHtmlListItem *);
void visitPost(DocHtmlListItem *); void visitPost(DocHtmlListItem *);
void visitPre(DocHtmlPre *); //void visitPre(DocHtmlPre *);
void visitPost(DocHtmlPre *); //void visitPost(DocHtmlPre *);
void visitPre(DocHtmlDescList *); void visitPre(DocHtmlDescList *);
void visitPost(DocHtmlDescList *); void visitPost(DocHtmlDescList *);
void visitPre(DocHtmlDescTitle *); void visitPre(DocHtmlDescTitle *);
......
...@@ -1439,14 +1439,14 @@ void RTFGenerator::startDescription() ...@@ -1439,14 +1439,14 @@ void RTFGenerator::startDescription()
{ {
DBG_RTF(t << "{\\comment (startDescription)}" << endl) DBG_RTF(t << "{\\comment (startDescription)}" << endl)
t << "{" << endl; t << "{" << endl;
t << rtf_Style_Reset << rtf_CList_DepthStyle(); t << rtf_Style_Reset << rtf_DList_DepthStyle();
} }
void RTFGenerator::endDescription() void RTFGenerator::endDescription()
{ {
DBG_RTF(t << "{\\comment (endDescription)}" << endl) DBG_RTF(t << "{\\comment (endDescription)}" << endl)
t << "}";
newParagraph(); newParagraph();
t << "}";
} }
void RTFGenerator::startDescItem() void RTFGenerator::startDescItem()
...@@ -1758,6 +1758,7 @@ void RTFGenerator::writeRTFReference(const char *label) ...@@ -1758,6 +1758,7 @@ void RTFGenerator::writeRTFReference(const char *label)
void RTFGenerator::startCodeFragment() void RTFGenerator::startCodeFragment()
{ {
DBG_RTF(t << "{\\comment (startCodeFragment) }" << endl)
t << "{" << endl; t << "{" << endl;
newParagraph(); newParagraph();
t << rtf_Style_Reset << rtf_Code_DepthStyle(); t << rtf_Style_Reset << rtf_Code_DepthStyle();
...@@ -1974,8 +1975,11 @@ void RTFGenerator::endTextBlock() ...@@ -1974,8 +1975,11 @@ void RTFGenerator::endTextBlock()
void RTFGenerator::newParagraph() void RTFGenerator::newParagraph()
{ {
if (!m_omitParagraph)
{
DBG_RTF(t << "{\\comment (newParagraph)}" << endl) DBG_RTF(t << "{\\comment (newParagraph)}" << endl)
if (!m_omitParagraph) t << "\\par" << endl; t << "\\par" << endl;
}
m_omitParagraph = FALSE; m_omitParagraph = FALSE;
} }
...@@ -2177,6 +2181,7 @@ static bool PreProcessFile(QDir &d,QCString &infName, QTextStream &t, bool bIncl ...@@ -2177,6 +2181,7 @@ static bool PreProcessFile(QDir &d,QCString &infName, QTextStream &t, bool bIncl
void RTFGenerator::startDotGraph() void RTFGenerator::startDotGraph()
{ {
DBG_RTF(t << "{\\comment (startDotGraph)}" << endl)
} }
void RTFGenerator::endDotGraph(DotClassGraph &g) void RTFGenerator::endDotGraph(DotClassGraph &g)
...@@ -2193,10 +2198,13 @@ void RTFGenerator::endDotGraph(DotClassGraph &g) ...@@ -2193,10 +2198,13 @@ void RTFGenerator::endDotGraph(DotClassGraph &g)
t << fileName << "." << Config_getEnum("DOT_IMAGE_FORMAT"); t << fileName << "." << Config_getEnum("DOT_IMAGE_FORMAT");
t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
t << "}" << endl; t << "}" << endl;
newParagraph();
DBG_RTF(t << "{\\comment (endDotGraph)}" << endl)
} }
void RTFGenerator::startInclDepGraph() void RTFGenerator::startInclDepGraph()
{ {
DBG_RTF(t << "{\\comment (startInclDepGraph)}" << endl)
} }
void RTFGenerator::endInclDepGraph(DotInclDepGraph &g) void RTFGenerator::endInclDepGraph(DotInclDepGraph &g)
...@@ -2212,6 +2220,7 @@ void RTFGenerator::endInclDepGraph(DotInclDepGraph &g) ...@@ -2212,6 +2220,7 @@ void RTFGenerator::endInclDepGraph(DotInclDepGraph &g)
t << fileName << "." << Config_getEnum("DOT_IMAGE_FORMAT"); t << fileName << "." << Config_getEnum("DOT_IMAGE_FORMAT");
t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
t << "}" << endl; t << "}" << endl;
DBG_RTF(t << "{\\comment (endInclDepGraph)}" << endl)
} }
/** Tests the integrity of the result by counting brackets. /** Tests the integrity of the result by counting brackets.
......
...@@ -3827,18 +3827,14 @@ void filterLatexString(QTextStream &t,const char *str, ...@@ -3827,18 +3827,14 @@ void filterLatexString(QTextStream &t,const char *str,
case '>': t << "$>$"; break; case '>': t << "$>$"; break;
case '|': t << "$|$"; break; case '|': t << "$|$"; break;
case '~': t << "$\\sim$"; break; case '~': t << "$\\sim$"; break;
case '[': if (Config_getBool("PDF_HYPERLINKS")) case '[': if (Config_getBool("PDF_HYPERLINKS") || insideItem)
t << "\\mbox{[}"; t << "\\mbox{[}";
else if (insideItem)
t << "\\[";
else else
t << "["; t << "[";
break; break;
case ']': if (pc=='[') t << "$\\,$"; case ']': if (pc=='[') t << "$\\,$";
if (Config_getBool("PDF_HYPERLINKS")) if (Config_getBool("PDF_HYPERLINKS") || insideItem)
t << "\\mbox{]}"; t << "\\mbox{]}";
else if (insideItem)
t << "\\]";
else else
t << "]"; t << "]";
break; break;
......
...@@ -138,6 +138,18 @@ void XmlDocVisitor::visit(DocStyleChange *s) ...@@ -138,6 +138,18 @@ void XmlDocVisitor::visit(DocStyleChange *s)
case DocStyleChange::Small: case DocStyleChange::Small:
if (s->enable()) m_t << "<small>"; else m_t << "</small> "; if (s->enable()) m_t << "<small>"; else m_t << "</small> ";
break; break;
case DocStyleChange::Preformatted:
if (s->enable())
{
m_t << "<preformatted>";
m_insidePre=TRUE;
}
else
{
m_t << "</preformatted> ";
m_insidePre=FALSE;
}
break;
} }
} }
...@@ -412,18 +424,6 @@ void XmlDocVisitor::visitPost(DocHtmlListItem *) ...@@ -412,18 +424,6 @@ void XmlDocVisitor::visitPost(DocHtmlListItem *)
m_t << "</listitem>\n"; m_t << "</listitem>\n";
} }
void XmlDocVisitor::visitPre(DocHtmlPre *)
{
m_t << "<preformatted>\n";
m_insidePre=TRUE;
}
void XmlDocVisitor::visitPost(DocHtmlPre *)
{
m_insidePre=FALSE;
m_t << "</preformatted>\n";
}
void XmlDocVisitor::visitPre(DocHtmlDescList *) void XmlDocVisitor::visitPre(DocHtmlDescList *)
{ {
m_t << "<variablelist>\n"; m_t << "<variablelist>\n";
...@@ -517,12 +517,12 @@ void XmlDocVisitor::visitPost(DocHRef *) ...@@ -517,12 +517,12 @@ void XmlDocVisitor::visitPost(DocHRef *)
void XmlDocVisitor::visitPre(DocHtmlHeader *header) void XmlDocVisitor::visitPre(DocHtmlHeader *header)
{ {
m_t << "<sect" << header->level() << ">"; m_t << "<heading" << header->level() << ">";
} }
void XmlDocVisitor::visitPost(DocHtmlHeader *header) void XmlDocVisitor::visitPost(DocHtmlHeader *header)
{ {
m_t << "</sect" << header->level() << ">\n"; m_t << "</heading" << header->level() << ">\n";
} }
void XmlDocVisitor::visitPre(DocImage *img) void XmlDocVisitor::visitPre(DocImage *img)
......
...@@ -76,8 +76,8 @@ class XmlDocVisitor : public DocVisitor ...@@ -76,8 +76,8 @@ class XmlDocVisitor : public DocVisitor
void visitPost(DocHtmlList *) ; void visitPost(DocHtmlList *) ;
void visitPre(DocHtmlListItem *); void visitPre(DocHtmlListItem *);
void visitPost(DocHtmlListItem *); void visitPost(DocHtmlListItem *);
void visitPre(DocHtmlPre *); //void visitPre(DocHtmlPre *);
void visitPost(DocHtmlPre *); //void visitPost(DocHtmlPre *);
void visitPre(DocHtmlDescList *); void visitPre(DocHtmlDescList *);
void visitPost(DocHtmlDescList *); void visitPost(DocHtmlDescList *);
void visitPre(DocHtmlDescTitle *); void visitPre(DocHtmlDescTitle *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment