Commit f1ddf16a authored by dimitri's avatar dimitri

Release-1.4.7-20060809

parent 3a7dcb4c
DOXYGEN Version 1.4.7-20060716
DOXYGEN Version 1.4.7-20060809
Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions.
--------
Dimitri van Heesch (16 July 2006)
Dimitri van Heesch (09 August 2006)
......@@ -24,6 +24,7 @@ distclean: clean
cd addon/doxmlparser/src ; $(MAKE) distclean
cd addon/doxmlparser/test ; $(MAKE) distclean
cd addon/doxmlparser/examples/metrics ; $(MAKE) distclean
cd addon/doxyapp ; $(MAKE) distclean
-rm -f lib/lib*
-rm -f bin/doxy*
-rm -f html
......
DOXYGEN Version 1.4.7_20060716
DOXYGEN Version 1.4.7_20060809
Please read INSTALL for compilation instructions.
......@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (16 July 2006)
Dimitri van Heesch (dimitri@stack.nl) (09 August 2006)
all clean depend: Makefile.doxyapp
$(MAKE) -f Makefile.doxyapp $@
distclean: clean
$(RM) -rf Makefile doxyapp.pro Makefile.doxyapp
tmake:
$(ENV) $(PERL) $(TMAKE) doxyapp.pro >Makefile.doxyapp
strip:
strip doxyapp
Makefile.doxyapp: doxyapp.pro
$(ENV) $(PERL) $(TMAKE) doxyapp.pro >Makefile.doxyapp
install:
This directory contains an example of how to use doxygen as
an "source parsing engine" in an application. It shows how to configure doxygen
from the application and shows how to run doxygen without generating output,
and then uses the information about the symbols found in the source code.
Note that if you use this approach your application should be licensed under the GPL.
/******************************************************************************
*
* Copyright (C) 1997-2006 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.
*
*/
/** @file
* @brief Example of how to use doxygen as part of another GPL applications
*
* This example shows how to configure and run doxygen programmatically from
* within an application without generating the usual output.
* The example should work on any Unix like OS (including Linux and Mac OS X).
*
* This example shows how to use to code parser to get cross-references information
* and it also shows how to look up symbols in a program parsed by doxygen and
* show some information about it.
*/
#include </usr/include/unistd.h> // ugly hack to get the right unistd.h (doxygen has one too)
#include "doxygen.h"
#include "outputgen.h"
#include "parserintf.h"
class XRefDummyCodeGenerator : public CodeOutputInterface
{
public:
XRefDummyCodeGenerator(FileDef *fd) : m_fd(fd) {}
~XRefDummyCodeGenerator() {}
// these are just null functions, they can be used to produce a syntax highlighted
// and cross-linked version of the source code, but who needs that anyway ;-)
void codify(const char *) {}
void writeCodeLink(const char *,const char *,const char *,const char *) {}
void startCodeLine() {}
void endCodeLine() {}
void startCodeAnchor(const char *) {}
void endCodeAnchor() {}
void startFontClass(const char *) {}
void endFontClass() {}
void writeCodeAnchor(const char *) {}
void writeLineNumber(const char *,const char *,const char *,int) {}
// here we are presented with the symbols found by the code parser
void linkableSymbol(int l, const char *sym,Definition *symDef,Definition *context)
{
QCString ctx;
if (context) // the context of the symbol is known
{
if (context->definitionType()==Definition::TypeMember) // it is inside a member
{
Definition *parentContext = context->getOuterScope();
if (parentContext && parentContext->definitionType()==Definition::TypeClass)
// it is inside a member of a class
{
ctx.sprintf("inside %s %s of %s %s",
((MemberDef *)context)->memberTypeName().data(),
context->name().data(),
((ClassDef*)parentContext)->compoundTypeString().data(),
parentContext->name().data());
}
else if (parentContext==Doxygen::globalScope) // it is inside a global member
{
ctx.sprintf("inside %s %s",
((MemberDef *)context)->memberTypeName().data(),
context->name().data());
}
}
if (ctx.isEmpty()) // it is something else (class, or namespace member, ...)
{
ctx.sprintf("in %s",context->name().data());
}
}
printf("Found symbol %s at line %d of %s %s\n",
sym,l,m_fd->getDefFileName().data(),ctx.data());
if (symDef && context) // in this case the definition of the symbol is
// known to doxygen.
{
printf("-> defined at line %d of %s\n",
symDef->getDefLine(),symDef->getDefFileName().data());
}
}
private:
FileDef *m_fd;
};
static void findXRefSymbols(FileDef *fd)
{
// get the interface to a parser that matches the file extension
ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
// reset the parsers state
pIntf->resetCodeParserState();
// create a new backend object
XRefDummyCodeGenerator *xrefGen = new XRefDummyCodeGenerator(fd);
// parse the source code
pIntf->parseCode(*xrefGen,
0,
fileToString(fd->absFilePath()),
FALSE,
0,
fd);
// dismiss the object.
delete xrefGen;
}
static void listSymbol(Definition *d)
{
if (d!=Doxygen::globalScope && // skip the global namespace symbol
d->name().at(0)!='@' // skip anonymous stuff
)
{
printf("%s\n",
d->name().data());
}
}
static void listSymbols()
{
QDictIterator<DefinitionIntf> sli(*Doxygen::symbolMap);
DefinitionIntf *di;
for (sli.toFirst();(di=sli.current());++sli)
{
if (di->definitionType()==DefinitionIntf::TypeSymbolList) // list of symbols
// with same name
{
DefinitionListIterator dli(*(DefinitionList*)di);
Definition *d;
// for each symbol
for (dli.toFirst();(d=dli.current());++dli)
{
listSymbol(d);
}
}
else // single symbol
{
listSymbol((Definition*)di);
}
}
}
static void lookupSymbol(Definition *d)
{
if (d!=Doxygen::globalScope && // skip the global namespace symbol
d->name().at(0)!='@' // skip anonymous stuff
)
{
printf("Symbol info\n");
printf("-----------\n");
printf("Name: %s\n",d->name().data());
printf("File: %s\n",d->getDefFileName().data());
printf("Line: %d\n",d->getDefLine());
// depending on the definition type we can case to the appropriate
// derived to get additional information
switch (d->definitionType())
{
case Definition::TypeClass:
{
ClassDef *cd = (ClassDef *)d;
printf("Kind: %s\n",cd->compoundTypeString().data());
}
break;
case Definition::TypeFile:
{
FileDef *fd = (FileDef *)d;
printf("Kind: File: #includes %d other files\n",
fd->includeFileList() ? fd->includeFileList()->count() : 0);
}
break;
case Definition::TypeNamespace:
{
NamespaceDef *nd = (NamespaceDef *)d;
printf("Kind: Namespace: contains %d classes and %d namespaces\n",
nd->getClassSDict() ? nd->getClassSDict()->count() : 0,
nd->getNamespaceSDict() ? nd->getNamespaceSDict()->count() : 0);
}
break;
case Definition::TypeMember:
{
MemberDef *md = (MemberDef *)d;
printf("Kind: %s\n",md->memberTypeName().data());
}
break;
default:
// ignore groups/pages/packages/dirs for now
break;
}
}
}
static void lookupSymbols(const QCString &sym)
{
if (!sym.isEmpty())
{
DefinitionIntf *di = Doxygen::symbolMap->find(sym);
if (di)
{
if (di->definitionType()==DefinitionIntf::TypeSymbolList)
{
DefinitionListIterator dli(*(DefinitionList*)di);
Definition *d;
// for each symbol with the given name
for (dli.toFirst();(d=dli.current());++dli)
{
lookupSymbol(d);
}
}
else
{
lookupSymbol((Definition*)di);
}
}
else
{
printf("Unknown symbol\n");
}
}
}
int main(int argc,char **argv)
{
char cmd[256];
if (argc<2)
{
printf("Usage: %s [source_file | source_dir]\n",argv[0]);
exit(1);
}
// initialize data structures
initDoxygen();
// setup the non-default configuration options
// we need a place to put intermediate files
Config_getString("OUTPUT_DIRECTORY")="/tmp/doxygen";
// disable html output
Config_getBool("GENERATE_HTML")=FALSE;
// disable latex output
Config_getBool("GENERATE_LATEX")=FALSE;
// be quiet
Config_getBool("QUIET")=TRUE;
// turn off warnings
Config_getBool("WARNINGS")=FALSE;
Config_getBool("WARN_IF_UNDOCUMENTED")=FALSE;
Config_getBool("WARN_IF_DOC_ERROR")=FALSE;
// Extract as much as possible
Config_getBool("EXTRACT_ALL")=TRUE;
Config_getBool("EXTRACT_STATIC")=TRUE;
Config_getBool("EXTRACT_PRIVATE")=TRUE;
Config_getBool("EXTRACT_LOCAL_METHODS")=TRUE;
// Extract source browse information, needed
// to make doxygen gather the cross reference info
Config_getBool("SOURCE_BROWSER")=TRUE;
// set the input
Config_getList("INPUT").append(argv[1]);
// check and finialize the configuration
checkConfiguration();
// parse the files
parseInput();
// iterate over the input files
FileNameListIterator fnli(Doxygen::inputNameList);
FileName *fn;
// foreach file with a certain name
for (fnli.toFirst();(fn=fnli.current());++fnli)
{
FileNameIterator fni(*fn);
FileDef *fd;
// for each file definition
for (;(fd=fni.current());++fni)
{
// get the references (linked and unlinked) found in this file
findXRefSymbols(fd);
}
}
// clean up after us
rmdir("/tmp/doxygen");
while (1)
{
printf("> Type a symbol name or\n> .list for a list of symbols or\n> .quit to exit\n> ");
fgets(cmd,256,stdin);
QCString s(cmd);
if (s.at(s.length()-1)=='\n') s=s.left(s.length()-1); // strip trailing \n
if (s==".list")
listSymbols();
else if (s==".quit")
exit(0);
else
lookupSymbols(s);
}
}
TEMPLATE = app.t
CONFIG = console warn_on debug
HEADERS =
SOURCES = doxyapp.cpp
LIBS += -L../../lib -L../../lib -ldoxygen -lqtools -lmd5 -ldoxycfg -lpng
DESTDIR =
OBJECTS_DIR = ../../objects
TARGET = ../../bin/doxyapp
INCLUDEPATH += ../../qtools ../../src
DEPENDPATH += ../../src
TARGETDEPS = ../../lib/libdoxygen.a
......@@ -47,6 +47,7 @@ QCString getResourcePath()
return result;
}
#if 0
#define GRAPHVIZ_PATH "/Applications/Graphviz.app"
#define DOT_PATH GRAPHVIZ_PATH "/Contents/MacOS"
#define DOT_LOCATION DOT_PATH "/dot"
......@@ -73,6 +74,12 @@ void setDotPath()
//Config_getBool("HAVE_DOT")=TRUE;
}
}
#endif
void setDotPath()
{
Config_getString("DOT_PATH")=getResourcePath();
}
#endif
......@@ -512,7 +519,12 @@ Step4::Step4(QWidget *parent) : QWidget(parent,"Step4")
dotGroup->setButton(0);
m_dotOptions->setEnabled(FALSE);
gbox->addWidget(w,4,0);
#if defined(Q_OS_MACX) // we bundle dot with the mac package
m_diagramMode->setButton(2);
#else
m_diagramMode->setButton(1);
#endif
layout->addWidget(m_diagramMode);
layout->addStretch(1);
......@@ -678,6 +690,7 @@ MainWidget::MainWidget(QWidget *parent)
// initialize config settings
Config::instance()->init();
Config::instance()->check();
Config_getBool("HAVE_DOT")=TRUE;
#if defined(Q_OS_MACX)
setDotPath();
#endif
......@@ -887,8 +900,8 @@ void MainWidget::launchWizard()
// -------- Initialize the dialog ----------------
// step1
wizard.setProjectName(Config_getString("PROJECT_NAME"));
wizard.setProjectNumber(Config_getString("PROJECT_NUMBER"));
wizard.setProjectName(QString::fromLocal8Bit(Config_getString("PROJECT_NAME")));
wizard.setProjectNumber(QString::fromLocal8Bit(Config_getString("PROJECT_NUMBER")));
if (Config_getList("INPUT").count()>0)
{
QString dirName=Config_getList("INPUT").getFirst();
......@@ -899,7 +912,7 @@ void MainWidget::launchWizard()
}
}
wizard.setRecursiveScan(Config_getBool("RECURSIVE"));
wizard.setDestinationDir(Config_getString("OUTPUT_DIRECTORY"));
wizard.setDestinationDir(QString::fromLocal8Bit(Config_getString("OUTPUT_DIRECTORY")));
// step2
wizard.setExtractAll(Config_getBool("EXTRACT_ALL"));
......@@ -979,12 +992,12 @@ void MainWidget::launchWizard()
// -------- Store the results ----------------
// step1
Config_getString("PROJECT_NAME")=wizard.getProjectName();
Config_getString("PROJECT_NAME")=wizard.getProjectName().local8Bit();
Config_getString("PROJECT_NUMBER")=wizard.getProjectNumber();
Config_getList("INPUT").clear();
Config_getList("INPUT").append(wizard.getSourceDir());
Config_getBool("RECURSIVE")=wizard.scanRecursively();
Config_getString("OUTPUT_DIRECTORY")=wizard.getDestinationDir();
Config_getString("OUTPUT_DIRECTORY")=wizard.getDestinationDir().local8Bit();
// step2
if (wizard.extractAll())
......@@ -1125,7 +1138,7 @@ void MainWidget::loadConfigFromFile(const QString &fn)
else
{
Config::instance()->convertStrToVal();
#if defined(Q_OS_MACX)
#if 0 //defined(Q_OS_MACX)
if (checkIfDotInstalled() &&
qstricmp(Config_getString("DOT_PATH"),DOT_PATH)!=0
)
......@@ -1163,9 +1176,9 @@ void MainWidget::launchExpert()
Expert expert(this);
expert.init();
expert.exec();
#if defined(Q_OS_MACX)
setDotPath();
#endif
//#if defined(Q_OS_MACX)
// setDotPath();
//#endif
if (expert.hasChanged()) setConfigSaved(FALSE);
}
......
......@@ -6,6 +6,7 @@ class QObject;
class IInput
{
public:
virtual ~IInput() {}
virtual void init() = 0;
virtual void setEnabled(bool) = 0;
virtual QObject *qobject() = 0;
......
......@@ -20,7 +20,7 @@ doxygen_version_minor=4
doxygen_version_revision=7
#NOTE: Setting version_mmn to "NO" will omit mmn info from the package.
doxygen_version_mmn=20060716
doxygen_version_mmn=20060809
bin_dirs=`echo $PATH | sed -e "s/:/ /g"`
......@@ -34,6 +34,7 @@ f_prefix=/usr/local
f_insttool=NO
f_english=NO
f_wizard=NO
f_app=NO
f_thread=NO
f_langs=nl,se,cz,fr,id,it,de,jp,je,es,fi,ru,hr,pl,pt,hu,kr,ke,ro,si,cn,no,br,dk,sk,ua,gr,tw,sr,ca,lt,za,ar,fa
......@@ -81,6 +82,9 @@ while test -n "$1"; do
--with-doxywizard | -with-doxywizard)
f_wizard=YES
;;
--with-doxyapp | -with-doxyapp)
f_app=YES
;;
-h | -help | --help)
f_help=y
;;
......@@ -521,7 +525,7 @@ TMAKE_CXXFLAGS += -DENGLISH_ONLY
EOF
fi
f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/doxmlparser/src/Makefile.in addon/doxmlparser/test/Makefile.in addon/doxmlparser/examples/metrics/Makefile.in libpng/Makefile.in libmd5/Makefile.in"
f_inmakefiles="Makefile.in qtools/Makefile.in src/Makefile.in examples/Makefile.in doc/Makefile.in addon/doxywizard/Makefile.in addon/doxmlparser/src/Makefile.in addon/doxmlparser/test/Makefile.in addon/doxmlparser/examples/metrics/Makefile.in libpng/Makefile.in libmd5/Makefile.in addon/doxyapp/Makefile.in"
for i in $f_inmakefiles ; do
SRC=$i
......@@ -544,6 +548,9 @@ EOF
if test $f_wizard = YES; then
echo " \$(MAKE) -C addon/doxywizard" >> $DST
fi
if test $f_app = YES; then
echo " \$(MAKE) -C addon/doxyapp" >> $DST
fi
echo "" >> $DST
echo "doxywizard_install:" >> $DST
if test $f_wizard = YES; then
......@@ -555,7 +562,7 @@ EOF
echo " Created $DST from $SRC..."
done
f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in addon/doxmlparser/examples/metrics/metrics.pro.in libpng/libpng.pro.in libmd5/libmd5.pro.in"
f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in addon/doxmlparser/examples/metrics/metrics.pro.in libpng/libpng.pro.in libmd5/libmd5.pro.in addon/doxyapp/doxyapp.pro.in"
for i in $f_inprofiles ; do
SRC=$i
......
......@@ -37,6 +37,12 @@
#include "docparser.h"
#include "searchindex.h"
//static inline MemberList *createNewMemberList(MemberList::ListType lt)
//{
// MemberList *result = new MemberList(lt);
// return result;
//}
// constructs a new class definition
ClassDef::ClassDef(
......@@ -98,6 +104,8 @@ ClassDef::ClassDef(
m_isLocal=FALSE;
}
#if 0
pubMethods=0;
proMethods=0;
pacMethods=0;
......@@ -137,6 +145,7 @@ ClassDef::ClassDef(
variableMembers=0;
propertyMembers=0;
eventMembers=0;
#endif
}
......@@ -157,6 +166,48 @@ ClassDef::~ClassDef()
delete m_variableInstances;
delete m_templBaseClassNames;
delete m_tempArgs;
#if 0
delete pubMethods;
delete proMethods;
delete pacMethods;
delete priMethods;
delete pubStaticMethods;
delete proStaticMethods;
delete pacStaticMethods;
delete priStaticMethods;
delete pubSlots;
delete proSlots;
delete priSlots;
delete pubAttribs;
delete proAttribs;
delete pacAttribs;
delete priAttribs;
delete pubStaticAttribs;
delete proStaticAttribs;
delete pacStaticAttribs;
delete priStaticAttribs;
delete pubTypes;
delete proTypes;
delete pacTypes;
delete priTypes;
delete related;
delete signals;
delete friends;
delete dcopMethods;
delete properties;
delete events;
delete constructors;
delete typedefMembers;
delete enumMembers;
delete enumValMembers;
delete functionMembers;
delete relatedMembers;
delete variableMembers;
delete propertyMembers;
delete eventMembers;
#endif
}
QCString ClassDef::getMemberListFileName() const
......@@ -217,35 +268,15 @@ void ClassDef::insertSubClass(ClassDef *cd,Protection p,
void ClassDef::addMembersToMemberGroup()
{
::addMembersToMemberGroup(pubTypes,&memberGroupSDict,this);
::addMembersToMemberGroup(pubMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(pubAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(pubSlots,&memberGroupSDict,this);
::addMembersToMemberGroup(signals,&memberGroupSDict,this);
::addMembersToMemberGroup(dcopMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(pubStaticMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(pubStaticAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(pacTypes,&memberGroupSDict,this);
::addMembersToMemberGroup(pacMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(pacAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(pacStaticMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(pacStaticAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(proTypes,&memberGroupSDict,this);
::addMembersToMemberGroup(proMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(proAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(proSlots,&memberGroupSDict,this);
::addMembersToMemberGroup(proStaticMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(proStaticAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(priTypes,&memberGroupSDict,this);
::addMembersToMemberGroup(priMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(priAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(priSlots,&memberGroupSDict,this);
::addMembersToMemberGroup(priStaticMethods,&memberGroupSDict,this);
::addMembersToMemberGroup(priStaticAttribs,&memberGroupSDict,this);
::addMembersToMemberGroup(friends,&memberGroupSDict,this);
::addMembersToMemberGroup(related,&memberGroupSDict,this);
::addMembersToMemberGroup(properties,&memberGroupSDict,this);
::addMembersToMemberGroup(events,&memberGroupSDict,this);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::detailedLists)==0)
{
::addMembersToMemberGroup(ml,&memberGroupSDict,this);
}
}
// add members inside sections to their groups
if (memberGroupSDict)
......@@ -272,93 +303,47 @@ void ClassDef::internalInsertMember(MemberDef *md,
//printf("adding %s::%s\n",name().data(),md->name().data());
if (!isReference())
{
static bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS");
static bool extractPrivate = Config_getBool("EXTRACT_PRIVATE");
/********************************************/
/* insert member in the declaration section */
/********************************************/
if (md->isRelated() &&
(Config_getBool("EXTRACT_PRIVATE") || prot!=Private))
if (md->isRelated() && (extractPrivate || prot!=Private))
{
if (related==0) related = new MemberList;
if (sortBriefDocs)
related->inSort(md);
else
related->append(md);
md->setSectionList(this,related);
addMemberToList(MemberList::related,md);
}
else if (md->isFriend())
{
if (friends==0) friends = new MemberList;
if (sortBriefDocs)
friends->inSort(md);
else
friends->append(md);
md->setSectionList(this,friends);
addMemberToList(MemberList::friends,md);
}
else
{
switch (md->memberType())
{
case MemberDef::Signal: // Qt specific
if (signals==0) signals = new MemberList;
if (sortBriefDocs)
signals->inSort(md);
else
signals->append(md);
md->setSectionList(this,signals);
addMemberToList(MemberList::signals,md);
break;
case MemberDef::DCOP: // KDE2 specific
if (dcopMethods==0) dcopMethods = new MemberList;
if (sortBriefDocs)
dcopMethods->inSort(md);
else
dcopMethods->append(md);
md->setSectionList(this,dcopMethods);
addMemberToList(MemberList::dcopMethods,md);
break;
case MemberDef::Property:
if (properties==0) properties = new MemberList;
if (sortBriefDocs)
properties->inSort(md);
else
properties->append(md);
md->setSectionList(this,properties);
addMemberToList(MemberList::properties,md);
break;
case MemberDef::Event:
if (events==0) events = new MemberList;
if (sortBriefDocs)
events->inSort(md);
else
events->append(md);
md->setSectionList(this,events);
addMemberToList(MemberList::events,md);
break;
case MemberDef::Slot: // Qt specific
switch (prot)
{
case Protected:
case Package: // slots in packages are not possible!
if (proSlots==0) proSlots = new MemberList;
if (sortBriefDocs)
proSlots->inSort(md);
else
proSlots->append(md);
md->setSectionList(this,proSlots);
break;
addMemberToList(MemberList::proSlots,md);
break;
case Public:
if (pubSlots==0) pubSlots = new MemberList;
if (sortBriefDocs)
pubSlots->inSort(md);
else
pubSlots->append(md);
md->setSectionList(this,pubSlots);
addMemberToList(MemberList::pubSlots,md);
break;
case Private:
if (priSlots==0) priSlots = new MemberList;
if (sortBriefDocs)
priSlots->inSort(md);
else
priSlots->append(md);
md->setSectionList(this,priSlots);
addMemberToList(MemberList::priSlots,md);
break;
}
break;
......@@ -370,36 +355,16 @@ void ClassDef::internalInsertMember(MemberDef *md,
switch (prot)
{
case Protected:
if (proStaticAttribs==0) proStaticAttribs= new MemberList;
if (sortBriefDocs)
proStaticAttribs->inSort(md);
else
proStaticAttribs->append(md);
md->setSectionList(this,proStaticAttribs);
addMemberToList(MemberList::proStaticAttribs,md);
break;
case Package:
if (pacStaticAttribs==0) pacStaticAttribs= new MemberList;
if (sortBriefDocs)
pacStaticAttribs->inSort(md);
else
pacStaticAttribs->append(md);
md->setSectionList(this,pacStaticAttribs);
addMemberToList(MemberList::pacStaticAttribs,md);
break;
case Public:
if (pubStaticAttribs==0) pubStaticAttribs= new MemberList;
if (sortBriefDocs)
pubStaticAttribs->inSort(md);
else
pubStaticAttribs->append(md);
md->setSectionList(this,pubStaticAttribs);
addMemberToList(MemberList::pubStaticAttribs,md);
break;
case Private:
if (priStaticAttribs==0) priStaticAttribs= new MemberList;
if (sortBriefDocs)
priStaticAttribs->inSort(md);
else
priStaticAttribs->append(md);
md->setSectionList(this,priStaticAttribs);
addMemberToList(MemberList::priStaticAttribs,md);
break;
}
}
......@@ -408,36 +373,16 @@ void ClassDef::internalInsertMember(MemberDef *md,
switch (prot)
{
case Protected:
if (proStaticMethods==0) proStaticMethods = new MemberList;
if (sortBriefDocs)
proStaticMethods->inSort(md);
else
proStaticMethods->append(md);
md->setSectionList(this,proStaticMethods);
addMemberToList(MemberList::proStaticMethods,md);
break;
case Package:
if (pacStaticMethods==0) pacStaticMethods = new MemberList;
if (sortBriefDocs)
pacStaticMethods->inSort(md);
else
pacStaticMethods->append(md);
md->setSectionList(this,pacStaticMethods);
addMemberToList(MemberList::pacStaticMethods,md);
break;
case Public:
if (pubStaticMethods==0) pubStaticMethods = new MemberList;
if (sortBriefDocs)
pubStaticMethods->inSort(md);
else
pubStaticMethods->append(md);
md->setSectionList(this,pubStaticMethods);
addMemberToList(MemberList::pubStaticMethods,md);
break;
case Private:
if (priStaticMethods==0) priStaticMethods = new MemberList;
if (sortBriefDocs)
priStaticMethods->inSort(md);
else
priStaticMethods->append(md);
md->setSectionList(this,priStaticMethods);
addMemberToList(MemberList::priStaticMethods,md);
break;
}
}
......@@ -449,36 +394,16 @@ void ClassDef::internalInsertMember(MemberDef *md,
switch (prot)
{
case Protected:
if (proAttribs==0) proAttribs = new MemberList;
if (sortBriefDocs)
proAttribs->inSort(md);
else
proAttribs->append(md);
md->setSectionList(this,proAttribs);
addMemberToList(MemberList::proAttribs,md);
break;
case Package:
if (pacAttribs==0) pacAttribs = new MemberList;
if (sortBriefDocs)
pacAttribs->inSort(md);
else
pacAttribs->append(md);
md->setSectionList(this,pacAttribs);
addMemberToList(MemberList::pacAttribs,md);
break;
case Public:
if (pubAttribs==0) pubAttribs = new MemberList;
if (sortBriefDocs)
pubAttribs->inSort(md);
else
pubAttribs->append(md);
md->setSectionList(this,pubAttribs);
addMemberToList(MemberList::pubAttribs,md);
break;
case Private:
if (priAttribs==0) priAttribs = new MemberList;
if (sortBriefDocs)
priAttribs->inSort(md);
else
priAttribs->append(md);
md->setSectionList(this,priAttribs);
addMemberToList(MemberList::priAttribs,md);
break;
}
}
......@@ -487,36 +412,16 @@ void ClassDef::internalInsertMember(MemberDef *md,
switch (prot)
{
case Protected:
if (proTypes==0) proTypes = new MemberList;
if (sortBriefDocs)
proTypes->inSort(md);
else
proTypes->append(md);
md->setSectionList(this,proTypes);
addMemberToList(MemberList::proTypes,md);
break;
case Package:
if (pacTypes==0) pacTypes = new MemberList;
if (sortBriefDocs)
pacTypes->inSort(md);
else
pacTypes->append(md);
md->setSectionList(this,pacTypes);
addMemberToList(MemberList::pacTypes,md);
break;
case Public:
if (pubTypes==0) pubTypes = new MemberList;
if (sortBriefDocs)
pubTypes->inSort(md);
else
pubTypes->append(md);
md->setSectionList(this,pubTypes);
addMemberToList(MemberList::pubTypes,md);
break;
case Private:
if (priTypes==0) priTypes = new MemberList;
if (sortBriefDocs)
priTypes->inSort(md);
else
priTypes->append(md);
md->setSectionList(this,priTypes);
addMemberToList(MemberList::priTypes,md);
break;
}
}
......@@ -525,36 +430,16 @@ void ClassDef::internalInsertMember(MemberDef *md,
switch (prot)
{
case Protected:
if (proMethods==0) proMethods = new MemberList;
if (sortBriefDocs)
proMethods->inSort(md);
else
proMethods->append(md);
md->setSectionList(this,proMethods);
addMemberToList(MemberList::proMethods,md);
break;
case Package:
if (pacMethods==0) pacMethods = new MemberList;
if (sortBriefDocs)
pacMethods->inSort(md);
else
pacMethods->append(md);
md->setSectionList(this,pacMethods);
addMemberToList(MemberList::pacMethods,md);
break;
case Public:
if (pubMethods==0) pubMethods = new MemberList;
if (sortBriefDocs)
pubMethods->inSort(md);
else
pubMethods->append(md);
md->setSectionList(this,pubMethods);
addMemberToList(MemberList::pubMethods,md);
break;
case Private:
if (priMethods==0) priMethods = new MemberList;
if (sortBriefDocs)
priMethods->inSort(md);
else
priMethods->append(md);
md->setSectionList(this,priMethods);
addMemberToList(MemberList::priMethods,md);
break;
}
}
......@@ -566,42 +451,23 @@ void ClassDef::internalInsertMember(MemberDef *md,
/*******************************************************/
/* insert member in the detailed documentation section */
/*******************************************************/
if ((md->isRelated() &&
(Config_getBool("EXTRACT_PRIVATE") || prot!=Private)
) || md->isFriend()
)
if ((md->isRelated() && (extractPrivate || prot!=Private)) || md->isFriend())
{
if (relatedMembers==0) relatedMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
relatedMembers->inSort(md);
else
relatedMembers->append(md);
addMemberToList(MemberList::relatedMembers,md);
}
else
{
switch (md->memberType())
{
case MemberDef::Property:
if (propertyMembers==0) propertyMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
propertyMembers->inSort(md);
else
propertyMembers->append(md);
addMemberToList(MemberList::propertyMembers,md);
break;
case MemberDef::Event:
if (eventMembers==0) eventMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
eventMembers->inSort(md);
else
eventMembers->append(md);
addMemberToList(MemberList::eventMembers,md);
break;
case MemberDef::Signal: // fall through
case MemberDef::DCOP:
if (functionMembers==0) functionMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
functionMembers->inSort(md);
else
functionMembers->append(md);
addMemberToList(MemberList::functionMembers,md);
break;
case MemberDef::Slot:
switch (prot)
......@@ -609,71 +475,44 @@ void ClassDef::internalInsertMember(MemberDef *md,
case Protected:
case Package:
case Public:
if (functionMembers==0) functionMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
functionMembers->inSort(md);
else
functionMembers->append(md);
addMemberToList(MemberList::functionMembers,md);
break;
case Private:
if (functionMembers==0) functionMembers = new MemberList;
if (Config_getBool("EXTRACT_PRIVATE"))
if (extractPrivate)
{
if (Config_getBool("SORT_MEMBER_DOCS"))
functionMembers->inSort(md);
else
functionMembers->append(md);
addMemberToList(MemberList::functionMembers,md);
}
break;
}
break;
default: // any of the other members
if (prot!=Private || Config_getBool("EXTRACT_PRIVATE"))
if (prot!=Private || extractPrivate)
{
switch (md->memberType())
{
case MemberDef::Typedef:
if (typedefMembers==0) typedefMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
typedefMembers->inSort(md);
else
typedefMembers->append(md);
addMemberToList(MemberList::typedefMembers,md);
break;
case MemberDef::Enumeration:
if (enumMembers==0) enumMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
enumMembers->inSort(md);
else
enumMembers->append(md);
addMemberToList(MemberList::enumMembers,md);
break;
case MemberDef::EnumValue:
if (enumValMembers==0) enumValMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
enumValMembers->inSort(md);
else
enumValMembers->append(md);
addMemberToList(MemberList::enumValMembers,md);
break;
case MemberDef::Function:
if (md->isConstructor() || md->isDestructor())
{
if (constructors==0) constructors = new MemberList;
constructors->append(md);
MemberList *ml = createMemberList(MemberList::constructors);
ml->append(md);
md->setSectionList(this,ml);
}
else
{
if (functionMembers==0) functionMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
functionMembers->inSort(md);
else
functionMembers->append(md);
addMemberToList(MemberList::functionMembers,md);
}
break;
case MemberDef::Variable:
if (variableMembers==0) variableMembers = new MemberList;
if (Config_getBool("SORT_MEMBER_DOCS"))
variableMembers->inSort(md);
else
variableMembers->append(md);
addMemberToList(MemberList::variableMembers,md);
break;
default:
err("Unexpected member type %d found!\n",md->memberType());
......@@ -735,34 +574,18 @@ void ClassDef::insertMember(MemberDef *md)
void ClassDef::computeAnchors()
{
ClassDef *context = Config_getBool("INLINE_INHERITED_MEMB") ? this : 0;
setAnchors(context,'a',pubMethods);
setAnchors(context,'b',proMethods);
setAnchors(context,'c',pacMethods);
setAnchors(context,'d',priMethods);
setAnchors(context,'e',pubStaticMethods);
setAnchors(context,'f',proStaticMethods);
setAnchors(context,'g',pacStaticMethods);
setAnchors(context,'h',priStaticMethods);
setAnchors(context,'i',pubSlots);
setAnchors(context,'j',proSlots);
setAnchors(context,'k',priSlots);
setAnchors(context,'l',signals);
setAnchors(context,'m',related);
setAnchors(context,'n',friends);
setAnchors(context,'o',pubAttribs);
setAnchors(context,'p',proAttribs);
setAnchors(context,'q',pacAttribs);
setAnchors(context,'r',priAttribs);
setAnchors(context,'s',pubStaticAttribs);
setAnchors(context,'t',proStaticAttribs);
setAnchors(context,'u',pacStaticAttribs);
setAnchors(context,'v',priStaticAttribs);
setAnchors(context,'w',pubTypes);
setAnchors(context,'x',proTypes);
setAnchors(context,'y',priTypes);
setAnchors(context,'z',dcopMethods);
setAnchors(context,'0',properties);
setAnchors(context,'1',events);
const char *letters = "abcdefghijklmnopqrstuvwxyz0123456789";
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
int index = 0;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::detailedLists)==0)
{
setAnchors(context,letters[index++],ml);
}
}
if (memberGroupSDict)
{
MemberGroupSDict::Iterator mgli(*memberGroupSDict);
......@@ -799,35 +622,15 @@ void ClassDef::findSectionsInDocumentation()
mg->findSectionsInDocumentation();
}
}
if (pubTypes) pubTypes->findSectionsInDocumentation();
if (pubMethods) pubMethods->findSectionsInDocumentation();
if (pubAttribs) pubAttribs->findSectionsInDocumentation();
if (pubSlots) pubSlots->findSectionsInDocumentation();
if (signals) signals->findSectionsInDocumentation();
if (dcopMethods) dcopMethods->findSectionsInDocumentation();
if (pubStaticMethods) pubStaticMethods->findSectionsInDocumentation();
if (pubStaticAttribs) pubStaticAttribs->findSectionsInDocumentation();
if (pacTypes) pacTypes->findSectionsInDocumentation();
if (pacMethods) pacMethods->findSectionsInDocumentation();
if (pacAttribs) pacAttribs->findSectionsInDocumentation();
if (pacStaticMethods) pacStaticMethods->findSectionsInDocumentation();
if (pacStaticAttribs) pacStaticAttribs->findSectionsInDocumentation();
if (proTypes) proTypes->findSectionsInDocumentation();
if (proMethods) proMethods->findSectionsInDocumentation();
if (proAttribs) proAttribs->findSectionsInDocumentation();
if (proSlots) proSlots->findSectionsInDocumentation();
if (proStaticMethods) proStaticMethods->findSectionsInDocumentation();
if (proStaticAttribs) proStaticAttribs->findSectionsInDocumentation();
if (priTypes) priTypes->findSectionsInDocumentation();
if (priMethods) priMethods->findSectionsInDocumentation();
if (priAttribs) priAttribs->findSectionsInDocumentation();
if (priSlots) priSlots->findSectionsInDocumentation();
if (priStaticMethods) priStaticMethods->findSectionsInDocumentation();
if (priStaticAttribs) priStaticAttribs->findSectionsInDocumentation();
if (friends) friends->findSectionsInDocumentation();
if (related) related->findSectionsInDocumentation();
if (properties) properties->findSectionsInDocumentation();
if (events) events->findSectionsInDocumentation();
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::detailedLists)==0)
{
ml->findSectionsInDocumentation();
}
}
}
......@@ -1502,71 +1305,102 @@ void ClassDef::writeDocumentation(OutputList &ol)
}
// public types
if (pubTypes) pubTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicTypes(),0);
writeMemberDeclarations(ol,MemberList::pubTypes,theTranslator->trPublicTypes());
//if (pubTypes) pubTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicTypes(),0);
// public methods
if (pubSlots) pubSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicSlots(),0);
if (signals) signals->writeDeclarations(ol,this,0,0,0,theTranslator->trSignals(),0);
if (dcopMethods) dcopMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trDCOPMethods(),0);
if (pubMethods) pubMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicMembers(),0);
if (pubStaticMethods) pubStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicMembers(),0);
writeMemberDeclarations(ol,MemberList::pubSlots,theTranslator->trPublicSlots());
//if (pubSlots) pubSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicSlots(),0);
writeMemberDeclarations(ol,MemberList::signals,theTranslator->trSignals());
//if (signals) signals->writeDeclarations(ol,this,0,0,0,theTranslator->trSignals(),0);
writeMemberDeclarations(ol,MemberList::dcopMethods,theTranslator->trDCOPMethods());
//if (dcopMethods) dcopMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trDCOPMethods(),0);
writeMemberDeclarations(ol,MemberList::pubMethods,theTranslator->trPublicMembers());
//if (pubMethods) pubMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicMembers(),0);
writeMemberDeclarations(ol,MemberList::pubStaticMethods,theTranslator->trStaticPublicMembers());
//if (pubStaticMethods) pubStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicMembers(),0);
// public attribs
if (pubAttribs) pubAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicAttribs(),0);
if (pubStaticAttribs) pubStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicAttribs(),0);
writeMemberDeclarations(ol,MemberList::pubAttribs,theTranslator->trPublicAttribs());
//if (pubAttribs) pubAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPublicAttribs(),0);
writeMemberDeclarations(ol,MemberList::pubStaticAttribs,theTranslator->trStaticPublicAttribs());
//if (pubStaticAttribs) pubStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPublicAttribs(),0);
// protected types
if (proTypes) proTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedTypes(),0);
writeMemberDeclarations(ol,MemberList::proTypes,theTranslator->trProtectedTypes());
//if (proTypes) proTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedTypes(),0);
// protected methods
if (proSlots) proSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedSlots(),0);
if (proMethods) proMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedMembers(),0);
if (proStaticMethods) proStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedMembers(),0);
writeMemberDeclarations(ol,MemberList::proSlots,theTranslator->trProtectedSlots());
//if (proSlots) proSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedSlots(),0);
writeMemberDeclarations(ol,MemberList::proMethods,theTranslator->trProtectedMembers());
//if (proMethods) proMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedMembers(),0);
writeMemberDeclarations(ol,MemberList::proStaticMethods,theTranslator->trStaticProtectedMembers());
//if (proStaticMethods) proStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedMembers(),0);
// protected attribs
if (proAttribs) proAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedAttribs(),0);
if (proStaticAttribs) proStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedAttribs(),0);
writeMemberDeclarations(ol,MemberList::proAttribs,theTranslator->trProtectedAttribs());
//if (proAttribs) proAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trProtectedAttribs(),0);
writeMemberDeclarations(ol,MemberList::proStaticAttribs,theTranslator->trStaticProtectedAttribs());
//if (proStaticAttribs) proStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticProtectedAttribs(),0);
// package types
if (pacTypes) pacTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageTypes(),0);
writeMemberDeclarations(ol,MemberList::pacTypes,theTranslator->trPackageTypes());
//if (pacTypes) pacTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageTypes(),0);
// package methods
if (pacMethods) pacMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageMembers(),0);
if (pacStaticMethods) pacStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageMembers(),0);
writeMemberDeclarations(ol,MemberList::pacMethods,theTranslator->trPackageMembers());
//if (pacMethods) pacMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageMembers(),0);
writeMemberDeclarations(ol,MemberList::pacStaticMethods,theTranslator->trStaticPackageMembers());
//if (pacStaticMethods) pacStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageMembers(),0);
// package attribs
if (pacAttribs) pacAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageAttribs(),0);
if (pacStaticAttribs) pacStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageAttribs(),0);
writeMemberDeclarations(ol,MemberList::pacAttribs,theTranslator->trPackageAttribs());
//if (pacAttribs) pacAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPackageAttribs(),0);
writeMemberDeclarations(ol,MemberList::pacStaticAttribs,theTranslator->trStaticPackageAttribs());
//if (pacStaticAttribs) pacStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPackageAttribs(),0);
// package
if (properties) properties->writeDeclarations(ol,this,0,0,0,theTranslator->trProperties(),0);
writeMemberDeclarations(ol,MemberList::properties,theTranslator->trProperties());
//if (properties) properties->writeDeclarations(ol,this,0,0,0,theTranslator->trProperties(),0);
// events
if (events) events->writeDeclarations(ol,this,0,0,0,theTranslator->trEvents(),0);
writeMemberDeclarations(ol,MemberList::events,theTranslator->trEvents());
//if (events) events->writeDeclarations(ol,this,0,0,0,theTranslator->trEvents(),0);
if (Config_getBool("EXTRACT_PRIVATE"))
{
// private types
if (priTypes) priTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateTypes(),0);
writeMemberDeclarations(ol,MemberList::priTypes,theTranslator->trPrivateTypes());
//if (priTypes) priTypes->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateTypes(),0);
// private members
if (priSlots) priSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateSlots(),0);
if (priMethods) priMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateMembers(),0);
if (priStaticMethods) priStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateMembers(),0);
writeMemberDeclarations(ol,MemberList::priSlots,theTranslator->trPrivateSlots());
//if (priSlots) priSlots->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateSlots(),0);
writeMemberDeclarations(ol,MemberList::priMethods,theTranslator->trPrivateMembers());
//if (priMethods) priMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateMembers(),0);
writeMemberDeclarations(ol,MemberList::priStaticMethods,theTranslator->trStaticPrivateMembers());
//if (priStaticMethods) priStaticMethods->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateMembers(),0);
// private attribs
if (priAttribs) priAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateAttribs(),0);
if (priStaticAttribs) priStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateAttribs(),0);
writeMemberDeclarations(ol,MemberList::priAttribs,theTranslator->trPrivateAttribs());
//if (priAttribs) priAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trPrivateAttribs(),0);
writeMemberDeclarations(ol,MemberList::priStaticAttribs,theTranslator->trStaticPrivateAttribs());
//if (priStaticAttribs) priStaticAttribs->writeDeclarations(ol,this,0,0,0,theTranslator->trStaticPrivateAttribs(),0);
}
// friends
if (friends) friends->writeDeclarations(ol,this,0,0,0,theTranslator->trFriends(),0);
writeMemberDeclarations(ol,MemberList::friends,theTranslator->trFriends());
//if (friends) friends->writeDeclarations(ol,this,0,0,0,theTranslator->trFriends(),0);
// related functions
if (related) related->writeDeclarations(ol,this,0,0,0,
theTranslator->trRelatedFunctions(),
writeMemberDeclarations(ol,MemberList::related,theTranslator->trRelatedFunctions(),
theTranslator->trRelatedSubscript()
);
//if (related) related->writeDeclarations(ol,this,0,0,0,
// theTranslator->trRelatedFunctions(),
// theTranslator->trRelatedSubscript()
// );
// nested classes
if (m_innerClasses) m_innerClasses->writeDeclaration(ol,0,0,TRUE);
......@@ -1628,29 +1462,37 @@ void ClassDef::writeMemberDocumentation(OutputList &ol)
Doxygen::suppressDocWarnings = TRUE;
}
if (typedefMembers) typedefMembers->writeDocumentation(ol,name(),this,
theTranslator->trMemberTypedefDocumentation());
writeMemberDocumentation(ol,MemberList::typedefMembers,theTranslator->trMemberTypedefDocumentation());
//if (typedefMembers) typedefMembers->writeDocumentation(ol,name(),this,
// theTranslator->trMemberTypedefDocumentation());
if (enumMembers) enumMembers->writeDocumentation(ol,name(),this,
theTranslator->trMemberEnumerationDocumentation());
writeMemberDocumentation(ol,MemberList::enumMembers,theTranslator->trMemberEnumerationDocumentation());
//if (enumMembers) enumMembers->writeDocumentation(ol,name(),this,
// theTranslator->trMemberEnumerationDocumentation());
if (constructors) constructors->writeDocumentation(ol,name(),this,
theTranslator->trConstructorDocumentation());
writeMemberDocumentation(ol,MemberList::constructors,theTranslator->trConstructorDocumentation());
//if (constructors) constructors->writeDocumentation(ol,name(),this,
// theTranslator->trConstructorDocumentation());
if (functionMembers) functionMembers->writeDocumentation(ol,name(),this,
theTranslator->trMemberFunctionDocumentation());
writeMemberDocumentation(ol,MemberList::functionMembers,theTranslator->trMemberFunctionDocumentation());
//if (functionMembers) functionMembers->writeDocumentation(ol,name(),this,
// theTranslator->trMemberFunctionDocumentation());
if (relatedMembers) relatedMembers->writeDocumentation(ol,name(),this,
theTranslator->trRelatedFunctionDocumentation());
writeMemberDocumentation(ol,MemberList::relatedMembers,theTranslator->trRelatedFunctionDocumentation());
//if (relatedMembers) relatedMembers->writeDocumentation(ol,name(),this,
// theTranslator->trRelatedFunctionDocumentation());
if (variableMembers) variableMembers->writeDocumentation(ol,name(),this,
theTranslator->trMemberDataDocumentation());
writeMemberDocumentation(ol,MemberList::variableMembers,theTranslator->trMemberDataDocumentation());
//if (variableMembers) variableMembers->writeDocumentation(ol,name(),this,
// theTranslator->trMemberDataDocumentation());
if (propertyMembers) propertyMembers->writeDocumentation(ol,name(),this,
theTranslator->trPropertyDocumentation());
writeMemberDocumentation(ol,MemberList::propertyMembers,theTranslator->trPropertyDocumentation());
//if (propertyMembers) propertyMembers->writeDocumentation(ol,name(),this,
// theTranslator->trPropertyDocumentation());
if (eventMembers) eventMembers->writeDocumentation(ol,name(),this,
theTranslator->trEventDocumentation());
writeMemberDocumentation(ol,MemberList::eventMembers,theTranslator->trEventDocumentation());
//if (eventMembers) eventMembers->writeDocumentation(ol,name(),this,
// theTranslator->trEventDocumentation());
if (Config_getBool("SEPARATE_MEMBER_PAGES"))
{
......@@ -1668,6 +1510,16 @@ void ClassDef::writeMemberPages(OutputList &ol)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::detailedLists)
{
ml->writeDocumentationPage(ol,name(),this);
}
}
#if 0
if (typedefMembers) typedefMembers->writeDocumentationPage(ol,name(),this);
if (enumMembers) enumMembers->writeDocumentationPage(ol,name(),this);
if (constructors) constructors->writeDocumentationPage(ol,name(),this);
......@@ -1676,6 +1528,7 @@ void ClassDef::writeMemberPages(OutputList &ol)
if (variableMembers) variableMembers->writeDocumentationPage(ol,name(),this);
if (propertyMembers) propertyMembers->writeDocumentationPage(ol,name(),this);
if (eventMembers) eventMembers->writeDocumentationPage(ol,name(),this);
#endif
ol.popGeneratorState();
}
......@@ -2082,67 +1935,96 @@ void ClassDef::writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup)
}
}
if (pubTypes) pubTypes->setInGroup(inGroup);
if (pubTypes) pubTypes->writePlainDeclarations(ol,this,0,0,0);
if (pubMethods) pubMethods->setInGroup(inGroup);
if (pubMethods) pubMethods->writePlainDeclarations(ol,this,0,0,0);
if (pubAttribs) pubAttribs->setInGroup(inGroup);
if (pubAttribs) pubAttribs->writePlainDeclarations(ol,this,0,0,0);
if (pubSlots) pubSlots->setInGroup(inGroup);
if (pubSlots) pubSlots->writePlainDeclarations(ol,this,0,0,0);
if (signals) signals->setInGroup(inGroup);
if (signals) signals->writePlainDeclarations(ol,this,0,0,0);
if (dcopMethods) dcopMethods->setInGroup(inGroup);
if (dcopMethods) dcopMethods->writePlainDeclarations(ol,this,0,0,0);
if (properties) properties->setInGroup(inGroup);
if (properties) properties->writePlainDeclarations(ol,this,0,0,0);
if (events) events->setInGroup(inGroup);
if (events) events->writePlainDeclarations(ol,this,0,0,0);
if (pubStaticMethods) pubStaticMethods->setInGroup(inGroup);
if (pubStaticMethods) pubStaticMethods->writePlainDeclarations(ol,this,0,0,0);
if (pubStaticAttribs) pubStaticAttribs->setInGroup(inGroup);
if (pubStaticAttribs) pubStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
if (proTypes) proTypes->setInGroup(inGroup);
if (proTypes) proTypes->writePlainDeclarations(ol,this,0,0,0);
if (proMethods) proMethods->setInGroup(inGroup);
if (proMethods) proMethods->writePlainDeclarations(ol,this,0,0,0);
if (proAttribs) proAttribs->setInGroup(inGroup);
if (proAttribs) proAttribs->writePlainDeclarations(ol,this,0,0,0);
if (proSlots) proSlots->setInGroup(inGroup);
if (proSlots) proSlots->writePlainDeclarations(ol,this,0,0,0);
if (proStaticMethods) proStaticMethods->setInGroup(inGroup);
if (proStaticMethods) proStaticMethods->writePlainDeclarations(ol,this,0,0,0);
if (proStaticAttribs) proStaticAttribs->setInGroup(inGroup);
if (proStaticAttribs) proStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
if (pacTypes) pacTypes->setInGroup(inGroup);
if (pacTypes) pacTypes->writePlainDeclarations(ol,this,0,0,0);
if (pacMethods) pacMethods->setInGroup(inGroup);
if (pacMethods) pacMethods->writePlainDeclarations(ol,this,0,0,0);
if (pacAttribs) pacAttribs->setInGroup(inGroup);
if (pacAttribs) pacAttribs->writePlainDeclarations(ol,this,0,0,0);
if (pacStaticMethods) pacStaticMethods->setInGroup(inGroup);
if (pacStaticMethods) pacStaticMethods->writePlainDeclarations(ol,this,0,0,0);
if (pacStaticAttribs) pacStaticAttribs->setInGroup(inGroup);
if (pacStaticAttribs) pacStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pubTypes,inGroup);
//if (pubTypes) pubTypes->setInGroup(inGroup);
//if (pubTypes) pubTypes->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pubMethods,inGroup);
//if (pubMethods) pubMethods->setInGroup(inGroup);
//if (pubMethods) pubMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pubAttribs,inGroup);
//if (pubAttribs) pubAttribs->setInGroup(inGroup);
//if (pubAttribs) pubAttribs->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pubSlots,inGroup);
//if (pubSlots) pubSlots->setInGroup(inGroup);
//if (pubSlots) pubSlots->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::signals,inGroup);
//if (signals) signals->setInGroup(inGroup);
//if (signals) signals->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::dcopMethods,inGroup);
//if (dcopMethods) dcopMethods->setInGroup(inGroup);
//if (dcopMethods) dcopMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::properties,inGroup);
//if (properties) properties->setInGroup(inGroup);
//if (properties) properties->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::events,inGroup);
//if (events) events->setInGroup(inGroup);
//if (events) events->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pubStaticMethods,inGroup);
//if (pubStaticMethods) pubStaticMethods->setInGroup(inGroup);
//if (pubStaticMethods) pubStaticMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pubStaticAttribs,inGroup);
//if (pubStaticAttribs) pubStaticAttribs->setInGroup(inGroup);
//if (pubStaticAttribs) pubStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::proTypes,inGroup);
//if (proTypes) proTypes->setInGroup(inGroup);
//if (proTypes) proTypes->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::proMethods,inGroup);
//if (proMethods) proMethods->setInGroup(inGroup);
//if (proMethods) proMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::proAttribs,inGroup);
//if (proAttribs) proAttribs->setInGroup(inGroup);
//if (proAttribs) proAttribs->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::proSlots,inGroup);
//if (proSlots) proSlots->setInGroup(inGroup);
//if (proSlots) proSlots->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::proStaticMethods,inGroup);
//if (proStaticMethods) proStaticMethods->setInGroup(inGroup);
//if (proStaticMethods) proStaticMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::proStaticAttribs,inGroup);
//if (proStaticAttribs) proStaticAttribs->setInGroup(inGroup);
//if (proStaticAttribs) proStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pacTypes,inGroup);
//if (pacTypes) pacTypes->setInGroup(inGroup);
//if (pacTypes) pacTypes->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pacMethods,inGroup);
//if (pacMethods) pacMethods->setInGroup(inGroup);
//if (pacMethods) pacMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pacAttribs,inGroup);
//if (pacAttribs) pacAttribs->setInGroup(inGroup);
//if (pacAttribs) pacAttribs->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pacStaticMethods,inGroup);
//if (pacStaticMethods) pacStaticMethods->setInGroup(inGroup);
//if (pacStaticMethods) pacStaticMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::pacStaticAttribs,inGroup);
//if (pacStaticAttribs) pacStaticAttribs->setInGroup(inGroup);
//if (pacStaticAttribs) pacStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
if (Config_getBool("EXTRACT_PRIVATE"))
{
if (priTypes) priTypes->setInGroup(inGroup);
if (priTypes) priTypes->writePlainDeclarations(ol,this,0,0,0);
if (priMethods) priMethods->setInGroup(inGroup);
if (priMethods) priMethods->writePlainDeclarations(ol,this,0,0,0);
if (priAttribs) priAttribs->setInGroup(inGroup);
if (priAttribs) priAttribs->writePlainDeclarations(ol,this,0,0,0);
if (priSlots) priSlots->setInGroup(inGroup);
if (priSlots) priSlots->writePlainDeclarations(ol,this,0,0,0);
if (priStaticMethods) priStaticMethods->setInGroup(inGroup);
if (priStaticMethods) priStaticMethods->writePlainDeclarations(ol,this,0,0,0);
if (priStaticAttribs) priStaticAttribs->setInGroup(inGroup);
if (priStaticAttribs) priStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
}
if (friends) friends->setInGroup(inGroup);
if (friends) friends->writePlainDeclarations(ol,this,0,0,0);
if (related) related->setInGroup(inGroup);
if (related) related->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::priTypes,inGroup);
//if (priTypes) priTypes->setInGroup(inGroup);
//if (priTypes) priTypes->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::priMethods,inGroup);
//if (priMethods) priMethods->setInGroup(inGroup);
//if (priMethods) priMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::priAttribs,inGroup);
//if (priAttribs) priAttribs->setInGroup(inGroup);
//if (priAttribs) priAttribs->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::priSlots,inGroup);
//if (priSlots) priSlots->setInGroup(inGroup);
//if (priSlots) priSlots->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::priStaticMethods,inGroup);
//if (priStaticMethods) priStaticMethods->setInGroup(inGroup);
//if (priStaticMethods) priStaticMethods->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::priStaticAttribs,inGroup);
//if (priStaticAttribs) priStaticAttribs->setInGroup(inGroup);
//if (priStaticAttribs) priStaticAttribs->writePlainDeclarations(ol,this,0,0,0);
}
writePlainMemberDeclaration(ol,MemberList::friends,inGroup);
//if (friends) friends->setInGroup(inGroup);
//if (friends) friends->writePlainDeclarations(ol,this,0,0,0);
writePlainMemberDeclaration(ol,MemberList::related,inGroup);
//if (related) related->setInGroup(inGroup);
//if (related) related->writePlainDeclarations(ol,this,0,0,0);
}
/*! a link to this class is possible within this project */
......@@ -3142,15 +3024,15 @@ void ClassDef::addListReferences()
mg->addListReferences(this);
}
}
if (constructors) constructors->addListReferences(this);
if (typedefMembers) typedefMembers->addListReferences(this);
if (enumMembers) enumMembers->addListReferences(this);
if (enumValMembers) enumValMembers->addListReferences(this);
if (functionMembers) functionMembers->addListReferences(this);
if (relatedMembers) relatedMembers->addListReferences(this);
if (variableMembers) variableMembers->addListReferences(this);
if (propertyMembers) propertyMembers->addListReferences(this);
if (eventMembers) eventMembers->addListReferences(this);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::detailedLists)
{
ml->addListReferences(this);
}
}
}
MemberDef *ClassDef::getMemberByName(const QCString &name)
......@@ -3183,3 +3065,69 @@ MemberDef *ClassDef::getMemberByName(const QCString &name)
return xmd;
}
MemberList *ClassDef::createMemberList(MemberList::ListType lt)
{
m_memberLists.setAutoDelete(TRUE);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()==lt)
{
return ml;
}
}
// not found, create a new member list
ml = new MemberList(lt);
m_memberLists.append(ml);
return ml;
}
MemberList *ClassDef::getMemberList(MemberList::ListType lt)
{
MemberList *ml = m_memberLists.first();
while (ml)
{
if (ml->listType()==lt)
{
return ml;
}
ml = m_memberLists.next();
}
return 0;
}
void ClassDef::addMemberToList(MemberList::ListType lt,MemberDef *md)
{
static bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS");
MemberList *ml = createMemberList(lt);
if (sortBriefDocs)
ml->inSort(md);
else
ml->append(md);
md->setSectionList(this,ml);
}
void ClassDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title,
const char *subTitle)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDeclarations(ol,this,0,0,0,title,subTitle);
}
void ClassDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDocumentation(ol,name(),this,title);
}
void ClassDef::writePlainMemberDeclaration(OutputList &ol,MemberList::ListType lt,bool inGroup)
{
MemberList * ml = getMemberList(lt);
if (ml)
{
ml->setInGroup(inGroup);
ml->writePlainDeclarations(ol,this,0,0,0);
}
}
......@@ -54,10 +54,6 @@ struct IncludeInfo;
class ClassDef : public Definition
{
public:
/*! \name Public API
* \{
*/
/*! The various compound types */
enum CompoundType { Class=Entry::CLASS_SEC,
Struct=Entry::STRUCT_SEC,
......@@ -67,22 +63,68 @@ class ClassDef : public Definition
Category=Entry::CATEGORY_SEC,
Exception=Entry::EXCEPTION_SEC
};
/*! Creates a new compound definition.
* \param fileName full path and file name in which this compound was
* found.
* \param startLine line number where the definition of this compound
* starts.
* \param name the name of this compound (including scope)
* \param ct the kind of Compound
* \param ref the tag file from which this compound is extracted
* or 0 if the compound doesn't come from a tag file
* \param fName the file name as found in the tag file.
* This overwrites the file that doxygen normally
* generates based on the compound type & name.
* \param isSymbol If TRUE this class name is added as a publicly
* visible (and referencable) symbol.
*/
ClassDef(const char *fileName,int startLine,
const char *name,CompoundType ct,
const char *ref=0,const char *fName=0,
bool isSymbol=TRUE);
/*! Destroys a compound definition. */
~ClassDef();
//-----------------------------------------------------------------------------------
// --- getters
//-----------------------------------------------------------------------------------
/*! Used for RTTI, this is a class */
DefType definitionType() const { return TypeClass; }
/*! Returns the unique base name (without extension) of the class's file on disk */
QCString getOutputFileBase() const;
QCString getInstanceOutputFileBase() const;
QCString getFileBase() const;
/*! Returns the base name for the source code file */
QCString getSourceFileBase() const;
/*! If this class originated from a tagfile, this will return the tag file reference */
QCString getReference() const;
/*! Returns TRUE if this class is imported via a tag file */
bool isReference() const;
/*! Returns TRUE if this is a local class definition, see EXTRACT_LOCAL_CLASSES */
bool isLocal() const { return m_isLocal; }
/*! returns TRUE if this class was artificially introduced, for instance because
* it is used to show a template instantiation relation.
*/
bool isArtificial() const { return m_artificial; }
/*! returns the classes nested into this class */
ClassSDict *getInnerClasses() { return m_innerClasses; }
/*! returns TRUE if this class has documentation */
bool hasDocumentation() const;
/*! Returns the name as it is appears in the documentation */
QCString displayName() const;
/*! Returns the type of compound this is */
/*! Returns the type of compound this is, i.e. class/struct/union/.. */
CompoundType compoundType() const { return m_compType; }
/*! Returns the type of compound as a string */
......@@ -93,7 +135,7 @@ class ClassDef : public Definition
*/
BaseClassList *baseClasses() { return m_inherits; }
/*! Returns the list of sub classes that directly inherit from this class
/*! Returns the list of sub classes that directly derive from this class
*/
BaseClassList *subClasses() { return m_inheritedBy; }
......@@ -102,21 +144,12 @@ class ClassDef : public Definition
*/
MemberNameInfoSDict *memberNameInfoSDict() { return m_allMemberNameInfoSDict; }
void writeDocumentation(OutputList &ol);
void writeDocumentationForInnerClasses(OutputList &ol);
void writeMemberDocumentation(OutputList &ol);
void writeMemberPages(OutputList &ol);
void writeMemberList(OutputList &ol);
void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup);
void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag);
void writeQuickMemberLinks(OutputList &ol,MemberDef *md) const;
/*! Return the protection level (Public,Protected,Private) in which
* this compound was found.
*/
Protection protection() const { return m_prot; }
/*! returns TRUE iff a link is possible to an item within this project.
/*! returns TRUE iff a link is possible to this item within this project.
*/
bool isLinkableInProject() const;
......@@ -159,11 +192,13 @@ class ClassDef : public Definition
* this template class. Returns 0 if not a template or no instances.
*/
QDict<ClassDef> *getTemplateInstances() const { return m_templateInstances; }
/*! Returns the template master of which this class is an instance.
* Returns 0 if not applicable.
*/
ClassDef *templateMaster() const { return m_templateMaster; }
/*! Returns TRUE if this class is a template */
bool isTemplate() const { return m_tempArgs!=0; }
IncludeInfo *includeInfo() const { return m_incInfo; }
......@@ -183,12 +218,6 @@ class ClassDef : public Definition
return m_usesIntfClassDict;
}
/** Marks this class as a template argument of some another class */
void makeTemplateArgument(bool b=TRUE)
{
m_isTemplArg = b;
}
bool isTemplateArgument() const
{
return m_isTemplArg;
......@@ -208,6 +237,7 @@ class ClassDef : public Definition
* with type="class" and name="T".
*/
void getTemplateParameterLists(QList<ArgumentList> &lists) const;
QCString qualifiedNameWithTemplateParameters(
QList<ArgumentList> *actualParams=0) const;
......@@ -219,128 +249,78 @@ class ClassDef : public Definition
/*! Returns TRUE if this class is implemented in Objective-C */
bool isObjectiveC() const { return m_isObjC; }
/*! Returns the class of which this is a category (Objective-C only) */
ClassDef *categoryOf() const { return m_categoryOf; }
/*! returns the name of the class including outer classes, but not
/*! Returns the name of the class including outer classes, but not
* including namespaces.
*/
QCString className() const;
/* member lists by protection */
MemberList *pubMethods;
MemberList *proMethods;
MemberList *pacMethods;
MemberList *priMethods;
MemberList *pubStaticMethods;
MemberList *proStaticMethods;
MemberList *pacStaticMethods;
MemberList *priStaticMethods;
MemberList *pubSlots;
MemberList *proSlots;
MemberList *priSlots;
MemberList *pubAttribs;
MemberList *proAttribs;
MemberList *pacAttribs;
MemberList *priAttribs;
MemberList *pubStaticAttribs;
MemberList *proStaticAttribs;
MemberList *pacStaticAttribs;
MemberList *priStaticAttribs;
MemberList *pubTypes;
MemberList *proTypes;
MemberList *pacTypes;
MemberList *priTypes;
MemberList *related;
MemberList *signals;
MemberList *friends;
MemberList *dcopMethods;
MemberList *properties;
MemberList *events;
/* member list by types */
MemberList *constructors;
MemberList *typedefMembers;
MemberList *enumMembers;
MemberList *enumValMembers;
MemberList *functionMembers;
MemberList *relatedMembers;
MemberList *variableMembers;
MemberList *propertyMembers;
MemberList *eventMembers;
/*! Returns the members in the list identified by \a lt */
MemberList *getMemberList(MemberList::ListType lt);
/* user defined member groups */
MemberGroupSDict *memberGroupSDict;
/*! Returns the list containing the list of members sorted per type */
const QList<MemberList> &getMemberLists() const { return m_memberLists; }
/*! \} Public API */
/*! Returns the member groups defined for this class */
MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
QDict<int> *getTemplateBaseClassNames() const;
ClassDef *getVariableInstance(const char *templSpec);
//-----------------------------------------------------------------------------------
// --- setters ----
//-----------------------------------------------------------------------------------
/*! \name Doxygen internal API
* \{
*/
void insertBaseClass(ClassDef *,const char *name,Protection p,Specifier s,const char *t=0);
void insertSubClass(ClassDef *,Protection p,Specifier s,const char *t=0);
void setIncludeFile(FileDef *fd,const char *incName,bool local,bool force);
void insertMember(MemberDef *);
void insertUsedFile(const char *);
void computeAnchors();
//void computeMemberGroups();
//void setAnchor(MemberDef *);
//void dumpMembers();
bool addExample(const char *anchor,const char *name, const char *file);
void addMembersToMemberGroup();
void distributeMemberGroupDocumentation();
void findSectionsInDocumentation();
void setNamespace(NamespaceDef *nd) { m_nspace = nd; }
void setTemplateArguments(ArgumentList *al);
void mergeMembers();
void mergeCategory(ClassDef *category);
void setNamespace(NamespaceDef *nd) { m_nspace = nd; }
void setFileDef(FileDef *fd) { m_fileDef=fd; }
//void determineImplUsageRelation();
//void determineIntfUsageRelation();
void setSubGrouping(bool enabled) { m_subGrouping = enabled; }
void setProtection(Protection p) { m_prot=p; }
void setGroupDefForAllMembers(GroupDef *g,Grouping::GroupPri_t pri,const QCString &fileName,int startLine,bool hasDocs);
void addInnerCompound(Definition *d);
void addUsedClass(ClassDef *cd,const char *accessName);
void addUsedByClass(ClassDef *cd,const char *accessName);
//void initTemplateMapping();
//void setTemplateArgumentMapping(const char *formal,const char *actual);
//QCString getTemplateArgumentMapping(const char *formal) const;
ClassDef *insertTemplateInstance(const QCString &fileName,int startLine,
const QCString &templSpec,bool &freshInstance);
ClassDef *getVariableInstance(const char *templSpec);
void setTemplateBaseClassNames(QDict<int> *templateNames);
QDict<int> *getTemplateBaseClassNames() const;
void setTemplateMaster(ClassDef *tm) { m_templateMaster=tm; }
void addMembersToTemplateInstance(ClassDef *cd,const char *templSpec);
void addUsedClass(ClassDef *cd,const char *accessName);
void addUsedByClass(ClassDef *cd,const char *accessName);
void setClassIsArtificial() { m_artificial = TRUE; }
void setIsStatic(bool b) { m_isStatic=b; }
void setIsObjectiveC(bool b) { m_isObjC=b; }
void addListReferences();
void setCompoundType(CompoundType t) { m_compType = t; }
/*! Creates a new compound definition.
* \param fileName full path and file name in which this compound was
* found.
* \param startLine line number where the definition of this compound
* starts.
* \param name the name of this compound (including scope)
* \param ct the kind of Compound
* \param ref the tag file from which this compound is extracted
* or 0 if the compound doesn't come from a tag file
* \param fName the file name as found in the tag file.
* This overwrites the file that doxygen normally
* generates based on the compound type & name.
* \param isSymbol If TRUE this class name is added as a publicly
* visible (and referencable) symbol.
*/
ClassDef(const char *fileName,int startLine,
const char *name,CompoundType ct,
const char *ref=0,const char *fName=0,
bool isSymbol=TRUE);
/*! Destroys a compound definition. */
~ClassDef();
void setTemplateArguments(ArgumentList *al);
void setTemplateBaseClassNames(QDict<int> *templateNames);
void setTemplateMaster(ClassDef *tm) { m_templateMaster=tm; }
void addMembersToTemplateInstance(ClassDef *cd,const char *templSpec);
ClassSDict *getInnerClasses() { return m_innerClasses; }
/*! Marks this class as a template argument of some another class */
void makeTemplateArgument(bool b=TRUE) { m_isTemplArg = b; }
//-----------------------------------------------------------------------------------
// --- actions ----
//-----------------------------------------------------------------------------------
void findSectionsInDocumentation();
void addMembersToMemberGroup();
void addListReferences();
void computeAnchors();
void mergeMembers();
void distributeMemberGroupDocumentation();
void writeDocumentation(OutputList &ol);
void writeDocumentationForInnerClasses(OutputList &ol);
void writeMemberDocumentation(OutputList &ol);
void writeMemberPages(OutputList &ol);
void writeMemberList(OutputList &ol);
void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup);
void writeDetailedDescription(OutputList &ol,const QCString &pageType,bool exampleFlag);
void writeQuickMemberLinks(OutputList &ol,MemberDef *md) const;
bool visited;
......@@ -350,11 +330,15 @@ class ClassDef : public Definition
bool hasNonReferenceSuperClass();
void showUsedFiles(OutputList &ol);
/*! \} Interal API */
private:
void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList);
QCString getMemberListFileName() const;
void addMemberToList(MemberList::ListType lt,MemberDef *md);
MemberList *createMemberList(MemberList::ListType lt);
void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title,
const char *subTitle=0);
void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title);
void writePlainMemberDeclaration(OutputList &ol,MemberList::ListType lt,bool inGroup);
/*! file name that forms the base for the output file containing the
* class documentation. For compatibility with Qt (e.g. links via tag
......@@ -367,16 +351,6 @@ class ClassDef : public Definition
*/
IncludeInfo *m_incInfo;
/*! file name that forms the base for the "list of members" for this
* class.
*/
//QCString m_memListFileName;
/*! Bare name of the class without any scoping prefixes
* (like for nested classes and classes inside namespaces)
*/
//QCString m_scopelessName;
/*! List of base class (or super-classes) from which this class derives
* directly.
*/
......@@ -450,6 +424,11 @@ class ClassDef : public Definition
*/
ClassDef *m_categoryOf;
QList<MemberList> m_memberLists;
/* user defined member groups */
MemberGroupSDict *memberGroupSDict;
/*! Indicated whether this class exists because it is used by
* some other class only (TRUE) or if some class inherits from
* it (FALSE). This is need to remove used-only classes from
......
......@@ -25,10 +25,11 @@ class CodeOutputInterface;
class FileDef;
class MemberDef;
extern void parseCCode(CodeOutputInterface &,const char *,const QCString &,
void parseCCode(CodeOutputInterface &,const char *,const QCString &,
bool ,const char *,FileDef *fd=0,
int startLine=-1,int endLine=-1,bool inlineFragment=FALSE,
MemberDef *memberDef=0);
extern void resetCCodeParserState();
void resetCCodeParserState();
void codeFreeScanner();
#endif
......@@ -106,6 +106,7 @@ static int g_lastCContext;
static bool g_insideObjC;
static bool g_insideProtocolList;
static bool g_lexInit = FALSE;
// context for an Objective-C method call
struct ObjCCallCtx
......@@ -458,7 +459,6 @@ static void startCodeLine()
Definition *d = g_sourceFileDef->getSourceDefinition(g_yyLineNr);
//printf("startCodeLine %d d=%s\n", g_yyLineNr,d ? d->name().data() : "<null>");
//g_code->startLineNumber();
if (!g_includeCodeFragment && d)
{
g_currentDefinition = d;
......@@ -498,10 +498,8 @@ static void startCodeLine()
}
else
{
//g_code->codify(lineNumber);
g_code->writeLineNumber(0,0,0,g_yyLineNr);
}
//g_code->endLineNumber();
}
g_code->startCodeLine();
if (g_currentFontClass)
......@@ -764,15 +762,20 @@ static MemberDef *setCallContextForVar(const QCString &name)
static void addDocCrossReference(MemberDef *src,MemberDef *dst)
{
static bool referencedByRelation = Config_getBool("REFERENCED_BY_RELATION");
static bool referencesRelation = Config_getBool("REFERENCES_RELATION");
static bool callerGraph = Config_getBool("CALLER_GRAPH");
static bool callGraph = Config_getBool("CALL_GRAPH");
if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
//printf("addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data());
if ((Config_getBool("REFERENCED_BY_RELATION") || Config_getBool("CALLER_GRAPH")) &&
if ((referencedByRelation || callerGraph) &&
(src->isFunction() || src->isSlot())
)
{
dst->addSourceReferencedBy(src);
}
if ((Config_getBool("REFERENCES_RELATION") || Config_getBool("CALL_GRAPH")) &&
if ((referencesRelation || callGraph) &&
(src->isFunction() || src->isSlot())
)
{
......@@ -828,6 +831,8 @@ static bool getLinkInScope(const QCString &c, // scope
}
//printf("d->getReference()=`%s' d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data());
ol.linkableSymbol(g_yyLineNr,md->name(),md,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(ol,md->getReference(),
md->getOutputFileBase(),
md->anchor(),
......@@ -936,6 +941,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
g_anchorCount++;
}
}
ol.linkableSymbol(g_yyLineNr,cd->name(),cd,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),0,clName);
addToSearchIndex(className);
if (md)
......@@ -977,6 +984,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
//printf("is a global md=%p g_currentDefinition=%s\n",md,g_currentDefinition?g_currentDefinition->name().data():"<none>");
if (md->isLinkable())
{
ol.linkableSymbol(g_yyLineNr,md->name(),md,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName);
addToSearchIndex(clName);
if (g_currentMemberDef)
......@@ -989,6 +998,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
}
// nothing found, just write out the word
ol.linkableSymbol(g_yyLineNr,clName,0,
g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
codifyLines(clName);
addToSearchIndex(clName);
}
......@@ -1044,6 +1055,8 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,ClassDef *mcd,const
}
// write the actual link
ol.linkableSymbol(g_yyLineNr,xmd->name(),xmd,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(ol,xmd->getReference(),
xmd->getOutputFileBase(),xmd->anchor(),memName);
addToSearchIndex(memName);
......@@ -1149,6 +1162,9 @@ static void generateMemberLink(CodeOutputInterface &ol,const QCString &varName,
}
}
}
// nothing found -> write result as is
ol.linkableSymbol(g_yyLineNr,memName,0,
g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
codifyLines(memName);
addToSearchIndex(memName);
return;
......@@ -1331,6 +1347,8 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
{
if (ctx->method && ctx->method->isLinkable())
{
g_code->linkableSymbol(g_yyLineNr,ctx->method->name(),ctx->method,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(*g_code,
ctx->method->getReference(),
ctx->method->getOutputFileBase(),
......@@ -1343,6 +1361,8 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
}
else
{
g_code->linkableSymbol(g_yyLineNr,pName->data(),0,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
codifyLines(pName->data());
}
}
......@@ -1414,6 +1434,8 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
}
else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable
{
g_code->linkableSymbol(g_yyLineNr,ctx->objectVar->name(),ctx->objectVar,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(*g_code,
ctx->objectVar->getReference(),
ctx->objectVar->getOutputFileBase(),
......@@ -1430,6 +1452,8 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
) // object is class name
{
ClassDef *cd = ctx->objectType;
g_code->linkableSymbol(g_yyLineNr,cd->name(),cd,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(*g_code,
cd->getReference(),
cd->getOutputFileBase(),
......@@ -1443,6 +1467,8 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
if (cd && cd->isLinkable())
{
if (ctx->objectType==0) ctx->objectType=cd;
g_code->linkableSymbol(g_yyLineNr,cd->name(),cd,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
writeMultiLineCodeLink(*g_code,
cd->getReference(),
cd->getOutputFileBase(),
......@@ -1451,6 +1477,8 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
}
else
{
g_code->linkableSymbol(g_yyLineNr,pObject->data(),0,
g_currentMemberDef ? g_currentMemberDef : g_currentDefinition);
codifyLines(pObject->data());
}
}
......@@ -1708,6 +1736,9 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
g_theVarContext.addVariable(g_parmType,g_parmName);
g_parmType.resize(0);g_parmName.resize(0);
}
<ObjCMethod,ObjCParams,ObjCParamType>{ID} {
generateClassOrGlobalLink(*g_code,yytext);
}
<ObjCMethod,ObjCParams,ObjCParamType>. {
g_code->codify(yytext);
}
......@@ -1811,6 +1842,7 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
g_inClass=FALSE;
//fprintf(stderr,"g_bodyCurlyCount=%d\n",g_bodyCurlyCount);
if (--g_bodyCurlyCount<=0)
{
g_insideBody=FALSE;
......@@ -2232,6 +2264,8 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
{
if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),yytext))
{
g_code->linkableSymbol(g_yyLineNr,yytext,0,
g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
g_code->codify(yytext);
addToSearchIndex(yytext);
}
......@@ -2239,6 +2273,8 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
}
else
{
g_code->linkableSymbol(g_yyLineNr,yytext,0,
g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
g_code->codify(yytext);
addToSearchIndex(yytext);
g_name.resize(0);
......@@ -2260,6 +2296,8 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
//fprintf(stderr,"g_theCallContext.getClass()=%p\n",g_theCallContext.getClass());
if (!generateClassMemberLink(*g_code,g_theCallContext.getClass(),yytext))
{
g_code->linkableSymbol(g_yyLineNr,yytext,0,
g_currentMemberDef?g_currentMemberDef:g_currentDefinition);
g_code->codify(yytext);
addToSearchIndex(yytext);
}
......@@ -3140,6 +3178,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
codeYYrestart( codeYYin );
BEGIN( Body );
codeYYlex();
g_lexInit=TRUE;
if (g_needsTermination)
{
endFontClass();
......@@ -3154,11 +3193,23 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
return;
}
void codeFreeScanner()
{
#if defined(YY_FLEX_SUBMINOR_VERSION)
if (g_lexInit)
{
codeYYlex_destroy();
}
#endif
}
#if !defined(YY_FLEX_SUBMINOR_VERSION)
extern "C" { // some bogus code to keep the compiler happy
void codeYYdummy() { yy_flex_realloc(0,0); }
}
#elif YY_FLEX_SUBMINOR_VERSION<33
#error "You seem to be using a version of flex newer than 2.5.4. These are currently incompatible with 2.5.4, and do NOT work with doxygen! Please use version 2.5.4 or expect things to be parsed wrongly! A bug report has been submitted (#732132)."
#error "You seem to be using a version of flex newer than 2.5.4 but older than 2.5.33. These versions do NOT work with doxygen! Please use version <=2.5.4 or >=2.5.33 or expect things to be parsed wrongly!"
#endif
......@@ -2329,8 +2329,8 @@ void openGroup(Entry *e,const char *,int)
if (e->section==Entry::GROUPDOC_SEC) // auto group
{
g_autoGroupStack.push(new Grouping(e->name,e->groupingPri()));
printf("==> openGroup(name=%s,sec=%x) g_autoGroupStack=%d\n",
e->name.data(),e->section,g_autoGroupStack.count());
//printf("==> openGroup(name=%s,sec=%x) g_autoGroupStack=%d\n",
// e->name.data(),e->section,g_autoGroupStack.count());
}
else // start of a member group
{
......@@ -2352,8 +2352,8 @@ void openGroup(Entry *e,const char *,int)
void closeGroup(Entry *e,const char *fileName,int)
{
printf("==> closeGroup(name=%s,sec=%x) g_autoGroupStack=%d\n",
e->name.data(),e->section,g_autoGroupStack.count());
//printf("==> closeGroup(name=%s,sec=%x) g_autoGroupStack=%d\n",
// e->name.data(),e->section,g_autoGroupStack.count());
if (g_memberGroupId!=DOX_NOGROUP) // end of member group
{
MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(g_memberGroupId);
......@@ -2372,7 +2372,7 @@ void closeGroup(Entry *e,const char *fileName,int)
{
Grouping *grp = g_autoGroupStack.pop();
e->groups->removeLast();
printf("Removing %s\n",grp->groupname.data());
//printf("Removing %s\n",grp->groupname.data());
delete grp;
initGroupInfo(e);
}
......@@ -2386,9 +2386,9 @@ void initGroupInfo(Entry *e)
e->relates = g_memberGroupRelates;
if (!g_autoGroupStack.isEmpty())
{
printf("Appending group %s to %s: count=%d entry=%p\n",
g_autoGroupStack.top()->groupname.data(),
e->name.data(),e->groups->count(),e);
//printf("Appending group %s to %s: count=%d entry=%p\n",
// g_autoGroupStack.top()->groupname.data(),
// e->name.data(),e->groups->count(),e);
e->groups->append(new Grouping(*g_autoGroupStack.top()));
}
}
......
......@@ -1196,6 +1196,27 @@ void Config::check()
annotationFromBrief.append("an");
annotationFromBrief.append("the");
}
if (Config_getBool("CALL_GRAPH") &&
(!Config_getBool("SOURCE_BROWSER") || !Config_getBool("REFERENCES_RELATION"))
)
{
config_err("Warning: turning on CALL_GRAPH requires turning "
"SOURCE_BROWSER and\nREFERENCES_RELATION on as well!\n"
"Assuming SOURCE_BROWSER=YES and REFERENCES_RELATION=YES\n");
Config_getBool("SOURCE_BROWSER")=TRUE;
Config_getBool("REFERENCES_RELATION")=TRUE;
}
if (Config_getBool("CALLER_GRAPH") &&
(!Config_getBool("SOURCE_BROWSER") || !Config_getBool("REFERENCED_BY_RELATION"))
)
{
config_err("Warning: turning on CALLER_GRAPH requires turning "
"SOURCE_BROWSER and\nREFERENCEDBY_RELATION on as well!\n"
"Assuming SOURCE_BROWSER=YES and REFERENCED_BY_RELATION=YES\n");
Config_getBool("SOURCE_BROWSER")=TRUE;
Config_getBool("REFERENCED_BY_RELATION")=TRUE;
}
}
void Config::init()
......
......@@ -313,7 +313,7 @@ void generateDEFClassSection(ClassDef *cd,
MemberList *ml,
const char *kind)
{
if (cd && ml->count()>0)
if (cd && ml && ml->count()>0)
{
t << " cp-section = {" << endl;
t << " sec-kind = '" << kind << "';" << endl;
......@@ -408,54 +408,41 @@ void generateDEFForClass(ClassDef *cd,QTextStream &t)
}
}
int numMembers =
(cd->pubTypes ? cd->pubTypes->count() : 0)+
(cd->pubMethods ? cd->pubMethods->count() : 0)+
(cd->pubAttribs ? cd->pubAttribs->count() : 0)+
(cd->pubSlots ? cd->pubSlots->count() : 0)+
(cd->signals ? cd->signals->count() : 0)+
(cd->dcopMethods ? cd->dcopMethods->count() : 0)+
(cd->pubStaticMethods ? cd->pubStaticMethods->count() : 0)+
(cd->pubStaticAttribs ? cd->pubStaticAttribs->count() : 0)+
(cd->proTypes ? cd->proTypes->count() : 0)+
(cd->proMethods ? cd->proMethods->count() : 0)+
(cd->proAttribs ? cd->proAttribs->count() : 0)+
(cd->proSlots ? cd->proSlots->count() : 0)+
(cd->proStaticMethods ? cd->proStaticMethods->count() : 0)+
(cd->proStaticAttribs ? cd->proStaticAttribs->count() : 0)+
(cd->priTypes ? cd->priTypes->count() : 0)+
(cd->priMethods ? cd->priMethods->count() : 0)+
(cd->priAttribs ? cd->priAttribs->count() : 0)+
(cd->priSlots ? cd->priSlots->count() : 0)+
(cd->priStaticMethods ? cd->priStaticMethods->count() : 0)+
(cd->priStaticAttribs ? cd->priStaticAttribs->count() : 0)+
(cd->friends ? cd->friends->count() : 0)+
(cd->related ? cd->related->count() : 0);
int numMembers = 0;
QListIterator<MemberList> mli(cd->getMemberLists());
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::detailedLists)==0)
{
numMembers+=ml->count();
}
}
if (numMembers>0)
{
generateDEFClassSection(cd,t,cd->pubTypes,"public-type");
generateDEFClassSection(cd,t,cd->pubMethods,"public-func");
generateDEFClassSection(cd,t,cd->pubAttribs,"public-attrib");
generateDEFClassSection(cd,t,cd->pubSlots,"public-slot");
generateDEFClassSection(cd,t,cd->signals,"signal");
generateDEFClassSection(cd,t,cd->dcopMethods,"dcop-func");
generateDEFClassSection(cd,t,cd->properties,"property");
generateDEFClassSection(cd,t,cd->pubStaticMethods,"public-static-func");
generateDEFClassSection(cd,t,cd->pubStaticAttribs,"public-static-attrib");
generateDEFClassSection(cd,t,cd->proTypes,"protected-type");
generateDEFClassSection(cd,t,cd->proMethods,"protected-func");
generateDEFClassSection(cd,t,cd->proAttribs,"protected-attrib");
generateDEFClassSection(cd,t,cd->proSlots,"protected-slot");
generateDEFClassSection(cd,t,cd->proStaticMethods,"protected-static-func");
generateDEFClassSection(cd,t,cd->proStaticAttribs,"protected-static-attrib");
generateDEFClassSection(cd,t,cd->priTypes,"private-type");
generateDEFClassSection(cd,t,cd->priMethods,"private-func");
generateDEFClassSection(cd,t,cd->priAttribs,"private-attrib");
generateDEFClassSection(cd,t,cd->priSlots,"private-slot");
generateDEFClassSection(cd,t,cd->priStaticMethods,"private-static-func");
generateDEFClassSection(cd,t,cd->priStaticAttribs,"private-static-attrib");
generateDEFClassSection(cd,t,cd->friends,"signal");
generateDEFClassSection(cd,t,cd->related,"related");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubTypes),"public-type");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubMethods),"public-func");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubAttribs),"public-attrib");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubSlots),"public-slot");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::signals),"signal");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::dcopMethods),"dcop-func");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::properties),"property");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubStaticMethods),"public-static-func");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::pubStaticAttribs),"public-static-attrib");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::proTypes),"protected-type");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::proMethods),"protected-func");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::proAttribs),"protected-attrib");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::proSlots),"protected-slot");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::proStaticMethods),"protected-static-func");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::proStaticAttribs),"protected-static-attrib");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::priTypes),"private-type");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::priMethods),"private-func");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::priAttribs),"private-attrib");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::priSlots),"private-slot");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::priStaticMethods),"private-static-func");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::priStaticAttribs),"private-static-attrib");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::friends),"signal");
generateDEFClassSection(cd,t,cd->getMemberList(MemberList::related),"related");
}
t << " cp-filename = '" << cd->getDefFileName() << "';" << endl;
......@@ -512,12 +499,12 @@ void generateDEFForNamespace(NamespaceDef *nd,QTextStream &t)
writeDEFString(t,nd->name());
t << ';' << endl;
generateDEFSection(nd,t,&nd->decDefineMembers,"define");
generateDEFSection(nd,t,&nd->decProtoMembers,"prototype");
generateDEFSection(nd,t,&nd->decTypedefMembers,"typedef");
generateDEFSection(nd,t,&nd->decEnumMembers,"enum");
generateDEFSection(nd,t,&nd->decFuncMembers,"func");
generateDEFSection(nd,t,&nd->decVarMembers,"var");
generateDEFSection(nd,t,nd->getMemberList(MemberList::decDefineMembers),"define");
generateDEFSection(nd,t,nd->getMemberList(MemberList::decProtoMembers),"prototype");
generateDEFSection(nd,t,nd->getMemberList(MemberList::decTypedefMembers),"typedef");
generateDEFSection(nd,t,nd->getMemberList(MemberList::decEnumMembers),"enum");
generateDEFSection(nd,t,nd->getMemberList(MemberList::decFuncMembers),"func");
generateDEFSection(nd,t,nd->getMemberList(MemberList::decVarMembers),"var");
t << " ns-filename = '" << nd->getDefFileName() << "';" << endl;
t << " ns-fileline = '" << nd->getDefLine() << "';" << endl;
......@@ -539,12 +526,12 @@ void generateDEFForFile(FileDef *fd,QTextStream &t)
writeDEFString(t,fd->name());
t << ';' << endl;
generateDEFSection(fd,t,fd->decDefineMembers,"define");
generateDEFSection(fd,t,fd->decProtoMembers,"prototype");
generateDEFSection(fd,t,fd->decTypedefMembers,"typedef");
generateDEFSection(fd,t,fd->decEnumMembers,"enum");
generateDEFSection(fd,t,fd->decFuncMembers,"func");
generateDEFSection(fd,t,fd->decVarMembers,"var");
generateDEFSection(fd,t,fd->getMemberList(MemberList::decDefineMembers),"define");
generateDEFSection(fd,t,fd->getMemberList(MemberList::decProtoMembers),"prototype");
generateDEFSection(fd,t,fd->getMemberList(MemberList::decTypedefMembers),"typedef");
generateDEFSection(fd,t,fd->getMemberList(MemberList::decEnumMembers),"enum");
generateDEFSection(fd,t,fd->getMemberList(MemberList::decFuncMembers),"func");
generateDEFSection(fd,t,fd->getMemberList(MemberList::decVarMembers),"var");
t << " file-full-name = '" << fd->getDefFileName() << "';" << endl;
t << " file-first-line = '" << fd->getDefLine() << "';" << endl;
......
......@@ -46,14 +46,41 @@ static void addToMap(const char *name,Definition *d)
if (index!=-1) symbolName=symbolName.mid(index+2);
if (!symbolName.isEmpty())
{
DefinitionList *dl=Doxygen::symbolMap->find(symbolName);
if (dl==0)
//printf("******* adding symbol `%s' (%p)\n",symbolName.data(),d);
DefinitionIntf *di=Doxygen::symbolMap->find(symbolName);
//printf(" addToMap(%p): looking for symbol %s: %p\n",d,symbolName.data(),di);
if (di==0) // new Symbol
{
dl = new DefinitionList;
Doxygen::symbolMap->append(symbolName,dl);
//printf(" new symbol!\n");
Doxygen::symbolMap->insert(symbolName,d);
}
//printf("******* adding symbol `%s' (%p)\n",symbolName.data(),d);
else // existing symbol
{
//printf(" existing symbol: ");
if (di->definitionType()==DefinitionIntf::TypeSymbolList) // already multiple symbols
{
//printf("adding to exiting list\n");
DefinitionList *dl = (DefinitionList*)di;
dl->append(d);
}
else // going from one to two symbols
{
Doxygen::symbolMap->take(symbolName);
DefinitionList *dl = new DefinitionList;
//printf("replacing symbol by list %p with elements %p and %p\n",dl,di,d);
dl->append((Definition*)di);
dl->append(d);
Doxygen::symbolMap->insert(symbolName,dl);
}
}
// auto resize if needed
static int sizeIndex=9;
if (Doxygen::symbolMap->size()>SDict_primes[sizeIndex])
{
Doxygen::symbolMap->resize(SDict_primes[++sizeIndex]);
}
d->setSymbolName(symbolName);
}
}
......@@ -66,12 +93,26 @@ static void removeFromMap(Definition *d)
if (!symbolName.isEmpty())
{
//printf("******* removing symbol `%s' (%p)\n",symbolName.data(),d);
DefinitionList *dl=Doxygen::symbolMap->find(symbolName);
if (dl)
DefinitionIntf *di=Doxygen::symbolMap->find(symbolName);
if (di)
{
ASSERT(dl!=0);
ASSERT(di!=0);
if (di!=d) // symbolName not unique
{
//printf(" removing from list: %p!\n",di);
DefinitionList *dl = (DefinitionList*)di;
bool b = dl->removeRef(d);
ASSERT(b==TRUE);
if (dl->isEmpty())
{
Doxygen::symbolMap->take(symbolName);
}
}
else // symbolName unique
{
//printf(" removing symbol %p\n",di);
Doxygen::symbolMap->take(symbolName);
}
}
}
}
......
......@@ -54,18 +54,27 @@ struct BodyInfo
FileDef *fileDef; // file definition containing the function body
};
/*! The common base class of all entity definitions found in the sources. */
class Definition
/*! Abstract interface for a Definition or DefinitionList */
class DefinitionIntf
{
public:
DefinitionIntf() {}
virtual ~DefinitionIntf() {}
/*! Types of derived classes */
enum DefType
{
TypeClass, TypeMember, TypeFile, TypeGroup,
TypeNamespace, TypePackage, TypePage, TypeDir
TypeNamespace, TypePackage, TypePage, TypeDir,
TypeSymbolList
};
/*! Use this for dynamic inspection of the type of the derived class */
virtual DefType definitionType() const = 0;
};
/*! The common base class of all entity definitions found in the sources. */
class Definition : public DefinitionIntf
{
public:
/*! Create a new definition */
Definition(
......@@ -76,16 +85,24 @@ class Definition
/*! Destroys the definition */
virtual ~Definition();
//-----------------------------------------------------------------------------------
// ---- getters -----
//-----------------------------------------------------------------------------------
/*! Returns the name of the definition */
const QCString& name() const { return m_name; }
/*! Returns the local name without any scope qualifiers. */
QCString localName() const;
/*! Returns the base name of the output file that contains this
* definition.
*/
virtual QCString qualifiedName();
/*! Returns the local name without any scope qualifiers. */
QCString localName() const;
/*! Returns the name of this definition as it appears in the symbol map.
*/
QCString symbolName() const { return m_symbolName; }
/*! Returns the base file name (without extension) of this definition.
* as it is referenced to/written to disk.
......@@ -98,15 +115,6 @@ class Definition
/*! Returns the detailed description of this definition */
QCString documentation() const { return m_details ? m_details->doc : QCString(""); }
/*! Returns the brief description of this definition */
QCString briefDescription() const { return m_brief ? m_brief->doc : QCString(""); }
/*! Sets a new \a name for the definition */
void setName(const char *name) { m_name=name; }
/*! Sets the documentation of this definition to \a d. */
void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE);
/*! Returns the line number at which the detailed documentation was found. */
int docLine() const { return m_details ? m_details->line : 1; }
......@@ -115,10 +123,8 @@ class Definition
*/
QCString docFile() const { return m_details ? m_details->file : QCString("<"+m_name+">"); }
/*! Sets the brief description of this definition to \a b.
* A dot is added to the sentence if not available.
*/
void setBriefDescription(const char *b,const char *briefFile,int briefLine);
/*! Returns the brief description of this definition */
QCString briefDescription() const { return m_brief ? m_brief->doc : QCString(""); }
/*! Returns the line number at which the brief description was found. */
int briefLine() const { return m_brief ? m_brief->line : 1; }
......@@ -166,6 +172,8 @@ class Definition
virtual bool isVisible() const
{ return m_hidden || isLinkable(); }
bool isHidden() const { return m_hidden; }
/*! If this definition was imported via a tag file, this function
* returns the tagfile for the external project. This can be
* translated into an external link target via
......@@ -176,12 +184,37 @@ class Definition
/*! Returns TRUE if this definition is imported via a tag file. */
virtual bool isReference() const { return !m_ref.isEmpty(); }
/*! Sets the tag file id via which this definition was imported. */
void setReference(const char *r) { m_ref=r; }
int getStartBodyLine() const { return m_body ? m_body->startLine : -1; }
int getEndBodyLine() const { return m_body ? m_body->endLine : -1; }
FileDef *getBodyDef() { return m_body ? m_body->fileDef : 0; }
/*! Returns the name of this definition as it appears in the symbol map.
GroupList *partOfGroups() const { return m_partOfGroups; }
const QList<ListItemInfo> *xrefListItems() const;
virtual Definition *findInnerCompound(const char *name);
virtual Definition *getOuterScope() const { return m_outerScope; }
MemberSDict *getReferencesMembers() const { return m_sourceRefsDict; }
MemberSDict *getReferencedByMembers() const { return m_sourceRefByDict; }
//-----------------------------------------------------------------------------------
// ---- setters -----
//-----------------------------------------------------------------------------------
/*! Sets a new \a name for the definition */
void setName(const char *name) { m_name=name; }
/*! Sets the documentation of this definition to \a d. */
void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE);
/*! Sets the brief description of this definition to \a b.
* A dot is added to the sentence if not available.
*/
QCString symbolName() const { return m_symbolName; }
void setBriefDescription(const char *b,const char *briefFile,int briefLine);
/*! Sets the tag file id via which this definition was imported. */
void setReference(const char *r) { m_ref=r; }
/*! Sets the name of this definition as it should appear in the symbol map.
*/
......@@ -192,47 +225,37 @@ class Definition
*/
void addSectionsToDefinition(QList<SectionInfo> *anchorList);
/*! Writes the documentation anchors of the definition to
* the Doxygen::tagFile stream.
*/
void writeDocAnchorsToTagFile();
bool isHidden() const { return m_hidden; }
// source references
void setBodySegment(int bls,int ble);
void setBodyDef(FileDef *fd);
int getStartBodyLine() const { return m_body ? m_body->startLine : -1; }
int getEndBodyLine() const { return m_body ? m_body->endLine : -1; }
FileDef *getBodyDef() { return m_body ? m_body->fileDef : 0; }
void writeSourceDef(OutputList &ol,const char *scopeName);
void writeInlineCode(OutputList &ol,const char *scopeName);
void writeSourceRefs(OutputList &ol,const char *scopeName);
void writeSourceReffedBy(OutputList &ol,const char *scopeName);
void addSourceReferencedBy(MemberDef *d);
void addSourceReferences(MemberDef *d);
void setRefItems(const QList<ListItemInfo> *sli);
void mergeRefItems(Definition *d);
const QList<ListItemInfo> *xrefListItems() const;
virtual Definition *findInnerCompound(const char *name);
virtual Definition *getOuterScope() const { return m_outerScope; }
virtual void addInnerCompound(Definition *d);
virtual void setOuterScope(Definition *d);
MemberSDict *getReferencesMembers() const { return m_sourceRefsDict; }
MemberSDict *getReferencedByMembers() const { return m_sourceRefByDict; }
void setHidden(bool b) { m_hidden = b; }
void makePartOfGroup(GroupDef *gd);
GroupList *partOfGroups() const { return m_partOfGroups; }
QCString convertNameToFile(const char *name,bool allowDots=FALSE) const;
//-----------------------------------------------------------------------------------
// --- actions ----
//-----------------------------------------------------------------------------------
QCString convertNameToFile(const char *name,bool allowDots=FALSE) const;
void writeSourceDef(OutputList &ol,const char *scopeName);
void writeInlineCode(OutputList &ol,const char *scopeName);
void writeSourceRefs(OutputList &ol,const char *scopeName);
void writeSourceReffedBy(OutputList &ol,const char *scopeName);
void makePartOfGroup(GroupDef *gd);
void writePathFragment(OutputList &ol) const;
void writeNavigationPath(OutputList &ol) const;
virtual void writeQuickMemberLinks(OutputList &,MemberDef *) const {}
void setHidden(bool b) { m_hidden = b; }
/*! Writes the documentation anchors of the definition to
* the Doxygen::tagFile stream.
*/
void writeDocAnchorsToTagFile();
protected:
void setLocalName(const QCString name) { m_localName=name; }
......@@ -241,7 +264,13 @@ class Definition
int getXRefListId(const char *listName) const;
void writeSourceRefList(OutputList &ol,const char *scopeName,
const QCString &text,MemberSDict *members,bool);
//-----------------------------------------------------------------------------------
// --- member variables
//-----------------------------------------------------------------------------------
SectionDict *m_sectionDict; // dictionary of all sections
MemberSDict *m_sourceRefByDict;
MemberSDict *m_sourceRefsDict;
......@@ -271,10 +300,11 @@ class Definition
QCString m_defFileExt;
};
class DefinitionList : public QList<Definition>
class DefinitionList : public QList<Definition>, public DefinitionIntf
{
public:
~DefinitionList() {}
DefType definitionType() const { return TypeSymbolList; }
int compareItems(GCI item1,GCI item2)
{
return stricmp(((Definition *)item1)->name(),
......
......@@ -70,8 +70,6 @@ class DirDef : public Definition
void writeDetailedDocumentation(OutputList &ol);
void writeDocumentation(OutputList &ol);
void writeDepGraph(QTextStream &t);
//void writePathFragment(OutputList &ol) const;
//void writeNavigationPath(OutputList &ol);
static DirDef *mergeDirectoryInTree(const QCString &path);
bool visited;
......
......@@ -3582,6 +3582,31 @@ void DocSimpleSect::appendLinkWord(const QString &word)
g_inSeeBlock=FALSE;
}
QCString DocSimpleSect::typeString() const
{
switch (m_type)
{
case Unknown: break;
case See: return "see";
case Return: return "return";
case Author: // fall through
case Authors: return "author";
case Version: return "version";
case Since: return "since";
case Date: return "date";
case Note: return "note";
case Warning: return "warning";
case Pre: return "pre";
case Post: return "post";
case Invar: return "invariant";
case Remark: return "remark";
case Attention: return "attention";
case User: return "user";
case Rcs: return "rcs";
}
return "unknown";
}
//--------------------------------------------------------------------------
int DocParamList::parse(const QString &cmdName)
......
......@@ -915,6 +915,7 @@ class DocSimpleSect : public CompAccept<DocSimpleSect>, public DocNode
virtual ~DocSimpleSect();
Kind kind() const { return Kind_SimpleSect; }
Type type() const { return m_type; }
QCString typeString() const;
DocNode *parent() const { return m_parent; }
void accept(DocVisitor *v);
int parse(bool userTitle);
......
......@@ -629,29 +629,29 @@ void DotNode::writeBox(QTextStream &t,
{
t << "{" << convertLabel(m_label);
t << "\\n|";
writeBoxMemberList(t,'+',m_classDef->pubAttribs,m_classDef);
writeBoxMemberList(t,'+',m_classDef->pubStaticAttribs,m_classDef);
writeBoxMemberList(t,'~',m_classDef->pacAttribs,m_classDef);
writeBoxMemberList(t,'~',m_classDef->pacStaticAttribs,m_classDef);
writeBoxMemberList(t,'#',m_classDef->proAttribs,m_classDef);
writeBoxMemberList(t,'#',m_classDef->proStaticAttribs,m_classDef);
writeBoxMemberList(t,'-',m_classDef->priAttribs,m_classDef);
writeBoxMemberList(t,'-',m_classDef->priStaticAttribs,m_classDef);
writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubAttribs),m_classDef);
writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubStaticAttribs),m_classDef);
writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacAttribs),m_classDef);
writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacStaticAttribs),m_classDef);
writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proAttribs),m_classDef);
writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proStaticAttribs),m_classDef);
writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priAttribs),m_classDef);
writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticAttribs),m_classDef);
t << "|";
writeBoxMemberList(t,'+',m_classDef->pubMethods,m_classDef);
writeBoxMemberList(t,'+',m_classDef->pubStaticMethods,m_classDef);
writeBoxMemberList(t,'+',m_classDef->pubSlots,m_classDef);
writeBoxMemberList(t,'~',m_classDef->pacMethods,m_classDef);
writeBoxMemberList(t,'~',m_classDef->pacStaticMethods,m_classDef);
writeBoxMemberList(t,'#',m_classDef->proMethods,m_classDef);
writeBoxMemberList(t,'#',m_classDef->proStaticMethods,m_classDef);
writeBoxMemberList(t,'#',m_classDef->proSlots,m_classDef);
writeBoxMemberList(t,'-',m_classDef->priMethods,m_classDef);
writeBoxMemberList(t,'-',m_classDef->priStaticMethods,m_classDef);
writeBoxMemberList(t,'-',m_classDef->priSlots,m_classDef);
if (m_classDef->memberGroupSDict)
{
MemberGroupSDict::Iterator mgdi(*m_classDef->memberGroupSDict);
writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubMethods),m_classDef);
writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubStaticMethods),m_classDef);
writeBoxMemberList(t,'+',m_classDef->getMemberList(MemberList::pubSlots),m_classDef);
writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacMethods),m_classDef);
writeBoxMemberList(t,'~',m_classDef->getMemberList(MemberList::pacStaticMethods),m_classDef);
writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proMethods),m_classDef);
writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proStaticMethods),m_classDef);
writeBoxMemberList(t,'#',m_classDef->getMemberList(MemberList::proSlots),m_classDef);
writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priMethods),m_classDef);
writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priStaticMethods),m_classDef);
writeBoxMemberList(t,'-',m_classDef->getMemberList(MemberList::priSlots),m_classDef);
if (m_classDef->getMemberGroupSDict())
{
MemberGroupSDict::Iterator mgdi(*m_classDef->getMemberGroupSDict());
MemberGroup *mg;
for (mgdi.toFirst();(mg=mgdi.current());++mgdi)
{
......@@ -2774,7 +2774,7 @@ void DotGroupCollaboration::buildGraph(GroupDef* gd,int)
// Write collaboration
// Add members
addMemberList( gd->getMembers() );
addMemberList( gd->getMemberList(MemberList::allMembersList) );
// Add classes
if ( gd->getClasses() && gd->getClasses()->count() )
......
......@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <qtextcodec.h>
#include <unistd.h>
#include "version.h"
#include "doxygen.h"
......@@ -66,6 +67,7 @@
#include "parserintf.h"
#include "htags.h"
#include "pyscanner.h"
#include "code.h"
#define RECURSE_ENTRYTREE(func,var) \
......@@ -125,7 +127,7 @@ bool Doxygen::parseSourcesNeeded = FALSE;
double Doxygen::sysElapsedTime = 0.0;
QTime Doxygen::runningTime;
SearchIndex * Doxygen::searchIndex=0;
SDict<DefinitionList> *Doxygen::symbolMap;
QDict<DefinitionIntf> *Doxygen::symbolMap;
bool Doxygen::outputToWizard=FALSE;
QDict<int> * Doxygen::htmlDirMap = 0;
QCache<LookupInfo> Doxygen::lookupCache(50000,50000);
......@@ -1406,7 +1408,9 @@ static void findUsingDirectives(EntryNav *rootNav)
// see if the using statement was found inside a namespace or inside
// the global file scope.
if (rootNav->parent() && rootNav->parent()->section() == Entry::NAMESPACE_SEC)
if (rootNav->parent() && rootNav->parent()->section()==Entry::NAMESPACE_SEC &&
(fd==0 || fd->name().right(5)!=".java") // not a .java file
)
{
nsName=stripAnonymousNamespaceScope(rootNav->parent()->name());
if (!nsName.isEmpty())
......@@ -1582,8 +1586,13 @@ static void findUsingDeclarations(EntryNav *rootNav)
// file scope).
QCString name = substitute(root->name,".","::");
MemberDef *mtd=0;
usingCd = getResolvedClass(nd,fd,name,&mtd);
//MemberDef *mtd=0;
//usingCd = getResolvedClass(nd,fd,name,&mtd);
usingCd = getClass(name);
if (usingCd==0)
{
usingCd = Doxygen::hiddenClasses.find(name);
}
//printf("%s -> %p\n",root->name.data(),usingCd);
if (usingCd==0) // definition not in the input => add an artificial class
......@@ -1592,7 +1601,7 @@ static void findUsingDeclarations(EntryNav *rootNav)
name.data(),root->section,root->tArgLists ? (int)root->tArgLists->count() : -1);
usingCd = new ClassDef(
"<using>",1,
root->name,ClassDef::Class);
name,ClassDef::Class);
Doxygen::hiddenClasses.append(root->name,usingCd);
usingCd->setClassIsArtificial();
}
......@@ -1602,6 +1611,7 @@ static void findUsingDeclarations(EntryNav *rootNav)
usingCd->name().data(),nd?nd->name().data():fd->name().data());
}
#if 0
if (mtd) // add the typedef to the correct scope
{
if (nd)
......@@ -1615,7 +1625,9 @@ static void findUsingDeclarations(EntryNav *rootNav)
fd->addUsingDeclaration(mtd);
}
}
else if (usingCd) // add the class to the correct scope
else
#endif
if (usingCd) // add the class to the correct scope
{
if (nd)
{
......@@ -2371,8 +2383,9 @@ static void buildVarList(EntryNav *rootNav)
scope=root->relates;
}
// note: changed from scope to classScope on 2-10-2005
if (!classScope.isEmpty() && !name.isEmpty() && (cd=getClass(classScope)))
cd=getClass(scope);
if (cd==0 && classScope!=scope) cd=getClass(classScope);
if (cd)
{
MemberDef *md=0;
......@@ -4946,7 +4959,9 @@ static void findMember(EntryNav *rootNav,
}
if (root->relates.isEmpty() && rootNav->parent() &&
(rootNav->parent()->section()&Entry::SCOPE_MASK) &&
((rootNav->parent()->section()&Entry::SCOPE_MASK) ||
(rootNav->parent()->section()==Entry::OBJCIMPL_SEC)
) &&
!rootNav->parent()->name().isEmpty()) // see if we can combine scopeName
// with the scope in which it was found
{
......@@ -5373,6 +5388,7 @@ static void findMember(EntryNav *rootNav,
mn->append(md);
cd->insertMember(md);
md->setRefItems(root->sli);
delete tArgList;
}
else
{
......@@ -5711,6 +5727,7 @@ static void filterMemberDocumentation(EntryNav *rootNav)
"findMemberDocumentation(): root->type=`%s' root->inside=`%s' root->name=`%s' root->args=`%s' section=%x root->memSpec=%d root->mGrpId=%d\n",
root->type.data(),root->inside.data(),root->name.data(),root->args.data(),root->section,root->memSpec,root->mGrpId
);
//printf("rootNav->parent()->name()=%s\n",rootNav->parent()->name().data());
bool isFunc=TRUE;
if (root->relatesDup && !root->relates.isEmpty())
......@@ -7426,7 +7443,7 @@ static void generateNamespaceDocs()
nd->writeDocumentation(*outputList);
}
// for each class in the namespace...
ClassSDict::Iterator cli(*nd->classSDict);
ClassSDict::Iterator cli(*nd->getClassSDict());
for ( ; cli.current() ; ++cli )
{
ClassDef *cd=cli.current();
......@@ -8267,8 +8284,8 @@ void initDoxygen()
setlocale(LC_ALL,"");
setlocale(LC_NUMERIC,"C");
#endif
Doxygen::symbolMap = new SDict<DefinitionList>(1000);
Doxygen::symbolMap->setAutoDelete(TRUE);
Doxygen::symbolMap = new QDict<DefinitionIntf>(1000);
//Doxygen::symbolMap->setAutoDelete(TRUE);
Doxygen::globalScope = new NamespaceDef("<globalScope>",1,"<globalScope>");
Doxygen::runningTime.start();
......@@ -8315,6 +8332,26 @@ void cleanUpDoxygen()
delete theTranslator;
delete outputList;
Mappers::freeMappers();
codeFreeScanner();
// iterate through Doxygen::symbolMap and delete all
// DefinitionList objects, since they have no owner
QDictIterator<DefinitionIntf> dli(*Doxygen::symbolMap);
DefinitionIntf *di;
for (dli.toFirst();(di=dli.current());)
{
if (di->definitionType()==DefinitionIntf::TypeSymbolList)
{
DefinitionIntf *tmp = Doxygen::symbolMap->take(dli.currentKey());
delete (DefinitionList *)tmp;
}
else
{
++dli;
}
}
//delete Doxygen::symbolMap; <- we cannot do this unless all static lists
// (such as Doxygen::namespaceSDict)
// with objects based on Definition are made
......@@ -8596,6 +8633,14 @@ void readConfiguration(int argc, char **argv)
exit(0);
}
/* Perlmod wants to know the path to the config file.*/
QFileInfo configFileInfo(configName);
setPerlModDoxyfile(configFileInfo.absFilePath());
}
void checkConfiguration()
{
Config::instance()->substituteEnvironmentVars();
Config::instance()->convertStrToVal();
Config::instance()->check();
......@@ -8620,9 +8665,6 @@ void readConfiguration(int argc, char **argv)
/* Set the global html file extension. */
Doxygen::htmlFileExtension = Config_getString("HTML_FILE_EXTENSION");
/* Perlmod wants to know the path to the config file.*/
QFileInfo configFileInfo(configName);
setPerlModDoxyfile(configFileInfo.absFilePath());
Doxygen::xrefLists->setAutoDelete(TRUE);
......@@ -8941,6 +8983,16 @@ void parseInput()
exit(1);
}
// we are done with input scanning now, so free up the buffers used by flex
// (can be around 4MB)
preFreeScanner();
scanFreeScanner();
pyscanFreeScanner();
//delete rootNav;
//g_storage.close();
//exit(1);
/**************************************************************************
* Gather information *
**************************************************************************/
......
......@@ -110,7 +110,7 @@ class Doxygen
static double sysElapsedTime;
static QTime runningTime;
static SearchIndex *searchIndex;
static SDict<DefinitionList> *symbolMap;
static QDict<DefinitionIntf> *symbolMap;
static bool outputToWizard;
static QDict<int> *htmlDirMap;
static QCache<LookupInfo> lookupCache;
......@@ -122,6 +122,7 @@ class Doxygen
void initDoxygen();
void readConfiguration(int argc, char **argv);
void checkConfiguration();
void parseInput();
void generateOutput();
......
......@@ -24,6 +24,7 @@ int Entry::num=0;
Entry::Entry()
{
//printf("Entry::Entry(%p)\n",this);
num++;
m_parent=0;
section = EMPTY_SEC;
......@@ -33,7 +34,7 @@ Entry::Entry()
extends->setAutoDelete(TRUE);
groups = new QList<Grouping>;
groups->setAutoDelete(TRUE);
anchors = new QList<SectionInfo>;
anchors = new QList<SectionInfo>; // Doxygen::sectionDict takes ownership of the items!
argList = new ArgumentList;
argList->setAutoDelete(TRUE);
//printf("Entry::Entry() tArgList=0\n");
......@@ -49,6 +50,7 @@ Entry::Entry()
Entry::Entry(const Entry &e)
{
//printf("Entry::Entry(%p):copy\n",this);
num++;
section = e.section;
protection = e.protection;
......@@ -171,17 +173,17 @@ Entry::Entry(const Entry &e)
Entry::~Entry()
{
//printf("Entry::~Entry(%p) num=%d\n",this,num);
//printf("Deleting entry %d name %s type %x children %d\n",
// num,name.data(),section,sublist->count());
//delete sublist; // each element is now own by a EntryNav so we do no longer own
delete m_sublist; // each element is now own by a EntryNav so we do no longer own
// our children.
delete extends;
delete groups;
delete anchors;
delete argList;
delete tArgLists;
//delete mtArgList;
delete tagInfo;
delete sli;
num--;
......@@ -200,6 +202,7 @@ void Entry::addSubEntry(Entry *current)
void Entry::reset()
{
//printf("Entry::reset()\n");
name.resize(0);
type.resize(0);
args.resize(0);
......@@ -273,12 +276,14 @@ void Entry::createSubtreeIndex(EntryNav *nav,QFile &storage,FileDef *fd)
{
childNode->createSubtreeIndex(childNav,storage,fd);
}
//m_sublist->setAutoDelete(FALSE);
m_sublist->clear();
}
}
void Entry::createNavigationIndex(EntryNav *rootNav,QFile &storage,FileDef *fd)
{
//printf("createNavigationIndex(%p) sublist=%p\n",this,m_sublist);
if (m_sublist)
{
//printf("saveEntries: %d children\n",root->sublist->count());
......@@ -290,6 +295,7 @@ void Entry::createNavigationIndex(EntryNav *rootNav,QFile &storage,FileDef *fd)
createSubtreeIndex(rootNav,storage,fd);
}
// remove all entries from root
//m_sublist->setAutoDelete(FALSE);
m_sublist->clear();
}
}
......@@ -535,6 +541,7 @@ ArgumentList *unmarshalArgumentList(QFile &f)
uint count = unmarshalUInt(f);
if (count==NULL_LIST) return 0; // null list
ArgumentList *result = new ArgumentList;
result->setAutoDelete(TRUE);
//printf("unmarshalArgumentList: %d\n",count);
for (i=0;i<count;i++)
{
......@@ -560,6 +567,7 @@ QList<ArgumentList> *unmarshalArgumentLists(QFile &f)
uint count = unmarshalUInt(f);
if (count==NULL_LIST) return 0; // null list
QList<ArgumentList> *result = new QList<ArgumentList>;
result->setAutoDelete(TRUE);
//printf("unmarshalArgumentLists: %d\n",count);
for (i=0;i<count;i++)
{
......@@ -574,6 +582,7 @@ QList<BaseInfo> *unmarshalBaseInfoList(QFile &f)
uint count = unmarshalUInt(f);
if (count==NULL_LIST) return 0; // null list
QList<BaseInfo> *result = new QList<BaseInfo>;
result->setAutoDelete(TRUE);
for (i=0;i<count;i++)
{
QCString name = unmarshalQCString(f);
......@@ -590,6 +599,7 @@ QList<Grouping> *unmarshalGroupingList(QFile &f)
uint count = unmarshalUInt(f);
if (count==NULL_LIST) return 0; // null list
QList<Grouping> *result = new QList<Grouping>;
result->setAutoDelete(TRUE);
for (i=0;i<count;i++)
{
QCString name = unmarshalQCString(f);
......@@ -605,6 +615,7 @@ QList<SectionInfo> *unmarshalSectionInfoList(QFile &f)
uint count = unmarshalUInt(f);
if (count==NULL_LIST) return 0; // null list
QList<SectionInfo> *result = new QList<SectionInfo>;
result->setAutoDelete(TRUE);
for (i=0;i<count;i++)
{
QCString label = unmarshalQCString(f);
......@@ -623,6 +634,7 @@ QList<ListItemInfo> *unmarshalItemInfoList(QFile &f)
uint count = unmarshalUInt(f);
if (count==NULL_LIST) return 0; // null list
QList<ListItemInfo> *result = new QList<ListItemInfo>;
result->setAutoDelete(TRUE);
for (i=0;i<count;i++)
{
ListItemInfo *lii = new ListItemInfo;
......@@ -710,6 +722,7 @@ bool loadEntry(Entry *e,QFile &f)
e->virt = (Specifier)unmarshalInt(f);
e->args = unmarshalQCString(f);
e->bitfields = unmarshalQCString(f);
delete e->argList;
e->argList = unmarshalArgumentList(f);
e->tArgLists = unmarshalArgumentLists(f);
e->program = unmarshalQCString(f);
......@@ -734,8 +747,11 @@ bool loadEntry(Entry *e,QFile &f)
e->bodyLine = unmarshalInt(f);
e->endBodyLine = unmarshalInt(f);
e->mGrpId = unmarshalInt(f);
delete e->extends;
e->extends = unmarshalBaseInfoList(f);
delete e->groups;
e->groups = unmarshalGroupingList(f);
delete e->anchors;
e->anchors = unmarshalSectionInfoList(f);
e->fileName = unmarshalQCString(f);
e->startLine = unmarshalInt(f);
......@@ -832,8 +848,8 @@ void EntryNav::releaseEntry()
{
if (!m_noLoad)
{
delete m_info;
//printf("EntryNav::releaseEntry %p\n",m_info);
delete m_info;
m_info=0;
}
}
......
......@@ -55,6 +55,7 @@ class DevNullCodeDocInterface : public CodeOutputInterface
virtual void startFontClass(const char *) {}
virtual void endFontClass() {}
virtual void writeCodeAnchor(const char *) {}
virtual void linkableSymbol(int, const char *,Definition *,Definition *) {}
};
......@@ -83,6 +84,8 @@ FileDef::FileDef(const char *p,const char *nm,
srcMemberDict = 0;
usingDirList = 0;
usingDeclList = 0;
#if 0
allMemberList = 0;
decDefineMembers = 0;
decProtoMembers = 0;
......@@ -96,6 +99,8 @@ FileDef::FileDef(const char *p,const char *nm,
docEnumMembers = 0;
docFuncMembers = 0;
docVarMembers = 0;
#endif
package = 0;
isSource = FALSE;
docname = nm;
......@@ -104,6 +109,7 @@ FileDef::FileDef(const char *p,const char *nm,
{
docname.prepend(stripFromPath(path.copy()));
}
m_isJava = name().right(5)==".java";
memberGroupSDict = 0;
acquireFileVersion();
}
......@@ -122,6 +128,8 @@ FileDef::~FileDef()
delete usingDirList;
delete usingDeclList;
delete memberGroupSDict;
#if 0
delete allMemberList;
delete decDefineMembers;
delete decProtoMembers;
......@@ -135,12 +143,14 @@ FileDef::~FileDef()
delete docEnumMembers;
delete docFuncMembers;
delete docVarMembers;
#endif
}
/*! Compute the HTML anchor names for all members in the class */
void FileDef::computeAnchors()
{
if (allMemberList) setAnchors(0,'a',allMemberList);
MemberList *ml = getMemberList(MemberList::allMembersList);
if (ml) setAnchors(0,'a',ml);
}
void FileDef::distributeMemberGroupDocumentation()
......@@ -169,12 +179,16 @@ void FileDef::findSectionsInDocumentation()
mg->findSectionsInDocumentation();
}
}
if (decDefineMembers) decDefineMembers->findSectionsInDocumentation();
if (decProtoMembers) decProtoMembers->findSectionsInDocumentation();
if (decTypedefMembers) decTypedefMembers->findSectionsInDocumentation();
if (decEnumMembers) decEnumMembers->findSectionsInDocumentation();
if (decFuncMembers) decFuncMembers->findSectionsInDocumentation();
if (decVarMembers) decVarMembers->findSectionsInDocumentation();
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::declarationLists)
{
ml->findSectionsInDocumentation();
}
}
}
void FileDef::writeDetailedDocumentation(OutputList &ol)
......@@ -520,12 +534,18 @@ void FileDef::writeDocumentation(OutputList &ol)
}
//allMemberList.writeDeclarations(ol,0,0,this,0,0,0);
if (decDefineMembers) decDefineMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trDefines(),0);
if (decProtoMembers) decProtoMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFuncProtos(),0);
if (decTypedefMembers) decTypedefMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trTypedefs(),0);
if (decEnumMembers) decEnumMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trEnumerations(),0);
if (decFuncMembers) decFuncMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFunctions(),0);
if (decVarMembers) decVarMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trVariables(),0);
writeMemberDeclarations(ol,MemberList::decDefineMembers,theTranslator->trDefines());
//if (decDefineMembers) decDefineMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trDefines(),0);
writeMemberDeclarations(ol,MemberList::decProtoMembers,theTranslator->trFuncProtos());
//if (decProtoMembers) decProtoMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFuncProtos(),0);
writeMemberDeclarations(ol,MemberList::decTypedefMembers,theTranslator->trTypedefs());
//if (decTypedefMembers) decTypedefMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trTypedefs(),0);
writeMemberDeclarations(ol,MemberList::decEnumMembers,theTranslator->trEnumerations());
//if (decEnumMembers) decEnumMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trEnumerations(),0);
writeMemberDeclarations(ol,MemberList::decFuncMembers,theTranslator->trFunctions());
//if (decFuncMembers) decFuncMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trFunctions(),0);
writeMemberDeclarations(ol,MemberList::decVarMembers,theTranslator->trVariables());
//if (decVarMembers) decVarMembers->writeDeclarations(ol,0,0,this,0,theTranslator->trVariables(),0);
ol.endMemberSections();
if (!Config_getBool("DETAILS_AT_TOP"))
......@@ -553,7 +573,8 @@ void FileDef::writeDocumentation(OutputList &ol)
if (Config_getBool("SEPARATE_MEMBER_PAGES"))
{
if (allMemberList) allMemberList->sort();
MemberList *ml = getMemberList(MemberList::allMembersList);
if (ml) ml->sort();
writeMemberPages(ol);
}
}
......@@ -565,41 +586,47 @@ void FileDef::writeMemberDocumentation(OutputList &ol)
ol.disable(OutputGenerator::Html);
}
if (docDefineMembers)
{
docDefineMembers->writeDocumentation(ol,name(),this,
theTranslator->trDefineDocumentation());
}
writeMemberDocumentation(ol,MemberList::docDefineMembers,theTranslator->trDefineDocumentation());
//if (docDefineMembers)
//{
// docDefineMembers->writeDocumentation(ol,name(),this,
// theTranslator->trDefineDocumentation());
//}
if (docProtoMembers)
{
docProtoMembers->writeDocumentation(ol,name(),this,
theTranslator->trFunctionPrototypeDocumentation());
}
writeMemberDocumentation(ol,MemberList::docProtoMembers,theTranslator->trFunctionPrototypeDocumentation());
//if (docProtoMembers)
//{
// docProtoMembers->writeDocumentation(ol,name(),this,
// theTranslator->trFunctionPrototypeDocumentation());
//}
if (docTypedefMembers)
{
docTypedefMembers->writeDocumentation(ol,name(),this,
theTranslator->trTypedefDocumentation());
}
writeMemberDocumentation(ol,MemberList::docTypedefMembers,theTranslator->trTypedefDocumentation());
//if (docTypedefMembers)
//{
// docTypedefMembers->writeDocumentation(ol,name(),this,
// theTranslator->trTypedefDocumentation());
//}
if (docEnumMembers)
{
docEnumMembers->writeDocumentation(ol,name(),this,
theTranslator->trEnumerationTypeDocumentation());
}
writeMemberDocumentation(ol,MemberList::docEnumMembers,theTranslator->trEnumerationTypeDocumentation());
//if (docEnumMembers)
//{
// docEnumMembers->writeDocumentation(ol,name(),this,
// theTranslator->trEnumerationTypeDocumentation());
//}
if (docFuncMembers)
{
docFuncMembers->writeDocumentation(ol,name(),this,
theTranslator->trFunctionDocumentation());
}
writeMemberDocumentation(ol,MemberList::docFuncMembers,theTranslator->trFunctionDocumentation());
//if (docFuncMembers)
//{
// docFuncMembers->writeDocumentation(ol,name(),this,
// theTranslator->trFunctionDocumentation());
//}
if (docVarMembers)
{
docVarMembers->writeDocumentation(ol,name(),this,
theTranslator->trVariableDocumentation());
}
writeMemberDocumentation(ol,MemberList::docVarMembers,theTranslator->trVariableDocumentation());
//if (docVarMembers)
//{
// docVarMembers->writeDocumentation(ol,name(),this,
// theTranslator->trVariableDocumentation());
//}
if (Config_getBool("SEPARATE_MEMBER_PAGES"))
{
......@@ -612,12 +639,23 @@ void FileDef::writeMemberPages(OutputList &ol)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::documentationLists)
{
ml->writeDocumentationPage(ol,name(),this);
}
}
#if 0
if (docDefineMembers) docDefineMembers->writeDocumentationPage(ol,name(),this);
if (docProtoMembers) docProtoMembers->writeDocumentationPage(ol,name(),this);
if (docTypedefMembers) docTypedefMembers->writeDocumentationPage(ol,name(),this);
if (docEnumMembers) docEnumMembers->writeDocumentationPage(ol,name(),this);
if (docFuncMembers) docFuncMembers->writeDocumentationPage(ol,name(),this);
if (docVarMembers) docVarMembers->writeDocumentationPage(ol,name(),this);
#endif
ol.popGeneratorState();
}
......@@ -629,6 +667,7 @@ void FileDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) const
ol.writeString(" <div class=\"navtab\">\n");
ol.writeString(" <table>\n");
MemberList *allMemberList = getMemberList(MemberList::allMembersList);
if (allMemberList)
{
MemberListIterator mli(*allMemberList);
......@@ -725,12 +764,23 @@ void FileDef::parseSource()
void FileDef::addMembersToMemberGroup()
{
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::declarationLists)
{
::addMembersToMemberGroup(ml,&memberGroupSDict,this);
}
}
#if 0
::addMembersToMemberGroup(decDefineMembers, &memberGroupSDict,this);
::addMembersToMemberGroup(decProtoMembers, &memberGroupSDict,this);
::addMembersToMemberGroup(decTypedefMembers, &memberGroupSDict,this);
::addMembersToMemberGroup(decEnumMembers, &memberGroupSDict,this);
::addMembersToMemberGroup(decFuncMembers, &memberGroupSDict,this);
::addMembersToMemberGroup(decVarMembers, &memberGroupSDict,this);
#endif
}
/*! Adds member definition \a md to the list of all members of this file */
......@@ -738,6 +788,7 @@ void FileDef::insertMember(MemberDef *md)
{
//printf("%s:FileDef::insertMember(%s (=%p) list has %d elements)\n",
// name().data(),md->name().data(),md,allMemberList.count());
MemberList *allMemberList = getMemberList(MemberList::allMembersList);
if (allMemberList && allMemberList->findRef(md)!=-1)
{
return;
......@@ -745,63 +796,74 @@ void FileDef::insertMember(MemberDef *md)
if (allMemberList==0)
{
allMemberList = new MemberList;
allMemberList = new MemberList(MemberList::allMembersList);
m_memberLists.append(allMemberList);
}
allMemberList->append(md);
bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS");
bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS");
switch (md->memberType())
{
case MemberDef::Variable:
case MemberDef::Property:
if (decVarMembers==0) decVarMembers = new MemberList;
if (sortBriefDocs) decVarMembers->inSort(md); else decVarMembers->append(md);
if (docVarMembers==0) docVarMembers = new MemberList;
if (sortMemberDocs) docVarMembers->inSort(md); else docVarMembers->append(md);
docVarMembers->setInFile(TRUE);
addMemberToList(MemberList::decVarMembers,md);
//if (decVarMembers==0) decVarMembers = new MemberList;
//if (sortBriefDocs) decVarMembers->inSort(md); else decVarMembers->append(md);
addMemberToList(MemberList::docVarMembers,md);
//if (docVarMembers==0) docVarMembers = new MemberList;
//if (sortMemberDocs) docVarMembers->inSort(md); else docVarMembers->append(md);
//docVarMembers->setInFile(TRUE);
break;
case MemberDef::Function:
if (decFuncMembers==0) decFuncMembers = new MemberList;
if (sortBriefDocs) decFuncMembers->inSort(md); else decFuncMembers->append(md);
if (docFuncMembers==0) docFuncMembers = new MemberList;
if (sortMemberDocs) docFuncMembers->inSort(md); else docFuncMembers->append(md);
docFuncMembers->setInFile(TRUE);
addMemberToList(MemberList::decFuncMembers,md);
//if (decFuncMembers==0) decFuncMembers = new MemberList;
//if (sortBriefDocs) decFuncMembers->inSort(md); else decFuncMembers->append(md);
addMemberToList(MemberList::docFuncMembers,md);
//if (docFuncMembers==0) docFuncMembers = new MemberList;
//if (sortMemberDocs) docFuncMembers->inSort(md); else docFuncMembers->append(md);
//docFuncMembers->setInFile(TRUE);
break;
case MemberDef::Typedef:
if (decTypedefMembers==0) decTypedefMembers = new MemberList;
if (sortBriefDocs) decTypedefMembers->inSort(md); else decTypedefMembers->append(md);
if (docTypedefMembers==0) docTypedefMembers = new MemberList;
if (sortMemberDocs) docTypedefMembers->inSort(md); else docTypedefMembers->append(md);
docTypedefMembers->setInFile(TRUE);
addMemberToList(MemberList::decTypedefMembers,md);
//if (decTypedefMembers==0) decTypedefMembers = new MemberList;
//if (sortBriefDocs) decTypedefMembers->inSort(md); else decTypedefMembers->append(md);
addMemberToList(MemberList::docTypedefMembers,md);
//if (docTypedefMembers==0) docTypedefMembers = new MemberList;
//if (sortMemberDocs) docTypedefMembers->inSort(md); else docTypedefMembers->append(md);
//docTypedefMembers->setInFile(TRUE);
break;
case MemberDef::Enumeration:
if (decEnumMembers==0) decEnumMembers = new MemberList;
if (sortBriefDocs) decEnumMembers->inSort(md); else decEnumMembers->append(md);
if (docEnumMembers==0) docEnumMembers = new MemberList;
if (sortMemberDocs) docEnumMembers->inSort(md); else docEnumMembers->append(md);
docEnumMembers->setInFile(TRUE);
addMemberToList(MemberList::decEnumMembers,md);
//if (decEnumMembers==0) decEnumMembers = new MemberList;
//if (sortBriefDocs) decEnumMembers->inSort(md); else decEnumMembers->append(md);
addMemberToList(MemberList::docEnumMembers,md);
//if (docEnumMembers==0) docEnumMembers = new MemberList;
//if (sortMemberDocs) docEnumMembers->inSort(md); else docEnumMembers->append(md);
//docEnumMembers->setInFile(TRUE);
break;
case MemberDef::EnumValue: // enum values are shown inside their enums
break;
case MemberDef::Prototype:
if (decProtoMembers==0) decProtoMembers = new MemberList;
if (sortBriefDocs) decProtoMembers->inSort(md); else decProtoMembers->append(md);
if (docProtoMembers==0) docProtoMembers = new MemberList;
if (sortMemberDocs) docProtoMembers->inSort(md); else docProtoMembers->append(md);
docProtoMembers->setInFile(TRUE);
addMemberToList(MemberList::decProtoMembers,md);
//if (decProtoMembers==0) decProtoMembers = new MemberList;
//if (sortBriefDocs) decProtoMembers->inSort(md); else decProtoMembers->append(md);
addMemberToList(MemberList::docProtoMembers,md);
//if (docProtoMembers==0) docProtoMembers = new MemberList;
//if (sortMemberDocs) docProtoMembers->inSort(md); else docProtoMembers->append(md);
//docProtoMembers->setInFile(TRUE);
break;
case MemberDef::Define:
if (decDefineMembers==0) decDefineMembers = new MemberList;
if (sortBriefDocs) decDefineMembers->inSort(md); else decDefineMembers->append(md);
if (docDefineMembers==0) docDefineMembers = new MemberList;
if (sortMemberDocs) docDefineMembers->inSort(md); else docDefineMembers->append(md);
docDefineMembers->setInFile(TRUE);
addMemberToList(MemberList::decDefineMembers,md);
//if (decDefineMembers==0) decDefineMembers = new MemberList;
//if (sortBriefDocs) decDefineMembers->inSort(md); else decDefineMembers->append(md);
addMemberToList(MemberList::docDefineMembers,md);
//if (docDefineMembers==0) docDefineMembers = new MemberList;
//if (sortMemberDocs) docDefineMembers->inSort(md); else docDefineMembers->append(md);
//docDefineMembers->setInFile(TRUE);
break;
default:
err("FileDef::insertMembers(): "
"member `%s' with class scope `%s' inserted in file scope `%s'!\n",
md->name().data(),
md->getClassDef() ? md->getClassDef()->name().data() : "",
md->getClassDef() ? md->getClassDef()->name().data() : "<global>",
name().data());
}
//addMemberToGroup(md,groupId);
......@@ -1025,12 +1087,24 @@ void FileDef::addListReferences()
mg->addListReferences(this);
}
}
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::documentationLists)
{
ml->addListReferences(this);
}
}
#if 0
if (docDefineMembers) docDefineMembers->addListReferences(this);
if (docProtoMembers) docProtoMembers->addListReferences(this);
if (docTypedefMembers) docTypedefMembers->addListReferences(this);
if (docEnumMembers) docEnumMembers->addListReferences(this);
if (docFuncMembers) docFuncMembers->addListReferences(this);
if (docVarMembers) docVarMembers->addListReferences(this);
#endif
}
//-------------------------------------------------------------------
......@@ -1383,3 +1457,64 @@ QCString FileDef::includeName() const
}
}
MemberList *FileDef::createMemberList(MemberList::ListType lt)
{
m_memberLists.setAutoDelete(TRUE);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()==lt)
{
return ml;
}
}
// not found, create a new member list
ml = new MemberList(lt);
m_memberLists.append(ml);
return ml;
}
void FileDef::addMemberToList(MemberList::ListType lt,MemberDef *md)
{
static bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS");
static bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS");
MemberList *ml = createMemberList(lt);
if (((ml->listType()&MemberList::declarationLists) && sortBriefDocs) ||
((ml->listType()&MemberList::documentationLists) && sortMemberDocs)
)
ml->inSort(md);
else
ml->append(md);
if (lt&MemberList::documentationLists)
{
ml->setInFile(TRUE);
}
}
MemberList *FileDef::getMemberList(MemberList::ListType lt) const
{
FileDef *that = (FileDef*)this;
MemberList *ml = that->m_memberLists.first();
while (ml)
{
if (ml->listType()==lt)
{
return ml;
}
ml = that->m_memberLists.next();
}
return 0;
}
void FileDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDeclarations(ol,0,0,this,0,title,0);
}
void FileDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDocumentation(ol,name(),this,title);
}
......@@ -127,6 +127,8 @@ class FileDef : public Definition
}
bool isIncluded(const QCString &name) const;
bool isJava() const { return m_isJava; }
void writeDetailedDocumentation(OutputList &ol);
void writeDocumentation(OutputList &ol);
void writeMemberDocumentation(OutputList &ol);
......@@ -168,9 +170,13 @@ class FileDef : public Definition
void addListReferences();
bool isDocumentationFile() const;
//void generateXML(QTextStream &t);
//void generateXMLSection(QTextStream &t,MemberList *ml,const char *type);
MemberList *getMemberList(MemberList::ListType lt) const;
const QList<MemberList> &getMemberLists() const { return m_memberLists; }
#if 0
MemberList *allMemberList;
// members in the declaration part of the documentation
......@@ -188,12 +194,12 @@ class FileDef : public Definition
MemberList *docEnumMembers;
MemberList *docFuncMembers;
MemberList *docVarMembers;
#endif
/* user defined member groups */
MemberGroupSDict *memberGroupSDict;
NamespaceSDict *namespaceSDict;
ClassSDict *classSDict;
MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; }
ClassSDict *getClassSDict() const { return classSDict; }
bool visited;
......@@ -204,6 +210,11 @@ class FileDef : public Definition
void acquireFileVersion();
private:
MemberList *createMemberList(MemberList::ListType lt);
void addMemberToList(MemberList::ListType lt,MemberDef *md);
void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title);
void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title);
QDict<IncludeInfo> *includeDict;
QList<IncludeInfo> *includeList;
QDict<IncludeInfo> *includedByDict;
......@@ -218,9 +229,14 @@ class FileDef : public Definition
QIntDict<Definition> *srcDefDict;
QIntDict<MemberDef> *srcMemberDict;
bool isSource;
bool m_isJava;
QCString fileVersion;
PackageDef *package;
DirDef *dir;
QList<MemberList> m_memberLists;
MemberGroupSDict *memberGroupSDict;
NamespaceSDict *namespaceSDict;
ClassSDict *classSDict;
};
......
......@@ -107,7 +107,8 @@ void FormulaList::generateBitmaps(const char *path)
if (latexCmd.isEmpty()) latexCmd="latex";
if (iSystem(latexCmd,"_formulas.tex")!=0)
{
err("Problems running latex. Check your installation or look for typos in _formulas.tex!\n");
err("Problems running latex. Check your installation or look "
"for typos in _formulas.tex and check _formulas.log!\n");
formulaError=TRUE;
//return;
}
......@@ -286,7 +287,7 @@ void FormulaList::generateBitmaps(const char *path)
}
// remove intermediate files produced by latex
thisDir.remove("_formulas.dvi");
thisDir.remove("_formulas.log");
if (!formulaError) thisDir.remove("_formulas.log"); // keep file in case of errors
thisDir.remove("_formulas.aux");
}
// remove the latex file itself
......
......@@ -45,7 +45,6 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t,
pageDict = new PageSDict(17);
exampleDict = new PageSDict(17);
dirList = new DirList;
allMemberList = new MemberList;
allMemberNameInfoSDict = new MemberNameInfoSDict(17);
if (refFileName)
{
......@@ -59,6 +58,9 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t,
memberGroupSDict = new MemberGroupSDict;
memberGroupSDict->setAutoDelete(TRUE);
allMemberList = new MemberList(MemberList::allMembersList);
#if 0
decDefineMembers.setInGroup(TRUE);
decProtoMembers.setInGroup(TRUE);
decTypedefMembers.setInGroup(TRUE);
......@@ -74,6 +76,7 @@ GroupDef::GroupDef(const char *df,int dl,const char *na,const char *t,
docEnumValMembers.setInGroup(TRUE);
docFuncMembers.setInGroup(TRUE);
docVarMembers.setInGroup(TRUE);
#endif
visited = 0;
groupScope = 0;
......@@ -128,12 +131,24 @@ void GroupDef::findSectionsInDocumentation()
{
mg->findSectionsInDocumentation();
}
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::declarationLists)
{
ml->findSectionsInDocumentation();
}
}
#if 0
decDefineMembers.findSectionsInDocumentation();
decProtoMembers.findSectionsInDocumentation();
decTypedefMembers.findSectionsInDocumentation();
decEnumMembers.findSectionsInDocumentation();
decFuncMembers.findSectionsInDocumentation();
decVarMembers.findSectionsInDocumentation();
#endif
}
void GroupDef::addFile(const FileDef *def)
......@@ -183,6 +198,16 @@ void GroupDef::addExample(const PageDef *def)
void GroupDef::addMembersToMemberGroup()
{
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::declarationLists)
{
::addMembersToMemberGroup(ml,&memberGroupSDict,this);
}
}
#if 0
::addMembersToMemberGroup(&decDefineMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decProtoMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decTypedefMembers,&memberGroupSDict,this);
......@@ -190,6 +215,7 @@ void GroupDef::addMembersToMemberGroup()
::addMembersToMemberGroup(&decEnumValMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decFuncMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decVarMembers,&memberGroupSDict,this);
#endif
//printf("GroupDef::addMembersToMemberGroup() memberGroupList=%d\n",memberGroupList->count());
MemberGroupSDict::Iterator mgli(*memberGroupSDict);
......@@ -253,94 +279,108 @@ bool GroupDef::insertMember(MemberDef *md,bool docOnly)
case MemberDef::Variable:
if (!docOnly)
{
if (Config_getBool("SORT_BRIEF_DOCS"))
decVarMembers.inSort(md);
else
decVarMembers.append(md);
addMemberToList(MemberList::decVarMembers,md);
//if (Config_getBool("SORT_BRIEF_DOCS"))
// decVarMembers.inSort(md);
//else
// decVarMembers.append(md);
}
if (Config_getBool("SORT_MEMBER_DOCS"))
docVarMembers.inSort(md);
else
docVarMembers.append(md);
addMemberToList(MemberList::docVarMembers,md);
//if (Config_getBool("SORT_MEMBER_DOCS"))
// docVarMembers.inSort(md);
//else
// docVarMembers.append(md);
break;
case MemberDef::Function:
if (!docOnly)
{
if (Config_getBool("SORT_BRIEF_DOCS"))
decFuncMembers.inSort(md);
else
decFuncMembers.append(md);
addMemberToList(MemberList::decFuncMembers,md);
//if (Config_getBool("SORT_BRIEF_DOCS"))
// decFuncMembers.inSort(md);
//else
// decFuncMembers.append(md);
}
if (Config_getBool("SORT_MEMBER_DOCS"))
docFuncMembers.inSort(md);
else
docFuncMembers.append(md);
addMemberToList(MemberList::docFuncMembers,md);
//if (Config_getBool("SORT_MEMBER_DOCS"))
// docFuncMembers.inSort(md);
//else
// docFuncMembers.append(md);
break;
case MemberDef::Typedef:
if (!docOnly)
{
if (Config_getBool("SORT_BRIEF_DOCS"))
decTypedefMembers.inSort(md);
else
decTypedefMembers.append(md);
addMemberToList(MemberList::decTypedefMembers,md);
//if (Config_getBool("SORT_BRIEF_DOCS"))
// decTypedefMembers.inSort(md);
//else
// decTypedefMembers.append(md);
}
if (Config_getBool("SORT_MEMBER_DOCS"))
docTypedefMembers.inSort(md);
else
docTypedefMembers.append(md);
addMemberToList(MemberList::docTypedefMembers,md);
//if (Config_getBool("SORT_MEMBER_DOCS"))
// docTypedefMembers.inSort(md);
//else
// docTypedefMembers.append(md);
break;
case MemberDef::Enumeration:
if (!docOnly)
{
if (Config_getBool("SORT_BRIEF_DOCS"))
decEnumMembers.inSort(md);
else
decEnumMembers.append(md);
addMemberToList(MemberList::decEnumMembers,md);
//if (Config_getBool("SORT_BRIEF_DOCS"))
// decEnumMembers.inSort(md);
//else
// decEnumMembers.append(md);
}
if (Config_getBool("SORT_MEMBER_DOCS"))
docEnumMembers.inSort(md);
else
docEnumMembers.append(md);
addMemberToList(MemberList::docEnumMembers,md);
//if (Config_getBool("SORT_MEMBER_DOCS"))
// docEnumMembers.inSort(md);
//else
// docEnumMembers.append(md);
break;
case MemberDef::EnumValue:
if (!docOnly)
{
addMemberToList(MemberList::decEnumValMembers,md);
//printf("enum value %s!\n",md->name().data());
if (Config_getBool("SORT_BRIEF_DOCS"))
decEnumValMembers.inSort(md);
else
decEnumValMembers.append(md);
//if (Config_getBool("SORT_BRIEF_DOCS"))
// decEnumValMembers.inSort(md);
//else
// decEnumValMembers.append(md);
}
if (Config_getBool("SORT_MEMBER_DOCS"))
docEnumValMembers.inSort(md);
else
docEnumValMembers.append(md);
addMemberToList(MemberList::docEnumValMembers,md);
//if (Config_getBool("SORT_MEMBER_DOCS"))
// docEnumValMembers.inSort(md);
//else
// docEnumValMembers.append(md);
break;
case MemberDef::Prototype:
if (!docOnly)
{
if (Config_getBool("SORT_BRIEF_DOCS"))
decProtoMembers.inSort(md);
else
decProtoMembers.append(md);
addMemberToList(MemberList::decProtoMembers,md);
//if (Config_getBool("SORT_BRIEF_DOCS"))
// decProtoMembers.inSort(md);
//else
// decProtoMembers.append(md);
}
if (Config_getBool("SORT_MEMBER_DOCS"))
docProtoMembers.inSort(md);
else
docProtoMembers.append(md);
addMemberToList(MemberList::docProtoMembers,md);
//if (Config_getBool("SORT_MEMBER_DOCS"))
// docProtoMembers.inSort(md);
//else
// docProtoMembers.append(md);
break;
case MemberDef::Define:
if (!docOnly)
{
if (Config_getBool("SORT_BRIEF_DOCS"))
decDefineMembers.inSort(md);
else
decDefineMembers.append(md);
addMemberToList(MemberList::decDefineMembers,md);
//if (Config_getBool("SORT_BRIEF_DOCS"))
// decDefineMembers.inSort(md);
//else
// decDefineMembers.append(md);
}
if (Config_getBool("SORT_MEMBER_DOCS"))
docDefineMembers.inSort(md);
else
docDefineMembers.append(md);
addMemberToList(MemberList::docDefineMembers,md);
//if (Config_getBool("SORT_MEMBER_DOCS"))
// docDefineMembers.inSort(md);
//else
// docDefineMembers.append(md);
break;
default:
err("GroupDef::insertMembers(): "
......@@ -374,36 +414,36 @@ void GroupDef::removeMember(MemberDef *md)
delete mni;
}
allMemberList->remove(md);
removeMemberFromList(MemberList::allMembersList,md);
switch(md->memberType())
{
case MemberDef::Variable:
decVarMembers.remove(md);
docVarMembers.remove(md);
removeMemberFromList(MemberList::decVarMembers,md);
removeMemberFromList(MemberList::docVarMembers,md);
break;
case MemberDef::Function:
decFuncMembers.remove(md);
docFuncMembers.remove(md);
removeMemberFromList(MemberList::decFuncMembers,md);
removeMemberFromList(MemberList::docFuncMembers,md);
break;
case MemberDef::Typedef:
decTypedefMembers.remove(md);
docTypedefMembers.remove(md);
removeMemberFromList(MemberList::decTypedefMembers,md);
removeMemberFromList(MemberList::docTypedefMembers,md);
break;
case MemberDef::Enumeration:
decEnumMembers.remove(md);
docEnumMembers.remove(md);
removeMemberFromList(MemberList::decEnumMembers,md);
removeMemberFromList(MemberList::docEnumMembers,md);
break;
case MemberDef::EnumValue:
decEnumValMembers.remove(md);
docEnumValMembers.remove(md);
removeMemberFromList(MemberList::decEnumValMembers,md);
removeMemberFromList(MemberList::docEnumValMembers,md);
break;
case MemberDef::Prototype:
decProtoMembers.remove(md);
docProtoMembers.remove(md);
removeMemberFromList(MemberList::decProtoMembers,md);
removeMemberFromList(MemberList::docProtoMembers,md);
break;
case MemberDef::Define:
decDefineMembers.remove(md);
docDefineMembers.remove(md);
removeMemberFromList(MemberList::decDefineMembers,md);
removeMemberFromList(MemberList::docDefineMembers,md);
break;
default:
err("GroupDef::removeMember(): unexpected member remove in file!\n");
......@@ -418,7 +458,7 @@ bool GroupDef::containsGroup(const GroupDef *def)
void GroupDef::addGroup(const GroupDef *def)
{
printf("adding group `%s' to group `%s'\n",def->name().data(),name().data());
//printf("adding group `%s' to group `%s'\n",def->name().data(),name().data());
//if (Config_getBool("SORT_MEMBER_DOCS"))
// groupList->inSort(def);
//else
......@@ -665,13 +705,20 @@ void GroupDef::writeDocumentation(OutputList &ol)
}
//allMemberList->writeDeclarations(ol,0,0,0,this,0,0);
decDefineMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trDefines(),0);
decProtoMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trFuncProtos(),0);
decTypedefMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trTypedefs(),0);
decEnumMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trEnumerations(),0);
decEnumValMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trEnumerationValues(),0,TRUE);
decFuncMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trFunctions(),0);
decVarMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trVariables(),0);
writeMemberDeclarations(ol,MemberList::decDefineMembers,theTranslator->trDefines());
//decDefineMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trDefines(),0);
writeMemberDeclarations(ol,MemberList::decProtoMembers,theTranslator->trFuncProtos());
//decProtoMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trFuncProtos(),0);
writeMemberDeclarations(ol,MemberList::decTypedefMembers,theTranslator->trTypedefs());
//decTypedefMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trTypedefs(),0);
writeMemberDeclarations(ol,MemberList::decEnumMembers,theTranslator->trEnumerations());
//decEnumMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trEnumerations(),0);
writeMemberDeclarations(ol,MemberList::decEnumValMembers,theTranslator->trEnumerationValues());
//decEnumValMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trEnumerationValues(),0,TRUE);
writeMemberDeclarations(ol,MemberList::decFuncMembers,theTranslator->trFunctions());
//decFuncMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trFunctions(),0);
writeMemberDeclarations(ol,MemberList::decVarMembers,theTranslator->trVariables());
//decVarMembers.writeDeclarations(ol,0,0,0,this,theTranslator->trVariables(),0);
}
ol.endMemberSections();
......@@ -733,26 +780,33 @@ void GroupDef::writeMemberDocumentation(OutputList &ol)
ol.disable(OutputGenerator::Html);
}
docDefineMembers.writeDocumentation(ol,name(),this,
theTranslator->trDefineDocumentation());
writeMemberDocumentation(ol,MemberList::docDefineMembers,theTranslator->trDefineDocumentation());
//docDefineMembers.writeDocumentation(ol,name(),this,
// theTranslator->trDefineDocumentation());
docProtoMembers.writeDocumentation(ol,name(),this,
theTranslator->trFunctionPrototypeDocumentation());
writeMemberDocumentation(ol,MemberList::docProtoMembers,theTranslator->trFunctionPrototypeDocumentation());
//docProtoMembers.writeDocumentation(ol,name(),this,
// theTranslator->trFunctionPrototypeDocumentation());
docTypedefMembers.writeDocumentation(ol,name(),this,
theTranslator->trTypedefDocumentation());
writeMemberDocumentation(ol,MemberList::docTypedefMembers,theTranslator->trTypedefDocumentation());
//docTypedefMembers.writeDocumentation(ol,name(),this,
// theTranslator->trTypedefDocumentation());
docEnumMembers.writeDocumentation(ol,name(),this,
theTranslator->trEnumerationTypeDocumentation());
writeMemberDocumentation(ol,MemberList::docEnumMembers,theTranslator->trEnumerationTypeDocumentation());
//docEnumMembers.writeDocumentation(ol,name(),this,
// theTranslator->trEnumerationTypeDocumentation());
docEnumValMembers.writeDocumentation(ol,name(),this,
theTranslator->trEnumerationValueDocumentation(),TRUE);
writeMemberDocumentation(ol,MemberList::docEnumValMembers,theTranslator->trEnumerationValueDocumentation());
//docEnumValMembers.writeDocumentation(ol,name(),this,
// theTranslator->trEnumerationValueDocumentation(),TRUE);
docFuncMembers.writeDocumentation(ol,name(),this,
theTranslator->trFunctionDocumentation());
writeMemberDocumentation(ol,MemberList::docFuncMembers,theTranslator->trFunctionDocumentation());
//docFuncMembers.writeDocumentation(ol,name(),this,
// theTranslator->trFunctionDocumentation());
docVarMembers.writeDocumentation(ol,name(),this,
theTranslator->trVariableDocumentation());
writeMemberDocumentation(ol,MemberList::docVarMembers,theTranslator->trVariableDocumentation());
//docVarMembers.writeDocumentation(ol,name(),this,
// theTranslator->trVariableDocumentation());
if (Config_getBool("SEPARATE_MEMBER_PAGES"))
{
......@@ -765,12 +819,23 @@ void GroupDef::writeMemberPages(OutputList &ol)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::documentationLists)
{
ml->writeDocumentationPage(ol,name(),this);
}
}
#if 0
docDefineMembers.writeDocumentationPage(ol,name(),this);
docProtoMembers.writeDocumentationPage(ol,name(),this);
docTypedefMembers.writeDocumentationPage(ol,name(),this);
docEnumMembers.writeDocumentationPage(ol,name(),this);
docFuncMembers.writeDocumentationPage(ol,name(),this);
docVarMembers.writeDocumentationPage(ol,name(),this);
#endif
ol.popGeneratorState();
}
......@@ -872,8 +937,8 @@ void addDirToGroups(Entry *root,DirDef *dd)
void addGroupToGroups(Entry *root,GroupDef *subGroup)
{
printf("addGroupToGroups for %s groups=%d\n",root->name.data(),
root->groups?root->groups->count():-1);
//printf("addGroupToGroups for %s groups=%d\n",root->name.data(),
// root->groups?root->groups->count():-1);
QListIterator<Grouping> gli(*root->groups);
Grouping *g;
for (;(g=gli.current());++gli)
......@@ -885,6 +950,11 @@ void addGroupToGroups(Entry *root,GroupDef *subGroup)
gd->addGroup(subGroup);
subGroup->makePartOfGroup(gd);
}
else if (gd==subGroup)
{
warn(root->fileName,root->startLine,"Trying to add group %s to itself!",
gd->name().data());
}
}
}
......@@ -1030,12 +1100,87 @@ void GroupDef::addListReferences()
{
mg->addListReferences(this);
}
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::documentationLists)
{
ml->addListReferences(this);
}
}
#if 0
docDefineMembers.addListReferences(this);
docProtoMembers.addListReferences(this);
docTypedefMembers.addListReferences(this);
docEnumMembers.addListReferences(this);
docFuncMembers.addListReferences(this);
docVarMembers.addListReferences(this);
#endif
}
MemberList *GroupDef::createMemberList(MemberList::ListType lt)
{
m_memberLists.setAutoDelete(TRUE);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()==lt)
{
return ml;
}
}
// not found, create a new member list
ml = new MemberList(lt);
m_memberLists.append(ml);
ml->setInGroup(TRUE);
return ml;
}
void GroupDef::addMemberToList(MemberList::ListType lt,MemberDef *md)
{
static bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS");
static bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS");
MemberList *ml = createMemberList(lt);
if (((ml->listType()&MemberList::declarationLists) && sortBriefDocs) ||
((ml->listType()&MemberList::documentationLists) && sortMemberDocs)
)
ml->inSort(md);
else
ml->append(md);
}
MemberList *GroupDef::getMemberList(MemberList::ListType lt) const
{
GroupDef *that = (GroupDef*)this;
MemberList *ml = that->m_memberLists.first();
while (ml)
{
if (ml->listType()==lt)
{
return ml;
}
ml = that->m_memberLists.next();
}
return 0;
}
void GroupDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDeclarations(ol,0,0,0,this,title,0);
}
void GroupDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDocumentation(ol,name(),this,title);
}
void GroupDef::removeMemberFromList(MemberList::ListType lt,MemberDef *md)
{
MemberList *ml = getMemberList(lt);
if (ml) ml->remove(md);
}
......@@ -92,26 +92,11 @@ class GroupDef : public Definition
void setGroupScope(Definition *d) { groupScope = d; }
Definition *getGroupScope() const { return groupScope; }
// members in the declaration part of the documentation
MemberList decDefineMembers;
MemberList decProtoMembers;
MemberList decTypedefMembers;
MemberList decEnumMembers;
MemberList decEnumValMembers;
MemberList decFuncMembers;
MemberList decVarMembers;
// members in the documentation part of the documentation
MemberList docDefineMembers;
MemberList docProtoMembers;
MemberList docTypedefMembers;
MemberList docEnumMembers;
MemberList docEnumValMembers;
MemberList docFuncMembers;
MemberList docVarMembers;
MemberList *getMemberList(MemberList::ListType lt) const;
const QList<MemberList> &getMemberLists() const { return m_memberLists; }
/* user defined member groups */
MemberGroupSDict *memberGroupSDict;
MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
FileList * getFiles() const { return fileList; }
ClassSDict * getClasses() const { return classSDict; }
......@@ -119,12 +104,18 @@ class GroupDef : public Definition
GroupList * getSubGroups() const { return groupList; }
PageSDict * getPages() const { return pageDict; }
DirList * getDirs() const { return dirList; }
MemberList* getMembers() const { return allMemberList; }
//MemberList* getMembers() const { return allMemberList; }
protected:
void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
private:
MemberList *createMemberList(MemberList::ListType lt);
void addMemberToList(MemberList::ListType lt,MemberDef *md);
void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title);
void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title);
void removeMemberFromList(MemberList::ListType lt,MemberDef *md);
QCString title; // title of the group
bool titleSet; // true if title is not the same as the name
QCString fileName; // base name of the generated file
......@@ -141,6 +132,9 @@ class GroupDef : public Definition
Definition *groupScope;
QList<MemberList> m_memberLists;
MemberGroupSDict *memberGroupSDict;
};
class GroupSDict : public SDict<GroupDef>
......
......@@ -444,7 +444,7 @@ void HtmlDocVisitor::visitPost(DocRoot *)
void HtmlDocVisitor::visitPre(DocSimpleSect *s)
{
if (m_hide) return;
m_t << "<dl compact><dt><b>";
m_t << "<dl class=\"" << s->typeString() << "\" compact><dt><b>";
switch(s->type())
{
case DocSimpleSect::See:
......
......@@ -222,6 +222,8 @@ class HtmlGenerator : public OutputGenerator
void writeCodeAnchor(const char *anchor)
{ t << "<a name=\"" << anchor << "\"></a>"; }
void linkableSymbol(int,const char *,Definition *,Definition *) {}
static void writeSearchPage();
private:
......
......@@ -2637,12 +2637,55 @@ void writeGraphInfo(OutputList &ol)
ol.popGeneratorState();
}
void writeGroupIndexItem(GroupDef *gd,MemberList *ml,const QCString &title,
HtmlHelp *htmlHelp,FTVHelp *ftvHelp)
{
if (ml && ml->count()>0)
{
bool first=TRUE;
MemberDef *md=ml->first();
while (md)
{
if (md->isDetailedSectionVisible(TRUE,FALSE))
{
if (first)
{
first=FALSE;
if (htmlHelp)
{
htmlHelp->addContentsItem(TRUE, convertToHtml(title), gd->getOutputFileBase(),0);
htmlHelp->incContentsDepth();
}
if (ftvHelp)
{
ftvHelp->addContentsItem(TRUE, gd->getReference(), gd->getOutputFileBase(), 0, title);
ftvHelp->incContentsDepth();
}
}
if (htmlHelp)
{
htmlHelp->addContentsItem(FALSE,md->name(),md->getOutputFileBase(),md->anchor());
}
if (ftvHelp)
{
ftvHelp->addContentsItem(FALSE,md->getReference(),md->getOutputFileBase(),md->anchor(),md->name());
}
}
md=ml->next();
}
if (htmlHelp && !first) htmlHelp->decContentsDepth();
if (ftvHelp && !first) ftvHelp->decContentsDepth();
}
}
//----------------------------------------------------------------------------
/*!
* write groups as hierarchical trees
* \author KPW
*/
void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level)
{
HtmlHelp *htmlHelp=0;
......@@ -2680,12 +2723,15 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level)
int numSubItems = 0;
if ( Config_getBool("TOC_EXPAND"))
{
numSubItems += gd->docDefineMembers.count();
numSubItems += gd->docTypedefMembers.count();
numSubItems += gd->docEnumMembers.count();
numSubItems += gd->docFuncMembers.count();
numSubItems += gd->docVarMembers.count();
numSubItems += gd->docProtoMembers.count();
QListIterator<MemberList> mli(gd->getMemberLists());
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::documentationLists)
{
numSubItems += ml->count();
}
}
numSubItems += gd->namespaceSDict->count();
numSubItems += gd->classSDict->count();
numSubItems += gd->fileList->count();
......@@ -2759,6 +2805,20 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level)
if (Config_getBool("TOC_EXPAND"))
{
writeGroupIndexItem(gd,gd->getMemberList(MemberList::docDefineMembers),
theTranslator->trDefines(),htmlHelp,ftvHelp);
writeGroupIndexItem(gd,gd->getMemberList(MemberList::docTypedefMembers),
theTranslator->trTypedefs(),htmlHelp,ftvHelp);
writeGroupIndexItem(gd,gd->getMemberList(MemberList::docEnumMembers),
theTranslator->trEnumerations(),htmlHelp,ftvHelp);
writeGroupIndexItem(gd,gd->getMemberList(MemberList::docFuncMembers),
theTranslator->trFunctions(),htmlHelp,ftvHelp);
writeGroupIndexItem(gd,gd->getMemberList(MemberList::docVarMembers),
theTranslator->trVariables(),htmlHelp,ftvHelp);
writeGroupIndexItem(gd,gd->getMemberList(MemberList::docProtoMembers),
theTranslator->trFuncProtos(),htmlHelp,ftvHelp);
#if 0
// write members
struct MemInfo
{
......@@ -2821,6 +2881,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level)
}
}
#endif
// write namespaces
NamespaceSDict *namespaceSDict=gd->namespaceSDict;
......
......@@ -212,6 +212,7 @@ class LatexGenerator : public OutputGenerator
void endFontClass() {}
void writeCodeAnchor(const char *) {}
void linkableSymbol(int,const char *,Definition *,Definition *) {}
private:
LatexGenerator(const LatexGenerator &);
......
......@@ -198,6 +198,7 @@ SOURCES = ce_lex.cpp \
win32:TMAKE_CXXFLAGS += -DQT_NODLL
win32-msvc:TMAKE_CXXFLAGS += -Zm200
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
linux-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
INCLUDEPATH += ../qtools
INCLUDEPATH += ../libpng
INCLUDEPATH += ../libmd5
......
......@@ -33,6 +33,7 @@ int main(int argc,char **argv)
initDoxygen();
readConfiguration(argc,argv);
checkConfiguration();
parseInput();
generateOutput();
return 0;
......
......@@ -267,6 +267,7 @@ class ManGenerator : public OutputGenerator
//void endSectionRefList() {}
void writeCodeAnchor(const char *) {}
void linkableSymbol(int,const char *,Definition *,Definition *) {}
private:
bool firstCol;
......
......@@ -461,7 +461,7 @@ void MemberDef::insertReimplementedBy(MemberDef *md)
{
m_templateMaster->insertReimplementedBy(md);
}
if (redefinedBy==0) redefinedBy = new MemberList;
if (redefinedBy==0) redefinedBy = new MemberList(MemberList::redefinedBy);
if (redefinedBy->findRef(md)==-1)
{
redefinedBy->inSort(md);
......@@ -480,7 +480,7 @@ MemberList *MemberDef::reimplementedBy() const
void MemberDef::insertEnumField(MemberDef *md)
{
if (enumFields==0) enumFields=new MemberList;
if (enumFields==0) enumFields=new MemberList(MemberList::enumFields);
enumFields->append(md);
}
......
......@@ -259,8 +259,6 @@ class MemberDef : public Definition
void setFromAnonymousMember(MemberDef *m) { annMemb=m; }
bool fromAnonymousScope() const { return annScope; }
bool anonymousDeclShown() const { return annUsed; }
//void setIndentDepth( int i) { indDepth=i; }
//int indentDepth() { return indDepth; }
// callgraph related members
bool hasCallGraph() const { return m_hasCallGraph; }
......@@ -283,11 +281,6 @@ class MemberDef : public Definition
MemberDef *inheritsDocsFrom() const { return m_docProvider; }
//QCString getBodyAnchor() const
//{
// return bodyMemb ? bodyMemb->anchor() : anchor();
//}
//void setBodyMember(MemberDef *md) { bodyMemb = md; }
void setDocsForDefinition(bool b) { docsForDefinition = b; }
void setGroupAlias(MemberDef *md) { groupAlias = md; }
MemberDef *getGroupAlias() const { return groupAlias; }
......
......@@ -39,7 +39,7 @@ MemberGroup::MemberGroup(Definition *parent,
int id,const char *hdr,const char *d,const char *docFile)
{
//printf("New member group id=%d header=%s desc=%s\n",id,hdr,d);
memberList = new MemberList;
memberList = new MemberList(MemberList::memberGroup);
grpId = id;
grpHeader = hdr;
doc = d;
......@@ -47,6 +47,7 @@ MemberGroup::MemberGroup(Definition *parent,
inSameSection = TRUE;
inDeclSection = 0;
m_numDecMembers = -1;
m_numDocMembers = -1;
m_parent = parent;
m_docFile = docFile;
//printf("Member group docs=`%s'\n",doc.data());
......@@ -141,6 +142,16 @@ int MemberGroup::countDecMembers(/*bool sectionPerType*/)
return m_numDecMembers;
}
int MemberGroup::countDocMembers()
{
if (m_numDocMembers==-1)
{
memberList->countDocMembers();
m_numDocMembers = memberList->numDocMembers();
}
return m_numDocMembers;
}
void MemberGroup::distributeMemberGroupDocumentation()
{
//printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",grpHeader.data());
......
......@@ -55,7 +55,8 @@ class MemberGroup
QCString documentation() { return doc; }
bool allMembersInSameSection() { return inSameSection; }
void addToDeclarationSection();
int countDecMembers(/*bool sectionPerType*/);
int countDecMembers();
int countDocMembers();
void distributeMemberGroupDocumentation();
void findSectionsInDocumentation();
int varCount() const;
......@@ -83,6 +84,7 @@ class MemberGroup
MemberList *inDeclSection;
bool inSameSection;
int m_numDecMembers;
int m_numDocMembers;
Definition *m_parent;
QCString m_docFile;
};
......
......@@ -26,7 +26,7 @@
#include "outputlist.h"
#include "groupdef.h"
MemberList::MemberList() : QList<MemberDef>()
MemberList::MemberList(ListType lt) : m_listType(lt)
{
memberGroupList=0;
m_numDecMembers=-1; // special value indicating that computation is needed
......@@ -139,7 +139,7 @@ void MemberList::countDocMembers(bool countEnumValues)
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
mg->countDecMembers();
mg->countDocMembers();
m_numDocMembers+=mg->numDocMembers();
}
}
......
......@@ -29,8 +29,79 @@ class MemberGroupList;
class MemberList : public QList<MemberDef>
{
public:
MemberList();
enum ListType
{
privateLists = 0x0800,
detailedLists = 0x1000,
declarationLists = 0x2000,
documentationLists = 0x4000,
pubMethods = 0,
proMethods = 1,
pacMethods = 2,
priMethods = 3 + privateLists,
pubStaticMethods = 4,
proStaticMethods = 5,
pacStaticMethods = 6,
priStaticMethods = 7 + privateLists,
pubSlots = 8,
proSlots = 9,
priSlots = 10 + privateLists,
pubAttribs = 11,
proAttribs = 12,
pacAttribs = 13,
priAttribs = 14 + privateLists,
pubStaticAttribs = 15,
proStaticAttribs = 16,
pacStaticAttribs = 17,
priStaticAttribs = 18 + privateLists,
pubTypes = 19,
proTypes = 20,
pacTypes = 21,
priTypes = 22 + privateLists,
related = 23,
signals = 24,
friends = 25,
dcopMethods = 26,
properties = 27,
events = 28,
typedefMembers = 29 + detailedLists,
enumMembers = 30 + detailedLists,
enumValMembers = 31 + detailedLists,
functionMembers = 32 + detailedLists,
relatedMembers = 33 + detailedLists,
variableMembers = 34 + detailedLists,
propertyMembers = 35 + detailedLists,
eventMembers = 36 + detailedLists,
constructors = 37 + detailedLists,
allMembersList = 38,
decDefineMembers = 39 + declarationLists,
decProtoMembers = 40 + declarationLists,
decTypedefMembers = 41 + declarationLists,
decEnumMembers = 42 + declarationLists,
decFuncMembers = 43 + declarationLists,
decVarMembers = 44 + declarationLists,
decEnumValMembers = 45 + declarationLists,
docDefineMembers = 46 + documentationLists,
docProtoMembers = 47 + documentationLists,
docTypedefMembers = 48 + documentationLists,
docEnumMembers = 49 + documentationLists,
docFuncMembers = 50 + documentationLists,
docVarMembers = 51 + documentationLists,
docEnumValMembers = 52 + documentationLists,
redefinedBy = 53,
enumFields = 54,
memberGroup = 55
};
MemberList(ListType lt);
~MemberList();
ListType listType() const { return m_listType; }
bool insert(uint index,const MemberDef *md);
void inSort(const MemberDef *md);
void append(const MemberDef *md);
......@@ -71,6 +142,7 @@ class MemberList : public QList<MemberDef>
MemberGroupList *memberGroupList;
bool m_inGroup; // is this list part of a group definition
bool m_inFile; // is this list part of a file definition
ListType m_listType;
};
class MemberListIterator : public QListIterator<MemberDef>
......
......@@ -82,12 +82,23 @@ void NamespaceDef::findSectionsInDocumentation()
{
mg->findSectionsInDocumentation();
}
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::declarationLists)
{
ml->findSectionsInDocumentation();
}
}
#if 0
decDefineMembers.findSectionsInDocumentation();
decProtoMembers.findSectionsInDocumentation();
decTypedefMembers.findSectionsInDocumentation();
decEnumMembers.findSectionsInDocumentation();
decFuncMembers.findSectionsInDocumentation();
decVarMembers.findSectionsInDocumentation();
#endif
}
void NamespaceDef::insertUsedFile(const char *f)
......@@ -139,82 +150,104 @@ void NamespaceDef::insertNamespace(NamespaceDef *nd)
void NamespaceDef::addMembersToMemberGroup()
{
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::declarationLists)
{
::addMembersToMemberGroup(ml,&memberGroupSDict,this);
}
}
#if 0
::addMembersToMemberGroup(&decDefineMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decProtoMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decTypedefMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decEnumMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decFuncMembers,&memberGroupSDict,this);
::addMembersToMemberGroup(&decVarMembers,&memberGroupSDict,this);
#endif
}
void NamespaceDef::insertMember(MemberDef *md)
{
//memList->append(md);
allMemberList.append(md);
static bool sortBriefDocs=Config_getBool("SORT_BRIEF_DOCS");
allMemberList->append(md);
//static bool sortBriefDocs=Config_getBool("SORT_BRIEF_DOCS");
switch(md->memberType())
{
case MemberDef::Variable:
if (sortBriefDocs)
decVarMembers.inSort(md);
else
decVarMembers.append(md);
if (sortBriefDocs)
docVarMembers.inSort(md);
else
docVarMembers.append(md);
addMemberToList(MemberList::decVarMembers,md);
//if (sortBriefDocs)
// decVarMembers.inSort(md);
//else
// decVarMembers.append(md);
addMemberToList(MemberList::docVarMembers,md);
//if (sortBriefDocs)
// docVarMembers.inSort(md);
//else
// docVarMembers.append(md);
break;
case MemberDef::Function:
if (sortBriefDocs)
decFuncMembers.inSort(md);
else
decFuncMembers.append(md);
if (sortBriefDocs)
docFuncMembers.inSort(md);
else
docFuncMembers.append(md);
addMemberToList(MemberList::decFuncMembers,md);
//if (sortBriefDocs)
// decFuncMembers.inSort(md);
//else
// decFuncMembers.append(md);
addMemberToList(MemberList::docFuncMembers,md);
//if (sortBriefDocs)
// docFuncMembers.inSort(md);
//else
// docFuncMembers.append(md);
break;
case MemberDef::Typedef:
if (sortBriefDocs)
decTypedefMembers.inSort(md);
else
decTypedefMembers.append(md);
if (sortBriefDocs)
docTypedefMembers.inSort(md);
else
docTypedefMembers.append(md);
addMemberToList(MemberList::decTypedefMembers,md);
//if (sortBriefDocs)
// decTypedefMembers.inSort(md);
//else
// decTypedefMembers.append(md);
addMemberToList(MemberList::docTypedefMembers,md);
//if (sortBriefDocs)
// docTypedefMembers.inSort(md);
//else
// docTypedefMembers.append(md);
break;
case MemberDef::Enumeration:
if (sortBriefDocs)
decEnumMembers.inSort(md);
else
decEnumMembers.append(md);
if (sortBriefDocs)
docEnumMembers.inSort(md);
else
docEnumMembers.append(md);
addMemberToList(MemberList::decEnumMembers,md);
//if (sortBriefDocs)
// decEnumMembers.inSort(md);
//else
// decEnumMembers.append(md);
addMemberToList(MemberList::docEnumMembers,md);
//if (sortBriefDocs)
// docEnumMembers.inSort(md);
//else
// docEnumMembers.append(md);
break;
case MemberDef::EnumValue:
break;
case MemberDef::Prototype:
if (sortBriefDocs)
decProtoMembers.inSort(md);
else
decProtoMembers.append(md);
if (sortBriefDocs)
docProtoMembers.inSort(md);
else
docProtoMembers.append(md);
addMemberToList(MemberList::decProtoMembers,md);
//if (sortBriefDocs)
// decProtoMembers.inSort(md);
//else
// decProtoMembers.append(md);
addMemberToList(MemberList::docProtoMembers,md);
//if (sortBriefDocs)
// docProtoMembers.inSort(md);
//else
// docProtoMembers.append(md);
break;
case MemberDef::Define:
if (sortBriefDocs)
decDefineMembers.inSort(md);
else
decDefineMembers.append(md);
if (sortBriefDocs)
docDefineMembers.inSort(md);
else
docDefineMembers.append(md);
addMemberToList(MemberList::decDefineMembers,md);
//if (sortBriefDocs)
// decDefineMembers.inSort(md);
//else
// decDefineMembers.append(md);
addMemberToList(MemberList::docDefineMembers,md);
//if (sortBriefDocs)
// docDefineMembers.inSort(md);
//else
// docDefineMembers.append(md);
break;
default:
err("NamespaceDef::insertMembers(): "
......@@ -228,7 +261,7 @@ void NamespaceDef::insertMember(MemberDef *md)
void NamespaceDef::computeAnchors()
{
setAnchors(0,'a',&allMemberList);
setAnchors(0,'a',allMemberList);
}
void NamespaceDef::writeDetailedDocumentation(OutputList &ol)
......@@ -347,13 +380,18 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
mg->writeDeclarations(ol,0,this,0,0);
}
//allMemberList.writeDeclarations(ol,0,this,0,0,0,0);
decDefineMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trDefines(),0);
decProtoMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trFuncProtos(),0);
decTypedefMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trTypedefs(),0);
decEnumMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trEnumerations(),0);
decFuncMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trFunctions(),0);
decVarMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trVariables(),0);
writeMemberDeclarations(ol,MemberList::decDefineMembers,theTranslator->trDefines());
//decDefineMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trDefines(),0);
writeMemberDeclarations(ol,MemberList::decProtoMembers,theTranslator->trFuncProtos());
//decProtoMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trFuncProtos(),0);
writeMemberDeclarations(ol,MemberList::decTypedefMembers,theTranslator->trTypedefs());
//decTypedefMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trTypedefs(),0);
writeMemberDeclarations(ol,MemberList::decEnumMembers,theTranslator->trEnumerations());
//decEnumMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trEnumerations(),0);
writeMemberDeclarations(ol,MemberList::decFuncMembers,theTranslator->trFunctions());
//decFuncMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trFunctions(),0);
writeMemberDeclarations(ol,MemberList::decVarMembers,theTranslator->trVariables());
//decVarMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trVariables(),0);
ol.endMemberSections();
if (!Config_getBool("DETAILS_AT_TOP"))
......@@ -382,7 +420,7 @@ void NamespaceDef::writeDocumentation(OutputList &ol)
if (Config_getBool("SEPARATE_MEMBER_PAGES"))
{
allMemberList.sort();
allMemberList->sort();
writeMemberPages(ol);
}
}
......@@ -394,23 +432,29 @@ void NamespaceDef::writeMemberDocumentation(OutputList &ol)
ol.disable(OutputGenerator::Html);
}
docDefineMembers.writeDocumentation(ol,name(),this,
theTranslator->trDefineDocumentation());
writeMemberDocumentation(ol,MemberList::docDefineMembers,theTranslator->trDefineDocumentation());
//docDefineMembers.writeDocumentation(ol,name(),this,
// theTranslator->trDefineDocumentation());
docProtoMembers.writeDocumentation(ol,name(),this,
theTranslator->trFunctionPrototypeDocumentation());
writeMemberDocumentation(ol,MemberList::docProtoMembers,theTranslator->trFunctionPrototypeDocumentation());
//docProtoMembers.writeDocumentation(ol,name(),this,
// theTranslator->trFunctionPrototypeDocumentation());
docTypedefMembers.writeDocumentation(ol,name(),this,
theTranslator->trTypedefDocumentation());
writeMemberDocumentation(ol,MemberList::docTypedefMembers,theTranslator->trTypedefDocumentation());
//docTypedefMembers.writeDocumentation(ol,name(),this,
// theTranslator->trTypedefDocumentation());
docEnumMembers.writeDocumentation(ol,name(),this,
theTranslator->trEnumerationTypeDocumentation());
writeMemberDocumentation(ol,MemberList::docEnumMembers,theTranslator->trEnumerationTypeDocumentation());
//docEnumMembers.writeDocumentation(ol,name(),this,
// theTranslator->trEnumerationTypeDocumentation());
docFuncMembers.writeDocumentation(ol,name(),this,
theTranslator->trFunctionDocumentation());
writeMemberDocumentation(ol,MemberList::docFuncMembers,theTranslator->trFunctionDocumentation());
//docFuncMembers.writeDocumentation(ol,name(),this,
// theTranslator->trFunctionDocumentation());
docVarMembers.writeDocumentation(ol,name(),this,
theTranslator->trVariableDocumentation());
writeMemberDocumentation(ol,MemberList::docVarMembers,theTranslator->trVariableDocumentation());
//docVarMembers.writeDocumentation(ol,name(),this,
// theTranslator->trVariableDocumentation());
if (Config_getBool("SEPARATE_MEMBER_PAGES"))
{
......@@ -423,12 +467,23 @@ void NamespaceDef::writeMemberPages(OutputList &ol)
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::documentationLists)
{
ml->writeDocumentationPage(ol,name(),this);
}
}
#if 0
docDefineMembers.writeDocumentationPage(ol,name(),this);
docProtoMembers.writeDocumentationPage(ol,name(),this);
docTypedefMembers.writeDocumentationPage(ol,name(),this);
docEnumMembers.writeDocumentationPage(ol,name(),this);
docFuncMembers.writeDocumentationPage(ol,name(),this);
docVarMembers.writeDocumentationPage(ol,name(),this);
#endif
ol.popGeneratorState();
}
......@@ -440,7 +495,7 @@ void NamespaceDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) co
ol.writeString(" <div class=\"navtab\">\n");
ol.writeString(" <table>\n");
MemberListIterator mli(allMemberList);
MemberListIterator mli(*allMemberList);
MemberDef *md;
for (mli.toFirst();(md=mli.current());++mli)
{
......@@ -474,8 +529,8 @@ void NamespaceDef::writeQuickMemberLinks(OutputList &ol,MemberDef *currentMd) co
int NamespaceDef::countMembers()
{
allMemberList.countDocMembers();
return allMemberList.numDocMembers()+classSDict->count();
allMemberList->countDocMembers();
return allMemberList->numDocMembers()+classSDict->count();
}
void NamespaceDef::addUsingDirective(NamespaceDef *nd)
......@@ -544,12 +599,23 @@ void NamespaceDef::addListReferences()
{
mg->addListReferences(this);
}
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()&MemberList::documentationLists)
{
ml->addListReferences(this);
}
}
#if 0
docDefineMembers.addListReferences(this);
docProtoMembers.addListReferences(this);
docTypedefMembers.addListReferences(this);
docEnumMembers.addListReferences(this);
docFuncMembers.addListReferences(this);
docVarMembers.addListReferences(this);
#endif
}
QCString NamespaceDef::displayName() const
......@@ -669,3 +735,74 @@ void NamespaceSDict::writeDeclaration(OutputList &ol,bool localName)
ol.endMemberList();
}
MemberList *NamespaceDef::createMemberList(MemberList::ListType lt)
{
m_memberLists.setAutoDelete(TRUE);
QListIterator<MemberList> mli(m_memberLists);
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if (ml->listType()==lt)
{
return ml;
}
}
// not found, create a new member list
ml = new MemberList(lt);
m_memberLists.append(ml);
return ml;
}
void NamespaceDef::addMemberToList(MemberList::ListType lt,MemberDef *md)
{
static bool sortBriefDocs = Config_getBool("SORT_BRIEF_DOCS");
static bool sortMemberDocs = Config_getBool("SORT_MEMBER_DOCS");
MemberList *ml = createMemberList(lt);
if (((ml->listType()&MemberList::declarationLists) && sortBriefDocs) ||
((ml->listType()&MemberList::documentationLists) && sortMemberDocs)
)
ml->inSort(md);
else
ml->append(md);
}
MemberList *NamespaceDef::getMemberList(MemberList::ListType lt) const
{
NamespaceDef *that = (NamespaceDef*)this;
MemberList *ml = that->m_memberLists.first();
while (ml)
{
if (ml->listType()==lt)
{
return ml;
}
ml = that->m_memberLists.next();
}
return 0;
}
void NamespaceDef::writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDeclarations(ol,0,this,0,0,title,0);
}
void NamespaceDef::writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title)
{
MemberList * ml = getMemberList(lt);
if (ml) ml->writeDocumentation(ol,name(),this,title);
}
bool NamespaceDef::isLinkableInProject() const
{
int i = name().findRev("::");
if (i==-1) i=0; else i+=2;
return !name().isEmpty() && name().at(i)!='@' &&
hasDocumentation() && !isReference() && !isHidden();
}
bool NamespaceDef::isLinkable() const
{
return isLinkableInProject() || isReference();
}
......@@ -64,17 +64,8 @@ class NamespaceDef : public Definition
void combineUsingRelations();
QCString displayName() const;
bool isLinkableInProject() const
{
int i = name().findRev("::");
if (i==-1) i=0; else i+=2;
return !name().isEmpty() && name().at(i)!='@' &&
hasDocumentation() && !isReference() && !isHidden();
}
bool isLinkable() const
{
return isLinkableInProject() || isReference();
}
bool isLinkableInProject() const;
bool isLinkable() const;
void addMembersToMemberGroup();
void distributeMemberGroupDocumentation();
void findSectionsInDocumentation();
......@@ -83,49 +74,38 @@ class NamespaceDef : public Definition
void addInnerCompound(Definition *d);
void addListReferences();
//protected:
// void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
MemberList *getMemberList(MemberList::ListType lt) const;
const QList<MemberList> &getMemberLists() const { return m_memberLists; }
public:
/*! Returns the user defined member groups */
MemberGroupSDict *getMemberGroupSDict() const { return memberGroupSDict; }
// members in the declaration part of the documentation
MemberList decDefineMembers;
MemberList decProtoMembers;
MemberList decTypedefMembers;
MemberList decEnumMembers;
MemberList decFuncMembers;
MemberList decVarMembers;
// members in the documentation part of the documentation
MemberList docAllMemberList;
MemberList docDefineMembers;
MemberList docProtoMembers;
MemberList docTypedefMembers;
MemberList docEnumMembers;
MemberList docFuncMembers;
MemberList docVarMembers;
/* user defined member groups */
MemberGroupSDict *memberGroupSDict;
/*! Returns the classes contained in this namespace */
ClassSDict *getClassSDict() const { return classSDict; }
/*! Classes inside this namespace */
ClassSDict *classSDict;
/*! Namespaces inside this namespace */
NamespaceSDict *namespaceSDict;
/*! Returns the namespaces contained in this namespace */
NamespaceSDict *getNamespaceSDict() const { return namespaceSDict; }
bool visited;
private:
//QCString reference;
MemberList *createMemberList(MemberList::ListType lt);
void addMemberToList(MemberList::ListType lt,MemberDef *md);
void writeMemberDeclarations(OutputList &ol,MemberList::ListType lt,const QCString &title);
void writeMemberDocumentation(OutputList &ol,MemberList::ListType lt,const QCString &title);
QCString fileName;
QStrList files;
NamespaceSDict *usingDirList;
SDict<Definition> *usingDeclList;
SDict<Definition> *m_innerCompounds;
MemberList allMemberList;
MemberList *allMemberList;
QList<MemberList> m_memberLists;
MemberGroupSDict *memberGroupSDict;
ClassSDict *classSDict;
NamespaceSDict *namespaceSDict;
};
......
......@@ -36,6 +36,7 @@ class DotGroupCollaboration;
class DocNode;
class MemberDef;
class GroupDef;
class Definition;
/*! \brief Output interface for code parser.
*/
......@@ -69,6 +70,8 @@ class CodeOutputInterface
virtual void startFontClass(const char *) = 0;
virtual void endFontClass() = 0;
virtual void writeCodeAnchor(const char *name) = 0;
virtual void linkableSymbol(int line,const char *symName,
Definition *symDef,Definition *context) = 0;
};
/*! \brief Base Interface used for generating output outside of the
......
......@@ -391,6 +391,7 @@ class OutputList : public OutputDocInterface
og=outputs->next();
}
}
void linkableSymbol(int,const char *,Definition *,Definition *) {}
private:
void debug();
......
......@@ -1690,34 +1690,34 @@ void PerlModGenerator::generatePerlModForClass(ClassDef *cd)
addTemplateList(cd,m_output);
addListOfAllMembers(cd);
MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict);
MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
generatePerlModSection(cd,mg->members(),"user_defined",mg->header());
generatePerlModSection(cd,cd->pubTypes,"public_typedefs");
generatePerlModSection(cd,cd->pubMethods,"public_methods");
generatePerlModSection(cd,cd->pubAttribs,"public_members");
generatePerlModSection(cd,cd->pubSlots,"public_slots");
generatePerlModSection(cd,cd->signals,"signals");
generatePerlModSection(cd,cd->dcopMethods,"dcop_methods");
generatePerlModSection(cd,cd->properties,"properties");
generatePerlModSection(cd,cd->pubStaticMethods,"public_static_methods");
generatePerlModSection(cd,cd->pubStaticAttribs,"public_static_members");
generatePerlModSection(cd,cd->proTypes,"protected_typedefs");
generatePerlModSection(cd,cd->proMethods,"protected_methods");
generatePerlModSection(cd,cd->proAttribs,"protected_members");
generatePerlModSection(cd,cd->proSlots,"protected_slots");
generatePerlModSection(cd,cd->proStaticMethods,"protected_static_methods");
generatePerlModSection(cd,cd->proStaticAttribs,"protected_static_members");
generatePerlModSection(cd,cd->priTypes,"private_typedefs");
generatePerlModSection(cd,cd->priMethods,"private_methods");
generatePerlModSection(cd,cd->priAttribs,"private_members");
generatePerlModSection(cd,cd->priSlots,"private_slots");
generatePerlModSection(cd,cd->priStaticMethods,"private_static_methods");
generatePerlModSection(cd,cd->priStaticAttribs,"private_static_members");
generatePerlModSection(cd,cd->friends,"friend_methods");
generatePerlModSection(cd,cd->related,"related_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::pubTypes),"public_typedefs");
generatePerlModSection(cd,cd->getMemberList(MemberList::pubMethods),"public_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::pubAttribs),"public_members");
generatePerlModSection(cd,cd->getMemberList(MemberList::pubSlots),"public_slots");
generatePerlModSection(cd,cd->getMemberList(MemberList::signals),"signals");
generatePerlModSection(cd,cd->getMemberList(MemberList::dcopMethods),"dcop_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::properties),"properties");
generatePerlModSection(cd,cd->getMemberList(MemberList::pubStaticMethods),"public_static_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::pubStaticAttribs),"public_static_members");
generatePerlModSection(cd,cd->getMemberList(MemberList::proTypes),"protected_typedefs");
generatePerlModSection(cd,cd->getMemberList(MemberList::proMethods),"protected_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::proAttribs),"protected_members");
generatePerlModSection(cd,cd->getMemberList(MemberList::proSlots),"protected_slots");
generatePerlModSection(cd,cd->getMemberList(MemberList::proStaticMethods),"protected_static_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::proStaticAttribs),"protected_static_members");
generatePerlModSection(cd,cd->getMemberList(MemberList::priTypes),"private_typedefs");
generatePerlModSection(cd,cd->getMemberList(MemberList::priMethods),"private_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::priAttribs),"private_members");
generatePerlModSection(cd,cd->getMemberList(MemberList::priSlots),"private_slots");
generatePerlModSection(cd,cd->getMemberList(MemberList::priStaticMethods),"private_static_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::priStaticAttribs),"private_static_members");
generatePerlModSection(cd,cd->getMemberList(MemberList::friends),"friend_methods");
generatePerlModSection(cd,cd->getMemberList(MemberList::related),"related_methods");
addPerlModDocBlock(m_output,"brief",cd->getDefFileName(),cd->getDefLine(),cd,0,cd->briefDescription());
addPerlModDocBlock(m_output,"detailed",cd->getDefFileName(),cd->getDefLine(),cd,0,cd->documentation());
......@@ -1767,7 +1767,7 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd)
m_output.openHash()
.addFieldQuotedString("name", nd->name());
ClassSDict *cl = nd->classSDict;
ClassSDict *cl = nd->getClassSDict();
if (cl)
{
m_output.openList("classes");
......@@ -1780,7 +1780,7 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd)
m_output.closeList();
}
NamespaceSDict *nl = nd->namespaceSDict;
NamespaceSDict *nl = nd->getNamespaceSDict();
if (nl)
{
m_output.openList("namespaces");
......@@ -1793,17 +1793,17 @@ void PerlModGenerator::generatePerlModForNamespace(NamespaceDef *nd)
m_output.closeList();
}
MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict);
MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
generatePerlModSection(nd,mg->members(),"user-defined",mg->header());
generatePerlModSection(nd,&nd->decDefineMembers,"defines");
generatePerlModSection(nd,&nd->decProtoMembers,"prototypes");
generatePerlModSection(nd,&nd->decTypedefMembers,"typedefs");
generatePerlModSection(nd,&nd->decEnumMembers,"enums");
generatePerlModSection(nd,&nd->decFuncMembers,"functions");
generatePerlModSection(nd,&nd->decVarMembers,"variables");
generatePerlModSection(nd,nd->getMemberList(MemberList::decDefineMembers),"defines");
generatePerlModSection(nd,nd->getMemberList(MemberList::decProtoMembers),"prototypes");
generatePerlModSection(nd,nd->getMemberList(MemberList::decTypedefMembers),"typedefs");
generatePerlModSection(nd,nd->getMemberList(MemberList::decEnumMembers),"enums");
generatePerlModSection(nd,nd->getMemberList(MemberList::decFuncMembers),"functions");
generatePerlModSection(nd,nd->getMemberList(MemberList::decVarMembers),"variables");
addPerlModDocBlock(m_output,"brief",nd->getDefFileName(),nd->getDefLine(),0,0,nd->briefDescription());
addPerlModDocBlock(m_output,"detailed",nd->getDefFileName(),nd->getDefLine(),0,0,nd->documentation());
......@@ -1867,12 +1867,12 @@ void PerlModGenerator::generatePerlModForFile(FileDef *fd)
}
m_output.closeList();
generatePerlModSection(fd,fd->decDefineMembers,"defines");
generatePerlModSection(fd,fd->decProtoMembers,"prototypes");
generatePerlModSection(fd,fd->decTypedefMembers,"typedefs");
generatePerlModSection(fd,fd->decEnumMembers,"enums");
generatePerlModSection(fd,fd->decFuncMembers,"functions");
generatePerlModSection(fd,fd->decVarMembers,"variables");
generatePerlModSection(fd,fd->getMemberList(MemberList::decDefineMembers),"defines");
generatePerlModSection(fd,fd->getMemberList(MemberList::decProtoMembers),"prototypes");
generatePerlModSection(fd,fd->getMemberList(MemberList::decTypedefMembers),"typedefs");
generatePerlModSection(fd,fd->getMemberList(MemberList::decEnumMembers),"enums");
generatePerlModSection(fd,fd->getMemberList(MemberList::decFuncMembers),"functions");
generatePerlModSection(fd,fd->getMemberList(MemberList::decVarMembers),"variables");
addPerlModDocBlock(m_output,"brief",fd->getDefFileName(),fd->getDefLine(),0,0,fd->briefDescription());
addPerlModDocBlock(m_output,"detailed",fd->getDefFileName(),fd->getDefLine(),0,0,fd->documentation());
......@@ -1965,17 +1965,17 @@ void PerlModGenerator::generatePerlModForGroup(GroupDef *gd)
m_output.closeList();
}
MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict);
MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict());
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
generatePerlModSection(gd,mg->members(),"user-defined",mg->header());
generatePerlModSection(gd,&gd->decDefineMembers,"defines");
generatePerlModSection(gd,&gd->decProtoMembers,"prototypes");
generatePerlModSection(gd,&gd->decTypedefMembers,"typedefs");
generatePerlModSection(gd,&gd->decEnumMembers,"enums");
generatePerlModSection(gd,&gd->decFuncMembers,"functions");
generatePerlModSection(gd,&gd->decVarMembers,"variables");
generatePerlModSection(gd,gd->getMemberList(MemberList::decDefineMembers),"defines");
generatePerlModSection(gd,gd->getMemberList(MemberList::decProtoMembers),"prototypes");
generatePerlModSection(gd,gd->getMemberList(MemberList::decTypedefMembers),"typedefs");
generatePerlModSection(gd,gd->getMemberList(MemberList::decEnumMembers),"enums");
generatePerlModSection(gd,gd->getMemberList(MemberList::decFuncMembers),"functions");
generatePerlModSection(gd,gd->getMemberList(MemberList::decVarMembers),"variables");
addPerlModDocBlock(m_output,"brief",gd->getDefFileName(),gd->getDefLine(),0,0,gd->briefDescription());
addPerlModDocBlock(m_output,"detailed",gd->getDefFileName(),gd->getDefLine(),0,0,gd->documentation());
......
......@@ -28,5 +28,6 @@ void initPreprocessor();
void cleanUpPreprocessor();
void addSearchDir(const char *dir);
void preprocessFile(const char *fileName,BufStr &output);
void preFreeScanner();
#endif
......@@ -105,6 +105,7 @@ static int g_condCtx;
static bool g_skip;
static QStack<bool> g_condStack;
static bool g_lexInit = FALSE;
static void setFileName(const char *name)
......@@ -2377,6 +2378,7 @@ void preprocessFile(const char *fileName,BufStr &output)
g_guardExpr.resize(0);
preYYlex();
g_lexInit=TRUE;
if (inputFilter.isEmpty())
fclose(preYYin);
else
......@@ -2399,6 +2401,16 @@ void preprocessFile(const char *fileName,BufStr &output)
}
}
void preFreeScanner()
{
#if defined(YY_FLEX_SUBMINOR_VERSION)
if (g_lexInit)
{
preYYlex_destroy();
}
#endif
}
#if !defined(YY_FLEX_SUBMINOR_VERSION)
extern "C" { // some bogus code to keep the compiler happy
// int preYYwrap() { return 1 ; }
......
......@@ -715,22 +715,8 @@ static void generateFunctionLink(CodeOutputInterface &ol,char *funcName)
return;
}
static void findMemberLink(CodeOutputInterface &ol,char *symName)
static void findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *symName)
{
//printf("Member reference: %s scope=%s member=%s\n",
// yytext,
// g_currentDefinition?g_currentDefinition->name().data():"<none>",
// g_currentMemberDef?g_currentMemberDef->name().data():"<none>"
// );
if (g_currentDefinition)
{
DefinitionList *dl = Doxygen::symbolMap->find(symName);
if (dl)
{
DefinitionListIterator dli(*dl);
Definition *sym;
for (dli.toFirst();(sym=dli.current());++dli)
{
//printf("sym %s outerScope=%s equal=%d\n",
// sym->name().data(),sym->getOuterScope()->name().data(),
// sym->getOuterScope()==g_currentDefinition);
......@@ -755,10 +741,32 @@ static void findMemberLink(CodeOutputInterface &ol,char *symName)
sym->getOutputFileBase(),
anchor,
symName);
return;
}
}
}
static void findMemberLink(CodeOutputInterface &ol,char *symName)
{
//printf("Member reference: %s scope=%s member=%s\n",
// yytext,
// g_currentDefinition?g_currentDefinition->name().data():"<none>",
// g_currentMemberDef?g_currentMemberDef->name().data():"<none>"
// );
if (g_currentDefinition)
{
DefinitionIntf *di = Doxygen::symbolMap->find(symName);
if (di->definitionType()==DefinitionIntf::TypeSymbolList) // multiple symbols
{
DefinitionListIterator dli(*(DefinitionList*)di);
Definition *sym;
for (dli.toFirst();(sym=dli.current());++dli)
{
findMemberLink(ol,sym,symName);
}
}
else // single symbol
{
findMemberLink(ol,(Definition*)di,symName);
}
}
//printf("sym %s not found\n",&yytext[5]);
......
......@@ -54,4 +54,6 @@ class PythonLanguageScanner : public ParserInterface
void parsePrototype(const char *text);
};
void pyscanFreeScanner();
#endif
......@@ -108,6 +108,9 @@ static bool g_hideClassDocs;
static QCString g_defVal;
static int g_braceCount;
static bool g_lexInit = FALSE;
//-----------------------------------------------------------------------------
......@@ -1060,7 +1063,7 @@ STARTDOCSYMS ^{B}"##"/[^#]
<VariableDec>{
"=" { // the assignment operator
printf("====== VariableDec at line %d\n",yyLineNr);
//printf("====== VariableDec at line %d\n",yyLineNr);
}
{B} { // spaces
}
......@@ -1415,6 +1418,7 @@ static void parseCompounds(Entry *rt)
groupEnterCompound(yyFileName,yyLineNr,ce->name);
pyscanYYlex() ;
g_lexInit=TRUE;
delete current; current=0;
ce->program.resize(0);
......@@ -1481,6 +1485,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
pyscanYYrestart( pyscanYYin );
BEGIN( Search );
pyscanYYlex();
g_lexInit=TRUE;
groupLeaveFile(yyFileName,yyLineNr);
......@@ -1527,6 +1532,7 @@ static void parsePrototype(const QCString &text)
BEGIN( FunctionDec );
pyscanYYlex();
g_lexInit=TRUE;
current->name = current->name.stripWhiteSpace();
if (current->section == Entry::MEMBERDOC_SEC && current->args.isEmpty())
......@@ -1544,6 +1550,16 @@ static void parsePrototype(const QCString &text)
//printf("**** parsePrototype end\n");
}
void pyscanFreeScanner()
{
#if defined(YY_FLEX_SUBMINOR_VERSION)
if (g_lexInit)
{
pyscanYYlex_destroy();
}
#endif
}
//----------------------------------------------------------------------------
void PythonLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root)
......
......@@ -270,6 +270,7 @@ class RTFGenerator : public OutputGenerator
//void endSectionRefList() {}
void writeCodeAnchor(const char *) {}
void linkableSymbol(int,const char *,Definition *,Definition *) {}
static bool preProcessFileInplace(const char *path,const char *name);
......
......@@ -49,4 +49,6 @@ class CLanguageScanner : public ParserInterface
void parsePrototype(const char *text);
};
void scanFreeScanner();
#endif
......@@ -84,6 +84,7 @@ static Entry* tempEntry = 0 ;
static Entry* firstTypedefEntry = 0 ;
static int yyLineNr = 1 ;
static int anonCount = 0 ;
static int anonNSCount = 0 ;
static QCString yyFileName;
static MethodTypes mtype;
static bool gstat;
......@@ -157,6 +158,8 @@ static char docBlockTerm;
static QCString idlAttr;
static QCString idlProp;
static bool g_lexInit = FALSE;
//-----------------------------------------------------------------------------
......@@ -559,6 +562,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
%x DefineEnd
%x CompoundName
%x ClassVar
%x CSConstraint
%x ClassCategory
%x ClassTemplSpec
%x Bases
......@@ -1873,7 +1877,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}".*"*/" {
closeGroup(current,yyFileName,yyLineNr);
}
<FindMembers>"=" {
<FindMembers>"=" { // in PHP code this could also be due to "<?="
current->bodyLine = yyLineNr;
lastInitializerContext = YY_START;
initBracketCount=0;
......@@ -2000,6 +2004,12 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
<SkipVerbString>. {
*pSkipVerbString+=*yytext;
}
<ReadInitializer>"?>" {
if (insidePHP)
BEGIN( FindMembersPHP );
else
current->initializer+=yytext;
}
<ReadInitializer>. {
current->initializer+=*yytext;
}
......@@ -3477,6 +3487,23 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
}
}
}
<SkipCurlyEndDoc>"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { // desc is followed by another one
docBlockContext = SkipCurlyEndDoc;
docBlockInBody = FALSE;
docBlockJavaStyle = yytext[yyleng-2]=='*' && Config_getBool("JAVADOC_AUTOBRIEF");
docBlock.resize(0);
docBlockTerm = '}';
if (yytext[yyleng-3]=='/')
{
startCommentBlock(TRUE);
BEGIN( DocLine );
}
else
{
startCommentBlock(FALSE);
BEGIN( DocBlock );
}
}
<SkipCurlyEndDoc>"}" {
//addToBody("}");
current = tempEntry;
......@@ -3694,6 +3721,10 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
baseName.resize(0);
BEGIN( BasesProt ) ;
}
else if (insideCS && strcmp(yytext,"where")==0) // C# type contraint
{
BEGIN( CSConstraint );
}
else
{
if (current->section == Entry::ENUM_SEC)
......@@ -3703,6 +3734,11 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
current->type += ' ' ;
current->type += current->name ;
current->name = yytext ;
if (nameIsOperator(current->name))
{
BEGIN( Operator );
}
}
}
<ClassVar>[(\[] {
......@@ -3722,6 +3758,15 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
BEGIN( FindMembers );
}
}
<CSConstraint>"{" {
unput('{');
BEGIN( ClassVar );
}
<CSConstraint>\n {
yyLineNr++;
}
<CSConstraint>. {
}
<ClassCategory>{ID} {
current->name+=yytext;
}
......@@ -3791,9 +3836,16 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
current->startLine = yyLineNr ;
current->name = removeRedundantWhiteSpace(current->name);
if (current->name.isEmpty() && !isTypedef) // anonymous compound
{
if (current->section==Entry::NAMESPACE_SEC) // allow reopening of anonymous namespaces
{
current->name.sprintf("@%d",anonNSCount);
}
else
{
current->name.sprintf("@%d",anonCount++);
}
}
curlyCount=0;
if (current_root && // not a nested struct inside an @interface section
current_root->section!=Entry::INTERFACE_SEC &&
......@@ -4591,6 +4643,7 @@ static void parseCompounds(Entry *rt)
groupEnterCompound(yyFileName,yyLineNr,ce->name);
scanYYlex() ;
g_lexInit=TRUE;
//forceEndGroup();
groupLeaveCompound(yyFileName,yyLineNr,ce->name);
......@@ -4639,6 +4692,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
initParser();
groupEnterFile(yyFileName,yyLineNr);
current = new Entry;
//printf("current=%p current_root=%p\n",current,current_root);
int sec=guessSection(yyFileName);
if (sec)
{
......@@ -4659,6 +4713,7 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
}
scanYYlex();
g_lexInit=TRUE;
if (YY_START==Comment)
{
......@@ -4679,6 +4734,8 @@ static void parseMain(const char *fileName,const char *fileBuf,Entry *rt)
parseCompounds(rt);
inputFile.close();
anonNSCount++;
}
}
......@@ -4712,6 +4769,7 @@ static void parsePrototype(const QCString &text)
scanYYrestart( scanYYin );
BEGIN(Prototype);
scanYYlex();
g_lexInit=TRUE;
current->name = current->name.stripWhiteSpace();
if (current->section == Entry::MEMBERDOC_SEC && current->args.isEmpty())
......@@ -4728,6 +4786,16 @@ static void parsePrototype(const QCString &text)
//printf("**** parsePrototype end\n");
}
void scanFreeScanner()
{
#if defined(YY_FLEX_SUBMINOR_VERSION)
if (g_lexInit)
{
scanYYlex_destroy();
}
#endif
}
//static void handleGroupStartCommand(const char *header)
//{
// memberGroupHeader=header;
......@@ -4783,7 +4851,6 @@ void CLanguageScanner::parsePrototype(const char *text)
::parsePrototype(text);
}
//----------------------------------------------------------------------------
#if !defined(YY_FLEX_SUBMINOR_VERSION)
......
......@@ -1583,14 +1583,14 @@ class TranslatorRussian : public Translator
/*! This is used to introduce a caller (or called-by) graph */
virtual QCString trCallerGraph()
{
return " :";
return decode( " :" );
}
/*! This is used in the documentation of a file/namespace before the list
* of documentation blocks for enumeration values
*/
virtual QCString trEnumerationValueDocumentation()
{ return " "; }
{ return decode( " " ); }
};
......
......@@ -706,14 +706,16 @@ QCString substTypedef(Definition *scope,FileDef *fileScope,const QCString &name)
if (name.isEmpty()) return result;
// lookup scope fragment in the symbol map
DefinitionList *dl = Doxygen::symbolMap->find(name);
if (dl==0) return result; // no matches
DefinitionIntf *di = Doxygen::symbolMap->find(name);
if (di==0) return result; // no matches
MemberDef *bestMatch=0;
if (di->definitionType()==DefinitionIntf::TypeSymbolList) // multi symbols
{
// search for the best match
DefinitionListIterator dli(*dl);
DefinitionListIterator dli(*(DefinitionList*)di);
Definition *d;
int minDistance=10000; // init at "infinite"
MemberDef *bestMatch=0;
for (dli.toFirst();(d=dli.current());++dli) // foreach definition
{
// only look at members
......@@ -734,12 +736,45 @@ QCString substTypedef(Definition *scope,FileDef *fileScope,const QCString &name)
}
}
}
}
else if (di->definitionType()==DefinitionIntf::TypeMember) // single symbol
{
Definition *d = (Definition*)di;
// that are also typedefs
MemberDef *md = (MemberDef *)di;
if (md->isTypedef()) // d is a typedef
{
// test accessibility of typedef within scope.
int distance = isAccessibleFromWithExpScope(scope,fileScope,d,"");
if (distance!=-1) // definition is accessible
{
bestMatch = md;
}
}
}
if (bestMatch) result = bestMatch->typeString();
//printf("substTypedef(%s,%s)=%s\n",scope?scope->name().data():"<global>",
// name.data(),result.data());
return result;
}
static Definition *endOfPathIsUsedClass(SDict<Definition> *cl,const QCString &localName)
{
if (cl)
{
SDict<Definition>::Iterator cli(*cl);
Definition *cd;
for (cli.toFirst();(cd=cli.current());++cli)
{
if (cd->localName()==localName)
{
return cd;
}
}
}
return 0;
}
/*! Starting with scope \a start, the string \a path is interpreted as
* a part of a qualified scope name (e.g. A::B::C), and the scope is
* searched. If found the scope definition is returned, otherwise 0
......@@ -755,8 +790,25 @@ static Definition *followPath(Definition *start,FileDef *fileScope,const QCStrin
{
// try to resolve the part if it is a typedef
QCString qualScopePart = substTypedef(current,fileScope,path.mid(is,l));
current = current->findInnerCompound(qualScopePart);
if (current==0) break; // failed to follow the path
Definition *next = current->findInnerCompound(qualScopePart);
if (next==0) // failed to follow the path
{
if (current->definitionType()==Definition::TypeNamespace)
{
current = endOfPathIsUsedClass(
((NamespaceDef *)current)->getUsedClasses(),qualScopePart);
}
else if (current->definitionType()==Definition::TypeFile)
{
current = endOfPathIsUsedClass(
((FileDef *)current)->getUsedClasses(),qualScopePart);
}
if (current==0) break;
}
else // continue to follow scope
{
current = next;
}
ps=is+l;
}
//printf("followPath(start=%s,path=%s) result=%s\n",
......@@ -791,16 +843,34 @@ bool accessibleViaUsingNamespace(const NamespaceSDict *nl,
Definition *item,
const QCString &explicitScopePart="")
{
static QDict<void> visitedDict;
if (nl) // check used namespaces for the class
{
NamespaceSDict::Iterator nli(*nl);
NamespaceDef *und;
for (nli.toFirst();(und=nli.current());++nli)
{
//printf("Trying via used namespace %s\n",und->name().data());
//printf("[Trying via used namespace %s\n",und->name().data());
Definition *sc = explicitScopePart.isEmpty() ? und : followPath(und,fileScope,explicitScopePart);
if (sc && item->getOuterScope()==sc) return TRUE;
//printf("Try via used namespace done\n");
if (sc && item->getOuterScope()==sc)
{
//printf("] found it\n");
return TRUE;
}
QCString key=und->name();
if (und->getUsedNamespaces() && visitedDict.find(key)==0)
{
visitedDict.insert(key,(void *)0x08);
if (accessibleViaUsingNamespace(und->getUsedNamespaces(),fileScope,item,explicitScopePart))
{
//printf("] found it via recursion\n");
return TRUE;
}
visitedDict.remove(key);
}
//printf("] Try via used namespace done\n");
}
}
return FALSE;
......@@ -812,13 +882,17 @@ bool accessibleViaUsingNamespace(const NamespaceSDict *nl,
*/
int isAccessibleFrom(Definition *scope,FileDef *fileScope,Definition *item)
{
//fprintf(stderr,"<isAccesibleFrom(scope=%s,item=%s itemScope=%s)\n",
//printf("<isAccesibleFrom(scope=%s,item=%s itemScope=%s)\n",
// scope->name().data(),item->name().data(),item->getOuterScope()->name().data());
QCString key(40);
key.sprintf("%p:%p:%p",scope,fileScope,item);
static QDict<void> visitedDict;
if (visitedDict.find(key)) return -1; // already looked at this
if (visitedDict.find(key))
{
//printf("> already found\n");
return -1; // already looked at this
}
visitedDict.insert(key,(void *)0x8);
int result=0; // assume we found it
......@@ -826,7 +900,7 @@ int isAccessibleFrom(Definition *scope,FileDef *fileScope,Definition *item)
if (item->getOuterScope()==scope)
{
//fprintf(stderr,"> found it\n");
//printf("> found it\n");
}
else if (scope==Doxygen::globalScope)
{
......@@ -835,17 +909,17 @@ int isAccessibleFrom(Definition *scope,FileDef *fileScope,Definition *item)
SDict<Definition> *cl = fileScope->getUsedClasses();
if (accessibleViaUsingClass(cl,fileScope,item))
{
//fprintf(stderr,"> found via used class\n");
//printf("> found via used class\n");
goto done;
}
NamespaceSDict *nl = fileScope->getUsedNamespaces();
if (accessibleViaUsingNamespace(nl,fileScope,item))
{
//fprintf(stderr,"> found via used namespace\n");
//printf("> found via used namespace\n");
goto done;
}
}
//fprintf(stderr,"> reached global scope\n");
//printf("> reached global scope\n");
result=-1; // not found in path to globalScope
}
else // keep searching
......@@ -858,19 +932,19 @@ int isAccessibleFrom(Definition *scope,FileDef *fileScope,Definition *item)
SDict<Definition> *cl = nscope->getUsedClasses();
if (accessibleViaUsingClass(cl,fileScope,item))
{
//fprintf(stderr,"> found via used class\n");
//printf("> found via used class\n");
goto done;
}
NamespaceSDict *nl = nscope->getUsedNamespaces();
if (accessibleViaUsingNamespace(nl,fileScope,item))
{
//fprintf(stderr,"> found via used namespace\n");
//printf("> found via used namespace\n");
goto done;
}
}
// repeat for the parent scope
i=isAccessibleFrom(scope->getOuterScope(),fileScope,item);
//fprintf(stderr,"> result=%d\n",i);
//printf("> result=%d\n",i);
result= (i==-1) ? -1 : i+1;
}
done:
......@@ -930,10 +1004,9 @@ int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope,
for (cli.toFirst();(cd=cli.current());++cli)
{
//printf("Trying for class %s\n",cd->name().data());
i = isAccessibleFromWithExpScope(scope,fileScope,item,cd->name());
if (i!=-1)
if (cd==item)
{
//printf("> found via explicit scope of used class\n");
//printf("> class is used in this scope\n");
goto done;
}
}
......@@ -974,12 +1047,6 @@ int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope,
if (scope->definitionType()==Definition::TypeNamespace)
{
NamespaceDef *nscope = (NamespaceDef*)scope;
SDict<Definition> *cl = nscope->getUsedClasses();
if (accessibleViaUsingClass(cl,fileScope,item,explicitScopePart))
{
//printf("> found in used class\n");
goto done;
}
NamespaceSDict *nl = nscope->getUsedNamespaces();
if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart))
{
......@@ -991,12 +1058,6 @@ int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope,
{
if (fileScope)
{
SDict<Definition> *cl = fileScope->getUsedClasses();
if (accessibleViaUsingClass(cl,fileScope,item,explicitScopePart))
{
//printf("> found in used class\n");
goto done;
}
NamespaceSDict *nl = fileScope->getUsedNamespaces();
if (accessibleViaUsingNamespace(nl,fileScope,item,explicitScopePart))
{
......@@ -1014,6 +1075,19 @@ int isAccessibleFromWithExpScope(Definition *scope,FileDef *fileScope,
//printf("> result=%d\n",i);
result= (i==-1) ? -1 : i+1;
}
#if 0
if (scope!=Doxygen::globalScope)
{
int i=isAccessibleFromWithExpScope(scope->getOuterScope(),fileScope,
item,explicitScopePart);
//printf("> result=%d\n",i);
result= (i==-1) ? -1 : i+1;
}
else
{
result = -1;
}
#endif
}
done:
visitedDict.remove(key);
......@@ -1027,131 +1101,30 @@ int computeQualifiedIndex(const QCString &name)
return name.findRev("::",i==-1 ? name.length() : i);
}
/* Find the fully qualified class name refered to by the input class
* or typedef name against the input scope.
* Loops through scope and each of its parent scopes looking for a
* match against the input name. Can recursively call itself when
* resolving typedefs.
*/
ClassDef *getResolvedClassRec(Definition *scope,
void getResolvedSymbol(Definition *scope,
FileDef *fileScope,
const char *n,
MemberDef **pTypeDef,
QCString *pTemplSpec
Definition *d,
const QCString &explicitScopePart,
int &minDistance,
ClassDef *&bestMatch,
MemberDef *&bestTypedef,
QCString &bestTemplSpec
)
{
//printf("[getResolvedClassRec(%s,%s)\n",scope?scope->name().data():"<global>",n);
QCString name=n;
QCString explicitScopePart;
int qualifierIndex = computeQualifiedIndex(name);
//printf("name=%s qualifierIndex=%d\n",name.data(),qualifierIndex);
if (qualifierIndex!=-1) // qualified name
{
// split off the explicit scope part
explicitScopePart=name.left(qualifierIndex);
// todo: improve namespace alias substitution
replaceNamespaceAliases(explicitScopePart,explicitScopePart.length());
name=name.mid(qualifierIndex+2);
}
if (name.isEmpty())
{
//printf("] empty name\n");
return 0; // empty name
}
DefinitionList *dl = Doxygen::symbolMap->find(name);
//printf("Looking for symbol %s result=%p\n",name.data(),dl);
if (dl==0)
{
return 0;
}
bool hasUsingStatements =
(fileScope && ((fileScope->getUsedNamespaces() &&
fileScope->getUsedNamespaces()->count()>0) ||
(fileScope->getUsedClasses() &&
fileScope->getUsedClasses()->count()>0))
);
//printf("hasUsingStatements=%d\n",hasUsingStatements);
// Since it is often the case that the same name is searched in the same
// scope over an over again (especially for the linked source code generation)
// we use a cache to collect previous results. This is possible since the
// result of a lookup is deterministic. As the key we use the concatenated
// scope, the name to search for and the explicit scope prefix. The speedup
// achieved by this simple cache can be enormous.
int scopeNameLen = scope->name().length()+1;
int nameLen = name.length()+1;
int explicitPartLen = explicitScopePart.length();
int fileScopeLen = hasUsingStatements ? 1+fileScope->absFilePath().length() : 0;
// below is a more efficient coding of
// QCString key=scope->name()+"+"+name+"+"+explicitScopePart;
QCString key(scopeNameLen+nameLen+explicitPartLen+fileScopeLen+1);
char *p=key.data();
qstrcpy(p,scope->name()); *(p+scopeNameLen-1)='+';
p+=scopeNameLen;
qstrcpy(p,name); *(p+nameLen-1)='+';
p+=nameLen;
qstrcpy(p,explicitScopePart);
p+=explicitPartLen;
// if a file scope is given and it contains using statements we should
// also use the file part in the key (as a class name can be in
// two different namespaces and a using statement in a file can select
// one of them).
if (hasUsingStatements)
{
// below is a more efficient coding of
// key+="+"+fileScope->name();
*p++='+';
qstrcpy(p,fileScope->absFilePath());
p+=fileScopeLen-1;
}
*p='\0';
LookupInfo *pval=Doxygen::lookupCache.find(key);
//printf("Searching for %s result=%p\n",key.data(),pval);
if (pval)
{
if (pTemplSpec) *pTemplSpec=pval->templSpec;
if (pTypeDef) *pTypeDef=pval->typeDef;
//printf("] cachedMatch=%s\n",
// pval->classDef?pval->classDef->name().data():"<none>");
//if (pTemplSpec)
// printf("templSpec=%s\n",pTemplSpec->data());
return pval->classDef;
}
else // not found yet; we already add a 0 to avoid the possibility of
// endless recursion.
{
Doxygen::lookupCache.insert(key,new LookupInfo);
}
ClassDef *bestMatch=0;
//printf(" found %d symbol(s) with name %s\n",dl->count(),name.data());
// now we look int the list of Definitions and determine which one is the "best"
DefinitionListIterator dli(*dl);
Definition *d;
MemberDef *bestTypedef=0;
QCString bestTemplSpec;
int minDistance=10000; // init at "infinite"
int count=0;
for (dli.toFirst();(d=dli.current());++dli,++count) // foreach definition
{
//printf(" found type %x name=%s (%d/%d) d=%p\n",
// d->definitionType(),d->name().data(),count,dl->count(),d);
// only look at classes and members
if (d->definitionType()==Definition::TypeClass ||
d->definitionType()==Definition::TypeMember)
(d->definitionType()==Definition::TypeMember &&
(((MemberDef*)d)->isTypedef() || ((MemberDef*)d)->isEnumerate())
)
)
{
g_visitedNamespaces.clear();
// test accessibility of definition within scope.
int distance = isAccessibleFromWithExpScope(scope,fileScope,d,explicitScopePart);
//printf(" distance %s is %d\n",d->name().data(),distance);
//printf(" distance %s (%p) is %d\n",d->name().data(),d,distance);
if (distance!=-1) // definition is accessible
{
// see if we are dealing with a class or a typedef
......@@ -1193,6 +1166,10 @@ ClassDef *getResolvedClassRec(Definition *scope,
bestTemplSpec.resize(0);
}
}
else
{
//printf(" is a template argument!\n");
}
}
else if (d->definitionType()==Definition::TypeMember)
{
......@@ -1261,7 +1238,133 @@ ClassDef *getResolvedClassRec(Definition *scope,
//printf(" Not accessible!\n");
}
} // if definition is a class or member
} // foreach definition
}
/* Find the fully qualified class name refered to by the input class
* or typedef name against the input scope.
* Loops through scope and each of its parent scopes looking for a
* match against the input name. Can recursively call itself when
* resolving typedefs.
*/
ClassDef *getResolvedClassRec(Definition *scope,
FileDef *fileScope,
const char *n,
MemberDef **pTypeDef,
QCString *pTemplSpec
)
{
//printf("[getResolvedClassRec(%s,%s)\n",scope?scope->name().data():"<global>",n);
QCString name=n;
QCString explicitScopePart;
int qualifierIndex = computeQualifiedIndex(name);
//printf("name=%s qualifierIndex=%d\n",name.data(),qualifierIndex);
if (qualifierIndex!=-1) // qualified name
{
// split off the explicit scope part
explicitScopePart=name.left(qualifierIndex);
// todo: improve namespace alias substitution
replaceNamespaceAliases(explicitScopePart,explicitScopePart.length());
name=name.mid(qualifierIndex+2);
}
if (name.isEmpty())
{
//printf("] empty name\n");
return 0; // empty name
}
DefinitionIntf *di = Doxygen::symbolMap->find(name);
//printf("Looking for symbol %s result=%p\n",name.data(),dl);
if (di==0)
{
return 0;
}
bool hasUsingStatements =
(fileScope && ((fileScope->getUsedNamespaces() &&
fileScope->getUsedNamespaces()->count()>0) ||
(fileScope->getUsedClasses() &&
fileScope->getUsedClasses()->count()>0))
);
//printf("hasUsingStatements=%d\n",hasUsingStatements);
// Since it is often the case that the same name is searched in the same
// scope over an over again (especially for the linked source code generation)
// we use a cache to collect previous results. This is possible since the
// result of a lookup is deterministic. As the key we use the concatenated
// scope, the name to search for and the explicit scope prefix. The speedup
// achieved by this simple cache can be enormous.
int scopeNameLen = scope->name().length()+1;
int nameLen = name.length()+1;
int explicitPartLen = explicitScopePart.length();
int fileScopeLen = hasUsingStatements ? 1+fileScope->absFilePath().length() : 0;
// below is a more efficient coding of
// QCString key=scope->name()+"+"+name+"+"+explicitScopePart;
QCString key(scopeNameLen+nameLen+explicitPartLen+fileScopeLen+1);
char *p=key.data();
qstrcpy(p,scope->name()); *(p+scopeNameLen-1)='+';
p+=scopeNameLen;
qstrcpy(p,name); *(p+nameLen-1)='+';
p+=nameLen;
qstrcpy(p,explicitScopePart);
p+=explicitPartLen;
// if a file scope is given and it contains using statements we should
// also use the file part in the key (as a class name can be in
// two different namespaces and a using statement in a file can select
// one of them).
if (hasUsingStatements)
{
// below is a more efficient coding of
// key+="+"+fileScope->name();
*p++='+';
qstrcpy(p,fileScope->absFilePath());
p+=fileScopeLen-1;
}
*p='\0';
LookupInfo *pval=Doxygen::lookupCache.find(key);
//printf("Searching for %s result=%p\n",key.data(),pval);
if (pval)
{
if (pTemplSpec) *pTemplSpec=pval->templSpec;
if (pTypeDef) *pTypeDef=pval->typeDef;
//printf("] cachedMatch=%s\n",
// pval->classDef?pval->classDef->name().data():"<none>");
//if (pTemplSpec)
// printf("templSpec=%s\n",pTemplSpec->data());
return pval->classDef;
}
else // not found yet; we already add a 0 to avoid the possibility of
// endless recursion.
{
Doxygen::lookupCache.insert(key,new LookupInfo);
}
ClassDef *bestMatch=0;
MemberDef *bestTypedef=0;
QCString bestTemplSpec;
int minDistance=10000; // init at "infinite"
if (di->definitionType()==DefinitionIntf::TypeSymbolList)
{
DefinitionListIterator dli(*(DefinitionList*)di);
Definition *d;
int count=0;
for (dli.toFirst();(d=dli.current());++dli,++count) // foreach definition
{
getResolvedSymbol(scope,fileScope,d,explicitScopePart,
minDistance,bestMatch,bestTypedef,bestTemplSpec);
}
}
else
{
Definition *d = (Definition *)di;
getResolvedSymbol(scope,fileScope,d,explicitScopePart,
minDistance,bestMatch,bestTypedef,bestTemplSpec);
}
if (pTypeDef)
{
*pTypeDef = bestTypedef;
......@@ -1307,12 +1410,13 @@ ClassDef *getResolvedClass(Definition *scope,
if (scope==0 ||
(scope->definitionType()!=Definition::TypeClass &&
scope->definitionType()!=Definition::TypeNamespace
)
) ||
(fileScope && fileScope->isJava() && QCString(n).find("::")!=-1)
)
{
scope=Doxygen::globalScope;
}
//printf("getResolvedClass(scope=%s,file=%s,name=%s,mayUnlinkable=%d)\n",
//printf("------------ getResolvedClass(scope=%s,file=%s,name=%s,mayUnlinkable=%d)\n",
// scope?scope->name().data():"<global>",
// fileScope?fileScope->name().data():"<none>",
// n,
......@@ -2032,7 +2136,7 @@ static QCString trimTemplateSpecifiers(
const QCString &namespaceName,
const QCString &className,
const QCString &s
)
)
{
//printf("trimTemplateSpecifiers(%s,%s,%s)\n",namespaceName.data(),className.data(),s.data());
QCString scopeName=mergeScopes(namespaceName,className);
......@@ -3391,6 +3495,47 @@ bool getDefs(const QCString &scName,const QCString &memberName,
// unknown or undocumented scope
}
if (mn && scopeName.isEmpty() && mScope.isEmpty()) // Maybe a related function?
{
MemberListIterator mmli(*mn);
MemberDef *mmd, *fuzzy_mmd = 0;
ArgumentList *argList = 0;
bool hasEmptyArgs = args && strcmp(args, "()") == 0;
if (args)
stringToArgumentList(args, argList = new ArgumentList);
for (mmli.toFirst(); (mmd = mmli.current()); ++mmli)
{
if (!mmd->isLinkable() || !mmd->isRelated() || !mmd->getClassDef())
continue;
if (!args) break;
QCString className = mmd->getClassDef()->name();
if (matchArguments2(mmd->getOuterScope(),mmd->getFileDef(),mmd->argumentList(),
Doxygen::globalScope,mmd->getFileDef(),argList,
checkCV
)
) break;
if (!fuzzy_mmd && hasEmptyArgs)
fuzzy_mmd = mmd;
}
if (argList) delete argList, argList = 0;
mmd = mmd ? mmd : fuzzy_mmd;
if (mmd)
{
md = mmd;
cd = mmd->getClassDef();
return TRUE;
}
}
// maybe an namespace, file or group member ?
//printf("Testing for global function scopeName=`%s' mScope=`%s' :: mName=`%s'\n",
......@@ -5773,8 +5918,8 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
if (name.isEmpty())
return FALSE; // no name was given
DefinitionList *dl = Doxygen::symbolMap->find(name);
if (dl==0)
DefinitionIntf *di = Doxygen::symbolMap->find(name);
if (di==0)
return FALSE; // could not find any matching symbols
// mostly copied from getResolvedClassRec()
......@@ -5787,11 +5932,14 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
name = name.mid(qualifierIndex+2);
}
// find the closest closest matching definition
DefinitionListIterator dli(*dl);
Definition *d;
int minDistance = 10000;
MemberDef *bestMatch = 0;
if (di->definitionType()==DefinitionIntf::TypeSymbolList)
{
// find the closest closest matching definition
DefinitionListIterator dli(*(DefinitionList*)di);
Definition *d;
for (dli.toFirst();(d=dli.current());++dli)
{
if (d->definitionType()==Definition::TypeMember)
......@@ -5805,6 +5953,18 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
}
}
}
}
else if (di->definitionType()==Definition::TypeMember)
{
Definition *d = (Definition *)di;
g_visitedNamespaces.clear();
int distance = isAccessibleFromWithExpScope(scope,fileScope,d,explicitScopePart);
if (distance!=-1 && distance<minDistance)
{
minDistance = distance;
bestMatch = (MemberDef *)d;
}
}
if (bestMatch && bestMatch->isTypedef())
return TRUE; // closest matching symbol is a typedef
......
......@@ -39,6 +39,7 @@
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qintdict.h>
// no debug info
#define XML_DB(x) do {} while(0)
......@@ -61,6 +62,51 @@ static const char compound_xsd[] =
//------------------
class XmlSectionMapper : public QIntDict<char>
{
public:
XmlSectionMapper() : QIntDict<char>(47)
{
insert(MemberList::pubTypes,"public-type");
insert(MemberList::pubMethods,"public-func");
insert(MemberList::pubAttribs,"public-attrib");
insert(MemberList::pubSlots,"public-slot");
insert(MemberList::signals,"signal");
insert(MemberList::dcopMethods,"dcop-func");
insert(MemberList::properties,"property");
insert(MemberList::events,"event");
insert(MemberList::pubStaticMethods,"public-static-func");
insert(MemberList::pubStaticAttribs,"public-static-attrib");
insert(MemberList::proTypes,"protected-type");
insert(MemberList::proMethods,"protected-func");
insert(MemberList::proAttribs,"protected-attrib");
insert(MemberList::proSlots,"protected-slot");
insert(MemberList::proStaticMethods,"protected-static-func");
insert(MemberList::proStaticAttribs,"protected-static-attrib");
insert(MemberList::pacTypes,"package-type");
insert(MemberList::pacMethods,"package-func");
insert(MemberList::pacAttribs,"package-attrib");
insert(MemberList::pacStaticMethods,"package-static-func");
insert(MemberList::pacStaticAttribs,"package-static-attrib");
insert(MemberList::priTypes,"private-type");
insert(MemberList::priMethods,"private-func");
insert(MemberList::priAttribs,"private-attrib");
insert(MemberList::priSlots,"private-slot");
insert(MemberList::priStaticMethods,"private-static-func");
insert(MemberList::priStaticAttribs,"private-static-attrib");
insert(MemberList::friends,"friend");
insert(MemberList::related,"related");
insert(MemberList::decDefineMembers,"define");
insert(MemberList::decProtoMembers,"prototype");
insert(MemberList::decTypedefMembers,"typedef");
insert(MemberList::decEnumMembers,"enum");
insert(MemberList::decFuncMembers,"func");
insert(MemberList::decVarMembers,"var");
}
};
static XmlSectionMapper g_xmlSectionMapper;
inline void writeXMLString(QTextStream &t,const char *s)
{
......@@ -346,6 +392,10 @@ class XMLCodeGenerator : public CodeOutputInterface
if (extRef) m_external=extRef;
}
}
void linkableSymbol(int, const char *,Definition *,Definition *)
{
}
void finish()
{
if (m_insideCodeLine) endCodeLine();
......@@ -1192,9 +1242,9 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti)
writeInnerClasses(cd->getInnerClasses(),t);
writeTemplateList(cd,t);
if (cd->memberGroupSDict)
if (cd->getMemberGroupSDict())
{
MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict);
MemberGroupSDict::Iterator mgli(*cd->getMemberGroupSDict());
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
......@@ -1203,6 +1253,16 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti)
}
}
QListIterator<MemberList> mli(cd->getMemberLists());
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::detailedLists)==0)
{
generateXMLSection(cd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
#if 0
generateXMLSection(cd,ti,t,cd->pubTypes,"public-type");
generateXMLSection(cd,ti,t,cd->pubMethods,"public-func");
generateXMLSection(cd,ti,t,cd->pubAttribs,"public-attrib");
......@@ -1232,6 +1292,7 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti)
generateXMLSection(cd,ti,t,cd->priStaticAttribs,"private-static-attrib");
generateXMLSection(cd,ti,t,cd->friends,"friend");
generateXMLSection(cd,ti,t,cd->related,"related");
#endif
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,cd->briefFile(),cd->briefLine(),cd,0,cd->briefDescription());
......@@ -1311,12 +1372,12 @@ static void generateXMLForNamespace(NamespaceDef *nd,QTextStream &ti)
writeXMLString(t,nd->name());
t << "</compoundname>" << endl;
writeInnerClasses(nd->classSDict,t);
writeInnerNamespaces(nd->namespaceSDict,t);
writeInnerClasses(nd->getClassSDict(),t);
writeInnerNamespaces(nd->getNamespaceSDict(),t);
if (nd->memberGroupSDict)
if (nd->getMemberGroupSDict())
{
MemberGroupSDict::Iterator mgli(*nd->memberGroupSDict);
MemberGroupSDict::Iterator mgli(*nd->getMemberGroupSDict());
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
......@@ -1325,12 +1386,23 @@ static void generateXMLForNamespace(NamespaceDef *nd,QTextStream &ti)
}
}
QListIterator<MemberList> mli(nd->getMemberLists());
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::declarationLists)==0)
{
generateXMLSection(nd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
#if 0
generateXMLSection(nd,ti,t,&nd->decDefineMembers,"define");
generateXMLSection(nd,ti,t,&nd->decProtoMembers,"prototype");
generateXMLSection(nd,ti,t,&nd->decTypedefMembers,"typedef");
generateXMLSection(nd,ti,t,&nd->decEnumMembers,"enum");
generateXMLSection(nd,ti,t,&nd->decFuncMembers,"func");
generateXMLSection(nd,ti,t,&nd->decVarMembers,"var");
#endif
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,nd->briefFile(),nd->briefLine(),nd,0,nd->briefDescription());
......@@ -1437,18 +1509,18 @@ static void generateXMLForFile(FileDef *fd,QTextStream &ti)
t << " </invincdepgraph>" << endl;
}
if (fd->classSDict)
if (fd->getClassSDict())
{
writeInnerClasses(fd->classSDict,t);
writeInnerClasses(fd->getClassSDict(),t);
}
if (fd->namespaceSDict)
if (fd->getNamespaceSDict())
{
writeInnerNamespaces(fd->namespaceSDict,t);
writeInnerNamespaces(fd->getNamespaceSDict(),t);
}
if (fd->memberGroupSDict)
if (fd->getMemberGroupSDict())
{
MemberGroupSDict::Iterator mgli(*fd->memberGroupSDict);
MemberGroupSDict::Iterator mgli(*fd->getMemberGroupSDict());
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
......@@ -1457,12 +1529,23 @@ static void generateXMLForFile(FileDef *fd,QTextStream &ti)
}
}
QListIterator<MemberList> mli(fd->getMemberLists());
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::declarationLists)==0)
{
generateXMLSection(fd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
#if 0
generateXMLSection(fd,ti,t,fd->decDefineMembers,"define");
generateXMLSection(fd,ti,t,fd->decProtoMembers,"prototype");
generateXMLSection(fd,ti,t,fd->decTypedefMembers,"typedef");
generateXMLSection(fd,ti,t,fd->decEnumMembers,"enum");
generateXMLSection(fd,ti,t,fd->decFuncMembers,"func");
generateXMLSection(fd,ti,t,fd->decVarMembers,"var");
#endif
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,fd->briefFile(),fd->briefLine(),fd,0,fd->briefDescription());
......@@ -1525,9 +1608,9 @@ static void generateXMLForGroup(GroupDef *gd,QTextStream &ti)
writeInnerPages(gd->getPages(),t);
writeInnerGroups(gd->getSubGroups(),t);
if (gd->memberGroupSDict)
if (gd->getMemberGroupSDict())
{
MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict);
MemberGroupSDict::Iterator mgli(*gd->getMemberGroupSDict());
MemberGroup *mg;
for (;(mg=mgli.current());++mgli)
{
......@@ -1536,12 +1619,23 @@ static void generateXMLForGroup(GroupDef *gd,QTextStream &ti)
}
}
QListIterator<MemberList> mli(gd->getMemberLists());
MemberList *ml;
for (mli.toFirst();(ml=mli.current());++mli)
{
if ((ml->listType()&MemberList::declarationLists)==0)
{
generateXMLSection(gd,ti,t,ml,g_xmlSectionMapper.find(ml->listType()));
}
}
#if 0
generateXMLSection(gd,ti,t,&gd->decDefineMembers,"define");
generateXMLSection(gd,ti,t,&gd->decProtoMembers,"prototype");
generateXMLSection(gd,ti,t,&gd->decTypedefMembers,"typedef");
generateXMLSection(gd,ti,t,&gd->decEnumMembers,"enum");
generateXMLSection(gd,ti,t,&gd->decFuncMembers,"func");
generateXMLSection(gd,ti,t,&gd->decVarMembers,"var");
#endif
t << " <briefdescription>" << endl;
writeXMLDocBlock(t,gd->briefFile(),gd->briefLine(),gd,0,gd->briefDescription());
......
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