Commit 75fed736 authored by dimitri's avatar dimitri

Release-20010517

parent f5f5db18
......@@ -3,4 +3,4 @@ DOXYGEN Version 1.2.7
Please read the installation section of the manual for instructions.
--------
Dimitri van Heesch (30 April 2001)
Dimitri van Heesch (17 May 2001)
......@@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at
Enjoy,
Dimitri van Heesch (30 April 2001)
Dimitri van Heesch (17 May 2001)
......@@ -12,7 +12,7 @@
# Documents produced by Doxygen are derivative works derived from the
# input used in their production; they are not affected by this license.
all: FORCE
all: language.doc FORCE
DOXYGEN_DOCDIR=$(DOXYDOCS); \
export DOXYGEN_DOCDIR; \
VERSION=$(VERSION) ; \
......@@ -26,6 +26,9 @@ all: FORCE
@cp doxygen_logo.eps ../latex
clean:
rm -rf ../html ../latex
rm -rf ../html ../latex language.doc
language.doc: language.tpl FORCE
$(PERL) translator.pl
FORCE:
......@@ -86,6 +86,7 @@ documentation:
<li> \refitem cmdingroup \ingroup
<li> \refitem cmdinternal \internal
<li> \refitem cmdinvariant \invariant
<li> \refitem cmdinterface \interface
<li> \refitem cmdlatexonly \latexonly
<li> \refitem cmdli \li
<li> \refitem cmdline \line
......@@ -349,6 +350,16 @@ Doxygen. Unrecognized commands are treated as normal text.
\sa section \ref cmddefgroup "\\defgroup".
<hr>
\subsection cmdinterface \interface
\addindex \interface
Indicates that a comment block contains documentation for an
interface with name \<name\>. The arguments are equal to the \\class
command.
\sa section \ref cmdclass "\\class".
<hr>
\subsection cmdinternal \internal
......
......@@ -83,6 +83,8 @@ documentation. Note that all attributes of a HTML tag are ignored
<li>\c </TR> Does not generate any output.
<li>\c <TT> Starts a piece of text displayed in a typewriter font.
<li>\c </TT> Ends a \c <TT> section.
<li>\c <KBD> Starts a piece of text displayed in a typewriter font.
<li>\c </KBD> Ends a \c <KBD> section.
<li>\c <UL> Starts an unnumbered item list.
<li>\c </UL> Ends an unnumbered item list.
<li>\c <VAR> Starts a piece of text displayed in an italic font.
......
/******************************************************************************
* <notice>This is the template for generating language.doc. Edit this file,
* not the language.doc.</notice>
*
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
* granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
*/
/*! \page langhowto Internationalization
<h3>Support for multiple languages</h3>
Doxygen has support for multiple languages. This means
that the text fragments that doxygen generates can changed into languages
other than English (the default) at configuration time.
<p>
Currently, $numlang languages are supported (sorted alphabetically):
$languages.
The table of information related to the supported languages follows.
It is sorted by language alphabetically. The <B>Status</B> column
was generated from sources and shows approximately the last version
when the translator was updated.
<p>
$information_table
Have a look at <code>doxygen/doc/translator.txt</code> for more details.
<p>
Most people on the list have indicated that they were also busy
doing other things, so if you want to help to speed things up please
let them (or me) know.
If you want to add support for a language that is not yet listed
please see the next section.
<h3>Adding a new language to doxygen</h3>
This short HOWTO explains how to add support for a new language to Doxygen:
Just follow these steps:
<ol>
<li>Tell me for which language you want to add support. If no one else
is already working on support for that language, you will be
assigned as the maintainer for the language.
<li>Create a copy of translator_en.h and name it
translator_<your_2_letter_counter_code>.h
I'll use xx in the rest of this document.
<li>Edit language.cpp:
Add a
\verbatim
#include<translator_xx.h>
\endverbatim
in <code>setTranslator()</code> add
\verbatim
else if (L_EQUAL("your_language_name"))
{
theTranslator = new TranslatorYourLanguage;
}
\endverbatim
after the <code>if { ... }</code>
<li>Edit libdoxygen.pro.in and add \c translator_xx.h to
the \c HEADERS line in the file doxygen.pro.
<li>Edit <code>translator_xx.h</code>:
<ul>
<li>Rename <code>TRANSLATOR_EN_H</code> to <code>TRANSLATOR_XX_H</code> twice.
<li>Rename TranslatorEnglish to TranslatorYourLanguage
<li>In the member <code>idLanguage()</code> change "english" into the
name of the your language (use lower case characters only). Depending
on the language you may also wish to change the member functions
latexLanguageSupportCommand() and idLanguageCharset().
<li>Edit all the strings that are returned by the member functions that
start with tr.
Try to match punctuation and capitals!
To enter special characters (with accents) you can:
<ul>
<li> Enter them directly if your keyboard supports that and you are
using a Latin-1 font.
Doxygen will translate the characters to proper Latex and
leave the Html and man output for what it is (which is fine, if
idLanguageCharset() is set correctly).
<li> Use html codes like \&auml; for an a with an umlaut (i.e. &auml;).
See the HTML specification for the codes.
</ul>
</ul>
<li>Run configure and make again from the root of the distribution,
in order to regenerated the Makefiles.
<li>Now you can use <code>OUTPUT_LANGUAGE = your_language_name</code>
in the config file to generate output in your language.
<li>Send <code>translator_xx.h</code> to me so I can add it to doxygen.
</ol>
<h3>Maintaining a language</h3>
As new versions of doxygen appear, new sentences will be
added to the Translator interface class. Of course these need to be translated
as well (otherwise doxygen wouldn't even compile!).
Waiting until all language maintainers have translated these new sentences
and sent the results would not be very practical for me.
Instead, a new class TranslatorAdapter_x_y_z will be added to
translator_adapter.h (here x,y, and z correspond to the current
version of doxygen). And all translators that previous derived from
Translator will now derive from this adapter class.
The Adapter class contains the new sentences with
default translations using the English translator (which is always up to date).
Instead of deriving your TranslatorXX class directly from Translator it will
derive from the intermediate class TranslatorAdapter_x_y_z.
Thus, if a translator class inherits from a adapter class
maintenance is needed. By looking at the adapter class itself (and its base
classes) you can easily see which methods need to be updated.
To update a language simply make your translator class derive from
the abstract class Translator and provide translations for the methods that
were previously provided by the adapter class (and its base classes).
*/
:start
call perl -w translator.pl
pause
goto start
\ No newline at end of file
This diff is collapsed.
#
# $Id$
#
#
# Copyright (C) 1997-2001 by Dimitri van Heesch.
#
......
This diff is collapsed.
This diff is collapsed.
......@@ -35,9 +35,15 @@ int ClassList::compareItems(GCI item1, GCI item2)
{
ClassDef *c1=(ClassDef *)item1;
ClassDef *c2=(ClassDef *)item2;
//int prefixLength = Config::instance()->get("").length();
//int i1 = c1->name().left(prefixLength)==Config::instance()->get("") ? prefixLength : 0;
//int i2 = c2->name().left(prefixLength)==Config::instance()->get("") ? prefixLength : 0;
return stricmp(c1->name().data()+getPrefixIndex(c1->name()),
c2->name().data()+getPrefixIndex(c2->name())
);
}
int ClassSDict::compareItems(GCI item1, GCI item2)
{
ClassDef *c1=(ClassDef *)item1;
ClassDef *c2=(ClassDef *)item2;
return stricmp(c1->name().data()+getPrefixIndex(c1->name()),
c2->name().data()+getPrefixIndex(c2->name())
);
......@@ -48,13 +54,14 @@ ClassListIterator::ClassListIterator(const ClassList &cllist) :
{
}
void ClassList::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter,const char *header)
void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter,const char *header)
{
if (count()>0)
{
ClassDef *cd=first();
ClassSDict::Iterator sdi(*this);
ClassDef *cd=0;
bool found=FALSE;
while (cd)
for (sdi.toFirst();(cd=sdi.current());++sdi)
{
if (cd->name().find('@')==-1 &&
(filter==0 || *filter==cd->compoundType())
......@@ -124,7 +131,6 @@ void ClassList::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *fi
}
}
}
cd=next();
}
if (found) ol.endMemberList();
}
......
......@@ -22,6 +22,7 @@
#include <qdict.h>
#include "classdef.h"
#include "sortdict.h"
class ClassList : public QList<ClassDef>
{
......@@ -30,8 +31,6 @@ class ClassList : public QList<ClassDef>
~ClassList();
int compareItems(GCI item1,GCI item2);
void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter=0,
const char *header=0);
};
class ClassListIterator : public QListIterator<ClassDef>
......@@ -47,4 +46,14 @@ class ClassDict : public QDict<ClassDef>
~ClassDict() {}
};
class ClassSDict : public SDict<ClassDef>
{
public:
ClassSDict(int size) : SDict<ClassDef>(size) {}
~ClassSDict() {}
int compareItems(GCI item1,GCI item2);
void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter=0,
const char *header=0);
};
#endif
......@@ -31,26 +31,33 @@
Definition::Definition(const char *df,int dl,
const char *name,const char *b,const char *d)
{
defFileName = df;
defLine = dl;
n=name;
brief=b;
doc=d;
sectionDict=0,
startBodyLine=endBodyLine=-1,
bodyDef=0;
sourceRefList=0;
sourceRefDict=0;
m_defFileName = df;
m_defLine = dl;
m_name=name;
m_localName=name;
int i=m_localName.findRev("::");
if (i!=-1)
{
m_localName=m_localName.right(m_localName.length()-i-2);
}
m_brief=b;
m_doc=d;
m_sectionDict=0,
m_startBodyLine=m_endBodyLine=-1,
m_bodyDef=0;
m_sourceRefList=0;
m_sourceRefDict=0;
m_todoId=0;
m_testId=0;
m_bugId=0;
m_outerScope=0;
}
Definition::~Definition()
{
delete sectionDict;
delete sourceRefList;
delete sourceRefDict;
delete m_sectionDict;
delete m_sourceRefList;
delete m_sourceRefDict;
}
......@@ -65,13 +72,13 @@ void Definition::addSectionsToDefinition(QList<QCString> *anchorList)
{
//printf("Add section `%s' to definition `%s'\n",
// si->label.data(),n.data());
if (sectionDict==0)
if (m_sectionDict==0)
{
sectionDict = new SectionDict(17);
m_sectionDict = new SectionDict(17);
}
if (sectionDict->find(*s)==0)
if (m_sectionDict->find(*s)==0)
{
sectionDict->insert(*s,si);
m_sectionDict->insert(*s,si);
}
si->definition = this;
}
......@@ -81,9 +88,9 @@ void Definition::addSectionsToDefinition(QList<QCString> *anchorList)
void Definition::writeDocAnchorsToTagFile()
{
if (!Config_getString("GENERATE_TAGFILE").isEmpty() && sectionDict)
if (!Config_getString("GENERATE_TAGFILE").isEmpty() && m_sectionDict)
{
QDictIterator<SectionInfo> sdi(*sectionDict);
QDictIterator<SectionInfo> sdi(*m_sectionDict);
SectionInfo *si;
for (;(si=sdi.current());++sdi)
{
......@@ -99,14 +106,14 @@ void Definition::writeDocAnchorsToTagFile()
void Definition::setBriefDescription(const char *b)
{
brief=QCString(b).stripWhiteSpace();
int bl=brief.length();
m_brief=QCString(b).stripWhiteSpace();
int bl=m_brief.length();
if (bl>0) // add puntuation if needed
{
switch(brief.at(bl-1))
switch(m_brief.at(bl-1))
{
case '.': case '!': case '?': break;
default: brief+='.'; break;
default: m_brief+='.'; break;
}
}
}
......@@ -219,7 +226,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{
ol.pushGeneratorState();
//printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef);
if (Config_getBool("SOURCE_BROWSER") && startBodyLine!=-1 && bodyDef)
if (Config_getBool("SOURCE_BROWSER") && m_startBodyLine!=-1 && m_bodyDef)
{
//ol.disable(OutputGenerator::RTF);
ol.newParagraph();
......@@ -231,15 +238,15 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
{
QCString lineStr,anchorStr;
lineStr.sprintf("%d",startBodyLine);
anchorStr.sprintf("l%05d",startBodyLine);
lineStr.sprintf("%d",m_startBodyLine);
anchorStr.sprintf("l%05d",m_startBodyLine);
if (lineMarkerPos<fileMarkerPos) // line marker before file marker
{
// write text left from linePos marker
parseText(ol,refText.left(lineMarkerPos));
ol.disableAllBut(OutputGenerator::Html);
// write line link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(),
ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
anchorStr,lineStr);
ol.enableAll();
ol.disable(OutputGenerator::Html);
......@@ -253,12 +260,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
ol.disableAllBut(OutputGenerator::Html);
// write file link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(),
0,bodyDef->name());
ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
0,m_bodyDef->name());
ol.enableAll();
ol.disable(OutputGenerator::Html);
// write normal text (Latex/Man only)
ol.docify(bodyDef->name());
ol.docify(m_bodyDef->name());
ol.enableAll();
// write text right from file marker
......@@ -271,12 +278,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
parseText(ol,refText.left(fileMarkerPos));
ol.disableAllBut(OutputGenerator::Html);
// write file link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(),
0,bodyDef->name());
ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
0,m_bodyDef->name());
ol.enableAll();
ol.disable(OutputGenerator::Html);
// write normal text (Latex/Man only)
ol.docify(bodyDef->name());
ol.docify(m_bodyDef->name());
ol.enableAll();
// write text between markers
......@@ -285,7 +292,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
ol.disableAllBut(OutputGenerator::Html);
// write line link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(),
ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
anchorStr,lineStr);
ol.enableAll();
ol.disable(OutputGenerator::Html);
......@@ -316,12 +323,12 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName)
ol.pushGeneratorState();
//printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(),
// startBodyLine,endBodyLine,bodyDef);
if (Config_getBool("INLINE_SOURCES") && startBodyLine!=-1 &&
endBodyLine>=startBodyLine && bodyDef)
if (Config_getBool("INLINE_SOURCES") && m_startBodyLine!=-1 &&
m_endBodyLine>=m_startBodyLine && m_bodyDef)
{
QCString codeFragment;
int actualStart=startBodyLine,actualEnd=endBodyLine;
if (readCodeFragment(bodyDef->absFilePath(),
int actualStart=m_startBodyLine,actualEnd=m_endBodyLine;
if (readCodeFragment(m_bodyDef->absFilePath(),
actualStart,actualEnd,codeFragment)
)
{
......@@ -330,7 +337,7 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName)
if (definitionType()==TypeMember) setParameterList((MemberDef *)this);
ol.startCodeFragment();
parseCode(ol,scopeName,codeFragment,FALSE,0,
bodyDef,actualStart,actualEnd,TRUE);
m_bodyDef,actualStart,actualEnd,TRUE);
ol.endCodeFragment();
}
}
......@@ -343,13 +350,13 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName)
void Definition::writeSourceRefs(OutputList &ol,const char *scopeName)
{
ol.pushGeneratorState();
if (Config_getBool("SOURCE_BROWSER") && sourceRefList)
if (Config_getBool("SOURCE_BROWSER") && m_sourceRefList)
{
ol.newParagraph();
parseText(ol,theTranslator->trReferencedBy());
ol.docify(" ");
QCString ldefLine=theTranslator->trWriteList(sourceRefList->count());
QCString ldefLine=theTranslator->trWriteList(m_sourceRefList->count());
QRegExp marker("@[0-9]+");
int index=0,newIndex,matchLen;
......@@ -359,7 +366,7 @@ void Definition::writeSourceRefs(OutputList &ol,const char *scopeName)
bool ok;
parseText(ol,ldefLine.mid(index,newIndex-index));
uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
MemberDef *md=sourceRefList->at(entryIndex);
MemberDef *md=m_sourceRefList->at(entryIndex);
if (ok && md)
{
QCString scope=md->getScopeString();
......@@ -402,8 +409,8 @@ void Definition::writeSourceRefs(OutputList &ol,const char *scopeName)
bool Definition::hasDocumentation() const
{
return !doc.isEmpty() || // has detailed docs
!brief.isEmpty() || // has brief description
return !m_doc.isEmpty() || // has detailed docs
!m_brief.isEmpty() || // has brief description
Config_getBool("EXTRACT_ALL"); // extract everything
}
......@@ -419,16 +426,49 @@ void Definition::addSourceReference(MemberDef *md)
name.prepend(scope+"::");
}
if (sourceRefList==0)
if (m_sourceRefList==0)
{
sourceRefDict = new MemberDict(53);
sourceRefList = new MemberList;
m_sourceRefDict = new MemberDict(53);
m_sourceRefList = new MemberList;
}
if (sourceRefDict->find(name)==0)
if (m_sourceRefDict->find(name)==0)
{
sourceRefDict->insert(name,md);
sourceRefList->inSort(md);
m_sourceRefDict->insert(name,md);
m_sourceRefList->inSort(md);
}
}
}
Definition *Definition::findInnerCompound(const char *)
{
return 0;
}
void Definition::addInnerCompound(Definition *)
{
err("Error: Definition::addInnerCompound() called\n");
}
QCString Definition::qualifiedName() const
{
//printf("start Definition::qualifiedName()\n");
if (m_outerScope==0) return m_localName; // TODO: remove this check
QCString qualifiedName;
if (m_outerScope->name()=="<globalScope>")
{
qualifiedName = m_localName.copy();
}
else
{
qualifiedName = m_outerScope->qualifiedName()+"::"+m_localName;
}
//printf("end Definition::qualifiedName()=%s\n",qualifiedName.data());
return qualifiedName;
};
QCString Definition::localName() const
{
return m_localName;
}
......@@ -47,26 +47,28 @@ class Definition
/*! Destroys the definition */
virtual ~Definition();
/*! Returns the name of the definition */
const QCString& name() const { return n; }
const QCString& name() const { return m_name; }
/*! Returns the base name of the output file that contains this
* definition.
*/
QCString qualifiedName() const;
QCString localName() const;
virtual QCString getOutputFileBase() const = 0;
/*! Returns the name of the source listing of this file. */
const QCString getSourceFileBase() const { ASSERT(0); return "NULL"; }
/*! Returns the detailed description of this definition */
const QCString& documentation() const { return doc; }
const QCString& documentation() const { return m_doc; }
/*! Returns the brief description of this definition */
const QCString& briefDescription() const { return brief; }
const QCString& briefDescription() const { return m_brief; }
/*! Sets a new \a name for the definition */
void setName(const char *name) { n=name; }
void setName(const char *name) { m_name=name; }
/*! Sets the documentation of this definition to \a d. */
void setDocumentation(const char *d,bool stripWhiteSpace=TRUE)
{
if (stripWhiteSpace)
doc=((QCString)d).stripWhiteSpace();
m_doc=((QCString)d).stripWhiteSpace();
else
doc=d;
m_doc=d;
}
/*! Sets the brief description of this definition to \a b.
* A dot is added to the sentence if not available.
......@@ -77,9 +79,9 @@ class Definition
virtual bool isLinkableInProject() = 0;
virtual bool isLinkable() = 0;
bool isReference() const { return !ref.isEmpty(); }
void setReference(const char *r) { ref=r; }
QCString getReference() const { return ref; }
bool isReference() const { return !m_ref.isEmpty(); }
void setReference(const char *r) { m_ref=r; }
QCString getReference() const { return m_ref; }
/*! Add the list of anchors that mark the sections that are found in the
* documentation.
......@@ -90,13 +92,13 @@ class Definition
// source references
void setBodySegment(int bls,int ble)
{
startBodyLine=bls;
endBodyLine=ble;
m_startBodyLine=bls;
m_endBodyLine=ble;
}
void setBodyDef(FileDef *fd) { bodyDef=fd; }
int getStartBodyLine() const { return startBodyLine; }
int getEndBodyLine() const { return endBodyLine; }
FileDef *getBodyDef() { return bodyDef; }
void setBodyDef(FileDef *fd) { m_bodyDef=fd; }
int getStartBodyLine() const { return m_startBodyLine; }
int getEndBodyLine() const { return m_endBodyLine; }
FileDef *getBodyDef() { return m_bodyDef; }
void writeSourceDef(OutputList &ol,const char *scopeName);
void writeInlineCode(OutputList &ol,const char *scopeName);
void writeSourceRefs(OutputList &ol,const char *scopeName);
......@@ -113,28 +115,40 @@ class Definition
int bugId() const { return m_bugId; }
/*! returns the file in which this definition was found */
QCString getDefFileName() const { return defFileName; }
QCString getDefFileName() const { return m_defFileName; }
/*! returns the line number at which the definition was found */
int getDefLine() const { return defLine; }
int getDefLine() const { return m_defLine; }
virtual Definition *findInnerCompound(const char *name);
virtual Definition *getOuterScope() { return m_outerScope; }
virtual void addInnerCompound(Definition *d);
virtual void setOuterScope(Definition *d) { m_outerScope = d; }
protected:
int startBodyLine; // line number of the start of the definition
int endBodyLine; // line number of the end of the definition
FileDef *bodyDef; // file definition containing the function body
int m_startBodyLine; // line number of the start of the definition
int m_endBodyLine; // line number of the end of the definition
FileDef *m_bodyDef; // file definition containing the function body
// where the item was found
QCString defFileName;
int defLine;
QCString m_defFileName;
int m_defLine;
/*! The class, namespace in which this class is located
*/
Definition *m_outerScope;
QCString m_name; // name of the definition
QCString m_localName; // local (unqualified) name of the definition
// in the future m_name should become m_localName
private:
QCString n; // name of the definition
QCString brief; // brief description
QCString doc; // detailed description
QCString ref; // reference to external documentation
SectionDict *sectionDict; // dictionary of all sections
MemberList *sourceRefList; // list of entities that refer to this
//QCString m_qualifiedName; // name of the definition
QCString m_brief; // brief description
QCString m_doc; // detailed description
QCString m_ref; // reference to external documentation
SectionDict *m_sectionDict; // dictionary of all sections
MemberList *m_sourceRefList; // list of entities that refer to this
// entity in their definition
MemberDict *sourceRefDict;
MemberDict *m_sourceRefDict;
int m_testId; // id for test list item
int m_todoId; // id for todo list item
int m_bugId; // id for bug list item
......
......@@ -916,7 +916,7 @@ void TreeDiagram::drawConnectors(QTextStream &t,Image *image,
void clearVisitFlags()
{
ClassListIterator cli(Doxygen::classList);
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
......
......@@ -831,6 +831,7 @@ HREF [hH][rR][eE][fF]
I [iI]
IMG [iI][mM][gG]
INPUT [iI][nN][pP][uU][tT]
KBD [kK][bB][dD]
LI [lL][iI]
META [mM][eE][tT][aA]
MULTICOL [mM][uU][lL][tT][iI][cC][oO][lL]
......@@ -2099,6 +2100,8 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
<DocScan>"</"{LI}{ATTR}">"
<DocScan>"<"{TT}{ATTR}">" { outDoc->startTypewriter(); }
<DocScan>"</"{TT}{ATTR}">" { outDoc->endTypewriter(); }
<DocScan>"<"{KBD}{ATTR}">" { outDoc->startTypewriter(); }
<DocScan>"</"{KBD}{ATTR}">" { outDoc->endTypewriter(); }
<DocScan>"<"{EM}{ATTR}">" { outDoc->startEmphasis(); }
<DocScan>"</"{EM}{ATTR}">" { outDoc->endEmphasis(); }
<DocScan>"<"{HR}{ATTR}">" { outDoc->writeRuler(); }
......
......@@ -25,6 +25,7 @@
#include "config.h"
#include "language.h"
#include "scanner.h"
#include "defargs.h"
#include <qdir.h>
#include <qfile.h>
......@@ -175,6 +176,141 @@ static bool isLeaf(ClassDef *cd)
return TRUE;
}
/*! Builds a mapping from formal arguments of class \a tcd to the
* actual arguments stored in templSpec. To properly initialize
* the mapping with the default template values
* ClassDef::initTemplateMapping() is called once for each class graph
* (the ClassDef::visited flag is used for this).
*/
static void setTemplateInstance(QCString templSpec,ClassDef *tcd)
{
//printf("====== setTemplateInstance(templ=%s,class=%s)\n",templSpec.data(),tcd->name().data());
if (!templSpec.isEmpty())
{
//if (!tcd->visited)
//{
// tcd->visited=TRUE;
//}
ArgumentList *tempArgList = new ArgumentList;
stringToArgumentList(templSpec,tempArgList);
ArgumentListIterator ali(*tempArgList);
Argument *arg;
uint count=0;
for (ali.toFirst();(arg=ali.current());++ali,++count)
{
ArgumentList *formalArgList = tcd->templateArguments();
Argument *formalArg=0;
//printf("arg->type=%s count=%d formalArgList=%p\n",
// arg->type.data(),count,formalArgList);
if (formalArgList && formalArgList->count()>count &&
(formalArg=formalArgList->at(count)))
{
if (formalArg->name!=arg->type)
{
tcd->setTemplateArgumentMapping(formalArg->name,arg->type);
//printf("%s->setTemplateInstantation(%s,%s)\n",tcd->name().data(),
// formalArg->name.data(),arg->type.data());
}
}
}
delete tempArgList;
}
}
/*! Substitutes the formal template argument list \a templSpec
* of class \a cd with the actual template arguments.
* The mapping from formal to actual template is assumed to be stored
* in \a cd using setTemplateInstance().
*/
static QCString substituteTemplateSpec(ClassDef *cd,const QCString &templSpec)
{
QCString result;
if (!templSpec.isEmpty())
{
ArgumentList *tempArgList = new ArgumentList;
stringToArgumentList(templSpec,tempArgList);
ArgumentListIterator ali(*tempArgList);
Argument *arg;
bool first=TRUE;
for (ali.toFirst();(arg=ali.current());)
{
if (first) result="<",first=FALSE;
QCString actual = cd->getTemplateArgumentMapping(arg->type);
if (!actual.isEmpty())
{
result+=actual;
}
else
{
result+=arg->type;
}
++ali;
if (ali.current()) result+=","; else result+=">";
}
delete tempArgList;
}
//printf("substituteTemplateSpec(%s,%s)=`%s'\n",cd->name().data(),templSpec.data(),result.data());
return removeRedundantWhiteSpace(result);
}
/*! Determines the actual template instance of template class \a tcd that
* relates to class \a cd. The result is stored in \a tcd.
* \param cd A class
* \param tcd A template base class
* \param templSpec Actual template parameter list to be used for tcd
* \param result resulting instance class
* \param actualArg actual template instance name of the resulting class
*/
static void computeTemplateInstance(
ClassDef *cd,ClassDef *tcd,const QCString templSpec,
ClassDef *&result,QCString &actualArg
)
{
//printf("====== computeTemplateInstance(%s,base=%s,templ=%s)\n",
// cd->name().data(),tcd->name().data(),templSpec.data());
// store the specific instance inside the class
setTemplateInstance(templSpec,tcd);
int tArgNum = tcd->isTemplateBaseClass();
if (tArgNum!=-1)
{
//printf("tArgNum=%d\n",tArgNum);
ArgumentList *formalArgList = cd->templateArguments();
if (formalArgList)
{
//printf("formalArgList=%p\n",formalArgList);
Argument *formalArg=formalArgList->at(tArgNum);
if (formalArg)
{
//printf("formalArg=%s\n",formalArg->name.data());
actualArg = cd->getTemplateArgumentMapping(formalArg->name);
//printf("ActualArg=%s\n",actualArg.data());
int pos=0;
QCString name;
QCString templSpec;
while (extractClassNameFromType(actualArg,pos,name,templSpec))
{
//printf("name=%s templSpec=%s\n",name.data(),templSpec.data());
ClassDef *acd=getResolvedClass(name);
if (acd && !templSpec.isEmpty())
{
// store specific template instance in the class
setTemplateInstance(templSpec,acd);
}
if (acd)
{
result = acd;
actualArg = acd->name()+templSpec;
return;
}
}
}
}
}
actualArg.resize(0);
result = 0;
}
//--------------------------------------------------------------------
class DotNodeList : public QList<DotNode>
......@@ -693,8 +829,8 @@ DotGfxHierarchyTable::DotGfxHierarchyTable()
// build a graph with each class as a node and the inheritance relations
// as edges
initClassHierarchy(&Doxygen::classList);
ClassListIterator cli(Doxygen::classList);
initClassHierarchy(&Doxygen::classSDict);
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd;
for (cli.toLast();(cd=cli.current());--cli)
{
......@@ -784,8 +920,8 @@ int DotClassGraph::m_curNodeNumber;
void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot,
const char *label,int distance,const char *usedName,const char *templSpec,bool base)
{
//printf(":: DoxGfxUsageGraph::addClass(class=%s,parent=%s,prot=%d,label=%s,dist=%d)\n",
// cd->name().data(),n->m_label.data(),prot,label,distance);
//printf("DoxClassGraph::addClass(class=%s,parent=%s,prot=%d,label=%s,dist=%d,usedName=%s,templSpec=%s,base=%d)\n",
// cd->name().data(),n->m_label.data(),prot,label,distance,usedName,templSpec,base);
int edgeStyle = label ? EdgeInfo::Dashed : EdgeInfo::Solid;
QCString className;
if (usedName) // name is a typedef
......@@ -850,11 +986,25 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base)
BaseClassDef *bcd;
for ( ; (bcd=bcli.current()) ; ++bcli )
{
//printf("addClass: base=%s this=%s templ=%s\n",bcd->classDef->name().data(),
// cd->name().data(),bcd->templSpecifiers.data());
QCString templSpec;
if (base) templSpec = bcd->templSpecifiers;
addClass(bcd->classDef,n,bcd->prot,0,distance,bcd->usedName,templSpec,base);
//printf("-------- inheritance relation %s->%s templ=`%s'\n",
// cd->name().data(),bcd->classDef->name().data(),bcd->templSpecifiers.data());
QCString templSpec;
if (base) templSpec = substituteTemplateSpec(
cd,bcd->templSpecifiers);
ClassDef *acd=0;
QCString actualArg;
computeTemplateInstance(cd,bcd->classDef,templSpec,acd,actualArg);
//printf("acd=%p actualArg=%s\n",acd,actualArg.data());
if (acd)
{
addClass(acd,n,bcd->prot,0,distance,actualArg,
templSpec,base);
}
else
{
addClass(bcd->classDef,n,bcd->prot,0,distance,bcd->usedName,
templSpec,base);
}
}
if (m_graphType != Inheritance)
{
......@@ -883,8 +1033,25 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base)
label+=QCString("\\n")+s;
}
}
//printf("Found label=`%s'\n",label.data());
addClass(ucd->classDef,n,EdgeInfo::Black,label,distance,0,ucd->templSpecifiers,base);
QCString actualArg;
ClassDef *acd=0;
//printf("-------- usage relation %s->%s templ=`%s'\n",
// cd->name().data(),ucd->classDef->name().data(),
// ucd->templSpecifiers.data());
QCString templSpec = substituteTemplateSpec(
cd,ucd->templSpecifiers);
computeTemplateInstance(cd,ucd->classDef, templSpec, acd,actualArg);
if (acd)
{
addClass(acd,n,EdgeInfo::Black,label,distance,actualArg,
templSpec,base);
}
else
{
//printf("Found label=`%s'\n",label.data());
addClass(ucd->classDef,n,EdgeInfo::Black,label,distance,0,
templSpec,base);
}
}
}
}
......@@ -906,6 +1073,11 @@ DotClassGraph::DotClassGraph(ClassDef *cd,GraphType t,int maxRecursionDepth)
);
m_usedNodes = new QDict<DotNode>(1009);
m_usedNodes->insert(cd->name(),m_startNode);
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *icd;
for (cli.toFirst();(icd=cli.current());++cli) icd->initTemplateMapping();
//printf("Root node %s\n",cd->name().data());
if (m_recDepth>0)
{
......
This diff is collapsed.
......@@ -40,9 +40,15 @@ class PageInfo;
typedef QList<QCString> StringList;
typedef QDict<FileDef> FileDict;
typedef QDict<QCString> StringDict;
typedef QDict<GroupDef> GroupDict;
class StringDict : public QDict<QCString>
{
public:
StringDict(uint size=17) : QDict<QCString>(size) {}
virtual ~StringDict() {}
};
extern QCString spaces;
/*! \brief This class serves as a namespace for global variables used by doxygen.
......@@ -52,8 +58,8 @@ extern QCString spaces;
class Doxygen
{
public:
static ClassList classList;
static ClassDict classDict;
static ClassSDict classSDict;
static ClassList hiddenClasses;
static PageSDict *exampleSDict;
static PageSDict *pageSDict;
static PageInfo *mainPage;
......@@ -87,6 +93,7 @@ class Doxygen
static QIntDict<QCString> memberDocDict; // dictionary of the member groups heading
static QDict<void> expandAsDefinedDict;
static PackageSDict packageDict;
static NamespaceDef *globalScope;
};
void initDoxygen();
......
......@@ -31,22 +31,33 @@ struct Example
QCString file;
};
class ExampleList : public QList<Example>
//class ExampleList : public QList<Example>
//{
// public:
// ExampleList() : QList<Example>() {}
// ~ExampleList() {}
// int compareItems(GCI item1,GCI item2)
// {
// return stricmp(((Example *)item1)->name,((Example *)item2)->name);
// }
//};
//class ExampleDict : public QDict<Example>
//{
// public:
// ExampleDict(int size=17) : QDict<Example>(size) {}
// ~ExampleDict() {}
//};
class ExampleSDict : public SDict<Example>
{
public:
ExampleList() : QList<Example>() {}
~ExampleList() {}
ExampleSDict(int size=17) : SDict<Example>(size) {}
~ExampleSDict() {}
int compareItems(GCI item1,GCI item2)
{
return stricmp(((Example *)item1)->name,((Example *)item2)->name);
}
};
class ExampleDict : public QDict<Example>
{
public:
ExampleDict(int size=17) : QDict<Example>(size) {}
~ExampleDict() {}
};
#endif
......@@ -44,7 +44,7 @@ FileDef::FileDef(const char *p,const char *nm,const char *lref)
filename=nm;
diskname=nm;
setReference(lref);
classList = new ClassList;
classSDict = new ClassSDict(17);
includeList = new QList<IncludeInfo>;
includeList->setAutoDelete(TRUE);
includeDict = new QDict<IncludeInfo>(61);
......@@ -72,7 +72,7 @@ FileDef::FileDef(const char *p,const char *nm,const char *lref)
/*! destroy the file definition */
FileDef::~FileDef()
{
delete classList;
delete classSDict;
delete includeDict;
delete includeList;
delete namespaceList;
......@@ -298,7 +298,7 @@ void FileDef::writeDocumentation(OutputList &ol)
if (found) ol.endMemberList();
}
classList->writeDeclaration(ol);
classSDict->writeDeclaration(ol);
/* write user defined member groups */
MemberGroupListIterator mgli(*memberGroupList);
......@@ -545,9 +545,9 @@ void FileDef::insertMember(MemberDef *md)
void FileDef::insertClass(ClassDef *cd)
{
if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(cd);
classSDict->inSort(cd->name(),cd);
else
classList->append(cd);
classSDict->append(cd->name(),cd);
}
/*! Adds namespace definition \a nd to the list of all compounds of this file */
......
......@@ -29,8 +29,9 @@
class FileDef;
class FileList;
class ClassList;
class ClassSDict;
class ClassDef;
class ClassList;
class MemberDef;
class OutputList;
class NamespaceDef;
......@@ -168,7 +169,7 @@ class FileDef : public Definition
private:
ClassList *classList;
ClassSDict *classSDict;
QDict<IncludeInfo> *includeDict;
QList<IncludeInfo> *includeList;
QDict<IncludeInfo> *includedByDict;
......
......@@ -36,7 +36,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t) :
Definition(df,dl,na)
{
fileList = new FileList;
classList = new ClassList;
classSDict = new ClassSDict(257);
groupList = new GroupList;
parentGroupList = new GroupList;
namespaceList = new NamespaceList;
......@@ -78,7 +78,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t) :
GroupDef::~GroupDef()
{
delete fileList;
delete classList;
delete classSDict;
delete groupList;
delete parentGroupList;
delete namespaceList;
......@@ -108,12 +108,12 @@ void GroupDef::addFile(const FileDef *def)
fileList->append(def);
}
void GroupDef::addClass(const ClassDef *def)
void GroupDef::addClass(const ClassDef *cd)
{
if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(def);
classSDict->inSort(cd->name(),cd);
else
classList->append(def);
classSDict->append(cd->name(),cd);
}
void GroupDef::addNamespace(const NamespaceDef *def)
......@@ -135,51 +135,9 @@ void GroupDef::addExample(const PageInfo *def)
exampleDict->append(def->name,def);
}
#if 0
void GroupDef::addMemberListToGroup(MemberList *ml,
bool (MemberDef::*func)() const)
{
if (ml==0) return;
MemberListIterator mli(*ml);
MemberDef *md;
for (;(md=mli.current());++mli)
{
int groupId=md->getMemberGroupId();
if ((md->*func)() && groupId!=-1)
{
QCString *pGrpHeader = Doxygen::memberHeaderDict[groupId];
QCString *pDocs = Doxygen::memberDocDict[groupId];
if (pGrpHeader)
{
MemberGroup *mg = memberGroupDict->find(groupId);
if (mg==0)
{
mg = new MemberGroup(groupId,*pGrpHeader,pDocs ? pDocs->data() : 0);
memberGroupDict->insert(groupId,mg);
memberGroupList->append(mg);
}
mg->insertMember(md);
md->setMemberGroup(mg);
}
}
}
}
#endif
void GroupDef::addMembersToMemberGroup()
{
#if 0
addMemberListToGroup(allMemberList,&MemberDef::isDefine);
addMemberListToGroup(allMemberList,&MemberDef::isTypedef);
addMemberListToGroup(allMemberList,&MemberDef::isEnumerate);
addMemberListToGroup(allMemberList,&MemberDef::isEnumValue);
addMemberListToGroup(allMemberList,&MemberDef::isFunction);
addMemberListToGroup(allMemberList,&MemberDef::isSlot);
addMemberListToGroup(allMemberList,&MemberDef::isSignal);
addMemberListToGroup(allMemberList,&MemberDef::isVariable);
#endif
::addMembersToMemberGroup(&decDefineMembers,memberGroupDict,memberGroupList);
::addMembersToMemberGroup(&decProtoMembers,memberGroupDict,memberGroupList);
::addMembersToMemberGroup(&decTypedefMembers,memberGroupDict,memberGroupList);
......@@ -198,7 +156,7 @@ void GroupDef::addMembersToMemberGroup()
}
void GroupDef::insertMember(MemberDef *md)
void GroupDef::insertMember(MemberDef *md,bool docOnly)
{
//printf("GroupDef::insertMember(%s)\n",md->name().data());
MemberNameInfo *mni=0;
......@@ -226,28 +184,28 @@ void GroupDef::insertMember(MemberDef *md)
switch(md->memberType())
{
case MemberDef::Variable:
decVarMembers.append(md);
if (!docOnly) decVarMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS"))
docVarMembers.inSort(md);
else
docVarMembers.append(md);
break;
case MemberDef::Function:
decFuncMembers.append(md);
if (!docOnly) decFuncMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS"))
docFuncMembers.inSort(md);
else
docFuncMembers.append(md);
break;
case MemberDef::Typedef:
decTypedefMembers.append(md);
if (!docOnly) decTypedefMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS"))
docTypedefMembers.inSort(md);
else
docTypedefMembers.append(md);
break;
case MemberDef::Enumeration:
decEnumMembers.append(md);
if (!docOnly) decEnumMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS"))
docEnumMembers.inSort(md);
else
......@@ -256,14 +214,14 @@ void GroupDef::insertMember(MemberDef *md)
case MemberDef::EnumValue:
break;
case MemberDef::Prototype:
decProtoMembers.append(md);
if (!docOnly) decProtoMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS"))
docProtoMembers.inSort(md);
else
docProtoMembers.append(md);
break;
case MemberDef::Define:
decDefineMembers.append(md);
if (!docOnly) decDefineMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS"))
docDefineMembers.inSort(md);
else
......@@ -304,7 +262,7 @@ bool GroupDef::isASubGroup() const
int GroupDef::countMembers() const
{
return fileList->count()+
classList->count()+
classSDict->count()+
namespaceList->count()+
groupList->count()+
allMemberList->count()+
......@@ -332,7 +290,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
OutputList briefOutput(&ol);
if (!briefDescription().isEmpty())
{
parseDoc(briefOutput,defFileName,defLine,name(),0,briefDescription());
parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription());
ol+=briefOutput;
ol.writeString(" \n");
ol.pushGeneratorState();
......@@ -375,7 +333,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,0,0,fd->briefDescription());
parseDoc(ol,m_defFileName,m_defLine,0,0,fd->briefDescription());
ol.endMemberDescription();
ol.newParagraph();
}
......@@ -404,7 +362,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,0,0,nd->briefDescription());
parseDoc(ol,m_defFileName,m_defLine,0,0,nd->briefDescription());
ol.endMemberDescription();
ol.newParagraph();
}
......@@ -432,7 +390,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{
ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,0,0,gd->briefDescription());
parseDoc(ol,m_defFileName,m_defLine,0,0,gd->briefDescription());
ol.endMemberDescription();
ol.newParagraph();
}
......@@ -441,7 +399,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
ol.endMemberList();
}
classList->writeDeclaration(ol);
classSDict->writeDeclaration(ol);
if (allMemberList->count()>0)
{
......@@ -490,7 +448,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
// write documentation
if (!documentation().isEmpty())
{
parseDoc(ol,defFileName,defLine,name(),0,documentation()+"\n");
parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n");
}
}
PageInfo *pi=0;
......@@ -604,6 +562,7 @@ void addMemberToGroups(Entry *root,MemberDef *md)
QCString *s;
for (;(s=sli.current());++sli)
{
//printf("addMemberToGroups(group=%s,member=%s)\n",s->data(),md->name().data());
GroupDef *gd=0;
if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
{
......@@ -612,6 +571,8 @@ void addMemberToGroups(Entry *root,MemberDef *md)
{
gd->insertMember(md);
md->setGroupDef(gd);
ClassDef *cd = md->getClassDefOfAnonymousType();
if (cd) cd->setGroupDefForAllMembers(gd);
}
else if (mgd!=gd)
{
......
......@@ -27,7 +27,7 @@
#include "htmlhelp.h"
class FileList;
class ClassList;
class ClassSDict;
class FileDef;
class ClassDef;
class NamespaceDef;
......@@ -55,7 +55,7 @@ class GroupDef : public Definition
void addParentGroup(const GroupDef *def);
void addPage(PageInfo *def); // pages in this group
void addExample(const PageInfo *def); // examples in this group
void insertMember(MemberDef *def);
void insertMember(MemberDef *def,bool docOnly=FALSE);
void writeDocumentation(OutputList &ol);
int countMembers() const;
bool isLinkableInProject()
......@@ -84,7 +84,7 @@ class GroupDef : public Definition
QCString title; // title of the group
QCString fileName; // base name of the generated file
FileList *fileList; // list of files in the group
ClassList *classList; // list of classes in the group
ClassSDict *classSDict; // list of classes in the group
NamespaceList *namespaceList; // list of namespaces in the group
GroupList *groupList; // list of sub groups.
GroupList *parentGroupList; // list of parent groups.
......
......@@ -469,26 +469,8 @@ void writeClassTree(BaseClassList *cl)
//----------------------------------------------------------------------------
/*! Generates HTML Help tree of classes */
void writeClassTree(ClassList *cl)
void writeClassTreeNode(ClassDef *cd,bool hasHtmlHelp,bool hasFtvHelp,bool &started)
{
HtmlHelp *htmlHelp=0;
FTVHelp *ftvHelp=0;
bool &generateHtml = Config_getBool("GENERATE_HTML") ;
bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP");
bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW");
if (hasHtmlHelp)
{
htmlHelp = HtmlHelp::getInstance();
}
if (hasFtvHelp)
{
ftvHelp = FTVHelp::getInstance();
}
ClassListIterator cli(*cl);
bool started=FALSE;
for ( ; cli.current() ; ++cli)
{
ClassDef *cd=cli.current();
if (cd->isVisibleInHierarchy() && !cd->visited)
{
if (!started)
......@@ -500,11 +482,11 @@ void writeClassTree(ClassList *cl)
{
if (hasHtmlHelp)
{
htmlHelp->addContentsItem(hasChildren,cd->name(),cd->getOutputFileBase());
HtmlHelp::getInstance()->addContentsItem(hasChildren,cd->name(),cd->getOutputFileBase());
}
if (hasFtvHelp)
{
ftvHelp->addContentsItem(hasChildren,cd->getReference(),cd->getOutputFileBase(),0,cd->name());
FTVHelp::getInstance()->addContentsItem(hasChildren,cd->getReference(),cd->getOutputFileBase(),0,cd->name());
}
}
if (hasChildren)
......@@ -513,6 +495,31 @@ void writeClassTree(ClassList *cl)
}
cd->visited=TRUE;
}
}
void writeClassTree(ClassList *cl)
{
bool &generateHtml = Config_getBool("GENERATE_HTML") ;
bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP");
bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW");
ClassListIterator cli(*cl);
bool started=FALSE;
for ( ; cli.current() ; ++cli)
{
writeClassTreeNode(cli.current(),hasHtmlHelp,hasFtvHelp,started);
}
}
void writeClassTree(ClassSDict *d)
{
bool &generateHtml = Config_getBool("GENERATE_HTML") ;
bool hasHtmlHelp = generateHtml && Config_getBool("GENERATE_HTMLHELP");
bool hasFtvHelp = generateHtml && Config_getBool("GENERATE_TREEVIEW");
ClassSDict::Iterator cli(*d);
bool started=FALSE;
for ( ; cli.current() ; ++cli)
{
writeClassTreeNode(cli.current(),hasHtmlHelp,hasFtvHelp,started);
}
}
......@@ -520,7 +527,7 @@ void writeClassTree(ClassList *cl)
void writeClassHierarchy(OutputList &ol)
{
initClassHierarchy(&Doxygen::classList);
initClassHierarchy(&Doxygen::classSDict);
HtmlHelp *htmlHelp=0;
FTVHelp *ftvHelp=0;
......@@ -537,7 +544,7 @@ void writeClassHierarchy(OutputList &ol)
}
bool started=FALSE;
ClassListIterator cli(Doxygen::classList);
ClassSDict::Iterator cli(Doxygen::classSDict);
for (;cli.current(); ++cli)
{
ClassDef *cd=cli.current();
......@@ -546,9 +553,9 @@ void writeClassHierarchy(OutputList &ol)
// hasVisibleRoot(cd->baseClasses()),
// cd->isVisibleInHierarchy()
// );
if (!hasVisibleRoot(cd->baseClasses()))
if (!hasVisibleRoot(cd->baseClasses())) // filter on root classes
{
if (cd->isVisibleInHierarchy())
if (cd->isVisibleInHierarchy()) // should it be visible
{
if (!started)
{
......@@ -560,6 +567,7 @@ void writeClassHierarchy(OutputList &ol)
bool hasChildren = !cd->visited && cd->subClasses()->count()>0;
if (cd->isLinkable())
{
//printf("Writing class %s\n",cd->name().data());
ol.writeIndexItem(cd->getReference(),cd->getOutputFileBase(),cd->displayName());
if (cd->isReference())
{
......@@ -609,9 +617,9 @@ void writeClassHierarchy(OutputList &ol)
// TODO: let this function return the real number of items in the hierarchy.
int countClassHierarchy()
{
initClassHierarchy(&Doxygen::classList);
initClassHierarchy(&Doxygen::classSDict);
int count=0;
ClassListIterator cli(Doxygen::classList);
ClassSDict::Iterator cli(Doxygen::classSDict);
for ( ; cli.current(); ++cli)
{
if (cli.current()->subClasses()->count()>0) count++;
......@@ -1060,7 +1068,7 @@ int countAnnotatedClasses()
{
int count=0;
//ClassDef *cd=Doxygen::classList.first();
ClassListIterator cli(Doxygen::classList);
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
......@@ -1083,7 +1091,7 @@ void writeAnnotatedClassList(OutputList &ol)
ol.startIndexList();
//ClassDef *cd=Doxygen::classList.first();
//while (cd)
ClassListIterator cli(Doxygen::classList);
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd;
for (;(cd=cli.current());++cli)
{
......@@ -1164,7 +1172,7 @@ void writeAlphabeticalClassList(OutputList &ol)
ol.startAlphabeticalIndexList();
// first count the number of headers
ClassListIterator cli(Doxygen::classList);
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd;
char startLetter=0;
int headerItems=0;
......@@ -2167,15 +2175,33 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel)
// write group info
bool hasSubGroups = gd->groupList->count()>0;
bool hasSubPages = gd->pageDict->count()>0;
int numSubItems = 0;
if( Config_getBool("TOC_EXPAND"))
{
numSubItems += gd->docDefineMembers.count();
numSubItems += gd->docTypedefMembers.count();
numSubItems += gd->docEnumMembers.count();
numSubItems += gd->docEnumValMembers.count();
numSubItems += gd->docFuncMembers.count();
numSubItems += gd->docVarMembers.count();
numSubItems += gd->docProtoMembers.count();
numSubItems += gd->namespaceList->count();
numSubItems += gd->classSDict->count();
numSubItems += gd->fileList->count();
numSubItems += gd->exampleDict->count();
}
bool isDir = hasSubGroups || hasSubPages || numSubItems>0;
//printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
if(htmlHelp)
{
htmlHelp->addContentsItem(hasSubGroups || hasSubPages,gd->groupTitle(),gd->getOutputFileBase());
htmlHelp->addContentsItem(isDir,gd->groupTitle(),gd->getOutputFileBase());
htmlHelp->incContentsDepth();
}
if(ftvHelp)
{
ftvHelp->addContentsItem(hasSubGroups || hasSubPages,gd->getReference(),gd->getOutputFileBase(),0,gd->groupTitle());
ftvHelp->addContentsItem(isDir,gd->getReference(),gd->getOutputFileBase(),
0,gd->groupTitle());
ftvHelp->incContentsDepth();
}
......@@ -2324,7 +2350,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel)
}
// write classes
if(gd->classList->count()>0)
if(gd->classSDict->count()>0)
{
if(htmlHelp)
{
......@@ -2339,7 +2365,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel)
ftvHelp->incContentsDepth();
}
writeClassTree(gd->classList);
writeClassTree(gd->classSDict);
if(htmlHelp) htmlHelp->decContentsDepth();
if(ftvHelp) ftvHelp->decContentsDepth();
}
......
......@@ -39,6 +39,7 @@
#include "translator_cn.h"
#include "translator_no.h"
#include "translator_br.h"
#include "translator_dk.h"
#endif
#define L_EQUAL(a) !stricmp(langName,a)
......@@ -132,6 +133,10 @@ bool setTranslator(const char *langName)
{
theTranslator=new TranslatorBrazilian;
}
else if (L_EQUAL("danish"))
{
theTranslator=new TranslatorDanish;
}
#endif
else // use the default language (i.e. english)
{
......
......@@ -536,9 +536,10 @@ void LatexGenerator::startIndexSection(IndexSections is)
break;
case isClassDocumentation:
{
ClassDef *cd=Doxygen::classList.first();
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE;
while (cd && !found)
for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{
if (cd->isLinkableInProject())
{
......@@ -546,7 +547,6 @@ void LatexGenerator::startIndexSection(IndexSections is)
t << "{"; //Compound Documentation}\n";
found=TRUE;
}
cd=Doxygen::classList.next();
}
}
break;
......@@ -703,25 +703,24 @@ void LatexGenerator::endIndexSection(IndexSections is)
break;
case isClassDocumentation:
{
ClassDef *cd=Doxygen::classList.first();
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE;
while (cd && !found)
for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{
if (cd->isLinkableInProject())
{
t << "}\n\\input{" << cd->getOutputFileBase() << "}\n";
found=TRUE;
}
cd=Doxygen::classList.next();
}
while (cd)
for (;(cd=cli.current());++cli)
{
if (cd->isLinkableInProject())
{
if (compactLatex) t << "\\input"; else t << "\\include";
t << "{" << cd->getOutputFileBase() << "}\n";
}
cd=Doxygen::classList.next();
}
}
break;
......
......@@ -20,7 +20,6 @@ HEADERS = bufstr.h \
classdef.h \
classlist.h \
code.h \
config.h \
constexp.h \
cppvalue.h \
debug.h \
......@@ -98,7 +97,6 @@ SOURCES = ce_lex.cpp \
classdef.cpp \
classlist.cpp \
code.cpp \
config.cpp \
cppvalue.cpp \
debug.cpp \
declinfo.cpp \
......@@ -124,7 +122,6 @@ SOURCES = ce_lex.cpp \
language.cpp \
latexgen.cpp \
logos.cpp \
main.cpp \
mangen.cpp \
memberdef.cpp \
membergroup.cpp \
......
......@@ -28,14 +28,31 @@
#include "util.h"
#include "doxygen.h"
static QCString getExtension()
{
QCString ext = Config_getString("MAN_EXTENSION");
if( ext.length() >= 2 &&
ext.data()[0] == '.' &&
isdigit( ext.data()[1] ) )
{
ext = ext.mid(1, 1);
}
else
{
ext = "3";
}
return ext;
}
ManGenerator::ManGenerator() : OutputGenerator()
{
dir=Config_getString("MAN_OUTPUT")+"/man3";
dir=Config_getString("MAN_OUTPUT")+"/man" + getExtension();
firstCol=TRUE;
paragraph=FALSE;
col=0;
upperCase=FALSE;
insideTabbing=FALSE;
inHeader=FALSE;
}
ManGenerator::~ManGenerator()
......@@ -54,21 +71,25 @@ void ManGenerator::append(const OutputGenerator *g)
else
firstCol = ((ManGenerator *)g)->firstCol;
col+=((ManGenerator *)g)->col;
inHeader=((ManGenerator *)g)->inHeader;
paragraph=FALSE;
}
void ManGenerator::init()
{
QDir d(Config_getString("MAN_OUTPUT"));
if (!d.exists() && !d.mkdir(Config_getString("MAN_OUTPUT")))
QCString ext = getExtension();
QCString &manOutput = Config_getString("MAN_OUTPUT");
QDir d(manOutput);
if (!d.exists() && !d.mkdir(manOutput))
{
err("Could not create output directory %s\n",Config_getString("MAN_OUTPUT").data());
err("Could not create output directory %s\n",manOutput.data());
exit(1);
}
d.setPath(Config_getString("MAN_OUTPUT")+"/man3");
if (!d.exists() && !d.mkdir(Config_getString("MAN_OUTPUT")+"/man3"))
d.setPath(manOutput+"/man"+ext);
if (!d.exists() && !d.mkdir(manOutput+"/man"+ext))
{
err("Could not create output directory %s/man3\n",Config_getString("MAN_OUTPUT").data());
err("Could not create output directory %s/man%s\n",manOutput.data(),ext.data());
exit(1);
}
}
......@@ -123,7 +144,8 @@ void ManGenerator::endFile()
void ManGenerator::endTitleHead(const char *,const char *name)
{
t << ".TH \"" << name << "\" 3 \"" << dateToString(FALSE) << "\" \"";
t << ".TH \"" << name << "\" " << getExtension() << " \""
<< dateToString(FALSE) << "\" \"";
if (Config_getString("PROJECT_NAME").isEmpty())
t << "Doxygen";
else
......@@ -134,6 +156,7 @@ void ManGenerator::endTitleHead(const char *,const char *name)
t << ".SH NAME" << endl;
t << name << " \\- ";
firstCol=FALSE;
inHeader=TRUE;
}
void ManGenerator::newParagraph()
......@@ -470,3 +493,42 @@ void ManGenerator::endMemberGroup(bool)
t << "\n.in -1c";
firstCol=FALSE;
}
void ManGenerator::startSection(const char *,const char *,bool sub)
{
if( !inHeader )
{
if( sub )
{
startMemberHeader();
}
else
{
startGroupHeader();
}
}
}
void ManGenerator::endSection(const char *,bool sub)
{
if( !inHeader )
{
if( sub )
{
endMemberHeader();
}
else
{
endGroupHeader();
}
}
else
{
t << "\n";
firstCol=TRUE;
paragraph=FALSE;
inHeader=FALSE;
}
}
......@@ -175,8 +175,8 @@ class ManGenerator : public OutputGenerator
void endParamList() { endDescList(); }
void endDescTitle();
void writeDescItem();
void startSection(const char *,const char *,bool) {}
void endSection(const char *,bool) {}
void startSection(const char *,const char *,bool);
void endSection(const char *,bool);
void writeSectionRef(const char *,const char *,const char *,const char *) {}
void writeSectionRefItem(const char *,const char *,const char *) {}
//void writeSectionRefAnchor(const char *,const char *,const char *) {}
......@@ -231,6 +231,7 @@ class ManGenerator : public OutputGenerator
int col;
bool upperCase;
bool insideTabbing;
bool inHeader;
ManGenerator(const ManGenerator &g);
ManGenerator &operator=(const ManGenerator &g);
......
......@@ -241,8 +241,7 @@ MemberDef::MemberDef(const char *df,int dl,
memDec=0;
group=0;
grpId=-1;
exampleList=0;
exampleDict=0;
exampleSDict=0;
enumFields=0;
enumScope=0;
enumDeclList=0;
......@@ -271,6 +270,7 @@ MemberDef::MemberDef(const char *df,int dl,
indDepth=0;
section=0;
explExt=FALSE;
cachedAnonymousType=0;
maxInitLines=Config_getInt("MAX_INITIALIZER_LINES");
userInitLines=-1;
docEnumValues=FALSE;
......@@ -315,8 +315,7 @@ MemberDef::MemberDef(const char *df,int dl,
MemberDef::~MemberDef()
{
delete redefinedBy;
delete exampleList;
delete exampleDict;
delete exampleSDict;
delete enumFields;
delete argList;
delete tArgList;
......@@ -338,17 +337,15 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr,
const char *file)
{
//printf("%s::addExample(%s,%s,%s)\n",name.data(),anchor,nameStr,file);
if (exampleDict==0) exampleDict = new ExampleDict;
if (exampleList==0) exampleList = new ExampleList;
if (exampleDict->find(nameStr)==0)
if (exampleSDict==0) exampleSDict = new ExampleSDict;
if (exampleSDict->find(nameStr)==0)
{
//printf("Add reference to example %s to member %s\n",nameStr,name.data());
Example *e=new Example;
e->anchor=anchor;
e->name=nameStr;
e->file=file;
exampleDict->insert(nameStr,e);
exampleList->inSort(e);
exampleSDict->inSort(nameStr,e);
return TRUE;
}
return FALSE;
......@@ -356,32 +353,12 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr,
bool MemberDef::hasExamples()
{
if (exampleList==0)
if (exampleSDict==0)
return FALSE;
else
return exampleList->count()>0;
return exampleSDict->count()>0;
}
#if 0
void MemberDef::writeExample(OutputList &ol)
{
Example *e=exampleList->first();
while (e)
{
ol.writeObjectLink(0,e->file,e->anchor,e->name);
e=exampleList->next();
if (e)
{
if (exampleList->at()==(int)exampleList->count()-1)
ol.writeString(" and ");
else
ol.writeString(", ");
}
}
ol.writeString(".");
}
#endif
QCString MemberDef::getOutputFileBase() const
{
if (classDef)
......@@ -396,7 +373,7 @@ QCString MemberDef::getOutputFileBase() const
{
return nspace->getOutputFileBase();
}
warn(defFileName,defLine,
warn(m_defFileName,m_defLine,
"Warning: Internal inconsistency: member %s does not belong to any"
" container!",name().data()
);
......@@ -457,9 +434,19 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *cd,NamespaceDef *nd,
/*! If this member has an anonymous class/struct/union as its type, then
* this method will return the ClassDef that describes this return type.
*/
ClassDef *MemberDef::getClassDefOfAnonymousType(const char *scopeName) const
ClassDef *MemberDef::getClassDefOfAnonymousType()
{
QCString cname=scopeName;
if (cachedAnonymousType) return cachedAnonymousType;
QCString cname;
if (getClassDef()!=0)
{
cname=getClassDef()->name().copy();
}
else if (getNamespaceDef()!=0)
{
cname=getNamespaceDef()->name().copy();
}
QCString ltype(type);
// strip `static' keyword from ltype
if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7);
......@@ -495,6 +482,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType(const char *scopeName) const
annoClassDef=getClass(ts);
}
}
cachedAnonymousType = annoClassDef;
return annoClassDef;
}
......@@ -539,7 +527,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
bool inGroup
)
{
//printf("%s MemberDef::writeDeclaration()\n",name().data());
//printf("%s MemberDef::writeDeclaration() inGroup=%d\n",name().data(),inGroup);
// hide members whose brief section should not be visible
if (!isBriefSectionVisible()) return;
......@@ -598,7 +586,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (hasHtmlHelp) htmlHelp = HtmlHelp::getInstance();
// search for the last anonymous scope in the member type
ClassDef *annoClassDef=getClassDefOfAnonymousType((cd||nd)?cname.data():0);
ClassDef *annoClassDef=getClassDefOfAnonymousType();
// start a new member declaration
ol.startMemberItem((annoClassDef || annMemb || annEnumType) ? 1 : 0);
......@@ -659,7 +647,6 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (annoClassDef) // type is an anonymous compound
{
int ir=i+l;
//printf("class found!\n");
annoClassDef->writeDeclaration(ol,annMemb,inGroup);
ol.startMemberItem(2);
int j;
......@@ -674,10 +661,6 @@ void MemberDef::writeDeclaration(OutputList &ol,
{
ol.docify(";");
}
//else
//{
// ol.docify(varName);
//}
}
else
{
......@@ -724,7 +707,8 @@ void MemberDef::writeDeclaration(OutputList &ol,
// write name
if (!name().isEmpty() && name().at(0)!='@')
{
if (isLinkable())
//printf("Member name=`%s gd=%p md->groupDef=%p inGroup=%d isLinkable()=%d\n",name().data(),gd,getGroupDef(),inGroup,isLinkable());
if (/*d->isLinkable() &&*/ isLinkable())
{
if (annMemb)
{
......@@ -738,8 +722,10 @@ void MemberDef::writeDeclaration(OutputList &ol,
annMemb->annUsed=annUsed=TRUE;
}
else
{
//printf("writeLink %s->%d\n",name.data(),hasDocumentation());
writeLink(ol,cd,nd,fd,gd);
}
}
else // there is a brief member description and brief member
// descriptions are enabled or there is no detailed description.
......@@ -796,7 +782,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC") && !annMemb)
{
ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,cname,name(),briefDescription());
parseDoc(ol,m_defFileName,m_defLine,cname,name(),briefDescription());
if (detailsVisible)
{
ol.pushGeneratorState();
......@@ -850,6 +836,7 @@ bool MemberDef::isDetailedSectionVisible(bool inGroup) const
bool staticFilter = getClassDef()!=0 || !isStatic() || Config_getBool("EXTRACT_STATIC");
// details are not part of a group or this is for a group documentation page
// TODO: FIX THIS!!! This should made such that it is always TRUE.
bool groupFilter = getGroupDef()==0 || inGroup;
// member is part of an anonymous scope that is the type of
......@@ -887,7 +874,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
QCString cname = container->name();
QCString cfname = container->getOutputFileBase();
// get member name
QCString doxyName=name().copy();
// prepend scope if there is any. TODO: make this optional for C only docs
......@@ -1122,14 +1108,14 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
) /* || !annMemb */
)
{
parseDoc(ol,defFileName,defLine,scopeName,name(),briefDescription());
parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),briefDescription());
ol.newParagraph();
}
/* write detailed description */
if (!documentation().isEmpty())
{
parseDoc(ol,defFileName,defLine,scopeName,name(),documentation()+"\n");
parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),documentation()+"\n");
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::RTF);
ol.newParagraph();
......@@ -1161,7 +1147,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.endEmphasis();
ol.endDescTableTitle();
ol.startDescTableData();
parseDoc(ol,defFileName,defLine,scopeName,name(),a->docs);
parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),a->docs);
ol.endDescTableData();
}
}
......@@ -1218,7 +1204,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (!fmd->briefDescription().isEmpty())
{
parseDoc(ol,defFileName,defLine,scopeName,fmd->name(),fmd->briefDescription());
parseDoc(ol,m_defFileName,m_defLine,scopeName,fmd->name(),fmd->briefDescription());
//ol.newParagraph();
}
if (!fmd->briefDescription().isEmpty() &&
......@@ -1228,7 +1214,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
if (!fmd->documentation().isEmpty())
{
parseDoc(ol,defFileName,defLine,scopeName,fmd->name(),fmd->documentation()+"\n");
parseDoc(ol,m_defFileName,m_defLine,scopeName,fmd->name(),fmd->documentation()+"\n");
}
ol.endDescTableData();
}
......@@ -1376,7 +1362,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.endBold();
ol.endDescTitle();
ol.writeDescItem();
writeExample(ol,getExampleList());
writeExample(ol,getExamples());
//ol.endDescItem();
ol.endDescList();
}
......@@ -1412,7 +1398,7 @@ void MemberDef::warnIfUndocumented()
t="file", d=fd;
if (d && d->isLinkable() && !isLinkable() && name().find('@')==-1)
warn_undoc(defFileName,defLine,"Warning: Member %s of %s %s is not documented.",
warn_undoc(m_defFileName,m_defLine,"Warning: Member %s of %s %s is not documented.",
name().data(),t,d->name().data());
}
......@@ -1481,3 +1467,9 @@ QCString MemberDef::anchor() const
if (enumScope) return enumScope->anchor()+anc;
return anc;
}
void MemberDef::setGroupDef(GroupDef *gd)
{
printf("%s MemberDef::setGroupDef(%s)\n",name().data(),gd->name().data());
group=gd;
}
......@@ -31,8 +31,7 @@ class GroupDef;
class FileDef;
class MemberList;
class MemberGroup;
class ExampleList;
class ExampleDict;
class ExampleSDict;
class OutputList;
class GroupDef;
class QTextStream;
......@@ -138,7 +137,7 @@ class MemberDef : public Definition
void setMaxInitLines(int lines) { userInitLines=lines; }
void setMemberClass(ClassDef *cd) { classDef=cd; }
void setSectionList(MemberList *sl) { section=sl; }
void setGroupDef(GroupDef *gd) { group=gd; }
void setGroupDef(GroupDef *gd);
void setExplicitExternal(bool b) { explExt=b; }
void makeRelated() { related=TRUE; }
......@@ -177,8 +176,7 @@ class MemberDef : public Definition
// example related members
bool addExample(const char *anchor,const char *name,const char *file);
bool hasExamples();
ExampleList *getExampleList() const { return exampleList; }
ExampleSDict *getExamples() const { return exampleSDict; }
// prototype related members
void setPrototype(bool p) { proto=p; }
......@@ -217,7 +215,7 @@ class MemberDef : public Definition
QCString getScopeString() const;
ClassDef *getClassDefOfAnonymousType(const char *scopeName) const;
ClassDef *getClassDefOfAnonymousType();
private:
ClassDef *classDef; // member of or related to
......@@ -228,8 +226,9 @@ class MemberDef : public Definition
MemberList *redefinedBy; // the list of members that redefine this one
MemberDef *memDef; // member definition for this declaration
MemberDef *memDec; // member declaration for this definition
ExampleList *exampleList; // a list of all examples using this member
ExampleDict *exampleDict; // a dictionary of all examples for quick access
ExampleSDict *exampleSDict; // a dictionary of all examples for quick access
MemberList *enumFields; // enumeration fields
OutputList *enumDeclList; // stored piece of documentation for enumeration.
NamespaceDef *nspace; // the namespace this member is in.
......@@ -271,6 +270,11 @@ class MemberDef : public Definition
GroupDef *group; // group in which this member is in
bool explExt; // member was explicitly declared external
ClassDef *cachedAnonymousType; // if the member has an anonymous compound
// as its type then this is computed by
// getClassDefOfAnonymousType() and
// cached here.
// disable copying of member defs
MemberDef(const MemberDef &);
......
/******************************************************************************
*
* $Id$
*
*
* Copyright (C) 1997-2001 by Dimitri van Heesch.
*
......
......@@ -20,6 +20,7 @@
#include <qlist.h>
#include "memberdef.h"
#include "sortdict.h"
class MemberName : public QList<MemberDef>
{
......@@ -107,6 +108,19 @@ class MemberNameInfoDict : public QDict<MemberNameInfo>
~MemberNameInfoDict() {}
};
class MemberNameInfoSDict : public SDict<MemberNameInfo>
{
public:
MemberNameInfoSDict(int size) : SDict<MemberNameInfo>(size) {}
~MemberNameInfoSDict() {}
int compareItems(GCI item1,GCI item2)
{ return stricmp(
((MemberNameInfo *)item1)->memberName(),
((MemberNameInfo *)item2)->memberName()
);
}
};
class MemberNameInfoListIterator : public QListIterator<MemberNameInfo>
{
public:
......
......@@ -32,23 +32,22 @@ NamespaceDef::NamespaceDef(const char *df,int dl,
Definition(df,dl,name)
{
fileName=(QCString)"namespace_"+name;
classList = new ClassList;
classDict = new ClassDict(1009);
//memList = new MemberList;
classSDict = new ClassSDict(257);
namespaceSDict = new NamespaceSDict(257);
m_innerCompounds = new SDict<Definition>(257);
usingDirList = 0;
usingDeclList = 0;
setReference(lref);
memberGroupList = new MemberGroupList;
memberGroupList->setAutoDelete(TRUE);
memberGroupDict = new MemberGroupDict(1009);
defFileName = df;
defLine = dl;
}
NamespaceDef::~NamespaceDef()
{
delete classList;
delete classDict;
delete classSDict;
delete namespaceSDict;
delete m_innerCompounds;
delete usingDirList;
delete usingDeclList;
delete memberGroupList;
......@@ -77,13 +76,23 @@ void NamespaceDef::insertUsedFile(const char *f)
void NamespaceDef::insertClass(ClassDef *cd)
{
if (classDict->find(cd->name())==0)
if (classSDict->find(cd->name())==0)
{
if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(cd);
classSDict->inSort(cd->name(),cd);
else
classList->append(cd);
classDict->insert(cd->name(),cd);
classSDict->append(cd->name(),cd);
}
}
void NamespaceDef::insertNamespace(NamespaceDef *nd)
{
if (namespaceSDict->find(nd->name())==0)
{
if (Config_getBool("SORT_MEMBER_DOCS"))
namespaceSDict->inSort(nd->name(),nd);
else
namespaceSDict->append(nd->name(),nd);
}
}
......@@ -219,7 +228,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
OutputList briefOutput(&ol);
if (!briefDescription().isEmpty())
{
parseDoc(briefOutput,defFileName,defLine,name(),0,briefDescription());
parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription());
ol+=briefOutput;
ol.writeString(" \n");
ol.pushGeneratorState();
......@@ -237,7 +246,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
ol.endTextBlock();
ol.startMemberSections();
classList->writeDeclaration(ol);
classSDict->writeDeclaration(ol);
/* write user defined member groups */
MemberGroupListIterator mgli(*memberGroupList);
......@@ -283,7 +292,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
}
if (!documentation().isEmpty())
{
parseDoc(ol,defFileName,defLine,name(),0,documentation()+"\n");
parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n");
ol.newParagraph();
}
ol.endTextBlock();
......@@ -328,7 +337,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
int NamespaceDef::countMembers()
{
allMemberList.countDocMembers();
return allMemberList.numDocMembers()+classList->count();
return allMemberList.numDocMembers()+classSDict->count();
}
void NamespaceDef::addUsingDirective(NamespaceDef *nd)
......@@ -354,3 +363,15 @@ QCString NamespaceDef::getOutputFileBase() const
return convertNameToFile(fileName);
}
Definition *NamespaceDef::findInnerCompound(const char *name)
{
if (name==0) return 0;
return m_innerCompounds->find(name);
}
void NamespaceDef::addInnerCompound(Definition *d)
{
m_innerCompounds->append(d->localName(),d);
}
......@@ -21,17 +21,19 @@
#include "qtbc.h"
#include <qstrlist.h>
#include <qdict.h>
#include "sortdict.h"
#include "definition.h"
#include "memberlist.h"
class ClassDef;
class OutputList;
class ClassList;
class ClassDict;
class OutputList;
class ClassSDict;
class MemberDef;
class NamespaceList;
class MemberGroupDict;
class MemberGroupList;
class NamespaceSDict;
class NamespaceDef : public Definition
{
......@@ -43,8 +45,11 @@ class NamespaceDef : public Definition
QCString getOutputFileBase() const;
void insertUsedFile(const char *fname);
void writeDocumentation(OutputList &ol);
void insertClass(ClassDef *cd);
void insertNamespace(NamespaceDef *nd);
void insertMember(MemberDef *md);
void computeAnchors();
int countMembers();
void addUsingDirective(NamespaceDef *nd);
......@@ -65,6 +70,9 @@ class NamespaceDef : public Definition
}
void addMembersToMemberGroup();
void distributeMemberGroupDocumentation();
virtual Definition *findInnerCompound(const char *name);
void addInnerCompound(Definition *d);
//protected:
// void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
......@@ -73,10 +81,15 @@ class NamespaceDef : public Definition
//QCString reference;
QCString fileName;
QStrList files;
ClassList *classList;
ClassDict *classDict;
/*! Classes inside this namespace */
ClassSDict *classSDict;
/*! Namespaces inside this namespace */
NamespaceSDict *namespaceSDict;
NamespaceList *usingDirList;
ClassList *usingDeclList;
SDict<Definition> *m_innerCompounds;
MemberList allMemberList;
......@@ -128,4 +141,19 @@ class NamespaceDict : public QDict<NamespaceDef>
~NamespaceDict() {}
};
class NamespaceSDict : public SDict<NamespaceDef>
{
public:
NamespaceSDict(int size) : SDict<NamespaceDef>(size) {}
~NamespaceSDict() {}
int compareItems(GCI item1,GCI item2)
{
return stricmp(((NamespaceDef *)item1)->name(),
((NamespaceDef *)item2)->name()
);
}
};
#endif
......@@ -30,22 +30,22 @@
PackageDef::PackageDef(const char *df,int dl,const char *na,const char *ref) :
Definition(df,dl,na)
{
classList = new ClassList;
classSDict = new ClassSDict(17);
packageFileName = (QCString)"package_"+na;
setReference(ref);
}
PackageDef::~PackageDef()
{
delete classList;
delete classSDict;
}
void PackageDef::addClass(const ClassDef *def)
void PackageDef::addClass(const ClassDef *cd)
{
if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(def);
classSDict->inSort(cd->name(),cd);
else
classList->append(def);
classSDict->append(cd->name(),cd);
}
void PackageDef::writeDocumentation(OutputList &ol)
......@@ -61,7 +61,7 @@ void PackageDef::writeDocumentation(OutputList &ol)
OutputList briefOutput(&ol);
if (!briefDescription().isEmpty())
{
parseDoc(briefOutput,defFileName,defLine,name(),0,briefDescription());
parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription());
ol+=briefOutput;
ol.writeString(" \n");
ol.pushGeneratorState();
......@@ -81,9 +81,9 @@ void PackageDef::writeDocumentation(OutputList &ol)
ol.startMemberSections();
ClassDef::CompoundType ct;
ct=ClassDef::Interface;
classList->writeDeclaration(ol,&ct,theTranslator->trInterfaces());
classSDict->writeDeclaration(ol,&ct,theTranslator->trInterfaces());
ct=ClassDef::Class;
classList->writeDeclaration(ol,&ct,theTranslator->trClasses());
classSDict->writeDeclaration(ol,&ct,theTranslator->trClasses());
ol.endMemberSections();
if (!Config_getString("GENERATE_TAGFILE").isEmpty())
......@@ -114,7 +114,7 @@ void PackageDef::writeDocumentation(OutputList &ol)
// write documentation
if (!documentation().isEmpty())
{
parseDoc(ol,defFileName,defLine,name(),0,documentation()+"\n");
parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n");
}
}
......
......@@ -24,7 +24,7 @@
#include "definition.h"
#include "sortdict.h"
class ClassList;
class ClassSDict;
class ClassDef;
class PackageList;
class OutputList;
......@@ -49,7 +49,7 @@ class PackageDef : public Definition
private:
QCString packageFileName; // base name of the generated file
ClassList *classList; // list of classes in the package
ClassSDict *classSDict; // list of classes in the package
};
class PackageSDict : public SDict<PackageDef>
......
......@@ -991,16 +991,16 @@ void RTFGenerator::startIndexSection(IndexSections is)
case isClassDocumentation:
{
//Compound Documentation
ClassDef *cd=Doxygen::classList.first();
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE;
while (cd && !found)
for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{
if (cd->isLinkableInProject())
{
beginRTFChapter();
found=TRUE;
}
cd=Doxygen::classList.next();
}
}
break;
......@@ -1220,11 +1220,12 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isClassDocumentation:
{
ClassDef *cd=Doxygen::classList.first();
ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE;
t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}"<< endl;
while (cd && !found)
for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{
if (cd->isLinkableInProject())
{
......@@ -1234,9 +1235,8 @@ void RTFGenerator::endIndexSection(IndexSections is)
t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
found=TRUE;
}
cd=Doxygen::classList.next();
}
while (cd)
for (;(cd=cli.current());++cli)
{
if (cd->isLinkableInProject())
{
......@@ -1246,7 +1246,6 @@ void RTFGenerator::endIndexSection(IndexSections is)
t << cd->getOutputFileBase();
t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
}
cd=Doxygen::classList.next();
}
}
break;
......
......@@ -1557,11 +1557,10 @@ TITLE [tT][iI][tT][lL][eE]
{
current->endBodyLine = yyLineNr;
QCString &cn = current->name;
//QCString rn = stripAnnonymousScope(current_root->name);
QCString rn = current_root->name.copy();
//printf("cn=`%s' rn=`%s'\n",cn.data(),rn.data());
if (!cn.isEmpty() && !rn.isEmpty() &&
(current_root->section & Entry::SCOPE_MASK))
(current_root->section & Entry::SCOPE_MASK))
{
cn.prepend(rn+"::");
}
......@@ -2294,7 +2293,7 @@ TITLE [tT][iI][tT][lL][eE]
current->argList->clear();
BEGIN( FindMembers ) ;
}
<CompoundName>{SCOPENAME}{BN}*/"<" {
<CompoundName>{SCOPENAME}{BN}*/"<" {
sharpCount = 0;
current->name = yytext ;
lineCount();
......@@ -2317,7 +2316,7 @@ TITLE [tT][iI][tT][lL][eE]
<ClassTemplSpec>. {
current->name += yytext;
}
<CompoundName>{SCOPENAME} {
<CompoundName>{SCOPENAME} {
current->name = yytext ;
lineCount();
BEGIN( ClassVar );
......@@ -3855,14 +3854,14 @@ static void parseCompounds(Entry *rt)
memberGroupId = NOGROUP;
// rebuild compound's group context
QCString *s = ce->groups->first();
if (s)
{
lastDefGroup=*s;
startGroup();
}
current->mGrpId = memberGroupId = ce->mGrpId;
//QCString *s = ce->groups->first();
//if (s)
//{
// lastDefGroup=*s;
// startGroup();
//}
//current->mGrpId = memberGroupId = ce->mGrpId;
scanYYlex() ;
delete current; current=0;
......
......@@ -79,6 +79,14 @@ class SDict
m_list->append(d);
m_dict->insert(key,d);
}
/*! Sorts the members of the dictionary. First appending a number
* of members and then sorting them is faster (O(NlogN) than using
* inSort() for each member (O(N^2)).
*/
void sort()
{
m_list->sort();
}
/*! Inserts a compound into the dictionary in a sorted way.
* \param key The unique key to use to quicky find the item later on.
* \param d The compound to add.
......@@ -103,6 +111,12 @@ class SDict
{
return m_dict->find(key);
}
/*! Returns the item at position \a i in the sorted dictionary */
T *at(uint i)
{
return m_list->at(i);
}
/*! Function that is used to compare two items when sorting.
* Overload this to properly sort items.
* \sa inSort()
......@@ -152,6 +166,13 @@ class SDict
{
return m_li->toFirst();
}
/*! Set the iterator to the last element in the list.
* \return The first compound, or zero if the list was empty.
*/
T *toLast() const
{
return m_li->toLast();
}
/*! Returns the current compound */
T *current() const
{
......@@ -165,6 +186,14 @@ class SDict
{
return m_li->operator++();
}
/*! Moves the iterator to the previous element.
* \return the new "current" element, or zero if the iterator was
* already pointing at the first element.
*/
T *operator--()
{
return m_li->operator--();
}
private:
QListIterator<T> *m_li;
......
......@@ -120,9 +120,9 @@
// Windows version. The version which does not call the function is
// probably slightly faster.
#include "translator_adapter.h"
#include "translator.h"
class TranslatorCzech : public TranslatorAdapterBase
class TranslatorCzech : public Translator
{
private:
/*! The Decode() inline assumes the source written in the
......
This diff is collapsed.
......@@ -1176,13 +1176,37 @@ class TranslatorEnglish : public Translator
// new since 1.2.6
//////////////////////////////////////////////////////////////////////////
/*! Used as ansicpg for RTF file */
/*! Used as ansicpg for RTF file
*
* The following table shows the correlation of Charset name, Charset Value and
* Codepage number:
* Charset Name Charset Value(hex) Codepage number
* ------------------------------------------------------
* DEFAULT_CHARSET 1 (x01)
* SYMBOL_CHARSET 2 (x02)
* OEM_CHARSET 255 (xFF)
* ANSI_CHARSET 0 (x00) 1252
* RUSSIAN_CHARSET 204 (xCC) 1251
* EE_CHARSET 238 (xEE) 1250
* GREEK_CHARSET 161 (xA1) 1253
* TURKISH_CHARSET 162 (xA2) 1254
* BALTIC_CHARSET 186 (xBA) 1257
* HEBREW_CHARSET 177 (xB1) 1255
* ARABIC _CHARSET 178 (xB2) 1256
* SHIFTJIS_CHARSET 128 (x80) 932
* HANGEUL_CHARSET 129 (x81) 949
* GB2313_CHARSET 134 (x86) 936
* CHINESEBIG5_CHARSET 136 (x88) 950
*
*/
virtual QCString trRTFansicp()
{
return "1252";
}
/*! Used as ansicpg for RTF fcharset */
/*! Used as ansicpg for RTF fcharset
* \see trRTFansicp() for a table of possible values.
*/
virtual QCString trRTFCharSet()
{
return "0";
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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