Commit 0921be25 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-20010517

parent 76e77e75
...@@ -3,4 +3,4 @@ DOXYGEN Version 1.2.7 ...@@ -3,4 +3,4 @@ DOXYGEN Version 1.2.7
Please read the installation section of the manual for instructions. 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 ...@@ -7,4 +7,4 @@ The latest version of doxygen can be obtained at
Enjoy, Enjoy,
Dimitri van Heesch (30 April 2001) Dimitri van Heesch (17 May 2001)
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# Documents produced by Doxygen are derivative works derived from the # Documents produced by Doxygen are derivative works derived from the
# input used in their production; they are not affected by this license. # input used in their production; they are not affected by this license.
all: FORCE all: language.doc FORCE
DOXYGEN_DOCDIR=$(DOXYDOCS); \ DOXYGEN_DOCDIR=$(DOXYDOCS); \
export DOXYGEN_DOCDIR; \ export DOXYGEN_DOCDIR; \
VERSION=$(VERSION) ; \ VERSION=$(VERSION) ; \
...@@ -26,6 +26,9 @@ all: FORCE ...@@ -26,6 +26,9 @@ all: FORCE
@cp doxygen_logo.eps ../latex @cp doxygen_logo.eps ../latex
clean: clean:
rm -rf ../html ../latex rm -rf ../html ../latex language.doc
language.doc: language.tpl FORCE
$(PERL) translator.pl
FORCE: FORCE:
...@@ -86,6 +86,7 @@ documentation: ...@@ -86,6 +86,7 @@ documentation:
<li> \refitem cmdingroup \ingroup <li> \refitem cmdingroup \ingroup
<li> \refitem cmdinternal \internal <li> \refitem cmdinternal \internal
<li> \refitem cmdinvariant \invariant <li> \refitem cmdinvariant \invariant
<li> \refitem cmdinterface \interface
<li> \refitem cmdlatexonly \latexonly <li> \refitem cmdlatexonly \latexonly
<li> \refitem cmdli \li <li> \refitem cmdli \li
<li> \refitem cmdline \line <li> \refitem cmdline \line
...@@ -349,6 +350,16 @@ Doxygen. Unrecognized commands are treated as normal text. ...@@ -349,6 +350,16 @@ Doxygen. Unrecognized commands are treated as normal text.
\sa section \ref cmddefgroup "\\defgroup". \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> <hr>
\subsection cmdinternal \internal \subsection cmdinternal \internal
......
...@@ -83,6 +83,8 @@ documentation. Note that all attributes of a HTML tag are ignored ...@@ -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 </TR> Does not generate any output.
<li>\c <TT> Starts a piece of text displayed in a typewriter font. <li>\c <TT> Starts a piece of text displayed in a typewriter font.
<li>\c </TT> Ends a \c <TT> section. <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> Starts an unnumbered item list.
<li>\c </UL> Ends 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. <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. # 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) ...@@ -35,9 +35,15 @@ int ClassList::compareItems(GCI item1, GCI item2)
{ {
ClassDef *c1=(ClassDef *)item1; ClassDef *c1=(ClassDef *)item1;
ClassDef *c2=(ClassDef *)item2; ClassDef *c2=(ClassDef *)item2;
//int prefixLength = Config::instance()->get("").length(); return stricmp(c1->name().data()+getPrefixIndex(c1->name()),
//int i1 = c1->name().left(prefixLength)==Config::instance()->get("") ? prefixLength : 0; c2->name().data()+getPrefixIndex(c2->name())
//int i2 = c2->name().left(prefixLength)==Config::instance()->get("") ? prefixLength : 0; );
}
int ClassSDict::compareItems(GCI item1, GCI item2)
{
ClassDef *c1=(ClassDef *)item1;
ClassDef *c2=(ClassDef *)item2;
return stricmp(c1->name().data()+getPrefixIndex(c1->name()), return stricmp(c1->name().data()+getPrefixIndex(c1->name()),
c2->name().data()+getPrefixIndex(c2->name()) c2->name().data()+getPrefixIndex(c2->name())
); );
...@@ -48,13 +54,14 @@ ClassListIterator::ClassListIterator(const ClassList &cllist) : ...@@ -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) if (count()>0)
{ {
ClassDef *cd=first(); ClassSDict::Iterator sdi(*this);
ClassDef *cd=0;
bool found=FALSE; bool found=FALSE;
while (cd) for (sdi.toFirst();(cd=sdi.current());++sdi)
{ {
if (cd->name().find('@')==-1 && if (cd->name().find('@')==-1 &&
(filter==0 || *filter==cd->compoundType()) (filter==0 || *filter==cd->compoundType())
...@@ -124,7 +131,6 @@ void ClassList::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *fi ...@@ -124,7 +131,6 @@ void ClassList::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *fi
} }
} }
} }
cd=next();
} }
if (found) ol.endMemberList(); if (found) ol.endMemberList();
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <qdict.h> #include <qdict.h>
#include "classdef.h" #include "classdef.h"
#include "sortdict.h"
class ClassList : public QList<ClassDef> class ClassList : public QList<ClassDef>
{ {
...@@ -30,8 +31,6 @@ class ClassList : public QList<ClassDef> ...@@ -30,8 +31,6 @@ class ClassList : public QList<ClassDef>
~ClassList(); ~ClassList();
int compareItems(GCI item1,GCI item2); int compareItems(GCI item1,GCI item2);
void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter=0,
const char *header=0);
}; };
class ClassListIterator : public QListIterator<ClassDef> class ClassListIterator : public QListIterator<ClassDef>
...@@ -47,4 +46,14 @@ class ClassDict : public QDict<ClassDef> ...@@ -47,4 +46,14 @@ class ClassDict : public QDict<ClassDef>
~ClassDict() {} ~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 #endif
...@@ -31,26 +31,33 @@ ...@@ -31,26 +31,33 @@
Definition::Definition(const char *df,int dl, Definition::Definition(const char *df,int dl,
const char *name,const char *b,const char *d) const char *name,const char *b,const char *d)
{ {
defFileName = df; m_defFileName = df;
defLine = dl; m_defLine = dl;
n=name; m_name=name;
brief=b; m_localName=name;
doc=d; int i=m_localName.findRev("::");
sectionDict=0, if (i!=-1)
startBodyLine=endBodyLine=-1, {
bodyDef=0; m_localName=m_localName.right(m_localName.length()-i-2);
sourceRefList=0; }
sourceRefDict=0; 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_todoId=0;
m_testId=0; m_testId=0;
m_bugId=0; m_bugId=0;
m_outerScope=0;
} }
Definition::~Definition() Definition::~Definition()
{ {
delete sectionDict; delete m_sectionDict;
delete sourceRefList; delete m_sourceRefList;
delete sourceRefDict; delete m_sourceRefDict;
} }
...@@ -65,13 +72,13 @@ void Definition::addSectionsToDefinition(QList<QCString> *anchorList) ...@@ -65,13 +72,13 @@ void Definition::addSectionsToDefinition(QList<QCString> *anchorList)
{ {
//printf("Add section `%s' to definition `%s'\n", //printf("Add section `%s' to definition `%s'\n",
// si->label.data(),n.data()); // 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; si->definition = this;
} }
...@@ -81,9 +88,9 @@ void Definition::addSectionsToDefinition(QList<QCString> *anchorList) ...@@ -81,9 +88,9 @@ void Definition::addSectionsToDefinition(QList<QCString> *anchorList)
void Definition::writeDocAnchorsToTagFile() 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; SectionInfo *si;
for (;(si=sdi.current());++sdi) for (;(si=sdi.current());++sdi)
{ {
...@@ -99,14 +106,14 @@ void Definition::writeDocAnchorsToTagFile() ...@@ -99,14 +106,14 @@ void Definition::writeDocAnchorsToTagFile()
void Definition::setBriefDescription(const char *b) void Definition::setBriefDescription(const char *b)
{ {
brief=QCString(b).stripWhiteSpace(); m_brief=QCString(b).stripWhiteSpace();
int bl=brief.length(); int bl=m_brief.length();
if (bl>0) // add puntuation if needed if (bl>0) // add puntuation if needed
{ {
switch(brief.at(bl-1)) switch(m_brief.at(bl-1))
{ {
case '.': case '!': case '?': break; case '.': case '!': case '?': break;
default: brief+='.'; break; default: m_brief+='.'; break;
} }
} }
} }
...@@ -219,7 +226,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ...@@ -219,7 +226,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
{ {
ol.pushGeneratorState(); ol.pushGeneratorState();
//printf("Definition::writeSourceRef %d %p\n",bodyLine,bodyDef); //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.disable(OutputGenerator::RTF);
ol.newParagraph(); ol.newParagraph();
...@@ -231,15 +238,15 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ...@@ -231,15 +238,15 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this. if (lineMarkerPos!=-1 && fileMarkerPos!=-1) // should always pass this.
{ {
QCString lineStr,anchorStr; QCString lineStr,anchorStr;
lineStr.sprintf("%d",startBodyLine); lineStr.sprintf("%d",m_startBodyLine);
anchorStr.sprintf("l%05d",startBodyLine); anchorStr.sprintf("l%05d",m_startBodyLine);
if (lineMarkerPos<fileMarkerPos) // line marker before file marker if (lineMarkerPos<fileMarkerPos) // line marker before file marker
{ {
// write text left from linePos marker // write text left from linePos marker
parseText(ol,refText.left(lineMarkerPos)); parseText(ol,refText.left(lineMarkerPos));
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
// write line link (HTML only) // write line link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(), ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
anchorStr,lineStr); anchorStr,lineStr);
ol.enableAll(); ol.enableAll();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
...@@ -253,12 +260,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ...@@ -253,12 +260,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
// write file link (HTML only) // write file link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(), ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
0,bodyDef->name()); 0,m_bodyDef->name());
ol.enableAll(); ol.enableAll();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
// write normal text (Latex/Man only) // write normal text (Latex/Man only)
ol.docify(bodyDef->name()); ol.docify(m_bodyDef->name());
ol.enableAll(); ol.enableAll();
// write text right from file marker // write text right from file marker
...@@ -271,12 +278,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ...@@ -271,12 +278,12 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
parseText(ol,refText.left(fileMarkerPos)); parseText(ol,refText.left(fileMarkerPos));
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
// write file link (HTML only) // write file link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(), ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
0,bodyDef->name()); 0,m_bodyDef->name());
ol.enableAll(); ol.enableAll();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
// write normal text (Latex/Man only) // write normal text (Latex/Man only)
ol.docify(bodyDef->name()); ol.docify(m_bodyDef->name());
ol.enableAll(); ol.enableAll();
// write text between markers // write text between markers
...@@ -285,7 +292,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *) ...@@ -285,7 +292,7 @@ void Definition::writeSourceDef(OutputList &ol,const char *)
ol.disableAllBut(OutputGenerator::Html); ol.disableAllBut(OutputGenerator::Html);
// write line link (HTML only) // write line link (HTML only)
ol.writeObjectLink(0,bodyDef->getSourceFileBase(), ol.writeObjectLink(0,m_bodyDef->getSourceFileBase(),
anchorStr,lineStr); anchorStr,lineStr);
ol.enableAll(); ol.enableAll();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
...@@ -316,12 +323,12 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) ...@@ -316,12 +323,12 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName)
ol.pushGeneratorState(); ol.pushGeneratorState();
//printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(), //printf("Source Fragment %s: %d-%d bodyDef=%p\n",name().data(),
// startBodyLine,endBodyLine,bodyDef); // startBodyLine,endBodyLine,bodyDef);
if (Config_getBool("INLINE_SOURCES") && startBodyLine!=-1 && if (Config_getBool("INLINE_SOURCES") && m_startBodyLine!=-1 &&
endBodyLine>=startBodyLine && bodyDef) m_endBodyLine>=m_startBodyLine && m_bodyDef)
{ {
QCString codeFragment; QCString codeFragment;
int actualStart=startBodyLine,actualEnd=endBodyLine; int actualStart=m_startBodyLine,actualEnd=m_endBodyLine;
if (readCodeFragment(bodyDef->absFilePath(), if (readCodeFragment(m_bodyDef->absFilePath(),
actualStart,actualEnd,codeFragment) actualStart,actualEnd,codeFragment)
) )
{ {
...@@ -330,7 +337,7 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) ...@@ -330,7 +337,7 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName)
if (definitionType()==TypeMember) setParameterList((MemberDef *)this); if (definitionType()==TypeMember) setParameterList((MemberDef *)this);
ol.startCodeFragment(); ol.startCodeFragment();
parseCode(ol,scopeName,codeFragment,FALSE,0, parseCode(ol,scopeName,codeFragment,FALSE,0,
bodyDef,actualStart,actualEnd,TRUE); m_bodyDef,actualStart,actualEnd,TRUE);
ol.endCodeFragment(); ol.endCodeFragment();
} }
} }
...@@ -343,13 +350,13 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName) ...@@ -343,13 +350,13 @@ void Definition::writeInlineCode(OutputList &ol,const char *scopeName)
void Definition::writeSourceRefs(OutputList &ol,const char *scopeName) void Definition::writeSourceRefs(OutputList &ol,const char *scopeName)
{ {
ol.pushGeneratorState(); ol.pushGeneratorState();
if (Config_getBool("SOURCE_BROWSER") && sourceRefList) if (Config_getBool("SOURCE_BROWSER") && m_sourceRefList)
{ {
ol.newParagraph(); ol.newParagraph();
parseText(ol,theTranslator->trReferencedBy()); parseText(ol,theTranslator->trReferencedBy());
ol.docify(" "); ol.docify(" ");
QCString ldefLine=theTranslator->trWriteList(sourceRefList->count()); QCString ldefLine=theTranslator->trWriteList(m_sourceRefList->count());
QRegExp marker("@[0-9]+"); QRegExp marker("@[0-9]+");
int index=0,newIndex,matchLen; int index=0,newIndex,matchLen;
...@@ -359,7 +366,7 @@ void Definition::writeSourceRefs(OutputList &ol,const char *scopeName) ...@@ -359,7 +366,7 @@ void Definition::writeSourceRefs(OutputList &ol,const char *scopeName)
bool ok; bool ok;
parseText(ol,ldefLine.mid(index,newIndex-index)); parseText(ol,ldefLine.mid(index,newIndex-index));
uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok); uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
MemberDef *md=sourceRefList->at(entryIndex); MemberDef *md=m_sourceRefList->at(entryIndex);
if (ok && md) if (ok && md)
{ {
QCString scope=md->getScopeString(); QCString scope=md->getScopeString();
...@@ -402,8 +409,8 @@ void Definition::writeSourceRefs(OutputList &ol,const char *scopeName) ...@@ -402,8 +409,8 @@ void Definition::writeSourceRefs(OutputList &ol,const char *scopeName)
bool Definition::hasDocumentation() const bool Definition::hasDocumentation() const
{ {
return !doc.isEmpty() || // has detailed docs return !m_doc.isEmpty() || // has detailed docs
!brief.isEmpty() || // has brief description !m_brief.isEmpty() || // has brief description
Config_getBool("EXTRACT_ALL"); // extract everything Config_getBool("EXTRACT_ALL"); // extract everything
} }
...@@ -419,16 +426,49 @@ void Definition::addSourceReference(MemberDef *md) ...@@ -419,16 +426,49 @@ void Definition::addSourceReference(MemberDef *md)
name.prepend(scope+"::"); name.prepend(scope+"::");
} }
if (sourceRefList==0) if (m_sourceRefList==0)
{ {
sourceRefDict = new MemberDict(53); m_sourceRefDict = new MemberDict(53);
sourceRefList = new MemberList; m_sourceRefList = new MemberList;
} }
if (sourceRefDict->find(name)==0) if (m_sourceRefDict->find(name)==0)
{ {
sourceRefDict->insert(name,md); m_sourceRefDict->insert(name,md);
sourceRefList->inSort(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 ...@@ -47,26 +47,28 @@ class Definition
/*! Destroys the definition */ /*! Destroys the definition */
virtual ~Definition(); virtual ~Definition();
/*! Returns the name of the 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 /*! Returns the base name of the output file that contains this
* definition. * definition.
*/ */
QCString qualifiedName() const;
QCString localName() const;
virtual QCString getOutputFileBase() const = 0; virtual QCString getOutputFileBase() const = 0;
/*! Returns the name of the source listing of this file. */ /*! Returns the name of the source listing of this file. */
const QCString getSourceFileBase() const { ASSERT(0); return "NULL"; } const QCString getSourceFileBase() const { ASSERT(0); return "NULL"; }
/*! Returns the detailed description of this definition */ /*! 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 */ /*! 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 */ /*! 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. */ /*! Sets the documentation of this definition to \a d. */
void setDocumentation(const char *d,bool stripWhiteSpace=TRUE) void setDocumentation(const char *d,bool stripWhiteSpace=TRUE)
{ {
if (stripWhiteSpace) if (stripWhiteSpace)
doc=((QCString)d).stripWhiteSpace(); m_doc=((QCString)d).stripWhiteSpace();
else else
doc=d; m_doc=d;
} }
/*! Sets the brief description of this definition to \a b. /*! Sets the brief description of this definition to \a b.
* A dot is added to the sentence if not available. * A dot is added to the sentence if not available.
...@@ -77,9 +79,9 @@ class Definition ...@@ -77,9 +79,9 @@ class Definition
virtual bool isLinkableInProject() = 0; virtual bool isLinkableInProject() = 0;
virtual bool isLinkable() = 0; virtual bool isLinkable() = 0;
bool isReference() const { return !ref.isEmpty(); } bool isReference() const { return !m_ref.isEmpty(); }
void setReference(const char *r) { ref=r; } void setReference(const char *r) { m_ref=r; }
QCString getReference() const { return ref; } QCString getReference() const { return m_ref; }
/*! Add the list of anchors that mark the sections that are found in the /*! Add the list of anchors that mark the sections that are found in the
* documentation. * documentation.
...@@ -90,13 +92,13 @@ class Definition ...@@ -90,13 +92,13 @@ class Definition
// source references // source references
void setBodySegment(int bls,int ble) void setBodySegment(int bls,int ble)
{ {
startBodyLine=bls; m_startBodyLine=bls;
endBodyLine=ble; m_endBodyLine=ble;
} }
void setBodyDef(FileDef *fd) { bodyDef=fd; } void setBodyDef(FileDef *fd) { m_bodyDef=fd; }
int getStartBodyLine() const { return startBodyLine; } int getStartBodyLine() const { return m_startBodyLine; }
int getEndBodyLine() const { return endBodyLine; } int getEndBodyLine() const { return m_endBodyLine; }
FileDef *getBodyDef() { return bodyDef; } FileDef *getBodyDef() { return m_bodyDef; }
void writeSourceDef(OutputList &ol,const char *scopeName); void writeSourceDef(OutputList &ol,const char *scopeName);
void writeInlineCode(OutputList &ol,const char *scopeName); void writeInlineCode(OutputList &ol,const char *scopeName);
void writeSourceRefs(OutputList &ol,const char *scopeName); void writeSourceRefs(OutputList &ol,const char *scopeName);
...@@ -113,28 +115,40 @@ class Definition ...@@ -113,28 +115,40 @@ class Definition
int bugId() const { return m_bugId; } int bugId() const { return m_bugId; }
/*! returns the file in which this definition was found */ /*! 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 */ /*! 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: protected:
int startBodyLine; // line number of the start of the definition int m_startBodyLine; // line number of the start of the definition
int endBodyLine; // line number of the end of the definition int m_endBodyLine; // line number of the end of the definition
FileDef *bodyDef; // file definition containing the function body FileDef *m_bodyDef; // file definition containing the function body
// where the item was found // where the item was found
QCString defFileName; QCString m_defFileName;
int defLine; 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: private:
QCString n; // name of the definition //QCString m_qualifiedName; // name of the definition
QCString brief; // brief description QCString m_brief; // brief description
QCString doc; // detailed description QCString m_doc; // detailed description
QCString ref; // reference to external documentation QCString m_ref; // reference to external documentation
SectionDict *sectionDict; // dictionary of all sections SectionDict *m_sectionDict; // dictionary of all sections
MemberList *sourceRefList; // list of entities that refer to this MemberList *m_sourceRefList; // list of entities that refer to this
// entity in their definition // entity in their definition
MemberDict *sourceRefDict; MemberDict *m_sourceRefDict;
int m_testId; // id for test list item int m_testId; // id for test list item
int m_todoId; // id for todo list item int m_todoId; // id for todo list item
int m_bugId; // id for bug list item int m_bugId; // id for bug list item
......
...@@ -916,7 +916,7 @@ void TreeDiagram::drawConnectors(QTextStream &t,Image *image, ...@@ -916,7 +916,7 @@ void TreeDiagram::drawConnectors(QTextStream &t,Image *image,
void clearVisitFlags() void clearVisitFlags()
{ {
ClassListIterator cli(Doxygen::classList); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd; ClassDef *cd;
for (;(cd=cli.current());++cli) for (;(cd=cli.current());++cli)
{ {
......
...@@ -831,6 +831,7 @@ HREF [hH][rR][eE][fF] ...@@ -831,6 +831,7 @@ HREF [hH][rR][eE][fF]
I [iI] I [iI]
IMG [iI][mM][gG] IMG [iI][mM][gG]
INPUT [iI][nN][pP][uU][tT] INPUT [iI][nN][pP][uU][tT]
KBD [kK][bB][dD]
LI [lL][iI] LI [lL][iI]
META [mM][eE][tT][aA] META [mM][eE][tT][aA]
MULTICOL [mM][uU][lL][tT][iI][cC][oO][lL] MULTICOL [mM][uU][lL][tT][iI][cC][oO][lL]
...@@ -2099,6 +2100,8 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG}) ...@@ -2099,6 +2100,8 @@ OPMASK ({B}*{OPNORM}({OPARG}?))|({OPCAST}{OPARG})
<DocScan>"</"{LI}{ATTR}">" <DocScan>"</"{LI}{ATTR}">"
<DocScan>"<"{TT}{ATTR}">" { outDoc->startTypewriter(); } <DocScan>"<"{TT}{ATTR}">" { outDoc->startTypewriter(); }
<DocScan>"</"{TT}{ATTR}">" { outDoc->endTypewriter(); } <DocScan>"</"{TT}{ATTR}">" { outDoc->endTypewriter(); }
<DocScan>"<"{KBD}{ATTR}">" { outDoc->startTypewriter(); }
<DocScan>"</"{KBD}{ATTR}">" { outDoc->endTypewriter(); }
<DocScan>"<"{EM}{ATTR}">" { outDoc->startEmphasis(); } <DocScan>"<"{EM}{ATTR}">" { outDoc->startEmphasis(); }
<DocScan>"</"{EM}{ATTR}">" { outDoc->endEmphasis(); } <DocScan>"</"{EM}{ATTR}">" { outDoc->endEmphasis(); }
<DocScan>"<"{HR}{ATTR}">" { outDoc->writeRuler(); } <DocScan>"<"{HR}{ATTR}">" { outDoc->writeRuler(); }
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include "config.h" #include "config.h"
#include "language.h" #include "language.h"
#include "scanner.h" #include "scanner.h"
#include "defargs.h"
#include <qdir.h> #include <qdir.h>
#include <qfile.h> #include <qfile.h>
...@@ -175,6 +176,141 @@ static bool isLeaf(ClassDef *cd) ...@@ -175,6 +176,141 @@ static bool isLeaf(ClassDef *cd)
return TRUE; 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> class DotNodeList : public QList<DotNode>
...@@ -693,8 +829,8 @@ DotGfxHierarchyTable::DotGfxHierarchyTable() ...@@ -693,8 +829,8 @@ DotGfxHierarchyTable::DotGfxHierarchyTable()
// build a graph with each class as a node and the inheritance relations // build a graph with each class as a node and the inheritance relations
// as edges // as edges
initClassHierarchy(&Doxygen::classList); initClassHierarchy(&Doxygen::classSDict);
ClassListIterator cli(Doxygen::classList); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd; ClassDef *cd;
for (cli.toLast();(cd=cli.current());--cli) for (cli.toLast();(cd=cli.current());--cli)
{ {
...@@ -784,8 +920,8 @@ int DotClassGraph::m_curNodeNumber; ...@@ -784,8 +920,8 @@ int DotClassGraph::m_curNodeNumber;
void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot, void DotClassGraph::addClass(ClassDef *cd,DotNode *n,int prot,
const char *label,int distance,const char *usedName,const char *templSpec,bool base) 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", //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); // cd->name().data(),n->m_label.data(),prot,label,distance,usedName,templSpec,base);
int edgeStyle = label ? EdgeInfo::Dashed : EdgeInfo::Solid; int edgeStyle = label ? EdgeInfo::Dashed : EdgeInfo::Solid;
QCString className; QCString className;
if (usedName) // name is a typedef if (usedName) // name is a typedef
...@@ -850,11 +986,25 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base) ...@@ -850,11 +986,25 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base)
BaseClassDef *bcd; BaseClassDef *bcd;
for ( ; (bcd=bcli.current()) ; ++bcli ) for ( ; (bcd=bcli.current()) ; ++bcli )
{ {
//printf("addClass: base=%s this=%s templ=%s\n",bcd->classDef->name().data(), //printf("-------- inheritance relation %s->%s templ=`%s'\n",
// cd->name().data(),bcd->templSpecifiers.data()); // cd->name().data(),bcd->classDef->name().data(),bcd->templSpecifiers.data());
QCString templSpec; QCString templSpec;
if (base) templSpec = bcd->templSpecifiers; if (base) templSpec = substituteTemplateSpec(
addClass(bcd->classDef,n,bcd->prot,0,distance,bcd->usedName,templSpec,base); 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) if (m_graphType != Inheritance)
{ {
...@@ -883,8 +1033,25 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base) ...@@ -883,8 +1033,25 @@ void DotClassGraph::buildGraph(ClassDef *cd,DotNode *n,int distance,bool base)
label+=QCString("\\n")+s; label+=QCString("\\n")+s;
} }
} }
//printf("Found label=`%s'\n",label.data()); QCString actualArg;
addClass(ucd->classDef,n,EdgeInfo::Black,label,distance,0,ucd->templSpecifiers,base); 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) ...@@ -906,6 +1073,11 @@ DotClassGraph::DotClassGraph(ClassDef *cd,GraphType t,int maxRecursionDepth)
); );
m_usedNodes = new QDict<DotNode>(1009); m_usedNodes = new QDict<DotNode>(1009);
m_usedNodes->insert(cd->name(),m_startNode); 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()); //printf("Root node %s\n",cd->name().data());
if (m_recDepth>0) if (m_recDepth>0)
{ {
......
This diff is collapsed.
...@@ -40,9 +40,15 @@ class PageInfo; ...@@ -40,9 +40,15 @@ class PageInfo;
typedef QList<QCString> StringList; typedef QList<QCString> StringList;
typedef QDict<FileDef> FileDict; typedef QDict<FileDef> FileDict;
typedef QDict<QCString> StringDict;
typedef QDict<GroupDef> GroupDict; typedef QDict<GroupDef> GroupDict;
class StringDict : public QDict<QCString>
{
public:
StringDict(uint size=17) : QDict<QCString>(size) {}
virtual ~StringDict() {}
};
extern QCString spaces; extern QCString spaces;
/*! \brief This class serves as a namespace for global variables used by doxygen. /*! \brief This class serves as a namespace for global variables used by doxygen.
...@@ -52,8 +58,8 @@ extern QCString spaces; ...@@ -52,8 +58,8 @@ extern QCString spaces;
class Doxygen class Doxygen
{ {
public: public:
static ClassList classList; static ClassSDict classSDict;
static ClassDict classDict; static ClassList hiddenClasses;
static PageSDict *exampleSDict; static PageSDict *exampleSDict;
static PageSDict *pageSDict; static PageSDict *pageSDict;
static PageInfo *mainPage; static PageInfo *mainPage;
...@@ -87,6 +93,7 @@ class Doxygen ...@@ -87,6 +93,7 @@ class Doxygen
static QIntDict<QCString> memberDocDict; // dictionary of the member groups heading static QIntDict<QCString> memberDocDict; // dictionary of the member groups heading
static QDict<void> expandAsDefinedDict; static QDict<void> expandAsDefinedDict;
static PackageSDict packageDict; static PackageSDict packageDict;
static NamespaceDef *globalScope;
}; };
void initDoxygen(); void initDoxygen();
......
...@@ -31,22 +31,33 @@ struct Example ...@@ -31,22 +31,33 @@ struct Example
QCString file; 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: public:
ExampleList() : QList<Example>() {} ExampleSDict(int size=17) : SDict<Example>(size) {}
~ExampleList() {} ~ExampleSDict() {}
int compareItems(GCI item1,GCI item2) int compareItems(GCI item1,GCI item2)
{ {
return stricmp(((Example *)item1)->name,((Example *)item2)->name); return stricmp(((Example *)item1)->name,((Example *)item2)->name);
} }
}; };
class ExampleDict : public QDict<Example>
{
public:
ExampleDict(int size=17) : QDict<Example>(size) {}
~ExampleDict() {}
};
#endif #endif
...@@ -44,7 +44,7 @@ FileDef::FileDef(const char *p,const char *nm,const char *lref) ...@@ -44,7 +44,7 @@ FileDef::FileDef(const char *p,const char *nm,const char *lref)
filename=nm; filename=nm;
diskname=nm; diskname=nm;
setReference(lref); setReference(lref);
classList = new ClassList; classSDict = new ClassSDict(17);
includeList = new QList<IncludeInfo>; includeList = new QList<IncludeInfo>;
includeList->setAutoDelete(TRUE); includeList->setAutoDelete(TRUE);
includeDict = new QDict<IncludeInfo>(61); includeDict = new QDict<IncludeInfo>(61);
...@@ -72,7 +72,7 @@ FileDef::FileDef(const char *p,const char *nm,const char *lref) ...@@ -72,7 +72,7 @@ FileDef::FileDef(const char *p,const char *nm,const char *lref)
/*! destroy the file definition */ /*! destroy the file definition */
FileDef::~FileDef() FileDef::~FileDef()
{ {
delete classList; delete classSDict;
delete includeDict; delete includeDict;
delete includeList; delete includeList;
delete namespaceList; delete namespaceList;
...@@ -298,7 +298,7 @@ void FileDef::writeDocumentation(OutputList &ol) ...@@ -298,7 +298,7 @@ void FileDef::writeDocumentation(OutputList &ol)
if (found) ol.endMemberList(); if (found) ol.endMemberList();
} }
classList->writeDeclaration(ol); classSDict->writeDeclaration(ol);
/* write user defined member groups */ /* write user defined member groups */
MemberGroupListIterator mgli(*memberGroupList); MemberGroupListIterator mgli(*memberGroupList);
...@@ -545,9 +545,9 @@ void FileDef::insertMember(MemberDef *md) ...@@ -545,9 +545,9 @@ void FileDef::insertMember(MemberDef *md)
void FileDef::insertClass(ClassDef *cd) void FileDef::insertClass(ClassDef *cd)
{ {
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(cd); classSDict->inSort(cd->name(),cd);
else else
classList->append(cd); classSDict->append(cd->name(),cd);
} }
/*! Adds namespace definition \a nd to the list of all compounds of this file */ /*! Adds namespace definition \a nd to the list of all compounds of this file */
......
...@@ -29,8 +29,9 @@ ...@@ -29,8 +29,9 @@
class FileDef; class FileDef;
class FileList; class FileList;
class ClassList; class ClassSDict;
class ClassDef; class ClassDef;
class ClassList;
class MemberDef; class MemberDef;
class OutputList; class OutputList;
class NamespaceDef; class NamespaceDef;
...@@ -168,7 +169,7 @@ class FileDef : public Definition ...@@ -168,7 +169,7 @@ class FileDef : public Definition
private: private:
ClassList *classList; ClassSDict *classSDict;
QDict<IncludeInfo> *includeDict; QDict<IncludeInfo> *includeDict;
QList<IncludeInfo> *includeList; QList<IncludeInfo> *includeList;
QDict<IncludeInfo> *includedByDict; QDict<IncludeInfo> *includedByDict;
......
...@@ -36,7 +36,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t) : ...@@ -36,7 +36,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t) :
Definition(df,dl,na) Definition(df,dl,na)
{ {
fileList = new FileList; fileList = new FileList;
classList = new ClassList; classSDict = new ClassSDict(257);
groupList = new GroupList; groupList = new GroupList;
parentGroupList = new GroupList; parentGroupList = new GroupList;
namespaceList = new NamespaceList; namespaceList = new NamespaceList;
...@@ -78,7 +78,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t) : ...@@ -78,7 +78,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t) :
GroupDef::~GroupDef() GroupDef::~GroupDef()
{ {
delete fileList; delete fileList;
delete classList; delete classSDict;
delete groupList; delete groupList;
delete parentGroupList; delete parentGroupList;
delete namespaceList; delete namespaceList;
...@@ -108,12 +108,12 @@ void GroupDef::addFile(const FileDef *def) ...@@ -108,12 +108,12 @@ void GroupDef::addFile(const FileDef *def)
fileList->append(def); fileList->append(def);
} }
void GroupDef::addClass(const ClassDef *def) void GroupDef::addClass(const ClassDef *cd)
{ {
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(def); classSDict->inSort(cd->name(),cd);
else else
classList->append(def); classSDict->append(cd->name(),cd);
} }
void GroupDef::addNamespace(const NamespaceDef *def) void GroupDef::addNamespace(const NamespaceDef *def)
...@@ -135,51 +135,9 @@ void GroupDef::addExample(const PageInfo *def) ...@@ -135,51 +135,9 @@ void GroupDef::addExample(const PageInfo *def)
exampleDict->append(def->name,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() 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(&decDefineMembers,memberGroupDict,memberGroupList);
::addMembersToMemberGroup(&decProtoMembers,memberGroupDict,memberGroupList); ::addMembersToMemberGroup(&decProtoMembers,memberGroupDict,memberGroupList);
::addMembersToMemberGroup(&decTypedefMembers,memberGroupDict,memberGroupList); ::addMembersToMemberGroup(&decTypedefMembers,memberGroupDict,memberGroupList);
...@@ -198,7 +156,7 @@ void GroupDef::addMembersToMemberGroup() ...@@ -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()); //printf("GroupDef::insertMember(%s)\n",md->name().data());
MemberNameInfo *mni=0; MemberNameInfo *mni=0;
...@@ -226,28 +184,28 @@ void GroupDef::insertMember(MemberDef *md) ...@@ -226,28 +184,28 @@ void GroupDef::insertMember(MemberDef *md)
switch(md->memberType()) switch(md->memberType())
{ {
case MemberDef::Variable: case MemberDef::Variable:
decVarMembers.append(md); if (!docOnly) decVarMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
docVarMembers.inSort(md); docVarMembers.inSort(md);
else else
docVarMembers.append(md); docVarMembers.append(md);
break; break;
case MemberDef::Function: case MemberDef::Function:
decFuncMembers.append(md); if (!docOnly) decFuncMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
docFuncMembers.inSort(md); docFuncMembers.inSort(md);
else else
docFuncMembers.append(md); docFuncMembers.append(md);
break; break;
case MemberDef::Typedef: case MemberDef::Typedef:
decTypedefMembers.append(md); if (!docOnly) decTypedefMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
docTypedefMembers.inSort(md); docTypedefMembers.inSort(md);
else else
docTypedefMembers.append(md); docTypedefMembers.append(md);
break; break;
case MemberDef::Enumeration: case MemberDef::Enumeration:
decEnumMembers.append(md); if (!docOnly) decEnumMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
docEnumMembers.inSort(md); docEnumMembers.inSort(md);
else else
...@@ -256,14 +214,14 @@ void GroupDef::insertMember(MemberDef *md) ...@@ -256,14 +214,14 @@ void GroupDef::insertMember(MemberDef *md)
case MemberDef::EnumValue: case MemberDef::EnumValue:
break; break;
case MemberDef::Prototype: case MemberDef::Prototype:
decProtoMembers.append(md); if (!docOnly) decProtoMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
docProtoMembers.inSort(md); docProtoMembers.inSort(md);
else else
docProtoMembers.append(md); docProtoMembers.append(md);
break; break;
case MemberDef::Define: case MemberDef::Define:
decDefineMembers.append(md); if (!docOnly) decDefineMembers.append(md);
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
docDefineMembers.inSort(md); docDefineMembers.inSort(md);
else else
...@@ -304,7 +262,7 @@ bool GroupDef::isASubGroup() const ...@@ -304,7 +262,7 @@ bool GroupDef::isASubGroup() const
int GroupDef::countMembers() const int GroupDef::countMembers() const
{ {
return fileList->count()+ return fileList->count()+
classList->count()+ classSDict->count()+
namespaceList->count()+ namespaceList->count()+
groupList->count()+ groupList->count()+
allMemberList->count()+ allMemberList->count()+
...@@ -332,7 +290,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ...@@ -332,7 +290,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
OutputList briefOutput(&ol); OutputList briefOutput(&ol);
if (!briefDescription().isEmpty()) if (!briefDescription().isEmpty())
{ {
parseDoc(briefOutput,defFileName,defLine,name(),0,briefDescription()); parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription());
ol+=briefOutput; ol+=briefOutput;
ol.writeString(" \n"); ol.writeString(" \n");
ol.pushGeneratorState(); ol.pushGeneratorState();
...@@ -375,7 +333,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ...@@ -375,7 +333,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{ {
ol.startMemberDescription(); ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,0,0,fd->briefDescription()); parseDoc(ol,m_defFileName,m_defLine,0,0,fd->briefDescription());
ol.endMemberDescription(); ol.endMemberDescription();
ol.newParagraph(); ol.newParagraph();
} }
...@@ -404,7 +362,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ...@@ -404,7 +362,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) if (!nd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{ {
ol.startMemberDescription(); ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,0,0,nd->briefDescription()); parseDoc(ol,m_defFileName,m_defLine,0,0,nd->briefDescription());
ol.endMemberDescription(); ol.endMemberDescription();
ol.newParagraph(); ol.newParagraph();
} }
...@@ -432,7 +390,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ...@@ -432,7 +390,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) if (!gd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{ {
ol.startMemberDescription(); ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,0,0,gd->briefDescription()); parseDoc(ol,m_defFileName,m_defLine,0,0,gd->briefDescription());
ol.endMemberDescription(); ol.endMemberDescription();
ol.newParagraph(); ol.newParagraph();
} }
...@@ -441,7 +399,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ...@@ -441,7 +399,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
ol.endMemberList(); ol.endMemberList();
} }
classList->writeDeclaration(ol); classSDict->writeDeclaration(ol);
if (allMemberList->count()>0) if (allMemberList->count()>0)
{ {
...@@ -490,7 +448,7 @@ void GroupDef::writeDocumentation(OutputList &ol) ...@@ -490,7 +448,7 @@ void GroupDef::writeDocumentation(OutputList &ol)
// write documentation // write documentation
if (!documentation().isEmpty()) if (!documentation().isEmpty())
{ {
parseDoc(ol,defFileName,defLine,name(),0,documentation()+"\n"); parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n");
} }
} }
PageInfo *pi=0; PageInfo *pi=0;
...@@ -604,6 +562,7 @@ void addMemberToGroups(Entry *root,MemberDef *md) ...@@ -604,6 +562,7 @@ void addMemberToGroups(Entry *root,MemberDef *md)
QCString *s; QCString *s;
for (;(s=sli.current());++sli) for (;(s=sli.current());++sli)
{ {
//printf("addMemberToGroups(group=%s,member=%s)\n",s->data(),md->name().data());
GroupDef *gd=0; GroupDef *gd=0;
if (!s->isEmpty() && (gd=Doxygen::groupDict[*s])) if (!s->isEmpty() && (gd=Doxygen::groupDict[*s]))
{ {
...@@ -612,6 +571,8 @@ void addMemberToGroups(Entry *root,MemberDef *md) ...@@ -612,6 +571,8 @@ void addMemberToGroups(Entry *root,MemberDef *md)
{ {
gd->insertMember(md); gd->insertMember(md);
md->setGroupDef(gd); md->setGroupDef(gd);
ClassDef *cd = md->getClassDefOfAnonymousType();
if (cd) cd->setGroupDefForAllMembers(gd);
} }
else if (mgd!=gd) else if (mgd!=gd)
{ {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "htmlhelp.h" #include "htmlhelp.h"
class FileList; class FileList;
class ClassList; class ClassSDict;
class FileDef; class FileDef;
class ClassDef; class ClassDef;
class NamespaceDef; class NamespaceDef;
...@@ -55,7 +55,7 @@ class GroupDef : public Definition ...@@ -55,7 +55,7 @@ class GroupDef : public Definition
void addParentGroup(const GroupDef *def); void addParentGroup(const GroupDef *def);
void addPage(PageInfo *def); // pages in this group void addPage(PageInfo *def); // pages in this group
void addExample(const PageInfo *def); // examples 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); void writeDocumentation(OutputList &ol);
int countMembers() const; int countMembers() const;
bool isLinkableInProject() bool isLinkableInProject()
...@@ -84,7 +84,7 @@ class GroupDef : public Definition ...@@ -84,7 +84,7 @@ class GroupDef : public Definition
QCString title; // title of the group QCString title; // title of the group
QCString fileName; // base name of the generated file QCString fileName; // base name of the generated file
FileList *fileList; // list of files in the group 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 NamespaceList *namespaceList; // list of namespaces in the group
GroupList *groupList; // list of sub groups. GroupList *groupList; // list of sub groups.
GroupList *parentGroupList; // list of parent groups. GroupList *parentGroupList; // list of parent groups.
......
...@@ -469,26 +469,8 @@ void writeClassTree(BaseClassList *cl) ...@@ -469,26 +469,8 @@ void writeClassTree(BaseClassList *cl)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
/*! Generates HTML Help tree of classes */ /*! 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 (cd->isVisibleInHierarchy() && !cd->visited)
{ {
if (!started) if (!started)
...@@ -500,11 +482,11 @@ void writeClassTree(ClassList *cl) ...@@ -500,11 +482,11 @@ void writeClassTree(ClassList *cl)
{ {
if (hasHtmlHelp) if (hasHtmlHelp)
{ {
htmlHelp->addContentsItem(hasChildren,cd->name(),cd->getOutputFileBase()); HtmlHelp::getInstance()->addContentsItem(hasChildren,cd->name(),cd->getOutputFileBase());
} }
if (hasFtvHelp) 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) if (hasChildren)
...@@ -513,6 +495,31 @@ void writeClassTree(ClassList *cl) ...@@ -513,6 +495,31 @@ void writeClassTree(ClassList *cl)
} }
cd->visited=TRUE; 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) ...@@ -520,7 +527,7 @@ void writeClassTree(ClassList *cl)
void writeClassHierarchy(OutputList &ol) void writeClassHierarchy(OutputList &ol)
{ {
initClassHierarchy(&Doxygen::classList); initClassHierarchy(&Doxygen::classSDict);
HtmlHelp *htmlHelp=0; HtmlHelp *htmlHelp=0;
FTVHelp *ftvHelp=0; FTVHelp *ftvHelp=0;
...@@ -537,7 +544,7 @@ void writeClassHierarchy(OutputList &ol) ...@@ -537,7 +544,7 @@ void writeClassHierarchy(OutputList &ol)
} }
bool started=FALSE; bool started=FALSE;
ClassListIterator cli(Doxygen::classList); ClassSDict::Iterator cli(Doxygen::classSDict);
for (;cli.current(); ++cli) for (;cli.current(); ++cli)
{ {
ClassDef *cd=cli.current(); ClassDef *cd=cli.current();
...@@ -546,9 +553,9 @@ void writeClassHierarchy(OutputList &ol) ...@@ -546,9 +553,9 @@ void writeClassHierarchy(OutputList &ol)
// hasVisibleRoot(cd->baseClasses()), // hasVisibleRoot(cd->baseClasses()),
// cd->isVisibleInHierarchy() // 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) if (!started)
{ {
...@@ -560,6 +567,7 @@ void writeClassHierarchy(OutputList &ol) ...@@ -560,6 +567,7 @@ void writeClassHierarchy(OutputList &ol)
bool hasChildren = !cd->visited && cd->subClasses()->count()>0; bool hasChildren = !cd->visited && cd->subClasses()->count()>0;
if (cd->isLinkable()) if (cd->isLinkable())
{ {
//printf("Writing class %s\n",cd->name().data());
ol.writeIndexItem(cd->getReference(),cd->getOutputFileBase(),cd->displayName()); ol.writeIndexItem(cd->getReference(),cd->getOutputFileBase(),cd->displayName());
if (cd->isReference()) if (cd->isReference())
{ {
...@@ -609,9 +617,9 @@ void writeClassHierarchy(OutputList &ol) ...@@ -609,9 +617,9 @@ void writeClassHierarchy(OutputList &ol)
// TODO: let this function return the real number of items in the hierarchy. // TODO: let this function return the real number of items in the hierarchy.
int countClassHierarchy() int countClassHierarchy()
{ {
initClassHierarchy(&Doxygen::classList); initClassHierarchy(&Doxygen::classSDict);
int count=0; int count=0;
ClassListIterator cli(Doxygen::classList); ClassSDict::Iterator cli(Doxygen::classSDict);
for ( ; cli.current(); ++cli) for ( ; cli.current(); ++cli)
{ {
if (cli.current()->subClasses()->count()>0) count++; if (cli.current()->subClasses()->count()>0) count++;
...@@ -1060,7 +1068,7 @@ int countAnnotatedClasses() ...@@ -1060,7 +1068,7 @@ int countAnnotatedClasses()
{ {
int count=0; int count=0;
//ClassDef *cd=Doxygen::classList.first(); //ClassDef *cd=Doxygen::classList.first();
ClassListIterator cli(Doxygen::classList); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd; ClassDef *cd;
for (;(cd=cli.current());++cli) for (;(cd=cli.current());++cli)
{ {
...@@ -1083,7 +1091,7 @@ void writeAnnotatedClassList(OutputList &ol) ...@@ -1083,7 +1091,7 @@ void writeAnnotatedClassList(OutputList &ol)
ol.startIndexList(); ol.startIndexList();
//ClassDef *cd=Doxygen::classList.first(); //ClassDef *cd=Doxygen::classList.first();
//while (cd) //while (cd)
ClassListIterator cli(Doxygen::classList); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd; ClassDef *cd;
for (;(cd=cli.current());++cli) for (;(cd=cli.current());++cli)
{ {
...@@ -1164,7 +1172,7 @@ void writeAlphabeticalClassList(OutputList &ol) ...@@ -1164,7 +1172,7 @@ void writeAlphabeticalClassList(OutputList &ol)
ol.startAlphabeticalIndexList(); ol.startAlphabeticalIndexList();
// first count the number of headers // first count the number of headers
ClassListIterator cli(Doxygen::classList); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd; ClassDef *cd;
char startLetter=0; char startLetter=0;
int headerItems=0; int headerItems=0;
...@@ -2167,15 +2175,33 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel) ...@@ -2167,15 +2175,33 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel)
// write group info // write group info
bool hasSubGroups = gd->groupList->count()>0; bool hasSubGroups = gd->groupList->count()>0;
bool hasSubPages = gd->pageDict->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()); //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
if(htmlHelp) if(htmlHelp)
{ {
htmlHelp->addContentsItem(hasSubGroups || hasSubPages,gd->groupTitle(),gd->getOutputFileBase()); htmlHelp->addContentsItem(isDir,gd->groupTitle(),gd->getOutputFileBase());
htmlHelp->incContentsDepth(); htmlHelp->incContentsDepth();
} }
if(ftvHelp) 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(); ftvHelp->incContentsDepth();
} }
...@@ -2324,7 +2350,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel) ...@@ -2324,7 +2350,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel)
} }
// write classes // write classes
if(gd->classList->count()>0) if(gd->classSDict->count()>0)
{ {
if(htmlHelp) if(htmlHelp)
{ {
...@@ -2339,7 +2365,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel) ...@@ -2339,7 +2365,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,bool subLevel)
ftvHelp->incContentsDepth(); ftvHelp->incContentsDepth();
} }
writeClassTree(gd->classList); writeClassTree(gd->classSDict);
if(htmlHelp) htmlHelp->decContentsDepth(); if(htmlHelp) htmlHelp->decContentsDepth();
if(ftvHelp) ftvHelp->decContentsDepth(); if(ftvHelp) ftvHelp->decContentsDepth();
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "translator_cn.h" #include "translator_cn.h"
#include "translator_no.h" #include "translator_no.h"
#include "translator_br.h" #include "translator_br.h"
#include "translator_dk.h"
#endif #endif
#define L_EQUAL(a) !stricmp(langName,a) #define L_EQUAL(a) !stricmp(langName,a)
...@@ -132,6 +133,10 @@ bool setTranslator(const char *langName) ...@@ -132,6 +133,10 @@ bool setTranslator(const char *langName)
{ {
theTranslator=new TranslatorBrazilian; theTranslator=new TranslatorBrazilian;
} }
else if (L_EQUAL("danish"))
{
theTranslator=new TranslatorDanish;
}
#endif #endif
else // use the default language (i.e. english) else // use the default language (i.e. english)
{ {
......
...@@ -536,9 +536,10 @@ void LatexGenerator::startIndexSection(IndexSections is) ...@@ -536,9 +536,10 @@ void LatexGenerator::startIndexSection(IndexSections is)
break; break;
case isClassDocumentation: case isClassDocumentation:
{ {
ClassDef *cd=Doxygen::classList.first(); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE; bool found=FALSE;
while (cd && !found) for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{ {
if (cd->isLinkableInProject()) if (cd->isLinkableInProject())
{ {
...@@ -546,7 +547,6 @@ void LatexGenerator::startIndexSection(IndexSections is) ...@@ -546,7 +547,6 @@ void LatexGenerator::startIndexSection(IndexSections is)
t << "{"; //Compound Documentation}\n"; t << "{"; //Compound Documentation}\n";
found=TRUE; found=TRUE;
} }
cd=Doxygen::classList.next();
} }
} }
break; break;
...@@ -703,25 +703,24 @@ void LatexGenerator::endIndexSection(IndexSections is) ...@@ -703,25 +703,24 @@ void LatexGenerator::endIndexSection(IndexSections is)
break; break;
case isClassDocumentation: case isClassDocumentation:
{ {
ClassDef *cd=Doxygen::classList.first(); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE; bool found=FALSE;
while (cd && !found) for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{ {
if (cd->isLinkableInProject()) if (cd->isLinkableInProject())
{ {
t << "}\n\\input{" << cd->getOutputFileBase() << "}\n"; t << "}\n\\input{" << cd->getOutputFileBase() << "}\n";
found=TRUE; found=TRUE;
} }
cd=Doxygen::classList.next();
} }
while (cd) for (;(cd=cli.current());++cli)
{ {
if (cd->isLinkableInProject()) if (cd->isLinkableInProject())
{ {
if (compactLatex) t << "\\input"; else t << "\\include"; if (compactLatex) t << "\\input"; else t << "\\include";
t << "{" << cd->getOutputFileBase() << "}\n"; t << "{" << cd->getOutputFileBase() << "}\n";
} }
cd=Doxygen::classList.next();
} }
} }
break; break;
......
...@@ -20,7 +20,6 @@ HEADERS = bufstr.h \ ...@@ -20,7 +20,6 @@ HEADERS = bufstr.h \
classdef.h \ classdef.h \
classlist.h \ classlist.h \
code.h \ code.h \
config.h \
constexp.h \ constexp.h \
cppvalue.h \ cppvalue.h \
debug.h \ debug.h \
...@@ -98,7 +97,6 @@ SOURCES = ce_lex.cpp \ ...@@ -98,7 +97,6 @@ SOURCES = ce_lex.cpp \
classdef.cpp \ classdef.cpp \
classlist.cpp \ classlist.cpp \
code.cpp \ code.cpp \
config.cpp \
cppvalue.cpp \ cppvalue.cpp \
debug.cpp \ debug.cpp \
declinfo.cpp \ declinfo.cpp \
...@@ -124,7 +122,6 @@ SOURCES = ce_lex.cpp \ ...@@ -124,7 +122,6 @@ SOURCES = ce_lex.cpp \
language.cpp \ language.cpp \
latexgen.cpp \ latexgen.cpp \
logos.cpp \ logos.cpp \
main.cpp \
mangen.cpp \ mangen.cpp \
memberdef.cpp \ memberdef.cpp \
membergroup.cpp \ membergroup.cpp \
......
...@@ -28,14 +28,31 @@ ...@@ -28,14 +28,31 @@
#include "util.h" #include "util.h"
#include "doxygen.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() ManGenerator::ManGenerator() : OutputGenerator()
{ {
dir=Config_getString("MAN_OUTPUT")+"/man3"; dir=Config_getString("MAN_OUTPUT")+"/man" + getExtension();
firstCol=TRUE; firstCol=TRUE;
paragraph=FALSE; paragraph=FALSE;
col=0; col=0;
upperCase=FALSE; upperCase=FALSE;
insideTabbing=FALSE; insideTabbing=FALSE;
inHeader=FALSE;
} }
ManGenerator::~ManGenerator() ManGenerator::~ManGenerator()
...@@ -54,21 +71,25 @@ void ManGenerator::append(const OutputGenerator *g) ...@@ -54,21 +71,25 @@ void ManGenerator::append(const OutputGenerator *g)
else else
firstCol = ((ManGenerator *)g)->firstCol; firstCol = ((ManGenerator *)g)->firstCol;
col+=((ManGenerator *)g)->col; col+=((ManGenerator *)g)->col;
inHeader=((ManGenerator *)g)->inHeader;
paragraph=FALSE; paragraph=FALSE;
} }
void ManGenerator::init() void ManGenerator::init()
{ {
QDir d(Config_getString("MAN_OUTPUT")); QCString ext = getExtension();
if (!d.exists() && !d.mkdir(Config_getString("MAN_OUTPUT"))) 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); exit(1);
} }
d.setPath(Config_getString("MAN_OUTPUT")+"/man3"); d.setPath(manOutput+"/man"+ext);
if (!d.exists() && !d.mkdir(Config_getString("MAN_OUTPUT")+"/man3")) 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); exit(1);
} }
} }
...@@ -123,7 +144,8 @@ void ManGenerator::endFile() ...@@ -123,7 +144,8 @@ void ManGenerator::endFile()
void ManGenerator::endTitleHead(const char *,const char *name) 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()) if (Config_getString("PROJECT_NAME").isEmpty())
t << "Doxygen"; t << "Doxygen";
else else
...@@ -134,6 +156,7 @@ void ManGenerator::endTitleHead(const char *,const char *name) ...@@ -134,6 +156,7 @@ void ManGenerator::endTitleHead(const char *,const char *name)
t << ".SH NAME" << endl; t << ".SH NAME" << endl;
t << name << " \\- "; t << name << " \\- ";
firstCol=FALSE; firstCol=FALSE;
inHeader=TRUE;
} }
void ManGenerator::newParagraph() void ManGenerator::newParagraph()
...@@ -470,3 +493,42 @@ void ManGenerator::endMemberGroup(bool) ...@@ -470,3 +493,42 @@ void ManGenerator::endMemberGroup(bool)
t << "\n.in -1c"; t << "\n.in -1c";
firstCol=FALSE; 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 ...@@ -175,8 +175,8 @@ class ManGenerator : public OutputGenerator
void endParamList() { endDescList(); } void endParamList() { endDescList(); }
void endDescTitle(); void endDescTitle();
void writeDescItem(); void writeDescItem();
void startSection(const char *,const char *,bool) {} void startSection(const char *,const char *,bool);
void endSection(const char *,bool) {} void endSection(const char *,bool);
void writeSectionRef(const char *,const char *,const char *,const char *) {} void writeSectionRef(const char *,const char *,const char *,const char *) {}
void writeSectionRefItem(const char *,const char *,const char *) {} void writeSectionRefItem(const char *,const char *,const char *) {}
//void writeSectionRefAnchor(const char *,const char *,const char *) {} //void writeSectionRefAnchor(const char *,const char *,const char *) {}
...@@ -231,6 +231,7 @@ class ManGenerator : public OutputGenerator ...@@ -231,6 +231,7 @@ class ManGenerator : public OutputGenerator
int col; int col;
bool upperCase; bool upperCase;
bool insideTabbing; bool insideTabbing;
bool inHeader;
ManGenerator(const ManGenerator &g); ManGenerator(const ManGenerator &g);
ManGenerator &operator=(const ManGenerator &g); ManGenerator &operator=(const ManGenerator &g);
......
...@@ -241,8 +241,7 @@ MemberDef::MemberDef(const char *df,int dl, ...@@ -241,8 +241,7 @@ MemberDef::MemberDef(const char *df,int dl,
memDec=0; memDec=0;
group=0; group=0;
grpId=-1; grpId=-1;
exampleList=0; exampleSDict=0;
exampleDict=0;
enumFields=0; enumFields=0;
enumScope=0; enumScope=0;
enumDeclList=0; enumDeclList=0;
...@@ -271,6 +270,7 @@ MemberDef::MemberDef(const char *df,int dl, ...@@ -271,6 +270,7 @@ MemberDef::MemberDef(const char *df,int dl,
indDepth=0; indDepth=0;
section=0; section=0;
explExt=FALSE; explExt=FALSE;
cachedAnonymousType=0;
maxInitLines=Config_getInt("MAX_INITIALIZER_LINES"); maxInitLines=Config_getInt("MAX_INITIALIZER_LINES");
userInitLines=-1; userInitLines=-1;
docEnumValues=FALSE; docEnumValues=FALSE;
...@@ -315,8 +315,7 @@ MemberDef::MemberDef(const char *df,int dl, ...@@ -315,8 +315,7 @@ MemberDef::MemberDef(const char *df,int dl,
MemberDef::~MemberDef() MemberDef::~MemberDef()
{ {
delete redefinedBy; delete redefinedBy;
delete exampleList; delete exampleSDict;
delete exampleDict;
delete enumFields; delete enumFields;
delete argList; delete argList;
delete tArgList; delete tArgList;
...@@ -338,17 +337,15 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr, ...@@ -338,17 +337,15 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr,
const char *file) const char *file)
{ {
//printf("%s::addExample(%s,%s,%s)\n",name.data(),anchor,nameStr,file); //printf("%s::addExample(%s,%s,%s)\n",name.data(),anchor,nameStr,file);
if (exampleDict==0) exampleDict = new ExampleDict; if (exampleSDict==0) exampleSDict = new ExampleSDict;
if (exampleList==0) exampleList = new ExampleList; if (exampleSDict->find(nameStr)==0)
if (exampleDict->find(nameStr)==0)
{ {
//printf("Add reference to example %s to member %s\n",nameStr,name.data()); //printf("Add reference to example %s to member %s\n",nameStr,name.data());
Example *e=new Example; Example *e=new Example;
e->anchor=anchor; e->anchor=anchor;
e->name=nameStr; e->name=nameStr;
e->file=file; e->file=file;
exampleDict->insert(nameStr,e); exampleSDict->inSort(nameStr,e);
exampleList->inSort(e);
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
...@@ -356,32 +353,12 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr, ...@@ -356,32 +353,12 @@ bool MemberDef::addExample(const char *anchor,const char *nameStr,
bool MemberDef::hasExamples() bool MemberDef::hasExamples()
{ {
if (exampleList==0) if (exampleSDict==0)
return FALSE; return FALSE;
else 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 QCString MemberDef::getOutputFileBase() const
{ {
if (classDef) if (classDef)
...@@ -396,7 +373,7 @@ QCString MemberDef::getOutputFileBase() const ...@@ -396,7 +373,7 @@ QCString MemberDef::getOutputFileBase() const
{ {
return nspace->getOutputFileBase(); return nspace->getOutputFileBase();
} }
warn(defFileName,defLine, warn(m_defFileName,m_defLine,
"Warning: Internal inconsistency: member %s does not belong to any" "Warning: Internal inconsistency: member %s does not belong to any"
" container!",name().data() " container!",name().data()
); );
...@@ -457,9 +434,19 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *cd,NamespaceDef *nd, ...@@ -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 /*! If this member has an anonymous class/struct/union as its type, then
* this method will return the ClassDef that describes this return type. * 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); QCString ltype(type);
// strip `static' keyword from ltype // strip `static' keyword from ltype
if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7); if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7);
...@@ -495,6 +482,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType(const char *scopeName) const ...@@ -495,6 +482,7 @@ ClassDef *MemberDef::getClassDefOfAnonymousType(const char *scopeName) const
annoClassDef=getClass(ts); annoClassDef=getClass(ts);
} }
} }
cachedAnonymousType = annoClassDef;
return annoClassDef; return annoClassDef;
} }
...@@ -539,7 +527,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -539,7 +527,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
bool inGroup 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 // hide members whose brief section should not be visible
if (!isBriefSectionVisible()) return; if (!isBriefSectionVisible()) return;
...@@ -598,7 +586,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -598,7 +586,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (hasHtmlHelp) htmlHelp = HtmlHelp::getInstance(); if (hasHtmlHelp) htmlHelp = HtmlHelp::getInstance();
// search for the last anonymous scope in the member type // 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 // start a new member declaration
ol.startMemberItem((annoClassDef || annMemb || annEnumType) ? 1 : 0); ol.startMemberItem((annoClassDef || annMemb || annEnumType) ? 1 : 0);
...@@ -659,7 +647,6 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -659,7 +647,6 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (annoClassDef) // type is an anonymous compound if (annoClassDef) // type is an anonymous compound
{ {
int ir=i+l; int ir=i+l;
//printf("class found!\n");
annoClassDef->writeDeclaration(ol,annMemb,inGroup); annoClassDef->writeDeclaration(ol,annMemb,inGroup);
ol.startMemberItem(2); ol.startMemberItem(2);
int j; int j;
...@@ -674,10 +661,6 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -674,10 +661,6 @@ void MemberDef::writeDeclaration(OutputList &ol,
{ {
ol.docify(";"); ol.docify(";");
} }
//else
//{
// ol.docify(varName);
//}
} }
else else
{ {
...@@ -724,7 +707,8 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -724,7 +707,8 @@ void MemberDef::writeDeclaration(OutputList &ol,
// write name // write name
if (!name().isEmpty() && name().at(0)!='@') 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) if (annMemb)
{ {
...@@ -738,8 +722,10 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -738,8 +722,10 @@ void MemberDef::writeDeclaration(OutputList &ol,
annMemb->annUsed=annUsed=TRUE; annMemb->annUsed=annUsed=TRUE;
} }
else else
{
//printf("writeLink %s->%d\n",name.data(),hasDocumentation()); //printf("writeLink %s->%d\n",name.data(),hasDocumentation());
writeLink(ol,cd,nd,fd,gd); writeLink(ol,cd,nd,fd,gd);
}
} }
else // there is a brief member description and brief member else // there is a brief member description and brief member
// descriptions are enabled or there is no detailed description. // descriptions are enabled or there is no detailed description.
...@@ -796,7 +782,7 @@ void MemberDef::writeDeclaration(OutputList &ol, ...@@ -796,7 +782,7 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC") && !annMemb) if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC") && !annMemb)
{ {
ol.startMemberDescription(); ol.startMemberDescription();
parseDoc(ol,defFileName,defLine,cname,name(),briefDescription()); parseDoc(ol,m_defFileName,m_defLine,cname,name(),briefDescription());
if (detailsVisible) if (detailsVisible)
{ {
ol.pushGeneratorState(); ol.pushGeneratorState();
...@@ -850,6 +836,7 @@ bool MemberDef::isDetailedSectionVisible(bool inGroup) const ...@@ -850,6 +836,7 @@ bool MemberDef::isDetailedSectionVisible(bool inGroup) const
bool staticFilter = getClassDef()!=0 || !isStatic() || Config_getBool("EXTRACT_STATIC"); bool staticFilter = getClassDef()!=0 || !isStatic() || Config_getBool("EXTRACT_STATIC");
// details are not part of a group or this is for a group documentation page // 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; bool groupFilter = getGroupDef()==0 || inGroup;
// member is part of an anonymous scope that is the type of // member is part of an anonymous scope that is the type of
...@@ -887,7 +874,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -887,7 +874,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
QCString cname = container->name(); QCString cname = container->name();
QCString cfname = container->getOutputFileBase(); QCString cfname = container->getOutputFileBase();
// get member name // get member name
QCString doxyName=name().copy(); QCString doxyName=name().copy();
// prepend scope if there is any. TODO: make this optional for C only docs // 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, ...@@ -1122,14 +1108,14 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
) /* || !annMemb */ ) /* || !annMemb */
) )
{ {
parseDoc(ol,defFileName,defLine,scopeName,name(),briefDescription()); parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),briefDescription());
ol.newParagraph(); ol.newParagraph();
} }
/* write detailed description */ /* write detailed description */
if (!documentation().isEmpty()) if (!documentation().isEmpty())
{ {
parseDoc(ol,defFileName,defLine,scopeName,name(),documentation()+"\n"); parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),documentation()+"\n");
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::RTF); ol.disableAllBut(OutputGenerator::RTF);
ol.newParagraph(); ol.newParagraph();
...@@ -1161,7 +1147,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1161,7 +1147,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.endEmphasis(); ol.endEmphasis();
ol.endDescTableTitle(); ol.endDescTableTitle();
ol.startDescTableData(); ol.startDescTableData();
parseDoc(ol,defFileName,defLine,scopeName,name(),a->docs); parseDoc(ol,m_defFileName,m_defLine,scopeName,name(),a->docs);
ol.endDescTableData(); ol.endDescTableData();
} }
} }
...@@ -1218,7 +1204,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1218,7 +1204,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
if (!fmd->briefDescription().isEmpty()) 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(); //ol.newParagraph();
} }
if (!fmd->briefDescription().isEmpty() && if (!fmd->briefDescription().isEmpty() &&
...@@ -1228,7 +1214,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1228,7 +1214,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
} }
if (!fmd->documentation().isEmpty()) 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(); ol.endDescTableData();
} }
...@@ -1376,7 +1362,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ...@@ -1376,7 +1362,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
ol.endBold(); ol.endBold();
ol.endDescTitle(); ol.endDescTitle();
ol.writeDescItem(); ol.writeDescItem();
writeExample(ol,getExampleList()); writeExample(ol,getExamples());
//ol.endDescItem(); //ol.endDescItem();
ol.endDescList(); ol.endDescList();
} }
...@@ -1412,7 +1398,7 @@ void MemberDef::warnIfUndocumented() ...@@ -1412,7 +1398,7 @@ void MemberDef::warnIfUndocumented()
t="file", d=fd; t="file", d=fd;
if (d && d->isLinkable() && !isLinkable() && name().find('@')==-1) 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()); name().data(),t,d->name().data());
} }
...@@ -1481,3 +1467,9 @@ QCString MemberDef::anchor() const ...@@ -1481,3 +1467,9 @@ QCString MemberDef::anchor() const
if (enumScope) return enumScope->anchor()+anc; if (enumScope) return enumScope->anchor()+anc;
return 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; ...@@ -31,8 +31,7 @@ class GroupDef;
class FileDef; class FileDef;
class MemberList; class MemberList;
class MemberGroup; class MemberGroup;
class ExampleList; class ExampleSDict;
class ExampleDict;
class OutputList; class OutputList;
class GroupDef; class GroupDef;
class QTextStream; class QTextStream;
...@@ -138,7 +137,7 @@ class MemberDef : public Definition ...@@ -138,7 +137,7 @@ class MemberDef : public Definition
void setMaxInitLines(int lines) { userInitLines=lines; } void setMaxInitLines(int lines) { userInitLines=lines; }
void setMemberClass(ClassDef *cd) { classDef=cd; } void setMemberClass(ClassDef *cd) { classDef=cd; }
void setSectionList(MemberList *sl) { section=sl; } void setSectionList(MemberList *sl) { section=sl; }
void setGroupDef(GroupDef *gd) { group=gd; } void setGroupDef(GroupDef *gd);
void setExplicitExternal(bool b) { explExt=b; } void setExplicitExternal(bool b) { explExt=b; }
void makeRelated() { related=TRUE; } void makeRelated() { related=TRUE; }
...@@ -177,8 +176,7 @@ class MemberDef : public Definition ...@@ -177,8 +176,7 @@ class MemberDef : public Definition
// example related members // example related members
bool addExample(const char *anchor,const char *name,const char *file); bool addExample(const char *anchor,const char *name,const char *file);
bool hasExamples(); bool hasExamples();
ExampleList *getExampleList() const { return exampleList; } ExampleSDict *getExamples() const { return exampleSDict; }
// prototype related members // prototype related members
void setPrototype(bool p) { proto=p; } void setPrototype(bool p) { proto=p; }
...@@ -217,7 +215,7 @@ class MemberDef : public Definition ...@@ -217,7 +215,7 @@ class MemberDef : public Definition
QCString getScopeString() const; QCString getScopeString() const;
ClassDef *getClassDefOfAnonymousType(const char *scopeName) const; ClassDef *getClassDefOfAnonymousType();
private: private:
ClassDef *classDef; // member of or related to ClassDef *classDef; // member of or related to
...@@ -228,8 +226,9 @@ class MemberDef : public Definition ...@@ -228,8 +226,9 @@ class MemberDef : public Definition
MemberList *redefinedBy; // the list of members that redefine this one MemberList *redefinedBy; // the list of members that redefine this one
MemberDef *memDef; // member definition for this declaration MemberDef *memDef; // member definition for this declaration
MemberDef *memDec; // member declaration for this definition 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 MemberList *enumFields; // enumeration fields
OutputList *enumDeclList; // stored piece of documentation for enumeration. OutputList *enumDeclList; // stored piece of documentation for enumeration.
NamespaceDef *nspace; // the namespace this member is in. NamespaceDef *nspace; // the namespace this member is in.
...@@ -271,6 +270,11 @@ class MemberDef : public Definition ...@@ -271,6 +270,11 @@ class MemberDef : public Definition
GroupDef *group; // group in which this member is in GroupDef *group; // group in which this member is in
bool explExt; // member was explicitly declared external 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 // disable copying of member defs
MemberDef(const MemberDef &); MemberDef(const MemberDef &);
......
/****************************************************************************** /******************************************************************************
* *
* $Id$ *
* *
* Copyright (C) 1997-2001 by Dimitri van Heesch. * Copyright (C) 1997-2001 by Dimitri van Heesch.
* *
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <qlist.h> #include <qlist.h>
#include "memberdef.h" #include "memberdef.h"
#include "sortdict.h"
class MemberName : public QList<MemberDef> class MemberName : public QList<MemberDef>
{ {
...@@ -107,6 +108,19 @@ class MemberNameInfoDict : public QDict<MemberNameInfo> ...@@ -107,6 +108,19 @@ class MemberNameInfoDict : public QDict<MemberNameInfo>
~MemberNameInfoDict() {} ~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> class MemberNameInfoListIterator : public QListIterator<MemberNameInfo>
{ {
public: public:
......
...@@ -32,23 +32,22 @@ NamespaceDef::NamespaceDef(const char *df,int dl, ...@@ -32,23 +32,22 @@ NamespaceDef::NamespaceDef(const char *df,int dl,
Definition(df,dl,name) Definition(df,dl,name)
{ {
fileName=(QCString)"namespace_"+name; fileName=(QCString)"namespace_"+name;
classList = new ClassList; classSDict = new ClassSDict(257);
classDict = new ClassDict(1009); namespaceSDict = new NamespaceSDict(257);
//memList = new MemberList; m_innerCompounds = new SDict<Definition>(257);
usingDirList = 0; usingDirList = 0;
usingDeclList = 0; usingDeclList = 0;
setReference(lref); setReference(lref);
memberGroupList = new MemberGroupList; memberGroupList = new MemberGroupList;
memberGroupList->setAutoDelete(TRUE); memberGroupList->setAutoDelete(TRUE);
memberGroupDict = new MemberGroupDict(1009); memberGroupDict = new MemberGroupDict(1009);
defFileName = df;
defLine = dl;
} }
NamespaceDef::~NamespaceDef() NamespaceDef::~NamespaceDef()
{ {
delete classList; delete classSDict;
delete classDict; delete namespaceSDict;
delete m_innerCompounds;
delete usingDirList; delete usingDirList;
delete usingDeclList; delete usingDeclList;
delete memberGroupList; delete memberGroupList;
...@@ -77,13 +76,23 @@ void NamespaceDef::insertUsedFile(const char *f) ...@@ -77,13 +76,23 @@ void NamespaceDef::insertUsedFile(const char *f)
void NamespaceDef::insertClass(ClassDef *cd) void NamespaceDef::insertClass(ClassDef *cd)
{ {
if (classDict->find(cd->name())==0) if (classSDict->find(cd->name())==0)
{ {
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(cd); classSDict->inSort(cd->name(),cd);
else else
classList->append(cd); classSDict->append(cd->name(),cd);
classDict->insert(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) ...@@ -219,7 +228,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
OutputList briefOutput(&ol); OutputList briefOutput(&ol);
if (!briefDescription().isEmpty()) if (!briefDescription().isEmpty())
{ {
parseDoc(briefOutput,defFileName,defLine,name(),0,briefDescription()); parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription());
ol+=briefOutput; ol+=briefOutput;
ol.writeString(" \n"); ol.writeString(" \n");
ol.pushGeneratorState(); ol.pushGeneratorState();
...@@ -237,7 +246,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ...@@ -237,7 +246,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
ol.endTextBlock(); ol.endTextBlock();
ol.startMemberSections(); ol.startMemberSections();
classList->writeDeclaration(ol); classSDict->writeDeclaration(ol);
/* write user defined member groups */ /* write user defined member groups */
MemberGroupListIterator mgli(*memberGroupList); MemberGroupListIterator mgli(*memberGroupList);
...@@ -283,7 +292,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ...@@ -283,7 +292,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
} }
if (!documentation().isEmpty()) if (!documentation().isEmpty())
{ {
parseDoc(ol,defFileName,defLine,name(),0,documentation()+"\n"); parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n");
ol.newParagraph(); ol.newParagraph();
} }
ol.endTextBlock(); ol.endTextBlock();
...@@ -328,7 +337,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ...@@ -328,7 +337,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
int NamespaceDef::countMembers() int NamespaceDef::countMembers()
{ {
allMemberList.countDocMembers(); allMemberList.countDocMembers();
return allMemberList.numDocMembers()+classList->count(); return allMemberList.numDocMembers()+classSDict->count();
} }
void NamespaceDef::addUsingDirective(NamespaceDef *nd) void NamespaceDef::addUsingDirective(NamespaceDef *nd)
...@@ -354,3 +363,15 @@ QCString NamespaceDef::getOutputFileBase() const ...@@ -354,3 +363,15 @@ QCString NamespaceDef::getOutputFileBase() const
return convertNameToFile(fileName); 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 @@ ...@@ -21,17 +21,19 @@
#include "qtbc.h" #include "qtbc.h"
#include <qstrlist.h> #include <qstrlist.h>
#include <qdict.h> #include <qdict.h>
#include "sortdict.h"
#include "definition.h" #include "definition.h"
#include "memberlist.h" #include "memberlist.h"
class ClassDef; class ClassDef;
class OutputList;
class ClassList; class ClassList;
class ClassDict; class OutputList;
class ClassSDict;
class MemberDef; class MemberDef;
class NamespaceList; class NamespaceList;
class MemberGroupDict; class MemberGroupDict;
class MemberGroupList; class MemberGroupList;
class NamespaceSDict;
class NamespaceDef : public Definition class NamespaceDef : public Definition
{ {
...@@ -43,8 +45,11 @@ class NamespaceDef : public Definition ...@@ -43,8 +45,11 @@ class NamespaceDef : public Definition
QCString getOutputFileBase() const; QCString getOutputFileBase() const;
void insertUsedFile(const char *fname); void insertUsedFile(const char *fname);
void writeDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol);
void insertClass(ClassDef *cd); void insertClass(ClassDef *cd);
void insertNamespace(NamespaceDef *nd);
void insertMember(MemberDef *md); void insertMember(MemberDef *md);
void computeAnchors(); void computeAnchors();
int countMembers(); int countMembers();
void addUsingDirective(NamespaceDef *nd); void addUsingDirective(NamespaceDef *nd);
...@@ -65,6 +70,9 @@ class NamespaceDef : public Definition ...@@ -65,6 +70,9 @@ class NamespaceDef : public Definition
} }
void addMembersToMemberGroup(); void addMembersToMemberGroup();
void distributeMemberGroupDocumentation(); void distributeMemberGroupDocumentation();
virtual Definition *findInnerCompound(const char *name);
void addInnerCompound(Definition *d);
//protected: //protected:
// void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const); // void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
...@@ -73,10 +81,15 @@ class NamespaceDef : public Definition ...@@ -73,10 +81,15 @@ class NamespaceDef : public Definition
//QCString reference; //QCString reference;
QCString fileName; QCString fileName;
QStrList files; QStrList files;
ClassList *classList;
ClassDict *classDict; /*! Classes inside this namespace */
ClassSDict *classSDict;
/*! Namespaces inside this namespace */
NamespaceSDict *namespaceSDict;
NamespaceList *usingDirList; NamespaceList *usingDirList;
ClassList *usingDeclList; ClassList *usingDeclList;
SDict<Definition> *m_innerCompounds;
MemberList allMemberList; MemberList allMemberList;
...@@ -128,4 +141,19 @@ class NamespaceDict : public QDict<NamespaceDef> ...@@ -128,4 +141,19 @@ class NamespaceDict : public QDict<NamespaceDef>
~NamespaceDict() {} ~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 #endif
...@@ -30,22 +30,22 @@ ...@@ -30,22 +30,22 @@
PackageDef::PackageDef(const char *df,int dl,const char *na,const char *ref) : PackageDef::PackageDef(const char *df,int dl,const char *na,const char *ref) :
Definition(df,dl,na) Definition(df,dl,na)
{ {
classList = new ClassList; classSDict = new ClassSDict(17);
packageFileName = (QCString)"package_"+na; packageFileName = (QCString)"package_"+na;
setReference(ref); setReference(ref);
} }
PackageDef::~PackageDef() PackageDef::~PackageDef()
{ {
delete classList; delete classSDict;
} }
void PackageDef::addClass(const ClassDef *def) void PackageDef::addClass(const ClassDef *cd)
{ {
if (Config_getBool("SORT_MEMBER_DOCS")) if (Config_getBool("SORT_MEMBER_DOCS"))
classList->inSort(def); classSDict->inSort(cd->name(),cd);
else else
classList->append(def); classSDict->append(cd->name(),cd);
} }
void PackageDef::writeDocumentation(OutputList &ol) void PackageDef::writeDocumentation(OutputList &ol)
...@@ -61,7 +61,7 @@ void PackageDef::writeDocumentation(OutputList &ol) ...@@ -61,7 +61,7 @@ void PackageDef::writeDocumentation(OutputList &ol)
OutputList briefOutput(&ol); OutputList briefOutput(&ol);
if (!briefDescription().isEmpty()) if (!briefDescription().isEmpty())
{ {
parseDoc(briefOutput,defFileName,defLine,name(),0,briefDescription()); parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription());
ol+=briefOutput; ol+=briefOutput;
ol.writeString(" \n"); ol.writeString(" \n");
ol.pushGeneratorState(); ol.pushGeneratorState();
...@@ -81,9 +81,9 @@ void PackageDef::writeDocumentation(OutputList &ol) ...@@ -81,9 +81,9 @@ void PackageDef::writeDocumentation(OutputList &ol)
ol.startMemberSections(); ol.startMemberSections();
ClassDef::CompoundType ct; ClassDef::CompoundType ct;
ct=ClassDef::Interface; ct=ClassDef::Interface;
classList->writeDeclaration(ol,&ct,theTranslator->trInterfaces()); classSDict->writeDeclaration(ol,&ct,theTranslator->trInterfaces());
ct=ClassDef::Class; ct=ClassDef::Class;
classList->writeDeclaration(ol,&ct,theTranslator->trClasses()); classSDict->writeDeclaration(ol,&ct,theTranslator->trClasses());
ol.endMemberSections(); ol.endMemberSections();
if (!Config_getString("GENERATE_TAGFILE").isEmpty()) if (!Config_getString("GENERATE_TAGFILE").isEmpty())
...@@ -114,7 +114,7 @@ void PackageDef::writeDocumentation(OutputList &ol) ...@@ -114,7 +114,7 @@ void PackageDef::writeDocumentation(OutputList &ol)
// write documentation // write documentation
if (!documentation().isEmpty()) 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 @@ ...@@ -24,7 +24,7 @@
#include "definition.h" #include "definition.h"
#include "sortdict.h" #include "sortdict.h"
class ClassList; class ClassSDict;
class ClassDef; class ClassDef;
class PackageList; class PackageList;
class OutputList; class OutputList;
...@@ -49,7 +49,7 @@ class PackageDef : public Definition ...@@ -49,7 +49,7 @@ class PackageDef : public Definition
private: private:
QCString packageFileName; // base name of the generated file 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> class PackageSDict : public SDict<PackageDef>
......
...@@ -991,16 +991,16 @@ void RTFGenerator::startIndexSection(IndexSections is) ...@@ -991,16 +991,16 @@ void RTFGenerator::startIndexSection(IndexSections is)
case isClassDocumentation: case isClassDocumentation:
{ {
//Compound Documentation //Compound Documentation
ClassDef *cd=Doxygen::classList.first(); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE; bool found=FALSE;
while (cd && !found) for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{ {
if (cd->isLinkableInProject()) if (cd->isLinkableInProject())
{ {
beginRTFChapter(); beginRTFChapter();
found=TRUE; found=TRUE;
} }
cd=Doxygen::classList.next();
} }
} }
break; break;
...@@ -1220,11 +1220,12 @@ void RTFGenerator::endIndexSection(IndexSections is) ...@@ -1220,11 +1220,12 @@ void RTFGenerator::endIndexSection(IndexSections is)
break; break;
case isClassDocumentation: case isClassDocumentation:
{ {
ClassDef *cd=Doxygen::classList.first(); ClassSDict::Iterator cli(Doxygen::classSDict);
ClassDef *cd=0;
bool found=FALSE; bool found=FALSE;
t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}"<< endl; t << "{\\tc \\v " << theTranslator->trClassDocumentation() << "}"<< endl;
while (cd && !found) for (cli.toFirst();(cd=cli.current()) && !found;++cli)
{ {
if (cd->isLinkableInProject()) if (cd->isLinkableInProject())
{ {
...@@ -1234,9 +1235,8 @@ void RTFGenerator::endIndexSection(IndexSections is) ...@@ -1234,9 +1235,8 @@ void RTFGenerator::endIndexSection(IndexSections is)
t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
found=TRUE; found=TRUE;
} }
cd=Doxygen::classList.next();
} }
while (cd) for (;(cd=cli.current());++cli)
{ {
if (cd->isLinkableInProject()) if (cd->isLinkableInProject())
{ {
...@@ -1246,7 +1246,6 @@ void RTFGenerator::endIndexSection(IndexSections is) ...@@ -1246,7 +1246,6 @@ void RTFGenerator::endIndexSection(IndexSections is)
t << cd->getOutputFileBase(); t << cd->getOutputFileBase();
t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n";
} }
cd=Doxygen::classList.next();
} }
} }
break; break;
......
...@@ -1557,11 +1557,10 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -1557,11 +1557,10 @@ TITLE [tT][iI][tT][lL][eE]
{ {
current->endBodyLine = yyLineNr; current->endBodyLine = yyLineNr;
QCString &cn = current->name; QCString &cn = current->name;
//QCString rn = stripAnnonymousScope(current_root->name);
QCString rn = current_root->name.copy(); QCString rn = current_root->name.copy();
//printf("cn=`%s' rn=`%s'\n",cn.data(),rn.data()); //printf("cn=`%s' rn=`%s'\n",cn.data(),rn.data());
if (!cn.isEmpty() && !rn.isEmpty() && if (!cn.isEmpty() && !rn.isEmpty() &&
(current_root->section & Entry::SCOPE_MASK)) (current_root->section & Entry::SCOPE_MASK))
{ {
cn.prepend(rn+"::"); cn.prepend(rn+"::");
} }
...@@ -2294,7 +2293,7 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -2294,7 +2293,7 @@ TITLE [tT][iI][tT][lL][eE]
current->argList->clear(); current->argList->clear();
BEGIN( FindMembers ) ; BEGIN( FindMembers ) ;
} }
<CompoundName>{SCOPENAME}{BN}*/"<" { <CompoundName>{SCOPENAME}{BN}*/"<" {
sharpCount = 0; sharpCount = 0;
current->name = yytext ; current->name = yytext ;
lineCount(); lineCount();
...@@ -2317,7 +2316,7 @@ TITLE [tT][iI][tT][lL][eE] ...@@ -2317,7 +2316,7 @@ TITLE [tT][iI][tT][lL][eE]
<ClassTemplSpec>. { <ClassTemplSpec>. {
current->name += yytext; current->name += yytext;
} }
<CompoundName>{SCOPENAME} { <CompoundName>{SCOPENAME} {
current->name = yytext ; current->name = yytext ;
lineCount(); lineCount();
BEGIN( ClassVar ); BEGIN( ClassVar );
...@@ -3855,14 +3854,14 @@ static void parseCompounds(Entry *rt) ...@@ -3855,14 +3854,14 @@ static void parseCompounds(Entry *rt)
memberGroupId = NOGROUP; memberGroupId = NOGROUP;
// rebuild compound's group context // rebuild compound's group context
QCString *s = ce->groups->first(); //QCString *s = ce->groups->first();
if (s) //if (s)
{ //{
lastDefGroup=*s; // lastDefGroup=*s;
startGroup(); // startGroup();
} //}
current->mGrpId = memberGroupId = ce->mGrpId; //current->mGrpId = memberGroupId = ce->mGrpId;
scanYYlex() ; scanYYlex() ;
delete current; current=0; delete current; current=0;
......
...@@ -79,6 +79,14 @@ class SDict ...@@ -79,6 +79,14 @@ class SDict
m_list->append(d); m_list->append(d);
m_dict->insert(key,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. /*! 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 key The unique key to use to quicky find the item later on.
* \param d The compound to add. * \param d The compound to add.
...@@ -103,6 +111,12 @@ class SDict ...@@ -103,6 +111,12 @@ class SDict
{ {
return m_dict->find(key); 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. /*! Function that is used to compare two items when sorting.
* Overload this to properly sort items. * Overload this to properly sort items.
* \sa inSort() * \sa inSort()
...@@ -152,6 +166,13 @@ class SDict ...@@ -152,6 +166,13 @@ class SDict
{ {
return m_li->toFirst(); 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 */ /*! Returns the current compound */
T *current() const T *current() const
{ {
...@@ -165,6 +186,14 @@ class SDict ...@@ -165,6 +186,14 @@ class SDict
{ {
return m_li->operator++(); 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: private:
QListIterator<T> *m_li; QListIterator<T> *m_li;
......
...@@ -120,9 +120,9 @@ ...@@ -120,9 +120,9 @@
// Windows version. The version which does not call the function is // Windows version. The version which does not call the function is
// probably slightly faster. // probably slightly faster.
#include "translator_adapter.h" #include "translator.h"
class TranslatorCzech : public TranslatorAdapterBase class TranslatorCzech : public Translator
{ {
private: private:
/*! The Decode() inline assumes the source written in the /*! The Decode() inline assumes the source written in the
......
This diff is collapsed.
...@@ -1176,13 +1176,37 @@ class TranslatorEnglish : public Translator ...@@ -1176,13 +1176,37 @@ class TranslatorEnglish : public Translator
// new since 1.2.6 // 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() virtual QCString trRTFansicp()
{ {
return "1252"; 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() virtual QCString trRTFCharSet()
{ {
return "0"; 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